PAEDID: Patch Autoencoder Based Deep Image Decomposition For Pixel-level Defective Region Segmentation

Shancong Mou, Meng Cao, Haoping Bai, Ping Huang, Jianjun Shi, Jiulong Shan · OpenReview

Abstract

Unsupervised pixel-level defective region segmentation is a critical task in image-based anomaly detection for industrial applications. Current state-of-the-art methods face inherent trade-offs: matrix-decomposition methods struggle with complex backgrounds, representation-based methods produce low-resolution "blobby" masks, and reconstruction-based methods are often noisy. We present PAEDID (Patch Autoencoder based Deep Image Decomposition), an unsupervised framework that combines the modeling power of deep autoencoders with the robustness of classical image decomposition. By learning a deep image prior through a patch autoencoder and formulating anomaly detection as a decomposition problem, PAEDID achieves accurate, high-resolution defect extraction. We demonstrate the effectiveness of PAEDID on simulation studies and industrial datasets, where it significantly outperforms existing benchmarks.

Introduction: The Challenge of Complex Backgrounds

In industrial quality control, identifying minute defects—such as cracks, stains, or scratches—on surfaces with intricate textures is a major challenge. Traditional unsupervised methods often fall short. Matrix decomposition methods typically assume backgrounds are "smooth" or "low-rank," an assumption that breaks down when faced with complex patterns like wood grain or the circular textures found in industrial components.

Complex circular textures from the BTAD dataset (Product 1) present a significant challenge for traditional low-rank matrix decomposition methods.

Methodology: The PAEDID Framework

The PAEDID framework operates in two distinct stages to bridge the gap between deep learning and classical optimization:

1. Training (Learning the "Normal" Prior)

A Patch Autoencoder (PAE) is trained exclusively on defect-free images. To ensure the model captures fine background details, it utilizes a high-capacity latent space. To prevent the network from "over-generalizing" and learning to reconstruct defects during inference, the authors build a Memory Bank of latent representations from the training patches.

2. Inference (Image Decomposition)

When a test image is processed, it is encoded into patches. Any patch identified as anomalous is replaced with the most similar "normal" patch from the memory bank. This "sanitized" representation is then decoded to create a high-quality background reconstruction ($\hat{X}$), serving as a Deep Image Prior.

Instead of simple pixel-wise subtraction, which often results in noise, PAEDID formulates the final segmentation as a penalized optimization problem: $$\min_{L, S} \|L - \hat{X}\|_{SSIM} + \lambda \|S\|_1 \text{ s.t. } X = L + S$$ Here, $L$ represents the restored background and $S$ is the sparse defect component. This decomposition step allows for the extraction of clean, sharp defect contours.

Experimental Results

PAEDID was evaluated on the BTAD (BeanTech Anomaly Detection) and ELPV (Electroluminescence Photovoltaic) datasets. It demonstrated significant improvements in the Dice coefficient, a key metric for mask accuracy.

  • BTAD Product 1: PAEDID achieved a 98.9% Dice score, compared to 83.9% for SSIM-AE and only 22.5% for PatchCore.
  • Solar Cell Case Study: On the ELPV dataset, PAEDID reached a 62.2% Dice score, more than doubling the performance of competitors like RASL (26.7%) and PatchCore (25.2%).
PAEDID produces a precise predicted mask that closely follows the defect's actual shape, avoiding the "blobby" artifacts common in representation-based methods.

Qualitative analysis confirms that PAEDID extracts fine, hair-like cracks that other methods either blur or miss entirely, providing the pixel-level accuracy required for high-stakes industrial applications.

Conclusion

By treating anomaly detection as an image decomposition problem guided by a deep prior, PAEDID offers a "best of both worlds" solution. It maintains the high-resolution benefits of autoencoders while incorporating the robustness of classical decomposition, setting a new standard for unsupervised pixel-level defect segmentation in complex industrial environments.

Summary updated

BibTeX
@misc{mou2022paedid,
  author = {Shancong Mou and Meng Cao and Haoping Bai and Ping Huang and Jianjun Shi and Jiulong Shan},
  title = {{PAEDID: Patch Autoencoder Based Deep Image Decomposition For Pixel-level Defective Region Segmentation}},
  year = {2022},
  eprint = {2203.14457},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.14457},
}
Figure