Harry24k / adversarial-attacks-pytorch

PyTorch implementation of adversarial attacks [torchattacks]
https://adversarial-attacks-pytorch.readthedocs.io/en/latest/index.html
MIT License
1.9k stars 352 forks source link

some bug in pixle attack #76

Closed muyuuuu closed 2 years ago

muyuuuu commented 2 years ago

I think this assert is confused for user

https://github.com/Harry24k/adversarial-attacks-pytorch/blob/6dbe9155b0ba6ff966f2d484366c13fcbf80e38d/torchattacks/attacks/pixle.py#L83-L84

after that, use for to loop images one by one.

https://github.com/Harry24k/adversarial-attacks-pytorch/blob/6dbe9155b0ba6ff966f2d484366c13fcbf80e38d/torchattacks/attacks/pixle.py#L107-L108

Harry24k commented 2 years ago

I agree that the assert line should be modified. Thank you! Using for loop images one by one is the limitation of the pixle attack as same as DeepFool. Maybe, there is a better way to generate pixle adversarial images, but I couldn't find it.

muyuuuu commented 2 years ago

Thank you for your reply and contributions.