Hyperparticle / one-pixel-attack-keras

Keras implementation of "One pixel attack for fooling deep neural networks" using differential evolution on Cifar10 and ImageNet

Home Page:https://arxiv.org/abs/1710.08864

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing img instead of id

pniedzwiedzinski opened this issue · comments

Function attack_success takes argument img which is an id of the image in the dataset. Wouldn't it be clearer if this variable is called img_id or something like this? Or we could pass the whole image from the dataset instead.

Yes, I agree this could be clearer if it was either called img_id or passed in the image itself. Looking back, I notice that the attack_success function in attack.py actually does pass in the image, so I think I can modify the Jupyter notebook to be the same.

I refactored the code, should be good to go.