peikexin9/deepxplore

About saving the result picture

wazxser opened this issue · 1 comments

Hello,
I get some result pictures. But when I using the model to predict the result picture, it still get the right prediction, which should be wrong predicted.
I am wondering about the process of saving the difference-inducing result. Take MNIST as a example, after we get the tensor gen_img, which has caused the difference, to save gen_img as a picture, there are some operations on gen_img, like x *= 255, x = np.clip(x, 0, 255).astype('uint8'). These operations change the value of gen_img. Won't them influence the result of the model prediction?

Hi @wazxser you are right. One potential fix is to further constraint the gradient descent process to make the pixel to be bounded between [0,255] and has to be discrete values from 0, 1/255,... to 255/255