This is a framework -
- To generate test dataset using Coverage-Guided Fuzzing (CGF) and
- To evaluate effectivness of various coverge criteria and seed selection strategies. The current framework supports classification network on various DNN architectures, MNIST, SVHN, GTSRB datasets.
- main.py: Use this main script to run fuzzing. Various input arguments are set to default. They should be changed based on requirements.
- Each model to be tested would need a saved state dictionary of trained model, a model profile and a set of initial seeds.
- The model profile and initial seeds can be constructed using fuzzer by setting respective flags to 1.
- The trained model need to be saved under - models/dataset/weights/<model_name>/
- For new networks, the functions intermediate_outputs and good_seed_detection need to be implemented.
- A configuration file needed for each model-dataset combination and saved in config/. Need to be thorough when creating these.
Run requirements.txt file for installing necessary Python packages. (Use of virtual enviornment is highly recommended)
- Install Python 3.10 (preferably using pyenv)
- Activate a virtual environment
python -m venv .env && source .env/bin/activate - Install requirements:
pip install -r requirements_mac.txt - Install
brew install freetype imagemagick(needs Homebrew package manager). Note the installation path ofimagemagick, which will be printed towards the end of the installation. Depending on the exact version installed, add a line similar to this to your~/.bashrcor~/.zshrc:export MAGICK_HOME=/opt/homebrew/Cellar/imagemagick/7.1.1-21 - Run
git submodule init && git submodule updateto check out theflannsubmodule. - Build and install the FLANN library:
brew install cmakecd flann && mkdir build && cd buildcmake ..makesudo make install(enter your system password)
- Test by running:
python main.py --help
Due to the large size of our corner cases datasets used in our empirical study, we are sharing them via a cloud download link. Please download the necessary files using the following link: https://www.dropbox.com/scl/fi/a2dws2hjpf8qslqc2riqx/fuzzing_data_eq_samples.zip?rlkey=fy22mwm4c1j73rczq0ag4mgbp&st=thm1w4wy&dl=0