Papers › Distribution Alignment for Fully Test-Time Adaptation with Dynamic Online Data Streams

Distribution Alignment for Fully Test-Time Adaptation with Dynamic Online Data Streams

16 Jul 2024arXiv:2407.12128archive 2025-07-28

Ziqiang Wang, Zhixiang Chi, Yanan Wu, Li Gu, Zhi Liu, Konstantinos Plataniotis, Yang Wang

Given a model trained on source data, Test-Time Adaptation (TTA) enables adaptation and inference in test data streams with domain shifts from the source. Current methods predominantly optimize the model for each incoming test data batch using self-training loss. While these methods yield commendable results in ideal test data streams, where batches are independently and identically sampled from the target distribution, they falter under more practical test data streams that are not independent and identically distributed (non-i.i.d.). The data batches in a non-i.i.d. stream display prominent label shifts relative to each other. It leads to conflicting optimization objectives among batches during the TTA process. Given the inherent risks of adapting the source model to unpredictable test-time distributions, we reverse the adaptation process and propose a novel Distribution Alignment loss for TTA. This loss guides the distributions of test-time features back towards the source distributions, which ensures compatibility with the well-trained source model and eliminates the pitfalls associated with conflicting optimization objectives. Moreover, we devise a domain shift detection mechanism to extend the success of our proposed TTA method in the continual domain shift scenarios. Our extensive experiments validate the logic and efficacy of our method. On six benchmark datasets, we surpass existing methods in non-i.i.d. scenarios and maintain competitive performance under the ideal i.i.d. assumption.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2407.12128")

Code

Syntology Ran 10 of 17 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 8 ran with no contract checked.

By repository: official repository: 17 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

WZq975/DA-TTA officialmentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 10 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran · fixture could not drive it
8ran
7unverified

Licence: 0 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from WZq975/DA-TTA. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

complete_data_dir_path WZq975/DA-TTA/conf.py official repository ran MIT (permissive) · 00900164f55d3e7c · report
create_file_list WZq975/DA-TTA/datasets/imagenet_subsets.py official repository ran MIT (permissive) · ae33aa95d68dffd6 · report
entropy_energy WZq975/DA-TTA/methods/lame.py official repository ran fingerprinted MIT (permissive) · 473a24407468b75e · report
get_num_classes WZq975/DA-TTA/conf.py official repository ran MIT (permissive) · ad7ee34b3774e46a · report
softmax_entropy WZq975/DA-TTA/methods/datta.py official repository ran · fixture could not drive it MIT (permissive) · 3078648c75e3e1e3 · report
softmax_entropy_cifar WZq975/DA-TTA/methods/cotta.py official repository ran MIT (permissive) · f0cf18b3022925f3 · report
softmax_entropy_imagenet WZq975/DA-TTA/methods/cotta.py official repository ran MIT (permissive) · e2785d59d7e26ba2 · report
stat_loss WZq975/DA-TTA/methods/datta.py official repository ran MIT (permissive) · 155e6f06ad63c237 · report
tta WZq975/DA-TTA/methods/memo.py official repository ran MIT (permissive) · eaa0b5d0d74c3ab3 · report
update_ema_variables WZq975/DA-TTA/methods/cotta.py official repository ran · our draft was wrong MIT (permissive) · a77d556c0aea19c1 · report
batch_norm WZq975/DA-TTA/methods/datta.py official repository unverified MIT (permissive) · fae69c4390cf3b2c · report
create_imagenet_subset WZq975/DA-TTA/datasets/imagenet_subsets.py official repository unverified MIT (permissive) · 04cb16a031d4e8b2 · report
get_domain_sequence WZq975/DA-TTA/conf.py official repository unverified MIT (permissive) · cfc577ab97377255 · report
laplacian_optimization WZq975/DA-TTA/methods/lame.py official repository unverified MIT (permissive) · d2597d43cbd2fbca · report
marginal_entropy WZq975/DA-TTA/methods/memo.py official repository unverified MIT (permissive) · 8a657c2641647a46 · report
softmax_entropy WZq975/DA-TTA/methods/eata.py official repository unverified MIT (permissive) · 7b9d88d29b50aca6 · report
update_model_probs WZq975/DA-TTA/methods/eata.py official repository unverified MIT (permissive) · 182d3657a9eebb0d · report

Tasks

Test-time Adaptation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections