GradMix: Multi-source Transfer across Domains and Tasks

Junnan Li, Ziwei Xu, Yongkang Wang, Qi Zhao, Mohan S. Kankanhalli

Introduction

Deep learning's reliance on massive labeled datasets presents a significant barrier for new tasks where data is scarce. While standard transfer learning typically fine-tunes a model from a single source, real-world scenarios often provide access to multiple disparate datasets. These sources frequently exhibit Multi-Source Domain and Task Transfer (MS-DTT) challenges, characterized by both domain shift (variations in visual style) and task shift (differences in label spaces).

GradMix addresses these challenges by intelligently weighting and mixing gradients from multiple source datasets to optimize performance on a target task. Unlike traditional domain adaptation methods that require shared label spaces, GradMix is model-agnostic and capable of transferring knowledge across entirely different tasks.

Methodology: Smart Gradient Mixing

The fundamental premise of GradMix is that not all gradients from source datasets contribute equally to learning the target task. Some data batches may provide useful features, while others might cause "negative transfer."

Layer-wise Gradient Weighting

GradMix assigns specific weights to source gradients at every network layer. Using a small, labeled target validation set as a reference, the algorithm calculates weights that maximize the cosine similarity between the aggregated source gradients and the gradient required to minimize loss on the target validation set.

GradMix architecture overview showing layer-wise gradient weighting to minimize loss on a small target set.

Adaptive Learning Rate (AdaLR)

To further mitigate negative transfer, GradMix employs an Adaptive Learning Rate (AdaLR). If a source mini-batch produces a gradient poorly aligned with the target task (indicated by low cosine similarity), the learning rate for that batch is automatically scaled down, preventing irrelevant data from degrading model weights.

Pseudo-labeling with Ensembles

To utilize unlabeled target data, GradMix employs an ensemble of models to generate high-confidence pseudo-labels. This consensus-based approach ensures that only reliable labels are incorporated into the training process, preventing the model from reinforcing its own errors.

Experimental Evaluation

The authors evaluated GradMix across two primary benchmarks designed to test domain and task shift simultaneously.

Overview of Multi-Source Domain and Task Transfer (MS-DTT) benchmarks for Digit and Action Recognition.
  1. Digit Recognition: Sources included SVHN (digits 5-9) and MNIST (digits 0-4), with the target being MNIST (digits 5-9). This requires the model to bridge both visual domain gaps and distinct label sets.
  2. Action Recognition: Sources included MPII (human activity images) and BU101 (web images), targeting UCF101 (video action recognition). This benchmark tests the transition from static images to temporal video data.

Key Results and Insights

GradMix demonstrates exceptional performance in low-data regimes. In the digit recognition task with only two labeled samples per class ($k=2$), GradMix achieved 91.17% accuracy, significantly outperforming standard fine-tuning (89.94%) and target-only training (71.35%).

Furthermore, GradMix shows strong synergy with semi-supervised learning (SSL). When integrated with MixMatch at $k=2$, accuracy reached 96.30%, nearly matching performance levels typically requiring thousands of labels. In action recognition, GradMix outperformed specialized baselines like EnergyNet and MDDA, proving the robustness of gradient-mixing in high-dimensional tasks.

Conclusion

GradMix offers a powerful, model-agnostic framework for multi-source transfer learning. By treating gradients as a universal language for optimization and applying layer-wise meta-learning, it effectively navigates complex domain and task shifts. While it introduces a ~40% computational overhead during training, its ability to achieve high accuracy with minimal target data makes it a compelling solution for data-constrained applications.

Summary updated

Abstract

The computer vision community is witnessing an unprecedented rate of new tasks being proposed and addressed, thanks to the deep convolutional networks' capability to find complex mappings from X to Y. The advent of each task often accompanies the release of a large-scale annotated dataset, for supervised training of deep network. However, it is expensive and time-consuming to manually label sufficient amount of training data. Therefore, it is important to develop algorithms that can leverage off-the-shelf labeled dataset to learn useful knowledge for the target task. While previous works mostly focus on transfer learning from a single source, we study multi-source transfer across domains and tasks (MS-DTT), in a semi-supervised setting. We propose GradMix, a model-agnostic method applicable to any model trained with gradient-based learning rule, to transfer knowledge via gradient descent by weighting and mixing the gradients from all sources during training. GradMix follows a meta-learning objective, which assigns layer-wise weights to the source gradients, such that the combined gradient follows the direction that minimize the loss for a small set of samples from the target dataset. In addition, we propose to adaptively adjust the learning rate for each mini-batch based on its importance to the target task, and a pseudo-labeling method to leverage the unlabeled samples in the target domain. We conduct MS-DTT experiments on two tasks: digit recognition and action recognition, and demonstrate the advantageous performance of the proposed method against multiple baselines.
BibTeX
@inproceedings{li2020gradmix,
  author = {Junnan Li and Ziwei Xu and Yongkang Wang and Qi Zhao and Mohan S. Kankanhalli},
  title = {{GradMix: Multi-source Transfer across Domains and Tasks}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2020},
  doi = {10.1109/wacv45572.2020.9093343},
}
Figure