Skip to main content

AdvSecureNet | Adversarial Secure Networks | Machine Learning Security

Project description

AdvSecureNet

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Reliability Rating Security Rating Technical Debt Maintainability Rating Vulnerabilities Unit Tests and Style Checks Build and Deploy Sphinx Documentation Upload Python Package

AdvSecureNet

AdvSecureNet is a Python library for Machine Learning Security, developed by Melih Catal at University of Zurich as part of his Master's Thesis under the supervision of Prof. Dr. Manuel Günther. The main focus of the library is on adversarial attacks and defenses for vision tasks, with plans to extend support to other tasks such as natural language processing.

The library provides tools to generate adversarial examples, evaluate the robustness of machine learning models against adversarial attacks, and train robust machine learning models. Built on top of PyTorch, it is designed to be modular and extensible, making it easy to run experiments with different configurations.

Table of Contents

Features

  • Generate adversarial examples
  • Evaluate model robustness against adversarial attacks
  • Train robust machine learning models
  • Modular and extensible design
  • Native multi-GPU support

Supported Attacks

Supported Defenses

Installation

You can install the library using pip:

pip install advsecurenet

Or install it from source:

git clone https://github.com/melihcatal/advsecurenet.git
cd advsecurenet
pip install -e .

Why AdvSecureNet?

  • Research-Oriented: Easily run and share experiments with different configurations using YAML configuration files.

  • Supports Various Attacks and Defenses: Experiment with a wide range of adversarial attacks and defenses.

  • Supports Any PyTorch Model: Use pre-trained models or your own PyTorch models with the library.

  • Supports Various Evaluation Metrics: Evaluate the robustness of models, performance of adversarial attacks, and defenses.

  • Bening Use Case Support: Train and evaluate models on benign data.

  • Native Multi-GPU Support: Efficiently run large-scale experiments utilizing multiple GPUs.

Usage

The library can be used as a command line tool or as an importable Python package.

Command Line Tool

Use the advsecurenet command to interact with the library. Use advsecurenet --help to see available commands and options. It is recommended to use YAML configuration files to run experiments. You can list the available configuration options using advsecurenet utils configs list and generate a template configuration file using advsecurenet utils configs get -c <config_name> -o <output_file>.

Running an adversarial attack:

advsecurenet attack -c ./fgsm.yml

Running an adversarial defense:

advsecurenet defense adversarial-training -c ./adv_training.yml

Running an evaluation:

advsecurenet evaluate benign -c ./evaluate_benign.yml

or

advsecurenet evaluate adversarial -c ./evaluate_adversarial.yml

Python Package

You can import the library as a Python package. You can use the advsecurenet module to access the library. You can find the available modules and classes in the documentation.

Examples

Examples of different use cases can be found in the examples directory.

Architecture

The high-level architecture of the library is shown in the figure below.

advsecurenet_arch-2

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

Further Information

More information about the library can be found in the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

advsecurenet-0.1.9.tar.gz (137.4 kB view hashes)

Uploaded Source

Built Distribution

advsecurenet-0.1.9-py3-none-any.whl (231.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page