Abstract
This paper proposes to use set features for detecting anomalies in samples that consist of unusual combinations of normal elements. Many leading methods discover anomalies by detecting an unusual part of a sample. For example, state-of-the-art segmentation-based approaches, first classify each element of the sample (e.g., image patch) as normal or anomalous and then classify the entire sample as anomalous if it contains anomalous elements. However, such approaches do not extend well to scenarios where the anomalies are expressed by an unusual combination of normal elements. In this paper, we overcome this limitation by proposing set features that model each sample by the distribution of its elements. We compute the anomaly score of each sample using a simple density estimation method, using fixed features. Our approach outperforms the previous state-of-the-art in image-level logical anomaly detection and sequence-level time series anomaly detection.
Introduction
Anomaly detection has traditionally focused on identifying "structural" defects—local irregularities like a scratch on a surface or a crack in a component. Modern segmentation-based methods excel at this by classifying individual patches as normal or anomalous. However, a more challenging class of defects exists: logical anomalies. In these cases, every individual component of a sample appears normal, but their combination or distribution is incorrect. For instance, a hardware kit might contain the correct types of items but in the wrong quantities.
To address this, the authors introduce SINBAD (Set INspection Based Anomalies Detection), a training-free method that treats samples as sets of features. By modeling the distribution of these features, SINBAD can detect when the "recipe" of a sample is wrong, even if the ingredients are individually perfect.
Methodology: The SINBAD Pipeline
SINBAD operates by representing each sample as a "set descriptor" that captures the statistical distribution of its constituent elements. The process involves four key steps:
- Feature Extraction: For images, features are extracted from intermediate layers of a pre-trained, frozen ResNet. For time series, a "window pyramid" approach extracts multi-scale temporal features.
- Random Projections: To handle high-dimensional feature spaces efficiently, the extracted features are projected onto multiple random directions. This captures the "shape" of the data distribution from various perspectives.
- Histogram Descriptors: For each projection, a 1D histogram is constructed. These histograms act as a count-based representation, preserving information about the frequency of specific feature values within the sample.
- Anomaly Scoring: The histograms are concatenated into a single set descriptor. The anomaly score is then calculated using the Mahalanobis distance or k-nearest neighbors (k-NN) relative to the distribution of normal training samples.
This approach is computationally efficient and requires no training or data augmentation, making it highly practical for industrial deployment.
Experimental Evaluation
The effectiveness of SINBAD was evaluated on two distinct benchmarks:
- MVTec-LOCO: An industrial inspection dataset specifically designed to differentiate between structural and logical anomalies. It includes complex samples like breakfast boxes and juice bottles.
- UEA Time Series Repository: A collection of five diverse datasets (e.g., Epilepsy, Naval Air Training) used to test the method's ability to detect sequence-level anomalies.
Results and Discussion
SINBAD demonstrates superior performance in detecting distributional shifts:
- Image-Level Performance: On the MVTec-LOCO logical anomaly task, SINBAD achieved a 91.2% ROC-AUC, significantly surpassing the previous state-of-the-art (GCAD at 86.0%).
- Time Series Performance: The method achieved an average 96.8% ROC-AUC across the UEA datasets, outperforming complex deep learning models like NeuTraL-AD (94.4%).
- Efficiency: SINBAD can process over 20 images per second on a single GPU, highlighting its suitability for real-time applications.
While SINBAD is exceptionally strong at identifying "wrong combinations," it is less sensitive to tiny structural defects than specialized segmentation methods. The authors suggest that an ensemble approach—combining SINBAD with a structural detector—provides the most robust overall anomaly detection system.
Conclusion
By shifting the focus from local patch classification to global set distribution modeling, SINBAD provides a simple yet powerful solution for logical anomaly detection. Its training-free nature and high performance across both image and time-series domains mark a significant advancement in the field of unsupervised anomaly detection.
Summary updated