main.py - Standard training and testing
generate_gradients.py - Get numpy array of gradients
visualize.py - Visualize normalized gradient image of a given image
visualize2_attack.py - Visualize FGSM attack on given images and the corresponding accuracies given a specific epsilon
move_json.py - Move videos accoridng to official FF++ Train/Valid/Test splits
crop.py - Crop the face from a given frame (100 frames are extracted per video)
argument.py - Contains all parameters used. Mainly used for main.py
xception.py and models.py - Scripts to load xception net
code/train.py - apply randomized smoothing on xception model by training a classifier on gaussian-agumented images
code/train_pgd.py - apply train.py + adversarial training based on Projected Gradient Descent (PGD)
For more information on the scripts: I adapted the scripts from here
I provide 4 sample scripts that I used for training and testing.
- M3_train.pbs - Train a classifier on cropped faces
- grad.pbs - generate the gradient arrays (in .npy format) using best checkpoint from #1
- M4_train.pbs - Train a classifier on gradient arrays
- m4_gradtest.pbs - Test M4 classifier (works as a generic template for testing too)
- smoothed_train.pbs - Train a robust classifier on Images applied with the Randomized Smoothing method