Zhang Haoqi 516030910393
Jin Kaiqi 516030910382
In the folder "Classifier"
In this part, we train the VGG19 and RenNet18 and use model averaging idea to get a improvement. You can download pretrained model in https://jbox.sjtu.edu.cn/l/iJFKfe (password:itxu)
put dataset(fer2013.csv) in "data" folder, then
python preprocess.py
python main.py --bs 128 --lr 0.01 --model VGG19
Use the idea of model averaging.
python model_average.py --model VGG19 --model ResNet18 --bs 128
Model | PrivateTest_acc(%) |
---|---|
VGG19 | 72.834 |
ResNet18 | 73.391 |
Model Averaging(VGG19 + ResNet18) | 73.725 |
In the folder "attack & defense"
We apply DeepFool to attack the trained model and put the attack samples into training dataset to make the model more robust after model retraining. You can download pretrained model in https://jbox.sjtu.edu.cn/l/EnSEzf (password:cath)
python test_deepfool.py --model VGG19 --split PrivateTest
python defense.py --model ResNet19 --attmodel VGG19
Model | Attack Accuracy |
---|---|
VGG19-Before Retraining | 13.5% |
VGG19-After Retraining | 17.7% |