CAGFuzz, a Coverage-guided Adversarial Generative Fuzzing testing approach for DL systems. The goal of the CAGFuzz is to maximize the neuron coverage and generate adversarial test examples as much as possible with minor perturbations for the target DNNs. It mainly consists of four folders:
- Coverage_Calculate
- CycleGAN
- model
- similarity
This folder contains the code to calculate the neuron coverage. You can call the functions in the python file to run directly. An example is as follows:
from Keras_coverage import NCoverage
from keras.models import load_model
model = load_model("./model/model_LeNet-1.h5")
coverage = NCoverage(model, 0.1)
img = Image.open('./datasets/cifar-10/coverage/img-0-frog.png')
img = np.array(img).astype('float32').reshape(-1, 32, 32, 3)
coverage.update_coverage(img)
covered, total, p = coverage.curr_neuron_cov()
print(covered, total, p)
Implementation of Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks. Paper:https://arxiv.org/abs/1703.10593
$ cd CycleGAN/
$ python CycleGAN_model.py
An example of the generated adversarial examples is as follows: