Skip to main content
QUICK REVIEW

[Paper Review] Elsa: Energy-based learning for semi-supervised anomaly detection

Sungwon Han, Hyeonho Song|arXiv (Cornell University)|Mar 29, 2021
Anomaly Detection Techniques and ApplicationsComputer Science27 references6 citations
TL;DR

Elsa proposes a novel semi-supervised anomaly detection method that unifies unsupervised contrastive learning with a prototype-based energy function to improve robustness against data contamination. By fine-tuning embeddings using an energy score derived from cosine similarity to learned prototypes, Elsa achieves state-of-the-art performance on benchmark datasets, even when training data contains unknown anomalies.

ABSTRACT

Anomaly detection aims at identifying deviant instances from the normal data distribution. Many advances have been made in the field, including the innovative use of unsupervised contrastive learning. However, existing methods generally assume clean training data and are limited when the data contain unknown anomalies. This paper presents Elsa, a novel semi-supervised anomaly detection approach that unifies the concept of energy-based models with unsupervised contrastive learning. Elsa instills robustness against any data contamination by a carefully designed fine-tuning step based on the new energy function that forces the normal data to be divided into classes of prototypes. Experiments on multiple contamination scenarios show the proposed model achieves SOTA performance. Extensive analyses also verify the contribution of each component in the proposed model. Beyond the experiments, we also offer a theoretical interpretation of why contrastive learning alone cannot detect anomalies under data contamination.

Motivation & Objective

  • Address the limitation of contrastive learning in anomaly detection when training data contains unknown anomalies.
  • Develop a unified framework that combines unsupervised contrastive pre-training with semi-supervised energy-based fine-tuning.
  • Improve model robustness by learning a structured normal data distribution through prototype-based energy scoring.
  • Enable effective anomaly detection with minimal labeled data by leveraging a small set of normal/OOD labels.
  • Provide theoretical insight into why standard contrastive learning fails under data contamination from the energy model perspective.

Proposed method

  • Pre-train a feature encoder using contrastive learning on augmented data to learn generalizable representations.
  • Define an energy function based on cosine similarity between input embeddings and learned prototype vectors to model normality.
  • Use a discriminative classifier to compute logits as energy scores, where low energy indicates normality and high energy indicates anomaly.
  • Fine-tune the model using a novel loss that maximizes inverse energy for anomalies and minimizes energy for normal samples.
  • Introduce a prototype-based mechanism to capture intra-class diversity in normal data without requiring ground-truth class labels.
  • Apply early stopping based on a validation score computed from distinguishing original from augmented samples, which correlates highly with test performance.

Experimental results

Research questions

  • RQ1Why does standard contrastive learning fail to detect anomalies when training data contains unknown anomalies?
  • RQ2How can energy-based learning be effectively combined with unsupervised contrastive representation learning for anomaly detection?
  • RQ3What is the impact of prototype count and early stopping strategy on model performance and generalization?
  • RQ4Can a small set of labeled normal/OOD samples significantly improve detection robustness in contaminated training data?
  • RQ5How does the proposed energy function compare to existing loss objectives in terms of separation of normal and anomalous distributions?

Key findings

  • Elsa achieves state-of-the-art performance on CIFAR-10 and other benchmark datasets, even with only a small number of labeled samples.
  • The model demonstrates strong robustness in scenarios with unknown anomalies in training data, outperforming existing SOTA methods.
  • Ablation studies show that changing the contrastive learning objective’s energy function leads to the largest performance drop, validating the theoretical analysis.
  • The early stopping score based on distinguishing original from augmented samples shows a high Pearson correlation (0.912 ± 0.038) with test AUROC, enabling reliable early stopping.
  • The energy score distribution evolves during training: normal samples concentrate near prototypes while anomalies spread out, enabling clear separation.
  • Qualitative analysis confirms that prototypes capture meaningful, visually coherent clusters of normal data, such as distinct shapes in the Airplane class of CIFAR-10.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.