# blackbox-adversarial-toolbox
**Repository Path**: wuhanstudio/blackbox-adversarial-toolbox
## Basic Information
- **Project Name**: blackbox-adversarial-toolbox
- **Description**: Distributed Black-Box Attacks against Image Classification.
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-03-03
- **Last Updated**: 2022-03-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Black-box Adversarial Toolbox (BAT)
[](https://app.travis-ci.com/wuhanstudio/blackbox-adversarial-toolbox)
[](https://badge.fury.io/py/blackbox-adversarial-toolbox)
[](https://opensource.org/licenses/MIT)
[](https://pypi.org/project/blackbox-adversarial-toolbox/)
A Python Library for Deep Learning Security that focuses on Black-box attacks.
## Installation
```python
pip install blackbox-adversarial-toolbox
```
## Usage
```python
import numpy as np
from PIL import Image
from bat.attacks import SimBA
from bat.apis.deepapi import VGG16Cifar10
# Load Image [0.0, 1.0]
x = np.asarray(Image.open('dog.jpg').resize((32, 32))) / 255.0
# Initialize the Cloud API Model
DEEP_API_URL = 'https://api.wuhanstudio.uk'
model = VGG16Cifar10(DEEP_API_URL + "/vgg16_cifar10")
# SimBA Attack
simba = SimBA(model)
x_adv = simba.attack(x, epsilon=0.1, max_it=1000)
# Distributed SimBA Attack
x_adv = simba.attack(x, epsilon=0.1, max_it=1000, distributed=True , batch=50, max_workers=10)
```