Source-linked AI summary

PNI : Industrial Anomaly Detection using Position and Neighborhood Information

Jaehyeok Bae, Jae-Han Lee, Seyun Kim

arXiv:2211.12634v3cs.CV

TL;DR

Existing representation-based methods can overlook neighborhood correlations and positional information in normal features. PNI combines neighborhood-conditioned modeling, position-specific histograms, and synthetic-anomaly-trained refinement; on MVTec AD, it reports 99.56% I-AUROC and 98.98% P-AUROC, surpassing FastFlow by 0.16% and 0.48%, respectively.

  • Problem

    Representation-based anomaly methods assess features independently, overlooking neighborhood correlations and positional arrangements that can make locally normal features anomalous.

    Source: §1 · p. 2
  • Method

    PNI models normal features with neighborhood-conditioned MLPs and position-specific histograms, then uses a synthetic-anomaly-trained network to refine anomaly maps.

    Source: §1 · p. 2
  • Results

    On MVTec AD, PNI achieves 99.56% I-AUROC and 98.98% P-AUROC, surpassing FastFlow by 0.16% and 0.48%, respectively.

    Source: §4.2 · p. 6
  • Takeaways & Limitations

    Ablations associate neighborhood information with overall gains, positional information with object subcategories, and refinement with texture subcategories.

    Source: §4.2 · p. 7

    For p(Φ_i(x)|c_emb), PNI assumes independence from Ω because c_emb contains all Ω information relevant to Φ_i(x).

    Source: §3.2 · p. 4

Abstract

from arXiv · show

Because anomalous samples cannot be used for training, many anomaly detection and localization methods use pre-trained networks and non-parametric modeling to estimate encoded feature distribution. However, these methods neglect the impact of position and neighborhood information on the distribution of normal features. To overcome this, we propose a new algorithm, \textbf{PNI}, which estimates the normal distribution using conditional probability given neighborhood features, modeled with a multi-layer perceptron network. Moreover, position information is utilized by creating a histogram of representative features at each position. Instead of simply resizing the anomaly map, the proposed method employs an additional refine network trained on synthetic anomaly images to better interpolate and account for the shape and edge of the input image. We conducted experiments on the MVTec AD benchmark dataset and achieved state-of-the-art performance, with \textbf{99.56\%} and \textbf{98.98\%} AUROC scores in anomaly detection and localization, respectively.

1. Introduction

Industrial anomaly inspection must balance missed defects and false alarms, yet abnormal samples can be difficult to collect. PNI models normal features using neighborhood and position information and refines anomaly maps using synthetic anomalies.

1. Introduction

  • Abnormal samples can be difficult to collect, so industrial anomaly detection commonly uses normal-only training while seeking low false-positive and false-negative rates.Missed defects can be costly to customers, while false detections can increase manufacturing costs.Source: §1 · p. 1
  • Existing representation-based methods assess feature vectors independently, overlooking neighborhood correlations and positional arrangements that can make locally normal features defective.The paper gives incorrectly ordered colors in top-view cables as an example that PatchCore cannot capture.Source: §1 · p. 2
  • PNI combines position-specific histograms with an MLP conditioned on neighboring features to estimate normal-feature likelihoods and anomaly scores.The approach is presented as applicable to representation-based methods using pretrained features and non-parametric modeling.Source: §1 · p. 2
  • A refinement network trained on synthetic abnormal images revises anomaly maps toward ground-truth masks without using synthetic images to encode inputs or estimate anomaly scores.The refinement addresses the trade-off between small patches that may lose information and large patches that can blur localization.Source: §1 · p. 2
  • FNR fell from 1.83% to 0.95% and FPR from 4.07% to 1.50% versus [21], with a 0.46% AUROC improvement.The paper reports these reductions correspond to 48% fewer defective products reaching customers and 63% fewer good products wasted.Source: §1 · p. 2

2. Related Work

The paper uses PatchCore as a representation-based baseline and retains its feature-vector creation process. PNI’s overview adds separate position- and neighborhood-conditioned models and a refinement stage.

2. Related Work

  • PatchCore aggregates normal patch features, selects a representative coreset greedily, and scores test patches by nearest-neighbor search.PNI uses the same feature-vector creation process but is independent of the feature-extraction process, which may be replaced.Source: §2 · p. 2
  • The feature pipeline extracts hierarchical pretrained-network features, combines intermediate levels, and pools neighborhood patches into local patch-level vectors.For the described ResNet-50 example, the selected levels are 2 and 3; the smaller feature map is resized before concatenation.Source: §2 · p. 2
  • PNI’s training overview stores embedding and distribution coresets, fits neighborhood and position models, and separately trains a synthetic-defect refinement network; inference scores features before refining the map.The overview assigns an MLP to neighborhood information and histograms to position information.Source: Figure 2 · p. 3

3. Method

The method scores patch features using conditional normal-feature probabilities informed by position and neighboring features. It also refines anomaly maps with a network trained on synthetic defect images.

3.1. Overview

  • Patch anomaly scores are negative log-likelihoods of feature probabilities conditioned on position and neighboring features.The method extends the usual normal-feature probability model by conditioning it on both types of information.Source: §3.1 · p. 3
  • Sparse coreset condition probabilities are thresholded to approximate the feature likelihood, reducing computation with a small performance decrease.The threshold is set to τ = 1/(2|Cemb|) without optimization.Source: §3.1 · pp. 3–4

3.2. Modeling Normal Feature Distribution

  • Position and neighborhood distributions are combined by averaging: an MLP models neighborhood-conditioned probabilities, while per-position histograms estimate positional probabilities.A smaller distribution coreset Cdist, subsampled from Cemb, supports these estimates while retaining a mapping to the embedding coreset.Source: §3.2 · p. 4
  • The MLP concatenates features in a p × p neighborhood excluding the center, predicts probabilities over Cdist, and is trained with one-hot targets and cross-entropy.Temperature scaling with T = 2 is applied to make likelihood values more realistic.Source: §3.2 · p. 4

3.3. Pixelwise Refinement

  • A refinement network is trained on synthetic image, estimated-map, and ground-truth-map triples, using CutPaste, CutPaste scar, DRÆM, and manual defects in equal proportions.The four defect-generation methods produce patterns with distinct characteristics and varying sizes and shapes.Source: §3.3 · p. 5
  • The encoder-decoder refiner takes an RGB image and anomaly map as four-channel input, fuses their features after the first convolution, and combines regression and gradient losses.The gradient loss concentrates training near defect-region edges.Source: §3.3 · p. 5

4. Experimental Results

On MVTec AD, PNI achieved the reported best single-model AUROC scores for detection and localization, and it also outperformed other methods on BTAD localization. The experiments evaluate category-level results, component ablations, pixel errors, and qualitative localization.

4.1. Implementation Details

  • Experiments used MVTec AD and BTAD; I-AUROC measures detection, P-AUROC localization, and AUPRO gives equal weight to anomalous regions of different sizes.Images were resized to 512 × 512 and center-cropped to 480 × 480. The single model used ImageNet-pretrained WideResNet-101; the ensemble added ResNext-101 and DenseNet-201.Source: §4.1 · pp. 5–6

4.2. MVTec AD

  • 99.56% I-AUROC and 98.98% P-AUROC were PNI’s best MVTec AD detection and localization scores, surpassing FastFlow by 0.16% and 0.48%, respectively.Table 2 compares PNI with recent algorithms on I-AUROC, P-AUROC, and AUPRO.Source: §4.2 · p. 6, Table 2 · p. 7
  • PNI averaged 99.55% I-AUROC on object classes, reducing error by 43.8% versus second-best PatchCore; position helped object classes, while refinement helped textures.The authors also report that synthetic defect images handled varied and complex defects in real texture images.Source: §4.2 · p. 7
  • PNI scored 96.05% overall AUPRO, 0.53% above PFFM; PNI Ensemble led AUROC and AUPRO across object and texture categories.For object subcategories, PNI surpassed the second-best method by 0.64%.Source: §4.2 · p. 7, Table 2 · p. 7
  • Neighborhood information raised anomaly detection from 98.92% to 99.44%, reducing error by about 48.1%; position favored objects, while pixel-wise refinement favored textures.The baseline without the three components was identical to PatchCore and performed similarly; the two additions had complementary effects.Source: §4.2 · p. 7, Table 3 · p. 7
  • PNI’s predicted masks generally follow the ground truth; Figure 5 presents ground-truth masks, predicted masks, and anomaly maps.The prediction mask uses the threshold that maximizes F1; red marks high anomaly and blue low anomaly.Source: §4.2 · pp. 7–8, Figure 5 · p. 8
  • For metal-nut pixels, PNI reduced PatchCore FPR from 3.4% to 2.0% and FNR from 10.7% to 9.5%; total image errors were 7 false positives and 12 false negatives, versus 19 and 23.Figure 6 shows the anomaly-score histograms for this subcategory.Source: §4.2 · p. 8, Figure 6 · p. 8

4.3. BTAD

  • On BTAD, PNI outperformed other state-of-the-art algorithms on every product category and on the average localization score.Table 4 reports anomaly localization in P-AUROC.Source: Table 4 · p. 8, §4.3 · p. 8

5. Conclusion

PNI estimates normal-feature distributions using position and neighborhood information, and adds a synthetic-anomaly-trained refinement network to improve anomaly maps.

5. Conclusion

  • PNI estimates normal-feature distributions by incorporating position and neighborhood information, with experiments demonstrating its overall performance and effectiveness.Source: §5 · p. 8
  • Position is modeled with accumulated histograms from normal training images, while an MLP models normal-feature distributions conditioned on neighboring features.Source: §5 · p. 8
  • A pixel-wise refinement network trained on synthesized anomaly images improves anomaly maps according to the input image; the authors describe it as the field’s first such approach, to their knowledge.Source: §5 · p. 8
Loading 2211.12634v3…