carlini / nn_robust_attacks

Robust evasion attacks against neural network to find adversarial examples
BSD 2-Clause "Simplified" License
778 stars 229 forks source link

Misleading printing? #35

Open FairyOnIce opened 4 years ago

FairyOnIce commented 4 years ago

I am using l0_attack.py. The default printing shows:

            equal_count = self.model.image_size**2-np.sum(np.all(np.abs(img-nimg[0])<.0001,axis=2))
            print("Forced equal:",np.sum(1-valid),
                  "Equal count:",equal_count)

"Equal count" may be misleading as this number is the number of pixels that are different from (not equal to) the original image at the current iteration. Should it be

            print("Forced equal:",np.sum(1-valid),
                  "Different count:",equal_count)

or

            print("Forced equal:",np.sum(1-valid),
                  "L0:",equal_count)

https://github.com/carlini/nn_robust_attacks/blob/610c43f9e3c8def7b44b6909a79aceac073d2fba/l0_attack.py#L227