Ultimate tensorization: compressing convolutional and FC layers alike

Timur Garipov, Dmitry Podoprikhin, Alexander Novikov, Dmitry P. VetrovarXiv 2016

Abstract

Convolutional neural networks excel in image recognition tasks, but this comes at the cost of high computational and memory complexity. To tackle this problem, [1] developed a tensor factorization framework to compress fully-connected layers. In this paper, we focus on compressing convolutional layers. We show that while the direct application of the tensor framework [1] to the 4-dimensional kernel of convolution does compress the layer, we can do better. We reshape the convolutional kernel into a tensor of higher order and factorize it. We combine the proposed approach with the previous work to compress both convolutional and fully-connected layers of a network and achieve 80x network compression rate with 1.1% accuracy drop on the CIFAR-10 dataset.

Introduction

Convolutional Neural Networks (CNNs) are powerful but memory-intensive, making their deployment on mobile and edge devices difficult. State-of-the-art CNNs require millions of parameters and hundreds of megabytes of memory. This forces devices to rely on energy-hungry RAM rather than highly efficient processor caches, restricting the use of advanced CNNs on mobile devices.

Previous research successfully tackled this memory bottleneck by compressing fully-connected (FC) layers using tensor decomposition. However, once the FC layers are compressed, the convolutional layers become the new memory bottleneck. This paper addresses the challenge of effectively compressing these convolutional layers to achieve massive, end-to-end network compression without destroying the model's predictive power.

Methodology

The core technique relies on Tensor Train (TT) decomposition, a mathematical method that represents a large tensor as a sequence of smaller, interconnected matrices (called TT-cores). This allows for a highly compact representation of weights.

While one could naively apply TT decomposition directly to the standard 4D convolutional kernel (width, height, input channels, output channels), the authors show this is suboptimal. Instead, they propose a clever reshaping strategy:

  1. They treat the convolution operation as a matrix-by-matrix multiplication.
  2. They mathematically factorize the input and output channel dimensions (e.g., assuming total channels $C = C_1 \times C_2 \dots C_d$).
  3. They reshape the kernel into a much higher-dimensional tensor based on these factors.
  4. Finally, they apply the TT-format to this reshaped tensor.
Reshaping the convolutional kernel into a higher-order tensor for TT decomposition.

This reshaping fully unlocks the compression power of the TT decomposition. The network is then trained from scratch using the elements of the TT-cores as the trainable parameters, utilizing standard stochastic gradient descent and automatic differentiation.

Results and Discussion

The authors evaluated their approach on the CIFAR-10 dataset (50,000 training images and 10,000 test images).

Key Insights

  • Naive 4D tensorization isn't enough: Directly applying TT decomposition to a standard 4D convolutional kernel yields poor compression-to-accuracy trade-offs. The tensor simply doesn't have enough dimensions to allow the TT format to find deep, efficient low-rank structures.
  • Dimensionality reshaping is the secret sauce: By factoring the channel dimensions and reshaping the kernel into a higher-order (e.g., $d+2$ dimensions) tensor, the authors allow the TT decomposition to exploit much finer-grained redundancies within the network's weights.
  • Unifying Conv and FC compression: A beautiful mathematical consequence of this reshaping is that for a 1x1 convolution, the proposed format perfectly collapses into the exact matrix Tensor Train format previously proven to work wonders on fully-connected layers.

Performance Metrics

  • Beating the Naive Baseline: At a 2x compression rate on a convolution-dominated network, the proposed reshaping method lost only 0.8% accuracy, compared to a severe 2.4% drop using the naive 4D TT approach.
  • Convolution-Only Compression: On a network dominated by convolutions, the method achieved up to a 4x compression rate with only a ~2% decrease in accuracy (88.7% vs. the 90.7% uncompressed baseline).
  • Massive End-to-End Network Compression: On a network containing both heavy convolutional and fully-connected layers, compressing only the FC layers hit a ceiling at ~21x compression. By compressing both FC and convolutional layers using the proposed method, they achieved an incredible 82.87x overall network compression with merely a 1.1% drop in top-1 accuracy (89.4% vs. 90.5% baseline).
Performance comparison of various compressed models on CIFAR-10.

Conclusion

The primary limitation of this paper is its evaluation scope, restricted to the CIFAR-10 dataset and custom VGG-like architectures. Future work will involve scaling up experiments to the ILSVRC-2012 (ImageNet) dataset using state-of-the-art neural architectures to prove viability in enterprise-grade computer vision tasks. By unifying the compression of convolutional and fully-connected layers, this work paves the way for deploying sophisticated CNNs on resource-constrained hardware.

Summary updated

BibTeX
@misc{garipov2016ultimate,
  author = {Timur Garipov and Dmitry Podoprikhin and Alexander Novikov and Dmitry P. Vetrov},
  title = {{Ultimate tensorization: compressing convolutional and FC layers alike}},
  year = {2016},
  eprint = {1611.03214},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1611.03214},
}
Figure