Introduction
Anomaly detection (AD) is a critical task in industrial quality control, often described as a "needle in a haystack" problem. The goal is to identify rare defects—such as scratches, missing components, or surface irregularities—using only "normal" data for training. Traditionally, this required building separate models for every object category (e.g., one for bottles, another for screws). However, the field is shifting toward Unified Anomaly Detection, where a single model is trained to identify defects across a wide variety of object classes simultaneously.
While feature reconstruction is the dominant approach for Unified AD, existing models often struggle with detail preservation. Models like UniAD frequently produce blurry reconstructions that fail to capture intricate textures or lighting, leading to false positives. To address this, the authors propose RAS (Reconstruction as Sequence), a framework that redefines feature reconstruction as a sequential modeling task.
The RAS Framework and Architecture
The core innovation of this work is treating the decoder's reconstruction process not as a single forward pass, but as a sequence of refinements. This iterative approach allows the model to progressively "calibrate" the image features, moving from coarse approximations to high-fidelity reconstructions.
The RASFormer Block
The engine of this sequential process is the RASFormer block. Unlike standard transformer layers, the RASFormer incorporates two specialized components designed for the challenges of unified modeling:
- Adaptive Gating: In a unified setting, the network is bombarded with features from many different classes. The Adaptive Gate acts as a selective filter, deciding which information from the previous layer is relevant to the current object and what should be discarded. This prevents the model from being overwhelmed by redundant data across classes.
- Spatial Dynamics: By utilizing Multi-Head Self-Attention, the model captures the relationships between different parts of the image, ensuring that reconstructed pixels are contextually consistent with their neighbors.
Iterative Reconstruction as Sequence
By framing reconstruction as a sequence ($t=1$ to $t=N$), the model can effectively "denoise" and refine features over multiple steps. During training, the model is fed features with added Gaussian noise, forcing the RASFormer to learn the underlying "normal" distribution to effectively clean the data.
As shown in the comparison below, while baseline models like UniAD produce static, often blurry results, the RAS framework progressively improves the reconstruction quality. By the final step ($t=4$), the model successfully recovers fine details, such as reflections and complex textures, that other models flag as anomalous.
Experimental Results
The authors evaluated RAS on four major industrial benchmarks: MVTec-AD, VisA, BTAD, and MPDD. In the unified setting, RAS established a new state-of-the-art performance:
- Detection Accuracy: On MVTec-AD, RAS achieved an image-level AUROC of 98.4%, a significant improvement over UniAD's 96.5%.
- Localization Precision: For pixel-level anomaly localization (identifying the exact site of a defect), RAS reached 97.5% AUROC.
- Robustness: Stress tests revealed that RAS maintains high performance even as noise levels increase during inference, suggesting a deeper structural understanding of "normal" data compared to previous methods.
Conclusion
By redefining reconstruction as a sequential process and introducing the RASFormer block with adaptive gating, the RAS framework overcomes the "blurriness" bottleneck in unified anomaly detection. It achieves superior detail preservation and state-of-the-art accuracy across diverse industrial datasets. Future work may explore adaptive sequence lengths to optimize computational overhead for simpler objects while maintaining high precision for complex textures.
Summary updated