Active Learning Isolation Forest

Machine Learning
Introduced by
Das, S. et al. (active anomaly discovery framework); Liu, F. T. et al. (Isolation Forest base)
Year
2008–2019
Type
Active learning wrapper over isolation forest anomaly detector
Family
Machine learning

What does it do?

Active Learning Isolation Forest starts from an unsupervised Isolation Forest anomaly score and then asks a human expert to label a small set of instances chosen by a query strategy.

The expert labels are used to update the detector over several rounds, so the anomaly ranking reflects domain judgement as well as the structure of the data. The method is aimed at tabular data in which anomalies are unlabeled and labeling capacity is limited.

The intuition behind the method

Isolation Forest scores an instance as anomalous when random recursive partitioning isolates it quickly, but it has no notion of which anomalies matter in a given domain. Active learning adds a loop: after the forest scores the pool, a query strategy selects instances, typically the highest-scored ones or those near an uncertain boundary, and an expert labels them as anomaly or normal. The labels then change how the detector treats the remaining pool, so each round refines the ranking. The approach depends on the expert's labels being reliable, because the loop reinforces whatever the labels say.

History

Liu, Ting and Zhou introduced Isolation Forest at ICDM 2008 as a method that explicitly isolates anomalies instead of profiling normal points. Das et al. (ICDM 2019), in the paper Incorporating Expert Feedback into Active Anomaly Discovery, study the incorporation of expert feedback into active anomaly discovery, which is the setting addressed here.

When to use it

Use this method for anomaly detection on tabular data that is unlabeled or mostly unlabeled, when a domain expert can judge presented instances and can label a small budget spread over several rounds. It fits settings such as cybersecurity, fraud detection, predictive maintenance and clinical outlier identification, where a false alarm has a real cost and a reviewer can check a flagged case. Do not use it when no reliable oracle exists, when what counts as an anomaly changes faster than the feedback loop can follow, or when each label is so costly that even a few queries are infeasible. If labeled anomalies are already numerous enough to train a supervised classifier reliably, a supervised classifier is usually the more appropriate choice; this sufficiency should be judged on the data at hand.

Limitations and considerations

  • The loop assumes the oracle's labels are correct. Noisy or inconsistent labels are fed back into the ranking and can degrade it.
  • Each round requires rescoring the pool, so the cost grows with the size of the unlabeled data, which may be impractical for very large datasets.
  • The final model depends on which instances were queried and how they were labeled. Two runs on the same data can therefore give different rankings, and the detector is harder to reproduce or audit than a plain Isolation Forest.
  • Isolation Forest is a batch method that builds its trees on sub-samples of a fixed dataset, so the base detector does not update on a stream. Streaming use needs an online or sliding-window variant before feedback can be applied.
  • Concept drift, in which the nature of anomalies changes over time, is not handled automatically and may require re-initializing the active loop.

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

Strengths

  • The starting ranking needs no labels: the Isolation Forest base is trained on unlabeled data, and the original paper reports that its scoring has linear time complexity with a low constant and a low memory requirement, which keeps the scoring step affordable on large pools.
  • Liu et al. (2008) report that the base Isolation Forest performs well when the training set contains no anomalies, so the unsupervised starting ranking does not depend on labeled examples. This evidence does not by itself establish the performance of the full active pipeline.
  • Expert effort is confined to the instances the query strategy selects, so most of the pool is never reviewed by a person.
  • Query strategies such as top-k or uncertainty-based selection can be changed without altering the forest scorer, so the loop can be tuned to the relative cost of false alarms and missed anomalies.
  • Each round produces a revised ranking, so the effect of the labels on the ordering of the pool can be checked after every batch.

Applications

  • Network intrusion and cybersecurity alert triage, where analysts label a small set of suspicious connections per shift.
  • Credit card fraud detection with periodic analyst review of flagged transactions.
  • Predictive maintenance in manufacturing, identifying rare machine failures from sensor streams with limited failure records.
  • Clinical outlier detection in electronic health records where clinicians confirm unusual patient profiles.
  • Scientific data quality control, flagging instrument errors in experimental datasets reviewed by domain scientists.

How it works

How it works

1

An Isolation Forest is first trained on all available unlabeled data. Each instance receives an anomaly score based on how quickly random recursive partitioning isolates it: instances in sparse, easily isolated regions receive high scores. This unsupervised pass seeds the active learning loop with an initial ranking.

2

All unlabeled pool instances are ranked by their anomaly scores. A query strategy, such as selecting the top-k highest-scored instances or those whose scores fall in an uncertain boundary region, identifies the instances from which an oracle label is expected to be most useful.

3

The selected instances are presented to a domain expert (or a simulated oracle in experiments), who labels each as anomaly or normal. Only a small number of queries per round are needed, which makes the approach practical when labeling is expensive or requires expert judgment.

4

The new labels are incorporated into the detector through an update rule. Possible rules include re-weighting the ensemble members whose isolation paths agree with confirmed anomalies, adjusting path-length thresholds, or retraining with the labeled instances added as constraints. These rules are not interchangeable, because each changes how scores move across the pool. Results therefore depend on the rule and parameters chosen, and these should be stated in any report. Score rankings are then recomputed for the remaining pool.

5

The query-label-update cycle repeats for a fixed number of rounds or until the labeling budget is exhausted. The final ranking combines the broad structure found by the original unsupervised forest with the expert labels collected in each round, which is what makes it tailored to the domain.

Common pitfalls

  • Querying instances with the highest anomaly scores exclusively can create a confirmation bias, causing the model to miss novel anomaly types that initially appear normal.
  • Reporting performance only on the queried instances rather than on a held-out test set, which inflates precision estimates.
  • Treating oracle labels as ground truth without accounting for inter-rater disagreement, especially in medical or security contexts.
  • Forgetting to re-evaluate the full unsupervised forest after feedback; stale scores can make subsequent query rounds inefficient.

Frequently asked questions

How many labeled instances are typically needed for meaningful improvement?

No fixed number applies, because the answer depends on the dataset and on how reliable the oracle is. The per-round query size and the total labeling budget are chosen by the user, and whether feedback helps is best checked on a held-out labeled set, described below. Those held-out labels also draw on the labeling budget.

Does the base Isolation Forest need to be retrained from scratch after each round?

This depends on the update rule chosen. If the rule adjusts how scores are ranked, the existing forest can be kept, which avoids a full refit. Full retraining with label constraints is an option once the labeled set is large enough to justify its cost.

What query strategy works best for anomaly detection?

Top-k scoring is simple to implement and suits cases where the highest-scored points are the most likely anomalies. Uncertainty or margin-based selection is more useful when the boundary between normal and anomalous instances is unclear. Diversity-aware selection reduces the chance that successive queries repeat the same kind of instance.

Can this approach handle streaming or online data?

Standard Isolation Forest is a batch method, so active-learning extensions also tend to be batch-oriented. For streaming settings, online or sliding-window variants of Isolation Forest are needed before active feedback can be applied.

How do I evaluate the model fairly given that only a few instances are labeled?

Hold out a labeled test set that is never used for querying. At each round, compute precision, recall and ROC AUC on this set to check genuine improvement rather than fit to the queried labels. The held-out labels use part of the same labeling budget, so the test set should be sized as a deliberate share of that budget.

Related methods

Sources

  1. Das, S., Wong, W. K., Fern, A., Dietterich, T. G., & Amran Siddiqui, M. (2019). Incorporating Expert Feedback into Active Anomaly Discovery. In Proceedings of the 2019 IEEE International Conference on Data Mining (ICDM), pp. 1009–1014.

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

    Open DOI reference