Skip to content

Repository files navigation

K-MEB (SGD) — prototorch implementation

Paper DOI

Reference implementation of the stochastic-gradient-descent variant of the K minimum enclosing ball (K-MEB) outlier detector from:

D. Staps, T. Villmann, B. Paaßen, "K Minimum Enclosing Balls for Outlier Detection", WSOM+ 2024, Springer, 2024, pp. 174–184. DOI: 10.1007/978-3-031-67159-3_20

What it does

Fits K enclosing balls for outlier detection by stochastic gradient descent, inspired by Generalized Learning Vector Quantization (GLVQ): points are visited one by one, balls are pushed away from negatives and the closest ball is pulled toward positives, minimizing the soft (hinge-relaxed) K-MEB objective (typically with Adam). Built on top of prototorch. The companion alternating-optimization / QP variant lives in [K-MEB_qp].

Run

pip install -r requirements.txt
python3 examples/KMEB_irisAnomalie.py            # Euclidean
python3 examples/KernelizedKMEB_irisAnomalie.py  # kernelized

The exact paper state is on branch published / tag v-paper-2024a.

Layout

Path Purpose
kmeb_prototorch/oneclass.py K-MEB model (prototorch GLVQ-based)
kmeb_prototorch/functions/ distances, competitions, losses, callbacks
examples/ runnable examples (Euclidean + kernelized)

Dependencies

prototorch / prototorch_models (PyPI) provide the LVQ building blocks. This repo does not depend on the private prototorch_oneclass research package.

How to cite

See CITATION.cff and cite the paper above.

BibTeX:

@inproceedings{staps2024kmeb,
  title     = {K Minimum Enclosing Balls for Outlier Detection},
  author    = {Staps, Daniel and Villmann, Thomas and Paa{\ss}en, Benjamin},
  booktitle = {Advances in Self-Organizing Maps, Learning Vector Quantization, Interpretable Machine Learning, and Beyond (WSOM+ 2024)},
  pages     = {174--184}, year = {2024}, publisher = {Springer},
  doi       = {10.1007/978-3-031-67159-3_20}
}

Acknowledgment

By Daniel Staps (0009-0002-4459-4544), Thomas Villmann and Benjamin Paaßen. Cleanup with assistance from Claude (Anthropic).

License

MIT — see LICENSE.

About

K Minimum Enclosing Balls for outlier detection — SGD/GLVQ variant (prototorch).

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages