Robust Distribution Alignment for Industrial Anomaly Detection under Distribution Shift
Jingyi Liao, Xun Xu, Yongyi Su, Rong-Cheng Tu, Yifan Liu, Dacheng Tao, Xulei Yang · 2025
Read Robust Distribution Alignment for Industrial Anomaly Detection under Distribution Shift by Jingyi Liao, Xun Xu, Yongyi Su, Rong-Cheng Tu, Yifan Liu, Dacheng Tao, Xulei Yang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-14910.txt.
Introduction
Jingyi Liao and co-authors tackle, in a 2025 paper, a weak point of factory inspection AI: anomaly detectors trained in one plant often fail when lighting or sensors change at another. Their method keeps the popular memory-bank design, where normal examples are stored and new items are compared against them.
They tune the stored features using a robust distance measure on a small sample of target-site data, aligning the bank without full retraining. Unlike many rivals, the approach needs no advance knowledge of the new site's data patterns and works across model backbones. Tests on two-dimensional and three-dimensional benchmarks with faked shifts beat leading rivals.
Catalog record
| CREATOR | Jingyi Liao, Xun Xu, Yongyi Su, Rong-Cheng Tu, Yifan Liu, Dacheng Tao, Xulei Yang |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 39 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-14910
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Robust Distribution Alignment for Industrial Anomaly Detection under Distribution Shift Jingyi Liao, Xun Xu, Yongyi Su, Rong-Cheng Tu, Yifan Liu, Dacheng Tao, Xulei Yang Abstract Anomaly detection plays a crucial role in quality control for industrial applications. However, ensuring robustness under unseen domain shifts such as lighting variations or sensor drift remains a significant challenge. Existing methods attempt to address domain shifts by training generalizable models but often rely on prior knowledge of target distributions and can hardly generalise to backbones designed for other data modalities. To overcome these limitations, we build upon memory-bank-based anomaly detection methods, optimizing a robust Sinkhorn distance on limited target training data to enhance generalization to unseen target domains. We evaluate the effectiveness on both 2D and 3D anomaly detection benchmarks with simulated distribution shifts. Our proposed method demonstrates superior results compared with state-of-the-art anomaly detection and domain adaptation methods. 1 Introduction Figure 1 : Upper: Examples of synthesized distribution shifts [ 16 ] on MVTec and RealIAD. Lower: Results from top baselines and our method. The Upperbound is trained and tested on the original distribution. GNL [ 6 ] performs well on “Contrast” shift due to AutoContrast augmentation during training. Detecting anomalous patterns is essential for maintaining quality control in industrial applications. Current state-of-the-art methods for industrial anomaly detection typically require extensive defect-free training samples to model the distribution of normal patterns. These methods often employ reconstruction [ 12 , 44 ] or memory banks [ 29 , 38 , 14 , 19 ] to capture normal data distributions. While demonstrating impressive performance, they often overlook the robustness in real-world applications. In particular, domain shift, where training/source and testing/target data distributions 1 1 1 We respectively use training/source and testing/target interchangeably throughout the manuscript. differ due to factors like changes in lighting or sensor drift, remain a significant challenge in industrial settings. Examples of synthesized distribution shift [ 16 ] are illustrated in Fig. 1 (upper). The performances of state-of-the-art methods are significantly compromised by the distribution shifts, as evidenced by the gap between the “Upperbound” (results on clean testing data) and their performance on corrupted testing data. Recent works [ 6 , 21 ] tackle this issue by treating anomaly detection under distribution shift as an out-of-distribution (OOD) generalization problem. During training, they encourage consistency in the intermediate features of normal samples under different data augmentations, which is sometimes referred to as synthetic OOD by [ 21 ] . Training model with this objective ensures that the model’s representation is less sensitive to shifts in the data distribution at test time. Despite recent advancements, domain generalization approaches face several key limitations. First, they rely on data augmentations or synthetic OOD samples that mimic target distribution shifts during training. This inherently assumes prior knowledge of the target domain shift , which may not always hold. For example, GNL [ 6 ] suffers performance degradation when the actual distribution shift is not well represented by training augmentations. Second, these methods are built on reverse distillation [ 12 ] , which requires constructing a decoder to invert the encoder . This design choice limits flexibility, making it non-trivial to extend to architectures such as 3D point cloud encoders. Finally, GNL [ 6 ] necessitates access to a random normal training sample at inference. However, privacy constraints and storage limitations often restrict access to training data, making this requirement impractical in real-world scenarios. Figure 2 : Illustration of pipeline of RoDA. The source domain fitting stage constructs a memory bank of normal training features, which serves as a reference for anomaly detection. In the domain adaptation stage, a limited amount of target domain data is augmented and aligned with the source memory bank through robust optimal transport. In this work, we first develop a memory-bank-based solution [ 29 , 37 ] that overcomes limitations in modality, network architecture, and the reliance on normal training sample replay. Our approach extracts features from normal training samples and constructs a memory bank to capture their distribution. During inference, test sample features are compared against this memory bank, enabling anomaly detection without requiring a decoder or replaying normal samples. This design ensures broad generalization across different modalities and encoder architectures. To further address the limitation of requiring prior knowledge of distribution shifts, we freeze the training stage with clean normal data and adapt the model using a small set of target adaptation data. In many scenarios, collecting some unlabeled target-domain data is feasible at low or no cost, enabling model adaptation. Domain adaptation methods [ 33 , 32 , 25 , 24 ] leverage such data, with distribution alignment proving particularly effective. By modeling source and target distributions and minimizing their discrepancy, distribution alignment improves generalization with fewer hyperparameter sensitivities compared to self-training or self-supervised learning. However, existing distribution alignment methods often overlook the presence of anomalies in target data which is common in anomaly detection tasks. Naively aligning distributions without accounting for anomalies can lead to misalignment, as anomalies may dominate the distribution discrepancy. To address this, we draw inspiration from robust distribution alignment techniques in generative modeling [ 1 ] and domain adaptation [ 8 ] , formulating the adaptation process as an optimal transport problem. Given target training data, we compute a soft assignment between target samples and memory bank prototypes using optimal transport, e.g., the Sinkhorn distance [ 10 ] . To mitigate the risk of assigning anomalies to prototypes, we introduce two key techniques. First, we discretizatize/binarize the Sinkhorn assignment to suppress spurious alignments. We further conduct target domain augmentation to generate multiple views of target samples, increasing robustness to anomalies. These strategies enhance the robustness of Sinkhorn distance, ensuring more reliable adaptation. These designs give rise to our method, Ro bust D istribution A lignment ( RoDA ) with an overview illustrated in Fig. 2 . Finally, the adapted model is applied for inference on target test data, improving anomaly detection under distribution shifts. Our contributions are summarized as follows. • We identify the practical challenges of generalizing to OOD target data in industrial anomaly detection and propose a distribution alignment-based optimal transport approach to improve robustness. • We enhance the optimal transport framework for anomaly detection by introducing assignment discretization and target domain data augmentation, mitigating the impact of anomalies. • We conduct evaluations under synthetic distribution shifts across both 2D and 3D data modalities, demonstrating the effectiveness. 2 Related Works Anomaly Detection : Anomaly Detection (AD) identifies samples that deviate significantly from the norm. Most AD approaches operate in an unsupervised setting, leveraging different techniques to model normal data [ 30 , 40 , 12 , 29 , 12 , 38 ] . One-class classification methods, [ 30 , 26 ] , represent normal data using support samples. Reconstruction-based methods [ 40 , 45 ] detect anomalies through higher reconstruction errors. Knowledge distillation approaches, such as RD4AD [ 12 , 35 ] , identify anomalies by comparing distilled and original features. Memory bank based methods [ 42 , 29 ] measure deviations in feature space from normal training samples. Among these methods, memory bank based exhibits more versatility to different data modalities and network architectures due to the decoder-free architecture. Domain Adaptation :