Introduction
Unsupervised outlier detection (OD) aims to identify anomalous samples in a dataset without the guidance of labels. Traditionally, Autoencoders (AEs) have been the standard tool for this task, operating on the assumption that anomalies are harder to reconstruct than normal data. However, modern neural networks are often excessively proficient at reconstruction, frequently reproducing outliers with high fidelity. This "over-reconstruction" prevents AEs from effectively distinguishing between inliers and outliers based on pixel-level errors.
The MCOD Framework
To address these limitations, we introduce MCOD (Memory and Contrastive Learning for Outlier Detection). MCOD shifts the focus from pixel-level reconstruction to high-level feature space analysis. The framework utilizes two primary components: a Contrastive Learning Module and a specialized Memory Module.
Contrastive Learning Module
Using a dual-encoder setup (similar to MoCo), the model learns to map augmented versions of the same image to similar feature representations while pushing different images apart. This process establishes a discriminative feature space where semantic identities are naturally separated, making anomalies easier to isolate.
Memory Module and the "Forgetting" Mechanism
The memory module maintains "prototypes" representing cluster centers of normal data. It performs three key operations:
- Reading: Measures feature consistency by comparing samples to prototypes.
- Writing: Updates prototypes using features from the training queue.
- Forgetting: To handle "polluted" training data containing outliers, the model tracks prototype support. Prototypes with low support—likely representing anomalies—are suppressed using Gaussian noise. This ensures the memory primarily stores "normal" patterns.
Experimental Results
MCOD was evaluated on standard benchmarks including MNIST, Fashion-MNIST, CIFAR-10, and CIFAR-100. The framework demonstrates significant performance gains over state-of-the-art methods, particularly on complex datasets.
On the CIFAR-100 dataset with a 10% outlier proportion, MCOD achieved an AUROC of 87.7%, a stark improvement over the 51.2% achieved by a standard Convolutional Autoencoder (CAE). Furthermore, MCOD maintains stability even as the outlier proportion increases to 20%, thanks to the robustness of the memory module's filtering capabilities.
Discussion and Conclusion
The success of MCOD highlights that pixel-level reconstruction is often a distracting proxy for outlier detection. By focusing on feature-space consistency and implementing an active "forgetting" mechanism, the model effectively purifies its internal representation of normalcy.
A primary limitation is the "Minority Assumption": the system relies on outliers being infrequent. If outliers exceed approximately 30% of the dataset, they may begin to be perceived as legitimate patterns by the memory module. Future research will explore the use of prior features to further strengthen the model's initial understanding of "normal" data.
Summary updated