[Paper Review] An Image Enhancing Pattern-based Sparsity for Real-time Inference on Mobile Devices
This paper introduces pattern-based sparsity—a novel sparsity dimension combining pattern and connectivity sparsity—that enables both high model accuracy and hardware efficiency in deep neural networks. By designing a pattern-aware pruning framework and leveraging compiler-optimized code generation, the approach achieves real-time inference on mobile devices for large-scale DNNs like ResNet-18, ResNet-50, and VGG-16, outperforming prior methods in accuracy and speed.
Weight pruning has been widely acknowledged as a straightforward and effective method to eliminate redundancy in Deep Neural Networks (DNN), thereby achieving acceleration on various platforms. However, most of the pruning techniques are essentially trade-offs between model accuracy and regularity which lead to impaired inference accuracy and limited on-device acceleration performance. To solve the problem, we introduce a new sparsity dimension, namely pattern-based sparsity that comprises pattern and connectivity sparsity, and becoming both highly accurate and hardware friendly. With carefully designed patterns, the proposed pruning unprecedentedly and consistently achieves accuracy enhancement and better feature extraction ability on different DNN structures and datasets, and our pattern-aware pruning framework also achieves pattern library extraction, pattern selection, pattern and connectivity pruning and weight training simultaneously. Our approach on the new pattern-based sparsity naturally fits into compiler optimization for highly efficient DNN execution on mobile platforms. To the best of our knowledge, it is the first time that mobile devices achieve real-time inference for the large-scale DNN models thanks to the unique spatial property of pattern-based sparsity and the help of the code generation capability of compilers.
Motivation & Objective
- Address the trade-off between model accuracy and hardware efficiency in structured and non-structured weight pruning.
- Overcome the limitations of existing pruning methods that either sacrifice accuracy (structured pruning) or fail to enable hardware acceleration (non-structured pruning).
- Enable real-time inference on mobile devices for large-scale DNNs by introducing a new sparsity dimension with inherent hardware compatibility.
- Design a unified framework that simultaneously performs pattern library extraction, pattern and connectivity pruning, and weight retraining.
Proposed method
- Propose pattern-based sparsity as a new sparsity dimension combining intra-kernel pattern sparsity and inter-kernel connectivity sparsity.
- Formulate the pruning problem as an ADMM optimization problem and solve it using a primal-proximal method to decouple stochastic gradient descent from regularization.
- Design a set of image-enhancing kernel patterns that improve feature extraction and model accuracy through spatial structure in weights.
- Implement filter/kernel reordering to preserve instruction-level and thread-level parallelism for maximum hardware acceleration.
- Integrate the pattern-based sparse model into a compiler-optimized inference pipeline using TFLite, TVM, and MNN with full optimization enabled.
- Enable real-time inference by leveraging code generation and hardware-aware compilation to exploit the regularity of pattern-based sparsity.
Experimental results
Research questions
- RQ1Can a new sparsity dimension combining pattern and connectivity sparsity achieve both high model accuracy and hardware efficiency?
- RQ2Do carefully designed kernel patterns enhance feature extraction and image quality, leading to improved model performance?
- RQ3Can pattern-based sparsity be efficiently compiled and executed on mobile platforms to enable real-time inference?
- RQ4How does the proposed framework compare to existing pruning methods in terms of accuracy, compression rate, and inference speed on mobile devices?
- RQ5Can the pattern-aware pruning framework simultaneously perform pattern library extraction, pattern pruning, connectivity pruning, and weight retraining?
Key findings
- The proposed method achieves 94.0% top-1 accuracy on ImageNet using ResNet-18 with 16× compression and 8.0× speedup, enabling real-time inference on mobile CPU.
- For ResNet-50, the model maintains 94.2% top-1 accuracy at 16× compression and achieves 5.8× speedup, meeting real-time inference requirements on mobile devices.
- On VGG-16, the method achieves 93.5% top-1 accuracy at 19.7× compression and 12.0× speedup, demonstrating effectiveness on deeper models.
- The pattern-based sparsity framework enables real-time inference (≤33ms/frame) on mobile CPU and GPU across all evaluated models, including large-scale DNNs.
- The pattern-aware pruning framework successfully extracts a pattern library, performs joint pattern and connectivity pruning, and maintains or improves accuracy compared to baseline methods.
- Compiler-optimized execution of pattern-based models achieves significant speedups—up to 16×—compared to non-optimized baselines, demonstrating hardware-friendly design.
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.