Decentralizing Test-time Adaptation under Heterogeneous Data Streams

Zixian Su, Jingwei Guo, Xi Yang, Qiufeng Wang, Kaizhu Huang · DOI

Introduction

Deep learning models often encounter distribution shifts when deployed in real-world environments. Test-Time Adaptation (TTA) has emerged as a promising solution to update models on-the-fly using unlabeled test data. However, standard TTA methods typically assume homogeneous data streams where distribution shifts are uniform or change slowly. In practice, data streams are often heterogeneous, containing a mix of various corruptions or domain shifts within a single batch.

Target domain scenarios and error rate comparison across different TTA methods.

As shown in Figure 1, conventional methods like TENT or SAR struggle significantly in "Mixed" scenarios. This performance degradation stems from "gradient interference," where the model attempts to find a single parameter update for conflicting distribution shifts, leading to unstable adaptation and poor accuracy.

The FreDA Framework

To address these challenges, we propose Frequency-based Decentralized Adaptation (FreDA). FreDA "un-mixes" heterogeneous data streams by disentangling different shifts before performing model updates.

The FreDA framework: from batch input to base model enhancement via frequency-based clustering and decentralized fine-tuning.

The framework, illustrated in Figure 2, consists of four primary stages:

  1. Frequency Feature Extraction: FreDA utilizes the Fourier Transform to extract high-frequency components of the input images. These components serve as "spectral footprints" that are more effective at identifying domain-specific textures and edges than standard latent features learned for classification.
  2. Dynamic Clustering: Using K-means clustering on these high-frequency amplitude spectra, the heterogeneous batch is partitioned into $K$ locally homogeneous clusters.
  3. Decentralized Fine-tuning: Instead of a single global update, multiple local models are deployed. Each model adapts independently to its assigned cluster, preventing cross-domain contamination and gradient conflict.
  4. Base Model Enhancement: Periodically, local model parameters are aggregated into a base model, which then re-initializes the local models for subsequent adaptation rounds.

Additionally, Frequency-based Augmentation is employed within clusters to improve robustness by perturbing the amplitude spectrum of samples, creating diverse variations consistent with the specific shift.

Key Insights and Results

A major finding is the Fourier Advantage: high-frequency spectral information provides a more reliable signal for domain separation than pre-trained features. By proactively managing heterogeneity before parameter updates occur, FreDA avoids the "conflicting gradients" problem where an update for one shift (e.g., noise) might degrade performance on another (e.g., blur).

Experimental Performance

FreDA was evaluated across diverse benchmarks, including common corruptions (CIFAR-10/100-C, ImageNet-C), natural domain shifts (DomainNet126), and medical imaging (Camelyon17).

  • Superior Accuracy: On CIFAR-10-C, FreDA achieved an average error rate of 22.9%, significantly lower than TENT (44.1%) and other state-of-the-art methods.
  • Medical Breakthrough: In the Camelyon17 histopathology dataset, FreDA reduced the error rate to 27.9%, outperforming the next best method by 5.9%.
  • Robustness: The method demonstrated consistent gains across various architectures (ResNet-50, ViT) and maintained stability even with small batch sizes, making it highly practical for real-time edge deployment.

Conclusion and Future Work

FreDA provides a robust framework for TTA in realistic, heterogeneous environments. By leveraging frequency-domain clustering and decentralized learning, it effectively mitigates gradient interference. Future research will explore adaptively determining the optimal number of clusters ($K$) and implementing finer-grained, patch-level augmentation strategies in the spatial-frequency space.

Summary updated

BibTeX
@misc{su2024decentralizing,
  author = {Zixian Su and Jingwei Guo and Xi Yang and Qiufeng Wang and Kaizhu Huang},
  title = {{Decentralizing Test-time Adaptation under Heterogeneous Data Streams}},
  year = {2024},
  eprint = {2411.15173},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.15173},
}
Figure