Giter Site home page Giter Site logo

djawharaben / mindarmour Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mindspore-ai/mindarmour

0.0 0.0 0.0 8.52 MB

A tool box for MindSpore users to enhance model security and trustworthiness.

License: Apache License 2.0

Shell 0.13% Python 99.87%

mindarmour's Introduction

MindArmour

查看中文

What is MindArmour

MindArmour focus on security and privacy of artificial intelligence. MindArmour can be used as a tool box for MindSpore users to enhance model security and trustworthiness and protect privacy data. MindArmour contains three module: Adversarial Robustness Module, Fuzz Testing Module, Privacy Protection and Evaluation Module.

Adversarial Robustness Module

Adversarial robustness module is designed for evaluating the robustness of the model against adversarial examples, and provides model enhancement methods to enhance the model's ability to resist the adversarial attack and improve the model's robustness. This module includes four submodule: Adversarial Examples Generation, Adversarial Examples Detection, Model Defense and Evaluation.

The architecture is shown as follow:

mindarmour_architecture

Fuzz Testing Module

Fuzz Testing module is a security test for AI models. We introduce neuron coverage gain as a guide to fuzz testing according to the characteristics of neural networks. Fuzz testing is guided to generate samples in the direction of increasing neuron coverage rate, so that the input can activate more neurons and neuron values have a wider distribution range to fully test neural networks and explore different types of model output results and wrong behaviors.

The architecture is shown as follow:

fuzzer_architecture

Privacy Protection and Evaluation Module

Privacy Protection and Evaluation Module includes two modules: Differential Privacy Training Module and Privacy Leakage Evaluation Module.

Differential Privacy Training Module

Differential Privacy Training Module implements the differential privacy optimizer. Currently, SGD, Momentum and Adam are supported. They are differential privacy optimizers based on the Gaussian mechanism. This mechanism supports both non-adaptive and adaptive policy. Rényi differential privacy (RDP) and Zero-Concentrated differential privacy(ZCDP) are provided to monitor differential privacy budgets.

The architecture is shown as follow:

dp_architecture

Privacy Leakage Evaluation Module

Privacy Leakage Evaluation Module is used to assess the risk of a model revealing user privacy. The privacy data security of the deep learning model is evaluated by using membership inference method to infer whether the sample belongs to training dataset.

The architecture is shown as follow:

privacy_leakage

Starting

System Environment Information Confirmation

  • The hardware platform should be Ascend, GPU or CPU.
  • See our MindSpore Installation Guide to install MindSpore.
    The versions of MindArmour and MindSpore must be consistent.
  • All other dependencies are included in setup.py.

Installation

Version dependency

Due the dependency between MindArmour and MindSpore, please follow the table below and install the corresponding MindSpore verision from MindSpore download page.

MindArmour Version Branch MindSpore Version
2.0.0 r2.0 >=1.7.0
1.9.0 r1.9 >=1.7.0
1.8.0 r1.8 >=1.7.0
1.7.0 r1.7 r1.7

Installation by Source Code

  1. Download source code from Gitee.

    git clone https://gitee.com/mindspore/mindarmour.git
  2. Compile and install in MindArmour directory.

    cd mindarmour
    python setup.py install

Installation by pip

pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindArmour/{arch}/mindarmour-{version}-cp37-cp37m-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
  • When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about other dependency items, see setup.py). In other cases, you need to manually install dependency items.
  • {version} denotes the version of MindArmour. For example, when you are downloading MindArmour 1.0.1, {version} should be 1.0.1.
  • {arch} denotes the system architecture. For example, the Linux system you are using is x86 architecture 64-bit, {arch} should be x86_64. If the system is ARM architecture 64-bit, then it should be aarch64.

Installation Verification

Successfully installed, if there is no error message such as No module named 'mindarmour' when execute the following command:

python -c 'import mindarmour'

Docs

Guidance on installation, tutorials, API, see our User Documentation.

Community

MindSpore Slack - Ask questions and find answers.

Contributing

Welcome contributions. See our Contributor Wiki for more details.

Release Notes

The release notes, see our RELEASE.

License

Apache License 2.0

mindarmour's People

Contributors

mindspore-bot avatar it-is-a-robot avatar jinxiulang avatar tommylike avatar xiaoyuwu-haha avatar hellowaywewe avatar liuzhidanhhh avatar luojianing1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.