Abstract
Identifying whether a given sample is an outlier or not is an important issue in various real-world domains. This study aims to solve the unsupervised outlier detection problem where training data contain outliers, but any label information about inliers and outliers is not given. We propose a powerful and efficient learning framework to identify outliers in a training data set using deep neural networks. We start with a new observation called the inlier-memorization (IM) effect. When we train a deep generative model with data contaminated with outliers, the model first memorizes inliers before outliers. Exploiting this finding, we develop a new method called the outlier detection via the IM effect (ODIM). The ODIM only requires a few updates; thus, it is computationally efficient, tens of times faster than other deep-learning-based algorithms. Also, the ODIM filters out outliers successfully, regardless of the types of data, such as tabular, image, and sequential. We empirically demonstrate the superiority and efficiency of the ODIM by analyzing 20 data sets.
Introduction
Unsupervised Outlier Detection (UOD) is a critical challenge in machine learning, particularly when dealing with large-scale datasets where manual labeling is infeasible. In a typical UOD scenario, the dataset contains a mix of normal "inliers" and anomalous "outliers" without any ground-truth labels to distinguish them.
Traditional approaches often employ Deep Generative Models (DGMs) to learn the underlying data distribution. The core assumption is that outliers will have a lower likelihood under the trained model. However, fully trained DGMs often suffer from the "memorization" problem, where the model eventually learns the outliers as well as the inliers, sometimes even assigning higher likelihoods to the anomalies. This convergence reduces the model's effectiveness in outlier detection.
The ODIM Framework
To address these limitations, we propose ODIM (Outlier Detection via the IM effect). ODIM is built upon the Inlier-Memorization (IM) effect, an observation that deep generative models learn to represent prevalent patterns (inliers) significantly faster than rare patterns (outliers).
The ODIM algorithm consists of several key stages:
- Under-fitted DGMs: Instead of training to convergence, ODIM utilizes an Importance Weighted Autoencoder (IWAE) trained for only a few updates—often less than a single epoch.
- Adaptive Early Stopping: To identify the optimal point where the gap between inlier and outlier loss is maximized, we fit a two-component Gaussian Mixture Model (GMM) to the per-sample losses. The Wasserstein distance between these components serves as a proxy for bimodality; training stops when this distance is at its peak.
- Ensembling: To mitigate the variance inherent in early-stage training, ODIM averages scores from an ensemble of 10 small models trained in parallel.
- Min-Max Scaling: Empirical and theoretical evidence suggests that min-max scaling preserves the input norms that drive the IM effect better than standard normalization.
The Inlier-Memorization Effect
The core insight of this research is that "perfect" training is actually detrimental to outlier detection. The model's initial struggle to represent rare data points is precisely what enables detection.
The authors provide a theoretical foundation demonstrating that in the early stages of Variational Autoencoder (VAE) training, the gradient magnitude is proportional to the $l_1$-norm of the input. Because inliers are more frequent, they dominate the initial parameter updates, leading to a faster drop in loss compared to outliers.
Experimental Setup and Results
The effectiveness of ODIM was evaluated using ADBench, a comprehensive benchmark suite. The study covered 57 datasets across various modalities, including 46 tabular datasets, 6 image datasets (using ViT features), and 5 text datasets (using BERT/RoBERTa embeddings).
- Superior Performance: ODIM achieved the highest average AUC and Precision-Recall (PR) scores across tabular, image, and text data compared to over 20 baseline methods. On image data, it reached an average AUC of 0.813, notably higher than the next best deep learning method, DTE (0.757).
- Extreme Efficiency: By relying on under-fitting, ODIM is remarkably fast. For instance, on the "Cover" dataset, ODIM completed in 7.7 seconds, whereas DeepSVDD required over 3,400 seconds—a 450x speedup.
- Robustness: The method remains effective when combined with Differential Privacy (DP-SGD) and in semi-supervised settings where a small amount of labeled outlier data is available.
Limitations and Future Work
While ODIM is highly effective, some areas remain for future exploration. The choice of pre-processing significantly impacts the IM effect and warrants further study. Additionally, while the current theoretical analysis focuses on linear factor models, extending this to complex non-linear architectures would strengthen the method's theoretical foundation. Finally, hyperparameter tuning for the ensemble size and early stopping patience can still influence performance on specific datasets.
Summary updated