Organizations: SmartMore Corporation, Shenzhen, China · The Hong Kong University of Science and Technology, Hong Kong SAR, China · University College London, London, UK · Rice University, Houston, USA
Unsupervised outlier detection that automatically identifies whether visual systems involve anomalous images is a significant research topic. However, most approaches are limited to natural images because they rely on frozen and pre-trained feature extractors. So that their performance cannot be maintained in practical scenarios, especially for industrial inspection and medical imaging. In this work, we first revisit this task and then introduce a versatile unsupervised outlier detection framework to enrich the application domains. The core idea of this framework is to improve feature discriminativess via exploiting intrinsic distribution priors. Evaluated on 3 domains and 14 benchmark datasets, our proposed solution achieves state-of-the-art performance and significantly outperforms existing methods. More importantly, we show its plug-and-play property that can be integrated into diverse visual applications to improve their robustness, such as image classification and 3D reconstruction.
Figures & tables
Figure 1: The highlights of our proposed VUOD framework. Left plot: VUOD significantly outperforms existing SOTAs on UOD benchmark datasets and real-world applications. More importantly, VUOD can be seamlessly integrated into various downstream visual tasks, such as image classification (middle plot) and 3D reconstruction with VGGT [ 66 ] (right plot), to improve their performance and robustness.
Figure 2: Comparison between our paradigm and default industrial inspection. Left plot: The default unsupervised paradigm for industrial inspection, requiring a training phase on defect-free samples before sequential inference. Right plot: Our introduced paradigm eliminates the split between training and testing, enabling flexible, simultaneous detection of multiple objects within a single scene.
Figure 3: The core idea of our proposed VUOD framework. An unlabeled target dataset is first processed by natural image pretrained feature extractors. We then investigate the intrinsic priors of the feature space (local and global separability), and generate pseudo labels. Based on predicted inliers and outliers, we apply contrastive learning to enhance the discriminativeness of the feature representations.
Figure 4: The visualization of local separability with ranking-index similarity (Eq. 5 ) . Intuitively, the fine-grained clustering algorithm Affinity Propagation [ 22 ] is capable of effectively separating outliers, even when the pretrained feature embeddings exhibit limited separability. In practice, uncontaminated inlier clusters typically show high ranking-index similarity (often larger than 0.9 ), while uncontaminated outlier clusters tend to exhibit substantially lower similarity values (often less than 0.5 ).
Figure 5: The clustering comparison between Affinity Propagation and k -Means. Since k -Means requires a predefined number of clusters, which is impractical in unsupervised settings, we adopt the automatically determined number of clusters from Affinity Propagation for a fair comparison. As illustrated, Affinity Propagation consistently performs better than k -Means, particularly when outliers constitute only a small fraction of the target dataset.
Figure 6: The AUC results comparison between the refined distance (Eq. 6 ) and the baseline (Eq. 4 ). By removing the outlier impact from the mean computation, the performance of global separability can be maintained across different outlier ratios, i.e., the challenging mean-shift problem is well addressed.
Figure 7: The AUC results comparison between the refined feature and the raw feature with three outliers. The refined feature can significantly improve the detection accuracy of three outlier detectors.
Figure 8: The histogram visualization of outlier score distribution with both raw features and enhanced features. The enhanced features exhibit substantially improved separability between inliers and outliers compared with the raw features.
Method
Venue
STL-10
Internet
Caltech-101
CIFAR-10
CIFAR-100
MIT-Places
Deep SVDD [ 60 ]
ICML-2018
0.593
0.674
0.745
0.533
0.575
0.539
RSRAE [ 37 ]
ICLR-2019
0.903
0.916
0.986
0.816
0.889
0.778
GOAD [ 6 ]
ICLR-2020
0.946
0.945
0.981
0.862
0.886
0.871
Shell-Re [ 40 ]
TPAMI-2021
0.866
0.896
0.905
0.867
0.834
0.822
NeuTraL [ 56 ]
ICML-2021
0.828
0.877
0.633
0.748
0.815
0.711
ICL [ 62 ]
ICLR-2022
0.929
0.937
0.964
0.859
0.911
0.832
Table 1: AUC results on a series of natural image datasets. Red and Blue indicates the best and second-best results, respectively.
Type
Dataset
ResNet-18
Wide ResNet-101
RSRAE
LVAD
Multi-T
FlexUOD
VUOD
RSRAE
LVAD
Multi-T
FlexUOD
VUOD
Industrial
MVTec-AD
0.709
0.779
0.757
0.752
0.911
0.770
0.799
0.780
0.778
0.931
BTAD
0.873
0.894
0.885
0.882
0.902
0.846
0.884
0.886
0.883
0.928
MPDD
0.618
0.573
0.563
0.564
0.906
0.592
0.602
0.603
0.595
0.926
MVTec-LOCO
0.655
0.693
0.661
0.663
0.812
0.629
0.695
0.657
0.660
0.832
Medical
LiverCT
0.666
0.663
0.696
0.708
0.813
0.703
0.571
0.652
0.567
0.838
Table 2: AUC results on industrial inspection and medical imaging (disease detection). The best results are highlighted in bold.
Type
Category
PaDiM [ 14 ]
FRE [ 52 ]
EfficientAD [ 5 ]
VUOD
VUOD
Backbone
ResNet-18
ResNet-50
Wide ResNet-101
ResNet-18
Wide ResNet-101
Textures
Carpet
0.986
0.968
0.969
0.875
0.901
Grid
0.865
0.869
0.996
0.816
0.859
Leather
0.997
1.000
0.976
0.841
0.971
Tile
0.939
0.994
0.960
0.924
0.972
Wood
0.987
0.992
0.903
0.939
0.991
Table 3: AUC results for each category on MVTec-AD.
AP
k -Means ( k=10 )
k -Means ( k=100 )
k -Means ( k= # AP )
84.60
9.588
61.20
207.3
Table 4: Timing (Seconds) is measured with 10,000 ResNet-50 feature samples. # AP refers to the automatic defined clustering number of AP .
Method
Timing (Seconds)
FLOPs (G)
GPU Memory (MB)
EfficientAD
42.10
75.91
102.0
VUOD
17.18
22.80
39.23
Table 5: Efficiency between VUOD and EfficientAD on MVTec-AD. We evaluate efficiency on the “bottle” category (input size: 256 × 256). Both methods use Wide ResNet-101 as the backbone and are conducted on one NVIDIA RTX 3090 GPU.
Method
STL-10
Internet
Caltech-101
CIFAR-10
CIFAR-100
MIT-Places
MVTec-AD
OCSVM (Raw Feat.)
0.899
0.903
0.955
0.824
0.845
0.824
0.754
OCSVM (Re. Feat.)
0.994
0.991
0.994
0.972
0.981
0.971
0.921
Improvement
10.6%
9.75%
4.08%
18.0%
16.1%
17.8%
22.1%
Method
BTAD
MPDD
MVTec-LOCO
LiverCT
BrainMRI
OCT
RESC
OCSVM (Raw Feat.)
0.874
0.575
0.662
0.597
0.605
0.747
0.701
OCSVM (Re. Feat.)
0.915
0.916
0.822
0.825
0.797
0.879
0.916
Table 6: Ablation study about VUOD. The results are AUC scores of OCSVM with the raw and enhanced features.
Method
(0.9, 0.7)
(0.9, 0.6)
(0.9, 0.5)
(0.9, 0.4)
(0.8, 0.6)
(0.8, 0.5)
(0.8, 0.4)
(0.8, 0.3)
VUOD
0.969
0.971
0.972
0.970
0.968
0.969
0.968
0.965
Method
(0.7, 0.5)
(0.7, 0.4)
(0.7, 0.3)
(0.7, 0.2)
(0.6, 0.4)
(0.6, 0.3)
(0.6, 0.2)
(0.6, 0.1)
VUOD
0.970
0.968
0.967
0.964
0.967
0.966
0.964
0.963
Table 7: Ablation study about parameter setting ( ϵ+ , ϵ− ) in Sec. 4.3 . The results are AUC scores of VUOD on CIFAR-10.
Method
Top-1 Accuracy
Top-5 Accuracy
Baseline
90.81%
99.11%
w/ VUOD
91.45%
99.39%
Table 8: Image classification results on Imagenette [ 28 ] , a smaller set of ImageNet [ 15 ] . The image classifier baseline we employed is ResNet-18.
Figure 9: 3D Dense Point Map Reconstruction Results of VGGT [ 66 ] . Ground Truth refers to the reconstruction obtained using VGGT on an uncontaminated image set. Three target datasets are visualized in the Appendix.
Foundation models provide highly descriptive representations for medical images, yet their reliability degrades under distribution shifts arising from changes in patients, devices, or acquisition conditions. Reliable out-of-distribution (OOD) detection is therefore essential for safe deployment. Recent post-hoc detectors efficiently exploit frozen embeddings (e.g., kNN), whereas reconstruction-based OOD detection in latent feature space has seen limited adoption due to inconsistent performance. In this work, we show that the limitation of reconstruction-based methods in latent space does not stem from poor reconstruction quality, but from how reconstruction errors are scored. Standard L2 residual norms collapse the anisotropic residual structure, thereby suppressing informative deviations. To address this limitation, we introduce MaRS (Mahalanobis Residual Scoring), a label-free OOD detector that learns an in-distribution manifold using a lightweight autoencoder and measures deviation via a Mahalanobis distance on reconstruction residuals, yielding variance-aware OOD scores. Across three imaging modalities, multiple types of distribution shift, and different model families and scales, MaRS outperforms established confidence-, distance-, and reconstruction-based baselines, while remaining fully post-hoc and lightweight. The code is available at https://github.com/francescodisalvo05/mars.
Francesco Di Salvo, Sebastian Doerrich, Christian Ledig
Out-of-Distribution (OOD) detection remains a fundamental challenge for neural networks, whose predictions can be overconfident on inputs that deviate from the training distribution. Most post-hoc OOD detection methods derive scores from a single representation level (eg., logits or penultimate features) or combine multiple layers via depth selection or OOD-calibrated weighting. However, because OOD shifts are diverse, the most informative representation level can vary strongly across OOD types and domains, making fixed-layer choices and OOD-calibrated aggregation brittle. In this paper, we propose PRISM (Projected Representation with Intermediate-layer Subspace Modeling), a model-agnostic post-hoc OOD detection method that models a unified multi-layer feature representation rather than aggregating independently scored layers. PRISM fuses intermediate and deep features into a single hierarchical embedding, estimates an in-distribution (ID) principal subspace, and then combines two complementary signals: (i) a class-conditional Mahalanobis distance in the projected subspace and (ii) the residual energy orthogonal to the learned manifold. This simple design avoids OOD-tuned layer weighting while capturing both in-subspace semantic deviations and off-subspace anomalies. Across diverse benchmarks spanning natural images, medical imaging, and industrial visual inspection, PRISM achieves consistent state-of-the-art cross-domain OOD detection performance with a single default configuration across all evaluated domains and architectures. We further show that PRISM incurs minimal inference overhead, making it practical for real-world deployment.
Gerhard Krumpl, Henning Avenhaus, Horst Possegger
Institute of Visual Computing, Graz University of Technology, Austria · KESTRELEYE GmbH, Austria
Unsupervised anomaly detection (UAD) aims to detect anomalies without labeled data, a necessity in many machine learning applications where anomalous samples are rare or not available. Most state-of-the-art methods fall into two categories: reconstruction-based approaches, which often reconstruct anomalies too well, and decoupled representation learning with density estimators, which can suffer from suboptimal feature spaces. While some recent methods attempt to couple feature learning and anomaly detection, they often rely on surrogate objectives, restrict kernel choices, or introduce approximations that limit their expressiveness and robustness. To address this challenge, we propose a novel method that couples representation learning the exact One-Class SVM (OCSVM) optimization problem, through a custom loss formulation that directly aligns latent features with the OCSVM decision boundary. The model is evaluated on two tasks: a benchmark based on MNIST-C, and a challenging brain MRI lesion detection task. Unlike most methods that focus on large, hyperintense lesions at the image level, our approach succeeds to target small, non-hyperintense lesions, while we evaluate voxel-wise metrics, addressing a more clinically relevant scenario. Both experiments evaluate a form of robustness to domain shifts, including corruption types in MNIST-C and texture or population age variations in MRI. Results demonstrate performance and robustness of our proposed model, highlighting its potential for general UAD and real-world medical imaging applications. The source code is available at https://github.com/Nicolas-Pinon/uad\_ocsvm\_guided\_repr\_learning.