Skip to content
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

[BUG] The implementation of eps-ball in MI-FGSM #182

Closed
ZhongliangGuo opened this issue Apr 14, 2024 · 1 comment
Closed

[BUG] The implementation of eps-ball in MI-FGSM #182

ZhongliangGuo opened this issue Apr 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ZhongliangGuo
Copy link

✨ Short description of the bug [tl;dr]

whether use eps-ball for MI-FGSM

💬 Detailed code and results

I just double checked with the pseudo code of the MI-FGSM and other implementaion, it seems like the MI-FGSM didn't use a clamp in eps-ball, but in the implementation of this repo used it.

delta = torch.clamp(adv_images - images, min=-self.eps, max=self.eps)

@ZhongliangGuo ZhongliangGuo added the bug Something isn't working label Apr 14, 2024
@ZhongliangGuo ZhongliangGuo changed the title [BUG] The implementation of MI-FGSM [BUG] The implementation of eps-ball in MI-FGSM Apr 14, 2024
@rikonaka
Copy link
Contributor

rikonaka commented Apr 15, 2024

Hi @ZhongliangGuo , I have just checked the MI-FGSM code, and according to the code link given in the original paper, it embodies this clamp process in the code

https://github.com/dongyp13/Non-Targeted-Adversarial-Attacks/blob/5c68162e05de7afed2e3d33115df43e2a7a1c3da/attack_iter.py#L211

https://github.com/dongyp13/Non-Targeted-Adversarial-Attacks/blob/5c68162e05de7afed2e3d33115df43e2a7a1c3da/attack_iter.py#L188

the essence of this is to restrict the adversarial samples to natural samples within epsilon, and the code in torchattacks is actually do the same job as original code.

But the mi-fgsm code does have some problems with the code logic, which I've changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants