Imagine trying to draw a boundary around a cluster of normal data points to isolate anomalies. To do this, almost every classical and modern unsupervised anomaly detection algorithm requires a crucial piece of information: the contamination ratio ($\epsilon$), which specifies the exact proportion of outliers hidden within the dataset.
If you guess too high, the boundary shrinks too far, falsely rejecting perfectly valid data. If you guess too low, the boundary expands, inadvertently swallowing and memorizing the very anomalies you want to detect.
This requirement creates a fundamental paradox. We deploy unsupervised anomaly detection precisely because we do not know what the anomalies look like or how often they occur. Yet, from early kernel methods (Roth et al.) and support vector machines (Xu et al.) to deep normalizing flows (Śmieja et al.) and clustering frameworks (Fang et al.), performance hinges entirely on this unknown hyperparameter.
To build truly autonomous systems, a growing body of research focuses on learning or bypassing this contamination ratio directly from unlabeled, uncurated data.
The Intuition of Ranking Stability
How can we infer the proportion of outliers in a dataset without any labels? The key insight lies in observing how outlier scoring functions behave when we artificially vary our assumptions about the contamination level.
Consider what happens when you rank data points by their anomalousness across different hypothetical values of $\epsilon$. True, severe anomalies are robust; they remain at the top of the outlier ranking whether you assume the dataset is 1% contaminated or 10% contaminated. In contrast, marginal, normal data points fluctuate wildly in their rankings depending on where the boundary is drawn.
As demonstrated by Zhonghang LIU et al. in their FlexUOD framework, this phenomenon creates a predictable, quasi-linear relationship between the consistency of outlier rankings and the actual underlying contamination factor. By optimizing a ranking-similarity metric across varied contamination assumptions, the true outlier ratio can be mathematically exposed, allowing the system to automatically select the ideal detection strategy without human intervention.
Dynamic Filtering and Latent Optimization
Another approach avoids estimating a single static ratio upfront. Instead, these methods treat the anomaly labels as hidden, continuous variables and optimize them jointly alongside the model's parameters.
When a model trains on contaminated data, normal data points are easy to compress or reconstruct because they share underlying statistical patterns. Anomalies, being rare and disparate, resist this compression. We can exploit this difference during the training loop using two main mechanisms:
- Sample-Wise Importance Weighting: Kim et al. introduced an iterative framework (IAD) that assigns a continuous weight to each sample. As the model trains, samples with high error are progressively down-weighted. This prevents the model from overfitting to noise, effectively discovering the clean data distribution organically.
- Collaborative Peer-Filtering: Deep learning models like autoencoders are notoriously "too good" at learning, eventually memorizing outliers if trained long enough. To counter this without a fixed threshold, Boyang Liu et al. developed Robust Collaborative Autoencoders (RCA). By training multiple networks that peer-filter each other's data, the models only update their weights using samples that both networks agree look normal, neutralizing hidden outliers before they can corrupt the representations.
[ Contaminated Data ] ──> [ Autoencoder A ] ──( Filters Outliers )──> [ Trains Autoencoder B ]
│ ▲
└───────────────> [ Autoencoder B ] ──( Filters Outliers )────────────┘
By treating contamination as a latent variable to be minimized—as also explored by Aodong Li et al.—the model transforms hidden outliers from a source of destructive noise into a valuable training signal.
Post-Hoc Boundary Calibration
What if you cannot afford to retrain a massive deep learning model from scratch, but you know its decision boundary is biased because of an unknown training contamination rate?
Instead of modifying the training phase, recent work focuses on test-time adjustments. For example, Patra et al. developed an evidence-based post-hoc adjustment framework (EPHAD). This approach takes the biased predictions of a model trained on contaminated data and calibrates its decision boundaries at test time by injecting zero-shot "evidence" from foundation models (like CLIP).
By decoupling the boundary selection from the initial training phase, these methods allow practitioners to deploy anomaly detectors safely in open-world environments where the frequency of novel instances is completely unpredictable (Al-lahham et al.; Perini et al.).
Key Foundational Work
Outlier Detection with One-class Kernel Fisher Discriminants (2004) — contributed 1 concept elements to this direction.
Robust Support Vector Machine Training via Convex Outlier Ablation (2006) — contributed 1 concept elements to this direction.
A Novel Intrusion Detection Method (2004) — contributed 1 concept elements to this direction.