Deep neural networks (Krizhevsky et al., 2012; Hinton & Salakhutdinov, 2006; LeCun et al., 2015) has made great progress on different domains and applications in recent years. The community has witnessed the machine trained with deep networks and massive data being the first computer program defeating a European professional in the game of Go (Silver et al., 2016)
; the convolutional neural network surpassing human-level performance in image classification(He et al., 2015); the deep neural network framework to build an acoustic model in speech recognition (Hinton et al., 2012).
The importance of activation function has been recognized in the design of deep models. It not only fits complex data distributions but also achieves important invariance to various noise, data corruption and transforms affecting recognition(Bruna & Mallat, 2013). It is placed after every convolution layer with sigmoid or hyperbolic tangent as non-linear activation. If the input responses are too large positively or negatively, they are compressed to a saturation value through the nonlinear mapping and thus invariance is achieved. The rectified linear unit (ReLU) is found to be particularly effective (Nair & Hinton, 2010; Krizhevsky et al., 2012) in deep neural networks and widely used. It separates noisy signals and informative signals in a feature map by learning a threshold (bias). Certain amount of information is discarded after the non-linear activation. However, ReLU also has limitation because of the observations.
Given the same convolution kernel in the convolution layer, we observe that different magnitudes of responses may indicate different patterns. An illustrative example is shown in Figure 1. The eyes should have higher magnitudes in the responses to curved edges compared with those on the mouth because edge contrast on eyes is generally higher than that on mouths. Therefore, it is desirable to separate the responses according to its magnitude.
More importantly, the separation between informative signal and noise not only depends on the magnitudes of responses, but also the context of how the feature responses would be used to detect more abstract patterns in higher layers. In the hierarchical representations of deep neural networks, a pattern detected at the current layer serves as a sub-pattern to be combined into a more abstract pattern in its subsequent layers. For example, curved edges in Figure 1 are detected in the current layer and one of filters in its subsequent layer detects eyes. It requires high response of curved edges and treat the response with moderate magnitude as noise. However, for another filter in its subsequent layer to detect mouth, moderate responses are enough.
Unfortunately, if feature responses with ReLU module are removed by thresholding, they cannot be recovered. A single thresholding cannot serve for multiple purposes. In order to output multiple response maps with magnitudes in different ranges for a particular visual pattern, networks employing ReLU have to learn multiple redundant filters. A set of redundant filters learn similar convolution kernels but distinct bias terms. It unnecessarily increases the computation cost and model complexity, and is easier to overfit training data.
Many delicate activation functions have been proposed to increase the flexibility of nonlinear function. Parametric ReLU (He et al., 2015) generalizes Leaky ReLU (Mass et al., 2010) by learning the slope of the negative input, which yields an impressive learning behavior on large-scale image classification benchmark. Other variants in the ReLU family include Randomized Leaky ReLU (Xu et al., 2015) where the slope of the negative input is randomly sampled, and Exponential Linear Unit (Clevert et al., 2015) which has an exponential shape in the negative part and ensures a noise-robust deactivation state. Although these variants can reweight feature responses whose magnitudes are in different ranges, they cannot separate them into different feature maps.
As summarized in Figure 2, given a feature map as input, non-linear activation ReLU and its variants only output a single feature map. However, the MBA module outputs multiple feature maps without having to learn as many kernels as does ReLU. In some sense, our idea is opposite to the maxout network (Goodfellow et al., 2013). Maxout is also a non-linear activation. However, given feature maps generated by convolution kernels, it combines them to a single feature map:
where is an image, is a convolution kernel, and is a bias. The motivations of MBA and maxout are different and can be jointly used in the network design to balance the number of feature maps.
To this end, we propose a multi-bias non-linear activation (MBA) layer for deep neural networks. It decouples a feature map obtained from a convolution kernel to multiple maps, called band maps, according to the magnitudes of responses. This is implemented by introducing different biases, which share the same convolution kernel, imposed on the feature maps and then followed by the standard ReLU. Each decoupled band map corresponds to a range in the response magnitudes to a convolution kernel, and the range is learned. The responses in different magnitude ranges in the current layer are selected and combined in a flexible way by each filter in the subsequent layer. We provide analysis on the effect of the MBA module when taking its subsequent layer into account. Moreover, it is shown that the piece-wise linear activation function (Agostinelli et al., 2015) is a special case of MBA, where MBA provides more flexibility in decoupling the magnitudes and also in combining band maps from different convolution kernels. Finally, The experimental results on the CIFAR and SVHN datasets show that such a simple and yet effective algorithm can achieve state-of-the-art performance.
2 Multi-bias Non-linear Activation
The goal of this work is to decouple a feature map into multiple band maps by introducing a MBA layer, thus enforcing different thresholds on the same signal where in some cases responses in a certain range carry useful patterns and in another case they are merely noise. After passing through ReLU, these band maps are selected and combined by the filters in the subsequent convolution to represent more abstract visual patterns with large diversity.
2.1 Model formulation
Fig.3 (a) depicts the pipeline of the MBA module. After convolution in CNN, we obtain a set of feature maps. We represent the
-th feature map by vector, where , and denote the spatial width and height of the feature map, respectively. If the input of the MBA layer is the response obtained by a fully-connected layer, we can simply treat . The MBA layer separates into feature maps as follows:
where is the element-wise nonlinear function. Note that the only parameter introduced by the MBA module is a scalar . Denote and as the -th element in the map and respectively, where , we have the element-wise output form of the MBA module defined as:
In this paper, we mainly consider using ReLU as the nonlinear function because it is found to be successful in many applications. In ReLU, the response is thresholded by the bias as follows:
2.2 MBA with its subsequent convolutional layer
The output of the MBA module is a set of maps . These maps are then linearly combined by its subsequent convolutional layer into as follows:
where and is the representation of convolution by matrix multiplication. Denote the -th element in by , we have
where and take the forms of:
here is an intermediate variable to generate the coefficient . The formulation in (8) shows that the element in the feature map is separated by multiple biases to obtain multiple ReLU functions , and then these ReLU functions are linearly combined by the weights to obtain , which serves as the decoupled pattern in the MBA layer for the -th channel in the next convolutional layer at location . The -th element in h, i.e., is a weighted sum of as shown in (6). Therefore, the key is to study the mapping at location in an input feature map to at location in an output feature map in (8). Such a mapping is across feature channels and locations. (8) can be defined as a mapping function . There is a large set of such mapping functions which are characterized by parameters and . In the following discussion, we skip the subscripts to be concise.
We show the learned parameters of and for the input and the decoupled pattern in Figure 4. Specifically, Fig.4 (a) approximates the ReLU unit where is the base along the first axis in a 4-dimension space; Fig.4 (b) displays the property of leaky ReLU (Xu et al., 2015) to allow gradient back-propagation around small negative input; moreover, it has a steeper slope in the positive region than ReLU, which makes the training process faster. Fig.4 (c) stimulates the case where the activation function serves as a sigmoid non-linearity, i.e.
, only allowing small values around zero to backpropagate the gradients. The non-linear activation function in Fig.4 (d) forms a trapezoid-shaped and serves as the histogram bin ‘collector’ - only selecting the input within a small range and shuttering all the other activations outside the range. Note that the mapping is concave due to the negative values of when , in which case neither the standard ReLU nor APL unit could describe. In addition, the second and third rows of Figure 4 show more examples of the mappings decomposed from parameters in the convolution layer, from which we can see a wide diversity of patterns captured by the multi-bias mechanism to decouple the signal strength and the cross-channel sharing scheme to combine visual representations in a much more flexible way.
Figure 5 shows the histogram of response magnitudes in the input feature map before feeding into the MBA module. We adopt the architecture of model in Table 2 on CIFAR-10 to obtain the distribution result, where we randomly select 1,000 samples to get the average activations over all the MBA output. The histogram distributes around zero, which indicates the learned pattern or mapping affects the neurons only in a small range near zero.
2.3 Relationship with piecewise-linear functions
To see further the advantage of our algorithm, we compare our MBA layer with the recently proposed method called adaptive piecewise linear function unit (APL) (Agostinelli et al., 2015). It formulates the activation function as a sum of hinge-shaped functions. Fig.3 (b) describes the pipeline of the APL module. Given the feature map , it generates the output from piecewise linear functions from each element in as follows:
where are learnable parameters to control the shape of the non-linearity function. Then the subsequent convolutional layer computes the weighted sum of ‘piece-wise-linearized’ maps to have the output of channel at location as follows:
where is the parameters of the subsequent convolution kernel and we define
in a similar derivation through (4) to (6). It is obviously seen that APL represented in (10) is a special case of MBA by enforcing in (8). Therefore, for different target channel with index and , the piecewise-linear function provides the same while MBA provides different . Take again the case in Figure 1 for instance, the output channel for eyes requires with high magnitude while for mouth requires with low magnitude. This kind of requirement cannot be met by APL but can be met by our MBA. This is because our MBA can separate single into different for different according to the magnitude of while APL cannot.
A closer look at the difference between our algorithm and the APL unit is through the two diagrams in Figure 3. When an input feature map is decoupled into multiple band maps after the biasing process, APL only recombines band maps from the same input feature map to generate one output. However, MBA concatenates band maps across different input maps and allows to select and combine them in a flexible way, thus generating a much richer set of maps (patterns) than does the APL.
|Shallow network: 32-64-128-1024-1024|
|Deep network: ---1024-1024|
Table 1 shows the investigation breakdown on MNIST and CIFAR-10 when comparing MBA with APL and vanilla neural networks111 We do not use the tricks presented in APL (Agostinelli et al., 2015), for example, changing the dropout ratio or adding them before certain pooling layer.
. Here we adopt two types of network: the shallow one has three convolutional layers with the number of output 32, 64, 128, respectively and two fully connected layers which both have an output neurons of 1024; the deep one has nine convolutional layers divided into three stacks with each stack having the same number of output 32, 64, 128 and two fully connected layers. All convolutional layers have the same kernel size of 3 and we use max pooling of size 2, stride 2, at the end of each convolution or stack layer. Also we keep training parameters the same across models within each architecture to exclude external factors.
The number of parameters in each setting of Table 1 does not count those in the fully connected layers and we can compare the computational cost of MBA, APL and vanilla net quantitatively. Take the deep architecture case for example, the vanilla network has about k parameters with the designated structure; by applying the MBA module on it, the additional parameters are (a) the increasing channels of kernels in each subsequent layer, i.e., , where is the kernel size; and (b) a small fraction of the bias term, . Therefore we have a computational cost of . However, if we force the vanilla model to have the same output maps to be fed into the subsequent layers (models denoted as ‘@4x’), there has to be more maps coming from the convolutional kernel in the current layer. As mentioned in Section 1, such a scheme would increase the parameter overhead of kernels to a great extent. That is approximately times the size of the MBA module (in this case, M vs M).
Several remarks can be drawn from Table 1
. First, both MBA and APL modules imposed on the vanilla net can reduce test errors. Second, as the number of feature maps increases, vanilla networks can further boost the performance. However, it is less inferior compared with the MBA module (0.42% vs 0.31% on MNIST) where the latter has a much smaller set of parameters. Third, the piecewise linear function does not perform well compared with the proposed method, even though it has the same network width (APL@4x) or similar parameters (APL@same, by changing the output number of feature maps) as in the MBA model. This is probably due to the limited expressive power, or inferior ability of feature representation in (11). Therefore, these observations further proves the importance of applying the MBA module to separate the responses of various signals and feed the across-channel information into the next layer in a simple way, instead of buying more convolutional kernels.
3 Experimental results
We evaluate the proposed MBA module and compare with other state-of-the-arts on several benchmarks. The CIFAR-10 dataset (Krizhevsky & Hinton, 2009) consists of color images on 10 classes and is divided into 50,000 training images and 10,000 testing images. The CIFAR-100 dataset has the same size and format as CIFAR-10, but contains 100 classes, with only one tenth as many labeled examples per class. The SVHN (Netzer et al., 2011) dataset resembles MNIST and consists of color images of house numbers captured by Google street view. We use the seoncd format of the dataset where each image is of size
and the task is to classify the digit in the center. Additional digits may appear beside it and must be ignored. All images are preprocessed by subtracting each pixel value by the mean computed from the corresponding training set. We follow a similar split-up of the validation set from the training set as(Goodfellow et al., 2013), where one tenth of samples per class from the training set on CIFAR, and 400 plus 200 samples per class from the training and the extra set on SVHN, are selected to build a validation set.
3.1 Implementation Details
Our baseline network has three stacks of convolutional layers with each stack containing three convolutional layers, resulting in a total number of nine layers. Each stack has [96-96-96], [128-128-128] and [256-256-512] filters, respectively. The kernel size is
and padded bypixel on each side with stride for all convolutional layers. At the end of each convolutional stack is a max-pooling operation with kernel and stride size of 2. The two fully connected layers have 2048 neurons each. We also apply dropout with ratio after each fully connected layers. The final layer is a softmax classification layer.
The optimal training hyperparameters are determined on each validation set. We set the momentum as 0.9 and the weight decay to be 0.005. The base learning rate is set to be
, respectively. We drop the learning rate by 10% around every 40 epoches in a continuous exponential way and stop to decrease the learning rate until it reaches a minimum value (). For the CIFAR-100 and SVHN datasets, we use a slightly longer cycle of 50 epoches to drop the rate by 10%. The whole training process takes around 100, 150, and 150 epoches on three benchmarks. We use the hyperparameter for the MBA module and the mini-batch size of or . We do not carefully cross-validate the initialized biases in the MBA module to find the optimal settings but simply choose a set of constants to differentiate the initial biases.
3.2 Ablation Study
First, we explicitly explore the ability of the MBA module in CNN with different numbers of channels in each layer. From Table 2 we conclude that adding more MBA layers into the network generally reduces the classification error. Also, the width of the network, i.e., the number of filters in each stack, plays an important role to reduce the classification error. Considering models #4-#6, we can see that larger number of filters results in more expressive power the network and thus smaller classification error. It can be observed that the use of more MBA layers in model #6 performs better than the use of fewer MBA layers in model #3. However, the MBA module imposed on all stacks does not perform better than the one imposed on stack 2 and 3 only. This result shows that it is not necessary to use the MBA layer for lower convolutional layers that are close to raw data. Moreover, the improvement of our method does not come from introducing more parameters. For example, model #5 has much fewer parameters than the baseline and it still outperforms the baseline.
Second, we investigate the effect of the hyperparameter in the MBA module (Table 3), which is conducted on the CIFAR-10 validation set. In the MBA layer, a channel is decoupled to channels. We can observe that the inclusion of MBA layer on the network reduces the classification error when and . To further validate the necessity of the learnable biases, we fix the bias parameters after initialization. In this case, the validation error increases from for learned bias to for fixed bias. Moreover, we find that setting a large does not reduce the classification error further compared with because it is not necessary to decouple a single channel into too many channels.
3.3 Comparison to State-of-the-Arts
|Without Data Augmentation|
|ReLU (Srivastava et al., 2014)||12.61%||37.20%|
|Channel-out (Wang & JaJa, 2013)||13.20%||36.59%|
|Maxout (Goodfellow et al., 2013)||11.68%||38.57%|
|NIN (Lin et al., 2014)||10.41%||35.68%|
|DSN (Lee et al., 2014)||9.78%||34.57%|
|APL (Agostinelli et al., 2015)||9.59%||34.40%|
|With Data Augmentation|
|Maxout (Goodfellow et al., 2013)||9.38%||-|
|DropConnect (Wan et al., 2013)||9.32%||-|
|SelAtten (Stollenga et al., 2014)||9.22%||33.78%|
|NIN (Lin et al., 2014)||8.81%||-|
|DSN (Lee et al., 2014)||8.22%||-|
|APL (Agostinelli et al., 2015)||7.51%||30.83%|
|BayesNet (Snoek et al., 2015)||6.37%||27.40%|
|ELU (Clevert et al., 2015)||6.55%||24.28%|
We show the comparison results of the proposed MBA with other state-of-the-arts, including ReLU (Srivastava et al., 2014), Channel-out (Wang & JaJa, 2013), Maxout (Goodfellow et al., 2013), Network in Network (NIN) (Lin et al., 2014), Deep Supervision (DSN) (Lee et al., 2014), APL (Agostinelli et al., 2015), DropConnect (Wan et al., 2013)
, Selective Attention Model(Stollenga et al., 2014), Scalable Bayes Network (Snoek et al., 2015) and Exponential Linear Unit (Clevert et al., 2015) on the CIFAR and SVHN datasets. We will use the network architecture of candidate model #6 as the final MBA model thereafter.
CIFAR. Without data augmentation, Table 4 indicates that we achieve a relative and gain over previous state-of-the-arts on CIFAR-10 and CIFAR-100, respectively. As for the data augmentation version of our model, during trainin we first resize each image to a random size sampled from and then crop a region randomly out of the resized image. Horizontal flip is also adopted. For testing, we employ a multi-crop voting scheme, where crops from five corners (center, top right and left, bottom right nad left) are extracted and the final score is determined by their average. Note that we do not aggressively resort to trying all kinds of data augmentation techniques (Snoek et al., 2015), such as color channel shift, scalings, etc.; or extend the network’s depth to extremely deep, for example, ELU (Clevert et al., 2015) used a model of 18 convolutional layers. Our algorithm performs better than previous ones by an absolute reduction of and with data augmentation on these two datasets.
|StoPool (Zeiler & Fergus, 2013)||2.80%|
|ReLU (Srivastava et al., 2014)||2.55%|
|Maxout (Goodfellow et al., 2013)||2.47%|
|NIN (Lin et al., 2014)||2.35%|
|DropConnect (Wan et al., 2013)||1.94%|
|DSN (Lee et al., 2014)||1.92%|
|GenPool (Lee et al., 2015)||1.69%|
SVHN. We further conduct the comparison experiment on the house number dataset and we achieve a test error rate of 1.80% without data augmentation (Table 5).
4 Conclusion and Discussion
In this work, we propose a multi-bias non-linearity activation (MBA) module in deep neural networks. A key observation is that magnitudes of the responses from convolutional kernels have a wide diversity of pattern representations in the network, and it is not proper to discard weaker signals with single thresholding. The MBA unit placed after the feature maps helps to decouple response magnitudes to multiple maps and generates more patterns in the feature space at a low computational cost. We demonstrate that our algorithm is effective by conducting various independent component analysis as well as comparing the MBA method with other state-of-the-art network designs. Experiments show that such a design has superior performance than previous state-of-the-arts.
While the MBA layer could enrich the expressive power of the network, we believe more exploration of the discriminative features can be investigated to leverage the information hidden in the magnitude of response. Such an intuition is triggered by the fact that the non-linearity actually preserves or maintains the depth property of a network. One simple way is to divide the input feature maps, feed them into multiple non-linearities, and gather together again as the input of the subsequent convolutional layer.
- Agostinelli et al. (2015) Agostinelli, Forest, Hoffman, Matthew, Sadowski, Peter, and Baldi, Pierre. Learning Activation Functions to Improve Deep Neural Networks. In ICLR workshop, 2015.
- Bruna & Mallat (2013) Bruna, Joan and Mallat, Stephane. Invariant scattering convolution networks. IEEE Trans. Pattern Anal. Mach. Intell., 35(8):1872–1886, August 2013.
- Clevert et al. (2015) Clevert, Djork-Arne, Unterthiner, Thomas, and Hochreiter, Sepp. Fast and accurate deep network learning by exponential linear units. arXiv preprint: 1511.07289, 2015.
- Goodfellow et al. (2013) Goodfellow, Ian J., Warde-farley, David, Mirza, Mehdi, Courville, Aaron, and Bengio, Yoshua. Maxout networks. In ICML. 2013.
- He et al. (2015) He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. arXiv preprint:1502.01852, 2015.
- Hinton & Salakhutdinov (2006) Hinton, G. E. and Salakhutdinov, R. R. Reducing the dimensionality of data with neural networks. Science, 313, 2006.
- Hinton et al. (2012) Hinton, Geoffrey E., Deng, Li, Yu, Dong, Dahl, George E., Mohamed, Abdel-rahman, Jaitly, Navdeep, Senior, Andrew, Vanhoucke, Vincent, Nguyen, Patrick, Sainath, Tara N., and Kingsbury, Brian. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Process. Mag., 29(6):82–97, 2012.
- Krizhevsky & Hinton (2009) Krizhevsky, Alex and Hinton, Geoffrey. Learning multiple layers of features from tiny images. In Technical Report, 2009.
- Krizhevsky et al. (2012) Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1106–1114, 2012.
- LeCun et al. (2015) LeCun, Y., Bengio, Y., and Hinton, G. E. Deep learning. Nature, 521, 2015.
- Lee et al. (2014) Lee, Chen-Yu, Xie, Saining, Gallagher, Patrick, Zhang, Zhengyou, and Tu, Zhuowen. Deeply-supervised nets. arXiv preprint: 1409.5185, 2014.
- Lee et al. (2015) Lee, Chen-Yu, Gallagher, Patrick W., and Tu, Zhuowen. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. arXiv preprint:1509.08985, 2015.
- Lin et al. (2014) Lin, Min, Chen, Qiang, and Yan, Shuicheng. Network in network. In ICLR, 2014.
- Mass et al. (2010) Mass, Andrew L., Hannum, Awin Y., and Ng, Andew Y. Rectifier nonlinearities improve neural network acoustic models. In ICML, 2010.
Nair & Hinton (2010)
Nair, Vinod and Hinton, Geoffrey E.
Rectified linear units improve restricted boltzmann machines.In ICML, pp. 807–814, 2010.
- Netzer et al. (2011) Netzer, Yuval, Wang, Tao, Coates, Adam, Bissacco, Alessandro, Wu, Bo, and Ng, Andrew Y. Reading digits in natural images with unsupervised feature learning. In NIPS workshop, 2011.
- Silver et al. (2016) Silver, David, Huang, Aja, Maddison, Chris J., Guez, Arthur, Sifre, Laurent, van den Driessche, George, Schrittwieser, Julian, Antonoglou, Ioannis, Panneershelvam, Veda, Lanctot, Marc, Dieleman, Sander, Grewe, Dominik, Nham, John, Kalchbrenner, Nal, Sutskever, Ilya, Lillicrap, Timothy, Leach, Madeleine, Kavukcuoglu, Koray, Graepel, Thore, and Hassabis, Demis. Mastering the game of go with deep neural networks and tree search. Nature, 2016.
- Snoek et al. (2015) Snoek, Jasper, Rippel, Oren, Swersky, Kevin, Kiros, Ryan, Satish, Nadathur, Sundaram, Narayanan, Patwary, Mostofa, Prabhat, Mr, and Adams, Ryan. Scalable bayesian optimization using deep neural networks. In ICML, 2015.
- Srivastava et al. (2014) Srivastava, Nitish, Hinton, Geoffrey, Krizhevsky, Alex, Sutskever, Ilya, and Salakhutdinov, Ruslan. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014.
- Stollenga et al. (2014) Stollenga, Marijn F, Masci, Jonathan, Gomez, Faustino, and Schmidhuber, Juergen. Deep networks with internal selective attention through feedback connections. In NIPS, pp. 3545–3553. 2014.
- Wan et al. (2013) Wan, Li, Zeiler, Matthew, Zhang, Sixin, Cun, Yann Le, and Fergus, Rob. Regularization of neural networks using dropconnect. In ICML, 2013.
- Wang & JaJa (2013) Wang, Qi and JaJa, Joseph. From maxout to channel-out: Encoding information on sparse pathways. arXiv preprint: 1312.1909, 2013.
- Xu et al. (2015) Xu, Bing, Wang, Naiyan, Chen, Tianqi, and Li, Mu. Empirical evaluation of rectified activations in convolution network. arXiv preprint: 1505.00853, 2015.
- Zeiler & Fergus (2013) Zeiler, Matthew D. and Fergus, Rob. Stochastic pooling for regularization of deep convolutional neural networks. arXiv preprint:1301.3557, 2013.