Original paperSourceNo author review
Make your paper interactiveCreate

Text from the interactive explanation

A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization

Qiyu Chen, Huiyuan Luo, Chengkan Lv, Zhengtao Zhang

Industrial anomaly detection · GLASS (Chen, Luo, Lv & Zhang, 2024)

Inspection models learn from good products only, so researchers fake the defects. GLASS fakes them where it matters: right at the edge of normal. Flip its components and watch a real, tiny detector redraw its boundary live.

The canvas is a real experiment running in your browser. Each green circle stands for one normal feature vector, flattened to 2-D. A small neural network with one hidden layer, like the paper's discriminator, trains continuously to score normal features 0 and fakes 1. The background colour is its score; the glowing line is where it crosses 0.5.

Every batch, fresh fakes are made exactly in the order of the paper's Algorithm 1: a pink diamond appears at a normal feature plus Gaussian noise (GN); it then takes 20 small steps along the normalised gradient that increases the loss of calling it an anomaly (GA), drifting toward wherever the detector currently thinks things look normal; every 5 steps, truncated projection (TP) clamps its distance into the band [r1, 2·r1], with a visible snap. Grey triangles are distant local fakes standing in for the image-level texture overlays (LAS).

Hidden test points (show them with the checkbox) are never used for training: normal points, weak defects just outside the band, and strong defects far away. In 2-D we measure the band from the nearest normal point, as drawn in the paper's Fig. 3(a); in the paper's high-dimensional feature space, Eq. 2 clamps the distance from each fake's own source feature. In this flat toy, ascent without projection pushes fakes into the normal band, showing the risk projection guards against; on real images the paper measured a small gain from GA alone (Table 4). The numbers here illustrate the mechanism; the measured results are the paper's.

Why faint flaws are hard

A weak defect is a flaw with a small area or low contrast, so it sits very close to normal. Find the flaw in each woven swatch. Each defect is built the way the paper builds its MAD-sys test set: a noise-shaped patch of another, augmented fabric blended in with Eq. 4 at four transparency levels β. The higher β, the more original fabric shows through.

The defect workshop: local anomaly synthesis

GLASS's image-level branch (LAS) paints convincing fake flaws onto good images in three steps, and also hands the detector a pixel-exact mask of where the flaw is. These give the strong, textured anomalies that complement the near-normal feature fakes above.

I · Anomaly mask

II · Anomaly texture

The paper draws a random photo from the Describable Textures Dataset and applies three of nine random augmentations. Here, procedural textures and nine simple operations stand in for them.

III · Overlay fusion

One detector, three branches

During training, every image feeds three branches through the same frozen feature extractor E, the same small trainable adaptor A and the same discriminator D. Normal features are pushed toward score 0, global (GAS) fakes toward 1, and local (LAS) fakes toward their exact defect mask. At inspection time only the normal branch runs.

Swipe sideways to see the whole diagram.

Extractor WideResNet50, levels 2 + 3 merged, input 288 × 288, neighbourhood p = 3

Adaptor single-layer perceptron · Discriminator MLP with sigmoid output per feature point

GAS σg = 0.015 · r1 = 1, r2 = 2 · LAS β ~ N(0.5, 0.1²) truncated to [0.2, 0.8]

Training Adam, learning rates 1e-4 (adaptor) / 2e-4 (discriminator), 640 epochs, batch 8

Scores pixel map = smooth(upsample(z)); image score = max(z) · 1327 images/s

Manifold or hypersphere?

GLASS needs a picture of what "normal" looks like in feature space. The manifold hypothesis treats normal features as a thin, curved, locally flat sheet; a fake counts as anomalous once it is more than r1 from every normal feature. The hypersphere hypothesis treats them as a compact ball around their mean; fakes go into the shell between r′1 and 2r′1, with local fakes further out, up to 4r′1.

The authors found the manifold version slightly better overall, because many defect categories have complex nonlinear structure. GLASS-j chooses per product category using an image-level spectrogram : average all training images, take the 2-D Fourier transform, binarise it, and measure how compact it is. Less compact → manifold; more compact → hypersphere.

What it achieved

Speed

Weak defects (Table 3, average of MAD-man and MAD-sys)

A new woven-fabric benchmark

The authors built WFDD from industrial production: 4101 woven-fabric images across four categories (grey cloth, grid cloth, yellow cloth, pink flower) with block-shaped, point-like and line-type defects annotated at pixel level. GLASS-j reached 100% image-level AUROC on it. WFDD, MAD-man and MAD-sys are released with the code.

Scope and next steps, in the authors' words

GLASS targets structural anomalies (scratches, holes, stains) in industrial images. Logical anomalies, such as a missing or misplaced part, were not extensively explored, and local synthesis currently relies on an auxiliary texture dataset. The authors plan to extend GLASS to logical anomalies and to synthesise anomalies without external textures.

Source

Qiyu Chen, Huiyuan Luo, Chengkan Lv, Zhengtao Zhang. A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization. arXiv:2407.09359v1 [cs.CV], 12 July 2024. arxiv.org/abs/2407.09359 · DOI 10.48550/arXiv.2407.09359

The authors' code repository describes the work as an ECCV 2024 paper; this page follows the arXiv v1 preprint.

Code and datasets (WFDD, MAD-man, MAD-sys): github.com/cqylunlun/GLASS (MIT License).

All graphics on this page are original, code-drawn reinterpretations, not the paper's figures. The 2-D simulation, fabric swatches, bottle top and textures are illustrative and generated in your browser. Every numerical result quoted (tables, AUROC, PRO, throughput, compactness) is a measured value reported in the paper.

Topics in this iPaper

Computer science
Keywords: Industrial anomaly detection · Anomaly synthesis · Weak defect detection · Gradient ascent

Title page, arXiv identifier and keywords, page 1

Engineering
validated in industrial applications for woven fabric defect detection

Abstract, page 1

anomaly detection
unsupervised anomaly detection techniques are widely applied in industrial inspection scenarios

Section 1 Introduction, page 1

anomaly synthesis
Anomaly synthesis strategies can effectively enhance unsupervised anomaly detection.

Abstract, page 1

defect detection
GLASS achieves state-of-the-art results on the MVTec AD (detection AUROC of 99.9%), VisA, and MPDD datasets and excels in weak defect detection.

Abstract, page 1

computer vision
arXiv:2407.09359v1 [cs.CV] 12 Jul 2024

Title page arXiv stamp, page 1

gradient ascent
The most effective way to synthesize anomalies in feature space is to follow the direction of gradient ascent.

Section 3.2, Eq. 1, page 6

data augmentation
Synthesis-based methods view the synthesis of anomalies as a form of data augmentation from the normal samples.

Section 2 Related Work, page 3