Ensemble Isolation Forest

Machine Learning
Introduced by
Liu, F. T., Ting, K. M., Zhou, Z.-H. (base IF); ensemble extensions by multiple researchers
Year
2008 (base); ensemble variants 2010s–present
Type
Meta-ensemble anomaly detection
Family
Machine learning

What does it do?

Ensemble Isolation Forest trains several Isolation Forest models, each with a different random seed and, optionally, a different subsampling size, and combines their anomaly scores into one ranking.

The aim is to reduce the variance that a single forest shows on borderline observations, so that the ranking is intended to be less sensitive to the random choices made during training. It is an unsupervised method, typically applied to numeric tabular data.

The intuition behind the method

A single Isolation Forest can be sensitive to its random seed: the scores it assigns to borderline observations can shift between runs. Training several forests and combining their scores is meant to play a role similar to Random Forest in classification, averaging out part of the noise of individual models. Each forest isolates points along different random partitions of the feature space, so an observation that is easy to isolate across many forests is a stronger candidate for review than one flagged by a single model. Disagreement between forests is also informative, because it marks observations whose score depends on the random choices.

History

Isolation Forest was introduced by Liu, Ting, and Zhou at the 2008 IEEE International Conference on Data Mining (ICDM). Instead of profiling normal points, it isolates anomalies by random recursive partitioning, since anomalies are few and differ from the rest and so need fewer splits to separate. The original evaluation reported favourable AUC and processing time against ORCA, LOF and random forests, especially on large datasets. Ensemble variants, including the one described here, were developed after the base method and are not tied to a single verified originator or publication.

When to use it

Choose Ensemble Isolation Forest when a single Isolation Forest gives unstable rankings across runs and the anomaly ordering needs to be less sensitive to random seeds. It fits numeric tabular data with no assumed anomaly distribution, including high-dimensional data with many irrelevant attributes (the setting in which the base method was reported to perform well) and larger datasets where distance- or density-based methods become costly. It also suits settings where false alarms are expensive enough that a stable ranking justifies extra compute, such as fraud or intrusion monitoring. Consider simpler statistical baselines first when the data have only a handful of features, since isolation-based partitioning may offer little advantage there. Also avoid it when compute or memory is tightly limited, since training several forests multiplies both. If labelled anomalies are available and the anomaly pattern is well defined, a supervised classifier may be the better choice.

Limitations and considerations

  • Compute and memory scale with the number of forests, and each additional hyperparameter adds tuning work.
  • On very low-dimensional data, isolation-based partitioning may offer little advantage over simple statistical baselines; compare against such baselines before adopting the method.
  • Scores are relative rankings rather than calibrated probabilities, so choosing a threshold requires domain knowledge or labelled validation data.
  • The method is designed for numeric data; categorical features must be encoded first, and the encoding can change which observations appear isolated.

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

Strengths

  • Designed to reduce sensitivity to random seeds, so scores should vary less across runs than those of a single Isolation Forest, particularly for borderline observations. Whether this holds on a given dataset should be checked by measuring rank stability across seeds.
  • The base method runs in linear time with a low constant and low memory requirements and was designed for large datasets; the ensemble adds cost in proportion to the number of forests.
  • No assumption about normality or linearity: the method works on numeric features without modelling their distribution.
  • Constituent forests are independent, so training parallelises directly.
  • The spread of scores across forests shows which observations depend on random choices. This is a sensitivity diagnostic, not a calibrated uncertainty estimate.
  • The base method was reported to work well in high-dimensional problems with many irrelevant attributes and when the training set contains no anomalies, which suits unsupervised use.

Applications

  • Illustrative example: fraud detection in financial transaction data, where anomalies are rare and costly.
  • Illustrative example: network intrusion detection on high-dimensional packet-level or flow-level features.
  • Illustrative example: industrial quality control and predictive maintenance on sensor time-series derived features.
  • Illustrative example: health informatics, flagging unusual patient profiles in clinical datasets.
  • Illustrative example: log anomaly detection and system monitoring in IT operations.

How it works

How it works

1

Several Isolation Forest models are trained independently. Each uses its own random seed and may also use a different subsampling size, which changes the random trees and therefore the partitions each forest explores. This diversity is the source of variance reduction. Settings that do not change the scores, such as a contamination value that only sets a decision threshold, add no diversity to the ensemble.

2

Each forest gives every observation an anomaly score s(x, n) = 2^(-E(h(x))/c(n)), where E(h(x)) is the average path length needed to isolate the point across that forest's trees and c(n) is a normalising term that depends on the subsample size n. Shorter average path lengths give scores closer to 1, meaning the point is easier to isolate and more anomalous.

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

The scores from all forests are combined, most simply by averaging. Weighted averaging, where forests judged better calibrated receive more weight, and rank aggregation, which combines the ordering of observations instead of raw score values, are alternatives. The aggregation rule should be stated when results are reported, because it changes how disagreements between forests are resolved.

4

A single decision threshold is applied to the aggregated score. Observations above it, or those in the top fraction set by the target contamination rate, are flagged as anomalies. The threshold can come from a target contamination rate, a statistical cutoff, or domain rules. Because the aggregated score is a relative ranking, the threshold is a practical choice rather than a probability level.

Common pitfalls

  • Using identical seeds and settings across forests produces identical forests and no variance reduction. Seed and subsampling diversity is what makes the ensemble useful.
  • Setting the contamination rate without domain knowledge or labelled reference data gives an arbitrary threshold. Contamination sets only the cut-off, so varying it across forests does not make the scores more diverse.
  • Tuning the contamination rate on the same data used to report performance inflates apparent results. Where labels exist, use a separate held-out set.
  • Reading aggregated scores as probabilities. They are relative ranks, so comparisons across datasets or across different thresholds need care.
  • Assuming the ensemble is more stable than a single forest without checking. Measure stability on your data: train forests with different seeds, compare the top-k flagged observations between subsets of forests (overlap or rank correlation), and add forests until that agreement stops changing.

Frequently asked questions

How many isolation forests should I include in the ensemble?

There is no fixed number that is correct for every dataset. Add forests incrementally and check whether the set of top-ranked observations still changes between subsets of forests, using overlap or rank correlation. Once that agreement stops changing, extra forests add runtime and memory cost with little expected benefit.

How is this different from a single Isolation Forest?

A standard Isolation Forest already averages scores over many isolation trees within a single training run. Ensemble Isolation Forest trains several such models with different seeds or settings and aggregates their scores, aiming at further variance reduction across models.

How do I choose the contamination parameter?

If you have labeled anomalies, tune contamination on a held-out validation set. Without labels, use domain knowledge (e.g., expected fraud rate) or treat the parameter as a sensitivity control and inspect the top-ranked observations manually before committing to a threshold.

Does the ensemble need labeled data?

No. Like standard Isolation Forest, the ensemble is fully unsupervised and does not require anomaly labels during training. Labels are useful only for evaluating or calibrating the final threshold.

When should I prefer this over One-Class SVM or Autoencoder-based detection?

One-Class SVM training cost can grow with the number of training samples, and kernel computations add cost on large datasets. Autoencoders require architecture decisions and hyperparameter tuning. Relative runtime depends on data size, implementation and settings, so benchmark the candidate methods on your own data. Prefer the ensemble when fast training on large numeric tabular data and stable rankings matter, and the data are not image or text.

Related methods

Sources

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

    Open DOI reference
  2. Isolation Forest. Wikipedia.

    Open publication reference