Papers › DisCoPatch: Taming Adversarially-driven Batch Statistics for Improved...

DisCoPatch: Taming Adversarially-driven Batch Statistics for Improved Out-of-Distribution Detection

14 Jan 2025arXiv:2501.08005archive 2025-07-28

Francisco Caetano, Christiaan Viviers, Luis A. Zavala-Mondragón, Peter H. N. de With, Fons van der Sommen

Out-of-distribution (OOD) detection holds significant importance across many applications. While semantic and domain-shift OOD problems are well-studied, this work focuses on covariate shifts - subtle variations in the data distribution that can degrade machine learning performance. We hypothesize that detecting these subtle shifts can improve our understanding of in-distribution boundaries, ultimately improving OOD detection. In adversarial discriminators trained with Batch Normalization (BN), real and adversarial samples form distinct domains with unique batch statistics - a property we exploit for OOD detection. We introduce DisCoPatch, an unsupervised Adversarial Variational Autoencoder (VAE) framework that harnesses this mechanism. During inference, batches consist of patches from the same image, ensuring a consistent data distribution that allows the model to rely on batch statistics. DisCoPatch uses the VAE's suboptimal outputs (generated and reconstructed) as negative samples to train the discriminator, thereby improving its ability to delineate the boundary between in-distribution samples and covariate shifts. By tightening this boundary, DisCoPatch achieves state-of-the-art results in public OOD detection benchmarks. The proposed model not only excels in detecting covariate shifts, achieving 95.5% AUROC on ImageNet-1K(-C) but also outperforms all prior methods on public Near-OOD (95.0%) benchmarks. With a compact model size of 25MB, it achieves high OOD detection performance at notably lower latency than existing methods, making it an efficient and practical solution for real-world OOD detection applications. The code is publicly available.

PaperPDFCode 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="2501.08005")

Code

Syntology Ran 3 of 6 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 3 ran with no contract checked.

By repository: found in paper text by Syntology: 6 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

caetas/DisCoPatch found in paper text by Syntology 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

6 samples harvested; 3 ran; 0 honoured the contract we drafted; 3 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.

3ran
3unverified

Licence: 6 of the 6 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 caetas/DisCoPatch. “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.

Discriminator caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology ran · metamorphic tier: deterministic no licence file found · pointer only · c7c8dd4dcf04dd5f · report
MSSIM caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology ran · metamorphic tier: deterministic no licence file found · pointer only · e96938c177b897ed · report
Patchnorm2D caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology ran · metamorphic tier: deterministic no licence file found · pointer only · be451fcb6df06550 · report
DisCoPatch caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology unverified no licence file found · pointer only · 54c49855ae7a173d · report
VanillaVAE caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology unverified no licence file found · pointer only · fd69deb104cee551 · report
create_checkpoint_dir caetas/DisCoPatch/src/discopatch/models/DisCoPatch.py found in paper text by Syntology unverified no licence file found · pointer only · ecf6b3c0b950c09e · report

Tasks

AllOut of Distribution (OOD) DetectionOut-of-Distribution Detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Out-of-Distribution Detection ImageNet-1K vs ImageNet-C DisCoPatch AUROC 97.2 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1K vs ImageNet-C DisCoPatch FPR95 10.6 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1K vs ImageNet-C DisCoPatch Latency, ms 1.56 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1K vs SSB-hard DisCoPatch AUROC 95.8 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1K vs SSB-hard DisCoPatch FPR95 19.8 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1K vs SSB-hard DisCoPatch Latency, ms 1.56 #1 of 1 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs NINCO DisCoPatch AUROC 94.3 #3 of 5 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs NINCO DisCoPatch FPR@95 39.0 #3 of 5 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs NINCO DisCoPatch Latency, ms 1.56 #3 of 5 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs OpenImage-O DisCoPatch AUROC 94.4 #4 of 7 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs OpenImage-O DisCoPatch FPR95 29.7 #4 of 7 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs OpenImage-O DisCoPatch Latency, ms 1.56 #4 of 7 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs Textures DisCoPatch AUROC 96.4 #7 of 34 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs Textures DisCoPatch FPR95 18.9 #7 of 34 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs Textures DisCoPatch Latency, ms 1.56 #7 of 34 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs iNaturalist DisCoPatch AUROC 99.1 #5 of 28 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs iNaturalist DisCoPatch FPR95 3.6 #5 of 28 Archive leaderboard report
Out-of-Distribution Detection ImageNet-1k vs iNaturalist DisCoPatch Latency, ms 1.56 #5 of 28 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Batch Normalization

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