AnoSeg: Anomaly Segmentation Network Using Self-Supervised Learning

Jou Won Song, Kyeongbo Kong, Ye In Park, Seong Gyun Kim, Suk-Ju KangarXiv 2021

TL;DR

This paper introduces AnoSeg, a novel self-supervised network for anomaly segmentation that directly generates precise anomaly maps. By combining hard data augmentation, adversarial learning, and coordinate channel concatenation, AnoSeg achieves state-of-the-art performance on the MVTec AD dataset, outperforming existing methods in both anomaly detection and segmentation tasks.

What Problem Does This Paper Address?

In industrial manufacturing, identifying and localizing defects (anomaly segmentation) is crucial. However, obtaining large datasets with precise ground truth masks for anomalies is challenging, as defects are rare. Existing methods often focus on anomaly detection (identifying if an anomaly exists) rather than precise segmentation (outlining the exact defect area). Many current segmentation approaches indirectly derive anomaly maps from detection models, leading to less accurate localization. The core problem is the lack of effective methods that can directly learn pixel-level anomaly segmentation with limited or no anomaly data and ground truth.

Methods

The proposed AnoSeg network tackles this by employing three key novel techniques:

  • Anomaly Data Generation via Hard Augmentation: To create synthetic anomaly data and corresponding masks without real anomaly examples, the authors apply "hard augmentation" to normal images. This involves transformations like rotation, permutation, and color jitter, which shift the data distribution to simulate anomalies. These augmented images are then combined with original normal images to form a training dataset.
  • Self-Supervised Learning with Pixel-wise and Adversarial Losses: AnoSeg is trained in a self-supervised manner. It uses a pixel-wise segmentation loss to directly learn to generate anomaly maps. Additionally, an adversarial loss is incorporated, where a discriminator learns to distinguish between real normal data and generated data (normal images paired with anomaly maps). This adversarial component helps the network learn the true distribution of normal regions more effectively.
  • Coordinate Channel Concatenation: To better capture the spatial relationships of pixels, which is vital for segmentation, AnoSeg incorporates a "coordinate channel." This channel provides explicit location information for each pixel, allowing the network to understand where features are located within the image, thus improving its ability to distinguish between normal and anomalous regions based on their position.

Datasets

The primary dataset used for training and evaluation is the MVTec AD dataset. This dataset is a well-established benchmark for anomaly detection and segmentation, containing images of various industrial objects with both normal and anomalous samples. The authors do not introduce a new dataset.

Key Insights and Ideas

  • Direct Segmentation is Key: The paper strongly advocates for directly training a segmentation model rather than relying on indirect methods derived from anomaly detection. This direct approach, coupled with pixel-wise losses, is shown to be more effective for precise localization.
  • Synthetic Data Generation is Powerful: The use of "hard augmentation" to create synthetic anomaly data is a clever way to overcome the scarcity of real anomaly samples and ground truth masks, enabling self-supervised learning for segmentation.
  • Location Matters: Explicitly providing pixel location information through coordinate channels significantly improves the network's ability to understand and segment anomalies, especially those whose nature depends on their position within the object.
  • Anomaly Maps Enhance Detection: The generated anomaly maps are not only useful for segmentation but can also be fed into existing anomaly detection frameworks to boost their performance.

Key Results

  • State-of-the-Art Performance: AnoSeg achieves state-of-the-art results on the MVTec AD dataset for both anomaly segmentation and detection.
  • Superior Segmentation Metrics: In terms of pixel-level AUROC (Area Under the Receiver Operating Characteristic Curve) for anomaly segmentation, AnoSeg consistently outperforms other methods, achieving a mean AUROC of 0.97.
  • Robust IoU: For Intersection over Union (IoU), another key segmentation metric, AnoSeg also leads, with a mean IoU of 0.542, demonstrating its ability to accurately capture the extent of anomalies.
  • Threshold Robustness: The anomaly maps generated by AnoSeg are shown to be robust to thresholding, meaning their performance doesn't degrade significantly with different threshold choices, unlike some other methods.
  • Improved Anomaly Detection: When used in conjunction with existing GAN-based anomaly detection methods, AnoSeg's anomaly maps improve image-level AUROC performance.

Limitations and Future Work

  • Reliance on Synthetic Data: While effective, the method's performance is still dependent on the quality and diversity of the synthetically generated anomaly data. The paper acknowledges that generating "real anomaly maps that are unseen in training phase" can be challenging.
  • Generalization to Unseen Anomalies: Although the paper claims good generalization, the extent to which it can handle entirely novel types of anomalies not represented even by the augmentations remains an area for further exploration.
  • Computational Cost: While not explicitly detailed as a limitation, complex networks like AnoSeg often come with higher computational demands for training and inference, which could be a factor in real-world deployment.

The authors suggest that their anomaly maps can be used to improve anomaly detection, indicating a potential avenue for future work in integrating AnoSeg into broader industrial inspection systems.

Summary updated

BibTeX
@misc{song2021anoseg,
  author = {Jou Won Song and Kyeongbo Kong and Ye In Park and Seong Gyun Kim and Suk-Ju Kang},
  title = {{AnoSeg: Anomaly Segmentation Network Using Self-Supervised Learning}},
  year = {2021},
  eprint = {2110.03396},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.03396},
}
Figure