Exploiting Non-Linear Redundancy for Neural Model Compression

05/28/2020
by   Muhammad A. Shah, et al.
Carnegie Mellon University
0

Deploying deep learning models, comprising of non-linear combination of millions, even billions, of parameters is challenging given the memory, power and compute constraints of the real world. This situation has led to research into model compression techniques most of which rely on suboptimal heuristics and do not consider the parameter redundancies due to linear dependence between neuron activations in overparametrized networks. In this paper, we propose a novel model compression approach based on exploitation of linear dependence, that compresses networks by elimination of entire neurons and redistribution of their activations over other neurons in a manner that is provably lossless while training. We combine this approach with an annealing algorithm that may be applied during training, or even on a trained model, and demonstrate, using popular datasets, that our method results in a reduction of up to 99% in overall network size with small loss in performance. Furthermore, we provide theoretical results showing that in overparametrized, locally linear (ReLU) neural networks where redundant features exist, and with correct hyperparameter selection, our method is indeed able to capture and suppress those dependencies.

READ FULL TEXT VIEW PDF

Authors

page 1

page 2

page 3

page 4

02/02/2020

Non-linear Neurons with Human-like Apical Dendrite Activations

In order to classify linearly non-separable data, neurons are typically ...
03/05/2021

Precise Multi-Neuron Abstractions for Neural Network Certification

Formal verification of neural networks is critical for their safe adopti...
06/15/2022

Linearity Grafting: Relaxed Neuron Pruning Helps Certifiable Robustness

Certifiable robustness is a highly desirable property for adopting deep ...
02/02/2022

Approximate Bisimulation Relations for Neural Networks and Application to Assured Neural Network Compression

In this paper, we propose a concept of approximate bisimulation relation...
06/11/2021

DECORE: Deep Compression with Reinforcement Learning

Deep learning has become an increasingly popular and powerful option for...
02/15/2021

Scaling Up Exact Neural Network Compression by ReLU Stability

We can compress a neural network while exactly preserving its underlying...
10/03/2016

Adaptive Neuron Apoptosis for Accelerating Deep Learning on Large Scale Systems

We present novel techniques to accelerate the convergence of Deep Learni...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Modern Deep Neural Networks (DNN) have pushed the state-of-the-art in many computer vision tasks including image recognition, object detection, etc. Underlying the success of DNNs, are the millions of constituent parameters and their non-linear combinations that allow DNNs to accurately model a wide variety functions over their input features. However, running inference over these massive models imposes exorbitant memory and computational costs that make deploying them at scale in the real-world with more stringent latency, compute and energy constraints, a challenging problem.

This problem is exacerbated if later models build on existing models, which are themselves very large. Often, the intermediate outputs of a pretrained image recognition model are used to encode visual information for another downstream task, such as visual question answering, image retrieval, etc. Since these intermediate outputs can be very high-dimensional, using them as features can introduce a large number of parameters to downstream models. Therefore, methods for compressing the neural models can have far reaching effects vis-a-vis their deployability and scalability.

As deep learning models make their way from research labs to real world environments, the task of making them more resource efficient has received a great deal of attention. This has given rise to a large body of work focused on compressing and/or accelerating DNNs. One of the most common techniques for compressing neural models is parameter pruning, i.e. pruning away model parameters or neurons based on some metric. Such methods have many limitations ; one of them is that the heuristic used attempts to identify ”weak” elements (with small magnitude or derivative, for instance), but parameters can be unnecessary in more ways than being small. Consider two neurons taken individually that both have large amplitude, but happen to yield identical outputs ; one of them can be pruned without loss of information, but most current pruning methods could not figure it out.

In this paper we propose a novel neural model compression technique that exploits the dependencies in the non-linear activations of the units in each layer to identify redundant units and prune them. Our technique is based on the observation model optimization can potentially converge to a point at which the outputs of several units in one layer become highly correlated, even linearly dependent, with each other, and thus, by removing one of them and adjusting the outgoing weights of the other units we can obtain a smaller model with identical outputs.

We identify redundant units by measuring the degree to which they can be predicted as a linear combination of other units in the same layer. Specifically, we learn a transformation matrix, , that best approximates an identity mapping for the activations of the units in this layer, while constraining the diagonal of to be zero. We select the units with the lowest prediction error to remove, and adjust the outgoing weights of the remaining units using the values in the corresponding columns such that input to the next layer remains the same (or is minimally perturbed). Once we have removed all the predictable units, removing any additional units will cause a reduction in model performance. We then fine-tune the model to recover the lost accuracy. In order to facilitate tuning, we use distillation [7] to bring the compressed model’s output distribution close to the uncompressed model’s output distribution raised to a high temperature.

We demonstrate the efficacy of our technique on two popular image recognition models, AlexNet[10] and VGG[20], and three popular benchmark datasets, CIFAR-10[9] and Caltech-256[4]

. We demonstrate, theoretically and empirically, that under our proposed weight readjustment scheme, the inputs to the subsequent layer are only minimally perturbed while redundant units are present. Our technique can reduce the parameters of VGG and AlexNet by more than 99% on CIFAR10 and by more than 80% on Caltech-256. Finally, we inspect the intermediate representations of the compressed models and show that the data remains cleanly separable post-compression, which suggests that the intermediate representations continue to capture rich information about the data which may be useful for transfer learning tasks.

2 Related Work

Most existing techniques for reducing the size of neural models can be grouped into three high-level categories, namely low-rank factorization, knowledge distillation and, parameter pruning. We argue that all of them have significant shortcomings. There are also methods that reduce computation while not really affecting the number of parameters in the network, such as quantization [5][17]; however these are somewhat orthogonal to the scope of this paper.

2.1 Pruning

A common pruning approach to model compression attempts to eliminate individual parameters in the network [21, 22, 12]. Many of them do so by enforcing a sparsity constraint, such as regularization, to push some parameters to , or regularization to simply keep weights small and then prune the small ones [6]. Those methods can achieve reasonable performance (up to 35x compression in [5]). One of theses methods’ main limitations however, is that their outputs take the form of sparse weight matrices, and benefiting of those in terms of computation time is not always easy in practice.

A different family of methods overcome that shortcoming by pruning out entire neurons and/or convolution filters [11, 13, 24, 16, 18]. Those methods identify weak neurons using heuristics such as activation value [8] or absolute sum of weights [11]. Fine-tuning may be used afterwards [13].

Both of these methods treat each unit independently, in that they prune the unit if that unit has little effect on the downstream computations. However, these techniques would not prune a unit whose output is significantly impacts downstream computation but is largely predicted as a linear combination of the outputs of the other units in the same layer. Such units can be pruned, and their weights distributed, to achieve lossless compression.

2.2 Matrix Factorization

Factorization-based approaches [3, 14, 23] factor the weight matrices of the neural network into multiple low-rank components which can be then used to approximate the output of the original weight matrix. Those techniques are seemingly more similar to our approach : low-rank matrices eliminate some redundancies by projecting on a subspace of smaller dimension.

The key difference is that those methods work at the weight matrix level, while we find redundancies within post-activation representations. The non-linearity of those activations is likely to create new redundancies, that escape factorization methods but that our approach can capture. However, the case of a linear activation is similar to a factorization process, and we will to some extent use it in 3 to better understand the process of weight readjustment and how it affects the error surface.

2.3 Distillation

Model compression using knowledge distillation [7] involves training a more compact student model to predict the outputs of a larger teacher model, instead of the original targets [15, 2]. Distillation, or annealing, provides an interesting angle to the compression problem, but in itself suffers from several shortcomings. First, it requires the student model to be predefined, which is a rather tedious task. By default this model would need to be trained from scratch. Finally, this process relies solely on the extra supervision of the teacher model to overcome the challenges of training a less overparametrized model, with complex error surfaces ; this seems sub-optimal.

On the contrary, distillation can become very useful as a complementary compression tool. Assuming a compression method induces some drop in performance in the smaller model, a short amount of fine-tuning may boost its performance, and using knowledge distillation from the original model at that step can speed up that process. We make use of distillation in such a manner, in an iterative fashion, and discuss it in 4.1

3 Lossless redundancy elimination : formalism and justification

3.1 Notations and task definition

Throughout the paper, we consider a feed-forward neural network

where is the k-th dense or convolutional (which is dense with shared parameters) layer and is the following activation, in the largest sense. For example may involve a pooling, or a softmax operator in the case of . The weight matrix of is , of size . Depending on the nature of , and may be different ; however, to alleviate notations later on, we will consider that which does not induce a loss of generality in our algorithms.

For a given input vector

, sampled from data distribution we define the intermediate representations (activations) and (pre-activation), such that

Our goal is to eliminate redundancies within the activations of a given layer. To do so, we consider for each activation the task of predicting it as a linear combination of the neighbouring activations . Solving that task, evaluated with the norm, amounts to solving the following problem :

3.2 Expression of the matrix

Let us find the expression of redundancy matrix .

We start by simplifying the problem’s formulation. Rewriting the objective ( being the ith row vector in matrix ), elements of of different rows are clearly uncoupled both in the objective and the constraint. We can therefore solve that problem row-wise. Writing , we must solve problems of the form

.

Define

where is ’s correlation matrix, which is positive semidefinite. Let’s consider only the non-degenerate case where it is positive definite. is convex (of hessian , so the zeros of the gradients indicate exactly its minima).

Specifically, within the hyperplane of admissible points

, is minimal if and only if : , where is the lth vector of the canonical base. Or in other words, is a minimum iff it is a multiple of , the lth column of . Therefore the minimum is .

In full matrix form, we conclude that the solution to the equation is , with and

In practice, due to the presence of a matrix inversion, it is simpler and faster to obtain using gradient descent, given inputs sampled in the training set.

3.3 Weight readjustment

The previous weight matrix, and the residual error provides information regarding which activation is most predictable and should be removed. We then wish to adjust the remaining weight matrix of the following layer to account for this redundancy elimination. Assume only one activation was removed. We consider the compressed vectors (of size ) where activation l was removed. We can infer a transformation matrix from to , with minimal error, using the lth row of : , where :

i.e.

is the identity matrix

where has been inserted as the lth row, minus the coefficient .

Therefore, a natural adjustment for the weight matrix is , such that .

If we remove more than one coefficient at once, the expression of the transformation matrix is less straightforward. Assume for example that activations and are removed ; Obtaining the approximate expression of obtained from , using only remaining activations, leads to the following derivations :

More generally, assume a set of activations is eliminated. We note its complementary set . We define , the matrix defined by , and , the matrix such that . Then we can write, where contains only the activations in and only those not in :

i.e. provided that is invertible. From there we can easily obtain the equivalent of the transformation matrix in the single activation case :, where is completed with ones on the diagonal for the additional rows.

3.4 Stability results on compression

In practice, we wish to compress a network at some point during training, followed by further fine-tuning. We may expect that if we are close enough to a good local minimum in a convex region of the error surface, we may capture that minimum’s redundancies and eliminate them. One question however arises : after compression, will we still be close enough to the minimum that the fine-tuning will converge, or may it diverge? The following stability result gives partial answers to that question.

Theorem 3.1.

Let the kth activation in the neural network be linear, so that we can write for in the training set . Let

a local minimum for the loss function

in the parameter space , and assume an exact redundancy of the final activation of the kth layer : , where is minus its final row, and is the contracted weight matrix as computed in 3.3 with matrix . The compression-readjustment operation projects onto

Assume there is a -ball of radius centered , on which is convex. There is an ellipsoid centered on of equation

onto a convex region of the compressed parameter space.

We delay the full proof to an appendix. We can however discuss the implications of the theorem. We note first that the theorem by itself assumes linear activations. Assume our training brought us near a (global or local) minimum displaying some redundancies that we manage to eliminate. We would like regularities of the error space in that region, such as convexity, to be preserved after compression. That the point before compression was in a convex region around the minimum is not enough to have convexity in the compressed space; however, our theorem shows that there is a slightly different region, determined by the radius of the convex region around the minimum, that does ensure post-compression convexity. That region is obtained by flattening the ball onto the subspace of . Besides, the subspace corresponding to the compressed coefficient can be ignored.

While the above theorem applies only to the linear activation case, we argue that the results extends naturally to locally linear or nearly linear activations. Consider for example a ReLU activation: around any parameter point, there is a ball on which the network is identical to one with linear activation; we can apply theorem 1 on that restricted area of the space.

3.5 An empirical justification for readjustment

(a)
(b)
Figure 1: The norm of the change in the inputs to layer 17 of AlexNet after shrinking layer 16 down to almost 1% of its original size (a0 with and (b) without weight readjustment. Every step on the x-axis represents a shrinking step in which the layer is shrunk by 25%.

The proposed pruning approach is based on the hypothesis that elimination of linearly dependent (or almost dependent) neurons (or filters) within any layer with appropriate weight adjustment will result in minimal or even zero changes to the representations seen by subsequent layers in the network. In other words, compressing the th layer of a network as proposed should not significantly change the pre-activation values observed by layer . We evaluate this hypothesis in this section.

In Fig. 1, we plot pre-activation norm differences on an AlexNet network for an intermediate convolutional layer, computed on a random input sample, after compressing the previous layer. The norm difference is computed as , where represents the activations after the shrinking step. We compare the results obtained from just trimming dependent neurons without subsequent adjustment of weights, to those obtained after weight readjustment. As expected, trimming neurons modifies , but subsequent weight readjustment largely eliminates the changes from trimming – after 15 compression steps we have only a norm change, confirming the intuition behind our method.

4 When Activations Are Not Dependent

The above analysis shows that if there is perfect linear dependence in the neuron activations, i.e. , then we can achieve lossless compression, however, in many cases this condition may not hold. In such situations, the parameters of the pruned model, even after readjustment, may end up in a suboptimal region of the loss surface. This is because readjustment weights in are imperfect and error prone, and therefore will move the model parameters to a different, potentially suboptimal, point on the error surface. Since, reducing the size of the model makes the error surface less smooth [1], even if the operating point of the smaller model is close to the operating point of the larger model, it may have a much higher loss. To keep the model parameters from deviating too far from the optima during compression we employ a modified version of Annealed Model Contraction (AMC) [19], which attempts to keep the model in the optimal region by cycles between pruning and fine-tuning phases. Below we provide a description of AMC, and our modifications to it.

4.1 Annealed Model Contraction

AMC is an iterative method that greedily prunes the model layer-by-layer. As formulated in [19], AMC starts from the first (or the last) layer of the model and proceeds to maximally shrink the current layer before moving on to the next. While compressing a layer, AMC alternates between pruning and fine-tuning. Pruning is performed by reinitializing the layer with fewer neurons/filters and the whole network is then fine-tuned end-to-end. During fine-tuning, knowledge distillation [7] is used to facilitate training and the following loss is minimized

(1)

Where and

are the logits returned by the teacher and student models, respectively,

is a hyperparameter referred to as the temperature of the distribution, and controls the contribution of the loss against the target label to the the overall loss.

AMC continues to prune a layer as long as the pruned model’s accuracy remains within a threshold, , of the uncompressed model’s accuracy. Once the current layer can not be pruned any further, AMC proceeds to shrink the next layer in the model. AMC can be applied to both, dense and convolutional layers. In the case of the former, it prunes neurons while in the latter it prunes convolutional filters.

4.2 Annealed Model Contraction with Lossless Redundancy Elimination

1: adjust the weight matrix after the removal of the neuron from the previous layer using the method in 3.3
2 Function LREShrink(, , ):
       // compute the activations of the layer.
3      
4      
       // Concatenate the weights and bias.
5       for  do
             // drop the row of
6            
7            
8       end for
9      
10
11
12
13
14 while  do
15      
16      
17      
18       if   then
19            
20            
21            
22       end if
23      
24 end while
Algorithm 1 LRE-AMC Algorithm

While effective, AMC has the shortcoming that it takes an ad-hoc approach to parameter pruning. AMC removes neurons from a layer by reinitializing the layer with fewer neurons. The new initialization is random and therefore can land the model arbitrarily far away from the optimal point. On the other hand, the Lossless Redundancy Elimination (LRE) formalism presented in Section 3 provides a method of setting the parameters of the pruned layer that guarantees (under some constraints) that the model remains near the optimal operating point. However, LRE only considers the activations and weights between two layer, and thus does not account for the effects of pruning on the operating point of the whole model. Therefore, we propose to combine LRE and AMC in a novel model compression algorithm, which we call LRE-AMC, that compensates for the inadequacies of both LRE and AMC.

LRE-AMC (Algorithm 1) differs from vanilla AMC in two significant ways. First, instead of pruning neurons by reinitializing the layer, LRE-AMC uses the LRE formalism to select neurons/filters (in the following we will use the term units to refer to neurons and filters) to prune away based on the degree of linear dependency between their activations. Thus, LRE-AMC retains units that have linearly independent activation and thus have learned to encode unique aspects of the data, whereas these units have to be relearned under AMC. Second, LRE-AMC breaks the pruning process into two phases. In the first phase LRE is used to remove the selected units one-by-one and adjust the weight matrix such that the outputs of the layer are minimally perturbed. After each pruning stage we measure the performance of the model on a held-out set and continue pruning without fine-tuning until the performance of the model remains within a threshold, , of the original. When the performance drops below the threshold , we start phase two in which we use distillation to fine-tune the model to bring the model’s performance to within of the pre-compression performance.

5 Evaluation

5.1 Datasets

We evaluate our proposed method three datasets of real-world images, namely CIFAR-10 and Caltech-256. CIFAR10 contains 50,000 training images and 10,000 testing images. Each images has a size of pixels and is assigned one out of 10 class labels. Caltech-256 contains 30,607 real-world images, of different sizes, spanning 257 classes. Following the protocol from [20], we construct a balanced training set for Caltech 256 with 60 images per class. For both, Caltech256 and CIFAR10, we used 20% of the training images for validation during training. We apply data augmentation to increase the size of the training data and improve generalization. Specifically, we augment CIFAR10 with random affine transformations, horizontal flips and grayscaling. Meanwhile, we augment Caltech-256 by taking a random crop at a random scale between 0.8 and 1.0, and applying rotation, color jitter and horizontal flipping before resizing the image to

. The pixel values of images from both datasets are normalized by mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225].

5.2 Experimental Setup

We implemented AMC and LRE-AMC using Pytorch and Python 3. We use AlexNet and VGG16 as our base models which we will compress. Since the receptive field of the first convolutional layer in AlexNet is too large

images, we reduced it to

when training on CIFAR-10. When training on Caltech256, we initialized the models with weights from models pretrained on ImageNet and tuned only the final classification layer. The accuracy and number of parameters of the base models are presented in Table

1.

Model Dataset Total () Dense () Conv () Acc %
AlexNet CIFAR10 5.68 5.46 0.23 79.2
Caltech256 5.74 5.50 0.25 64.8
VGG16 CIFAR10 13.4 11.95 1.47 89.8
Caltech256 13.5 11.96 1.47 77.5
Table 1: The accuracy of the baseline models on CIFAR10 and Caltech256 and the number of parameters that they contain.

Since AMC does not define an order in which the layers must be shrunk, we must define one ourselves. We experiment with two orderings, namely, top down (TD) and round robin (RR). In TD we start from the penultimate layer, maximally shrink it and move down the network. In round robin (RR) we again start from the penultimate layer, but instead of maximally shrinking it we shrink each layer by at most a factor and then move to the next layer.

We also introduce additional constraints in LREShrink (Algorithm 1) to prevent the removal of neurons with independent observations and to stop removing neurons when becomes too error prone. Specifically, we do not apply the update if the average norm of the rows in the update is larger than the average norm of rows in the weight matrix i.e. or . To measure the effect of adjusting the network parameters using LRE, run experiments in which we do not adjust the network parameters using the LRE formalism presented in 3.3. Instead, we prune the neurons with linearly dependent activations by simply dropping the corresponding columns from the weight matrix, and keeping the other columns as is.

Unless otherwise specified, we use the following hyperparameter settings. For experiments with AlexNet we use a learning rate of and set in equation 1. For experiments with VGG16 we use a learning rate of and set . For both the models we set in equation 1 and

. During the fine-tuning phase, we tune the model for up to 50 epochs. We stop with the accuracy comes within

of the precompression accuracy. If the accuracy on the held-out set does not improve for epochs we reduce the learning rate by 50%. We stop tuning if the learning rate drops below .

5.3 Results

We present the percentage reduction in the number of model parameters, and the consequent loss in accuracy in Table 2. The “wAdj” and “noAdj” settings correspond to the setting in which LRE is used and the setting in which LRE is not used. Under both these settings we demonstrate that our technique is able to decimate the number of parameters of AlexNet and VGG16, by pruning as much as 99% of the model parameters.

5.3.1 Top Down Shrinking

We find that when we shrink the layers in top-down order we find that adjusting the model weights with LRE results in a significant reduction in model parameters. Adjusting the weights of AlexNet using LRE allows us to remove almost 30% more parameters on CIFAR10 and 47% more parameters on Caltech256, compared to when we did not adjust the weights. Furthermore, we observe that adjusting the weights allows us to prune additional neurons/filters from both, the dense and the convolution layers. This is an impressive result, not only because LRE-AMC able to reduce the number number of parameters in the network drastically but also because it yields better compression on the more difficult dataset. When we ran the same experiment with VGG16 we found that adjusting the weights using LRE results in slightly lower compression on CIFAR10 than however LRE is able to prune an additional 20% of the model parameters, most of which are pruned from the dense layers.

Dataset AlexNet VGG16
TD(noAdj) CIFAR10 68.6 70.8 15.1 4.15 98.1 99.9 83.8 5.23
Caltech256 37.3 38.8 03.8 6.35 46.5 51.9 02.1 5.44
TD(wAdj) CIFAR10 97.6 99.8 46.4 4.59 91.0 99.9 17.7 5.48
Caltech256 84.7 87.8 14.9 5.60 65.1 73.0 0.7 5.78
RR(noAdj) CIFAR10 99.3 99.6 91.5 5.29 99.4 99.7 97.0 5.44
Caltech256 75.8 75.9 74.2 5.33 80.9 82.0 72.0 5.87
RR (wAdj) CIFAR10 97.3 97.5 91.2 5.36 97.4 97.5 96.2 5.34
Caltech256 73.5 73.6 69.7 5.75 80.9 82.0 72.0 5.87
Table 2: The percentage reduction in the number of total parameters (), dense layer parameters (), convolutional layer parameters (), and classification accuracy ().

5.3.2 Round Robin Shrinking

When we shrink the layers in a round robin fashion we find that we can achieve greater compression of the convolutional layers. Since the convolution layers scan the input, computing their activations involves a lot of floating-point operations (FLOPs). Reducing the number of convolutional filters greatly reduces the FLOPs of the model. Interestingly, performing round robin shrinking has a more significant impact on the total number of model parameter in AlexNet when the weights are not adjusted using LRE. In fact, under round robin shrinking not adjusting the weights yields slightly better compression both in terms of reduction in the number of model parameters and the accuracy degredation. We also observe that under round robin shrinking, we achieve lower compression in terms of dense layer parameters on Caltech256 but we are able to prune away many more parameters from the convolutional layers. This seems to suggest that round robin shrinking would be ideal when minimizing FLOPs is more important than reducing memory consumption, while top-down shrinking should be preferred when memory consumption is to be optimized.

5.4 Analysis

5.4.1 Accuracy Error Tradeoff

In this section we present experimental results that describe the compression-performance trade-off of our approach. As mentioned, we have used a tolerance of to limit the deterioration of accuracy during and after compression. In Figure 2 we plot the decrease in accuracy against the percentage of the parameters pruned for top-down and round robin shrinking of AlexNet on Caltech-256 at different values of . Figure (a)a exhibits the expected trend, in that, as we decrease both, the decrease in accuracy and the fraction of removed parameters decrease. We see that the the parameter reduction falls much faster as we decrease , indicating that that under the top-down shrinking scheme additional accuracy comes at a steep cost in compression performance. On the other hand, Figure (b)b exhibits a very different trend. As we decrease from 0.05 to 0.03 the compression improves, however, it deteriorates as when and improves again when . Even though compression suffers when we set , the deterioration is modest compared to the top-down shrinking. We do not have a reliable explanation for this phenomenon, because the repetitive nature of the round-robin shrinking approach makes its analysis complicated.

(a)
(b)
Figure 2: The change in the compression percentage of AlexNet as the accuracy tolerance is reduced from 5% to 0% (a) under top-down shrinking and (b) round robin shrinking on Caltech-256. In both settings the weights are adjusted using LRE.

It is entirely possible that removing neurons/filters in a certain order can lead to greater compression than removing neurons in some other order. The complexity arises if the optimal order spans across layers, something which the LRE framework does not account for. Though we do not prove it conclusively, the round robin shrinking approach seems to maintain compression even under very stringent accuracy constraints, and, therefore, shows promise as an effective model compression approach that could benefit from further study.

5.4.2 Representation learning

Figure 3: Low-dimensional representations of the final convolutional layer outputs of the VGG16 network trained on CIFAR. Points are test images colored by label. On the first line is t-SNE, on the second PCA. The left column corresponds to the original network ; the middle one to the compressed network without weight readjustment ; the right one to the compressed network with readjustment.

As we discussed earlier, one of the main use of a compressed representation on a task such as image recognition should be to provide useful pretrained representations for potential downstream tasks. When using performance-guided pruning, it is possible to degrade the learned representations while resorting on the final layers to use artifacts to maintain good performance on the recognition task. To make sure that our method isn’t such a case, we provide some insight on the final convolutional layer of our VGG16 network trained on CIFAR through low-dimensional visualizations. In 3 we plot t-SNE visualizations to observe separability. We can observe the compressed representations images are almost as separable as they are in the original network. Since t-SNE distorts the point clusters, we also plot PCA representations to assess the shape of the clusters. We can see that weight readjustment plays a significant role here : without it, clusters are more scattered and less convex, while with it they are more similar to the original network. This vouches for redundancy elimination and weight readjustment as compression methods that respect the semantics of the data, and that arguably are compatible with transfer learning between vision tasks.

6 Conclusion

We have presented a novel neural model compression technique called LRE-AMC, which eliminates units (neurons or convolutional filters) whose activations are linearly dependent on the activations of other neurons in the same layer. Since entire units are pruned away, and not just individual parameters, the weight matrices in compressed model are smaller, which reduces the model’s memory requirements and makes computation more efficient. We demonstrate the efficacy of LRE-AMC by applying it to AlexNet and VGG16 and show that we can remove more than 99% of the units in both these models while suffering only a 5-6% loss in accuracy on CIFAR-10. We have also applied LRE-AMC to the more difficult Caltech-256 dataset and achieved more than 80% compression. Furthermore, we show that after compression the data remains separable in the model’s intermediate layers, suggesting that the intermediate representation could carry sufficient information for transfer learning tasks. For future work we will explore methods of incorporating information from the derivatives of the subsequent layers to better estimate the effect of removing a unit on the overall output of the network, and prune neurons that minimally impact the output. We expect that this modification will result in smaller models and greater accuracy.

References

  • [1] Z. Allen-Zhu, Y. Li, and Z. Song (2018) A convergence theory for deep learning via over-parameterization. arXiv preprint arXiv:1811.03962. Cited by: §4.
  • [2] V. Belagiannis, A. Farshad, and F. Galasso (2018) Adversarial network compression. In Proceedings of ECCV, pp. 0–0. Cited by: §2.3.
  • [3] E. Denton, W. Zaremba, J. Bruna, Y. Lecun, and R. Fergus (2014-04) Exploiting linear structure within convolutional networks for efficient evaluation. 2, pp. . Cited by: §2.2.
  • [4] G. Griffin, A. Holub, and P. Perona (2007) Caltech-256 object category dataset. Cited by: §1.
  • [5] S. Han, H. Mao, and W. J. Dally (2016) Deep compression: compressing deep neural network with pruning, trained quantization and huffman coding. ICLR. Cited by: §2.1, §2.
  • [6] S. Han, J. Pool, J. Tran, and W. Dally (2015) Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems 28, C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (Eds.), pp. 1135–1143. External Links: Link Cited by: §2.1.
  • [7] G. Hinton, O. Vinyals, and J. Dean (2015) Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531. Cited by: §1, §2.3, §4.1.
  • [8] H. Hu, R. Peng, Y. Tai, and C. Tang (2016) Network trimming: a data-driven neuron pruning approach towards efficient deep architectures. ArXiv abs/1607.03250. Cited by: §2.1.
  • [9] A. Krizhevsky, G. Hinton, et al. (2009) Learning multiple layers of features from tiny images. Technical report Citeseer. Cited by: §1.
  • [10] A. Krizhevsky, I. Sutskever, and G. E. Hinton (2012)

    Imagenet classification with deep convolutional neural networks

    .
    In NIPS, pp. 1097–1105. Cited by: §1.
  • [11] H. Li, A. Kadav, I. Durdanovic, H. Samet, and H.P. Graf (2016-08) Pruning filters for efficient convnets. pp. . Cited by: §2.1.
  • [12] J. LIU, Z. XU, R. SHI, R. C. C. Cheung, and H. K.H. So (2020) Dynamic sparse training: find efficient sparse network from scratch with trainable masked layers. In International Conference on Learning Representations, External Links: Link Cited by: §2.1.
  • [13] Z. Liu, J. Li, Z. Shen, G. Huang, S. Yan, and C. Zhang (2017) Learning efficient convolutional networks through network slimming. In Proceedings of the ICCV, pp. 2736–2744. Cited by: §2.1.
  • [14] Y. Lu, A. Kumar, S. Zhai, Y. Cheng, T. Javidi, and R. Feris (2017) Fully-adaptive feature sharing in multi-task networks with applications in person attribute classification. In Proceedings of the IEEE CVPR, pp. 5334–5343. Cited by: §2.2.
  • [15] P. Luo, Z. Zhu, Z. Liu, X. Wang, and X. Tang (2016) Face model compression by distilling knowledge from neurons. In AAAI, Cited by: §2.3.
  • [16] B. Mussay, M. Osadchy, V. Braverman, S. Zhou, and D. Feldman (2020) Data-independent neural pruning via coresets. In International Conference on Learning Representations, External Links: Link Cited by: §2.1.
  • [17] A. Øland and B. Raj (2015) Reducing communication overhead in distributed learning by an order of magnitude (almost). In 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2219–2223. Cited by: §2.
  • [18] H. Peng, J. Wu, S. Chen, and J. Huang (2019) Collaborative channel pruning for deep networks. In ICML, pp. 5113–5122. Cited by: §2.1.
  • [19] M. Shah and B. Raj (2020) DERIVING compact feature representations via annealed contraction. In Proceedings of 45th International Conference on Acoustics, Speech, and Signal Processing, Cited by: §4.1, §4.
  • [20] K. Simonyan and A. Zisserman (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Cited by: §1, §5.1.
  • [21] D. S. Touretzky, M. C. Mozer, and M. E. Hasselmo (1996) NIPS. Vol. 8. Cited by: §2.1.
  • [22] X. Xing, L. Sha, P. Hong, Z. Shang, and J. S. Liu (2020) Probabilistic connection importance inference and lossless compression of deep neural networks. In International Conference on Learning Representations, External Links: Link Cited by: §2.1.
  • [23] Z. Yang, M. Moczulski, M. Denil, N. de Freitas, A. Smola, L. Song, and Z. Wang (2015) Deep fried convnets. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1476–1483. Cited by: §2.2.
  • [24] Z. Zhuang, M. Tan, B. Zhuang, J. Liu, Y. Guo, Q. Wu, J. Huang, and J. Zhu (2018) Discrimination-aware channel pruning for deep neural networks. In Advances in Neural Information Processing Systems 31, S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (Eds.), pp. 875–886. External Links: Link Cited by: §2.1.