Unsupervised Learning with Generative Adversarial Network for Automatic Tire Defect Detection from X-ray Images

Yilin Wang, Yulong Zhang, Li Zheng, Liedong Yin, Jinshui Chen, Jiangang Lu

TL;DR

This paper introduces MAGAD, a novel unsupervised approach for detecting defects in tire X-ray images using Generative Adversarial Networks (GANs). By leveraging a memory-augmented module and an image-inpainting strategy, MAGAD effectively learns defect-free tire structures and identifies anomalies with high accuracy, addressing the challenge of limited defect samples in industrial settings.

What Problem Does This Paper Address?

The automated detection of defects in industrial products, particularly tires, is crucial for safety and quality control. While X-ray imaging is effective for inspecting the internal structure of tires, current defect detection methods often rely on manual inspection of X-ray images, which is time-consuming, subjective, and inefficient for large-scale production. Existing automated methods, especially those using deep learning, typically require a large number of labeled defect samples for training. However, in real-world industrial scenarios, defective samples are rare compared to defect-free ones, making supervised learning approaches impractical due to insufficient training data. This paper tackles this challenge by proposing an unsupervised method that can effectively detect tire defects using only defect-free samples for training.

Methods

The core of the proposed method, MAGAD (Memory-Augmented Generative Adversarial Network for Anomaly Detection), is an unsupervised anomaly detection framework built upon a GAN architecture.

  • GAN-based Reconstruction: The model uses a GAN with an autoencoder (AE) as the generator. The goal is to train the generator to reconstruct defect-free images. During training, only defect-free images are used, forcing the model to learn the patterns of normal tires. When a defective image is input during testing, the generator, having learned only defect-free patterns, will struggle to reconstruct it accurately, leading to a significant reconstruction residual.
  • Memory-Augmented Module: To enhance the memorization of defect-free patterns, a memory-augmented module is integrated into the latent space of the autoencoder. This module stores prototypical encoded features of defect-free images. During reconstruction, it uses an attention-based mechanism to retrieve relevant memory items, effectively retaining normal features and discarding anomalous ones.
  • Image Inpainting Strategy: To further improve the model's understanding of image context and structure, an image-inpainting strategy is employed. During training, a portion of a defect-free image is corrupted (e.g., with Gaussian noise), and the model is tasked with reconstructing the missing part. This forces the network to learn the underlying semantics and context of the image, leading to more robust feature learning. This strategy is also applied during testing to corrupt defect features, further amplifying the difference between original and reconstructed images.
  • Loss Function: The training involves a combination of losses:
  • Reconstruction Loss: Measures pixel-level (L1 loss) and patch-level (SSIM) similarity between the original and reconstructed images.
  • Sparsity Loss: Encourages sparsity in the weight matrix of the memory-augmented module to prevent identity mapping and improve anomaly detection.
  • Generative Adversarial Loss: Standard GAN loss to ensure the generator produces realistic outputs that can fool the discriminator.
  • Discriminator Loss: A least-squares loss to train the discriminator to distinguish between real and generated images.

Datasets

The experimental dataset consists of tire X-ray images obtained from an industrial production line.

  • Training Set: 20,000 defect-free images.
  • Test Set: 2077 defect images and 3947 defect-free images. The dataset includes 21 types of defects, integrated into two categories: normal and abnormal. Images are preprocessed to a size of 256 × 256 × 1 (grayscale).

Key Insights and Ideas

  • Unsupervised Learning for Rare Defects: The paper demonstrates that unsupervised learning, specifically anomaly detection, is a highly effective paradigm for industrial defect detection when labeled defect data is scarce.
  • Memory as a Defect-Free "Blueprint": The memory-augmented module acts as a learned "blueprint" of normal tire structures. By forcing the model to reconstruct based on this memory, it inherently struggles with deviations (defects).
  • Inpainting for Contextual Understanding: The image-inpainting strategy is not just for data augmentation; it's a clever self-supervised task that forces the model to deeply understand image context, making it more sensitive to anomalies that disrupt this learned context.
  • Reconstruction Residual as the Anomaly Score: The core idea is that the difference (residual) between an original image and its reconstruction will be significantly larger for defective images than for defect-free ones, providing a clear signal for anomaly detection.

Key Results

  • Superior Performance: The proposed MAGAD method achieved the highest Area Under Curve (AUC) of 0.873 on the tire X-ray test dataset, outperforming other methods like Autoencoder, f-AnoGAN, DSEBM, and Ganomaly.
  • High Accuracy and Recall: MAGAD achieved an accuracy of 79.8% and a recall of 83.1%, indicating its effectiveness in correctly identifying both normal and defective tires.
  • Component Effectiveness: Ablation studies confirmed the significant contributions of both the memory-augmented module and the image-inpainting strategy. Removing either component led to a noticeable drop in performance, with their combination yielding the best results.
  • Qualitative Reconstruction: Visual results showed that MAGAD effectively removed defects while preserving the structural integrity of the tire, outperforming other methods that either blurred patterns or distorted structures.

Limitations and Future Work

  • High-Resolution Images: The authors acknowledge that training GANs on very high-resolution images remains a challenge, suggesting this as a future research direction.
  • Binary Classification: Current anomaly detection methods, including MAGAD, primarily perform binary classification (defect/no defect). Future work could focus on improving algorithms to handle multi-classification problems for more granular defect identification.
  • Computational Complexity: While MAGAD's performance is superior, its runtime per image (11.73 ms) is slightly higher than simpler methods like Autoencoder (10.08 ms) due to its model complexity. However, this is deemed acceptable given the performance gains.
  • Parameter Tuning: The paper investigates the impact of memory size and corrupted block size, suggesting that optimal parameters (e.g., memory size of 1000, corrupted block size of 192) are crucial for performance. Further exploration of hyperparameter optimization could be beneficial.

Summary updated

BibTeX
@inproceedings{wang2021unsupervised,
  author = {Yilin Wang and Yulong Zhang and Li Zheng and Liedong Yin and Jinshui Chen and Jiangang Lu},
  title = {{Unsupervised Learning with Generative Adversarial Network for Automatic Tire Defect Detection from X-ray Images}},
  booktitle = {Sensors},
  year = {2021},
  url = {https://openreview.net/forum?id=OdNtDLBHK1},
}
Figure