Skip to main content

AIML Logo

Adversarial Insight ML (AIML)

PyPI version Python version License Code style Documentation

“Why does your machine lie?”

Adversarial Insight ML (AIML) is a python package that evaluates the robustness of image classification models against adversarial attacks. AIML provides the functionality to automatically test your models against generated adversarial examples and outputs precise, insightful and robust feedback based on the several attack methods we have carefully chosen. Furthermore, AIML aims to be straightforward and beginner-friendly to allow non-technical users to take full advantage of its functionalities.

For more information, you can also visit the PyPI page and the documentation page.

Table of Contents

Installation

To install Adversarial Insight ML, you can use pip:

pip install adversarial-insight-ml

Usage

Here's a simple overview of the usage of our package:

img overview

You can evaluate your model with the evaluate() function:

from aiml.evaluation.evaluate import evaluate

evaluate(model, test_dataset)

The evaluate() function has two required parameters:

  • input_model (str or model): A string of the name of the machine learning model or the machine learning model itself.
  • input_test_data (str or dataset): A string of the name of the testing dataset or the testing dataset itself.

The evaluate() function has the following optional parameters:

  • input_train_data (str or dataset, optional): A string of the name of the training dataset or the training dataset itself (default is None).
  • input_shape (tuple, optional): Shape of input data (default is None).
  • clip_values (tuple, optional): Range of input data values (default is None).
  • nb_classes (int, optional): Number of classes in the dataset (default is None).
  • batch_size_attack (int, optional): Batch size for attack testing (default is 64).
  • num_threads_attack (int, optional): Number of threads for attack testing (default is 0).
  • batch_size_train (int, optional): Batch size for training data (default is 64).
  • batch_size_test (int, optional): Batch size for test data (default is 64).
  • num_workers (int, optional): Number of workers to use for data loading (default is half of the available CPU cores).
  • dry (bool, optional): When True, the code should only test one example.
  • attack_para_list (list, optional): List of parameter combinations for the attack.

See the demos in examples/ directory for usage in action:

Features

After evaluating your model with evaluate() function, we provide the following insights:

  • Summary of adversarial attacks performed, found in a text file named attack_evaluation_result.txt followed by date. For example: Result Example
  • Samples of the images can be found in a directory img/ followed by date, for example:

    img overview sample image

Contributing

Code Style
Always adhere to the PEP 8 style guide for writing Python code, allowing upto 99 characters per line as the absolute maximum. Alternatively, just use black.

Commit Messages
When making changes to the codebase, please refer to the Documentation/SubmittingPatches in the Git repo:

  • Write commit messages in present tense and imperative mood, e.g., "Add feature" instead of "Added feature" or "Adding feature."
  • Craft your messages as if you're giving orders to the codebase to change its behaviour.

Branching
We conform to a variation of the "GitHub Flow'' convention, but not strictly. For example, see the following types of branches:

  • main: This branch is always deployable and reflects the production state.
  • bugfix/*: For bug fixes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

We extend our sincere appreciation to the following individuals who have been instrumental in the success of this project:

Firstly, our client Mr. Luke Chang. His invaluable guidance and insights guided us from the beginning through every phase, ensuring our work remained aligned with practical needs. This project would not have been possible without his efforts.

We'd also like to express our gratitude to Dr. Asma Shakil, who has coordinated and provided an opportunity for us to work together on this project.

Thank you for being part of this journey.

Warm regards, Team 7

Contacts

Sungjae Jang sjan260@aucklanduni.ac.nz
Takuya Saegusa tsae032@aucklanduni.ac.nz
Haozhe Wei hwei313@aucklanduni.ac.nz
Yuming Zhou yzho739@aucklanduni.ac.nz
Terence Zhang tzha820@aucklanduni.ac.nz

Metadata

Release files for adversarial-insight-ml 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adversarial-insight-ml 0.2.2
File Size Uploaded Provenance Actions
adversarial-insight-ml-0.2.2.tar.gz 5.2 MB Without provenance Details for adversarial-insight-ml-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adversarial-insight-ml 0.2.2
File Interpreter ABI Platform Actions
adversarial_insight_ml-0.2.2-py3-none-any.whl Python 3 none any Details for adversarial_insight_ml-0.2.2-py3-none-any.whl

Total release size: 5.3 MB

Release files / adversarial-insight-ml-0.2.2.tar.gz

Download URL adversarial-insight-ml-0.2.2.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
3b6cfd1c74983ffaeebb3f00ffb5f062e16eb918022cf1f95e20cc1ddb288e83
BLAKE2b-256 checksum
How to use checksums
0faa0bc30b851e8b2c9fc245614abc8bdd0a49a5f031439f54146af797ab14f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / adversarial_insight_ml-0.2.2-py3-none-any.whl

Download URL adversarial_insight_ml-0.2.2-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d155ac750f5ef2867a25e1e33e068fbe70171202f052a6633ae175ab77700b7
BLAKE2b-256 checksum
How to use checksums
2331e67e110c61b8ff93c0a75a0012efb2679acca19502e2d7e383952ca9489f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for adversarial-insight-ml 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page