ODIM: Outlier Detection via Likelihood of Under-Fitted Generative Models

Dongha Kim, JaesungHwang, Jongjin Lee, Kunwoong Kim, Yongdai Kim

Overview

Unsupervised Outlier Detection (UOD) is the task of identifying anomalies within a dataset that contains both normal data (inliers) and outliers, without the benefit of labeled examples. A standard approach to UOD involves training a Deep Generative Model (DGM), such as a Variational Autoencoder (VAE), to estimate the underlying data distribution. Data points with low likelihoods are then flagged as outliers.

However, a well-known and frustrating phenomenon plagues this approach: fully trained DGMs are notoriously poor at distinguishing outliers. Because neural networks are highly expressive, they eventually memorize the anomalies alongside the normal data, often assigning higher likelihoods to outliers than to inliers.

To address this, researchers introduce ODIM (Outlier Detection via the Inlier-Memorization effect). ODIM exploits the tendency of models to learn normal, dense data first by deliberately under-fitting the model. The result is a highly accurate, domain-agnostic outlier detector that runs tens of times faster than existing deep learning methods.

The ODIM Methodology

Instead of engineering a complex new model architecture, ODIM fundamentally alters the training process of existing DGMs to prevent anomaly memorization.

Overview of the ODIM pipeline.

The ODIM framework consists of four key steps:

  1. Min-Max Scaling: Data is pre-processed using min-max scaling rather than standard z-score normalization. Mathematical proofs in the study show that this keeps gradient updates balanced, ensuring the model doesn't accidentally prioritize outliers during early training steps.
  2. Under-fitting a DGM: ODIM trains an Importance Weighted Autoencoder (IWAE), but only for a very brief period—often less than a single epoch.
  3. Smart Early Stopping: To determine the exact moment to halt training, ODIM monitors the distribution of loss values across the training batch. As the model learns the inliers, the loss distribution splits into two distinct peaks (bimodal): low loss for inliers and high loss for outliers. ODIM fits a 2-component Gaussian Mixture Model (GMM) to these losses and stops training when the Wasserstein distance between the two peaks is maximized.
  4. Ensembling: Because early training dynamics are highly stochastic, ODIM trains multiple models (e.g., 10) in parallel with different random initializations and averages their outlier scores to ensure stability.

Key Insights: The Inlier-Memorization Effect

The foundational concept behind ODIM is the Inlier-Memorization (IM) Effect. Similar to how neural networks learn clean labels before noisy ones in supervised learning, DGMs learn dense regions (inliers) before sparse regions (outliers). Because reducing loss in dense regions drops the overall objective function faster, the optimizer naturally prioritizes inliers in the early epochs.

Histograms illustrating the Inlier-Memorization (IM) effect, where normal and anomaly loss distributions separate early in training.

This leads to a critical realization: likelihood is a good indicator of anomalies, but only briefly. The widely held belief that likelihood is a poor anomaly score only applies to fully trained models. In the early stages of training, likelihood is actually a highly discriminative feature. Furthermore, pre-processing dictates these early gradients. If standard z-score standardization is used, inliers might end up with larger norms than outliers, ruining the IM effect. Min-max scaling prevents this gradient imbalance.

Experimental Results

The authors evaluated ODIM on a massive suite of 57 benchmark datasets sourced from ADBench, proving it is highly effective and domain-agnostic across tabular, image, and text data.

  • State-of-the-Art Accuracy: ODIM achieved highly competitive results across all modalities, beating over 16 baselines.
  • Tabular (36 datasets): Average AUC of 0.757 (outperforming the next best, OCSVM, at 0.740).
  • Image (6 datasets): Average AUC of 0.813 using ViT features (crushing the next best, DTE, at 0.757).
  • Text (5 datasets): Average AUC of 0.659 using BERT/RoBERTa embeddings (vs. 0.598 for DTE).
  • Computational Speed: Because ODIM stops after just a few updates, it is incredibly fast. On the Cover dataset, ODIM took 7.7 seconds, whereas a baseline like DeepSVDD took 3,463 seconds.
  • Extensions: ODIM was successfully adapted for Differential Privacy (using DP-SGD) and semi-supervised settings (incorporating a few known outlier labels using a CUBO loss), demonstrating strong performance and flexibility.

Limitations and Future Directions

While the authors proved that min-max scaling preserves the IM effect better than standardization, they acknowledge it might not be the absolute optimal choice. Finding the perfect pre-processing technique remains an open research question. Additionally, while the theoretical insights into parameter updates during initial learning steps are novel, exploring these dynamics further could yield even more robust early-stopping or training strategies in the future.

Summary updated

BibTeX
@inproceedings{kim2024odim,
  author = {Dongha Kim and JaesungHwang and Jongjin Lee and Kunwoong Kim and Yongdai Kim},
  title = {{ODIM: Outlier Detection via Likelihood of Under-Fitted Generative Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=R8nbccD7kv},
}
Figure