Skip to main content
QUICK REVIEW

[Paper Review] PySAD: A Streaming Anomaly Detection Framework in Python

Selim F. Yilmaz, Süleyman S. Kozat|arXiv (Cornell University)|Sep 5, 2020
Anomaly Detection Techniques and ApplicationsComputer Science19 references13 citations
TL;DR

PySAD is a Python-based open-source framework for streaming anomaly detection, offering 16 state-of-the-art models tailored for real-time, memory-constrained data. It integrates with PyOD and scikit-learn, supports unsupervised, semi-supervised, and supervised learning, and includes modular components like projectors, ensemblers, and probability calibrators for end-to-end experimentation with streaming data.

ABSTRACT

Streaming anomaly detection requires algorithms that operate under strict constraints: bounded memory, single-pass processing, and constant-time complexity. We present PySAD, a comprehensive Python framework addressing these challenges through a unified architecture. The framework implements 17+ streaming algorithms (LODA, Half-Space Trees, xStream) with specialized components including projectors, probability calibrators, and postprocessors. Unlike existing batch-focused frameworks, PySAD enables efficient real-time processing with bounded memory while maintaining compatibility with PyOD and scikit-learn. Supporting all learning paradigms for univariate and multivariate streams, PySAD provides the most comprehensive streaming anomaly detection toolkit in Python. The source code is publicly available at github.com/selimfirat/pysad.

Motivation & Objective

  • To address the lack of specialized, open-source frameworks focused exclusively on streaming anomaly detection.
  • To provide a comprehensive, modular, and extensible framework for researchers and practitioners to design and evaluate streaming anomaly detection pipelines.
  • To enable seamless integration of batch anomaly detection models (from PyOD) into streaming settings via dedicated adapters.
  • To ensure high software quality through PEP8 compliance, continuous integration, and >95% test coverage.
  • To introduce unsupervised probability calibrators that convert raw anomaly scores into interpretable probabilities.

Proposed method

  • PySAD implements a streaming anomaly detection API based on the `BaseModel` class, which defines `fit_partial`, `score_partial`, and `fit_score_partial` for incremental learning and scoring.
  • The framework supports modular pipeline construction with components such as preprocessors, projectors, ensemblers, postprocessors, and probability calibrators.
  • It integrates batch anomaly detectors from PyOD (e.g., Isolation Forest) into streaming mode via `fit_score_partial` for online inference.
  • Probability calibrators use techniques like Gaussian tail fitting and conformal prediction to transform anomaly scores into probabilistic outputs.
  • The framework is built on top of scikit-learn and PyOD, leveraging their robustness and modularity while extending them for streaming workloads.
  • Continuous integration and testing are enforced across Linux, Windows, and macOS using Azure Pipelines to ensure cross-platform reliability.

Experimental results

Research questions

  • RQ1How can a modular, extensible, and production-ready framework for streaming anomaly detection be designed in Python?
  • RQ2What is the performance and usability advantage of a framework that natively supports streaming anomaly detection compared to batch-focused or general streaming frameworks?
  • RQ3Can unsupervised probability calibration techniques improve the interpretability of anomaly scores in streaming settings?
  • RQ4How effectively can existing batch anomaly detection models be adapted for streaming inference using a lightweight integration layer?
  • RQ5What role do modular components like projectors, ensemblers, and postprocessors play in enhancing detection performance on real-time data streams?

Key findings

  • PySAD is the only open-source framework in Python that exclusively focuses on streaming anomaly detection, offering 16 specialized models not available in general-purpose streaming tools.
  • The framework enables the use of batch models from PyOD in streaming mode through a seamless integration layer, extending their applicability to real-time systems.
  • Probability calibrators in PySAD convert raw anomaly scores into meaningful probabilities, enhancing interpretability and decision-making in real-world deployments.
  • The framework supports all major learning settings—unsupervised, semi-supervised, and supervised—within a unified streaming API.
  • With >95% test coverage, PEP8 compliance, and continuous integration across platforms, PySAD ensures high software quality and maintainability.
  • The modular pipeline design allows researchers to easily combine components like projectors, ensemblers, and postprocessors to optimize detection performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.