Bi-Discriminator Domain Adversarial Neural Networks With Class-Level Gradient Alignment

Chuang Zhao, Hongke Zhao, Hengshu Zhu, Zhenya Huang, Nan Feng, Enhong Chen, Hui Xiong

TL;DR

This paper introduces BACG, a novel domain adversarial neural network that improves unsupervised domain adaptation by aligning gradients at the class level and using evidential learning to handle uncertainty. This approach leads to more accurate and robust models, especially when dealing with domain shifts, and a faster variant, Fast-BACG, is also proposed.

What Problem Does This Paper Address?

Unsupervised Domain Adaptation (UDA) is a crucial area in machine learning, aiming to leverage knowledge from a labeled "source" domain to perform well on an unlabeled "target" domain. This is particularly useful when labeling data is expensive or time-consuming. A common challenge is the "domain shift" – differences in data distributions between the source and target domains that can degrade model performance.

Traditional methods often use bi-discriminator adversarial networks to align domain distributions. However, these methods have two main drawbacks:

  1. Accuracy Agnosticism: They focus on making the discriminators' outputs similar, not necessarily on whether the target samples are correctly classified. This can lead to misclassifications even when domain distributions appear aligned.
  2. Overconfident Estimation: Standard softmax-based models can become overconfident in their predictions, even for out-of-distribution samples. This can lead to incorrect alignment with "wrong anchors" in the source domain, further exacerbating the domain shift problem.

Methods

The proposed BACG (Bi-discriminator Domain Adversarial Neural Networks with Class-Level Gradient Alignment) tackles these issues with several key innovations:

  • Class-Level Gradient Alignment: Instead of just aligning global domain distributions, BACG aligns gradients at the class level. The intuition is that samples from the same class in both domains should follow similar optimization paths, leading to better class-specific alignment.
  • Optimizable Nearest Neighbor Pseudo-Labeling: To enable class-level gradient computation on the unlabeled target domain, BACG uses an end-to-end optimizable nearest neighbor algorithm to generate pseudo-labels. This unifies feature extraction and pseudo-labeling, avoiding the inconsistencies of two-stage approaches.
  • Evidential Learning for Uncertainty Estimation: To combat overconfidence and improve source domain sample selection, BACG employs evidential learning. This transforms the standard softmax output into a Multinomial Dirichlet hierarchical model, which provides not only class probabilities but also an estimate of sample uncertainty. This allows the model to select low-uncertainty source samples as "anchors" for gradient alignment, mitigating the impact of misclassified source samples.
  • Fast-BACG (Memory Bank Variant): To address the computational cost of nearest neighbor searches, a memory bank-based variant, Fast-BACG, is introduced. This significantly speeds up training and inference with only a minor drop in accuracy.

Datasets

The proposed BACG algorithm was evaluated on four benchmark datasets:

  • ImageClef: A composite dataset using classes from Caltech-256, ImageNet ILSVRC2012, and PASCAL VOC2012, forming 6 transfer tasks.
  • Visda2017: A challenging simulation-to-real dataset with 12 classes, constructed using training data as the source and test data as the target.
  • STL10 → CIFAR10: Two 10-class image datasets, with some classes removed to create a 9-class problem. Images were downscaled to 32x32.
  • Digits: A collection of three datasets (MNIST, SVHN, USPS) with 10 classes each, used to construct three domain adaptation tasks.

Key Insights and Ideas

  • Gradient alignment is more than just distribution alignment: Focusing on the gradients of class-specific losses provides a finer-grained signal for aligning domains, especially when dealing with class-level distinctions.
  • Uncertainty is key for robust source domain anchoring: By quantifying uncertainty, the model can intelligently select reliable source samples for alignment, avoiding the pitfalls of overconfident predictions and misaligned anchors.
  • End-to-end pseudo-labeling unifies objectives: Integrating pseudo-label generation directly into the training loop of the feature extractor leads to more consistent optimization and better feature representations.
  • Speed vs. Accuracy Trade-off: The Fast-BACG variant demonstrates that significant speed improvements can be achieved with minimal impact on accuracy, making the approach more practical for large-scale applications.

Key Results

BACG consistently outperformed several state-of-the-art baselines across all four benchmark datasets.

  • ImageClef: BACG achieved the best results on all 6 transfer tasks and had the highest average accuracy (90.1%).
  • Visda2017: Despite a larger domain gap, BACG led all baselines, demonstrating its robustness.
  • STL10 → CIFAR10: BACG showed significant improvement in multi-class recognition and class-level performance stability.
  • Digits: BACG achieved the best performance across all three transfer tasks.
  • Fast-BACG: Achieved a large inference speed improvement (e.g., 0.00005s vs. 0.12s per epoch for ImageClef CI) with only a minor accuracy drop (e.g., 93.6% vs. 93.75% for ImageClef CI).

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Adaptive Pseudo-Label Sensitivity: Making pseudo-labels sensitive to both locality and class centrality in a more adaptive manner, rather than simultaneous optimization.
  • Downstream Task Generalization: Verifying the effectiveness of BACG on more semi-supervised downstream tasks like person re-identification and semantic segmentation.
  • Further Improving Pseudo-Labeling: Exploring ways to further enhance the upper limit of classification accuracy by optimizing the balance between task interest and nearest-neighbor classification.

Summary updated

Abstract

Unsupervised domain adaptation aims to transfer rich knowledge from the annotated source domain to the unlabeled target domain with the same label space. One prevalent genre is the bi-discriminator domain adversarial network, which concurrently considers the decision boundaries of both domains during the domain alignment. While effective, methods within this genre still contend with accuracy agnosticism toward the target domain and overconfident estimation in the source domain. Consequently, these two limitations hinder the effectiveness of both decision boundaries. To address the aforementioned challenges, we propose a novel bi-discriminator domain adversarial neural network, denoted as BACG. Specifically, for accuracy awareness of the target domain, we initially devise an optimizable nearest neighbor algorithm for acquiring pseudo-labels of samples, followed by class-level gradient alignment between two domains. This approach explicitly incorporates the accuracy signal from the target domain. To alleviate overconfident estimation in the source domain, we adopt evidential learning theory and develop a multinomial Dirichlet hierarchical model to infer both the classification probability and uncertainty. This approach not only ensures optimal assumptions for the source domain but also guarantees high-quality domain alignment. Additionally, to lower the time overhead caused by pseudo-label assignment, we introduce a memory bank-based variant, namely, fast-BACG, which effectively accelerates the training process at the expense of a slight reduction in accuracy. Extensive experiments and thorough analysis on four benchmark data sets validate the effectiveness and robustness of our algorithm.
BibTeX
@article{zhao2024bi,
  author = {Chuang Zhao and Hongke Zhao and Hengshu Zhu and Zhenya Huang and Nan Feng and Enhong Chen and Hui Xiong},
  title = {{Bi-Discriminator Domain Adversarial Neural Networks With Class-Level Gradient Alignment}},
  journal = {IEEE Trans. Syst. Man Cybern. Syst.},
  year = {2024},
  doi = {10.1109/tsmc.2024.3402750},
}
Figure