arXiv:2608.29112cs.CVAug 2026

Manuscript Offprint

arXiv:2608.29112

NFAD: Nuisance-Filtered Anomaly Detection Under Distribution Shift

Dat Cao, Son Nghiem, Phan Nguyen, Jun Rekimoto, Jhih-Ciang Wu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Recent advances in anomaly detection (AD) for industrial inspection have pushed performance on standard benchmarks toward saturation. However, strong benchmark performance does not necessarily translate to real-world deployment, as these benchmarks are primarily collected under controlled acquisition conditions. Changes in illumination, background, viewpoint, and other environmental factors can shift normal samples away from the learned normal distribution and cause false anomaly responses. We address AD under such distribution shifts by explicitly modeling nuisance variation from changing imaging conditions in feature space. Without anomaly labels or target-domain data, our Nuisance-Filtered Anomaly Detection (NFAD) framework estimates a nuisance subspace from matched feature displacements induced by content-preserving perturbations and suppresses its contribution to anomaly residuals at inference. The same subspace supports two complementary branches: full projection for image-level detection and selective suppression for pixel-level localization, preserving evidence of localized defects. On AeBAD-S, a benchmark specifically designed for AD under acquisition shifts, NFAD achieves 91.0% image-level AUROC, establishing a new state of the art. Notably, this robustness does not come at the expense of conventional AD performance: NFAD remains competitive on standard benchmarks that do not explicitly evaluate distribution shift, including VisA, Real-IAD, and MVTec AD. These results show that explicitly suppressing such nuisance variation improves AD under distribution shift while preserving strong performance in standard settings.

1. Introduction

Industrial anomaly detection (AD) has made remarkable progress in recent years. Rapid advances in visual back-

Figure

Figure 1. Residual–nuisance entanglement. Normal and defect residuals exhibit similar, above-chance alignment with the label-free nuisance subspace across datasets and backbones.

bones, feature representations, and anomaly modeling have pushed performance on established benchmarks such as MVTec AD and VisA toward saturation [3, 18, 40, 43]. These benchmarks provide a consistent setting for measuring progress and comparing methods. However, strong benchmark performance does not necessarily translate to real-world deployment, since most existing benchmarks are collected under relatively controlled acquisition conditions. As a result, these controlled evaluations offer only limited evidence of how detectors will behave when the imaging setup changes. In deployment, changes in illumination, background, viewpoint, and camera configuration can shift normal samples away from the learned normal distribution and cause false anomaly responses. Despite its practical importance, anomaly detection under such distribution shifts remains comparatively underexplored.

The source of this gap becomes clearer when examining how existing industrial AD benchmarks are constructed. MVTec AD and VisA use highly standardized setups with limited variation in pose and illumination [3, 43]. Recent datasets have begun to broaden the scale and diversity of evaluation. Real-IAD [35] extends this scope with substan-

∗^{*}Equal contribution.

†^{\dagger}Corresponding author: jcwu@csie.ntnu.edu.tw tially more categories, higher-resolution images, and greater pose diversity through multiple views, yet still relies on fixed camera angles and controlled lighting. These protocols facilitate reproducible evaluation and efficient data collection, but do not fully reflect the variability encountered in real-world deployment. This leads to a fundamental question:

How can anomaly detectors reliably detect defects under variable imaging conditions?

Recent domain-shift benchmarks demonstrate the practical importance of this problem. AeBAD [41] evaluates normal test images under shifted acquisition conditions and reports substantial degradation of existing anomaly detectors, while ADShift and FiCo [5, 9] demonstrate that standard methods struggle to perform under synthetic corruptions. These results show that strong performance under conventional settings does not necessarily translate to robustness in practice, motivating AD methods that are robust to nuisance variations while remaining sensitive to defects.

The challenge is particularly fundamental for feature-based anomaly detection, which detect defects as deviations from normal feature representations [1, 13, 37]. A domain shift displaces normal features, causing the shift itself to appear anomalous. We model such acquisition changes as structured nuisance variation that occupies a subspace of the feature space. A natural strategy follows: identify the nuisance directions and remove them while preserving defect information. We show that nuisance projection works exceptionally well for anomaly detection. Yet, we also find that nuisance and defects are entangled in feature space (Sec. 3). This motivates our dual read-out design: NFAD estimates a nuisance subspace label-free from controlled perturbations of normal images, a detection head removes the full nuisance subspace, and a localization head exploits spatial incidence to selectively remove global drift whilst preserving local defect evidence. The result is a post-hoc operator that adds shift robustness without modifying or retraining the normal-only detector.

To the best of our knowledge, NFAD is the first industrial anomaly detection framework to estimate an acquisition-nuisance subspace label-free from content-preserving feature displacements and remove it post-hoc through task-specific dual-readouts. Our contributions are threefold:

• We show that nuisance and defect signals are entangled in feature space, occupying the same directions, so feature direction alone cannot tell which part of the residual is nuisance and which is defect.

• We introduce NFAD, a label-free feature reconstruction framework that removes global nuisance variations while preserving anomaly signals for robust anomaly detection under domain shift.

• We validate NFAD under real and controlled acquisition shifts. It achieves state-of-the-art 91.0% I-AUROC and 90.8% AUPRO on AeBAD-S while remaining competitive on VisA, Real-IAD, and MVTec-AD. Under synthetic corruptions, NFAD consistently improves robustness, with gains that transfer even to unmodeled shifts.

References (43)