HyperAIHyperAI
2 months ago

DisCoPatch: Batch Statistics Are All You Need For OOD Detection, But Only If You Can Trust Them

Caetano, Francisco ; Viviers, Christiaan ; Zavala-Mondragón, Luis A. ; de With, Peter H. N. ; van der Sommen, Fons
DisCoPatch: Batch Statistics Are All You Need For OOD Detection, But
  Only If You Can Trust Them
Abstract

Out-of-distribution (OOD) detection holds significant importance across manyapplications. While semantic and domain-shift OOD problems are well-studied,this work focuses on covariate shifts - subtle variations in the datadistribution that can degrade machine learning performance. We hypothesize thatdetecting these subtle shifts can improve our understanding of in-distributionboundaries, ultimately improving OOD detection. In adversarial discriminatorstrained with Batch Normalization (BN), real and adversarial samples formdistinct domains with unique batch statistics - a property we exploit for OODdetection. We introduce DisCoPatch, an unsupervised Adversarial VariationalAutoencoder (VAE) framework that harnesses this mechanism. During inference,batches consist of patches from the same image, ensuring a consistent datadistribution that allows the model to rely on batch statistics. DisCoPatch usesthe VAE's suboptimal outputs (generated and reconstructed) as negative samplesto train the discriminator, thereby improving its ability to delineate theboundary between in-distribution samples and covariate shifts. By tighteningthis boundary, DisCoPatch achieves state-of-the-art results in public OODdetection benchmarks. The proposed model not only excels in detecting covariateshifts, achieving 95.5% AUROC on ImageNet-1K(-C) but also outperforms all priormethods on public Near-OOD (95.0%) benchmarks. With a compact model size of25MB, it achieves high OOD detection performance at notably lower latency thanexisting methods, making it an efficient and practical solution for real-worldOOD detection applications. The code will be made publicly available