Table of Contents
Fetching ...

Reconstruction from edge image combined with color and gradient difference for industrial surface anomaly detection

Tongkun Liu, Bing Li, Zhuo Zhao, Xiao Du, Bingke Jiang, Leqi Geng

TL;DR

This work addresses unsupervised industrial visual anomaly detection by mitigating the generalization boundary issues prevalent in reconstruction-based methods. It introduces EdgRec, a reconstruction network that learns to recover RGB images from grayscale edges using a UNet-like denoising autoencoder with skip connections, enhanced by multi-scale pseudo anomalies and a hand-crafted color-gradient anomaly evaluator. The anomaly score combines a color difference in CIELAB space with a gradient-based structure term (MSGMS), enabling interpretable and tunable detection. On MVTec AD and MVTec 3D-AD (RGB-only), EdgRec achieves competitive image-level and pixel-level performance while offering greater interpretability and efficiency due to its handcrafted scoring. The approach provides a practical, adaptable alternative to latent-feature-based detectors in industrial settings, with potential for further improvements via multi-scale reconstruction and expanded pseudo anomaly generation.

Abstract

Reconstruction-based methods are widely explored in industrial visual anomaly detection. Such methods commonly require the model to well reconstruct the normal patterns but fail in the anomalies, and thus the anomalies can be detected by evaluating the reconstruction errors. However, in practice, it's usually difficult to control the generalization boundary of the model. The model with an overly strong generalization capability can even well reconstruct the abnormal regions, making them less distinguishable, while the model with a poor generalization capability can not reconstruct those changeable high-frequency components in the normal regions, which ultimately leads to false positives. To tackle the above issue, we propose a new reconstruction network where we reconstruct the original RGB image from its gray value edges (EdgRec). Specifically, this is achieved by an UNet-type denoising autoencoder with skip connections. The input edge and skip connections can well preserve the high-frequency information in the original image. Meanwhile, the proposed restoration task can force the network to memorize the normal low-frequency and color information. Besides, the denoising design can prevent the model from directly copying the original high-frequent components. To evaluate the anomalies, we further propose a new interpretable hand-crafted evaluation function that considers both the color and gradient differences. Our method achieves competitive results on the challenging benchmark MVTec AD (97.8\% for detection and 97.7\% for localization, AUROC). In addition, we conduct experiments on the MVTec 3D-AD dataset and show convincing results using RGB images only. Our code will be available at https://github.com/liutongkun/EdgRec.

Reconstruction from edge image combined with color and gradient difference for industrial surface anomaly detection

TL;DR

This work addresses unsupervised industrial visual anomaly detection by mitigating the generalization boundary issues prevalent in reconstruction-based methods. It introduces EdgRec, a reconstruction network that learns to recover RGB images from grayscale edges using a UNet-like denoising autoencoder with skip connections, enhanced by multi-scale pseudo anomalies and a hand-crafted color-gradient anomaly evaluator. The anomaly score combines a color difference in CIELAB space with a gradient-based structure term (MSGMS), enabling interpretable and tunable detection. On MVTec AD and MVTec 3D-AD (RGB-only), EdgRec achieves competitive image-level and pixel-level performance while offering greater interpretability and efficiency due to its handcrafted scoring. The approach provides a practical, adaptable alternative to latent-feature-based detectors in industrial settings, with potential for further improvements via multi-scale reconstruction and expanded pseudo anomaly generation.

Abstract

Reconstruction-based methods are widely explored in industrial visual anomaly detection. Such methods commonly require the model to well reconstruct the normal patterns but fail in the anomalies, and thus the anomalies can be detected by evaluating the reconstruction errors. However, in practice, it's usually difficult to control the generalization boundary of the model. The model with an overly strong generalization capability can even well reconstruct the abnormal regions, making them less distinguishable, while the model with a poor generalization capability can not reconstruct those changeable high-frequency components in the normal regions, which ultimately leads to false positives. To tackle the above issue, we propose a new reconstruction network where we reconstruct the original RGB image from its gray value edges (EdgRec). Specifically, this is achieved by an UNet-type denoising autoencoder with skip connections. The input edge and skip connections can well preserve the high-frequency information in the original image. Meanwhile, the proposed restoration task can force the network to memorize the normal low-frequency and color information. Besides, the denoising design can prevent the model from directly copying the original high-frequent components. To evaluate the anomalies, we further propose a new interpretable hand-crafted evaluation function that considers both the color and gradient differences. Our method achieves competitive results on the challenging benchmark MVTec AD (97.8\% for detection and 97.7\% for localization, AUROC). In addition, we conduct experiments on the MVTec 3D-AD dataset and show convincing results using RGB images only. Our code will be available at https://github.com/liutongkun/EdgRec.
Paper Structure (18 sections, 7 equations, 8 figures, 8 tables)

This paper contains 18 sections, 7 equations, 8 figures, 8 tables.

Figures (8)

  • Figure 1: For training phase, we first corrupt the original image $I$ with certain noise and thus get $I_A$; then we convert it to grayscale image $I_A^g$ and extract the edge $I_A^{e}$. Our training goal is to make the reconstructed image $I_R$ as close as possible to the $I$. For testing phase, we extract the grayscale edge $I^e$ of the original test image $I$ and reconstruct it to the RGB image $I_R$. The anomaly map $A$ is obtained by comparing the original and the reconstructed images via the compare function.
  • Figure 2: (a). Generate pseudo anomalies. We consider both the local (from the DTD dataset) and global (by Cutpaste augmentations) corruption when generating pseudo anomalies. (b). We use morphological erosion and dilation operations to extract the grayscale edge.
  • Figure 3: The architecture of the proposed reconstruction network.
  • Figure 4: The comparison of qualitative results between the conventional denosing autoencoder DeAE and our EdgRec.
  • Figure 5: The comparison of qualitative results when applying different psuedo anomalies
  • ...and 3 more figures