Package: adversarial-insight-ml
Adversarial Insight ML (AIML)“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 thePyPI pageand thedocumentation page.Table of ContentsInstallationUsageFeaturesContributingLicenseInstallationTo install Adversarial Insight ML, you can use pip:pipinstalladversarial-insight-mlUsageHere's a simple overview of the usage of our package:You can evaluate your model with theevaluate()function:fromaiml.evaluation.evaluateimportevaluateevaluate(model,test_dataset)Theevaluate()function hastwo 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.Theevaluate()function has the followingoptional 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 inexamples/directory for usage in action:demo_basicdemo_huggingfacedemo_robustbenchFeaturesAfter evaluating your model withevaluate()function, we provide
the following insights:Summary of adversarial attacks performed, found in a text file namedattack_evaluation_result.txtfollowed by date. For example:Samples of the images can be found in a directoryimg/followed by date, for example:ContributingCode StyleAlways adhere to thePEP 8style guide for writing Python code, allowing upto 99 characters per line as the absolute maximum. Alternatively, just useblack.Commit MessagesWhen making changes to the codebase, please refer to theDocumentation/SubmittingPatchesin 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.BranchingWe 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.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.AcknowledgementsWe 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 7ContactsSungjae Jangsjan260@aucklanduni.ac.nzTakuya Saegusatsae032@aucklanduni.ac.nzHaozhe Weihwei313@aucklanduni.ac.nzYuming Zhouyzho739@aucklanduni.ac.nzTerence Zhangtzha820@aucklanduni.ac.nz