Breaking Linear Classifiers on ImageNet
Open the sourceKarpathy explains adversarial 'fooling' images and argues that they are not a flaw of deep learning or of images specifically, but stem from the linear nature of model components. He shows that even a simple linear classifier on ImageNet can be fooled with imperceptible changes. He walks through how fooling works by reversing gradient-based training, gives a toy logistic regression example, and discusses how regularization relates to fooling resistance.
- Tiny, imperceptible perturbations can make state-of-the-art ConvNets classify an image as any chosen class, and many fooling images transfer across models. - He argues it is more accurate to speak of fooling subspaces than fooling images. - The core flaw comes from linear functions and also affects shallow linear classifiers and other domains such as speech. - Fooling images are made by holding parameters fixed and using backpropagation to compute the gradient of a class score with respect to the pixels, then nudging the image. - For a linear classifier, the gradient on the image is just the class weight vector, so adding a fraction of the target class's weights fools the model. - Higher regularization gives smoother, smaller weights that are harder to fool but generalize worse, and simple fixes such as adding a background class of fooling images did not work.
Based on Andrej Karpathy's public content. Not affiliated with or endorsed by Andrej Karpathy.
Supports these rules
Quotes from this video
“These results are not specific to images, ConvNets, and they are also not a “flaw” in Deep Learning”
“it is in fact this linear nature that is problematic.”
“Lets forget about ConvNets they are a distracting overkill as far as the core flaw goes.”
“condensing the problem to the smallest toy example that displays the problem.”
“gives a starting loss of about 80, which right away tells you that the initialization is completely out of whack (initial ImageNet loss should be ballpark 7.0, which is -log(1/1000)).”
“the standard AlexNetty ConvNet hyperparameters are of course completely inadequate.”
“it is much more accurate to speak about fooling subspaces rather than fooling images”