PIF: Anomaly detection via preference embedding

Filippo Leveni, Luca Magri, Giacomo Boracchi, Cesare Alippi · DOI

Abstract

Traditional anomaly detection methods primarily target statistical outliers in low-density regions. However, many real-world anomalies are defined by their deviation from structured geometric patterns rather than their isolation in space. We present Preference Isolation Forest (PIF), a framework that identifies these "pattern-breaking" anomalies by embedding data into a preference space and isolating points using a novel tree-based method, PI-FOREST, which utilizes Voronoi tessellations and Tanimoto distance. PIF demonstrates superior performance on both synthetic geometric datasets and complex computer vision benchmarks.

Introduction

Standard anomaly detection focuses on identifying points in low-density regions. In many applications, such as computer vision or industrial monitoring, an anomaly is not necessarily a point far from the crowd, but one that fails to follow a specific geometric rule or structure. For instance, in a dataset of intersecting lines, a point at the intersection is in a high-density area but may still be an anomaly if it does not lie precisely on either line. Detecting such "pattern-recognition" anomalies typically requires solving the difficult multi-model fitting problem first. PIF addresses this by detecting anomalies directly without full structure reconstruction.

Comparison of density-based (a) and pattern-based (b) anomalies.

Methods

The PIF framework consists of two primary stages: Preference Embedding and PI-FOREST isolation.

Preference Embedding

The data is mapped from ambient coordinates into a "preference space." The algorithm samples numerous random model instances (e.g., lines, circles). Each data point is represented by a vector where each dimension indicates its fit (preference) for a specific model. Normal points exhibit high preferences for models matching the underlying structure, whereas anomalies show sparse or null preferences, making them isolated in this new space.

PI-FOREST

Standard Isolation Forests (IFOR) use axis-parallel cuts, which are ineffective in preference space due to non-independent dimensions and non-Euclidean geometry. PIF introduces PI-TREE, which partitions space using Voronoi tessellations. By selecting random seed points and grouping data based on the Tanimoto distance—which is better suited for sparse preference vectors—PI-TREE effectively isolates anomalies at shallower depths.

Hierarchical partitioning of the preference space using Voronoi-based PI-TREE.

Experimental Evaluation

The researchers evaluated PIF against standard detectors like IFOR, Extended Isolation Forest (EIFOR), and Local Outlier Factor (LOF).

Datasets

  • Synthetic 2D Datasets: Seven datasets with structures like parallel lines (stair), intersecting lines (star), and concentric circles.
  • AdelaideRMF Dataset: A computer vision benchmark for identifying mismatched feature points in stereo image sequences.

Key Results

PIF consistently outperformed competitors in accuracy and robustness. On synthetic data, PIF achieved significantly higher AUC scores, particularly in "unbalanced" scenarios where one structure has far fewer points than another—a case where density-based methods like LOF often fail. In real-world tests on the AdelaideRMF dataset, PIF reached a mean AUC of 0.983 for homography estimation and 0.987 for fundamental matrices, demonstrating near-perfect detection of geometric mismatches.

Conclusion

PIF offers a robust solution for detecting anomalies that violate geometric structures. By leveraging preference embedding and Voronoi-based isolation, it bypasses the need for explicit model fitting. Future work includes exploring non-parametric embeddings and applying PIF to industrial defect detection.

Summary updated

BibTeX
@inproceedings{leveni2020pif,
  author = {Filippo Leveni and Luca Magri and Giacomo Boracchi and Cesare Alippi},
  title = {{PIF: Anomaly detection via preference embedding}},
  booktitle = {ICPR},
  year = {2020},
  doi = {10.1109/icpr48806.2021.9412658},
}
Figure