Table of Contents
Fetching ...

Towards Real Unsupervised Anomaly Detection Via Confident Meta-Learning

Muhammad Aqeel, Shakiba Sharifi, Marco Cristani, Francesco Setti

TL;DR

This paper tackles the gap in unsupervised anomaly detection by showing that the common assumption of entirely nominal training data is impractical. It introduces CoMet, a Confident Meta-Learning framework that combines Soft Confident Learning to downweight ambiguous samples and a MAML-inspired meta-learning loop to stabilize updates under uncertainty. The approach is model-agnostic and demonstrated to achieve state-of-the-art results on MVTec-AD, VIADUCT, and KSDD2 with two backbones, Normalizing Flows and SimpleNet, while being robust to anomalies present in the training data. The work offers a practical pathway toward truly unsupervised defect detection in industrial settings, with code made publicly available for reproducibility and wider adoption.

Abstract

So-called unsupervised anomaly detection is better described as semi-supervised, as it assumes all training data are nominal. This assumption simplifies training but requires manual data curation, introducing bias and limiting adaptability. We propose Confident Meta-learning (CoMet), a novel training strategy that enables deep anomaly detection models to learn from uncurated datasets where nominal and anomalous samples coexist, eliminating the need for explicit filtering. Our approach integrates Soft Confident Learning, which assigns lower weights to low-confidence samples, and Meta-Learning, which stabilizes training by regularizing updates based on training validation loss covariance. This prevents overfitting and enhances robustness to noisy data. CoMet is model-agnostic and can be applied to any anomaly detection method trainable via gradient descent. Experiments on MVTec-AD, VIADUCT, and KSDD2 with two state-of-the-art models demonstrate the effectiveness of our approach, consistently improving over the baseline methods, remaining insensitive to anomalies in the training set, and setting a new state-of-the-art across all datasets. Code is available at https://github.com/aqeeelmirza/CoMet

Towards Real Unsupervised Anomaly Detection Via Confident Meta-Learning

TL;DR

This paper tackles the gap in unsupervised anomaly detection by showing that the common assumption of entirely nominal training data is impractical. It introduces CoMet, a Confident Meta-Learning framework that combines Soft Confident Learning to downweight ambiguous samples and a MAML-inspired meta-learning loop to stabilize updates under uncertainty. The approach is model-agnostic and demonstrated to achieve state-of-the-art results on MVTec-AD, VIADUCT, and KSDD2 with two backbones, Normalizing Flows and SimpleNet, while being robust to anomalies present in the training data. The work offers a practical pathway toward truly unsupervised defect detection in industrial settings, with code made publicly available for reproducibility and wider adoption.

Abstract

So-called unsupervised anomaly detection is better described as semi-supervised, as it assumes all training data are nominal. This assumption simplifies training but requires manual data curation, introducing bias and limiting adaptability. We propose Confident Meta-learning (CoMet), a novel training strategy that enables deep anomaly detection models to learn from uncurated datasets where nominal and anomalous samples coexist, eliminating the need for explicit filtering. Our approach integrates Soft Confident Learning, which assigns lower weights to low-confidence samples, and Meta-Learning, which stabilizes training by regularizing updates based on training validation loss covariance. This prevents overfitting and enhances robustness to noisy data. CoMet is model-agnostic and can be applied to any anomaly detection method trainable via gradient descent. Experiments on MVTec-AD, VIADUCT, and KSDD2 with two state-of-the-art models demonstrate the effectiveness of our approach, consistently improving over the baseline methods, remaining insensitive to anomalies in the training set, and setting a new state-of-the-art across all datasets. Code is available at https://github.com/aqeeelmirza/CoMet

Paper Structure

This paper contains 18 sections, 16 equations, 5 figures, 3 tables.

Figures (5)

  • Figure 1: Impact of anomalies and near boundary samples in the training set. In Supervised Learning, positive and negative samples contribute to determining the boundary between the two data distributions. In Semi-Supervised Learning, often improperly called unsupervised, the lack of positive samples (i.e. anomalies) lead to overestimate the covariance of the nominal samples' distribution, resulting in a higher number of misdetections at inference time (red points lying inside the blue circle). Our Confident Meta-learning approach allows models to be learned properly in Unsupervised Learning by assigning low confidence weight to samples close to and beyond the decision boundary. Note that in Semi-Supervised Learning the positive samples (red dots) are transparent because they are not available at training time. In Unsupervised Learning instead, dots' transparency is proportional to the assigned confidence weights.
  • Figure 2: Training samples (nominal and anomalous) for some classes of the MVTec-AD dataset with the associated confidence weight $w$ estimated by CoMet. Weights close to $1$ indicate prototypical samples, while lower weights suggest samples close to (or beyond) the decision boundary.
  • Figure 3: CoMet pipeline. A pretrained feature extractor transforms input images to feature maps if required by the anomaly detection model of choice. Features are then divided into disjointed tasks. In the meta-learning inner loop one task is used for training and all the others for testing. Losses for training and validation are passed to the Soft Confident Learning module to compute the model confidence that is used for regularization of the weights update. Once all tasks have been processed, the SCL module uses current parametrization to compute the confidence of each sample data and use it to weight data in the meta update step.
  • Figure 4: Meta-learning process with outer and inner loops. In the inner loop, each task batch $T_1$ to $T_n$ updates task-specific parameters by optimizing $\theta$. After completing inner loop updates, the outer loop aggregates these adjustments to refine the global $\theta$, enhancing the model's ability to generalize and adapt quickly to new tasks.
  • Figure 5: Comparison of anomaly detection methods on the MVtec-AD (a) and KSDD2 (b) datasets, showing I-AUROC values across noise levels from 0% to 10%.