Introduction
Deep learning models, particularly Convolutional Neural Networks (CNNs), face significant challenges during real-world deployment. High-accuracy models like ResNet101 are often too computationally expensive for edge devices, and their performance typically degrades when moved from a controlled source domain to an unlabeled target domain—a phenomenon known as domain shift.
While Knowledge Distillation (KD) addresses model compression and Unsupervised Domain Adaptation (UDA) addresses domain shift, they are traditionally treated as sequential, independent steps. This paper proposes a joint optimization framework that simultaneously compresses a model and adapts it to a new environment, avoiding the sub-optimal results of sequential processing.
The KD-UDA Framework
The authors introduce a joint optimization strategy where a large Teacher model and a compact Student model are trained together.
The framework consists of several key components:
- Teacher Model ($\phi_T$): Performs UDA using Maximum Mean Discrepancy (MMD) to identify domain-invariant features between labeled source data and unlabeled target data.
- Student Model ($\phi_S$): Mimics the teacher's output through KD. Crucially, the student learns while the teacher is adapting, rather than learning from a static, pre-adapted model.
- Progressive Learning ($\beta$ Scheduler): A weighting parameter $\beta$ grows exponentially during training. Early on, the focus is on the Teacher learning the domain shift; later, the focus shifts to the Student mastering the knowledge distilled from the adapted Teacher.
- Consistency Loss: The student is also trained on labeled source data to ensure it retains fundamental feature recognition capabilities.
Datasets and Domain Shift
The method was evaluated on standard domain adaptation benchmarks, including Office31 and ImageClef-DA. These datasets represent the "messy" real-world environments models must navigate, characterized by variations in lighting, resolution, and background.
- Office31: Features 31 categories across Amazon (web images), DSLR (high-res), and Webcam (low-res) domains.
- ImageClef-DA: A balanced dataset featuring domains from ImageNet, Pascal-VOC, Caltech, and Bing.
Key Results and Insights
The joint approach offers several advantages over standard baselines and state-of-the-art pruning methods like Transfer Channel Pruning (TCP):
- Superior Accuracy: On the Office31 dataset, a ResNet18 student distilled from a ResNet50 teacher achieved an average accuracy of 77.8%, outperforming pruning-based methods which reached approximately 71.3%.
- Efficiency Gains: The ResNet18 student achieved a 56% reduction in FLOPs (floating-point operations) compared to the ResNet50 teacher, making it viable for real-time edge deployment.
- Mitigating the Capacity Gap: By training against a "moving target" (an adapting teacher), the student learns the process of adaptation, which helps bridge the gap between a high-capacity teacher and a low-capacity student.
- Teacher Scaling: Results showed that larger teachers (e.g., ResNet101) lead to even better student performance, confirming that the framework effectively transfers complex knowledge even when the student's architecture remains fixed.
Conclusion and Future Work
The proposed joint KD-UDA framework demonstrates that model compression and domain adaptation are mutually beneficial when optimized together. While the current implementation uses MMD for adaptation, future research could integrate adversarial losses. Additionally, extending this strategy beyond image classification to tasks like object detection or semantic segmentation remains a promising direction for future research.
Summary updated