-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about tsuc and ttr on ImageNet (ILSVRC2012)? #1
Comments
Thank you for your comments. I think your criticism on the calculation of 'utr' and 'ttr' is reasonable. The construction of the DataLoader in the eval function should be adjusted —— we could set the drop_last argument to True, or just simply set the batch_size to 1, as the last incomplete batch will cause the problem you mentioned. This is my coursework on one of my undergraduate courses —— I mean, it's not really something serious, so it certainly needs improvements. Please give me more details about the failure on the ILSVRC2012 validation set, and I'm willing to offer you a helping hand to solve this problem. Pull requests are welcomed. |
Hello, I think the problem about 'utr' and 'ttr' is not related to the last batch. It is caused by the discrepency of wb_error (white-box error) among mini-batches. Suppose that mini-batch A, B both contain 32 samples (batch_size=32). In A , only 3 samples are misclassified by the white-box model, and 2 of them are successfully transferred to the black-box model. In B, 30 samples are misclassified by the white-box model but none is successfully transferred to the black-box model. |
1. 'utr'/'ttr' problem loader = DataLoader(ds,batch_size = 1,shuffle = True,pin_memory = True,num_workers = 4) 2. ImageNet problem #eval.py
from torchvision.datasets import ImageNet
ds = ImageNet(split='val')
wb_eval_model = resnet18(pretrained=True).to(device)
wb_model = ResNet18FeatureExtractor(wb_eval_model)
bb_model = densenet121(pretrained=True).to(device)
#…… |
|
I find that my re-implementation may have some problems in model.eval()/model.train(). In AcivationAttacker.generate, the white box model should be set to eval mode, or the BatchNorm layer could cause mistakes. |
Yes, bb_model should be set to eval mode as well. |
Could you please kindly help me test the results under the correct evaluation process and eval mode? Maybe I'm too busy to maintain this project recently - at least before my winter vacation. Pull requests would be highly welcome. |
I think the evaluation process is very easy. But I wonder if it is proper to use these models evaluating on CIFAR10, as the images are in low resolution (32x32). These models are designed for ImageNet dataset. |
According to the CVPR 2019 paper, I think it's OK to use these models. |
I have run these codes. ResNet-18 is set as the wb_model and DenseNet-121 is the blackbox model. |
Thank you for your help! I have committed your changes on eval.py and the experiment results to the repository. |
I run the code and change the dataset from CIFAR-10 to ILSVRC2012 validation set. The success rate on white box is always 0. It is a bit strange.
Moreover, I think the calculation about 'utr' and 'ttr' is not correct. Assuming that we have two minibatch with size 32. In one minibatch, wb_error is 3 and 2 of them are successfully transferred. Then utrs in this minibatch is 66%. While in the other minibatch, wb_error is 32 but none of them is successfully transferred. Then utrs is 0%. According the code, utr will be 33% = (66%+0)/2. But actually I think it should be 2/(3+32), not 33%.
The text was updated successfully, but these errors were encountered: