Explicit Boundary Guided Semi-Push-Pull Contrastive Learning for Supervised Anomaly Detection
Xincheng YaoRuoqi LiJing ZhangJun SunChongyang Zhang
Proposes a supervised anomaly detection framework that leverages normal feature distributions to establish explicit decision boundaries and applies a semi-push-pull contrastive loss, enabling models to exploit limited known anomalies without losing generalization to unseen defect types.
Automated anomaly detection is essential across industrial defect inspection and medical imaging. Most existing systems rely strictly on unsupervised learning from normal data, which results in blurry decision boundaries and poor detection accuracy. While incorporating a small number of available abnormal samples can sharpen performance, existing supervised approaches tend to overfit to known defect types, failing when confronted with new, unseen anomalies.
The article demonstrates an explicit boundary guided framework for supervised anomaly detection that exploits limited anomaly data while preventing model bias against unseen defect types.
The authors develop a two-stage method combining normalizing flows with a boundary-guided semi-push-pull learning mechanism. First, the model maps normal image features into a standard distribution to define a clear boundary derived entirely from normal data. Next, a targeted training objective pulls near-boundary normal features inward while pushing abnormal features across an explicit safety margin. To address anomaly rarity, the approach also synthesizes realistic irregular patterns on normal images. The method was evaluated across six public benchmarks covering industrial manufacturing (MVTecAD, BTAD, AITEX, ELPV) and medical diagnostics (BrainMRI, HeadCT) under multi-class and unseen defect settings.
Across the evaluations, the proposed method achieved top performance, reaching 99.3% image-level and 99.2% pixel-level accuracy on the MVTecAD benchmark. When identifying entirely new, unseen anomaly classes, the framework outperformed competing supervised approaches by 3.3% to 12.9% in detection accuracy. On challenging and subtle defect subsets, the method increased detection performance by 3.6% and localization precision by 8.6% compared to the baseline. Visual assessments confirmed that the approach reliably eliminates ambiguous scoring regions, producing cleaner and more precise anomaly localization maps.
These results show that establishing separating boundaries anchored strictly in the normal data distribution prevents models from becoming biased toward known defects. For operational decision-makers, this translates to higher inspection reliability, reduced false alarms, and lower risk of overlooking novel defects in safety-critical manufacturing and clinical workflows.
Organizations deploying visual quality control or medical diagnostic systems should consider incorporating explicit boundary guidance and synthetic defect generation into their pipelines when small sets of historical defects are available. Before full-scale operational rollout, engineering teams should conduct pilot testing on domain-specific datasets to fine-tune margin parameters and assess computational overhead during live image processing.
While the reported performance gains are statistically robust across diverse benchmarks, confidence remains highest in standardized visual domains with clear foreground objects. Practitioners should exercise caution when applying the model to highly variable backgrounds or uncalibrated image streams until dedicated validation is complete.
- Paper: Catching Both Gray and Black Swans: Open-set Supervised Anomaly Detection, Choubo Ding et al. (2022). This paper establishes the problem formulation of open-set supervised anomaly detection using few labeled anomalies while generalizing to unseen anomalies, which the source directly builds upon.
- Paper: Deep One-Class Classification, Lukas Ruff et al. (2018). Deep SVDD introduces the foundational deep one-class boundary optimization concept that encloses normal feature distributions to detect anomalies.
- Paper: Support Vector Data Description, DAVID M.J. TAX et al. (2004). This classic work develops Support Vector Data Description for learning tight, compact separating boundaries around normal data, forming the conceptual basis for explicit boundary guidance.
- Paper: Latent Outlier Exposure for Anomaly Detection with Contaminated Data, Chen Qiu et al. (2022). This work introduces paired pull-normal and push-abnormal objectives in feature space to isolate anomalies, directly preceding the source paper's semi-push-pull contrastive learning mechanism.
- Paper: Deep Anomaly Detection with Outlier Exposure, Dan Hendrycks et al. (2019). Outlier Exposure provides the essential conceptual baseline of leveraging known auxiliary anomaly samples to improve generalization to unseen out-of-distribution instances.
- Paper: Deep Learning for Anomaly Detection, Guansong Pang et al. (2020). This survey provides a comprehensive taxonomy of deep anomaly score learning and weakly supervised few-shot normality representations that motivate the source's methodology.
- Paper: MVTec AD — A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection, Paul Bergmann et al. (2019). This paper introduces the standard MVTec AD benchmark and evaluation protocol utilized for visual anomaly detection models.
- Paper: AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection, Qihang Zhou et al. (2024). Extends the detection of unseen anomalies by utilizing vision-language foundation models with object-agnostic prompt learning in a zero-shot regime.
