DeepAI
Log In Sign Up

Bi-directional Contrastive Learning for Domain Adaptive Semantic Segmentation

07/22/2022
by   Geon Lee, et al.
0

We present a novel unsupervised domain adaptation method for semantic segmentation that generalizes a model trained with source images and corresponding ground-truth labels to a target domain. A key to domain adaptive semantic segmentation is to learn domain-invariant and discriminative features without target ground-truth labels. To this end, we propose a bi-directional pixel-prototype contrastive learning framework that minimizes intra-class variations of features for the same object class, while maximizing inter-class variations for different ones, regardless of domains. Specifically, our framework aligns pixel-level features and a prototype of the same object class in target and source images (i.e., positive pairs), respectively, sets them apart for different classes (i.e., negative pairs), and performs the alignment and separation processes toward the other direction with pixel-level features in the source image and a prototype in the target image. The cross-domain matching encourages domain-invariant feature representations, while the bidirectional pixel-prototype correspondences aggregate features for the same object class, providing discriminative features. To establish training pairs for contrastive learning, we propose to generate dynamic pseudo labels of target images using a non-parametric label transfer, that is, pixel-prototype correspondences across different domains. We also present a calibration method compensating class-wise domain biases of prototypes gradually during training.

READ FULL TEXT VIEW PDF

page 9

page 12

page 14

page 22

page 23

11/24/2021

SPCL: A New Framework for Domain Adaptive Semantic Segmentation via Semantic Prototype-based Contrastive Learning

Although there is significant progress in supervised semantic segmentati...
04/18/2022

Unsupervised Contrastive Domain Adaptation for Semantic Segmentation

Semantic segmentation models struggle to generalize in the presence of d...
08/12/2022

Exploring High-quality Target Domain Information for Unsupervised Domain Adaptive Semantic Segmentation

In unsupervised domain adaptive (UDA) semantic segmentation, the distill...
06/22/2021

Give Me Your Trained Model: Domain Adaptive Semantic Segmentation without Source Data

Benefited from considerable pixel-level annotations collected from a spe...
04/19/2022

SePiCo: Semantic-Guided Pixel Contrast for Domain Adaptive Semantic Segmentation

Domain adaptive semantic segmentation attempts to make satisfactory dens...
08/12/2021

LabOR: Labeling Only if Required for Domain Adaptive Semantic Segmentation

Unsupervised Domain Adaptation (UDA) for semantic segmentation has been ...
12/03/2018

SPLAT: Semantic Pixel-Level Adaptation Transforms for Detection

Domain adaptation of visual detectors is a critical challenge, yet exist...

1 Introduction

Figure 1: An illustration of our framework for UDASS. We generate pseudo labels of target images using a nonparametric label transfer. We then perform bi-directional pixel-prototype contrastive learning. This encourages pixel-level features in a target image and a prototype of the same object class in a source domain to pull each other, while setting them apart for different ones. We also perform the alignment and separation in a reverse direction, with pixel-level features of source images and prototypes of a target domain.

Semantic segmentation is to assign a semantic label to each pixel in an image. In the past decade, supervised methods based on convolutional neural networks (CNNs) 

[1, 26, 56, 33, 17, 41] have achieved remarkable improvements in semantic segmentation. Training networks for the dense prediction task generally requires lots of pixel-level labels. Annotating pixel-level labels of high-resolution images is, however, significantly labor-intensive and time-consuming. For example, annotating the labels for an image of size in Cityscapes [6] takes about 90 minutes. One alternative is to leverage synthetic datasets, e.g., GTA5 [32] and SYNTHIA [34], that contain realistic images and corresponding pixel-level labels. The annotation cost is much cheaper than the manual labeling, but CNNs trained with synthetic datasets do not work well on real images, due to the domain discrepancy between synthetic and real images.

To reduce the domain discrepancy, several methods [43, 15, 23, 4, 16, 44] have exploited an unsupervised domain adaptation approach. It transfers knowledge learned from a source domain (e.g., a synthetic dataset) to a target one (e.g., a real dataset), with labels for the source domain alone. Many unsupervised domain adaptation methods leverage an adversarial training scheme [12]

that aligns distributions of source and target domains by fooling a domain classifier 

[15, 30, 5, 23, 49, 16, 3, 36, 4, 55, 10, 27, 44, 28, 42, 48]. However, they typically focus on reducing the domain discrepancy globally, and fail to keep pixel-level semantics [50]. For example, regions corresponding to a car class in a source image might align with those for a bus class in a target image. Self-training methods [58, 59, 51, 50, 22]

enable a class-aware alignment. They generate pseudo labels for target images iteratively in a parametric approach, typically using CNNs trained with a source dataset, and then retrain a segmentation model on both source and target samples with the pseudo labels. This aligns cross-domain features in a class-level, improving performance of the model on target images progressively. The pseudo labels obtained using a parametric approach have the following drawbacks: First, they are very sparse, since low confident predictions are discarded to obtain reliable labels. Second, estimating pseudo labels is also computationally demanding, making them not to be updated frequently during training. These problems cause the segmentation model to overfit to pseudo labels, resulting in a large bias and a variance of predictions. In the following, we will call the labels estimated using a parametric approach as

static pseudo labels.

We present a novel contrastive learning framework using cross-domain pixel-prototype correspondences for unsupervised domain adaptive semantic segmentation (UDASS). It aligns pixel-level features of each object class in target images, obtained by pseudo labels, with prototypes of corresponding class in a source domain, computed by ground truth, while setting them apart for different classes (Fig. 1). The alignment and separation process is also performed in a reverse direction, with pixel-level features of source images and prototypes of a target domain. The cross-domain matching encourages domain-invariant feature representations, and the bidirectional pixel-prototype correspondences provide compact and discriminative representations. We also present a nonparametric approach to generating dynamic pseudo labels using pixel-prototype correspondences. Specifically, we calibrate prototypes of individual object classes in a source domain, while considering the domain discrepancy in target images, and establish correspondences for each prototype with individual pixel-level features in target images. We then transfer ground-truth labels of prototypes to corresponding pixels in target images. In contrast to the parametric approach in current self-training methods, our nonparametric approach provides denser pseudo labels, and generates the labels dynamically, whenever source images are changed during training. This helps to obtain more accurate pseudo labels, and prevents the overfitting problem. Experimental results on standard benchmarks including GTA5-to-Cityscapes [32, 6] and SYNTHIA-to-Cityscapes [34, 6] demonstrate that our contrastive learning framework provides domain-invariant and discriminative features for UDASS. The main contributions can be summarized as follows:

  • We introduce a novel contrastive learning framework using bi-directional pixel-prototype correspondences to learn domain-invariant and discriminative feature representations for UDASS.

  • We propose a nonparametric approach to generating dynamic pseudo labels. We also present a calibration method to reduce domain biases for pixel-prototype correspondences between target and source domains.

  • We set a new state of the art on standard benchmarks for UDASS, and demonstrate the effectiveness of our contrast learning framework.

2 Related work

2.0.1 Udass.

UDASS leverages knowledge learned from a label-rich source domain to predict semantic labels of a scene in a target domain, where ground-truth annotations are not available. Synthetic images (e.g., GTA5 [32] and SYNTHIA [34]) are widely used as source samples, as pixel-level labels can be generated automatically using computer graphics engines. The key factor for UDASS is hence to learn domain-invariant features to reduce the discrepancy between source and target domains. To this end, many UDASS methods adopt an adversarial learning framework [12] to fool a domain discriminator. They can generally be categorized into image-level and feature-level alignment methods. Motivated by image translation techniques [18, 57], image-level alignment methods [15, 5, 23, 30, 49] transfer the styles (e.g., texture and illumination) of target images to the source, so that segmentation models can accommodate both domains. Feature-level alignment methods [16, 3, 36, 4, 55, 10, 27, 44, 28, 42, 48] align the feature distributions of source and target images explicitly. These adversarial approaches, however, align source and target distributions globally. Namely, they perform a class-agnostic alignment, and ignore positional information of a scene. This suggests that the adversarial approaches fail to transfer pixel-level semantics, related to the structural information of a scene, from source to target domains.

UDASS methods based on self-training [58, 59, 22] have recently been introduced. The self-training approach first segments target images using a model trained on a source dataset, and obtains pseudo labels if the confidence of semantic labels predicted by the model exceeds a pre-defined threshold. It then retrains the model iteratively with both ground-truth and pseudo labels of source and target datasets, respectively. The representative work of [58] proposes to use different thresholds for individual object categories to consider a class imbalance problem. In [59], soft pseudo labels have been introduced, together with a confidence regularization technique that helps transfer discriminative feature representations from source to target domains. The self-training approaches [58, 59, 22, 52]

are, however, likely to overfit to pseudo labels. The reasons are as follows: (1) Pseudo labels are fixed for a few epochs during training, due to computational overheads, which accumulates error from incorrect pseudo labels; (2) Pseudo labels are very sparse, as high confident predictions are chosen only as the labels. Our method alleviates these limitations by generating denser pseudo labels dynamically in a nonparametric way using pixel-prototype correspondences. Most similar to ours is PLCA 

[20] using pixel-wise matches. It adopts a contrastive learning scheme to reduce the distances between source and target features directly at a pixel-level. The pixel-level domain alignment, however, does not consider contextual information, and fails to obtain compact representations between corresponding object categories in source and target domains. Our method instead uses bidirectional pixel-prototype correspondences for contrastive learning, which encourages intra-class compactness and inter-class separability across domains.

2.0.2 Prototypical learning.

The seminal work of [40] introduces prototypical networks that extract prototype representations for individual object categories. The prototypical features have proven useful in the limited-data regime for the task of, e.g., few-/zero-shot classification. PL [9] extends the idea of prototypical learning for few-shot semantic segmentation in such a way that class prototypes obtained from a support set are matched to pixel-level features in a query image. PANet [46] presents a bidirectional framework exploiting correspondences between prototypical features for a support set and pixel-level ones for query images, and vice versa, for few-shot semantic segmentation. Similar to these methods, we exploit prototypical features for semantic segmentation. Differently, we leverage them within a framework of contrastive learning for UDASS. We use pixel-prototype correspondences to obtain domain-invariant and discriminative feature representations. We also leverage the correspondences to obtain dynamic pseudo labels, which alleviates the limitations of current self-training methods using static pseudo labels.

2.0.3 Contrastive learning.

Contrastive learning [2, 13] is a de facto approach to learning generic feature representations in a self-supervised way. The basic idea is to encourage positive pairs with the same label to be close, while negative ones with different labels to be distant. In order to set positive and negative pairs without ground-truth labels, contrastive learning augments a single input image, e.g., using random cropping and color jittering. It then considers the original image and the augmented one as a positive pair, while setting the pairs composed of the original and other images as negative ones. Similar to ours, CANet [19] adopts contrastive learning for unsupervised domain adaptive classification. It computes the domain discrepancies using image-level features, and then performs a class-wise alignment using target labels obtained by a clustering method. Differently, our method leverages contrastive learning using correspondences between pixels and prototypes across domains. Optimizing bidirectional correspondences jointly in our method also enables aggregating features for the same object category, regardless of domains.

2.0.4 Nonparametric label transfer.

Label transfer has been widely used in object localization [29], scene segmentation [35, 25, 31, 39], automatic image annotation [45], and image translation [38]. Label transfer methods first search visually similar images or patches in large datasets for given queries, and then transfer labels of retrieved samples to the queries. Similar to our approach, the work of [8] adopts a nonparametric label transfer method for scene parsing under different domains (e.g., weather or illumination). Specifically, it extracts features from query images with pre-trained networks, finds the best matching images using SIFT flow [24], and transfers labels of the images to the queries via a probabilistic MRF model, suggesting that this approach requires source images and ground-truth labels at both training and test time. Our method, on the other hand, uses source images and corresponding ground-truth labels only at training time. Namely, we leverage non-parametric label transfer to train a parametric segmentation model.

Figure 2: An overview of our framework. (Left) Bi-directional contrastive learning: We first extract feature maps, and , from source and target images, and , respectively. We then obtain prototypes in a source domain, using ground-truth labels of source images . Prototypes in a target domain are similarly computed but with dynamic pseudo labels of target images . Bidirectional contrastive terms, FCL and BCL, exploit pixel-prototype correspondences across domains to learn domain-invariant and discriminative features for UDASS. (Right) Hybrid pseudo labels: We generate dynamic pseudo labels  using pixel-prototype correspondences across domains, while calibrating the prototypes to reduce domain discrepancies. We then combine them with static ones  using a parametric approach to obtain hybrid pseudo labels .

3 Approach

3.1 Overview

We introduce a cross-domain contrastive learning framework for UDASS using pixel-prototype correspondences (Fig. 2). It first extracts feature maps from source and target images, respectively, using a siamese network. We obtain prototypes of source and target domains using ground-truth labels of source images and pseudo labels of target ones, respectively. Our method then establishes correspondences between the prototypes and pixel-level features across domains, and leverages them to learn domain-invariant and discriminative representations via contrastive learning. To this end, we introduce a bi-directional contrastive loss that consists of a forward contrastive term (FCL) and a backward contrastive term (BCL). FCL matches individual pixel-level features of a target image with prototypes of a source domain, and enforces pixel-prototype pairs with the same class labels to be aligned closely than other ones. BCL performs the alignment process in a reverse direction, with pixel-level features of a source image and prototypes of a target domain, encouraging our model to provide discriminative and compact features. In order to establish training pairs for computing the bi-directional contrastive loss, we require pseudo labels of target images. To this end, we use dynamic pseudo labels obtained by a nonparametric label transfer, addressing the drawbacks of static pseudo labels. Specifically, given a pair of source-target images, we establish correspondences between prototypes of a source domain and pixel-level features of a target image, while calibrating the prototypes progressively during training to compensate domain discrepancies. We then set the pseudo labels of pixel-level features to the class labels of the corresponding prototypes in a source domain. Unlike static pseudo labels estimated by a parametric approach [58, 22], our approach can generate novel pseudo labels of target images dynamically, whenever a pair of source-target images are changed, during training. We estimate hybrid pseudo labels by combining dynamic and static labels, and use them for the bi-directional contrastive learning.

3.2 Bi-directional contrastive learning

Given a pair of source and target images, our goal is to aggregate pixel-level features for the same object class, regardless of domains, to learn domain-invariant and discriminative feature representations. To this end, we formulate UDASS as bi-directional pixel-prototype contrastive learning. Let us denote by the set of object classes. We obtain prototypes of source and target domains for the class , and , using masked average pooling (MAP) as follows:

(1)

where we denote by and pixel-level features of source and target images, respectively, at position . and are one-hot labels, i.e., 1 if the class label at position correspond to and 0 otherwise. Note that we use ground-truth labels of source images  and hybrid pseudo labels of target ones  to set the labels, and , respectively. Using the prototypes of source and target domains, we perform cross-domain contrastive learning in a bi-directional way. We leverage a bi-directional constative loss that consists of FCL and BCL. FCL exploits prototypes of a source domain and pixel-level features of a target image. To be specific, given pixel-level features of a target image, we select the prototypes of a source domain having the same class labels as the features, and set them as positive pairs, while other prototypes are used to set negative ones. FCL maximizes the similarities between positive pairs as follows:

(2)

where is a temperature parameter, and

computes cosine similarity. Similarly, BCL exploits prototypes of a target domain and pixel-level features of a source image. It encourages positive pairs sharing the same labels to pull each other, while making others set apart as follows:

(3)

In summary, using the bidirectional contrastive loss, pixel-level features for the same object class are embedded closely, regardless of domains, while those for different classes are distinguished from each other. That is, by jointly optimizing FCL and BCL, we can minimize intra-class variations and maximize inter-class variations of pixel-level features progressively during training. In contrast to current UDASS methods [54, 58, 59, 51, 50, 22] that do not consider such variations for domain adaptation, our approach provides more discriminative and compact features. This in turn allows to perform more accurate class-wise alignments across domains, and enables our model to generalize better on a target domain.

3.3 Dynamic pseudo labels

Current self-training methods [54, 58, 59, 51, 50, 22]

employ a parametric model trained with ground-truth labels of source images to obtain static pseudo labels of target images. Specifically, using the parametric segmentation model, confidence scores for individual object classes are computed for each pixel-level feature from entire target images. The pixel-level features with high confidence scores are chosen, and corresponding object classes are used as pseudo labels. Although exploiting static pseudo labels of target images enables performing class-aware UDASS, they have the following drawbacks: First, computing the pixel-level confidence scores for all target images to obtain the pseudo labels is computationally demanding. Current self-training methods perform this process for a few iterations (

e.g., 10000) during training, and update the pseudo labels of target images very occasionally. The error from incorrect pseudo labels might hence be accumulated. Second, current self-training methods choose highly confident pixel-level features only for static pseudo labels, and thus they are very sparse. These problems cause a model to overfit to the static pseudo labels, and induce suboptimal class-wise alignments between domains. To overcome the limitations, we introduce a novel approach to generating dynamic pseudo labels. It leverages a nonparametric label transfer technique using pixel-prototype correspondences between source and target images. That is, we estimate pseudo labels using pairs of source and target images. This suggests that our approach generates pseudo labels of target images dynamically, whenever source images are changed during training. In other words, the pseudo labels for the same target image could be different, depending on which source images are used to establish pixel-prototype correspondences w.r.t the target one (Fig. 3).

Figure 3: Visual comparison of static, dynamic, and hybrid pseudo labels for a target image. In contrast to the static label (the first column), estimated using a parametric segmentation model, dynamic labels are obtained by a nonparametric label transfer between source and target images. This suggests that they are denser and cheap to update. We can also obtain different dynamic labels (the second column), according to source images (the fourth column). We combine both labels to get hybrid pseudo labels (the third column), and use them to augment the number of positive and negative pairs for contrastive learning.

Concretely, given a pair of source and target images, we establish correspondences between prototypes of a source image and pixel-level features of a target one. To obtain reliable correspondences, we alleviate domain biases between source and target domains. We could estimate the degree of domain biases by calculating average class-wise features for each domain using all source and target images, followed by computing differences between the average features, which however requires lots of computational overheads. We instead leverage prototypes of source and target images. We first update prototypes of source and target domains progressively during training using an exponential moving average with a momentum parameter of  as follows:

(4)
(5)

where we denote by and updated prototypes of source and target domains, respectively, for the class . We then estimate class-wise domain biases:

(6)

and obtain calibrated prototypes for each object class in a source domain as follows:

(7)

Using the calibrated prototypes, we can establish more correct correspondences across domains. We consider the correspondences are correct, if similarity scores between the pixel-prototype matches are larger than a pre-defined threshold, and set dynamic pseudo labels of target images to corresponding object categories of the prototypes, as follows:

(8)

where is a dynamic pseudo label for the class at position , is a pre-defined threshold, and

(9)

3.3.1 Hybrid pseudo labels.

We can obtain diverse pseudo labels even for the same target image every iteration, and the dynamic labels are much denser than static ones. Static pseudo labels, on the other hand, are sparse but reliable. In order to take advantage of both, we combine them and obtain hybrid pseudo labels  as follows:

(10)

where is a static pseudo label for the class at position .

3.4 Training loss

Following the previous works [58, 59, 51, 50, 22], we exploit segmentation and entropy terms using ground-truth and pseudo labels of source and target images, respectively. The former encourages our model to provide accurate pixel-wise predictions, and the latter minimizes the entropy of the predictions. We define a loss for training a baseline model as follows:

(11)

where and are segmentation losses for source and target domains, respectively. and are entropy terms for source and target domains, respectively. , , , and are balance parameters for each term. For the baseline, we obtain static pseudo labels using the method of [58]. As our final model, we additionally use a bi-directional contrastive loss to learn domain-invariant and discriminative representations as follows:

(12)

where and are weighting factors for forward and backward contrastive terms, respectively.

4 Experiments

4.1 Implementation details

4.1.1 Dataset and evaluation metric.

We evaluate our framework on two standard benchmarks (GTA5 [32] Cityscapes [6], and SYNTHIA [34] Cityscapes [6]). GTA5 and SYNTHIA provide 24,996 and 9400 images, respectively. Cityscapes consists of 2975, 500, and 1525 images for training, validation, and testing, respectively. Following the standard protocol in [15, 43, 58, 59], we report the mean intersection over Union (mIoU) on 19 classes for GTA5 Cityscapes and 13 (or 16) classes for Synthia Cityscapes.

4.1.2 Training.

We adopt the DeepLab-V2 [1] architecture with ResNet-101 [14]

as a backbone network pretrained for ImageNet classification 

[7]. We first train DeepLab-V2 with a source dataset, and use it as an initial segmentation model for UDASS. We train the model for 100

iterations with a batch size of 4, using stochastic gradient descent (SGD) 

[21] of a momentum of 0.9 and weight decay of . We use a poly learning rate scheduling with an initial learning rate of . We update static pseudo labels every 10 iterations. We resize a shorter side of images to 850, and crop them into a patch of size 730 730. For data augmentation, we use horizontal flipping and random scaling with the factor of [0.8, 1.2]. We use a weighted sampling strategy to select source images containing objects that rarely appear in a source domain, mitigating low co-occurrence rates for the rare object categories. Following [52, 11]

, we additionally apply a self-distillation technique to our final model. Detailed descriptions for the weighted sampling and hyperparameter settings are available in the supplement.

GTA5 Cityscapes

Split

Methods   

Type

road

side.

build.

wall

fence

pole

light

sign

veg.

terrian

sky

person

rider

car

truck

bus

train

motor

bike

mIoU

Validation Source-only - 45.4 16.5 66.4 14.4 21.6 25.1 36.3 17.2 80.1 16.3 69.1 61.4 24.9 68.6 28.4 4.7 4.4 40.8 27.5 35.2
AdaptSeg [43] AT 86.5 36.0 79.9 23.4 23.3 23.9 35.2 14.8 83.4 33.3 75.6 58.5 27.6 73.7 32.5 35.4 3.9 30.1 28.1 42.4
CBST [58] ST 91.8 53.5 80.5 32.7 21.0 34.0 28.9 20.4 83.9 34.2 80.9 53.1 24.0 82.7 30.3 35.9 16.0 25.9 42.8 45.9
CRST [59] ST 91.0 55.4 80.0 33.7 21.4 37.3 32.9 24.5 85.0 34.1 80.8 57.7 24.6 84.1 27.8 30.1 26.9 26.0 42.3 47.1
PLCA [20] - 84.0 30.4 82.4 35.3 24.8 32.2 36.8 24.5 85.5 37.2 78.6 66.9 32.8 85.5 40.4 48.0 8.8 29.8 41.8 47.7
CAG_UDA [53] ST 90.4 51.6 83.8 34.2 27.8 38.4 25.3 48.4 85.4 38.2 78.1 58.6 34.6 84.7 21.9 42.7 41.1 29.3 37.2 50.2
FDA [51] ST 92.5 53.5 82.4 26.5 27.6 36.4 40.6 38.9 82.3 39.8 78.0 62.6 34.4 84.9 34.1 53.1 16.9 27.7 46.4 50.5
TPLD [37] ST 94.2 60.5 82.8 36.6 16.6 39.3 29.0 25.5 85.6 44.9 84.4 60.6 27.4 84.1 37.0 47.0 31.2 36.1 46.4 51.2
CorDA [47] ST 94.7 63.1 87.6 30.7 40.6 40.2 47.8 51.6 87.6 47.0 89.7 66.7 35.9 90.2 48.9 57.5 0.0 39.8 56.0 56.6
ProDA [52] ST 87.1 55.1 78.1 45.6 43.8 44.6 52.5 53.4 89.1 44.7 82.1 70.1 39.1 88.4 43.8 59.1 1.0 48.7 54.4 56.5
Ours ST 93.5 60.2 88.1 31.1 37.0 41.9 54.7 37.8 89.9 45.5 89.9 72.7 38.2 90.7 34.3 53.2 4.4 47.2 58.5 57.1
Test AdaptSeg [43] AT 88.5 40.4 81.0 26.3 20.6 25.6 36.0 12.9 84.8 45.5 87.2 63.7 35.8 76.4 27.7 28.0 2.9 33.0 26.1 44.3
CBST [58] ST 91.0 55.4 80.0 33.7 21.4 37.3 32.9 24.5 85.0 34.1 80.8 57.7 24.6 84.1 27.8 30.1 26.9 26.0 42.3 47.1
CRST [59] ST 93.5 57.6 84.6 39.3 24.1 25.2 35.0 17.3 85.0 40.6 86.5 58.7 28.7 85.8 49.0 56.4 5.4 31.9 43.2 49.9
FDA-MBT [51] ST 93.4 55.8 83.6 25.4 23.1 33.2 39.0 36.9 84.0 47.2 88.8 66.3 40.6 87.4 26.9 49.6 12.8 35.2 42.8 51.2
CorDA [47] ST 94.2 62.9 88.1 30.2 41.2 40.1 49.1 49.9 89.1 49.1 90.1 69.1 28.9 86.2 46.2 59.5 1.2 35.2 52.3 57.5
ProDA [52] ST 88.1 57.1 81.2 46.1 45.2 41.5 55.1 56.2 86.1 45.1 78.1 73.2 40.1 88.8 48.7 60.1 1.1 50.3 53.1 57.6
Ours ST 93.8 59.7 90.1 38.0 33.4 39.9 45.3 30.5 92.2 58.2 94.8 81.9 47.9 93.2 40.1 53.1 13.1 51.2 58.2 58.5
Table 1: Quantitative comparison with state-of-the-art methods on GTA5 Cityscapes in terms of mIoU. AT: methods based on adversarial training; ST: methods based on self-training. : a method using a different network architecture.
SYNTHIA Cityscapes
Methods   

Type

road

side.

build.

wall*

fence*

pole*

light

sign

veg.

sky

person

rider

car

bus

motor

bike

mIoU

mIoU*

Source-only AT 53.4 23.4 73.0 5.5 0.0 25.7 6.6 7.0 77.9 55.3 52.9 21.0 60.9 6.6 21.8 33.7 32.5 37.6
AdaptSeg [43] AT 84.3 42.7 77.5 - - - 4.7 7.0 77.9 82.5 54.3 21.0 72.3 32.2 18.9 32.3 - 46.7
CBST [58] ST 68.0 29.9 76.3 10.8 1.4 33.9 22.8 29.5 77.6 78.3 60.6 28.3 81.6 23.5 18.8 39.8 38.9 42.6
CRST [59] ST 67.7 32.2 73.9 10.7 1.6 37.4 22.2 31.2 80.8 80.5 60.8 29.1 82.8 25.0 19.4 45.3 43.8 50.1
CAG_UDA [53] ST 84.7 40.8 81.7 7.8 0.0 35.1 13.3 22.7 84.5 77.6 64.2 27.8 80.9 19.7 22.7 48.3 44.5 51.5
FDA [51] ST 79.3 35.0 73.2 - - - 19.9 24.0 61.7 82.6 61.4 31.1 83.9 40.8 38.4 51.1 - 52.5
PLCA [20] - 82.6 29.0 81.0 11.2 0.2 33.6 24.9 18.3 82.8 82.3 62.1 26.5 85.6 48.9 26.8 52.2 46.8 54.0
TPLD [37] ST 80.9 44.3 82.2 19.9 0.3 40.6 20.5 30.1 77.2 80.9 60.6 25.5 84.8 41.1 24.7 43.7 47.3 53.5
CorDA [47] ST 93.3 61.6 85.3 19.6 5.1 37.8 36.6 42.8 84.9 90.4 69.7 41.8 85.6 38.4 32.6 53.9 55.0 62.8
ProDA [52] ST 87.3 45.1 84.2 36.5 0.0 43.3 54.7 36.0 88.3 83.1 71.5 24.4 88.4 50.1 40.1 45.6 55.1 61.3
Ours ST 83.8 42.2 85.3 16.4 5.7 43.1 48.3 30.2 89.3 92.1 68.2 43.1 89.7 47.2 42.2 54.2 55.6 62.9
Table 2: Quantitative comparison with state-of-the-art methods on SYNTHIA Cityscapes results in terms of mIoU. We report the results for 13 classes (mIoU) and 16 classes (mIoU). AT: methods based on adversarial training; ST: methods based on self-training.
(a) Target images.
(b) Baseline.
(c) Ours.
(d) GT labels.
Figure 4: Qualitative comparisons on GTA5 Cityscapes. Our model gives better results than the baseline. (Best viewed in color)
(a) Baseline. (b) Ours.
Figure 5: t-SNE visualization of a baseline (a) and our model (b). (Best viewed in color)
Table 3: Quantitative results for variants of our model. We report mIoU scores for 19 and 16 classes on GTA5 Cityscapes and SYNTHIA Cityscapes, respectively. width=1center (w/o cal.) (w/ cal.) Source dataset GTA5 SYNTHIA 49.5 45.1 51.2 48.8 53.5 51.3 55.3 53.5 57.1 55.6

4.2 Results

4.2.1 Quantitative results.

We compare our method with the state-of-the-art methods on GTA5 Cityscapes and SYNTHIA Cityscapes in Tables 1 and 2, respectively. Note that all methods in the tables are based on the DeepLab-V2 [1] architecture with ResNet-101, except for CAG-UDA [53]. For a fair comparison, we report the results of ProDA [52] using the same network architecture as other methods, reproduced using an official source code. CBST [58] uses a self-training-based method to perform a class-aware alignment. This method is similar to our baseline, but it uses a limited number of pseudo labels, being outperformed by our approach on both benchmarks. PLCA [20] uses a pixel-wise association method to align source and target domains in a pixel-level. This method, however, fails to obtain compact feature representations, and it is hence outperformed by our approach on both benchmarks. CorDA [47] uses depth maps of source and target domains to transfer the knowledge of a source domain to a target one. Our method outperforms CorDA [47] on both benchmarks even without using the depth information, indicating that our contrastive learning framework effectively transfers the knowledge across domains using pseudo labels. ProDA [52] focuses on removing false-positives of pseudo labels [58] and uses sparse labels. Different from ProDA [52], we are interested in generating additional labels based upon the ones obtained by the approach of  [58]. That is, our method focuses on obtaining more true-positives and generating denser labels using pixel-prototype correspondences. Other than ProDA [52], we additionally use the bi-directional contrastive loss to minimize intra-class variations and maximize inter-class variations of pixel-level features. We achieve mIoU gains of 0.6% and 1.6% for GTA5 Cityscapes and SYNTHIA Cityscapes, respectively, compared to ProDA [52]. The results imply that our method effectively learns domain-invariant and discriminative representations with denser pseudo labels, improving the mIoU performance of semantic segmentation. Additional comparisons with ProDA [52] are available in the supplement. We also report mIoU scores for the test split of Cityscapes, obtained from an official evaluation server, which has been ignored by most previous works. We use official source codes provided by the authors to obtain the results of state-of-the-art methods. We achieve non-trivial mIoU gains over CorDA [47] and ProDA [52] for the test split of Cityscapes, demonstrating that ours can generalize better than them. Considering the performance gains of recent UDASS methods, the results are significant. For example, FDA [51] achieves a mIoU gain of 0.3% over CAG_UDA [53], and TPLD [37] gets the gain of 0.7% over FDA [51]. CorDA [47] and ProDA [52] provide large mIoU gains compared to other methods, but the improvements mainly come from exploiting additional depth maps and applying post-processing method, respectively.

4.2.2 Qualitative results.

We show in Fig. 4 segmentation results on the GTA5 Cityscapes task. Compared to the baseline model, our model provides more accurate segmentation results (e.g., the bus in the first row, and the road and the rider in the second row). We show in Fig. 5 the t-SNE plot of feature representations of our model and the baseline. We visualize features of source and target images for each method by red and blue circles, respectively. The results show that our method successfully aligns the features for the same object category and separates them for different ones. That is, it minimizes intra-class variations, and maximizes inter-class variations, regardless of domains.

4.2.3 Ablation study.

We present in Table 3 an ablation analysis for each component of our framework on GTA5 Cityscapes and SYNTHIA Cityscapes. We show mIoU scores for variants of our model on the validation split of Cityscapes. As a baseline in the first row, we use static pseudo labels, obtained by the method of [58], to perform a class-aware alignment between source and target domains. We can see from the second row that FCL gives better mIoU scores, demonstrating the effectiveness of our approach to aligning prototypes and pixel-level features across domains. From the first and third rows, we can clearly see that jointly optimizing two contrastive terms is effective to UDASS. The fourth row demonstrates that leveraging additional dynamic pseudo labels provides better results than exploiting the static ones alone in terms of the mIoU score, even without the calibration (w/o cal.). We can observe from the fifth row that the calibration (w/ cal.) reduces domain discrepancies, and further improves the performance significantly.

4.2.4 Comparison of pseudo labels.

We measure the densities of various pseudo labels and corresponding label accuracies, and report the results in Table 6. We can see that the densities of dynamic pseudo labels are slightly higher than that of a static one, even without calibrating domain biases, while maintaining the label accuracies. Using pixel-prototype correspondences between target and source domains leads to obtaining denser labels than [58]. The calibration process largely densifies dynamic pseudo labels. We can establish more correct correspondences between source and target domains by using the calibration process. The approach of [58] neglects the biases between source and target domains. Different from [58], ours compensate for the class-wise domain biases and generate more accurate and denser labels than [58]. Hybrid pseudo labels that combine static and dynamic ones provide the best result in terms of the label density and accuracy. When obtaining hybrid pseudo labels, we can reduce the number of incorrect static labels [58] by comparing them with dynamic ones. We show in Fig. 6 examples of dynamic pseudo labels obtained with and without the class-wise calibration. The results show that calibrating class-wise domain biases for source prototypes leads to establishing more correct pixel-prototype correspondences, providing denser and more accurate pseudo labels.

In Fig. 7, we compare generated pseudo labels using instance-wise prototypes  and momentum-based ones . We can see that using instance-wise prototypes  provides more diverse pseudo labels. They are more various than the other ones  slowly moving with momentum, and lead our model to establish diverse pixel-prototype correspondences.

(a) w/o cal. (b) w/ cal. (c) GT labels.
Figure 6: Visualization of dynamic pseudo labels. (a-b) Pseudo labels obtained without and with calibrating prototypes of a source domain; (c) Target labels.
Table 4: Quantitative results for various pseudo labels of a target domain. We report the densities of static, dynamic, and hybrid pseudo labels and corresponding label accuracies. width=1center Pseudo labels Density(%) Accuracy(%) Static  [58] 20.1 98.5 Dyn. (w/o cal.) 22.2 98.6 Dyn. (w/ cal.) 34.3 98.6 Hybrid 42.3 98.8
(a) Using .
(b) Using .
Figure 7: Pseudo labels at 30 and 60 iterations using (a) and (b), respectively.

5 Conclusion

We have introduced a novel contrastive learning framework for UDASS. Our key idea is to use cross-domain pixel-prototype correspondences to learn domain-invariant and discriminative representations. We have introduced a bi-directional contrastive loss to align the features for the same object category and seperate them for different ones. We have also introduced an approach to generating pseudo labels dynamically in a nonparametric way using pixel-prototype correspondences, while compensating class-wise domain biases between source and target domains. Experimental results show the effectiveness of our framework, setting a new state of the art on standard benchmarks.

5.0.1 Acknowledgements.

This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.RS-2022-00143524, Development of Fundamental Technology and Integrated Solution for Next-Generation Automatic Artificial Intelligence System, and No.2022-0-00124, Development of Artificial Intelligence Technology for Self-Improving Competency-Aware Learning Capabilities), and the Yonsei Signature Research Cluster Program of 2022 (2022-22-0002).

References

  • [1] L. Chen, G. Papandreou, I. Kokkinos, K. Murphy, and A. L. Yuille (2015) Semantic image segmentation with deep convolutional nets and fully connected CRFs. ICLR. Cited by: §1, §4.1.2, §4.2.1.
  • [2] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton (2020) A simple framework for contrastive learning of visual representations. In ICML, Cited by: §2.0.3.
  • [3] Y. Chen, W. Chen, Y. Chen, B. Tsai, Y. Frank Wang, and M. Sun (2017) No more discrimination: cross city adaptation of road scene segmenters. In ICCV, Cited by: §1, §2.0.1.
  • [4] Y. Chen, W. Li, and L. Van Gool (2018) ROAD: reality oriented adaptation for semantic segmentation of urban scenes. In CVPR, Cited by: §1, §2.0.1.
  • [5] Y. Chen, Y. Lin, M. Yang, and J. Huang (2019) CrDoCo: pixel-level domain transfer with cross-domain consistency. In CVPR, Cited by: §1, §2.0.1.
  • [6] M. Cordts, M. Omran, S. Ramos, T. Scharwächter, M. Enzweiler, R. Benenson, U. Franke, S. Roth, and B. Schiele (2015) The cityscapes dataset. In CVPR Workshop, Cited by: §1, §1, §4.1.1.
  • [7] J. Deng, W. Dong, R. Socher, L. Li, K. Li, and L. Fei-Fei (2009) ImageNet: a large-scale hierarchical image database. In CVPR, Cited by: §4.1.2.
  • [8] S. Di, H. Zhang, C. Li, X. Mei, D. Prokhorov, and H. Ling (2017)

    Cross-domain traffic scene understanding: a dense correspondence-based transfer learning approach

    .
    IEEE Trans. ITS 19 (3). Cited by: §2.0.4.
  • [9] N. Dong and E. P. Xing (2018) Few-shot semantic segmentation with prototype learning.. In BMVC, Cited by: §2.0.2.
  • [10] L. Du, J. Tan, H. Yang, J. Feng, X. Xue, Q. Zheng, X. Ye, and X. Zhang (2019) SSF-DAN: separated semantic feature based domain adaptation network for semantic segmentation. In ICCV, Cited by: §1, §2.0.1.
  • [11] Z. Fang, J. Wang, L. Wang, L. Zhang, Y. Yang, and Z. Liu (2021) SEED: self-supervised distillation for visual representation. ICLR. Cited by: §4.1.2.
  • [12] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky (2016)

    Domain-adversarial training of neural networks

    .
    JMLR. Cited by: §1, §2.0.1.
  • [13] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick (2020) Momentum contrast for unsupervised visual representation learning. In CVPR, Cited by: §2.0.3.
  • [14] K. He, X. Zhang, S. Ren, and J. Sun (2016) Deep residual learning for image recognition. In CVPR, Cited by: §4.1.2.
  • [15] J. Hoffman, E. Tzeng, T. Park, J. Zhu, P. Isola, K. Saenko, A. Efros, and T. Darrell (2018) CyCADA: cycle-consistent adversarial domain adaptation. In ICML, Cited by: §1, §2.0.1, §4.1.1.
  • [16] J. Hoffman, D. Wang, F. Yu, and T. Darrell FCNs in the wild: pixel-level adversarial and constraint-based adaptation. arXiv preprint arXiv:1612.02649. Cited by: §1, §2.0.1.
  • [17] Z. Huang, X. Wang, L. Huang, C. Huang, Y. Wei, and W. Liu (2019) CCNet: criss-cross attention for semantic segmentation. In ICCV, Cited by: §1.
  • [18] P. Isola, J. Zhu, T. Zhou, and A. A. Efros (2017) Image-to-image translation with conditional adversarial networks. In CVPR, Cited by: §2.0.1.
  • [19] G. Kang, L. Jiang, Y. Yang, and A. G. Hauptmann (2019) Contrastive adaptation network for unsupervised domain adaptation. In CVPR, Cited by: §2.0.3.
  • [20] G. Kang, Y. Wei, Y. Yang, Y. Zhuang, and A. Hauptmann (2020) Pixel-level cycle association: a new perspective for domain adaptive semantic segmentation. In NeurIPS, Cited by: §2.0.1, §4.2.1, Table 1, Table 2.
  • [21] J. Kiefer and J. Wolfowitz (1952) Stochastic estimation of the maximum of a regression function. The Annals of Mathematical Statistics. Cited by: §4.1.2.
  • [22] G. Li, G. Kang, W. Liu, Y. Wei, and Y. Yang (2020) Content-consistent matching for domain adaptive semantic segmentation. In ECCV, Cited by: §1, §2.0.1, §3.1, §3.2, §3.3, §3.4.
  • [23] Y. Li, L. Yuan, and N. Vasconcelos (2019) Bidirectional learning for domain adaptation of semantic segmentation. In CVPR, Cited by: §1, §2.0.1.
  • [24] C. Liu, J. Yuen, and A. Torralba (2010) SIFT flow: dense correspondence across scenes and its applications. IEEE Trans. PAMI 33 (5). Cited by: §2.0.4.
  • [25] C. Liu, J. Yuen, and A. Torralba (2011) Nonparametric scene parsing via label transfer. IEEE Trans. PAMI 33 (12). Cited by: §2.0.4.
  • [26] J. Long, E. Shelhamer, and T. Darrell (2015) Fully convolutional networks for semantic segmentation. In CVPR, Cited by: §1.
  • [27] Y. Luo, P. Liu, T. Guan, J. Yu, and Y. Yang (2019) Significance-aware information bottleneck for domain adaptive semantic segmentation. In ICCV, Cited by: §1, §2.0.1.
  • [28] Y. Luo, L. Zheng, T. Guan, J. Yu, and Y. Yang (2019) Taking a closer look at domain shift: category-level adversaries for semantics consistent domain adaptation. In CVPR, Cited by: §1, §2.0.1.
  • [29] T. Malisiewicz, A. Gupta, and A. A. Efros (2011) Ensemble of Exemplar-SVMs for object detection and beyond. In ICCV, Cited by: §2.0.4.
  • [30] Z. Murez, S. Kolouri, D. Kriegman, R. Ramamoorthi, and K. Kim (2018) Image to image translation for domain adaptation. In CVPR, Cited by: §1, §2.0.1.
  • [31] M. Najafi, S. T. Namin, M. Salzmann, and L. Petersson (2016) Sample and filter: nonparametric scene parsing via efficient filtering. In CVPR, Cited by: §2.0.4.
  • [32] S. R. Richter, V. Vineet, S. Roth, and V. Koltun (2016) Playing for data: ground truth from computer games. In ECCV, Cited by: §1, §1, §2.0.1, §4.1.1.
  • [33] O. Ronneberger, P. Fischer, and T. Brox (2015) U-Net: convolutional networks for biomedical image segmentation. In MICCAI, Cited by: §1.
  • [34] G. Ros, L. Sellart, J. Materzynska, D. Vazquez, and A. M. Lopez (2016) The synthia dataset: a large collection of synthetic images for semantic segmentation of urban scenes. In CVPR, Cited by: §1, §1, §2.0.1, §4.1.1.
  • [35] B. C. Russell, A. Efros, J. Sivic, W. T. Freeman, and A. Zisserman (2009) Segmenting scenes by matching image composites. Cited by: §2.0.4.
  • [36] S. Sankaranarayanan, Y. Balaji, A. Jain, S. N. Lim, and R. Chellappa Unsupervised domain adaptation for semantic segmentation with gans. arXiv preprint arXiv:1711.06969. Cited by: §1, §2.0.1.
  • [37] I. Shin, S. Woo, F. Pan, and I. S. Kweon (2020) Two-phase pseudo label densification for self-training based domain adaptation. In ECCV, Cited by: §4.2.1, Table 1, Table 2.
  • [38] A. Shrivastava, T. Malisiewicz, A. Gupta, and A. A. Efros (2011)

    Data-driven visual similarity for cross-domain image matching

    .
    In SIGGRAPH Asia, Cited by: §2.0.4.
  • [39] G. Singh and J. Kosecka (2013) Nonparametric scene parsing with adaptive feature relevance and semantic context. In CVPR, Cited by: §2.0.4.
  • [40] J. Snell, K. Swersky, and R. S. Zemel (2017) Prototypical networks for few-shot learning. NeurIPS. Cited by: §2.0.2.
  • [41] L. Song, Y. Li, Z. Li, G. Yu, H. Sun, J. Sun, and N. Zheng (2019) Learnable tree filter for structure-preserving feature transform. NeurIPS. Cited by: §1.
  • [42] R. Sun, X. Zhu, C. Wu, C. Huang, J. Shi, and L. Ma (2019) Not all areas are equal: transfer learning for semantic segmentation via hierarchical region selection. In CVPR, Cited by: §1, §2.0.1.
  • [43] Y. Tsai, W. Hung, S. Schulter, K. Sohn, M. Yang, and M. Chandraker (2018) Learning to adapt structured output space for semantic segmentation. In CVPR, Cited by: §1, §4.1.1, Table 1, Table 2.
  • [44] Y. Tsai, K. Sohn, S. Schulter, and M. Chandraker (2019) Domain adaptation for structured output via discriminative patch representations. In ICCV, Cited by: §1, §2.0.1.
  • [45] T. Uricchio, L. Ballan, L. Seidenari, and A. Del Bimbo (2017) Automatic image annotation via label transfer in the semantic space. PR 71. Cited by: §2.0.4.
  • [46] K. Wang, J. H. Liew, Y. Zou, D. Zhou, and J. Feng (2019) PANet: few-shot image semantic segmentation with prototype alignment. In ICCV, Cited by: §2.0.2.
  • [47] Q. Wang, D. Dai, L. Hoyer, L. Van Gool, and O. Fink (2021) Domain adaptive semantic segmentation with self-supervised depth estimation. In ICCV, Cited by: §4.2.1, Table 1, Table 2.
  • [48] Z. Wang, M. Yu, Y. Wei, R. Feris, J. Xiong, W. Hwu, T. S. Huang, and H. Shi (2020) Differential treatment for stuff and things: a simple unsupervised domain adaptation method for semantic segmentation. In CVPR, Cited by: §1, §2.0.1.
  • [49] J. Yang, W. An, S. Wang, X. Zhu, C. Yan, and J. Huang (2020) Label-driven reconstruction for domain adaptation in semantic segmentation. In ECCV, Cited by: §1, §2.0.1.
  • [50] Y. Yang, D. Lao, G. Sundaramoorthi, and S. Soatto (2020) Phase consistent ecological domain adaptation. In CVPR, Cited by: §1, §3.2, §3.3, §3.4.
  • [51] Y. Yang and S. Soatto (2020) FDA: fourier domain adaptation for semantic segmentation. In CVPR, Cited by: §1, §3.2, §3.3, §3.4, §4.2.1, Table 1, Table 2.
  • [52] P. Zhang, B. Zhang, T. Zhang, D. Chen, Y. Wang, and F. Wen (2021) Prototypical pseudo label denoising and target structure learning for domain adaptive semantic segmentation. In CVPR, Cited by: §2.0.1, §4.1.2, §4.2.1, Table 1, Table 2.
  • [53] Q. Zhang, J. Zhang, W. Liu, and D. Tao (2019) Category anchor-guided unsupervised domain adaptation for semantic segmentation. NeurIPS. Cited by: §4.2.1, Table 1, Table 2.
  • [54] Y. Zhang, P. David, and B. Gong (2017) Curriculum domain adaptation for semantic segmentation of urban scenes. In ICCV, Cited by: §3.2, §3.3.
  • [55] Y. Zhang, Z. Qiu, T. Yao, D. Liu, and T. Mei (2018) Fully convolutional adaptation networks for semantic segmentation. In CVPR, Cited by: §1, §2.0.1.
  • [56] S. Zheng, S. Jayasumana, B. Romera-Paredes, V. Vineet, Z. Su, D. Du, C. Huang, and P. H. Torr (2015)

    Conditional random fields as recurrent neural networks

    .
    In ICCV, Cited by: §1.
  • [57] J. Zhu, T. Park, P. Isola, and A. A. Efros (2017) Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, Cited by: §2.0.1.
  • [58] Y. Zou, Z. Yu, B. Kumar, and J. Wang (2018) Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In ECCV, Cited by: §1, §2.0.1, §3.1, §3.2, §3.3, §3.4, Figure 6, §4.1.1, §4.2.1, §4.2.3, §4.2.4, Table 1, Table 2.
  • [59] Y. Zou, Z. Yu, X. Liu, B. Kumar, and J. Wang (2019) Confidence regularized self-training. In ICCV, Cited by: §1, §2.0.1, §3.2, §3.3, §3.4, §4.1.1, Table 1, Table 2.