You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.9 kB

5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # MindArmour
  2. <!-- TOC -->
  3. - [MindArmour](#mindarmour)
  4. - [What is MindArmour](#what-is-mindarmour)
  5. - [Adversarial Robustness Module](#adversarial-robustness-module)
  6. - [Fuzz Testing Module](#fuzz-testing-module)
  7. - [Privacy Protection and Evaluation Module](#privacy-protection-and-evaluation-module)
  8. - [Differential Privacy Training Module](#differential-privacy-training-module)
  9. - [Privacy Leakage Evaluation Module](#privacy-leakage-evaluation-module)
  10. - [Starting](#starting)
  11. - [System Environment Information Confirmation](#system-environment-information-confirmation)
  12. - [Installation](#installation)
  13. - [Installation by Source Code](#installation-by-source-code)
  14. - [Installation by pip](#installation-by-pip)
  15. - [Installation Verification](#installation-verification)
  16. - [Docs](#docs)
  17. - [Community](#community)
  18. - [Contributing](#contributing)
  19. - [Release Notes](#release-notes)
  20. - [License](#license)
  21. <!-- /TOC -->
  22. [查看中文](./README_CN.md)
  23. ## What is MindArmour
  24. 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.
  25. ### Adversarial Robustness Module
  26. 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.
  27. This module includes four submodule: Adversarial Examples Generation, Adversarial Examples Detection, Model Defense and Evaluation.
  28. The architecture is shown as follow:
  29. ![mindarmour_architecture](docs/adversarial_robustness_en.png)
  30. ### Fuzz Testing Module
  31. 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.
  32. 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.
  33. The architecture is shown as follow:
  34. ![fuzzer_architecture](docs/fuzzer_architecture_en.png)
  35. ### Privacy Protection and Evaluation Module
  36. Privacy Protection and Evaluation Module includes two modules: Differential Privacy Training Module and Privacy Leakage Evaluation Module.
  37. #### Differential Privacy Training Module
  38. 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.
  39. 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.
  40. The architecture is shown as follow:
  41. ![dp_architecture](docs/differential_privacy_architecture_en.png)
  42. #### Privacy Leakage Evaluation Module
  43. 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.
  44. The architecture is shown as follow:
  45. ![privacy_leakage](docs/privacy_leakage_en.png)
  46. ## Starting
  47. ### System Environment Information Confirmation
  48. - The hardware platform should be Ascend, GPU or CPU.
  49. - See our [MindSpore Installation Guide](https://www.mindspore.cn/install) to install MindSpore.
  50. The versions of MindArmour and MindSpore must be consistent.
  51. - All other dependencies are included in [setup.py](https://gitee.com/mindspore/mindarmour/blob/master/setup.py).
  52. ### Installation
  53. ### Version dependency
  54. Due the dependency between MindArmour and MindSpore, please follow the table below and install the corresponding MindSpore verision from [MindSpore download page](https://www.mindspore.cn/versions/en).
  55. | MindArmour Version | Branch | MindSpore Version |
  56. | ------------------ | --------------------------------------------------------- | ----------------- |
  57. | 2.0.0 | [r2.0](https://gitee.com/mindspore/mindarmour/tree/r2.0/) | 1.7.0 - |
  58. | 1.9.0 | [r1.9](https://gitee.com/mindspore/mindarmour/tree/r1.9/) | 1.7.0 - |
  59. | 1.8.0 | [r1.8](https://gitee.com/mindspore/mindarmour/tree/r1.8/) | 1.7.0 - |
  60. | 1.7.0 | [r1.7](https://gitee.com/mindspore/mindarmour/tree/r1.7/) | r1.7 |
  61. #### Installation by Source Code
  62. 1. Download source code from Gitee.
  63. ```bash
  64. git clone https://gitee.com/mindspore/mindarmour.git
  65. ```
  66. 2. Compile and install in MindArmour directory.
  67. ```bash
  68. cd mindarmour
  69. python setup.py install
  70. ```
  71. #### Installation by pip
  72. ```bash
  73. 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
  74. ```
  75. > - When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about other dependency items, see [setup.py](https://gitee.com/mindspore/mindarmour/blob/master/setup.py)). In other cases, you need to manually install dependency items.
  76. > - `{version}` denotes the version of MindArmour. For example, when you are downloading MindArmour 1.0.1, `{version}` should be 1.0.1.
  77. > - `{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`.
  78. ### Installation Verification
  79. Successfully installed, if there is no error message such as `No module named 'mindarmour'` when execute the following command:
  80. ```bash
  81. python -c 'import mindarmour'
  82. ```
  83. ## Docs
  84. Guidance on installation, tutorials, API, see our [User Documentation](https://gitee.com/mindspore/docs).
  85. ## Community
  86. [MindSpore Slack](https://join.slack.com/t/mindspore/shared_invite/enQtOTcwMTIxMDI3NjM0LTNkMWM2MzI5NjIyZWU5ZWQ5M2EwMTQ5MWNiYzMxOGM4OWFhZjI4M2E5OGI2YTg3ODU1ODE2Njg1MThiNWI3YmQ) - Ask questions and find answers.
  87. ## Contributing
  88. Welcome contributions. See our [Contributor Wiki](https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md) for more details.
  89. ## Release Notes
  90. The release notes, see our [RELEASE](RELEASE.md).
  91. ## License
  92. [Apache License 2.0](LICENSE)

MindArmour关注AI的安全和隐私问题。致力于增强模型的安全可信、保护用户的数据隐私。主要包含3个模块:对抗样本鲁棒性模块、Fuzz Testing模块、隐私保护与评估模块。 对抗样本鲁棒性模块 对抗样本鲁棒性模块用于评估模型对于对抗样本的鲁棒性,并提供模型增强方法用于增强模型抗对抗样本攻击的能力,提升模型鲁棒性。对抗样本鲁棒性模块包含了4个子模块:对抗样本的生成、对抗样本的检测、模型防御、攻防评估。