Abstract
Generalist Anomaly Detection (GAD) aims to develop models capable of zero-shot transfer across diverse domains using only a few reference samples. Traditional GAD methods rely solely on normal references, often failing to distinguish subtle anomalies from normal variations. This paper introduces the Normal-Abnormal Generalist Learning (NAGL) framework, which leverages a mixture of normal and a few abnormal samples. By focusing on "residual" features—the differences between normal and abnormal states—NAGL achieves state-of-the-art cross-domain detection accuracy while running up to 14x faster than previous methods.
Introduction
Visual Anomaly Detection (AD) is critical for industrial quality control and medical diagnostics. While traditional "specialist" models require extensive domain-specific training, Generalist Anomaly Detection (GAD) seeks a "universal" model that can be trained on one domain (e.g., industrial parts) and immediately deployed to another (e.g., brain MRIs) using minimal reference data.
The primary bottleneck in current GAD research is the exclusive reliance on normal reference samples. This approach ignores the valuable information contained in small sets of abnormal samples often available in real-world scenarios. Without these "boundary markers," models struggle with false positives and missed detections. NAGL addresses this by incorporating both normal and abnormal references to guide the detection process.
Methodology
The core innovation of NAGL is shifting the focus from raw image features to the residual space. While the visual appearance of objects varies wildly across domains, the difference (residual) between a healthy and defective state often shares common characteristics.
The framework utilizes a lightweight, pre-trained ViT-S backbone and introduces two main components:
- Residual Mining (RM): This module extracts residuals between normal and abnormal reference samples. Using a cross-attention mechanism, it learns "residual proxies"—compact representations of abnormalities in the residual space that are independent of the specific object.
- Anomaly Feature Learning (AFL): For a new query image, this module compares the query’s residuals (relative to normal references) against the learned residual proxies. This allows for adaptive identification of instance-specific anomalies.
Experimental Results
NAGL was evaluated across three major benchmarks: MVTecAD (industrial), VisA (complex industrial), and BraTS (medical MRI). The experiments focused on cross-domain transfer, such as training on MVTecAD and testing on BraTS.
Performance and Efficiency
- Superior Accuracy: On MVTecAD (using 1 normal and 1 abnormal reference), NAGL achieved a 95.8% Image AUROC, outperforming baselines like WinCLIP which used four times as many normal samples.
- Medical Generalization: In industrial-to-medical transfer (BraTS), NAGL improved average AUROC by 10.6 percentage points over the previous state-of-the-art, ResAD.
- Blazing Speed: NAGL operates at 17.1 FPS, which is 2x faster than ResAD and 14x faster than InCTRL, making it highly suitable for real-time deployment.
Discussion and Conclusion
The success of NAGL stems from two key insights. First, anomalies are more "concentrated" and stable in residual space than in raw vision space, facilitating cross-domain transfer. Second, even a single abnormal reference sample significantly boosts performance by acting as a guide to prevent "false activations" common in KNN-based approaches.
Despite its strengths, future work could extend NAGL to 3D point clouds or video data. Additionally, integrating natural language prompts could further refine the detection process for specific defect types. By efficiently utilizing minimal abnormal data, NAGL sets a new standard for generalist anomaly detection.
Summary updated