On improving deep learning generalization with adaptive sparse connectivity
Shiwei Liu Decebal Constantin Mocanu Mykola Pechenizkiy


[


On improving deep learning generalization with adaptive sparse connectivity

















Shiwei Liuto
Decebal Constantin Mocanuto
Mykola Pechenizkiyto



toDepartment of Mathematics and Computer Science, Eindhoven University of Technology, Eindhoven, Netherlands

Shiwei Lius.liu3@tue.nl





Machine Learning, ICML

0.3in
]









  



Large neural networks are very successful in various tasks. However, with limited data, the generalization capabilities of deep neural networks are also very limited. In this paper, we empirically start showing that intrinsically sparse neural networks with adaptive sparse connectivity, which by design have a strict parameter budget during the training phase, have better generalization capabilities than their fully-connected counterparts. Besides this, we propose a new technique to train these sparse models by combining the Sparse Evolutionary Training (SET) procedure with neurons pruning. Operated on MultiLayer Perceptron (MLP) and tested on 15 datasets, our proposed technique zeros out around 50% of the hidden neurons during training, while having a linear number of parameters to optimize with respect to the number of neurons. The results show a competitive classification and generalization performance. 




§ INTRODUCTION



In spite of the good performance of deep neural networks, they encounter generalization issues and overfitting problems, especially when the amount of parameters is much higher than the amount of training examples. While, understanding this trade-off is an open research question, fortunately, various works have been proposed to handle this problem including, implicit norm regularization <cit.>, Two-Stage Training Process <cit.>, dropout <cit.>, Batch normalization <cit.>, etc. Recently, many complexity measures have emerged to understand what drives generalization in deep networks, such as sharpness <cit.>, PAC-Bayes <cit.> and margin-based measures <cit.>. <cit.> analyze different complexity measures and demonstrate that the combination of some of these measures seems to capture better neural networks generalization behavior. 

On the other side, the ability of sparse neural networks to reduce the number of parameters can dramatically shrink the model size and, therefore, relieve overfitting. However, the traditional algorithms to train such networks, make use of an initial fully-connected network which is trained first. Further on, the unimportant connections in this network are pruned using various techniques, e.g. <cit.> to obtain a sparse topology. The initial fully-connected network is a critical point hindering neural networks scalability due to its quadratic number of (many unnecessary) parameters with respect to its number of neurons.  To address this issue, <cit.> have proposed a new class of models, i.e.  intrinsically sparse neural networks with adaptive sparse connectivity. These models have a linear number of parameters with respect to the number of neurons, don't require an initial fully-connected network, and can be trained with the Sparse Evolutionary Training (SET) procedure.

In this paper, we introduce a new improvement to SET, dubbed SET with Neurons Pruning (NPSET), to further reduce the number of hidden neurons and parameters. Our approach is able to identify and eliminate a large number of non-informative hidden neurons and their accompanying connections by applying neurons pruning to the SET procedure. Same as SET, NPSET starts with a sparse topology, thus having a clear advantage over the state-of-the-art methods which start from fully connected topologies. The experimental results show that the removal of the hidden layer neurons with very few output connections allows NPSET to further reduce computational costs in both phases (training and inference). Moreover, we show that intrinsically sparse MLPs trained with both, SET or NPSET, have higher generalization ability than their fully-connected counterparts.



§ RELATED WORK


Inspired by Darwinian theory, Sparse Evolutionary Training (SET) <cit.> is a simple but efficient training method which enables an initially sparse topology of bipartite layers of neurons to evolve towards a scale-free topology, while learning to fit the data characteristics. After each training epoch, the connections having weights closest to zero are removed (magnitude based removal). After that, new connections (in the same  amount as the removed ones) are randomly added to the network. This offers benefits in both, computational time (pronounced faster training and testing time in comparison with fully connected bipartite layers) and quadratically lower memory requirements. The interested reader is referred to <cit.> for a detailed discussion, and to <cit.> for further developments and analyses on it.



§ METHODS

In this section, we detail our proposed method (NPSET).



 §.§ Why Neurons Pruning.

The sparse topology allows SET to create MultiLayer Perceptrons with hundreds of thousands of neurons <cit.>, which guarantees their ability to represent all sorts of features and approximate function to tackle different problems. However, such a large number of neurons is also a double-edged sword which can lead to significant redundancy. For example, in the case of CIFAR10 dataset whose features number is 3072, the neurons number of the first hidden layer is 4000 in <cit.>. Obviously, not all neurons can provide important information to outputs. To prove this, we test whether removing hidden neurons which have the least output connections will decrease the performance. Figure <ref> shows the influence of removing neurons from the first hidden layer for Lung-discrete dataset (due to the space limitation, we only give one dataset). It can be observed that the model maintains or even improves its accuracy after removing these unimportant neurons. In order to remove these non-informative neurons, at the beginning of each training epoch, we remove a certain fraction α of hidden neurons that have the smallest numbers of connections. Thus, with a large probability they will not have a notable impact on the model performance. 



 §.§ Where to Start Pruning.

The initial network topology generated by SET is randomly sparse and does not provide any specific information. Thus, pruning neurons at the beginning may eliminate significant neurons forever, along with a serious damage to performance. It is best to start applying neurons pruning after a certain number β of epochs rather than removing neurons from the beginning. After evolving in the first β epochs, the network has already learned how to identify and retain important connections, while the evolved neurons connectivity provides a helpful guidance to identify non-important neurons.



 §.§ How Many Epochs to Prune.

It is the fact that if we prune neurons in each epoch, the final number of neurons would be too small to keep a good accuracy. On the other hand, if we only prune neurons for several epochs, the number of removed neurons would be too trivial to decrease the computation. To preserve the good performance, we only apply neurons pruning for γ epochs, after which the SET procedure continues normally.



§ EXPERIMENTS AND RESULTS


We evaluated the proposed NPSET[The code of NPSET is built based on the source code of SET < https://github.com/dcmocanu/sparse-evolutionary-artificial-neural-networks>.] method by training sparse MLPs from scratch on 15 classification datasets with limited amount of samples and many input features, as detailed in Table <ref>. All datasets can be retrieved from Arizona State University open-source repository[<http://featureselection.asu.edu/index.php>.].
In order to understand the NPSET performance better, we compare it against five methods: (1) SET-MLP <cit.>, (2) 1^st NPSET-MLP where only neurons of the first hidden layer are pruned, (3) 2^nd NPSET-MLP where only neurons of the second hidden layer are pruned, 
(4) Direct SET-MLP, directly trained SET-MLP having the same hidden layer sizes as NPSET-MLP after neurons pruning. (5) Direct FC-MLP, directly trained FC-MLP having the same hidden layer sizes as NPSET-MLP after neurons pruning. All models used in this paper have two hidden layers, and ReLU activation function. We trained NPSET-MLP on a python implementation of fully connected MLPs[<https://github.com/ritchie46/vanilla-machine-learning>.], as the SET-MLP implementation was also built on top of this code, guaranteeing the validity of the comparison in this paper. Since our new method is an improvement over SET, we used SET-MLP as the baseline for experiments. All these methods are trained from scratch. 

To find the most suitable hyperparameters values, we performed a small random search experiment. This showed α = 0.04, β = 10 and γ = 40 are safe choices that not only removed the non-informative neurons, but also lead NPSET-MLP to have better performance.

The maximum accuracies of all 6 models for each dataset are shown in Table <ref>. From Table <ref>, we can observe that, compared with SET-MLP, NPSET-MLP improves the peak accuracy on 8 datasets, while both models reach better accuracy than their fully-connected counterpart. 


Table <ref> shows the compression rates, the numbers of parameters and neurons on 15 datasets for SET-MLP and NPSET-MLP. It worths noting that applying iterative neurons pruning to SET-MLP further increases the compression rate by 6 to 7 times.

To start understanding better the generalization capabilities of SET-MLP and NPSET-MLP, we performed an extra experiment by comparing them with a Dense-MLP (a FC-MLP having the same amount of hidden neurons as SET-MLP). Figure <ref> shows their learning curves and visualizes their generalization capabilities on 4 datasets (we limited the number of datasets due to space constraints). All three models are trained without any explicit regularization methods e.g. dropout, L1 and L2 Regularization, etc. We can see that the gap between the training and test accuracies of NPSET-MLP and SET-MLP is smaller than for Dense-MLP. Perhaps, the most interesting behavior is on the Yale dataset on which Dense-MLP presents perfect overfitting (e.g. zero loss, 100% classification accuracy). Contrary, the implicit regularization made by connections addition and removal in SET-MLP and NPSET-MLP don't let these models to perfectly overfit on the training data and enables them better generalization. 



§ CONCLUSION


In this paper we  propose a new method, i.e. NPSET, to enhance the Sparse Training Evolutionary procedure with Neurons Pruning. NPSET trains efficiently intrinsically sparse MLPs, in a number of cases achieving better classification accuracy than SET, while leading to a smaller amount of parameters. This is highly desirable to enhance neural networks scalability. Moreover, the experimental results demonstrate that both methods, SET and NPSET, can train intrinsically sparse MLPs with adaptive sparse connectivity to have higher generalization capabilities than their fully-connected counterparts.

This study is limited in its purpose. E.g., we focus just on MLP which even if can be one of the most used model in real-world applications (it represents 61% of a typical Google TPU (Tensor Processing Unit) workload <cit.>), it does not represent all neural network models. Consequently, there are many future research directions, e.g. analyze the methods performance on much larger tabular datasets, or on other types of neural networks models (e.g. convolutional neural networks). Among all of these, the most interesting research direction would be to understand why and when intrinsically sparse neural networks with adaptive sparse connectivity can generalize better than their fully-connected counterparts.






icml2019


