Introduction
In anomaly detection, algorithms typically generate a continuous anomaly score for each data point. However, operationalizing these scores—such as deciding when to trigger an alert—requires a binary threshold. This threshold is traditionally determined by the contamination factor ($\gamma$), which represents the expected proportion of outliers in a dataset. In large-scale deployments, such as monitoring fleets of wind turbines or retail networks, manually labeling data to estimate $\gamma$ for every unique environment is prohibitively expensive. This paper introduces TRADE (TRansferring the contamination factor by shape similarity), a method designed to transfer a known contamination factor from a source domain to a related target domain without requiring new labels.
The TRADE Methodology: Normalcy as an Anchor
The fundamental hypothesis behind TRADE is that while the frequency of anomalies may vary between related domains, the distribution of scores representing "normal" behavior remains geometrically similar. Instead of focusing on the characteristics of anomalies, TRADE treats the "shape of normalcy" as a consistent anchor across domains.
The algorithm operates through a four-step process:
- Source Modeling: Using a known source contamination factor ($\gamma^S$), the algorithm identifies a threshold ($\lambda^S$) to define a $\lambda$-cut distribution, which captures the geometric shape of scores for normal instances.
- Shape Matching: In the unlabeled target domain, TRADE searches for a threshold ($\lambda^T$) that yields a $\lambda$-cut distribution most similar to the source, quantified using Kullback-Leibler (KL) divergence.
- Optimization: The search for the optimal threshold is treated as a global optimization problem, solved using Differential Evolution.
- Ensemble Weighting: To ensure robustness, TRADE employs an ensemble of nine anomaly detection algorithms (e.g., Isolation Forest, VAE). It dynamically weights these detectors based on their ability to maintain consistent score shapes across domains.
Experimental Evaluation
The authors validated TRADE using 206 source-target pairs across three real-world application areas:
- Water Consumption: Detecting leaks in retail store data.
- Wind Energy: Identifying ice formation on turbine blades using public datasets (Turbine 15 and 21).
- IoT Security: Monitoring network traffic for botnet activity (N-BaIoT).
Key Results and Performance
TRADE was benchmarked against several baselines, including direct source transfer and unsupervised methods like OTSU and UNIFY. The results demonstrated that TRADE consistently outperforms these methods in both estimating the contamination factor and final detection accuracy.
Specifically, TRADE achieved the lowest Mean Absolute Error (MAE) in $\gamma$ estimation across the majority of test cases. When evaluating detection performance via F1 scores, TRADE showed improvements of 22% to 35% over the best-performing competitors in water and wind turbine tasks. Notably, the method proved robust even when the contamination levels of the source and target domains differed significantly (e.g., a 10% source vs. a 1% target).
Conclusion and Limitations
TRADE provides a scalable solution for the "threshold problem" in anomaly detection by leveraging the geometric stability of normal behavior. While highly effective, the method assumes a degree of domain similarity; it is not intended for transfers between fundamentally unrelated data types. Additionally, the computational cost of the optimization step and the current search range for $\gamma$ (limited to 0–0.25) are areas for future refinement. Despite these constraints, TRADE represents a significant step toward automated, label-free thresholding in complex monitoring environments.
Summary updated