CDGP: Contrastive Dual Gaussian Processes for Weakly Supervised Anomaly Segmentation
Organizations: Korea University · Dartmouth College
Abstract
Industrial visual inspection must both decide whether a product is defective and localize the defect, yet pixel-level masks are costly to collect at scale. Most anomaly-segmentation methods learn only from defect-free images and score deviations from normality. A true defect and an unusual-but-normal region, however, can both deviate substantially and receive similarly high scores. We propose Contrastive Dual Gaussian Processes (CDGP), a weakly supervised framework that models normal and anomaly inducing-variable predictive distributions over dense tokens. Its posterior-dominance statistic standardizes their predictive-mean difference by the joint predictive uncertainty, providing both spatial evidence and image-level confidence. This evidence complements hierarchical normal-reconstruction residuals for fine localization. All calibration uses training data only, without human pixel annotations or test-time fitting. Across MVTec AD2, KSDD2, and VisA, CDGP ranks first among the evaluated methods on all MVTec AD2 localization metrics and is first-place or competitive on KSDD2 and VisA. Factorized and matched linear-head controls delimit the contribution and scope of the linear-kernel Gaussian process (GP) formulation.
Figures & tables
| Method | MVTec AD 2 | KSDD2 | VisA | ||||
| AUROC-P | [email protected] | [email protected] | AUROC-P | [email protected] | AUROC-P | [email protected] | |
| Normal-only supervision | |||||||
| PaDiM Defard et al. [2021] | |||||||
| PatchCore Roth et al. [2022] | |||||||
| RD4AD Deng and Li [2022] | ±0.0 | ||||||
| DRAEM Zavrtanik et al. [2021] | |||||||
| Variant | AUROC-P | [email protected] | [email protected] |
| GP-free residual pipeline | |||
| Spatial GP only ( ) | |||
| Image GP only ( ) | |||
| Full CDGP (both GP paths) |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Variant | AUROC-P | [email protected] | [email protected] |
| Direct linear head | |||
| CDGP mean margin | |||
| CDGP posterior dominance |
| Variant | AUROC-P | [email protected] | [email protected] |
| Heteroscedastic linear | |||
| CDGP |
| Factor | Setting | AUROC-P | [email protected] | [email protected] |
| Hard-pool fraction | 10% | |||
| 20% (default) | ||||
| 40% | ||||
| Inducing budgets | ||||
| (default) | ||||
| Setting | AUROC-P | [email protected] | [email protected] |
| Linear (default) | |||
| Spherical RBF, | |||
| Spherical RBF, | |||
| Spherical RBF, |
| GP weight | AUROC-P | [email protected] | [email protected] |
| (default) | |||
| Dataset | Category | AUROC-I | AUROC-P | [email protected] | [email protected] |
| MVTec AD 2 | can | ||||
| fabric | |||||
| fruit_jelly | |||||
| rice | |||||
| sheet_metal | |||||
| vial |
| [email protected] | [email protected] | ||||
| Defect images/category | AUROC-I | Spatial | Final | Spatial | Final |
| 1 | |||||
| 2 | |||||
| 4 | |||||
| 8 | |||||
| 16 | |||||
| Model | Params. (M) | Latency (ms) | Peak VRAM (MiB) |
| CDGP | 63.8 | 357.4 |
| Component | Final setting |
| Input and encoder | RGB bilinear resize to (MVTec AD 2/VisA) or (KSDD2); ImageNet mean/std normalization; ImageNet-1K V2 WideResNet-50-2 weights; layer1–3; ; training-only color jitter . |
| Dual GP | Linear kernel; , ; hard pool ; jitter ; variance floor ; batch 16; 400 steps; AdamW, base LR , inducing-value LR , weight decay except zero on inducing values; cosine decay to of the initial LR; margin ; weights . |
| Residual student | Normal fit images only; batch 5 (MVTec AD 2/VisA) or 3 (KSDD2); 360 steps; AdamW LR , weight decay , cosine decay to ; three scales; hard fraction , . |
| Normal corruption | Gaussian noise std ; local averaging with probability ; zero rectangle with probability , with each side sampled between approximately and of the corresponding image dimension. |
| Calibration/inference | Training fit/calibration split ; ; identity spatial operator (no Gaussian smoothing or max blend); at most normal calibration pixels sampled deterministically; tail floor ; LSE ; logistic , balanced classes, nonnegative slope; . |
| Evaluation | Seeds ; final model at step 400; category mean within seed, then mean std over seeds. |
| Dataset | Partition and weak-label construction | Test overlap |
| MVTec AD 2 | For each category and seed, pool the publicly labeled images, stratify by the binary normal/defective label, and assign to train/test. Split the resulting training partition again for fit/calibration using a fixed stratified partition for each seed. Remove mask paths before either training stage. | 0 images |
| KSDD2 | Official train/test split; reduce each training mask once to a binary image label; split official training images for fit/calibration. | 0 images |
| VisA | Official 2cls_highshot train/test CSV; use its normal/anomaly training labels and split official training images for fit/calibration. | 0 images |
Industrial Anomaly Detection
Industrial anomaly detection finds defective products and abnormal equipment behavior from visual, sensor, audio, and other production data.
See all 261 papers