[Paper Review] CAINNFlow: Convolutional block Attention modules and Invertible Neural Networks Flow for anomaly detection and localization tasks
CAINNFlow proposes a plug-in architecture that integrates Convolutional Block Attention Modules (CBAM) into invertible normalizing flows to preserve spatial structure during unsupervised anomaly detection and localization. By replacing standard multilayer perceptrons with stacked 3×3 convolutions enhanced by CBAM, it achieves a pixel-level AUC of 98.64% on the MVTec AD dataset using CNN and Transformer backbones.
Detection of object anomalies is crucial in industrial processes, but unsupervised anomaly detection and localization is particularly important due to the difficulty of obtaining a large number of defective samples and the unpredictable types of anomalies in real life. Among the existing unsupervised anomaly detection and localization methods, the NF-based scheme has achieved better results. However, the two subnets (complex functions) $s_{i}(u_{i})$ and $t_{i}(u_{i})$ in NF are usually multilayer perceptrons, which need to squeeze the input visual features from 2D flattening to 1D, destroying the spatial location relationship in the feature map and losing the spatial structure information. In order to retain and effectively extract spatial structure information, we design in this study a complex function model with alternating CBAM embedded in a stacked $3 imes3$ full convolution, which is able to retain and effectively extract spatial structure information in the normalized flow model. Extensive experimental results on the MVTec AD dataset show that CAINNFlow achieves advanced levels of accuracy and inference efficiency based on CNN and Transformer backbone networks as feature extractors, and CAINNFlow achieves a pixel-level AUC of $98.64\%$ for anomaly detection in MVTec AD.
Motivation & Objective
- To address the limitation of normalizing flows in destroying spatial structure by flattening 2D feature maps into 1D vectors.
- To improve unsupervised anomaly detection and localization by preserving spatial relationships in feature representations.
- To develop a plug-in module compatible with any backbone network (CNN or Transformer) for flexible deployment.
- To enhance feature representation learning through attention mechanisms that focus on salient spatial and channel-wise features.
- To achieve state-of-the-art performance in both accuracy and inference efficiency on the MVTec AD benchmark.
Proposed method
- Design a complex function in the normalizing flow using stacked 3×3 fully convolutional layers to maintain 2D spatial structure.
- Integrate CBAM modules within the flow architecture to dynamically emphasize important spatial and channel features.
- Replace standard multilayer perceptrons in normalizing flows with the CBAM-enhanced convolutional blocks to preserve spatial information.
- Utilize invertible neural networks (INNs) to perform bijective transformation of normal sample features into a standard Gaussian distribution.
- Apply bidirectional flow: forward pass maps features to a normal distribution; reverse pass enables reconstruction and anomaly visualization.
- Train the model end-to-end using normal images only, leveraging likelihood estimation to detect anomalies via distribution deviation.
Experimental results
Research questions
- RQ1Can a normalizing flow architecture preserve spatial structure in 2D feature maps when performing distribution transformation?
- RQ2How does integrating CBAM into the flow’s complex function improve anomaly detection performance compared to standard MLPs?
- RQ3What is the optimal configuration of the CAC module (e.g., number of steps) for balancing performance and efficiency?
- RQ4Can CAINNFlow achieve state-of-the-art results with lightweight backbones like ResNet18?
- RQ5To what extent can the reverse process of CAINNFlow visualize and localize anomalies through noise injection and reconstruction?
Key findings
- CAINNFlow achieves a pixel-level AUC of 98.64% on the MVTec AD dataset, demonstrating state-of-the-art performance in anomaly detection.
- The CAC module structure outperforms CA and AC modules across 12 out of 12 evaluation metrics, confirming its effectiveness in spatial feature extraction.
- Setting the number of steps in the CAC module to 2 yields optimal performance, with further increases leading to degradation.
- CAINNFlow achieves high accuracy even when using ResNet18 as the backbone, indicating strong efficiency and compatibility with lightweight models.
- Qualitative results show that the reverse process successfully reconstructs normal features and highlights anomalies when noise is introduced.
- Feature visualization confirms that the forward pass transforms normal features into a well-distributed standard Gaussian, while abnormal inputs deviate significantly.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.