Abstract
Standard anomaly detection algorithms typically flag any data point that deviates significantly from the norm. However, in many practical applications—such as medical diagnostics or industrial monitoring—deviations in a "positive" direction (e.g., exceptionally low blood pressure or high machine efficiency) should not be treated as anomalies. This paper introduces monotonic anomaly detection, which employs asymmetric distance measures to ignore "good" deviations. We demonstrate that using a "ramp distance" function improves detection performance across a variety of real-world datasets by focusing on directional risk factors.
Introduction
Most semi-supervised anomaly detection methods operate on the principle that any significant difference from training data constitutes an anomaly. This difference is usually calculated using absolute distance (Minkowski p-distance). While effective for general outlier detection, this approach is often suboptimal when domain knowledge indicates that only one-sided deviations are problematic. For instance, a patient with perfect health metrics might be statistically distant from an average population but is not a medical anomaly in a clinical sense. The challenge lies in incorporating this monotonicity into existing algorithms without compromising their underlying local density estimation capabilities.
Methodology
The authors adapt four distance-based algorithms: Centre Distance (CD), Nearest Neighbour Distance (NND), Local Outlier Factor (LOF), and Average Localised Proximity (ALP). The primary innovation involves replacing the standard absolute difference $|y_i - x_i|$ with asymmetric variants that interpret negative values differently.
Two main variants are explored:
- Ramp Distance: Defined as $\max(0, y_i - x_i)$, this function treats "better than normal" values as neutral, providing no evidence for or against anomality.
- Signed Distance: Defined as $(y_i - x_i)$, this treats "better than normal" values as negative evidence, allowing them to potentially offset "bad" values in other attributes.
Experimental Setup
The proposed methods were evaluated using both synthetic datasets and ten real-world datasets from the UCI repository. These datasets span medical, industrial, and financial domains where attributes represent clear monotonic risk factors.
Results and Discussion
The experiments revealed several key insights:
- The "Compensation" Trap: While Signed Distance performed well on synthetic data, it struggled with real-world datasets. The negative values allowed "extra healthy" attributes to cancel out high-risk attributes, effectively reducing the complex local intelligence of algorithms like LOF to a simple sum of values.
- Ramp Distance Superiority: Ramp Distance emerged as the optimal choice. By treating "good" deviations as zero rather than negative, it maintains the algorithm's ability to model local data structures while ignoring irrelevant positive outliers.
- Performance Gains: On real-world data, Ramp Distance consistently outperformed traditional Absolute Distance. Statistical testing (one-sided Wilcoxon signed-rank) confirmed these improvements were significant, particularly for the ALP and NND algorithms.
- Contextual Limitations: In cases like the
diabetes-riskdataset, the monotonic approach underperformed because the training "norm" did not represent an ideal state. This highlights that monotonicity is most effective when the training data represents a baseline from which "bad" deviations are clearly defined.
Conclusion
Incorporating directional domain knowledge through Ramp Distance significantly enhances the precision of distance-based anomaly detection. This approach prevents "good" outliers from being flagged as anomalies, a common issue in medical and industrial applications. Future research should investigate extending these monotonic constraints to other frameworks, such as Isolation Forests or Support Vector Machines.
Summary updated