Black-box Adversarial Toolbox (BAT) - Python Library for Deep Learning Security
Project description
Black-box Adversarial Toolbox (BAT)
A Python Library for Deep Learning Security that focuses on Black-box attacks.
Installation
pip install blackbox-adversarial-toolbox
Usage
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for blackbox_adversarial_toolbox-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adff82fdae1424949b2b09c2ead3a62bff1773bb9de1141e7927aaed53f47c57 |
|
MD5 | 69c6c390ca0cdf2a544498837bde1fca |
|
BLAKE2b-256 | 17d51f48770b34ede42ef04c64043c5d46815f72814208f397cef59078dabaea |