Can domain adaptation make object recognition work for everyone?

Despite the rapid progress in deep visual recognition, modern computer vision datasets significantly overrepresent the developed world and models trained on such datasets underperform on images from unseen geographies. We investigate the effectiveness of unsupervised domain adaptation (UDA) of such models across geographies at closing this performance gap. To do so, we first curate two shifts from existing datasets to study the Geographical DA problem, and discover new challenges beyond data distribution shift: context shift, wherein object surroundings may change significantly across geographies, and subpopulation shift, wherein the intra-category distributions may shift. We demonstrate the inefficacy of standard DA methods at Geographical DA, highlighting the need for specialized geographical adaptation solutions to address the challenge of making object recognition work for everyone.


Introduction
As deep-learning based computer vision systems gain widespread adoption, it is crucial that they perform equitably across diverse geographical deployments. However, prior work [1] has found that in practice modern computer vision datasets significantly overrepresent the developed world and models trained on such datasets systematically underperform on images from the rest of the world [2] (see Fig. 1). Labeling images from target geographies is a natural solution but may be expensive and difficult to scale. Unsupervised domain adaptation [3][4][5] (UDA) has extensively studied the problem of adapting models trained on a labeled source to an unlabeled target domain. However, UDA typically considers specific kinds of shifts in data generating distributions (e.g. synthetic to real data [6], or clipart to sketch images [7]), rather than distribution shifts across space and time in the real world. In this work, we investigate the effectiveness of UDA techniques at the practical application of adapting trained object recognition models to novel geographies. * Work done partially as intern at Salesforce Research. † Work done at Salesforce Research.

Train (North America)
Test (Rest of the world) label = "statue" Figure 1. Modern computer vision datasets overrepresent the developed world [1]. This leads object recognition models trained on them (left) to underperform on images from novel geographies [2] (right -we show country of origin and model prediction above each image). In this work we investigate the effectiveness of domain adaptation [3] methods in bridging this performance gap.
Geographical domain adaptation presents two novel challenges beyond shifting data distributions: context shift and subpopulation shift. Context shift arises from a change in visual context for a given category across geographies (e.g. predominantly indoor v/s outdoor basketball courts). Subpopulation shift arises from a change in within-category data distributions (e.g. for a 'toothbrush' category, the relative proportion of electric v/s mechanical varieties may change across geographies). In our experiments, we demonstrate the inefficacy of conventional adaptation strategies in addressing these additional challenges.
Some prior work has studied the problem of transferring deep visual models to new geographies. De Vries et al. [2] benchmark the drop in performance of publicly available vision API's on images from diverse geographies from the Dollar Street dataset [8], but do not propose a mitigation strategy. Recently, Dubey et al. [9] formulate this as a domain generalization problem and propose a solution that makes use of auxiliary target domain embeddings. We instead pose the problem as one of domain adaptation so as to leverage the full potential of unlabeled target data by allowing model updates on it. We make the following contributions: soaps  hands  beds  plates  toilets  showers  shampoo  phones  lock_on_front_doors  sofas  teeth  hair_brushes  kitchen_sinks  salt  power_switches  toilet_paper  nicest_shoes  vegetables  water_outlets  books  toys  washing_detergent  medication  light_sources_kitchen  trash  wall_decorations  social_drinks  cars  cooking_utensils  front_doors  computers  fruits  dish_racks  cleaning_equipment  freezers  light_sources_in_livingroom  toothbrushes  music_equipment  grains  refrigerators  ovens  tools  pets  menstruation_pads  roofs  drying_clothes  alcoholic_drinks  papers  tables_with_food  glasses  radios  frontdoor_keys  steam_exits  power_outlets  wrist_watches  drinking_water  mosquito_protections   and GeoYFCC [9] datasets.
2. We validate the existence of context and subpopulation shift within these shifts, and experimentally verify that they pose significant challenges to model transfer.
3. We benchmark the performance of representative domain adaptation techniques from the literature on these shifts and find them to achieve limited success, illustrating the need for specialized adaptation solutions for Geographical DA.

Related Work
Unsupervised domain adaptation (UDA). UDA seeks to transfer a model trained on a labeled source to an unlabeled target domain, primarily via minimizing domain discrepancy statistics [10], domain-adversarial learning [4], or self-training [5]. We formulate the problem of transferring trained image classification models to images from unseen geographies as UDA, and study how standard DA methods fare in this setting.
Geographical transfer learning. Geographical transfer learning has received limited attention. Wang et al. [11] focus on cross-country adaptation of 3D object detectors, and propose a simple correction solution based on differences in average car sizes. Dubey et al. study the problem of geographical domain generalization, and propose an adaptive solution that uses auxiliary target domain embeddings but unlike our setting does not allow training on unlabeled target data. Concurrent work [12] extends the recently proposed WILDS [13] domain generalization benchmark to the unsupervised DA setting, and include one shift (FMoW [14]) for geographical adaptation of models trained for land use prediction from satellite imagery. In contrast, we study geographical adaptation of object recognition models trained on standard internet imagery from the Dollar Street and YFCC datasets, which poses unique challenges of context and subpopulation shift.
Context and subpopulation shift. Singh et al. [15] study the problem of contextual biases learned by deep models based on frequently co-occuring categories. Some recent works [16,17]   scene-level imagery. Recent work proposes the BREEDS benchmark [18] to study model robustness against subpopulation shift-the ability to generalize to novel data subclasses not seen during training. Cai et al. [19] study propose a inputconsistency based label propagation algorithm to overcome subpopulation shift. To our knowledge, we are the first to study these challenges in the context of geographical DA.

Benchmarks and Challenges
We first present our two shifts for geographical domain adaptation curated from the Dollar Street and GeoYFCC datasets. We describe our curation process and analyze the characteristics of each geographical domain shift. We then describe and visualize the context and subpopulation shift present in these benchmarks.

Benchmarks
Dollar Street-DA. The Dollar Street dataset was collected as part of the GapMinder project with the aim of using "photos as data to kill country stereotypes". It contains photographs and videos of everyday objects from peoples' homes spanning 66 unique countries. We restrict our study to image data and download images belonging to 128 unique categories. We filter out categories that are scene-level or too broad ("agriculture lands", "play areas") or abstract / subjective ("most loved items", "things I dream of having"), as well as categories with less than 50 images, resulting in 62 categories. We further deduplicate the dataset and merge some highly similar categories (e.g., "plates of food" and "plates"), leaving us with images of 58 unique and distinct curated categories from 60 countries. We set up an adaptation problem from North America and Europe as source (2930 images) and Africa, South America, and Asia as target (8813 images). Fig. 2a presents a label histogram of each domain. GeoYFCC-DA. The GeoYFCC dataset [9] contains 1.1 million images from 62 countries curated from the subset of YFCC100M [20] images with geotags that were then automatically labeled based on keyword matching of image tags against ImageNet-5K categories excluding those in ILSVRC12 [21]. We create an adaptation problem from countries in North America as source and countries in Asia, South America, and Australia as our target domain. Due to the automatic labeling pipeline, we notice a large amount of label noise in the dataset and take two measures to curate the dataset further: i) We train a ResNet50 [22] model on the source domain and measure heldout test accuracy, and only retain classes with > 25% accuracy. ii) We manually inspect 100 random qualitative examples from the source and target domains for the remaining categories and exclude categories with significant label noise. At the end of this process, we select 68 categories with 24.1k images in the source domain and 59.4k images in the target domain. See Fig. 2b for a label histogram of each domain.

Challenges: Context and subpopulation shift
Notation. Let X and Y denote input and ouput spaces, with the goal being to learn a convolutional neural network h : X → Y parameterized by Θ. In unsupervised DA we are given access to labeled source examples (x S , y S ) ∼ P S (X , Y), and unlabeled target examples x T ∼ P T (X ), where S and T denote the source and target domains. The goal is to maximize model accuracy on the target domain, and we consider adaptation of models trained to perform Kway object recognition: the inputs x are images, and labels y are categorical variables y ∈ {1, 2, .., K}. . Subpopulation shift for select categories across domains. We plot normalized cluster assignments per-domain as approximate subpopulation distributions -blue denotes within-category subpopulation distribution on source and orange denotes target. As seen, subpopulation distributions shift significantly across domains. On the right we visualize random images from some of the discovered clusters, and verify that they generally correspond to distinct subpopulations.
Data and label distribution shift. As in conventional domain adaptation, geographical DA also presents data distribution shift (P S (x) ̸ = P T (x)) as object appearances change across geographies (see Fig. 1), and label distribution shift (P S (y) ̸ = P T (y)), as task label distributions change across domains (see Fig. 2).
In addition, geographical adaptation presents two new challenges: context and subpopulation shift. Context shift. We define context c(x) for image x with label y as the task-irrelevant information in the image-this loosely corresponds to the background or surroundings of the object of interest. We define context shift as P S (c(x)|y) ̸ = P T (c(x)|y), representing a change in object context across geographical domains.
In Fig. 3 we show qualitative examples of context shift within our proposed Dollar Street-DA and GeoYFCC-DA shifts for a few categories. For example, we find that in Dollar Street-DA, most "toothbrush" images in the source domain tend to be photographed inside bathrooms, whereas the surroundings in the target domains are significantly more diverse (e.g. walls and roofs). We see similar trends in the GeoYFCC-DA shift (e.g. indoor v/s outdoor basketball games). As deep neural networks are known to often employ "shortcut learning" [23] of potentially spurious features (e.g. object backgrounds) to make predictions, we hypothesize (and experimentally verify in Sec. 4.4) that such a context shift will present a challenge to visual recognition models deployed in new geographies. Subpopulation shift. We define subpopulation shift as P S (x|y) ̸ = P T (x|y), representing a change in withincategory distribution across domains.
In Fig. 4, we show examples of subpopulation shift in the Dollar Street-DA and GeoYFCC-DA benchmarks. In the absence of subpopulation-level annotations, we use a simple strategy to obtain approximate annotations: we use a pretrained model (ResNet50 [22] trained on ImageNet) to extract features for source and target images of a given category, and perform agglomerative clustering on the combined set of embeddings. We then use the inferred cluster assignments as subpopulation annotations. We also plot the normalized within-class distribution of cluster assignments on the source and target domains, and measure the Wasserstein distance between the two as a measure of the degree of subpopulation shift.
As seen, this simple strategy discovers distinct clusters corresponding to semantically distinct subpopulations: e.g. for "cleaning equipment" on Dollar Street-DA we discover separate clusters roughly corresponding to brooms, vaccuum cleaners, mops, and miscellaneous cleaning items. Crucially, we find that the intra-class distribution of many categories changes significantly across geographies (e.g. brooms make up a significantly larger proportion of cleaning equipment in the target domain than in the source).  To quantitatively validate the subpopulation shift, we compute the degree of perclass subpopulation shift: for each class, we compute the normalized subpopulation distribution per-domain (as visualized in Fig. 4, left) distance, and average across classes. Fig. 5 presents results for this measure for our proposed geographical shifts versus randomly constructed source and target domains of the same size, for the Dollar Street and GeoYFCC datasets. As seen, geographical shifts lead to significantly higher subpopulation shift.

Setup
To account for label imbalance, we report per-class average accuracy as our metric. As described in Sec. 3, we consider adaptation on two shifts: Dollar Street-DA: We consider images from North America and Europe as the source domain (2.9k) and images from Asia, Africa, and South America as the target domain (8.8k). GeoYFCC-DA: We consider images from North America as the source domain (24.1k) and images from Asia, Australia, and South America as the target domain (59.4k).
On both shifts we create a 90%-10% train-test split on the source domain and report transfer performance on 20% heldout target data, but use the entire target dataset for unsupervised adaptation. On Dollar Street-DA, due to the relatively small size of the dataset, we report performance mean and standard deviation over three experimental runs.

Domain Adaptation Baselines
We benchmark 4 representative DA methods from the literature on our Geographical DA shifts: one domain discrepancy-based method, one domain adversarial method, and two self-training based methods. 1) MMD [10]: Aligns domains by computing mean source and target embeddings in a reproducing kernel hilbert space and minimizing their distance as a maximum mean discrepancy measure. 2) DANN [4]: Domain-adversarial neural networks adversarially learn a domain discriminator to distinguish source and target features against a feature encoder that is trained to fool the discriminator. 3) SENTRY [5]: SENTRY measures model predictive consistency across randomly augmented versions of each target image and selectively increases predictive entropy on highly consistent instances, while decreasing it on highly inconsistent ones. SENTRY also uses pseudolabel-based approximating class balancing on the target domain, and employs a slightly modified ResNet50 architecture [24]. 4) Selective Self-training (SST): We implement a simplified self-training baseline that self-trains against predicted labels on target instances on which the model is atleast 90% confident, and also employs pseudolabel-based target class balancing and a modified ResNet50 architecture [24].
Finally, we also report performance for a target oracle that is trained in a supervised fashion on the target domain. The target oracle is meant to represent a performance upper bound in the absence of domain shift. Implementation details. We use a ResNet50 [22] as our CNN architecture, and for SENTRY and SST use a modified few-shot variant [24] that replaces the last linear layer with a K-way (where K is the number of classes) fully-connected layer without bias. Input activations to this layer are L 2normalized and its output is passed into a softmax layer with a temperature of 0.05. For optimization, we use Adam [25] with a learning rate of 0.001 and weight decay of 5e −4 . We use a batch size of 128 across experiments. All DA methods are applied to a source model that is first trained using supervised training on the source domain for 50 epochs. We employ 100 epochs of adaptation on Dollar Street-DA and 40 epochs on GeoYFCC-DA. All methods additionally minimize a supervised cross-entropy loss on source labels during adaptation (with a loss weight of 1.0 and 0.1 on Dollar Street-DA and GeoYFCC-DA respectively). To combat label distribution shift, we follow Tan et al. [26] and use classbalanced sampling on the source domain across experiments. Table 1 presents average accuracy on the target test set for the Dollar Street-DA and GeoYFCC-DA shifts. We observe: ▷ Geographical shifts lead to significant performance drops (Row 1 v/s 2). As seen, the target oracle achieves 67.7% and 56.78% whereas the source model achieves a significantly lower performance of 54.66% (-13.1%) and 42.88% (-13.9%). Clearly, geographical variations pose a significant challenge to transfer. ▷ DA methods offer limited improvements (Rows 3-6). All the benchmarked methods achieve limited success at geographical adaptation, sometimes performing no better than the source model. Surprisingly, we find the simple SST method to achieve the best (albeit small) improvement over the source model (+4.1% / +2.3%), but still well short of the target oracle (-9% / -11.6%). Altogether, these results

Analyzing failure modes
We now analyze the performance of our best-performing SST model and contrast it with the target oracle. Per-class performance. In Fig. 6 we show per-category accuracies on the target test set for i) blue: a target oracle model trained on the target train set and ii) orange: the best performing SST model which was trained on the source train set and adapted to the entire target domain. We order categories in descending order of accuracy drop. As seen, the SST model performance lags behind the target oracle on most categories. We further analyze failure modes arising from context shift and subpopulation shift: Context shift. In Fig. 7 we show examples of model errors on the target domain arising from context shift. We also visualize GradCAM [27] explanations along side each image, and find that, in most cases, the model makes erroneous predictions on target images with contexts that are uncommon in the source domain (see Fig. 3 for source examples) while fixating on spurious background features. Subpopulation shift. To verify that subpopulation shift is a failure mode, we measure per-class average subpopulation accuracy, using the approximate subpopulation-level annotations described in Sec. 3.2. We then measure the correlation between the drop in per-class average subpopulation accuracy for the SST model compared to the target oracle (that does not experience subpopulation shift), against the degree of subpopulation shift measured via the per-category average of cross-domain Wasserstein distance between subpopulation distributions. On the 40 classes with the highest subpopulation shift in Dollar Street-DA, we observe a Pearson correlation coefficient of 0.44, and 0.39 on GeoYFCC-DA. This indicates the tendency of the adapted model to underperform to a larger degree-when compared to the target oracle-on categories with high subpopulation shift.

Limitations & Conclusion
Our work has some important limitations: we do not consider semantic drift, where the meaning of a category itself may change across geographies e.g. a "chair" in one country might be considered as a "sofa" in another. We also restrict our study to adaptation across continent-level shifts, but analyzing shifts across a more fine-grained (e.g. country) level is also potentially valuable. Moreover, variation in Figure 7. Context shift as a failure mode for Geographical DA. We visualize incorrect predictions from the best-performing SST model on the target test set alongside visual explanations generated with GradCAM [27] for Dollar Street-DA (left) and GeoYFCC-DA (right). As seen, the model frequently attends to spurious background features and makes incorrect predictions. visual appearance within a geography can sometimes be larger than that across geographies, due to other confounding factors like income and demographics-we do not study these differences here. Finally, in the absence of human annotations, we are restricted to using inferred subpopulation annotations for our analysis.
To summarize, we studied the problem of domain adaptation of trained object recognition models to new geographies, and investigated the effectiveness of off-the-shelf adaptation methods. We proposed two shifts to study this problem and demonstrated the existence of two unique challenges: crossdomain context shift and subpopulation-shift. We found existing DA methods to offer limited success at Geographical DA, suggesting the need for future work to develop specialized adaptation solutions for this important but understudied problem.