Source-linked AI summary

Collaborative Discrepancy Optimization for Reliable Image Anomaly Localization

Yunkang Cao, Xiaohao Xu, Zhaoge Liu, Weiming Shen

arXiv:2302.08769v1cs.CVcs.AI

TL;DR

Unsupervised anomaly localization can become unreliable when model generalization reduces discrepancies for abnormal samples. CDO jointly optimizes normal and synthetic-abnormal discrepancies through margin and overlap modules, and the paper reports improved localization performance and reliability across benchmarks and an automotive inspection dataset.

  • Problem

    Overgeneralization in unsupervised anomaly localization can reduce abnormal discrepancies and produce unreliable predictions.

  • Method

    CDO uses synthetic anomalies to jointly optimize normal and abnormal discrepancy distributions through margin and overlap optimization modules.

  • Results

    A suitable OOM setting improves AU-ROC by nearly 0.5% and AU-PRO by 1.2% over the no-OOM setting.

  • Takeaways & Limitations

    CDO enlarges the discrepancy-distribution margin, reduces overlap, and produces reliable anomaly localization performance.

Abstract

from arXiv · show

Most unsupervised image anomaly localization methods suffer from overgeneralization because of the high generalization abilities of convolutional neural networks, leading to unreliable predictions. To mitigate the overgeneralization, this study proposes to collaboratively optimize normal and abnormal feature distributions with the assistance of synthetic anomalies, namely collaborative discrepancy optimization (CDO). CDO introduces a margin optimization module and an overlap optimization module to optimize the two key factors determining the localization performance, i.e., the margin and the overlap between the discrepancy distributions (DDs) of normal and abnormal samples. With CDO, a large margin and a small overlap between normal and abnormal DDs are obtained, and the prediction reliability is boosted. Experiments on MVTec2D and MVTec3D show that CDO effectively mitigates the overgeneralization and achieves great anomaly localization performance with real-time computation efficiency. A real-world automotive plastic parts inspection application further demonstrates the capability of the proposed CDO. Code is available on https://github.com/caoyunkang/CDO.

I. INTRODUCTION

Unsupervised anomaly localization avoids costly anomaly annotations but remains vulnerable to overgeneralization, which reduces prediction reliability. CDO jointly optimizes normal and synthetic-abnormal discrepancies to enlarge distribution margins and reduce overlap.

  • I. INTRODUCTION: Unsupervised methods are attractive because anomaly samples and precise pixel-level annotations are costly and difficult to obtain.They therefore train using only normal samples.
  • I. INTRODUCTION: Overgeneralization can reduce abnormal discrepancies, damaging the margin and overlap between normal and abnormal discrepancy distributions.These distribution properties are identified as key factors influencing localization performance.
  • I. INTRODUCTION: CDO collaboratively minimizes normal discrepancies and maximizes synthetic-abnormal discrepancies to mitigate overgeneralization and improve prediction reliability.Synthetic anomalies are generated because real abnormal data are inaccessible during training.
  • I. INTRODUCTION: CDO uses MOM and OOM to obtain a larger margin and smaller overlap between normal and abnormal discrepancy distributions.MOM optimizes the margin, while OOM addresses overlap.
  • I. INTRODUCTION: A real-world automotive plastic-part dataset provides pixel-wise annotations and challenges the method with high normal inter-class variance and extremely small anomalies.The study reports impressive anomaly localization performance on this dataset.

II. RELATED WORK

Related work spans distribution-based, reconstruction-based, and knowledge-distillation-based approaches to unsupervised image anomaly localization. These methods differ in how they model or reconstruct normal feature distributions.

  • II. RELATED WORK: Unsupervised anomaly localization methods are categorized as distribution-based, reconstruction-based, or knowledge-distillation-based.The categories describe distinct strategies for modeling normal feature distributions.
  • II. RELATED WORK: Distribution-based methods model normal features with galleries, Gaussian distributions, or normalizing flows, trading off computation, memory, alignment sensitivity, and performance.SPADE uses nearest-neighbor retrieval, while PaDiM and flow-based methods use distribution modeling.
  • II. RELATED WORK: Reconstruction-based methods reconstruct normal features from noisy inputs or feature galleries to constrain outputs toward normal representations.Examples include RGB reconstruction, memory-based reconstruction, and related feature-reconstruction schemes.
  • II. RELATED WORK: Some reconstruction methods generate anomalies to improve reconstruction, whereas CDO uses synthetic anomalies to optimize discrepancy distributions instead.Their anomaly-generation purpose differs from CDO's discrepancy-optimization objective.

C. Knowledge distillation-based methods

Knowledge-distillation methods efficiently model normal feature distributions through expert and apprentice networks but can suffer from overgeneralization. CDO extends this setting by jointly optimizing normal and synthetic-abnormal discrepancies.

  • C. Knowledge distillation-based methods: Knowledge-distillation methods use pre-trained teacher features as an expert domain and student features as an apprentice domain to model normal features efficiently.The student is trained through feature discrepancies, while prior methods primarily optimize normal distributions.
  • C. Knowledge distillation-based methods: Prior methods mitigate related issues through informative distillation, reverse distillation, or anomaly-assisted training, yet knowledge-distillation methods still primarily minimize normal discrepancies.The cited methods include IKD, RD4AD, and SKD.
  • C. Knowledge distillation-based methods: The anomaly localization task assigns high scores to abnormal pixels and relatively low scores to normal pixels using an anomaly-scoring function.This formulation defines the target behavior for localization.
  • C. Knowledge distillation-based methods: CDO addresses overgeneralization by jointly optimizing discrepancies between normal and abnormal feature distributions with synthetic abnormal pixels.Its framework includes discrepancy-distribution generation, MOM, and OOM.
  • C. Knowledge distillation-based methods: CDO generates normal and synthetic-abnormal discrepancy distributions, weights hard tailed samples, and enlarges their margin through coordinated modules.The framework first maps perturbed inputs into expert and apprentice domains, then computes discrepancies.

C. DDG

The discrepancy-distribution generation stage maps normal and perturbed inputs into expert and apprentice domains and computes feature discrepancies. These discrepancies support CDO's margin and overlap optimization objectives.

  • C. DDG: DDG maps normal and perturbed pixels into expert and apprentice domains before generating normal and synthetic-abnormal discrepancy distributions.The expert and apprentice map functions extract corresponding features for discrepancy calculation.
  • C. DDG: Pixel-wise mean square error measures discrepancy between normalized expert and apprentice features in the knowledge-distillation implementation.The expert network is pre-trained, while the apprentice network is randomly initialized and optimized.
  • C. DDG: MOM minimizes normal discrepancies and maximizes synthetic-abnormal discrepancies to enlarge the margin, while OOM focuses on poorly optimized tail samples to reduce overlap.Average-only optimization can leave tail samples insufficiently optimized.

E. OOM

OOM reduces overlap between normal and abnormal discrepancy distributions by emphasizing tail samples during training. Its weights increase attention to high-discrepancy normal pixels and low-discrepancy abnormal pixels.

  • E. OOM: OOM focuses optimization on tailed hard samples that most influence overlap: normal samples with large discrepancies and abnormal samples with small discrepancies.It dynamically assigns weights to individual pixels during training, inspired by Focal Loss.
  • E. OOM: Normal discrepancies receive more attention when their ratio to the normal average is larger, whereas abnormal discrepancies receive more attention when their ratio is smaller.The ratio between each discrepancy and its average indicates pixel-wise importance.
  • E. OOM: The combined CDO loss uses weighted normal and abnormal discrepancy terms to optimize overlap and margin jointly.The formulation combines OOM and MOM in a single loss function.
  • E. OOM: The modulation coefficient γ controls the effect of the discrepancy weighting.The coefficient is constrained to γ ≥ 0.

F. Anomaly Score Calculation

CDO computes pixel anomaly scores from discrepancies between normalized expert and apprentice features. It can aggregate discrepancies across multiple hidden-layer hierarchies for multi-level anomaly localization.

  • F. Anomaly Score Calculation: The pixel anomaly score is defined by the discrepancy between normalized features extracted by the expert and apprentice networks.The normalized expert and apprentice features are compared for each pixel.
  • F. Anomaly Score Calculation: CDO further defines anomaly scores by leveraging expert and apprentice representations from different CNN hierarchies.Multi-hierarchical representations are used to improve anomaly localization performance.
  • F. Anomaly Score Calculation: The multi-hierarchy score aggregates discrepancy values across H hierarchies, where each term measures disagreement at one hierarchy.H denotes the number of hierarchies.

IV. EXPERIMENTS

CDO is evaluated on MVTec2D, MVTec3D, and a real-world automotive plastic-parts dataset using AU-ROC and AU-PRO. The experiments include quantitative comparisons, qualitative visualizations, and implementation details.

  • Experiments: The experiments evaluate CDO on MVTec2D and MVTec3D and apply it to automotive plastic-parts inspection for real-world validation.The plastic-parts dataset has pixel-wise annotations and includes challenging normal variation and extremely small anomalies.
  • Experiments: MVTec2D contains 15 categories, while MVTec3D contains 10 object categories and provides both RGB images and 3D scans.MVTec2D includes five texture and ten object categories; MVTec3D focuses mainly on geometric anomalies.
  • Experiments: AU-ROC and AU-PRO are the evaluation metrics, with higher values indicating better anomaly detection performance.AU-PRO is computed with a threshold of 0.3.
  • Experiments: Tables I, II, and III report quantitative comparisons on MVTec2D AU-ROC, MVTec2D AU-PRO, and MVTec3D AU-PRO, respectively.The supplied table passages identify each table’s dataset and metric scope but do not provide cell values.
  • Experiments: Qualitative results compare original images, ground-truth masks, and anomaly maps for MVTec2D, MVTec3D, and the plastic-parts dataset.The three image groups are denoted as panels (a), (b), and (c).

B. Comparisons with State-of-the-art methods

CDO outperforms competing methods on MVTec2D and MVTec3D, while maintaining strong performance under alternative evaluation settings.

  • MVTec2D: Under the CFLOW evaluation setting, CDO improves over CFLOW by 0.07% AU-ROC and 1.9% AU-PRO.The results further indicate that backbone and resolution selection affects practical performance.
  • MVTec2D: CDO achieves the highest AU-ROC and AU-PRO across MVTec2D settings, exceeding ST by 1.11% AU-ROC and 2.26% AU-PRO.It also exceeds PaDiM by 2.57% AU-PRO and reaches over 99% AU-ROC in nine categories.
  • MVTec3D: On MVTec3D, CDO exceeds the depth-based 3D-ST method by 10.72% AU-PRO and also outperforms its ST baseline.The comparison suggests RGB information can support geometric defect localization, while depth-only methods may miss some texture defects.

C. Ablation Studies

Ablations show that MOM enlarges discrepancy margins, OOM reduces distribution overlap by emphasizing hard samples, and backbone or resolution choices materially affect performance.

  • Influence of MOM: MOM increases MVTec2D AU-PRO by 2.33% and 1.04% in the two evaluated comparisons.With MOM, abnormal discrepancies first decrease and then rise, producing a larger final margin than the baseline case.
  • Influence of OOM: OOM removes secondary discrepancy peaks by emphasizing tailed samples, thereby decreasing overlap between normal and abnormal discrepancy distributions.Its weighting mechanism progressively assigns larger weights to hard pixels.
  • Influence of the modulating factor: A suitable OOM modulating factor improves performance by nearly 0.5% AU-ROC and 1.2% AU-PRO over the zero-factor setting.Performance initially improves and then stabilizes as the factor increases, with larger gains in object categories.
  • Backbones and resolutions: HR32 at 512 × 512 obtains the highest average AU-PRO of 95.21%, while HR48 at 256 × 256 obtains the highest average AU-ROC of 98.28%.ResNet performs better for texture categories, whereas HRNet performs better for object categories at 256 × 256.

D. Complexity Evaluation

CDO combines real-time inference with low memory use, requiring less storage than competing methods and substantially exceeding SPADE and PaDiM in speed.

  • Model size: CDO has the smallest model size and is 1.1× to 1.7× smaller than CFLOW.SPADE and PaDiM require additional feature-gallery or covariance storage, increasing memory consumption.
  • Inference speed: CDO runs 41.9× faster than SPADE and 34.7× faster than PaDiM under the reported hardware setup.Inference measurements include data input time and use GPU-allocated models.

E. Application to Automotive Plastic Parts Inspection

CDO was evaluated on a pixel-annotated automotive plastic-parts dataset collected with a dedicated inspection device, extending the benchmark evaluation to a real-world setting.

  • Dataset and inspection setup: The automotive dataset contains 1,500 normal training patches, 500 normal test patches, and 271 abnormal test patches at 256 × 256 resolution.Samples were collected using the inspection device shown in Fig. 9.
  • Real-world evaluation: The collected dataset is more challenging than existing anomaly datasets because normal patches have larger inter-class variance and anomalies can be extremely small.The study reports impressive anomaly localization performance after applying CDO.
  • Future direction: The paper identifies improved anomaly generation as future work to produce more realistic synthetic abnormal feature distributions.Generative adversarial networks are proposed as a possible replacement for random perturbation.
Loading 2302.08769v1…