CNN Acceleration by Low-rank Approximation with Quantized Factors

Nikolay Kozyrskiy, Anh-Huy PhanarXiv 2020 · OpenReview

TL;DR

This paper proposes a novel method to accelerate and compress Convolutional Neural Networks (CNNs) by combining low-rank tensor approximation (specifically, Tucker decomposition) with quantization of weights and activations. This approach aims to make powerful CNNs feasible for resource-constrained devices like mobile phones, achieving significant compression and speedup with minimal loss in accuracy.

What Problem Does This Paper Address?

Modern deep convolutional neural networks (CNNs) have achieved remarkable success in various computer vision tasks. However, their large size and high computational demands make them unsuitable for deployment on mobile and embedded devices, which have strict limitations on computational complexity, memory, and power consumption. To overcome this, CNNs need to be compressed and accelerated before deployment. Existing methods like pruning, quantization, and low-rank factorization have shown promise, but the authors argue that combining low-rank approximation with quantization offers a synergistic approach, as they exploit different types of redundancy within CNNs.

Methods

The core of this paper lies in the combination of two key techniques:

  • Low-Rank Tensor Approximation (Tucker Decomposition): Convolutional layers, which are computationally intensive, are represented using the Tucker decomposition. This method approximates the high-order tensor representing the convolutional weights with a smaller core tensor and a set of factor matrices. The paper focuses on partial Tucker decomposition, applying it to the filter depth and number of filters modes, as spatial dimensions of kernels are typically small.
  • Quantization: Both the weights and feature maps (activations) of the CNN are quantized to reduce their precision. The paper explores fixed-point representations with varying bit-widths (from 4 to 8 bits). They propose specific schemes for quantizing weights and activations, including methods for determining appropriate thresholds.
  • Quality Restoration (Fine-tuning): To mitigate the accuracy drop caused by compression and quantization, the authors propose a fine-tuning approach inspired by knowledge distillation. A "teacher" model (the original, uncompressed CNN) guides the training of a "student" model (the compressed CNN), helping it recover lost performance.
  • Rank Selection Algorithms: Determining the optimal multilinear ranks for the Tucker decomposition is crucial for balancing compression and accuracy. The paper introduces greedy one-step and multi-step algorithms for selecting these ranks, aiming to control the trade-off between compression ratio and quality drop.

Datasets

The proposed method was evaluated on the following standard image classification datasets:

  • CIFAR-10: A dataset of 60,000 32x32 color images in 10 classes.
  • CIFAR-100: A more complex version of CIFAR-10 with 100 classes.
  • ImageNet (ILSVRC): A large-scale dataset containing approximately 1 million images across 1000 object classes.

Key Insights and Ideas

  • Synergistic Compression: Combining low-rank approximation and quantization is more effective than either method alone because they exploit orthogonal types of redundancy (over-parameterization vs. parameter representation).
  • Partial Tucker Decomposition: Applying Tucker decomposition only to the filter depth and number of filters modes of convolutional kernels is sufficient and efficient, as spatial kernel dimensions are typically small.
  • Knowledge Distillation for Restoration: Using a teacher-student framework with knowledge distillation is an effective way to restore accuracy after compression and quantization, allowing for better fine-tuning.
  • Controllable Trade-off: The proposed rank selection algorithms enable explicit control over the trade-off between compression ratio and accuracy, making the method adaptable to different deployment requirements.
  • 8-bit Quantization is Effective: The experiments show that 8-bit quantization, combined with their compression techniques, can achieve significant compression with virtually no accuracy drop on various datasets.

Key Results

The paper demonstrates the effectiveness of their combined approach on ResNet18 and ResNet34 models:

  • CIFAR-10/CIFAR-100: For 8-bit quantization, the compressed models showed no accuracy drop compared to the full-precision models. This resulted in a 4x memory compression due to quantization alone.
  • ImageNet: While achieving very high compression ratios without accuracy loss was challenging on this complex dataset, the 8-bit quantized models achieved almost the same test accuracy as the full-precision counterparts.
  • Low Bitness Study: Experiments with 4- to 7-bit quantization on CIFAR-10, combined with appropriate fine-tuning, also resulted in minimal accuracy degradation.
  • Comparison with Other Methods: The proposed method, especially when combined with 8-bit quantization, outperformed other compression techniques (like SVD, Tucker, Tensor-Train, and Channel Pruning) in terms of achieving a better balance between compression and accuracy on ImageNet.

Limitations and Future Work

  • Time-Consuming Optimization: The process of finding the optimal compression configuration, even with automated algorithms, can be time-consuming.
  • Extreme Quantization: The paper did not explore extreme quantization bitnesses like binary or ternary, suggesting this as a future research direction.
  • Deep Reinforcement Learning (DRL) for Rank Selection: The authors propose using DRL for more efficient rank selection as a future avenue.
  • Binary and Ternary Quantization: Extending the method to combine low-rank tensor approximation with binary and ternary quantization is also suggested for future work.

Summary updated

Abstract

The modern convolutional neural networks although achieve great results in solving complex computer vision tasks still cannot be effectively used in mobile and embedded devices due to the strict requirements for computational complexity, memory and power consumption. The CNNs have to be compressed and accelerated before deployment. In order to solve this problem the novel approach combining two known methods, low-rank tensor approximation in Tucker format and quantization of weights and feature maps (activations), is proposed. The greedy one-step and multi-step algorithms for the task of multilinear rank selection are proposed. The approach for quality restoration after applying Tucker decomposition and quantization is developed. The efficiency of our method is demonstrated for ResNet18 and ResNet34 on CIFAR-10, CIFAR-100 and Imagenet classification tasks. As a result of comparative analysis performed for other methods for compression and acceleration our approach showed its promising features.
BibTeX
@misc{kozyrskiy2020cnn,
  author = {Nikolay Kozyrskiy and Anh-Huy Phan},
  title = {{CNN Acceleration by Low-rank Approximation with Quantized Factors}},
  year = {2020},
  eprint = {2006.08878},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.08878},
}
Figure