ADERH — Anomaly Detection by an Ensemble of Random Pairs of Hyperspheres
Official implementation of the NeurIPS 2025 paper "Anomaly Detection by an Ensemble of Random Pairs of Hyperspheres" (Walid Durani, Collin Leiber, Khalid Durani, Claudia Plant, Christian Böhm).
ADERH is a fast, hyperparameter-robust, isolation-based unsupervised anomaly detector for tabular data. Guided by a δ-separation argument, it covers normal regions with an ensemble of small hyperspheres built from randomly paired points; each sphere's isolation signal is refined by Pitch (a boundary-proximity ratio) and NDensity (a sparsity-aware density weight), and signals are averaged over the ensemble.
Install
pip install aderh
or from source:
git clone https://github.com/Walid10010/ADERH.git && cd ADERH
pip install -e .
Runtime dependencies: numpy, scikit-learn only.
Quickstart
from aderh import ADERH
det = ADERH(random_state=0).fit(X_train) # unsupervised
scores = det.decision_function(X_test) # higher = more anomalous
labels = det.predict(X_test) # 1 = anomaly, 0 = normal
Key parameters: n_estimators=256 (ensemble size), n=18 (hyperspheres per
member), contamination=0.1 (sets the label threshold). Defaults reproduce
the paper.
Reproducing the paper
Experiments are based on the ADBench benchmark:
pip install -r requirements-experiments.txt
git clone https://github.com/Minqi824/ADBench.git && mv ADBench data
python experiments/run_experiment.py
Protocol: MinMax scaling to [0, 1], 3 stratified 70/30 splits
(StratifiedShuffleSplit, random_state=0), seeds 0, 1, 2, 1000, 10000
for stochastic methods, AUC-ROC and AUC-PR averaged over splits × seeds,
results appended to results.csv.
Implementation notes
The packaged detector is verified score-identical to the original
reference script (tests/test_equivalence.py). Scoring convention follows
PyOD: higher decision_function values indicate anomalies
(score_samples provides the scikit-learn sign convention). Hypersphere
radii are defined in squared-distance space; see
IMPLEMENTATION_NOTES.md for the precise reference
semantics.
Citation
@inproceedings{durani2025aderh,
title = {Anomaly Detection by an Ensemble of Random Pairs of Hyperspheres},
author = {Durani, Walid and Leiber, Collin and Durani, Khalid and
Plant, Claudia and B{\"o}hm, Christian},
booktitle = {Advances in Neural Information Processing Systems 38 (NeurIPS)},
year = {2025}
}
License
Released under the MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aderh-1.0.0.tar.gz.
File metadata
- Download URL: aderh-1.0.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e77f729be1817f05db944a98b10353e60855912c4d69395e652511e172c1c8
|
|
| MD5 |
8a474793ee9c08b1bd6d3caf11c8b158
|
|
| BLAKE2b-256 |
1885606163d07955454fe60e5d7a401fa7ef33ddf53811033896714d3106c47c
|
File details
Details for the file aderh-1.0.0-py3-none-any.whl.
File metadata
- Download URL: aderh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
058b113dd5190562f164085e5b8cf26966b8992eb12c6ef5c4592b208085cbb9
|
|
| MD5 |
1450de8079388d8be4ab3bdab01b7d5b
|
|
| BLAKE2b-256 |
dffb3b7e32bbd3ac0cd13f78457fc557dbef86b918f1bcacfdda5b7150640606
|