<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Enhancing Adversarial Defense by k-Winners-Take-All</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>2020</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10225544</idno>
					<idno type="doi"></idno>
					<title level='j'>8th International Conference on Learning Representations</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Chang Xiao</author><author>Peilin Zhong</author><author>Changxi Zheng</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We propose a simple change to existing neural network structures for better defending against gradient-based adversarial attacks. Instead of using popular activation functions (such as ReLU), we advocate the use of k-Winners-Take-All (k-WTA) activation, a C 0 discontinuous function that purposely invalidates the neural network model's gradient at densely distributed input data points. The proposed k-WTA activation can be readily used in nearly all existing networks and training methods with no significant overhead. Our proposal is theoretically rationalized. We analyze why the discontinuities in k-WTA networks can largely prevent gradient-based search of adversarial examples and why they at the same time remain innocuous to the network training. This understanding is also empirically backed. We test k-WTA activation on various network structures optimized by a training method, be it adversarial training or not. In all cases, the robustness of k-WTA networks outperforms that of traditional networks under white-box attacks.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>In the tremendous success of deep learning techniques, there is a grain of salt. It has become wellknown that deep neural networks can be easily fooled by adversarial examples <ref type="bibr">(Szegedy et al., 2014)</ref>. Those deliberately crafted input samples can mislead the networks to produce an output drastically different from what we expect. In many important applications, from face recognition authorization to autonomous cars, this vulnerability gives rise to serious security concerns <ref type="bibr">(Barreno et al., 2010;</ref><ref type="bibr">2006;</ref><ref type="bibr">Sharif et al., 2016;</ref><ref type="bibr">Thys et al., 2019)</ref>. Attacking the network is straightforward. Provided a labeled data item (x, y), the attacker finds a perturbation x perceptually similar to x but misleading enough to cause the network to output a label different from y. By far, the most effective way of finding such a perturbation (or adversarial example) is by exploiting the gradient information of the network with respect to its input: the gradient indicates how to perturb x to trigger the maximal change of y. The defense, however, is challenging. Recent studies showed that adversarial examples always exist if one tends to pursue a high classification accuracy-adversarial robustness seems at odds with the accuracy <ref type="bibr">(Tsipras et al., 2018;</ref><ref type="bibr">Shafahi et al., 2019a;</ref><ref type="bibr">Su et al., 2018a;</ref><ref type="bibr">Weng et al., 2018;</ref><ref type="bibr">Zhang et al., 2019)</ref>. This intrinsic difficulty of eliminating adversarial examples suggests an alternative path: can we design a network whose adversarial examples are evasive rather than eliminated? Indeed, along with this thought is a series of works using obfuscated gradients as a defense mechanism <ref type="bibr">(Athalye et al., 2018)</ref>. Those methods hide the network's gradient information by artificially discretizing the input <ref type="bibr">(Buckman et al., 2018;</ref><ref type="bibr">Lin et al., 2019)</ref> or introducing certain randomness to the input <ref type="bibr">(Xie et al., 2018a;</ref><ref type="bibr">Guo et al., 2018)</ref> or the network structure <ref type="bibr">(Dhillon et al., 2018;</ref><ref type="bibr">Cohen et al., 2019)</ref> (see more discussion in Sec. 1.1). Yet, the hidden gradient in those methods can still be approximated, and as recently pointed out by <ref type="bibr">Athalye et al. (2018)</ref>, those methods remain vulnerable.</p><p>Technical contribution I) Rather than obfuscating the network's gradient, we make the gradient undefined. This is achieved by a simple change to the standard neural network structure: we advocate the use of a C 0 discontinuous activation function, namely the k-Winners-Take-All (k-WTA) activation, to replace the popular activation functions such as rectified linear units (ReLU). This is the only change we propose to a deep neural network. All other components (such as BatchNorm, convolution, and pooling) as well as the training methods remain unaltered. With no significant overhead, k-WTA activation can be readily used in nearly all existing networks and training methods.</p><p>k-WTA activation takes as input the entire output of a layer, retains its k largest values and deactivates all others to zero. As we will show in this paper, even an infinitesimal perturbation to the input may cause a complete change to the network neurons' activation pattern, thereby resulting in a large jump in the network's output. This means that, mathematically, if we use f (x; w) to denote a k-WTA network taking an input x and parameterized by weights w, then the gradient &#8711; x f (x; w) at certain x is undefined-f (x; w) is C 0 discontinuous. . . . The resulting model is piecewise continuous (blue curve), and the discontinuities can be dense.</p><p>Technical contribution II) More intriguing than the mere replacement of the activation function is why k-WTA helps improve the adversarial robustness. We offer our theoretical reasoning of its behavior from two perspectives. On the one hand, we show that the discontinuities of f (x; w) is densely distributed in the space of x. Dense enough such that a tiny perturbation from any x almost always comes across some discontinuities, where the gradients are undefined and thus the attacker's search of adversarial examples becomes blinded (see Figure <ref type="figure">1</ref>). On the other hand, a paradox seemingly exists. The discontinuities in the activation function also renders f (x; w) discontinuous with respect to the network weights w (at certain w values). But training the network relies on the presumption that the gradient with respect to the weights is almost always available. Interestingly, we show that, under k-WTA activation, the discontinuities of f (x; w) is rather sparse in the space of w, intuitively because the dimension of w (in parameter space) is much larger than the dimension of x (in data space). Thus, the network can be trained successfully.</p><p>Summary of results. We conducted extensive experiments on multiple datasets under different network architectures, including ResNet <ref type="bibr">(He et al., 2016)</ref>, DenseNet <ref type="bibr">(Huang et al., 2017)</ref>, and Wide ResNet <ref type="bibr">(Zagoruyko &amp; Komodakis, 2016)</ref>, that are optimized by regular training as well as various adversarial training methods <ref type="bibr">(Madry et al., 2017;</ref><ref type="bibr">Zhang et al., 2019;</ref><ref type="bibr">Shafahi et al., 2019b)</ref>. In all these setups, we compare the robustness performance of using the proposed k-WTA activation with commonly used ReLU activation under several white-box attacks, including PGD <ref type="bibr">(Kurakin et al., 2016)</ref>, Deepfool <ref type="bibr">(Moosavi-Dezfooli et al., 2016)</ref>, C&amp;W <ref type="bibr">(Carlini &amp; Wagner, 2017)</ref>, MIM <ref type="bibr">(Dong et al., 2018)</ref>, and others. In all tests, k-WTA networks outperform ReLU networks. The use of k-WTA activation is motivated for defending against gradient-based adversarial attacks. Our experiments suggest that the robustness improvement gained by simply switching to k-WTA activation is universal, not tied to specific network architectures or training methods. To promote reproducible research, we will release our implementation of k-WTA networks, along with our experiment code, configuration files and pre-trained models<ref type="foot">foot_0</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.1">RELATED WORK: OBFUSCATED GRADIENTS AS A DEFENSE MECHANISM</head><p>Before delving into k-WTA details, we review prior adversarial defense methods that share the same philosophy with our method and highlight our advantages. For a review of other attack and defense methods, we refer to Appendix A. Methods aiming for concealing the gradient information from the attacker has been termed as obfuscated gradients <ref type="bibr">(Athalye et al., 2018)</ref> or gradient masking <ref type="bibr">(Papernot et al., 2017;</ref><ref type="bibr">Tram&#232;r et al., 2017)</ref> techniques. One type of such methods is by exploiting randomness, either randomly transforming the input before feeding it to the network <ref type="bibr">(Xie et al., 2018a;</ref><ref type="bibr">Guo et al., 2018)</ref> or introducing stochastic layers in the network <ref type="bibr">(Dhillon et al., 2018)</ref>. However, the gradient information in these methods can be estimated by taking the average over multiple trials <ref type="bibr">(Athalye et al., 2018;</ref><ref type="bibr">2017)</ref>. As a result, these methods are vulnerable. Another type of obfuscated gradient methods relies on the so-called shattered gradient <ref type="bibr">(Athalye et al., 2018)</ref>, which aims to make the network gradients nonexistent or incorrect to the attacker, by purposely discretizing the input <ref type="bibr">(Buckman et al., 2018;</ref><ref type="bibr">Ma et al., 2018)</ref> or artificially raising numerical instability for gradient evaluation <ref type="bibr">(Song et al., 2018;</ref><ref type="bibr">Samangouei et al., 2018)</ref>. Unfortunately, these methods are also vulnerable. As shown by <ref type="bibr">Athalye et al. (2018)</ref>, they can be compromised by backward pass </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ReLU</head><p>Maxpool LWTA k-WTA Figure <ref type="figure">2</ref>: Different activation functions. ReLU: all neurons with negative activation values will be set to zero. Max-pooling: only the largest activation in each group is transmitted to the next layer, and this effectively downsample the output. LWTA: the largest activation in each group retains its value when entering the next layer, others are set to zero. k-WTA: the k largest activations in the entire layer retain their values when entering the next layer, others are set to zero (k = 3 in this example). Note that the output is not downsampled through ReLU, LWTA and k-WTA.</p><p>The gradient &#8711; x f can be estimated as long as one can find a smooth delegate g that approximates well f i (i.e., g(x) &#8776; f i (x)).</p><p>In stark contrast to all those methods, a slight change of the k-WTA activation pattern in an earlier layer of a network can cause a radical reorganization of activation patterns in later layers (as shown in Sec. 3). Thereby, k-WTA activation not just obfuscates the network's gradients but destroys them at certain input samples, introducing discontinuities densely distributed in the input data space. We are not aware of any possible smooth approximation of a k-WTA network to launch BPDA attacks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">k-WINNERS-TAKE-ALL ACTIVATION</head><p>The debut of the Winner-Takes-All (WTA) activation on the stage of neural networks dates back to 1980s, when <ref type="bibr">Grossberg (1982)</ref> introduced shunting short-term memory equations in on-center off-surround networks and showed the ability to identify the largest of N real numbers. Later, <ref type="bibr">Majani et al. (1989)</ref> generalized the WTA network to identify the K largest of N real numbers, and they termed the network as the K-Winners-Take-All (KWTA) network. These early WTA-type activation functions output only boolean values, mainly motivated by the properties of biological neural circuits. In particular, <ref type="bibr">Maass (2000a;</ref><ref type="bibr">b)</ref> has proved that any boolean function can be computed by a single KWTA unit. Yet, the boolean nature of these activation functions differs starkly from the modern activation functions, including the one we use.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">DEEP NEURAL NETWORKS ACTIVATED BY k-WINNERS-TAKE-ALL</head><p>We propose to use k-Winners-Take-All (k-WTA) activation, a natural generalization of the boolean KWTA<ref type="foot">foot_1</ref>  <ref type="bibr">(Majani et al., 1989)</ref>. k-WTA retains the k largest values of an N &#215; 1 input vector and sets all others to be zero before feeding the vector to the next network layer, namely, &#966; k (y) j = y j , y j &#8712; {k largest elements of y}, 0, Otherwise.</p><p>(1)</p><p>Here &#966; k : R N &#8594; R N is the k-WTA function (parameterized by an integer k), y &#8712; R N is the input to the activation, and &#966; k (y) j denote the j-the element of the output &#966; k (y) (see the rightmost subfigure of Figure <ref type="figure">2</ref>). Note that if y has multiple elements that are equally k-th largest, we break the tie by retaining the element with smaller indices until the k slots are taken. When using k-WTA activation, we need to choose k. Yet it makes no sense to fix k throughout all layers of the neural network, because these layers often have different output dimensions; a small k to one layer's dimension can be relatively large to the other. Instead of specifying k, we introduce a parameter &#947; &#8712; (0, 1) called sparsity ratio. If a layer has an output dimension N , then its k-WTA activation has k = &#947; &#8226; N . Even though the sparsity ratio can be set differently for different layers, in practice we found no clear gain from introducing such a variation. Therefore, we use a fixed &#947;-the only additional hyperparameter needed for the neural network. Nevertheless, we prefer a smaller &#947;. As we will discuss in the next section, a smaller &#947; usually leads to better robustness against finding adversarial examples. Therefore, to ease the training (when &#947; is small), we propose to use an iterative fine-tuning approach. Suppose the target sparsity ratio is &#947; 1 . We first train the network with a larger sparsity ratio &#947; 0 using the standard training process. Then, we iteratively fine tune the network. In each iteration, we reduce its sparsity ratio by a small &#948; and train the network for two epochs. The iteration repeats until &#947; 0 is reduced to &#947; 1 . This incremental process introduces little training overhead, because the cost of each fine tuning is negligible in comparison to training from scratch toward &#947; 0 . We also note that this process is optional. In practice we use it only when &#947; &lt; 0.2. We show more experiments on the efficacy of the incremental training in Appendix D.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">UNDERSTANDING k-WTA DISCONTINUITY</head><p>We now present our theoretical understanding of k-WTA's discontinuity behavior in the context of deep neural networks, revealing some implication toward the network's adversarial robustness.</p><p>that satisfies x = c &#8226; (x + d(x, x )x &#8869; ) for some scalar c, where x &#8869; is a unit vector perpendicular to x and on the plane spanned by x and x . With this notion, and if the elements in W is initialized by sampling from N (0, 1 l ) and b is initialized as zero, we find the following property: Theorem 1 (Dense discontinuities). Given any input x &#8712; R m and some &#946;, and &#8704;x &#8712; R m such that</p><p>Here l is the width of the layer, and &#947; is again the sparsity ratio in k-WTA. This theorem informs us that the larger the layer width l is, the smaller &#946;-and thus the smaller perpendicular perturbation distance d(x, x )-is needed to trigger a change of the activation pattern, that is, as the layer width increases, the piecewise linear regions become finer (see Appendix C for proof and more discussion). This property also echos a similar trend in ReLU networks, as pointed out by <ref type="bibr">Raghu et al. (2017)</ref>.</p><p>Why is the k-WTA network trainable? While k-WTA networks are highly discontinuous as revealed by Theorem 1 and our experiments (Figure <ref type="figure">3</ref>-a), in practice we experience no difficulty on training these networks. Our next theorem sheds some light on the reason behind the training success.</p><p>Theorem 2. Consider N data points</p><p>This theorem is more formally stated in Theorem 10 in Appendix C together with a proof there. Intuitively speaking, it states that if the network is sufficiently wide, then for any i = j, activation pattern of input data x i is almost separated from that of x j . Thus, the weights for predicting x i 's and x j 's labels can be optimized almost independently, without changing their individual activation patterns. In practice, the activation patterns of x i and x j are not fully separated but weakly correlated. During the optimization, the activation pattern of a data point x i may change, but the chance is relatively low-a similar behavior has also been found in ReLU networks <ref type="bibr">(Li &amp; Liang, 2018;</ref><ref type="bibr">Du et al., 2018;</ref><ref type="bibr">Allen-Zhu et al., 2019a;</ref><ref type="bibr">b;</ref><ref type="bibr">Song &amp; Yang, 2019)</ref>. Further, notice that the training loss takes a summation over all training data points. This means a weight update would change only a small set of activation patterns (since the chance of having the pattern changed is low); the discontinuous change on the loss value, after taking the summation, will be negligible (see Figure <ref type="figure">3-c</ref>). Thus, the discontinuities in k-WTA is not harmful to network training.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">EXPERIMENTAL RESULTS</head><p>We evaluate the robustness of k-WTA networks under adversarial attacks. Our evaluation considers multiple training methods on different network architectures (see details below). When reporting statistics, we use A rob to indicate the worst-case robustness accuracy on test data under all adversarial attacks we evaluated, and use A std to indicate the accuracy on the clean test data. We use k-WTA-&#947; to represent k-WTA activation with sparsity ratio &#947;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">ROBUSTNESS UNDER WHITE-BOX ATTACKS</head><p>The rationale behind k-WTA activation is to destroy network gradients-information needed in white-box attacks. We therefore evaluate k-WTA networks under multiple recently proposed whitebox attack methods, including Projected Gradient Descent (PGD) <ref type="bibr">(Madry et al., 2017)</ref>, <ref type="bibr">Deepfool (Moosavi-Dezfooli et al., 2016)</ref>, C&amp;W attack <ref type="bibr">(Carlini &amp; Wagner, 2017)</ref>, and Momentum Iterative Method (MIM) <ref type="bibr">(Dong et al., 2018)</ref>. Since k-WTA activation can be used in almost any training method, be it adversarial training or not, we also consider multiple training methods, including natural (non-adversarial) training, adversarial training (AT) <ref type="bibr">(Madry et al., 2017)</ref>, TRADES <ref type="bibr">(Zhang et al., 2019)</ref> and free adversarial training (FAT) <ref type="bibr">(Shafahi et al., 2019b)</ref>. In addition, we evaluate the robustness under transfer-based Black-box (BB) attacks <ref type="bibr">(Papernot et al., 2017)</ref>. The black-box threat model requires no knowledge about network architecture and parameters. Thus, we use a pre-trained VGG19 network <ref type="bibr">(Simonyan &amp; Zisserman, 2014)</ref> as the source model to generate adversarial examples using PGD. As demonstrated by <ref type="bibr">Su et al. (2018b)</ref>, VGG networks have the strongest transferability among different architectures. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">CONCLUSION</head><p>This paper proposes to replace widely used activation functions with the k-WTA activation for improving the neural network's robustness against adversarial attacks. This is the only change we advocate. The underlying idea is to embrace the discontinuities introduced by k-WTA functions to make the search for adversarial examples more challenging. Our method comes almost for free, harmless to network training, and readily useful in the current paradigm of neural networks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Supplementary Document Enhancing Adversarial Defense by k-Winners-Take-All</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A OTHER RELATED WORK</head><p>In this section, we briefly review the key ideas of attacking neural network models and existing defense methods based on adversarial training.</p><p>Attack methods. Recent years have seen adversarial attack studied extensively. The proposed attack methods fall under two general categories, white-box and black-box attacks. The white-box threat model assumes that the attacker knows the model's structure and parameters fully. This means that the attacker can exploit the model's gradient (with respect to the input) to find adversarial examples. A baseline of such attacks is the Fast Gradient Sign Method (FGSM) <ref type="bibr">(Goodfellow et al., 2014)</ref>, which constructs the adversarial example x of a given labeled data (x, y) using a gradient-based rule:</p><p>where f (x) denotes the neural network model's output, L(&#8226;) is the loss function provided f (x) and input label y, and is the perturbation range for the allowed adversarial example.</p><p>Extending FGSM, Projected Gradient Descent (PGD) <ref type="bibr">(Kurakin et al., 2016)</ref> utilizes local firstorder gradient of the network in a multi-step fashion, and is considered the "strongest" first-order adversary <ref type="bibr">(Madry et al., 2017)</ref>. In each step of PGD, the adversarial example is updated by a FGSM rule, namely,</p><p>where x n is the adversarial examples after n steps and &#928; x&#8712;&#8710; (x n ) projects x n back into an allowed perturbation range &#8710; (such as an ball of x under certain distance measure). Other attacks include Deepfool <ref type="bibr">(Moosavi-Dezfooli et al., 2016)</ref>, C&amp;W <ref type="bibr">(Carlini &amp; Wagner, 2017)</ref> and momentum-based attack <ref type="bibr">(Dong et al., 2018)</ref>. Those methods are all using first-order gradient information to construct adversarial samples.</p><p>The black-box threat model is a strict subset of the white-box threat model. It assumes that the attacker has no information about the model's architecture or parameters. Some black-box attack model allows the attacker to query the victim neural network to gather (or reverse-engineer) information. By far the most successful black-box attack is transfer attack <ref type="bibr">(Papernot et al., 2017;</ref><ref type="bibr">Tram&#232;r et al., 2017)</ref>. The idea is to first construct adversarial examples on an adversarially trained network and then attack the black-box network model use these samples. There also exist some gradient-free black-box attack methods, such as boundary attack <ref type="bibr">(Brendel et al., 2017;</ref><ref type="bibr">Chen &amp; Jordan, 2019)</ref>, one-pixel attack <ref type="bibr">(Su et al., 2019)</ref> and local search attack <ref type="bibr">(Narodytska &amp; Kasiviswanathan, 2016)</ref>. Those methods rely on repeatedly evaluating the model and are not as effective as gradient-based white-box attacks.</p><p>Adversarial training. Adversarial training <ref type="bibr">(Goodfellow et al., 2014;</ref><ref type="bibr">Madry et al., 2017;</ref><ref type="bibr">Kurakin et al., 2016;</ref><ref type="bibr">Huang et al., 2015)</ref> is by far the most successful method against adversarial attacks.</p><p>It trains the network model with adversarial images generated during the training time. <ref type="bibr">Madry et al. (2017)</ref> showed that adversarial training in essence solves the following min-max optimization problem:</p><p>where &#8710; is the set of allowed perturbations of training samples, and y denotes the true label of each training sample. Recent works that achieve state-of-the-art adversarial robustness rely on adversarial training <ref type="bibr">(Zhang et al., 2019;</ref><ref type="bibr">Xie et al., 2018b</ref> B DISCONTINUITY JUMP OF W&#966; k (x)</p><p>Consider a gradual and smooth change of the vector x. For the ease of illustration, let us assume all the values in x are distinct. Because every element in x changes smoothly, when the activation pattern A(x) changes, the k-th largest and k + 1-th largest value in x must swap: the previously k-th largest value is removed from the activation pattern, while the previously k + 1-th largest value is added in the activation pattern. Let i and j denote the indices of the two values, that is, x i is previously the k-th largest and x j is previously the k + 1-th largest. When this swap happens, x i and x j must be infinitesimally close to each other, and we use x * to indicate their common value.</p><p>This swap affects the computation of W&#966; k (x). Before the swap happens, x i is in the activation pattern but x j is not, therefore W i takes effect but W j does not. After the swap, W j takes effect while W j is suppressed. Therefore, the discontinuity jump due to this swap is</p><p>When W is determined, the magnitude of the jump depends on x * . Recall that x * is the k-th largest value in x when the swap happens. Thus, it depends on k and in turn the sparsity ratio &#947;: the smaller the &#947; is, the smaller k is effectively used (for a fixed vector length). As a result, the k-th largest value becomes larger-when k = 1, the largest value of x is used as x * .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C THEORETICAL PROOFS</head><p>In this section, we will prove Theorem 1 and Theorem 2. The formal version of the two theorems are Theorem 9 and Theorem 10 respectively.</p><p>Notation. We use [n] to denote the set {1, 2, &#8226; &#8226; &#8226; , n}. We use 1(E) to indicate an indicator variable.</p><p>If the event E happens, the value of 1(E) is 1. Otherwise the value of 1(E) is 0. For a weight matrix W , we use W i to denote the i-th row of W . For a bias vector b, we use b i to denote the i-th entry of b.</p><p>In this section, we show some behaviors of the k-WTA activation function. Recall that an n-layer neural network f (x) with k-WTA activation function can be seen as the following:</p><p>where W (i) is the weight matrix, b (i) is the bias vector of the i-th layer, and &#966;(&#8226;) is the k-WTA activation function, i.e., for an arbitrary vector y, &#966; k (y) is defined as the following:</p><p>For simplicity of the notation, if k is clear in the context, we will just use &#966;(y) for short. Notice that if there is a tie in the above definition, we assume the entry with smaller index has larger value. For a vector y &#8712; R l , we define the activation pattern A(y) &#8838; [l] as</p><p>Notice that if the activation pattern A(y) is different from A(y ), then W &#8226; &#966;(y) and W &#8226; &#966;(y ) will be in different linear region. Actually, W &#8226; &#966;(y) may even represent a discontinuous function. In the next section, we will show that when the network is much wider, the function may be more discontinuous with respect to the input.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C.1 DISCONTINUITY WITH RESPECT TO THE INPUT</head><p>We only consider the activation pattern of the output of one layer. We consider the behavior of the network after the initialization of the weight matrix and the bias vector. By initialization, the entries of the weight matrix W are i.i.d. random Gaussian variables, and the bias vector is zero. We can show that if the weight matrix is sufficiently wide, then for any vector x, with high probability, for all vector x satisfying that the "perpendicular" distance between x and x is larger than a small threshold, the activation patterns of W x and W x are different.</p><p>Notice that the scaling of W does not change the activation pattern of W x for any x, we can thus assume that each entry of W is a random variable with standard Gaussian distribution N (0, 1).</p><p>Before we prove Theorem 9, let us prove several useful lemmas. The following several lemmas does not depend on the randomness of the weight matrix.</p><p>Lemma 1 (Inputs with the same activation pattern form a convex set). Given an arbitrary weight matrix W &#8712; R l&#215;m and an arbitrary bias vector b &#8712; R l , for any x &#8712; R m , the set of all the vectors</p><p>Lemma 2 (Different patterns of input points with small angle imply different patterns of input points with large angle). Let &#945; &#8712; (0, 1). Given an arbitrary weight matrix W &#8712; R l&#215;m , a bias vector b = 0, and a vector x &#8712; R m with x 2 = 1, if every vector x &#8712; R m with x 2 = 1 and x, x = &#945; satisfies A</p><p>Proof. We draw a line between x and x . There must be a point x * &#8712; R m on the line and x, x = &#945;, where x = x * / x * 2 . Since b = 0, we have A(W x * +b) = A(W x +b) = A(W x+b). Since x * is on the line between x and x , we have A(W x + b) = A(W x + b) by convexity (see Lemma 1).</p><p>Lemma 3 (A sufficient condition for different patterns). Consider two vectors y &#8712; R l and y &#8712; R l . If &#8707;i &#8712; A(y), j &#8712; [l] \ A(y) such that y i &lt; y j , then A(y) = A(y ).</p><p>Proof. Suppose A(y) = A(y ). We have i &#8712; A(y ). It means that y i is one of the top-k largest values among all entries of y . Thus y j is also one of the top-k largest values, and j should be in A(y ) which leads to a contradiction.</p><p>In the remaining parts, we will assume that each entry of the weight matrix W &#8712; R l&#215;m is a standard random Gaussian variable. Lemma 4 (Upper bound of the entires of W ). Consider a matrix W &#8712; R l&#215;m where each entry is a random variable with standard Gaussian distribution N (0, 1). With probability at least 0.99, &#8704;i &#8712;</p><p>. By Markov's inequality, we have Pr[ W i 2 2 &gt; 100ml] &#8804; 0.01/l. By taking union bound over all i &#8712; [l], with probability at least 0.99, we have &#8704;i &#8712; [l], W i 2 &#8804; 10 &#8730; ml.</p><p>Lemma 5 (Two vectors may have different activation patterns with a good probability). Consider a matrix W &#8712; R l&#215;m where each entry is a random variable with standard Gaussian distribution N (0, 1). Let &#947; &#8712; (0, 0.48) be the sparsity ratio of the activation, i.e., &#947; = k/l. For any two vectors x, x &#8712; R m with x 2 = x 2 = 1 and x, x = &#945; for some arbitrary &#945; &#8712; (0.5, 1), with probability at least 1 -</p><p>Proof. Consider arbitrary two vectors x, x &#8712; R m with x 2 = x 2 = 1 and x, x = &#945;. We can find an orthogonal matrix Q &#8712; R m&#215;m such that x := Qx = (1, 0, 0,</p><p>Then we have W x = W x and W x = W x . Thus, we only need to analyze the activation patterns of W x and W x . Since Q is an orthogonal matrix and each entry of W is an i.i.d. random variable with standard Gaussian distribution N (0, 1), W = W Q is also a random matrix where each entry is an i.i.d. random variable with standard Gaussian distribution N (0, 1). Let the entries in the first column of W be X 1 , X 2 , &#8226; &#8226; &#8226; , X l and let the entries in the second column of</p><p>We set &#949; = &#8730; 1&#945; 2 /(96&#945;) and define R 1 &lt; R 1 &lt; R 2 &lt; R 2 as follows:</p><p>Pr</p><p>Pr</p><p>Pr X&#8764;N (0,1)</p><p>Since &#947; &lt; 0.48 and &#949; &#8804; 0.02, we have</p><p>Proof. By Equation ( <ref type="formula">7</ref>) and Equation ( <ref type="formula">10</ref>), Pr</p><p>Due to the density function of standard Gaussian distribution, we have</p><p>By the tail bound of Gaussian distribution, we have</p><p>By combining with Equation ( <ref type="formula">7</ref>), we have</p><p>where the last inequality follows from 1 -2&#949; &#8805; 0.5.</p><p>Claim 4.</p><p>We have</p><p>Thus,</p><p>We have</p><p>= &#949;&#947; by Equation ( <ref type="formula">7</ref>) and Equation (8). By Chernoff bound, we have</p><p>Similarly, we have <ref type="formula">9</ref>) and Equation (10). By chernoff bound, we have</p><p>Equation ( <ref type="formula">11</ref>) says that, with high probability, &#8704;i &#8712; [l] with X i &#8805; R 2 , it has i &#8712; A(W x). Equation (12) says that, with high probability, &#8704;i &#8712; [l] with X i &#8804; R 1 , it has i &#8712; A(W x). Equation ( <ref type="formula">14</ref>) (Equation ( <ref type="formula">13</ref>)) says that, with high probability, there are many i &#8712;</p><p>where</p><p>According to Equation (11), Equation ( <ref type="formula">12</ref>), Equation ( <ref type="formula">13</ref>) and Equation ( <ref type="formula">14</ref>), the probability that E happens is at least</p><p>(15) by union bound over &#274;1 , &#274;2 , &#274;3 , &#274;4 .</p><p>Claim 5. Condition on E, the probability that &#8707;i &#8712;</p><p>Pr</p><p>Thus, according to event E 4 , we have</p><p>. Claim 6. Condition on E, the probability that &#8707;i &#8712;</p><p>Thus, according to event E 3 , we have</p><p>. By Claim 5, with probability at least</p><p>where the first step follows from Equation ( <ref type="formula">6</ref>), the second step follows from</p><p>, and the last step follows from</p><p>Because of E 2 if X j &#8804; R 1 , X j should not be one of the top-k largest values. Due to Equation ( <ref type="formula">6</ref>), we have X j = W j x. Thus, if X j &#8804; R 1 , j &#8712; A(W x). By Claim C.1, with probability at least</p><p>) where the first step follows from Equation ( <ref type="formula">6</ref>), the second step follows from Y j &#8805; 0, and the last step follows from</p><p>By Equation ( <ref type="formula">19</ref>) and Equation ( <ref type="formula">17</ref></p><p>where the second step follows from Claim 3, the forth step follows from &#945; &#8805; 0.5, and the last step follows from &#949; = &#8730; 1&#945; 2 /(96&#945;). By Lemma 3, we can conclude A(W x) = A(W x ). By Equation ( <ref type="formula">15</ref>), Equation ( <ref type="formula">16</ref>), Equation ( <ref type="formula">18</ref>), and union bound, the overall probability is at least</p><p>, where the first and the last step follows from &#949; = &#8730; 1&#945; 2 /(96&#945;)</p><p>Next, we will use a tool called &#949;-net. Definition 7 (&#949;-Net). For a given set S, if there is a set N &#8838; S such that &#8704;x &#8712; S there exists a vector y &#8712; N such that xy 2 &#8804; &#949;, then N is an &#949;-net of S.</p><p>There is a standard upper bound of the size of an &#949;-net of a unit norm ball. Lemma 6 <ref type="bibr">(Wojtaszczyk (1996)</ref> II.E, 10). Given a matrix</p><p>Now we can extend above lemma to the following. Lemma 7 (&#949;-Net for the set of points with a certain angle). Given a vector x &#8712; R m with x 2 = 1 and a parameter &#945; &#8712; (-1, 1), let</p><p>Proof. Let U &#8712; R m&#215;(m-1) have orthonormal columns and U x = 0. Then S can be represented as</p><p>According to Lemma 6, there is an &#949;-net N of S with size |N | &#8804; (1 + 1/&#949;) m-1 . We construct N as following:</p><p>. Next, we will show that N is indeed an &#949;-net of S. Let x be an arbitrary vector from S.</p><p>There is a vector</p><p>Theorem 8 (Rotating a vector a little bit may change the activation pattern). Consider a weight matrix W &#8712; R l&#215;m where each entry is an i.i.d. sample drawn from the Gaussian distribution N (0, 1/l). Let &#947; &#8712; (0, 0.48) be the sparsity ratio of the activation function, i.e., &#947; = k/l. With probability at least 0.99, it has &#8704;i &#8712;</p><p>for any x &#8712; R m and &#945; &#8712; (0.5, 1), if</p><p>for a sufficiently large constant C, with probability at least</p><p>Proof. Notice that the scale of W does not affect the activation pattern of W x for any x &#8712; R m . Thus, we assume that each entry of W is a standard Gaussian random variable in the remaining proof, and we will instead condition on &#8704;i &#8712; [l], W i 2 &#8804; 10 &#8730; ml. The scale of x or x will not affect x,x x 2 x 2 . It will not affect the activation pattern either. Thus, x 2 = x 2 = 1.</p><p>By Lemma 4, with probability at least 0.99, we have &#8704;i &#8712;</p><p>By Lemma 7, there is an &#949;-net N of S such that</p><p>By Lemma 5, for any y &#8712; N , with probability at least</p><p>By taking union bound over all y &#8712; N , with probability at least</p><p>In the remaining of the proof, we will condition on the event E . Consider y &#8712; S. Since N is an &#949;-net of S, we can always find a y &#8712; N such that</p><p>Since event E happens, we can find i &#8712; A(W x) and j &#8712; [l] \ A(W x) such that</p><p>Then, we have</p><p>where the second step follows from W i y &lt; W j y -&#8730; 1&#945; 2 /(24&#945;) &#8226; &#8730; 2&#960; and W i (yy) &#8804; W i 2 yy 2 , the third step follows from W i 2 &#8804; 10 &#8730; ml and yy 2 &#8804; 2&#960;(1&#945; 2 )/(720&#945; &#8730; ml), the sixth step follows from W j (yy ) &#8804; W j 2 yy 2 , and the seventh step follows from W i 2 &#8804; 10 &#8730; ml and yy 2 &#8804; 2&#960;(1&#945; 2 )/(720&#945; &#8730; ml).</p><p>By Lemma 3, we know that A(W x) = A(W y ). Thus, &#8704;y &#8712; R m with y 2 = 1 and x, y = &#945;, we have A(W x) = A(W y ) conditioned on E . By Lemma 2, we can conclude that &#8704;x &#8712; R m with x 2 = 1 and x, x &#8804; &#945;, we have A(W x) = A(W x ) conditioned on E .</p><p>Theorem 9 (A formal version of Theorem 1). Consider a weight matrix W &#8712; R l&#215;m where each entry is an i.i.d. sample drawn from the Gaussian distribution N (0, 1/l). Let &#947; &#8712; (0, 0.48) be the sparsity ratio of the activation function, i.e., &#947; = k/l. With probability at least 0.99, it has &#8704;i &#8712;</p><p>for some &#946; &#8712; (0, 1) and a sufficiently large constant C, with probability at least</p><p>, where x = c &#8226; (x + &#8710;x) for some scaler c, and &#8710;x is perpendicular to x.</p><p>Proof. If x, x &#8804; 0, then the statement follows from Theorem 8 directly. In the following, we consider the case x, x &gt; 0.</p><p>Thus, we have the bounds:</p><p>By Theorem 8, we conclude the proof.</p><p>Example 1. Suppose that the training data contains N points</p><p>, where each entry of x i for i &#8712; [N ] is an i.i.d. Bernoulli random variable, i.e., each entry is 1 with some probability p &#8712; (100 log(N )/m, 0.5) and 0 otherwise. Consider a weight matrix W &#8712; R l&#215;m where each entry is an i.i.d. sample drawn from the Gaussian distribution N (0, 1/l). Let &#947; &#8712; (0, 0.48) be the sparsity ratio of the activation function, i.e., &#947; = k/l. If l &#8805; &#8486;(m/&#947; &#8226; log(m/&#947;)), then with probability at least 0.9, &#8704;i, j &#8712; [N ], the activation pattern of W x i and W x j are different, i.e., A(W</p><p>Proof. Firstly, let us bound</p><p>Thus, by taking union bound over all i &#8712; [N ], with probability at least 0.99, &#8704;i &#8712; [N ], &#8730; 0.9pm &#8804;</p><p>There are two cases.</p><p>Case 1 (p 2 m &gt; 20 log N ). By Bernstein inequality, we have</p><p>By taking union bound over all pairs of i, j, with probability at least 0.99, &#8704;i = j, x i , x j &#8804; 3 2 p 2 m. Since x i 2 , x j 2 &#8805; &#8730; 0.9pm, we have</p><p>Case 2 (p 2 m &#8804; 20 log N ). By Bernstein inequality, we have</p><p>By taking union bound over all pairs of i, j, with probability at least 0.99, &#8704;i = j, x i , x j &#8804; 10 log N , Since x i 2 , x j 2 &#8805; &#8730; 0.9pm &#8805; &#8730; 90 log N , we have</p><p>Thus, with probability at least 0.98, we have &#8704;i = j, x i , x j /( x i 2 x j 2 ) &#8804; 5/6. By Theorem 8, with probability at least 0.99, &#8704;q &#8712; [l], W q 2 &#8804; 10 &#8730; m. Condition on this event, and since &#8704;i = j we have x i , x j /( x i 2 x j 2 ) &#8804; 5/6, by Theorem 8 again and union bound over all i &#8712; [N ], with probability at least 0.99, &#8704;i = j, A(W x i ) = A(W x j ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C.2 DISJOINTNESS OF ACTIVATION PATTERNS OF DIFFERENT INPUT POINTS</head><p>Let X 1 , X 2 , &#8226; &#8226; &#8226; , X m be i.i.d. random variables drawn from the standard Gaussian distribution N (0, 1). Let Z = m i=1 X 2 i . We use the notation &#967; 2 m to denote the distribution of Z. If m is clear in the context, we just use &#967; 2 for short. Lemma 8 (A property of &#967; 2 distribution). Let Z be a random variable with &#967; 2 m m (m &#8805; 2) distribution. Given arbitrary &#949;, &#951; &#8712; (0, 1), if R is sufficiently large then</p><p>Proof. Let R be a sufficiently large number such that:</p><p>&#8226; e &#949;R/4 &#8805; 16 9 &#8226; 1 &#951; .</p><p>Let &#958; = &#949;/4. By the density function of &#967; 2 distribution, we have</p><p>and</p><p>where &#915;(&#8226;) is the Gamma function, and for integer m/2,</p><p>where the first step follows from &#8704;t &#8805; R, t m/2-1 &#8805; 1, and the third step follows from e -(1+&#949;)R/2 e -R/2 = e -&#949;R/2 &#8804; &#958;.</p><p>We also have:</p><p>where the first step follos from &#8704;t &#8805; R, t m/2-1 &#8804; e &#958;t/2 , and the third step follows from</p><p>Thus, we have</p><p>e -&#949;R/4 &#8804; &#951;.</p><p>Lemma 9. Consider x, y, z &#8712; R m . If</p><p>x,y</p><p>x 2 y 2 &#8804; &#945;, x,z x 2 z 2 &#8805; &#946; for some &#945;, &#946; &#8805; 0, then</p><p>, then y,z y 2 z 2 &#8804; (1&#949; &#945; )&#946;, where &#949; &#945; &#8712; (0, 1) only depends on &#945;.</p><p>Proof. Without loss of generality, we suppose x 2 = y 2 = z 2 = 1. We can decompose y as ax + y where y is perpendicular to x. We can decompose z as b 1 x + b 2 y / y 2 + z where z is perpendicular to both x and y . Then we have:</p><p>where the last inequality follows from 0</p><p>. Thus, if we set</p><p>&#946; should be strictly larger than &#945; + 1&#946; 2 , and the gap only depends on &#945;.</p><p>Lemma 10. Give x &#8712; R m , let y &#8712; R m be a random vector, where each entry of y is an i.i.d. sample drawn from the standard Gaussian distribution N (0, 1). Given &#946; &#8712; (0.5, 1),</p><p>Proof. Without loss of generality, we can assume x 2 = 1. Let y = y/ y 2 . Since each entry of y is an i.i.d. Gaussian variable, y is a random vector drawn uniformly from a unit sphere. Notice that if x, y &#8805; &#946;, then x - According to Lemma 6, there is an</p><p>If we put a cap centered at each point in N , then the whole unit sphere will be covered. Thus, we can conclude</p><p>Theorem 10 (A formal version of Theorem 2). Consider N data points x 1 , x 2 , &#8226; &#8226; &#8226; , x N &#8712; R m and a weight matrix W &#8712; R l&#215;m where each entry of W is an i.i.d. sample drawn from the Gaussian distribution N (0, 1/l). Suppose &#8704;i = j &#8712; [N ], x i , x j /( x i 2 x j 2 ) &#8804; &#945; for some &#945; &#8712; (0.5, 1). Fix k &#8805; 1 and &#948; &#8712; (0, 1), if l is sufficiently large, then with probability at least 1&#948;,</p><p>Proof. Notice that the scale of W and x 1 , x 2 , &#8226; &#8226; &#8226; , x N do not affect either x i , x j /( x i 2 x j 2 ) or the activation pattern. Thus, we can assume x 1 2 = x 2 2 = &#8226; &#8226; &#8226; = x N 2 = 1 and each entry of W is an i.i.d. standard Gaussian random variable.</p><p>Let</p><p>and &#949; &#945; be the same as mentioned in Lemma 9. Set &#949; and &#946; as</p><p>and let R satisfies</p><p>According to Lemma 8, if l is sufficiently large, then R is sufficiently large such that</p><p>Notice that for t &#8712; [l], W t 2 2 is a random variable with &#967; 2 m distribution. Thus, Pr[ W t 2 &#8805; (1 + &#949;)R] = &#948;/100 l . By taking union bound over all t &#8712; [l], with probability at least 1&#948;/100, &#8704;t &#8712; [l], W t 2 &#8804; (1 + &#949;)R. In the remaining of the proof, we will condition on that &#8704;t &#8712;</p><p>Due to Lemma 9, we have</p><p>Thus,</p><p>Notice that for i &#8712; [N ], t &#8712; [l], we have</p><p>By Chernoff bound, with probability at least 1&#948;/(100N ),</p><p>By taking union bound over i &#8712; [N ], with probability at least 1&#948;/100, &#8704;i &#8712; [N ],</p><p>we have W t x j &lt; &#946; R which implies that t &#8712; A(W x j ). Thus, with probability at least 1&#948;/50 &#8805; 1&#948; probability, &#8704;i = j, A(W</p><p>R and a weight matrix W &#8712; R l&#215;m where each entry of W is an i.i.d. sample drawn from the Gaussian distribution N (0, 1/l). Suppose &#8704;i = j &#8712; [N ], x i , x j /( x i 2 x j 2 ) &#8804; &#945; for some &#945; &#8712; (0.5, 1). Fix k &#8805; 1 and &#948; &#8712; (0, 1), if l is sufficiently large, then with probability at least 1&#948;, there exists a vector</p><p>Proof. Due to Theorem 10, with probability at least 1&#948;, &#8704;i = j, A(W</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D ADDITIONAL EXPERIMENTAL RESULTS</head><p>This section presents details of our experiment settings and additional results for evaluating and empirically understanding the robustness of k-WTA networks.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.1 EXPERIMENT SETTINGS</head><p>First, we describe the details of setting up the experiments described in Sec. 4. To compare k-WTA networks with their ReLU counterparts, we replace all ReLU activations in a network with k-WTA activation, while retaining all other modules (such as BatchNorm, Convolution, and pooling). To test on different network architectures, including ResNet18, DenseNet121, and Wide ResNet, we use the standard implementations that are publicly available<ref type="foot">foot_2</ref> . All experiments are conducted using PyTorch framework.</p><p>Training setups. We follow the same training procedure on CIFAR-10 and SVHN datasets. All the ReLU networks are trained with stochastic gradient descent (SGD) method with momentum=0.9. We use a learning rate 0.1 from the first to 50-th epoch and 0.01 from 50-th to 80-th epoch. To compare with ReLU networks, the k-WTA networks are trained in the same way as ReLU networks. All networks are trained with a batch size of 256. For k-WTA networks with a sparsity ratio &#947; = 0.1, when adversarial training is not used, we train them (recall in Sec. 2.2). starting with &#947; = 0.2 for 50 epochs with SGD (using learning rate=0.1, momentum=0.9) and then decreasing &#947; by 0.005 every 2 epochs until &#947; reaches 0.1. When adversarial training is enabled, we use untargeted PGD attack with 8 iterations to construct adversarial examples. To train networks with TRADES <ref type="bibr">(Zhang et al., 2019)</ref>, we use the implementation of its original paper<ref type="foot">foot_3</ref> with the parameter 1/&#955; = 6, a value that reportedly leads to the best robustness according to the paper. To train networks with the free adversarial training method <ref type="bibr">(Shafahi et al., 2019b)</ref>, we implement the training algorithm by following the original paper. We set the parameter m = 8 as suggested in the paper.</p><p>Attack setups. All attacks are evaluated under the &#8734; metric, with perturbation size = 0.031 (CIFAR-10) and 0.047 (SVHN) for pixels ranging in [0, 1]. We use Foolbox <ref type="bibr">(Rauber et al., 2017)</ref>, a third-party toolbox for evaluating adversarial robustness. We use the following setups for generating adversarial examples in various attack methods: For PGD attack, we use 40 iterations with random start, the step size is 0.003. For C&amp;W attack, we set the binary search step to 5, maximum number of iterations to 20, learning rate to 0.01, and initial constant to 0.01. For Deepfool, we use 20 steps and 10 sub-samples in its configuration. For momentum attack, we set the step size to 0.003 and number of iterations to 20. All other parameters are set by Foolbox to be its default values.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.2 EFFICACY OF INCREMENTAL TRAINING</head><p>We now report additional experiments to demonstrate the efficacy of the incremental fine-tuning method (described in Sec. 2.2). As shown in Figure <ref type="figure">6</ref> and described its caption, models trained with incremental fine-tuning (denoted as w/ FT in the plots' legend) performs better in terms of both standard accuracy (denoted as std in the plots' legend) and robust accuracy (denoted as Rob in the plots) when the k-WTA sparsity &#947; &lt; 0.2, suggesting that fine-tuning is worthwhile when &#947; is small.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.3 ADDITIONAL RESULTS ON CIFAR-10</head><p>Tests on different network architectures. We evaluate the robustness of k-WTA on different network architectures, including ResNet-18, DenseNet-121 and WideResNet-22-10. The results are reported in Table <ref type="table">2</ref>, where similar to the notation used in   <ref type="table">3</ref>) as ReLU, k-WTA-0.1, ReLU (AT), and k-WTA-0.1 (AT). We then launch transfer attacks across each pair of models. We also consider by-far the strongest black-box attack (according to <ref type="bibr">Papernot et al. (2017)</ref>): for the same model, for example, a k-WTA-0.1 network optimized by adversarial training, we train two independent versions, each with a different random initialization, and apply the transfer attacks across the two versions.</p><p>The results are reported in Table <ref type="table">3</ref>, where each row corresponds to a target (attacked) model, and each column corresponds to a source model from which the adversarial examples are generated. On the diagonal line of Table <ref type="table">3</ref>, each entry corresponds to the robustness under aforementioned transfer attacks across the two versions of the same models.</p><p>The results suggest that 1) it is more difficult to transfer attack k-WTA networks than ReLU networks using adversarial examples from other models, and 2) it is also more difficult to use adversarial examples of a k-WTA network to attack other models. In a sense, the adversarial examples of a k-WTA network tend to be "disjoint" from the adversarial examples of a ReLU network, despite their architectural similarity. Inspecting the diagonal entries of Table <ref type="table">3</ref>, we also find that k-WTA networks are more robust than their ReLU counterparts under the strongest black-box attack <ref type="bibr">(Papernot et al., 2017)</ref> (i.e., transfer attacks across two different versions of the same model).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.4 MNIST RESULTS</head><p>On MNIST dataset, we conduct experiments with an adversarial perturbation size =0.3 for pixels ranging in [0, 1]. We use Stochastic Gradient Descent (SGD) with learning rate=0.01 and momen-tum=0.9 to train a 3-layer CNN. The training takes 20 epochs for all the methods we evaluate. The robust accuracy are evaluated under PGD attacks that take 20 iterations with random initialization and a step size of 0.03. The results are summarized in Table <ref type="table">4</ref>. Again, k-WTA activation consistently improves robustness under all different training methods. Even with natural (non-adversarial) training, the resulting k-WTA network still has 62.2% robust accuracy, significantly outperforming ReLU network.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.5 ROBUSTNESS WITH RESPECT TO NATURAL PERTURBATIONS</head><p>We also evaluate the robustness of k-WTA networks under (non-adversarial) natural perturbations. We evaluated various types of perturbations, including adding Gaussian noise to the input image (std=0.05/0.1), random translation (maximum 5 pixel), random rotation (maximum 10 degrees) and color jittering (i.e., randomly changing the brightness, contrast and saturation of an image, with a maximum perturbation of 0.4), following <ref type="bibr">Hendrycks &amp; Dietterich (2019)</ref>. The results are summerized in Table <ref type="table">5</ref>, in which all models are ResNet18. We found that under all the tested perturbations, the accuracy drops in k-WTA networks are no worse than those in ReLU networks. Note that in these tests, all our models are trained with standard data augmentations (e.g., random crop and random flip); they are not specifically trained to avert the tested perturbations.</p><p>We also highlight an interesting finding here. Adding Gaussian noise leads to a large accuracy drop (e.g., from 92.9% to 69.7%/27.0% as shown in the table) on naturally trained ReLU network, but in k-WTA networks (especially k-WTA-0.1), the corresponding accuracy drop is much smaller (e.g., from 89.3% to 80.2%/50.9%). We conjecture that the dense discontinuities in k-WTA networks (recall Figure <ref type="figure">5</ref>) effectively add noise to the input distribution, thus making the model more robust against input noise.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D.6 LOSS LANDSCAPE VISUALIZATION</head><p>In addition to the experiments shown in Figure <ref type="figure">5</ref> and Sec. 4.3 of the main text, we further we visualize the loss landscapes of k-WTA networks when different sparsity ratios &#947; are used. The plots are shown in Figure <ref type="figure">7</ref>, produced in the same way as Figure <ref type="figure">5</ref> described in Sec. 4.3.</p><p>As analyzed in Sec. 3, a larger &#947; tends to smooth the loss surface of the k-WTA network with respect to the input, while a smaller &#947; renders the loss surface more discontinuous and "spiky". In addition, adversarial training tends to reduce the range of the loss values-a similar phenomenon in ReLU networks has already been reported <ref type="bibr">Madry et al. (2017);</ref><ref type="bibr">Tram&#232;r et al. (2017)</ref>-but that does not mean that the loss surface becomes smoother; the loss surface remains spiky.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>https://github.com/a554b554/kWTA-Activation</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>In this paper, we use k-WTA to refer our activation function, while using KWTA to refer the original boolean version by<ref type="bibr">Majani et al. (1989)</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2"><p>https://github.com/kuangliu/pytorch-cifar</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3"><p>https://github.com/yaodongyu/TRADES</p></note>
		</body>
		</text>
</TEI>
