Abstract
Anomaly detection often struggles with complex data patterns that do not align with simple coordinate axes. We present the Function-Based Isolation Forest (FuBIF), a mathematical framework that unifies diverse isolation-based models—including Extended, Hypersphere, and Deep Isolation Forests—under a single functional umbrella. By replacing traditional axis-aligned splits with generalized real-valued functions, FuBIF improves detection accuracy on non-linear data. Furthermore, we introduce FuBIFFI, a gradient-based method that provides robust, model-agnostic explanations for anomaly scores, ensuring that increased model complexity does not come at the cost of interpretability.
The Challenge of Geometric Bias
Anomaly detection is fundamentally a "needle in a haystack" problem. The classic Isolation Forest (IF) algorithm is widely adopted due to its efficiency; it isolates anomalies by randomly partitioning data until a point resides in its own leaf node. Because anomalies are few and different, they are typically isolated closer to the tree root than normal points.
However, standard IF suffers from a significant geometric weakness: it only splits data along coordinate axes (e.g., "Is Feature A > 10?"). When data exhibits complex, diagonal, or curved patterns, IF becomes biased and inefficient. While specialized variants like "Extended" or "Hypersphere" IF have been proposed to mitigate this, the field has lacked a consistent theoretical framework to unify these methods and explain their results.
The FuBIF Framework
FuBIF addresses these limitations by defining a split using a general function $f(x)$ and a threshold $\tau$. By selecting different sets of functions $\mathcal{F}$, researchers can recreate existing models or develop entirely new ones. The framework introduces several novel "conic section" splitters:
- Ellipsen-IF: Utilizes n-dimensional ellipsoids for partitioning.
- Hypern-IF: Employs hyperbola branches.
- Quad(λ)-IF: Uses general quadratic surfaces.
- NN-IF: Employs small, randomly initialized neural networks at each node to create highly flexible, non-linear boundaries.
As shown in the figure above, while standard IF (a) creates blocky, axis-aligned boundaries, FuBIF variants like the Sine-IF (f) can perfectly capture the underlying geometry of the data. This flexibility allows the model to isolate anomalies more effectively in high-dimensional, non-linear spaces.
Interpretable Anomalies with FuBIFFI
Explaining why a specific point was flagged as an anomaly is critical for trust in machine learning systems. Explaining non-linear splits is inherently difficult, but FuBIF solves this through FuBIFFI (FuBIF Feature Importance).
FuBIFFI calculates the gradient of the splitting functions along the path to an anomaly. By tracing how much each feature contributes to the "slope" of the decision boundary at every split, it assigns a precise importance score to every feature. This approach is model-agnostic, providing consistent explanations whether the underlying model uses simple linear splits or complex neural networks.
Key Insights and Results
- Geometry is Context-Dependent: There is no universal "best" splitter. Standard IF may outperform Ellipse-IF on square-shaped data (like the Pendigits dataset), while Ellipse-IF excels on globular data (like the Wine dataset).
- Performance and Efficiency: FuBIF models generally outperform established baselines, including AutoEncoders and Deep Isolation Forests, across standard benchmark datasets (e.g., ODDS library). Crucially, FuBIF scales significantly better than deep learning approaches, making it viable for large-scale industrial use.
- Unification of Deep Learning: The framework reveals that "Deep Isolation Forest" is a specific instance of FuBIF where the functions are neural networks, allowing for a more rigorous comparison between traditional and deep methods.
Limitations and Future Directions
While powerful, complex splitters can introduce new challenges. For instance, Quadric-IF can exhibit a lack of "translational invariance," meaning the model's effectiveness may change if the data is simply shifted in space without changing its internal structure.
Future research aims to develop Adaptive FuBIF, which would automatically select the optimal splitting function for a specific subset of data during the tree-building process. Additionally, creating ensembles that mix different function types (e.g., combining linear and circular splits) could further enhance robustness across diverse data geometries.
Summary updated