Skip to content

Implementation of anomaly detection approaches as scikit-learn estimators

License

Notifications You must be signed in to change notification settings

dsat4301/anomaly_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anomaly detection

This repository provides implementations of anomaly detection approaches as scikit-learn estimators. For the neural network-based models, PyTorch is also used. All implement the abstract classes BaseEstimator and OutlierMixin. The following methods acc. to the scikit-learn API are supported:

  • fit
  • predict
  • fit_predict
  • score_samples
  • decision_function
  • score

For more information, please refer to the scikit-learn documentation.

Installation using conda

cd <path-to-anomaly_detection-directory>
conda env create --file anomaly_detection.yml
conda activate anomaly_detection

# test installation
python -m pytest

Approaches

Approach Estimator Reference
Mahalanobis distance MahalanobisDistanceAnomalyDetector
Euclidean distance EuclideanDistanceAnomalyDetector
Chi-Squared distance ChiSquaredDistanceAnomalyDetector
DeepSVDD DeepSVDDAnomalyDetector Ruff, L. et al. Deep one-class classification
Autoencoder AEAnomalyDetector
VAE VAEAnomalyDetector Kingma, D. P. & Welling, M. Auto-encoding variational bayes
GANomaly GANomalyAnomalyDetector Akcay, S., Atapour-Abarghouei, A. & Breckon, T. P. Ganomaly: Semi-supervised anomaly detection via adversarial training

Running experiments

For running experiments on any dataset, please refer to the scikit-learn documentation.

Licence

MIT