Exploring Human-in-the-Loop Test-Time Adaptation by Synergizing Active Learning and Model Selection

Yushu Li, Yongyi Su, Xulei Yang, Kui Jia, Xun Xu

Abstract

Existing test-time adaptation (TTA) approaches often adapt models with the unlabeled testing data stream. A recent attempt relaxed the assumption by introducing limited human annotation, referred to as Human-In-the-Loop Test-Time Adaptation (HILTTA) in this study. The focus of existing HILTTA studies lies in selecting the most informative samples to label, a.k.a. active learning. In this work, we are motivated by a pitfall of TTA, i.e. sensitivity to hyper-parameters, and propose to approach HILTTA by synergizing active learning and model selection. Specifically, we first select samples for human annotation (active learning) and then use the labeled data to select optimal hyper-parameters (model selection). To prevent the model selection process from overfitting to local distributions, multiple regularization techniques are employed to complement the validation objective. A sample selection strategy is further tailored by considering the balance between active learning and model selection purposes. We demonstrate on 5 TTA datasets that the proposed HILTTA approach is compatible with off-the-shelf TTA methods and such combinations substantially outperform the state-of-the-art HILTTA methods. Importantly, our proposed method can always prevent choosing the worst hyper-parameters on all off-the-shelf TTA methods. The source code is available at https://github.com/Yushu-Li/HILTTA.

Introduction

Deep learning models often struggle when encountering distribution shifts at test time—where the incoming data differs significantly from the training set. Test-Time Adaptation (TTA) addresses this by updating model weights on the fly using unlabeled data streams. However, TTA is notoriously sensitive to hyperparameters such as learning rates and confidence thresholds. Without ground-truth labels, unsupervised adaptation can lead to model "collapse," where predictions become increasingly inaccurate.

Comparison of different Test-Time Adaptation settings.

While recent Active TTA (ATTA) methods introduce limited human labels to guide training, they typically rely on fixed, manually tuned hyperparameters. This paper introduces a Human-in-the-Loop (HILTTA) framework that utilizes a small budget of human-labeled samples (approximately 3%) not only for supervision but, crucially, for automated model selection to ensure robust performance.

The HILTTA Framework

The proposed HILTTA approach synergizes active learning and model selection through a three-step process designed for streaming data.

The HILTTA framework overview, illustrating the synergy between Active Learning and Model Selection.

1. Sample Selection (K-Margin)

To maximize the efficiency of human intervention, the system must identify the most informative samples. The authors introduce K-Margin clustering, which selects samples that are both high-uncertainty (where the model is least confident) and diverse (representing different regions of the feature space). This is achieved by weighting features with "margin confidence" and employing K-Center clustering to ensure broad coverage of the test distribution.

2. Model Selection

Once a small batch of samples is labeled by a human, it serves as a mini-validation set. The framework runs multiple "candidate models" in parallel, each with different hyperparameter configurations. The system then selects the optimal model $\theta^*$ that minimizes the validation loss on these labeled samples.

3. Regularization for Stability

Given the small size of the validation set, there is a risk of overfitting to local data fluctuations. To mitigate this, the authors employ two regularization techniques:

  • Anchor Deviation: A penalty for moving too far from the original source model's predictions.
  • Smoothed Scoring: An Exponential Moving Average (EMA) of validation losses to ensure hyperparameter transitions remain stable over time.

Experimental Results

The researchers evaluated HILTTA across five diverse benchmarks: CIFAR10-C, CIFAR100-C, ImageNet-C, ImageNet-D (style-transfer), and ModelNet40-C (3D point clouds).

  • Superior Accuracy: On ImageNet-C, HILTTA combined with the TENT algorithm achieved an error rate of 58.35%, significantly outperforming unsupervised TENT (73.13%) and even the best-case fixed hyperparameter scenario (62.96%).
  • Robustness to Hyperparameters: Unlike standard TTA methods that exhibit wild performance swings based on learning rates, HILTTA maintains optimal performance by adapting parameters dynamically. It consistently prevents "worst-case" scenarios where adaptation would otherwise fail.
  • Efficiency: Despite the parallel candidate models, the K-Margin selection process is roughly 3x faster than competing active TTA methods that require complex gradient embeddings.

Conclusion

HILTTA demonstrates that the primary value of human labels in test-time adaptation extends beyond simple supervision; they provide a vital "compass" for hyperparameter tuning. By synergizing active learning with model selection, the framework transforms TTA into a robust, self-correcting system. Future work will focus on optimizing the candidate pool search and reducing the computational overhead for deployment on resource-constrained edge devices.

Summary updated

BibTeX
@article{li2024exploring,
  author = {Yushu Li and Yongyi Su and Xulei Yang and Kui Jia and Xun Xu},
  title = {{Exploring Human-in-the-Loop Test-Time Adaptation by Synergizing Active Learning and Model Selection}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=P09rAv8UH7},
}
Figure