Abstract: This paper introduces CS-Flow (Cross-Scale-Flow), a novel approach for semi-supervised anomaly detection in industrial images. By leveraging multi-scale feature extraction and a fully convolutional normalizing flow architecture, CS-Flow effectively models the distribution of "normal" data while preserving spatial information. This design allows for both high-accuracy defect detection and precise localization. Evaluated on the MVTec AD and Magnetic Tile Defects benchmarks, CS-Flow achieves state-of-the-art results, demonstrating superior performance even with limited training data.
Introduction
In industrial manufacturing, identifying defects is critical for quality control. However, defects are often rare and highly variable, making it difficult to train traditional supervised classifiers. Semi-supervised anomaly detection (AD) addresses this by learning the characteristics of "normal" samples and identifying deviations as anomalies. Existing AD methods often struggle with preserving spatial details, handling multi-scale defects, or making overly simplistic distributional assumptions.
Methodology
CS-Flow addresses these challenges through a fully convolutional normalizing flow architecture. The process begins with multi-scale feature extraction using a pretrained, fixed EfficientNet-B5 backbone, which captures image features at three different resolutions simultaneously.
The core of the model is the Cross-Scale-Flow ($f_{csf}$), which consists of several coupling blocks. Unlike standard normalizing flows that use fully connected layers, CS-Flow is entirely convolutional, maintaining the 2D spatial structure of the feature maps. A key innovation is the cross-scale coupling block, where internal networks process all three scales simultaneously. This allows information to flow between different resolutions, enabling the model to detect both fine-grained local anomalies and larger structural defects. Because the mapping is bijective and preserves spatial dimensions, the negative log-likelihood of features can be mapped back to the original image coordinates to generate precise defect heatmaps.
Results and Discussion
The model was rigorously tested on the MVTec AD benchmark, which includes 15 categories of objects and textures. CS-Flow achieved a new state-of-the-art average AUROC of 98.7%, outperforming previous methods like PaDiM and DifferNet.
As shown in the results table, the model achieved perfect 100% scores on several texture classes, including Leather, Carpet, Tile, and Wood. Beyond its high accuracy, CS-Flow is remarkably data-efficient. Experiments showed that even when trained on as few as 16 images per category, the model maintained competitive performance, often surpassing prior methods trained on full datasets. On the Magnetic Tile Defects (MTD) dataset, CS-Flow set a new record with a 99.3% AUROC.
Conclusion
CS-Flow represents a significant advancement in image-based anomaly detection by integrating multi-scale processing within a fully convolutional normalizing flow. By allowing different scales to interact and preserving spatial context, it provides a robust and interpretable framework for industrial defect detection and localization. Future work may explore extending this cross-scale logic to temporal dimensions for video-based anomaly detection.
Summary updated