Abstract
Object detection models often suffer from performance degradation when encountering domain shifts at test time. We present STFAR (Self-Training with Feature Alignment Regularization), a framework for Test-Time Adaptive Object Detection (TTAOD). STFAR adapts pre-trained models to unlabeled data streams in real-time without requiring access to the original source training data. By integrating teacher-student self-training with a novel two-level feature alignment strategy—global and foreground—STFAR effectively mitigates confirmation bias and stabilizes the adaptation process. Experimental results on COCO-C, PASCAL-C, and Foggy-Cityscapes demonstrate that STFAR achieves state-of-the-art performance, significantly improving robustness against various environmental corruptions.
Introduction
Deep learning models for object detection are highly effective but notoriously "brittle" when faced with out-of-distribution data. A model trained on clear weather may fail in rain, snow, or fog. While Unsupervised Domain Adaptation (UDA) can address this, it typically requires simultaneous access to source and target data, which is often impractical due to privacy or storage constraints on edge devices like self-driving cars.
This paper addresses Test-Time Adaptive Object Detection (TTAOD). The objective is to adapt a pre-trained model to a stream of unlabeled data in real-time, on-the-fly, without ever looking back at the original source training images.
Methods: The STFAR Framework
The proposed STFAR framework combines two main components to achieve robust test-time adaptation:
- Self-Training (ST): Utilizing a "Teacher-Student" architecture, a Teacher model (an exponential moving average of the Student) generates pseudo-labels on weakly augmented images. The Student model is then trained to predict these labels on strongly augmented versions of the same images.
- Feature Alignment Regularization (FAR): To counter the "confirmation bias" inherent in self-training—where the model reinforces its own errors—STFAR regularizes the Student's internal features to match the distribution of features seen during original training.
A key innovation of STFAR is its two-level alignment strategy:
- Global Feature Alignment: Aligns the distribution of the entire backbone feature map.
- Foreground Feature Alignment: Specifically targets features within the "Regions of Interest" (ROIs) identified by the detector. This is critical for maintaining the performance of the classification and regression heads by ensuring object-level features remain consistent with the source domain.
To operate without source data, source feature statistics (mean and variance) are pre-computed offline and stored as compact multivariate Gaussians. During testing, target distributions are updated incrementally using an exponential moving average to ensure stability against outliers in the data stream.
Experimental Evaluation
STFAR was evaluated on three major benchmarks modified with corruptions to simulate real-world distribution shifts: COCO-C, PASCAL-C, and Foggy-Cityscapes.
Key Results
STFAR consistently outperformed existing test-time adaptation methods such as TENT, SHOT, and TTAC across all benchmarks, setting a new state-of-the-art.
Quantitative improvements include:
- COCO-C (ResNet-50): mAP increased from 15.9% (Direct Test) to 24.7%.
- PASCAL-C: mAP improved from 30.5% to 46.1%.
- Foggy-Cityscapes: mAP rose from 19.7% to 25.1%.
Qualitative analysis shows that STFAR is significantly better at detecting small or distant objects in challenging conditions like heavy snow or blur, where baseline models often fail to detect anything but noise.
Conclusion and Future Work
STFAR demonstrates that combining self-training with multi-level feature alignment effectively improves object detection robustness at test-time. While the method requires pre-computing source statistics and introduces some computational overhead due to multiple gradient updates per batch, it provides a powerful solution for real-world deployment. Future research may explore "continual" TTA, where models must adapt to multiple successive environmental changes without catastrophic forgetting.
Summary updated