All Projects β†’ SeldonIO β†’ Alibi Detect

SeldonIO / Alibi Detect

Licence: apache-2.0
Algorithms for outlier and adversarial instance detection, concept drift and metrics.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Alibi Detect

Social Media Depression Detector
πŸ˜” 😞 😣 πŸ˜– 😩 Detect depression on social media using the ssToT method introduced in our ASONAM 2017 paper titled "Semi-Supervised Approach to Monitoring Clinical Depressive Symptoms in Social Media"
Stars: ✭ 45 (-92.55%)
Mutual labels:  semi-supervised-learning, detection
Susi
SuSi: Python package for unsupervised, supervised and semi-supervised self-organizing maps (SOM)
Stars: ✭ 42 (-93.05%)
Mutual labels:  unsupervised-learning, semi-supervised-learning
Map
mean Average Precision - This code evaluates the performance of your neural net for object recognition.
Stars: ✭ 2,324 (+284.77%)
Mutual labels:  metrics, detection
Self Supervised Speech Recognition
speech to text with self-supervised learning based on wav2vec 2.0 framework
Stars: ✭ 106 (-82.45%)
Mutual labels:  unsupervised-learning, semi-supervised-learning
deepOF
TensorFlow implementation for "Guided Optical Flow Learning"
Stars: ✭ 26 (-95.7%)
Mutual labels:  semi-supervised-learning, unsupervised-learning
catgan pytorch
Unsupervised and Semi-supervised Learning with Categorical Generative Adversarial Networks
Stars: ✭ 50 (-91.72%)
Mutual labels:  semi-supervised-learning, unsupervised-learning
All About The Gan
All About the GANs(Generative Adversarial Networks) - Summarized lists for GAN
Stars: ✭ 630 (+4.3%)
Mutual labels:  unsupervised-learning, detection
Cleanlab
The standard package for machine learning with noisy labels, finding mislabeled data, and uncertainty quantification. Works with most datasets and models.
Stars: ✭ 2,526 (+318.21%)
Mutual labels:  unsupervised-learning, semi-supervised-learning
metric-transfer.pytorch
Deep Metric Transfer for Label Propagation with Limited Annotated Data
Stars: ✭ 49 (-91.89%)
Mutual labels:  semi-supervised-learning, unsupervised-learning
spear
SPEAR: Programmatically label and build training data quickly.
Stars: ✭ 81 (-86.59%)
Mutual labels:  semi-supervised-learning, unsupervised-learning
L2c
Learning to Cluster. A deep clustering strategy.
Stars: ✭ 262 (-56.62%)
Mutual labels:  unsupervised-learning, semi-supervised-learning
Vehicle counting tensorflow
🚘 "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.
Stars: ✭ 582 (-3.64%)
Mutual labels:  detection
Cameraengine
πŸ’πŸ“· Camera engine for iOS, written in Swift, above AVFoundation. πŸ’
Stars: ✭ 554 (-8.28%)
Mutual labels:  detection
See
Code for the AAAI 2018 publication "SEE: Towards Semi-Supervised End-to-End Scene Text Recognition"
Stars: ✭ 545 (-9.77%)
Mutual labels:  semi-supervised-learning
Athena
an open-source implementation of sequence-to-sequence based speech processing engine
Stars: ✭ 542 (-10.26%)
Mutual labels:  unsupervised-learning
Graphite Web
A highly scalable real-time graphing system
Stars: ✭ 5,384 (+791.39%)
Mutual labels:  metrics
Metrictank
metrics2.0 based, multi-tenant timeseries store for Graphite and friends.
Stars: ✭ 574 (-4.97%)
Mutual labels:  metrics
Awesome Semi Supervised Learning
πŸ“œ An up-to-date & curated list of awesome semi-supervised learning papers, methods & resources.
Stars: ✭ 538 (-10.93%)
Mutual labels:  semi-supervised-learning
Vulcan
Vulcan extends Prometheus adding horizontal scalability and long-term storage
Stars: ✭ 539 (-10.76%)
Mutual labels:  metrics
Yolov5 ncnn
πŸ… Deploy NCNN on mobile phones. Support Android and iOS. 移动端NCNNιƒ¨η½²οΌŒζ”―ζŒAndroid与iOS。
Stars: ✭ 535 (-11.42%)
Mutual labels:  detection

Alibi Detect Logo

Build Status Documentation Status Python version PyPI version GitHub Licence Slack channel

Alibi Detect is an open source Python library focused on outlier, adversarial and drift detection. The package aims to cover both online and offline detectors for tabular data, text, images and time series. The outlier detection methods should allow the user to identify global, contextual and collective outliers.

For more background on the importance of monitoring outliers and distributions in a production setting, check out this talk from the Challenges in Deploying and Monitoring Machine Learning Systems ICML 2020 workshop, based on the paper Monitoring and explainability of models in production and referencing Alibi Detect.

Table of Contents

Installation and Usage

alibi-detect can be installed from PyPI:

pip install alibi-detect

Alternatively, the development version can be installed:

pip install git+https://github.com/SeldonIO/alibi-detect.git

To use the Prophet time series outlier detector:

pip install alibi-detect[prophet]

We will use the VAE outlier detector to illustrate the API.

from alibi_detect.od import OutlierVAE
from alibi_detect.utils.saving import save_detector, load_detector

# initialize and fit detector
od = OutlierVAE(threshold=0.1, encoder_net=encoder_net, decoder_net=decoder_net, latent_dim=1024)
od.fit(X_train)

# make predictions
preds = od.predict(X_test)

# save and load detectors
filepath = './my_detector/'
save_detector(od, filepath)
od = load_detector(filepath)

The predictions are returned in a dictionary with as keys meta and data. meta contains the detector's metadata while data is in itself a dictionary with the actual predictions. It contains the outlier, adversarial or drift scores as well as the predictions whether instances are e.g. outliers or not. The exact details can vary slightly from method to method, so we encourage the reader to become familiar with the types of algorithms supported.

The save and load functionality for the Prophet time series outlier detector is currently experiencing issues in Python 3.6 but works in Python 3.7.

Supported Algorithms

The following tables show the advised use cases for each algorithm. The column Feature Level indicates whether the detection can be done at the feature level, e.g. per pixel for an image. Check the algorithm reference list for more information with links to the documentation and original papers as well as examples for each of the detectors.

Outlier Detection

Detector Tabular Image Time Series Text Categorical Features Online Feature Level
Isolation Forest βœ” ✘ ✘ ✘ βœ” ✘ ✘
Mahalanobis Distance βœ” ✘ ✘ ✘ βœ” βœ” ✘
AE βœ” βœ” ✘ ✘ ✘ ✘ βœ”
VAE βœ” βœ” ✘ ✘ ✘ ✘ βœ”
AEGMM βœ” βœ” ✘ ✘ ✘ ✘ ✘
VAEGMM βœ” βœ” ✘ ✘ ✘ ✘ ✘
Likelihood Ratios βœ” βœ” βœ” ✘ βœ” ✘ βœ”
Prophet ✘ ✘ βœ” ✘ ✘ ✘ ✘
Spectral Residual ✘ ✘ βœ” ✘ ✘ βœ” βœ”
Seq2Seq ✘ ✘ βœ” ✘ ✘ ✘ βœ”

Adversarial Detection

Detector Tabular Image Time Series Text Categorical Features Online Feature Level
Adversarial AE βœ” βœ” ✘ ✘ ✘ ✘ ✘
Model distillation βœ” βœ” βœ” βœ” βœ” ✘ ✘

Drift Detection

Detector Tabular Image Time Series Text Categorical Features Online Feature Level
Kolmogorov-Smirnov βœ” βœ” ✘ βœ” βœ” ✘ βœ”
Maximum Mean Discrepancy βœ” βœ” ✘ βœ” βœ” ✘ ✘
Chi-Squared βœ” ✘ ✘ ✘ βœ” ✘ βœ”
Mixed-type tabular data βœ” ✘ ✘ ✘ βœ” ✘ βœ”
Classifier βœ” βœ” βœ” βœ” βœ” ✘ ✘

Reference List

Outlier Detection

Adversarial Detection

Drift Detection

Datasets

The package also contains functionality in alibi_detect.datasets to easily fetch a number of datasets for different modalities. For each dataset either the data and labels or a Bunch object with the data, labels and optional metadata are returned. Example:

from alibi_detect.datasets import fetch_ecg

(X_train, y_train), (X_test, y_test) = fetch_ecg(return_X_y=True)

Sequential Data and Time Series

  • Genome Dataset: fetch_genome

    • Bacteria genomics dataset for out-of-distribution detection, released as part of Likelihood Ratios for Out-of-Distribution Detection. From the original TL;DR: The dataset contains genomic sequences of 250 base pairs from 10 in-distribution bacteria classes for training, 60 OOD bacteria classes for validation, and another 60 different OOD bacteria classes for test. There are respectively 1, 7 and again 7 million sequences in the training, validation and test sets. For detailed info on the dataset check the README.
    from alibi_detect.datasets import fetch_genome
    
    (X_train, y_train), (X_val, y_val), (X_test, y_test) = fetch_genome(return_X_y=True)
    
  • ECG 5000: fetch_ecg

    • 5000 ECG's, originally obtained from Physionet.
  • NAB: fetch_nab

    • Any univariate time series in a DataFrame from the Numenta Anomaly Benchmark. A list with the available time series can be retrieved using alibi_detect.datasets.get_list_nab().

Images

  • CIFAR-10-C: fetch_cifar10c

    • CIFAR-10-C (Hendrycks & Dietterich, 2019) contains the test set of CIFAR-10, but corrupted and perturbed by various types of noise, blur, brightness etc. at different levels of severity, leading to a gradual decline in a classification model's performance trained on CIFAR-10. fetch_cifar10c allows you to pick any severity level or corruption type. The list with available corruption types can be retrieved with alibi_detect.datasets.corruption_types_cifar10c(). The dataset can be used in research on robustness and drift. The original data can be found here. Example:
    from alibi_detect.datasets import fetch_cifar10c
    
    corruption = ['gaussian_noise', 'motion_blur', 'brightness', 'pixelate']
    X, y = fetch_cifar10c(corruption=corruption, severity=5, return_X_y=True)
    
  • Adversarial CIFAR-10: fetch_attack

    • Load adversarial instances on a ResNet-56 classifier trained on CIFAR-10. Available attacks: Carlini-Wagner ('cw') and SLIDE ('slide'). Example:
    from alibi_detect.datasets import fetch_attack
    
    (X_train, y_train), (X_test, y_test) = fetch_attack('cifar10', 'resnet56', 'cw', return_X_y=True)
    

Tabular

  • KDD Cup '99: fetch_kdd
    • Dataset with different types of computer network intrusions. fetch_kdd allows you to select a subset of network intrusions as targets or pick only specified features. The original data can be found here.

Models

Models and/or building blocks that can be useful outside of outlier, adversarial or drift detection can be found under alibi_detect.models. Main implementations:

  • PixelCNN++: alibi_detect.models.pixelcnn.PixelCNN

  • Variational Autoencoder: alibi_detect.models.autoencoder.VAE

  • Sequence-to-sequence model: alibi_detect.models.autoencoder.Seq2Seq

  • ResNet: alibi_detect.models.resnet

    • Pre-trained ResNet-20/32/44 models on CIFAR-10 can be found on our Google Cloud Bucket and can be fetched as follows:
    from alibi_detect.utils.fetching import fetch_tf_model
    
    model = fetch_tf_model('cifar10', 'resnet32')
    

Integrations

Alibi-detect is integrated in the open source machine learning model deployment platform Seldon Core and model serving framework KFServing.

Citations

If you use alibi-detect in your research, please consider citing it.

BibTeX entry:

@software{alibi-detect,
  title = {{Alibi-Detect}: Algorithms for outlier and adversarial instance detection, concept drift and metrics.},
  author = {Van Looveren, Arnaud and Vacanti, Giovanni and Klaise, Janis and Coca, Alexandru},
  url = {https://github.com/SeldonIO/alibi-detect},
  version = {0.5.1},
  date = {2021-03-05},
  year = {2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].