Secure ML Library

An open-source library for security evaluation of machine learning (ML)-based algorithms

Secure ML Research   Tutorial: Wild Patterns   Secure ML Library 

SecML has been partially developed with the support of European Union’s ALOHA project
Horizon 2020 Research and Innovation programme, grant agreement No. 780788.

SecML (Secure ML Library) is an open-source Python library implementing poisoning and evasion attacks against a wide family of learning algorithms, including SVMs, Neural Nets, Random Forests, and other algorithms available from scikit-learn. SecML-Lib also implements some of the secure-learning techniques developed by our team in the past years.

It comes with a set of powerful features:

  • Dense/Sparse data support. We provide full, transparent support for both dense (through numpy library) and sparse data (through scipy library) in a single data structure.

  • Wide range of supported ML algorithms. All supervised learning algorithms supported by scikit-learn are available, as well as Neural Networks (NNs) through PyTorch deep learning platform (coming soon).

  • Built-in attack algorithms. Evasion and poisoning attacks based on a custom-developed fast solver.

  • Visualize your results. We provide visualization and plotting framework based on the widely-known library matplotlib.

  • Explain your results. Explainable ML methods to interpret model decisions via influential features and prototypes. (coming soon)

  • Extensible. Easily create new wrappers for ML models or attack algorithms extending our abstract interfaces.

  • Multi-processing. Do you want to save time further? We provide full compatibility with all the multi-processing features of scikit-learn and pytorch, along with built-in support of the joblib library.

Click on the buttons below to download the code and the documentation, and to read the complete information (Installation Guide - Operating System requirements - Installation process - Extra Components - Usage Guide).


This library is maintained by Pluribus One and PRALab - Pattern Recognition and Applications Lab.
List of contributors:
  • Marco Melis (maintainer) [1]

  • Ambra Demontis [1]

  • Maura Pintor [1], [2]

  • Battista Biggio [1], [2]

1. Department of Electrical and Electronic Engineering, University of Cagliari
2. Pluribus One



SecML is currently in development.
If you encounter any bug, please report them using the GitLab issue tracker.
More info here.


Pluribus One S.r.l.

Via Bellini 9, 09128, Cagliari (CA)


PEC: pluribus-one[at]


Legal entity

Share capital: € 10008

VAT no.: 03621820921

R.E.A.: Cagliari 285352


University of Cagliari

  Pluribus One is a spin-off of the Department of Electrical and Electronic Engineering, University of Cagliari, Italy