[Paper Review] Compression of Deep Neural Networks on the Fly
This paper proposes a novel on-the-fly compression method for deep neural networks by introducing a binary regularization term during training to encourage weights to converge to 0 or 1, followed by Product Quantization (PQ) for further compression. The method achieves a 107× compression rate on MNIST with only 2% accuracy loss, significantly outperforming state-of-the-art techniques by integrating regularization into the learning phase rather than applying compression post-training.
Thanks to their state-of-the-art performance, deep neural networks are increasingly used for object recognition. To achieve these results, they use millions of parameters to be trained. However, when targeting embedded applications the size of these models becomes problematic. As a consequence, their usage on smartphones or other resource limited devices is prohibited. In this paper we introduce a novel compression method for deep neural networks that is performed during the learning phase. It consists in adding an extra regularization term to the cost function of fully-connected layers. We combine this method with Product Quantization (PQ) of the trained weights for higher savings in storage consumption. We evaluate our method on two data sets (MNIST and CIFAR10), on which we achieve significantly larger compression rates than state-of-the-art methods.
Motivation & Objective
- To reduce the storage footprint of deep neural networks for deployment on resource-constrained devices like smartphones.
- To address the challenge of large model sizes in state-of-the-art CNNs, which can exceed 100 MB and hinder deployment on embedded systems.
- To develop a method that compresses models during training rather than post-training, preserving performance while enabling higher compression.
- To investigate the impact of layer depth on binary quantization performance and optimize compression strategy accordingly.
Proposed method
- Introduces a novel regularization term in the loss function that encourages fully connected layer weights to converge to binary values (0 or 1) during training.
- Applies Product Quantization (PQ) to the trained, binarized weights to further reduce storage requirements.
- Focuses compression on fully connected layers, which account for over 90% of model size in typical CNNs.
- Prioritizes binarization of output layers first, as they have a greater impact on performance and storage.
- Uses a hybrid approach: binary regularization during training followed by PQ for additional compression.
- Employs a layer-wise strategy, quantizing from output to input layers to maintain classification accuracy.
Experimental results
Research questions
- RQ1How does the depth of the binarized layer affect classification performance in compressed DNNs?
- RQ2Can adding a binary regularization term during training improve compression efficiency without sacrificing accuracy?
- RQ3What is the optimal layer ordering for binarization (input-to-output vs. output-to-input) in fully connected layers?
- RQ4How does the proposed on-the-fly method compare to post-training compression techniques in terms of compression rate and accuracy?
- RQ5To what extent can Product Quantization further enhance compression when combined with learned binary weights?
Key findings
- The method achieves a 107× compression rate on the MNIST dataset with only 2% accuracy loss, significantly outperforming state-of-the-art methods.
- Compressing only the two output fully connected layers reduces model storage from 26 MB to 550 KB, demonstrating substantial memory savings.
- Performance degrades significantly when binarizing input layers first; the best results are achieved by binarizing output layers before input layers.
- The method maintains high accuracy even at extreme compression rates, with a test error of 0.88% on MNIST when only the final layer is binarized.
- The combination of on-the-fly binary regularization and PQ enables higher compression than PQ alone, with a 33× rate achieved via single PQ compared to 107× with the proposed method.
- The study confirms that output layers are more suitable for binarization due to their role in high-level feature detection, aligning with biological plausibility.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.