Robust Isolation Forest

Machine Learning
Introduced by
Liu, F. T., Ting, K. M., Zhou, Z.-H. (base); robust extensions by multiple authors
Year
2008–2019
Type
Robust ensemble anomaly detection
Family
Machine learning

What does it do?

Robust Isolation Forest is a name used for several variants of the Isolation Forest anomaly detector.

These variants aim to reduce score artefacts caused by axis-aligned splits and may pursue other robustness goals depending on the variant. It is not one canonical algorithm: the cited sources establish the base Isolation Forest (Liu et al., 2008) and one robust extension, the Extended Isolation Forest (Hariri et al., 2019). Whether a given variant also handles noisy or contaminated training data is not established by these sources and must be checked against that variant's own documentation.

The intuition behind the method

Isolation Forest scores each point by how quickly random recursive splits separate it from the rest of the data, so points isolated in few splits are treated as anomalous. Liu et al. (2008) report that this works well on large datasets and on high-dimensional problems with many irrelevant attributes. The robust literature identifies a different weakness: axis-aligned splits can leave geometric artefacts in the anomaly-score map, which Hariri et al. (2019) address by randomly transforming the data or by splitting along hyperplanes with random slopes. Whether a variant also handles anomalies inside the training set is a separate question. Liu et al. report good results when the training set contains no anomalies, so contamination robustness has to be verified for the specific variant in use.

History

Isolation Forest was introduced by Liu, Ting and Zhou in 2008. It isolates anomalies rather than profiling normal points, and it uses subsampling to achieve low cost. Hariri, Kind and Brunner (2019) proposed the Extended Isolation Forest after showing artefacts in anomaly-score heat maps caused by axis-aligned branching, and proposed random data transformation and random-slope hyperplanes as remedies. The name Robust Isolation Forest covers further variants whose specific origins are not established by the sources on this page.

When to use it

Choose a robust variant when you have a specific reason to expect the standard Isolation Forest to fail: for example, you have evidence that the training data contains anomalies and the variant documents how it handles them, or you have observed score artefacts of the kind Hariri et al. (2019) describe. Standard Isolation Forest should be the first baseline, since Liu et al. (2008) report favourable results on large datasets and on high-dimensional data with irrelevant attributes. Do not use the method when enough labelled anomalies are available, because supervised classifiers can use them directly. Avoid it for very small datasets, where random subsamples produce unstable rankings.

Limitations and considerations

  • Robustness steps add settings, such as a trimming fraction or a contamination value, for which the cited sources give no defaults, so they must be tuned and reported.
  • The score is a relative ranking in (0, 1), not a probability, so a threshold must be chosen separately, for example from labelled examples or from the score distribution.
  • Without ground-truth labels the ranking cannot be evaluated directly; the cited studies measure performance with AUROC and AUPRC against labelled benchmark data.
  • The cited sources do not establish that a generic robust variant tolerates contaminated training sets; Liu et al. (2008) report good performance when the training set contains no anomalies, so this must be checked for each variant.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Inherits from the base method the linear time complexity with a low constant and the low memory requirement reported by Liu et al. (2008); whether a given variant keeps these properties depends on its implementation.
  • The Extended Isolation Forest reduces artefacts in anomaly-score maps caused by axis-aligned branching, and Hariri et al. (2019) report improved robustness measured by the variance of scores along constant level sets.
  • Hariri et al. (2019) report no appreciable difference in convergence rate or computation time between the standard and extended forests.
  • Liu et al. (2008) report that Isolation Forest works well on high-dimensional problems with many irrelevant attributes.

Applications

  • Unsupervised screening of large tabular datasets, where Liu et al. (2008) report favourable AUC and processing time against several baselines.
  • Tabular data with many attributes, some of them irrelevant, which the base method was reported to handle.
  • Exploratory anomaly screening where no labelled anomalies exist, with the ranking used to prioritise observations for manual review.
  • Benchmarking new variants against standard Isolation Forest and the Extended Isolation Forest.

How it works

How it works

1

The standard Isolation Forest of Liu et al. (2008) builds trees from subsamples and ranks points by score; it does not use a contamination value. Some implementations accept a contamination value, so check the documentation of the variant for whether and how it is used. The cited sources do not describe a robust procedure for estimating contamination.

2

Each isolation tree is built on a small random subsample, the core design of Liu et al. (2008). The subsample size is a parameter; this page cites 256 points as typical, but that value should be checked against the full text of the base paper. Any additional safeguard, such as excluding extreme points in preliminary rounds, is variant-specific and not described in the cited sources.

3

Standard trees are grown by recursively choosing a feature at random and drawing a split value uniformly between that feature's minimum and maximum in the current node. Hariri et al. (2019) show that such axis-aligned branching can produce artefacts in anomaly-score heat maps. Their Extended Isolation Forest replaces the axis-aligned cut with a hyperplane with a random slope, which they prefer, and also describes randomly transforming the data before each tree as an alternative.

4

Each point is passed down every tree and its path length h(x) is recorded. The standard score s(x, n) = 2^{-E[h(x)]/c(n)} maps the expected path length into the interval (0, 1), where values closer to 1 indicate shorter isolation and therefore more anomalous points. c(n) is the normalising constant defined in Liu et al. (2008) for subsample size n; its full expression is not reproduced on this page. Any trimming or re-normalisation of path lengths is variant-specific and not described in the cited sources.

Formula
s(x, n) = 2^{-E[h(x)]/c(n)}
5

Path lengths from all trees are averaged to obtain E[h(x)], which makes the final ranking less dependent on any single tree. Other aggregation rules, such as a trimmed mean or reliability weighting, appear in some variants but are not specified in the cited sources, so take the choice from the implementation in use.

Common pitfalls

  • Treating Robust Isolation Forest as one algorithm: different papers and implementations use different robustness mechanisms, so results cannot be compared without naming the variant.
  • Setting a contamination value without validation, which can place the score cut-off poorly.
  • Reading a score near 1 as the probability that a point is anomalous.
  • Omitting the standard Isolation Forest and the Extended Isolation Forest as baselines before adding robustness steps.
  • Applying the method to very small datasets, where subsampling gives unstable rankings.

Frequently asked questions

How does Robust Isolation Forest differ from standard Isolation Forest?

Standard Isolation Forest uses random axis-aligned splits and ranks points by path length. Robust variants change one or more of the split geometry (for example the Extended Isolation Forest, which uses hyperplanes with random slopes), the handling of subsamples, or the aggregation of scores. Which change applies depends on the variant, so check its source paper.

How do I set the contamination parameter?

Use domain knowledge about the expected anomaly rate if you have it. Otherwise inspect the score distribution and, if labelled examples exist, choose the cut-off that gives acceptable precision and recall on them. The cited sources do not show how sensitive a robust variant is to a misspecified contamination value, so test this on your own data.

Is Robust Isolation Forest suitable for high-dimensional data?

Liu et al. (2008) report that Isolation Forest works well when many attributes are irrelevant. Hariri et al. (2019) address artefacts caused by axis-aligned splits in the score map and do not present their method as a fix for high dimensionality, so do not assume that an extended variant is needed in high dimensions.

When should I prefer a supervised anomaly detector instead?

When reliable labels exist for a meaningful number of anomalies, a supervised classifier can use them directly. Use an unsupervised robust method when labels are absent or sparse.

What sample size is required?

This page gives 256 points as the typical subsample per tree. Very small datasets produce unstable rankings because each tree sees little variety, and the cited sources do not give a minimum dataset size.

Related methods

Sources

  1. Liu, F. T., Ting, K. M., & Zhou, Z.-H. (2008). Isolation Forest. In Proceedings of the IEEE International Conference on Data Mining (ICDM), pp. 413–422. IEEE.

    Open DOI reference
  2. Hariri, S., Kind, M. C., & Brunner, R. J. (2019). Extended Isolation Forest. IEEE Transactions on Knowledge and Data Engineering, 33(4), 1479–1489.

    Open DOI reference