1 Introduction
Deep neural networks have recently led to significant improvement in countless areas of machine learning, from speech recognition to computer vision
Krizhevsky et al. (2012); Dahl et al. (2012); Taigman et al. (2013); Zhang et al. (2013). DNNs achieve high performance because deep cascades of nonlinear units allow to generalize nonlocally, in dataspecific manifolds Bengio (2009). While this ability to automatically learn nonlocal generalization priors from data is a strength of DNNs, it also creates counterintuitive properties. In particular Szegedy et al. (2014b) showed in their seminal paper that one can engineer small perturbations to the input data, called adversarial examples, that make an otherwise highperforming DNN misclassify every example. For image datasets, such perturbations are often imperceptible to the human eye, thus creating potential vulnerabilities when deploying neural networks in real environments. As an example, one could envision situations where an attacker having knowledge of the DNN parameters could use adversarial examples to attack the system and make it fail consistently. Even worse, due to the crossmodel, crossdataset generalization properties of the adversarial examples Szegedy et al. (2014b) , the attacker might generate adversarial examples from independent models without full knowledge of the system and still be able to conduct a highly successful attack. This indicates there is still a significant robustness gap between machine and human perception, despite recent results showing machine vision performance closing in on human performance Taigman et al. (2013). More formally, the challenge is: can we design and train a deep network that not only generalizes in abstract manifold space to achieve good recognition accuracy, but also retains local generalization in the input space?A main result from Szegedy et al. (2014b)
is that the smoothness assumption that underlies many kernel methods such as Support Vector Machines (SVMs) does not hold for deep neural networks trained through backpropagation. This points to a possible inherent instability in all deterministic, feedforward neural network architectures. In practice, SVMs can be used to replace the final softmax layer in classifier neural networks leading to better generalization
Tang (2013), but applying SVM in the manifold space does not guarantee local generalization in the input space. Recently, Duvenand et al. (2014)categorize distributions of deep neural networks through deep Gaussian Process (GP) and show that in stacked architectures, the capacity of the network captures fewer degrees of freedom as the layers increase. They propose to circumvent this by connecting inputs to every layer of the network. Without this trick, the input locality is hardly preserved in higher layers due to the complexity of nonlinear mapping cascades.
A framework leveraging both approaches is Random Recursive SVM (RSVM) Vinyals et al. (2012), which recursively solves a SVM whose input combines input data and outputs from the previous SVM layer, randomly projected to the same dimension as the input data. RSVM avoids solving nonconvex optimization by recursively solving a SVM and demonstrates generalization on small datasets. However, performance is suboptimal compared to stateoftheart DNNs, possibly due to lack of endtoend training Vinyals et al. (2012); Tang (2013). Another work inspired by the recursive nature of the human perceptual system is Deep Attention Selective Network (dasNet) Stollenga et al. (2014), which dynamically finetunes the weight of each convolutional filter at recognition time. We speculate that the robustness of human perception is due to complex hierarchies and recursions in the wirings of the human brain Felleman & Van Essen (1991); Douglas et al. (1995), since recursions provide multiple paths to input data and could retain locality information at multiple levels of representation. Such an intuition is also partially supported by the recent stateoftheart models for object classification and detection involving multiscale processing Szegedy et al. (2014a)
. Since modeling such recursions in DNNs is notoriously hard and often relies on additional techniques such as reinforcement learning
Stollenga et al. (2014); Mnih et al. (2014), we will at first investigate explicit inclusion of input generalization as an additional objective for the standard DNN training process.It is important to note that the adversarial examples are universal and unavoidable by their definition: one could always engineer an additive noise at input to make the model misclassify an example, and it is also a problem in shallow models such as logistic regression
Szegedy et al. (2014b). The question is how much noise is needed to make the model misclassify an otherwise correct example. Thus, solving the adversarial examples problem is equivalent to increasing the noticeability of the smallest adversarial noise for each example.In this paper we investigate new training procedures such that the adversarial examples generated based on Szegedy et al. (2014b) have higher distortion, where distortion is measured by where are the adversarial data and original data respectively. First, we investigate the structure of the adversarial examples, and show that contrary to their small distortion it is difficult to recover classification performance through additional perturbations, such as Gaussian additive noises and Gaussian blur. This suggests the size of “blindspots” are in fact relatively large, in input space volume, and locally continuous. We also show that adversarial examples are quite similar Szegedy et al. (2014b), and an autoencoder (AE) trained to denoise adversarial examples from one network generalizes well to denoise adversarials generated from different architectures. However, we also found that the AE and the classifier DNN can be stacked and the resulting network can again be attacked by creating new, adversarial examples of even smaller distortion. Because of this, we conclude that ideal architectures should be trained endtoend and incorporate input invariance with respect to the final network output. We find that ideas from denoising autoencoder (DAE), contractive autoencoder (CAE), and most recently marginalized denoising autoencoder (mDAE) provide strong framework for training neural networks that are robust against adversarial noises Rifai et al. (2011b); Alain & Bengio (2012); Chen et al. (2014). We propose Deep Contractive Networks (DCNs), which incorporate a layerwise contractive penalty, and show that adversarials generated from such networks have significantly higher distortion. We believe our initial results could serve as the basis for training more robust neural networks that can only be misdirected by a substantial noise, in a way that is more attuned to how human perception performs.
2 Framework
2.1 Generating Adversarial Examples
We follow the procedure outlined in Szegedy et al. (2014b) for generating adversarial examples from the classifier neural network, with a slight modification for computational efficiency. Using the same notation, we denote the classifier by
and its associated continuous loss function by
. Then, for a given image , whose pixels normalized to , and target label , the minimal adversarial noise is approximated by optimizing the following problem, given and subject to :(1) 
Instead of finding the minimum through linesearch per example, we use constant during evaluation of a given dataset and model architecture. We find such that for a sufficiently large subset of data of size , is minimized, subject to the constraint that the mean prediction error rate of is greater than . is chosen as throughout the experiments. Since we are interested in macroscale evaluation of adversarial examples per dataset and model, we find this setting sufficiently simplifies and speeds up the procedure while allowing quantitative analysis of the results.
2.2 Datasets and Model Architectures
We perform our experiements on the MNIST dataset, using a number of architectures LeCun & Cortes (1998); Krizhevsky & Hinton (2009). Table 1 summarizes experimental settings, baseline error rate, adversarial examples’ error rate and average adversarial distortion. weight decay is applied with , except in convolutional layers. For MNIST ConvNet has two convolutional layers, one fullyconnected layer, and one softmax layer.
Model Name  Dataset  Description  Train err.  Test err.  Adv. err.  Av. distortion 

N10010010  MNIST  ReLU net  0%  1.77%  99.9%  0.084 
N20020010  MNIST  ReLU net  0%  1.65%  99.9%  0.087 
AE40010  MNIST  AE net  1.0%  2.0%  99.6%  0.098 
ConvNet  MNIST  Conv. net  0%  0.90%  100%  0.095 
3 Recovering from Adversarial Examples
In order to gain insight into the properties of adversarial noises, we explore three preprocessing methods aiming at recovering from adversarial noise, as presented in the following sections.
3.1 Noise Injection
Given the tiny nature of adversarial noise, we investigate a recovery strategy based on additional corruptions, in the hope that we can move the input outside the network “blindspots”, which we initially assumed to be small and localized. We experiment with additive Gaussian noise and Gaussian blurring. For Gaussian noise we averaged predictions over 20 feedforward runs to reduce the prediction variance. Results for Gaussian additive noises are summarized in Figure
1. It shows the and the tradeoff between the adversarial examples recovered and the clean examples misclassified as one varies the amount of additive noises, which are added to only input layer or the input plus all the hidden layers. Results for Gaussian blurring are summarized in Table 2. For Gaussian additive noises, “L1” refers to the noise applied at input layer; “L*” refers to the noise applied at input layer plus all hidden layers. Gaussian blurring is only applied at input layer.The results show that convolution seems to help with recovering from the adversarial examples. For example, for ConvNet model, applying Gaussian blur kernel of size 11 to all input data can recover more than 50% of adversarial examples, at the expense of 3% increase in the test error on clean data (Table 2). In addition, for ConvNet model, adding Gaussian noise of at input layer plus hidden layers allow the model to recover more than 35% at similar small loss in model performance on clean data (Figure 1). However, neither Gaussian additive noises or blurring is effective in removing enough noise such that its error on adversarial examples could match that of the error on clean data.
Noise Injection (Gaussian additive noise): Test error on clean data (Left) and on adversarial data (Right) vs. standard deviation of Gaussian additive noise
Blur Kernel Size    5  11    5  11 

N10010010  1.8  2.6  11.3  99.9  43.5  62.8 
N20020010  1.6  2.5  14.8  99.9  47.0  65.5 
AE40010  2.0  3.2  16.6  99.6  68.3  78.8 
ConvNet  0.9  1.2  4.0  100  53.8  43.8 
3.2 Autoencoder
To assess the structure of the adversarial noise, we trained a threehiddenlayer autoencoder (784256128256784 neurons) on mapping adversarial examples back to the original data samples. An important detail is that we also train the model to map original training data back to itself, so that the autoencoder preserves the original data if the nonadversarial data samples are fed in; this allows us to stack several autoencoders. We train the autoencoder using adversarial examples from the training set only, and test generalization capabilities on adversarial examples from the test set across different model topologies. Table
3 shows generalization performance of autoencoders trained on adversarial examples from different models. Columns indicate whose adversarial data the autoencoder is trained on, rows indicate whose adversarial test data the autoencoder is used to denoise. Entries correspond to error rates when the outputs from the autoencoder is fed into the model identified by the row labels. We observe that autoencoders generalize very well on adversarial examples from different models. All autoencoders are able to recover at least 90% of adversarial errors, regardless of the model from which it originates.While this is a very successful experiment, we found one drawback: the autoencoder and its corresponding classifier can be stacked to form a new feedforward neural network, then adversarial examples can again generated from this stacked network. The last row in Table 3 and Figure 2 show such stacked network adversarial examples to have a significantly smaller distortion than adversarial examples from the original classifier network, suggesting that while the autoencoder effectively recovers the from the weaknesses of the original classifier network, the stacked network is then even more susceptible to adversarial noises. One possible explanation is that since the autoencoder is trained without the knowledge of the classification objective, it has more “blindspots” with respect to that final objective. This again confirms the necessity of endtoend training in deep neural networks.
N10010010  N20020010  AE40010  ConvNet  
N10010010  2.3%  2.4%  2.3%  5.2% 
N20020010  2.3%  2.2%  2.2%  5.4% 
AE40010  3.6%  3.5%  2.7%  9.2% 
ConvNet  7.7%  7.6%  8.3%  2.6% 
Test error (clean)  2.1%  1.9%  2.1%  1.1% 
Avg adv distortion  0.049  0.051  0.043  0.038 
3.3 Denoising Autoencoder
In this section, a standard denoising autoencoder (DAE) is trained, without the knowledge of the adversarial noise distribution. A DAE maps corrupted input data to clean input data. At each training batch, each pixel in the input data is corrupted by adding independent Gaussian noise with 0 mean and standard deviation. Table 4 summarizes the results indicating that a standard denoising autoencoder can still recover a significant portion of the adversarial noises. In particular, a denoising autoencoder with Gaussian noise could denoise adversarial examples almost as well as an autoencoder trained on actual adversarials noises, as shown in Table 3. However, this model also suffers the same deficiency as in Section 3.2, that a stacked network is more susceptible to adversarials. In this case, this deficiency likely arises due to imperfect training of DAE itself.
N10010010  N20020010  AE40010  ConvNetM  

DAE,  5.0%  4.9%  11.5%  9.1% 
DAE,  10.0%  10.6%  16.3%  15.3% 
3.4 Discussion
Our experiments have shown that the adversarial noise is fairly robust against local perturbations such as additive Gaussian noise, suggesting that the size of “blindspots” is relatively large. In the image data case, the effect of adversarial examples can be significantly reduced by lowpass filtering, such as Gaussian blurring, suggesting that adversarial noise mostly resides in highfrequency domain. Moreover, the success of the autoencoder and the denoising autoencoder experiment shows adversarial noise to have simple structure that is easily exploitable.
A key observation about the adversarial examples is that they are unavoidable and intrinsic property of any feedforward architecture. For any preprocessing, it is always possible to backpropagate the error signal through the additional functions and find new adversarial examples, not only for deterministic preprocessing steps such as Gaussian blurring and autoencoders. Surprisingly, our experiments show that the distortion of adversarials from stacked network is even lower than the distortion of adversarials from the original classifier network. Furthermore, Table 4 also hints that even a simple Gaussian additive noise, often used in data augmentation, effectively creates flat, invariant regions around the input data points. Based on these results and observations, we thus postulate that solving the adversarial problem should correspond to finding new training procedures and objective functions so as increase the distortion of the smallest adversarial examples. Therefore, in Section 4, we formulate a new model that could propagate the input invariance toward the final network outputs and be trained in endtoend.
4 Deep Contractive Network
In this section, we formulate Deep Contractive Network, which imposes a layerwise contractive penalty in a feedforward neural network. The layerwise penalty approximately minimizes the network outputs variance with respect to perturbations in the inputs, enabling the trained model to achieve “flatness” around the training data points.
4.1 Contractive autoencoder
Contractive autoencoder (CAE) is a variant of an autoencoder (AE) with an additional penalty for minimizing the squared norm of the Jacobian of the hidden representation with respect to input data
Rifai et al. (2011b). A standard AE consists of an encoder and a decoder. The encoder maps input data to the hidden representation, and the decoder attempts to reconstruct the input from the hidden representation. Formally, given input and hidden representation , the encoder parametrized by matrixand bias vector
and the decoder parametrized by matrix and bias vector , the output is given by:(2) 
where and
are nonlinear activation functions for the encoder and decoder respectively. Given
training data points, the AE is trained by finding the model parameters that minimize the following objective function:(3) 
For CAE, the objective function has an additional term:
(4) 
is a scaling factor that trades off reconstruction objective with contractive objective. is the Frobenius norm of the Jacobian matrix of with respect to .
4.2 Deep Contractive Networks
A Deep Contractive Network (DCN) is a generalization of the contractive autoencoder (CAE) to a feedforward neural network that outputs with a target . For a network with hidden layers, let denote the function for computing hidden representation at hidden layer : , , and . Ideally, the model should penalize the following objective:
(5) 
However, such a penalty is computationally expensive for calculating partial derivatives at each layer in the standard backpropagation framework. Therefore, a simplification is made by approximating the objective with the following:
(6) 
This layerwise contractive penalty enables partial derivatives to be computed in the same way as in a contractive autoencoder, and is easily incorporated into the backpropagation procedure. This objective does not guarantee global optimality for the solution to Eq. 5, and also limits the capacity of the neural network. However, it is a computationally efficient way to greedily propagate input invariance through a deep network.
Note that for a neural network with additive Gaussian noise added to input during the training, if we let , the training objective is equivalent to Eq. 5 Alain & Bengio (2012). However, such stochastic penalties require many passes of data to train the model effectively. For efficiency, we decided to employ a deterministic penalty instead Rifai et al. (2011b); Alain & Bengio (2012); Chen et al. (2014).
4.3 Experiments and results
The experiments involve applying a contractive penalty to the models in Table 1. The models were trained until they achieved nearly the same accuracy as the original models which lacked a contractive penalty. The adversarial examples are generated following the method defined in Section 2.1.
Table 5 shows that the contractive penalty successfully increases the minimum distortion of the adversarial noises. Table 6 shows the comparison of the Deep Contractive Network penalty against stochastic noise addition. Deep Contractive Networks are more robust than a standard neural network trained with Gaussian input noise, and can be easily augmented by adding Gaussian input noise to further increase the minimum distortion of adversarial noises.
Model Name  DCN error  DCN adv. distortion  orig. error  orig. adv. distortion 

N10010010  2.3%  0.107  1.8%  0.084 
N20020010  2.0%  0.102  1.6%  0.087 
AE40010  2.0%  0.106  2.0%  0.098 
ConvNet  1.2%  0.106  0.9%  0.095 
Training Condition  Test error  Av. distortion 

DCN  2.0%  0.102 
GN,L1,  1.8%  0.095 
GN,L*,  2.0%  0.099 
DCN+GN,L1,  2.2%  0.108 
4.4 Discussions and future work
Results show that Deep Contractive Networks can successfully be trained to propagate contractivity around the input data through the deep architecture, without significant loss in final accuracies. The model can be improved by augmenting the layerwise contractive penalty based on HigherOrder Contractive autoencoders Rifai et al. (2011a), and marginalized Denoising autoencoders Chen et al. (2014). While in this paper, Deep Contractive Networks are used as a framework for alleviating effects due to the adversarial examples, they also provide a suitable framework for probing the invariance properties learnt by deep neural networks. A further study should be conducted to evaluate the performance loss due to layerwise penalties as opposed to global contractive objectives as defined in Eq. 5. In addition, exploring nonEuclidean adversarial examples, e.g. small affine transformation on images, and varying contractivity at higher layers of the network could lead to insights into semantic attributes of features learned at high levels of representation. For example, explicitly learning instantiation parameters as previously attempted by models such as Transforming Autoencoder Hinton et al. (2011).
Our work also bridges supervised learning with unsupervised representation learning, by introducing the penalty from DAE and CAE to standard DNN. Such penalty not only acts as practical regularizers, but also is a highly efficient way to learn obvious information from the training data, such as local generalization in the input space. Recent progress in deep neural networks is driven by both endtoend supervised training and various modes of unsupervised feature learning
Krizhevsky et al. (2012); Bengio (2009), and thus we believe the merge of the two could likely enable new milestones in the field.5 Conclusions
We tested several denoising architectures to reduce the effects of the adversarial examples, and conclude that while the simple and stable structure of adversarial examples makes them easy to remove with autoencoders, the resulting stacked network is even more sensitive to new adversarial examples. We conclude that neural network’s sensitivity to adversarial examples is more related to intrinsic deficiencies in the training procedure and objective function than to model topology. The crux of the problem is then to come up with an appropriate training procedure and objective function that can efficiently make the network learn flat, invariant regions around the training data. We propose Deep Contractive Networks to explicitly learn invariant features at each layer and show some positive initial results.
Acknowledgments
The authors thank Nitish Srivastava for releasing his DeepNet Library, and Volodymyr Mnih for his CUDAMat Library Mnih (2009).
References
 Alain & Bengio (2012) Alain, Guillaume and Bengio, Yoshua. What regularized autoencoders learn from the data generating distribution. arXiv preprint arXiv:1211.4246, 2012.
 Bengio (2009) Bengio, Yoshua. Learning deep architectures for ai. Foundations and trends® in Machine Learning, 2(1):1–127, 2009.
 Chen et al. (2014) Chen, Minmin, Weinberger, Kilian, Sha, Fei, and Bengio, Yoshua. Marginalized denoising autoencoders for nonlinear representations. JMLR, 32(1):1476–1484, 2014.
 Dahl et al. (2012) Dahl, George E, Yu, Dong, Deng, Li, and Acero, Alex. Contextdependent pretrained deep neural networks for largevocabulary speech recognition. Audio, Speech, and Language Processing, IEEE Transactions on, 20(1):30–42, 2012.
 Douglas et al. (1995) Douglas, Rodney J, Koch, Christof, Mahowald, Misha, Martin, KA, and Suarez, Humbert H. Recurrent excitation in neocortical circuits. Science, 269(5226):981–985, 1995.
 Duvenand et al. (2014) Duvenand, David, Rippel, Oren, Adams, Ryan P., and Ghahramani, Zoubin. Avoiding pathologies in very deep networks. arXiv preprint arXiv:1402.5836, 2014.
 Felleman & Van Essen (1991) Felleman, Daniel J and Van Essen, David C. Distributed hierarchical processing in the primate cerebral cortex. Cerebral cortex, 1(1):1–47, 1991.
 Hinton et al. (2011) Hinton, Geoffrey E, Krizhevsky, Alex, and Wang, Sida D. Transforming autoencoders. In Artificial Neural Networks and Machine Learning–ICANN 2011, pp. 44–51. Springer, 2011.
 Krizhevsky & Hinton (2009) Krizhevsky, Alex and Hinton, Geoffrey. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 2009.
 Krizhevsky et al. (2012) Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. Imagenet classification with deep convolutional neural networks. In NIPS, volume 1, pp. 4, 2012.

LeCun & Cortes (1998)
LeCun, Yann and Cortes, Corinna.
The mnist database of handwritten digits, 1998.
 Mnih (2009) Mnih, Volodymyr. Cudamat: a cudabased matrix class for python. Department of Computer Science, University of Toronto, Tech. Rep. UTML TR, 4, 2009.
 Mnih et al. (2014) Mnih, Volodymyr, Heess, Nicolas, Graves, Alex, and Kavukcuoglu, Koray. Recurrent models of visual attention. CoRR, abs/1406.6247, 2014. URL http://arxiv.org/abs/1406.6247.
 Rifai et al. (2011a) Rifai, Salah, Mesnil, Grégoire, Vincent, Pascal, Muller, Xavier, Bengio, Yoshua, Dauphin, Yann, and Glorot, Xavier. Higher order contractive autoencoder. In Machine Learning and Knowledge Discovery in Databases, pp. 645–660. Springer, 2011a.

Rifai et al. (2011b)
Rifai, Salah, Vincent, Pascal, Muller, Xavier, Glorot, Xavier, and Bengio,
Yoshua.
Contractive autoencoders: Explicit invariance during feature extraction.
In Proceedings of the 28th International Conference on Machine Learning (ICML11), pp. 833–840, 2011b.  Stollenga et al. (2014) Stollenga, Marijn, Masci, Jonathan, Gomez, Faustino, and Schmidhuber, Juergen. Deep networks with internal selective attention through feedback connections. arXiv preprint arXiv:1407.3068, 2014.
 Szegedy et al. (2014a) Szegedy, Christian, Liu, Wei, Jia, Yangqing, Sermanet, Pierre, Reed, Scott, Anguelov, Dragomir, Erhan, Dumitru, Vanhoucke, Vincent, and Rabinovich, Andrew. Going deeper with convolutions. arXiv preprint arXiv:1409.4842, 2014a.
 Szegedy et al. (2014b) Szegedy, Christian, Zaremba, Wojciech, Sutskever, Ilya, Bruna, Joan, Erhan, Dumitru, Goodfellow, Ian, and Fergus, Rob. Intriguing properties of neural networks. ICLR, 2014b.

Taigman et al. (2013)
Taigman, Yaniv, Yang, Ming, Ranzato, Marc’Aurelio, and Wolf, Lior.
Deepface: Closing the gap to humanlevel performance in face
verification.
In
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition
, pp. 1701–1708, 2013.  Tang (2013) Tang, Yichuan. Deep learning using support vector machines. arXiv preprint arXiv:1306.0239, 2013.
 Vinyals et al. (2012) Vinyals, Oriol, Jia, Yangqing, Deng, Li, and Darrell, Trevor. Learning with recursive perceptual representations. In Advances in Neural Information Processing Systems, pp. 2825–2833, 2012.
 Zhang et al. (2013) Zhang, Ning, Paluri, Manohar, Ranzato, Marc’Aurelio, Darrell, Trevor, and Bourdev, Lubomir. Panda: Pose aligned networks for deep attribute modeling. arXiv preprint arXiv:1311.5591, 2013.
Comments
There are no comments yet.