I believe the range is to be in (0,1) as when imagize(adver.detach().cpu()) is called the values are normalised to fit in to the range (0,255). Howveer, when we try to read this image back into resnet by calling tensorize() the valuse (0,255) is fitted into the range of (0,1) instead of (-1,1). The resultant tensor is significantly different from the apply(input_tensor, delta) tensor. To prevent the data lost, the mask should be generated in the range of (0,1) instead.
I have noticed in the generation of the mask, the values used are in the range of (-1,1) seen both in:
adversarial_face_recognition.py ln 187:
self.mask_list[i].data.clamp_(-1, 1)
and alogorithm.py ln 74:
delta.data.clamp_(-1, 1)
I believe the range is to be in (0,1) as when
imagize(adver.detach().cpu())
is called the values are normalised to fit in to the range (0,255). Howveer, when we try to read this image back into resnet by calling tensorize() the valuse (0,255) is fitted into the range of (0,1) instead of (-1,1). The resultant tensor is significantly different from theapply(input_tensor, delta)
tensor. To prevent the data lost, the mask should be generated in the range of (0,1) instead.