Table of Contents
Fetching ...

A Feature Shuffling and Restoration Strategy for Universal Unsupervised Anomaly Detection

Wei Luo, Haiming Yao, Zhenfeng Qiang, Xiaotian Zhang, Weihang Zhang

Abstract

Unsupervised anomaly detection is vital in industrial fields, with reconstruction-based methods favored for their simplicity and effectiveness. However, reconstruction methods often encounter an identical shortcut issue, where both normal and anomalous regions can be well reconstructed and fail to identify outliers. The severity of this problem increases with the complexity of the normal data distribution. Consequently, existing methods may exhibit excellent detection performance in a specific scenario, but their performance sharply declines when transferred to another scenario. This paper focuses on establishing a universal model applicable to anomaly detection tasks across different settings, termed as universal anomaly detection. In this work, we introduce a novel, straightforward yet efficient framework for universal anomaly detection: \uline{F}eature \uline{S}huffling and \uline{R}estoration (FSR), which can alleviate the identical shortcut issue across different settings. First and foremost, FSR employs multi-scale features with rich semantic information as reconstruction targets, rather than raw image pixels. Subsequently, these multi-scale features are partitioned into non-overlapping feature blocks, which are randomly shuffled and then restored to their original state using a restoration network. This simple paradigm encourages the model to focus more on global contextual information. Additionally, we introduce a novel concept, the shuffling rate, to regulate the complexity of the FSR task, thereby alleviating the identical shortcut across different settings. Furthermore, we provide theoretical explanations for the effectiveness of FSR framework from two perspectives: network structure and mutual information. Extensive experimental results validate the superiority and efficiency of the FSR framework across different settings.Code is available at https://github.com/luow23/FSR.

A Feature Shuffling and Restoration Strategy for Universal Unsupervised Anomaly Detection

Abstract

Unsupervised anomaly detection is vital in industrial fields, with reconstruction-based methods favored for their simplicity and effectiveness. However, reconstruction methods often encounter an identical shortcut issue, where both normal and anomalous regions can be well reconstructed and fail to identify outliers. The severity of this problem increases with the complexity of the normal data distribution. Consequently, existing methods may exhibit excellent detection performance in a specific scenario, but their performance sharply declines when transferred to another scenario. This paper focuses on establishing a universal model applicable to anomaly detection tasks across different settings, termed as universal anomaly detection. In this work, we introduce a novel, straightforward yet efficient framework for universal anomaly detection: \uline{F}eature \uline{S}huffling and \uline{R}estoration (FSR), which can alleviate the identical shortcut issue across different settings. First and foremost, FSR employs multi-scale features with rich semantic information as reconstruction targets, rather than raw image pixels. Subsequently, these multi-scale features are partitioned into non-overlapping feature blocks, which are randomly shuffled and then restored to their original state using a restoration network. This simple paradigm encourages the model to focus more on global contextual information. Additionally, we introduce a novel concept, the shuffling rate, to regulate the complexity of the FSR task, thereby alleviating the identical shortcut across different settings. Furthermore, we provide theoretical explanations for the effectiveness of FSR framework from two perspectives: network structure and mutual information. Extensive experimental results validate the superiority and efficiency of the FSR framework across different settings.Code is available at https://github.com/luow23/FSR.
Paper Structure (33 sections, 16 equations, 14 figures, 6 tables, 1 algorithm)

This paper contains 33 sections, 16 equations, 14 figures, 6 tables, 1 algorithm.

Figures (14)

  • Figure 1: Illustration of universal anomaly detection. The universal anomaly detection refers to comprehensive consideration of a model's detection performance across few-shot, separate, and unified settings. (a) The few-shot setting involves training a model using only a limited number of samples from a specific category of product. (b) In the separate setting, a model is trained using a significant number of samples from a single category of product. (c) The unified setting entails training a single model using a substantial number of samples from multiple categories of products.
  • Figure 2: Comparison between reconstruction (Rec) task and our strategy across few-shot, separate, and unified settings. (a) Training loss (red) as well as the image/pixel AUROC (blue/green). In the Rec task, transitioning from a few-shot setting (Fs) to a separate setting (Ss) and subsequently to a unified setting (Us), the issue of identical shortcut becomes increasingly pronounced due to the growing complexity of the normal data distribution. On the contrary, our strategy is capable of addressing this issue across different settings. (b) Visualization of the shortcut problem, wherein the anomalous regions can be well reconstructed, making them difficult to distinguish from normal ones. In contrast, our strategy successfully addresses this issue, adeptly reconstructing anomalies as normal samples under various settings. Notably, all models are trained for feature reconstruction. We utilize an additional decoder to visualize the reconstructed features as images. This decoder is only designed for visualization.
  • Figure 3: The overall architecture of FSR framework. (a) The training stage comprises three steps: pre-trained feature extraction, random shuffling, and feature restoration. We use the difference between the input normal feature and restored feature as the feature restoration loss. (b) The testing stage incorporates only two steps: pre-trained feature extraction and feature restoration. We compute the anomaly score by comparing the difference between the input anomalous feature and restored feature, followed by an upsampling operation.
  • Figure 4: Illustration of multi-scale feature extraction.
  • Figure 5: The intuitive explanation of feature shuffling and restoration (FSR) effectiveness from the perspective of network structure. In reconstruction (Rec) task, shortcut learning issues exist, while there are no shortcut learning issues in FSR task.
  • ...and 9 more figures