Source-linked AI summary
Anomaly Detection using Deep Learning based Image Completion
Matthias Haselmann, Dieter P. Gruber, Paul Tabatabai
TL;DR
Surface inspection must identify defects despite limited labeled fault data and permitted appearance variation. The paper completes masked image patches using a network trained on fault-free samples, then uses reconstruction error for pixel-wise anomaly detection. It reports that the method surpasses tested methods on data set A, while very weakly contrasted defects can be confused with residual patterns.
Problem
Surface inspection can require large labeled fault datasets, while permitted patterns and sample-to-sample variations make golden-sample filtering difficult.
Source: §I · p. 1, §II · p. 2Method
Results
On data set A, the method achieves AUROC 0.99 and AUPRC 0.63, surpassing the other tested methods on both metrics.
Source: B. Results · p. 4Takeaways & Limitations
Distinctly contrasted anomalies can be detected, but very weakly contrasted defects are often confused with residual patterns.
Source: §V · p. 5Very weakly contrasted defects may be indistinguishable from residual pattern structures in the anomaly image.
Source: B. Results · p. 4
Abstract
from arXiv · showhide
Automated surface inspection is an important task in many manufacturing industries and often requires machine learning driven solutions. Supervised approaches, however, can be challenging, since it is often difficult to obtain large amounts of labeled training data. In this work, we instead perform one-class unsupervised learning on fault-free samples by training a deep convolutional neural network to complete images whose center regions are cut out. Since the network is trained exclusively on fault-free data, it completes the image patches with a fault-free version of the missing image region. The pixel-wise reconstruction error within the cut out region is an anomaly image which can be used for anomaly detection. Results on surface images of decorated plastic parts demonstrate that this approach is suitable for detection of visible anomalies and moreover surpasses all other tested methods.
I. INTRODUCTION
Surface inspection must distinguish defects from permitted patterns and sample-to-sample variation, making golden-sample filtering unsuitable for some textured parts. The paper uses one-class image completion to produce fault-free reconstructions and pixel-wise anomaly scores.
I. INTRODUCTION
- Permitted patterns and slight sample-to-sample appearance variations make defects difficult to distinguish, while golden samples cannot directly filter those appearances.Manual inspection can also lead to overlooked errors and subjective assessments.Source: §I · p. 1
- The introduction situates surface inspection within anomaly and novelty detection, which models normal samples and monitors anomaly scores for deviations or unseen patterns.Source: §I · p. 1
- A deep convolutional network completes surface-image patches using normal data, and the difference from the query region supplies a pixel-wise anomaly score.The algorithm removes a 32 × 32 center from a 128 × 128 patch before completion.Source: §I · p. 1, Figure 2 · p. 2
- The network uses reconstruction loss alone because an adversarial loss can increase pixel-wise reconstruction error despite making inpaints look more realistic.The authors report that reconstructed fault-free surfaces are closely matched to query images and that recognizable defects on patterned surfaces can be detected.Source: §I · p. 2
II. RELATED WORK
The related work contrasts supervised and one-class inspection approaches, then positions reconstruction and image completion as routes to pixel-wise anomaly detection. Existing methods face data, sensitivity, or speed constraints that motivate the paper’s approach.
II. RELATED WORK
- Multi-class learning uses normal and faulty training samples, but requires collecting many faults and manually labeling them, which is especially difficult for rare defects.Source: §II · p. 2
- Synthetic-defect injection enables classification or segmentation training on fault-free raw data, but guarantees detection only for represented defect distributions.Tiny and weakly contrasted defects can be detected when similar synthetic defects are injected.Source: §II · p. 2
- One-class SVM and CNN feature-space methods can miss weakly deviating images and do not provide pixel-wise anomaly detection.Source: §II · p. 2
- Autoencoders and denoising autoencoders support pixel-wise detection, but may fail to learn semantically meaningful representations from their reconstruction setup.Denoising corrupts pixels, which may not require learning much semantic information.Source: §II · p. 2
- Anomaly-detecting GANs generate normal instances through iterative optimization, making them slow for surface inspection that must process thousands of patches within seconds.Source: §II · p. 3
- Image completion removes a whole region rather than low-level pixel corruptions, requiring semantic understanding; completion trained on normal samples can inpaint fault-free regions for anomaly detection.Munawar and Creusot used Boltzmann machines to inpaint road images and detect obstacles.Source: §II · p. 3
A. Image Completion Network
The image-completion network is trained with a masked L1 reconstruction objective that weights the missing center differently from the remaining patch. Its architecture uses strided and dilated convolutions, and excludes adversarial loss because detection depends on pixel-wise reconstruction error.
A. Image Completion Network
- The network uses a 17-layer fully convolutional architecture with strided downsampling, dilated convolutions to expand receptive fields, and bilinear upscaling.It also uses mirror padding and ELU activations.Source: A. Image Completion Network · p. 3
- L1 reconstruction loss weights the 32 × 32 masked center differently from the rest of the image patch.Source: A. Image Completion Network · p. 3
- The weighting parameter λ is 0.9, and adversarial loss is omitted because more natural-looking images do not reduce the pixel-wise reconstruction error used for detection.Source: A. Image Completion Network · p. 3
- Training uses ADAM with batch size 128, and each model is trained for 100k–200k batches within 24 hours on a GTX 1080Ti.Source: A. Image Completion Network · p. 3
B. Pre- and post processing
The method trains on 128 × 128 patches with a masked center, then scores only the central part of the reconstruction error. Randomized extraction and augmentation provide varied training patches while limiting transformation border effects.
B. Pre- and post processing
- The network receives 128 × 128 patches with a masked 32 × 32 center, leaving a large known region to provide semantic information for completing the center.Source: B. Pre- and post processing · p. 3
- Training patches are extracted in real time at randomized positions, with randomized transformations applied to the source images.Larger-than-target patches are transformed and then center-cropped to reduce unwanted border effects.Source: B. Pre- and post processing · p. 3
- Anomaly scores use only the 24 × 24 center of the absolute reconstruction difference, excluding local continuations of border defects; stride 16 ensures anomalies fall wholly inside the scoring window at least once.Source: B. Pre- and post processing · p. 3
C. Reported metrics
The test set is highly class-imbalanced at the pixel level, making accuracy misleading. The reported curves include PR and ROC comparisons across methods on data set A.
C. Reported metrics
- Fig. 4 presents PR and ROC curves for all tested methods on data set A.Source: Figure 4 · p. 4, C. Reported metrics · p. 4
- All reported metrics are computed at the pixel level, where the test set is especially class-imbalanced.The paper therefore reports precision-recall and ROC curves rather than relying on accuracy.Source: C. Reported metrics · p. 4
- Accuracy is misleading for the test set because of its class imbalance.Source: C. Reported metrics · p. 4
A. Data sets
The evaluation uses two datasets of decorated free-form plastic parts with varied decoration and fixed positioning. Both datasets include conspicuous and very low-contrast defects.
A. Data sets
- Both datasets contain decorated free-form plastic parts whose pattern primitives vary in distortion, location, and appearance, while part positioning remains constant.Source: A. Data sets · p. 4
- Dataset A has four views per part and includes 34 training, 8 validation, and 17 test parts; dataset B has three views and 12, 12, and 4 parts, respectively.Source: A. Data sets · p. 4
- Both datasets include eye-catching defects as well as defects with very low contrast that are hardly visible to humans.Source: A. Data sets · p. 4
B. Results
The proposed method outperforms the tested methods on dataset A and also achieves high AUROC on dataset B. Its results include a contrast-related detection boundary, while the AnoGAN comparison excludes selected patches.
B. Results
- The comparison includes a classical autoencoder and AnoGAN, but AnoGAN metrics omit patches with visible region-of-interest edges or obviously incorrect reconstructions.AnoGAN comparisons are limited to dataset A because generating a patch requires time-intensive optimization.Source: B. Results · p. 4
- 0.99 AUROC and 0.63 AUPRC on dataset A; the proposed method surpasses the other tested methods on both metrics, and dataset B yields 0.98 AUROC and 0.26 AUPRC.Source: Table I · p. 4, B. Results · p. 4
- Clearly visible anomalies are reliably detected, but very weakly contrasted defects can blend with residual patterns in the anomaly image.Most weakly contrasted defects stand out from residual patterns caused by slight mismatches between generated and query images.Source: B. Results · p. 4
V. CONCLUSION
The conclusion describes fault-free-trained patch completion as a pixel-wise anomaly-scoring approach. It reports stronger detection for distinct contrast and limits for very weakly contrasted defects.
V. CONCLUSION
- A DCNN trained on fault-free data completes cut-out image centers, and reconstruction error provides a pixel-wise anomaly score for defect detection.Source: §V · p. 4
- Fig. 5 contrasts detectable defects in panels a and b with defects too weakly contrasted to detect in panel c; panel d shows dataset B examples.The figure pairs query images with DCNN reconstructions and pixel-wise absolute differences in the corresponding center regions.Source: Figure 5 · p. 5
- 0.95 pixel-wise AUROC and 0.43 pixel-wise AUPRC on dataset A clearly surpass the other tested methods.Source: §V · p. 5