Test Time Adaptation Using Adaptive Quantile Recalibration

Paria Mehrbod, Pedro Vianna, Geraldin Nanfack, Guy Wolf, Eugene Belilovsky

TL;DR

This paper introduces Adaptive Quantile Recalibration (AQR), a novel test-time adaptation technique that aligns internal feature distributions of deep learning models to their source domain distributions. AQR effectively handles complex activation distributions and diverse normalization layers, outperforming existing methods on challenging corrupted datasets.

What Problem Does This Paper Address?

Deep learning models often perform poorly when deployed in real-world scenarios where the data distribution differs from the training data (distribution shift). While test-time adaptation (TTA) methods aim to address this by adapting models using only test data, many existing approaches have limitations. Some assume activations follow a Gaussian distribution, which is often not true for complex networks. Others are restricted to specific normalization layers like BatchNorm, making them incompatible with modern architectures using GroupNorm or LayerNorm. Furthermore, some methods require retraining or can degrade over time. This paper tackles the challenge of creating a robust, generalizable, and architecture-agnostic TTA method that can adapt to distribution shifts without prior knowledge of the target domain.

Methods

The core of AQR is a nonparametric quantile-based transformation applied to the pre-activation features of a neural network during inference.

Here's a breakdown:

  • Setup Phase: After training on the source domain, the method computes and stores the percentiles of pre-activation values for each channel in each layer. This creates a "memory" of the in-distribution feature characteristics.
  • Inference Phase: For incoming test data batches, AQR computes the percentiles of the current pre-activation values. It then uses a piecewise linear transformation to map these test-time percentiles to the corresponding source-domain percentiles. This effectively "recalibrates" the feature distributions to match what the model saw during training.
  • Architecture Agnostic: AQR works independently of the specific normalization layer (BatchNorm, GroupNorm, LayerNorm) used in the network.
  • Tail Calibration: A significant contribution is addressing the instability of estimating extreme percentiles (tails of the distribution) with small batch sizes. AQR incorporates a robust strategy, "Average Sample Tails," which involves sampling multiple small batches, estimating tail percentiles, and averaging them for more stable estimates. This is crucial because tail values can be highly volatile and impact adaptation.

Datasets

The paper evaluates AQR on several standard benchmarks for robustness and domain adaptation:

  • CIFAR-10-C, CIFAR-100-C, and ImageNet-C: These are corrupted versions of CIFAR-10, CIFAR-100, and ImageNet, respectively. They feature 19 different corruption types (e.g., noise, blur, weather) at five severity levels, making them ideal for testing robustness to distribution shifts.
  • CIFAR-10, CIFAR-100, and ImageNet-1K: The original datasets are used for training and evaluating the models.

Key Insights and Ideas

  • Quantile Alignment is Powerful: The paper demonstrates that aligning the entire distribution shape via quantiles, rather than just mean and variance (as some methods do), is crucial for effectively adapting to complex, non-Gaussian feature distributions.
  • Tail Calibration is Essential for Robustness: The extreme ends of feature distributions are highly sensitive to batch size and corruption. AQR's dedicated tail calibration strategy significantly improves performance, especially in challenging scenarios.
  • Architecture Independence is Key for Modern Networks: The ability of AQR to work with various normalization layers (BN, GN, LN) makes it highly relevant for current deep learning architectures, which often move away from exclusive reliance on BatchNorm.
  • Fixed Source Statistics Offer Stability: By using pre-computed source statistics, AQR avoids the potential drift and instability that can occur with methods that continuously update parameters during inference.

Key Results

  • State-of-the-Art Performance: AQR consistently outperforms existing TTA baselines (TTN, TENT, SAR) across multiple datasets, architectures, and corruption severities, particularly on the challenging ImageNet-C dataset.
  • Significant Gains at Higher Severities: AQR's advantage over baselines grows substantially as corruption severity increases, highlighting its robustness.
  • Broad Architectural Applicability: AQR shows strong performance on ResNets (with BN and GN) and Vision Transformers (with LN), demonstrating its versatility.
  • Batch Size Matters for Tails: The performance gap between AQR and baselines widens with larger batch sizes, reinforcing the importance of robust tail estimation, especially at smaller batch sizes.
  • Tail Calibration Strategy Impact: The "Average Sample Tails" strategy for tail calibration yields the highest accuracy, significantly outperforming simpler methods like "Not Calibrated" or aggressive "Clipping."

Limitations and Future Work

  • Episodic vs. Online Adaptation: AQR is currently designed for episodic (batch-independent) test-time adaptation. While this offers stability, it doesn't accumulate knowledge across sequential batches. Future work could explore combining AQR with other TTA methods to enable online adaptation while preserving its stability.
  • Computational Cost: While AQR is designed for inference, computing percentiles and applying transformations adds some overhead. The paper mentions that for complex datasets like ImageNet with ViTs, applying AQR only to the top half of the network was beneficial, suggesting potential trade-offs in where to apply it for efficiency.
  • Further Exploration of Online Settings: The authors suggest extending AQR to online settings, which would be valuable for truly dynamic real-world applications where data arrives sequentially.

Summary updated

BibTeX
@inproceedings{mehrbod2026test,
  author = {Paria Mehrbod and Pedro Vianna and Geraldin Nanfack and Guy Wolf and Eugene Belilovsky},
  title = {{Test Time Adaptation Using Adaptive Quantile Recalibration}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2026},
}
Figure