How to use image and weight matrix to create adversarial images in TensorFlow?

前端 未结 1 351
死守一世寂寞
死守一世寂寞 2021-01-16 04:26

In the Breaking Linear Classifiers on ImageNet blog post, the author presented a very simple example on how to modify an image to fool a classifier. The technique given is p

相关标签:
1条回答
  • 2021-01-16 05:07

    Figured out how:

    So, if we're trying to create adversarial images to be falsely classified as "6", we need to grab the weights for "6" only from the weight matrix:

    w_six = w[:, 6]
    

    Then we can simply do matrix addition:

    images_fool = x + 1.5 * w_six
    
    0 讨论(0)
提交回复
热议问题