Deep Learning Architecture Improvement Based on Dynamic Pruning and Layer Fusion
Abstract
:1. Introduction
- A method for layer-level compression of CNNs is proposed. By introducing knowledge distillation and short–long fine-tuning, redundant layers are removed with lower accuracy loss.
- The proposal may provide an idea for applications that desire to reduce memory access more than reduce computational complexity.
2. Related Work
3. Methods
3.1. Preliminary
3.2. Dynamic Pruning
Algorithm 1: Algorithm for dynamic pruning. |
3.3. Layer Fusion
3.3.1. Knowledge Distillation
3.3.2. Short–Long Fine-Tuning
3.3.3. Iterative Layer Fusion
Algorithm 2: Flow of layer fusion. |
4. Experimental
4.1. Experimental Configuration
4.2. Experiments on CIFAR10
4.3. Experiments on ImageNet50
4.4. Analysis
- Knowledge distillation was replaced by cross-entropy loss in the fine-tuning.
- No short fine-tuning was performed after each structure was fused; only long fine-tuning was conducted after four layers were fused.
- We trained models from scratch with the optimized architectures.
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
Abbreviation | Explanation |
---|---|
FLOP | Floating-point operation |
CNN | Convolution neural network |
FPGA | Field-programmable gate array |
lasso | Least absolute shrinkage and selection operator |
Filter that connects the th input channel to the th | |
output channel | |
Input feature map on the th channel | |
Output feature map on the th channel | |
⊛ | Convolution operator |
b | Bias |
Current demarcation point of En-sparsity | |
Upper endpoint of target interval | |
Lower endpoint of target interval | |
x | Input of bottleneck structure |
Carrier structure | |
Material structure | |
Fused layer | |
The probability of the ith class | |
T | The temperature of knowledge distillation |
The soft label of the ith class | |
GPU | Graphics processing unit |
CPU | Central Processing Unit |
Acc. | Top-1 accuracy |
Acc. ↓ | Reduction in accuracy compared to the base model |
FLOPs ↓ | Reduction in FLOP compared to the base model |
SGD | Stochastic gradient descent algorithm |
References
- Li, Z.; Meng, L. Research on Deep Learning-based Cross-disciplinary Applications. In Proceedings of the 2022 International Conference on Advanced Mechatronic Systems (ICAMechS), Toyama, Japan, 17–20 December 2022; pp. 221–224. [Google Scholar] [CrossRef]
- Chen, X.; Liu, L.; Tan, X. Robust Pedestrian Detection Based on Multi-Spectral Image Fusion and Convolutional Neural Networks. Electronics 2022, 11, 1. [Google Scholar] [CrossRef]
- Avazov, K.; Mukhiddinov, M.; Makhmudov, F.; Cho, Y.I. Fire Detection Method in Smart City Environments Using a Deep-Learning-Based Approach. Electronics 2022, 11, 73. [Google Scholar] [CrossRef]
- Yue, X.; Li, H.; Shimizu, M.; Kawamura, S.; Meng, L. YOLO-GD: A Deep Learning-Based Object Detection Algorithm for Empty-Dish Recycling Robots. Machines 2022, 10, 294. [Google Scholar] [CrossRef]
- Ge, Y.; Yue, X.; Meng, L. YOLO-GG: A slight object detection model for empty-dish recycling robot. In Proceedings of the 2022 International Conference on Advanced Mechatronic Systems (ICAMechS), Toyama, Japan, 17–20 December 2022; pp. 59–63. [Google Scholar]
- Yue, X.; Li, H.; Fujikawa, Y.; Meng, L. Dynamic Dataset Augmentation for Deep Learning-Based Oracle Bone Inscriptions Recognition. J. Comput. Cult. Herit. 2022, 15, 76. [Google Scholar] [CrossRef]
- Meng, L.; Hirayama, T.; Oyanagi, S. Underwater-drone with panoramic camera for automatic fish recognition based on deep learning. IEEE Access 2018, 6, 17880–17886. [Google Scholar] [CrossRef]
- Deng, M.; Inoue, A.; Shibata, Y.; Sekiguchi, K.; Ueki, N. An obstacle avoidance method for two wheeled mobile robot. In Proceedings of the 2007 IEEE International Conference on Networking, Sensing and Control, London, UK, 15–17 April 2007; pp. 689–692. [Google Scholar] [CrossRef]
- Wen, S.; Deng, M.; Inoue, A. Operator-based robust non-linear control for gantry crane system with soft measurement of swing angle. Int. J. Model. Identif. Control 2012, 16, 86–96. [Google Scholar] [CrossRef]
- Bergerman, M.; van Henten, E.; Billingsley, J.; Reid, J.F.; Deng, M. IEEE Robotics and Automation Society Technical Committee on Agricultural Robotics and Automation. IEEE Robot. Autom. Mag. 2013, 20, 20–125. [Google Scholar] [CrossRef]
- Yue, X.; Lyu, B.; Li, H.; Meng, L.; Furumoto, K. Real-time medicine packet recognition system in dispensing medicines for the elderly. Meas. Sens. 2021, 18, 100072. [Google Scholar] [CrossRef]
- Gu, J.; Wang, Z.; Kuen, J.; Ma, L.; Shahroudy, A.; Shuai, B.; Liu, T.; Wang, X.; Wang, G.; Cai, J.; et al. Recent advances in convolutional neural networks. Pattern Recognit. 2018, 77, 354–377. [Google Scholar] [CrossRef] [Green Version]
- Daud, S.M.S.M.; Yusof, M.Y.P.M.; Heo, C.C.; Khoo, L.S.; Singh, M.K.C.; Mahmood, M.S.; Nawawi, H. Applications of drone in disaster management: A scoping review. Sci. Justice 2022, 62, 30–42. [Google Scholar] [CrossRef]
- Ghimire, D.; Kil, D.; Kim, S.H. A Survey on Efficient Convolutional Neural Networks and Hardware Acceleration. Electronics 2022, 11, 945. [Google Scholar] [CrossRef]
- Ahamad, A.; Sun, C.C.; Kuo, W.K. Quantized Semantic Segmentation Deep Architecture for Deployment on an Edge Computing Device for Image Segmentation. Electronics 2022, 11, 3561. [Google Scholar] [CrossRef]
- Zhao, M.; Li, M.; Peng, S.L.; Li, J. A Novel Deep Learning Model Compression Algorithm. Electronics 2022, 11, 1066. [Google Scholar] [CrossRef]
- Zhou, H.; Alvarez, J.M.; Porikli, F. Less is More: Towards Compact CNNs. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Springer International Publishing: Berlin/Heidelberg, Germany, 2016; pp. 662–677. [Google Scholar]
- Li, H.; Yue, X.; Wang, Z.; Chai, Z.; Wang, W.; Tomiyama, H.; Meng, L. Optimizing the deep neural networks by layer-wise refined pruning and the acceleration on FPGA. Comput. Intell. Neurosci. 2022, 2022, 8039281. [Google Scholar] [CrossRef] [PubMed]
- Jordao, A.; Lie, M.; Schwartz, W.R. Discriminative Layer Pruning for Convolutional Neural Networks. IEEE J. Sel. Top. Signal Process. 2020, 14, 828–837. [Google Scholar] [CrossRef]
- Yuan, S.; Du, Y.; Liu, M.; Yue, S.; Li, B.; Zhang, H. YOLOv5-Ytiny: A Miniature Aggregate Detection and Classification Model. Electronics 2022, 11, 1743. [Google Scholar] [CrossRef]
- Lin, S.; Ji, R.; Chen, C.; Tao, D.; Luo, J. Holistic CNN Compression via Low-Rank Decomposition with Knowledge Transfer. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 41, 2889–2905. [Google Scholar] [CrossRef]
- Li, H.; Wang, Z.; Yue, X.; Wang, W.; Hiroyuki, T.; Meng, L. A Comprehensive Analysis of Low-Impact Computations in Deep Learning Workloads. In Proceedings of the 2021 on Great Lakes Symposium on VLSI, GLSVLSI ’21, Virtual Event, 22–25 June 2021; Association for Computing Machinery: New York, NY, USA, 2021; pp. 385–390. [Google Scholar] [CrossRef]
- Hao, Z.; Li, Z.; Dang, X.; Ma, Z.; Liu, G. MM-LMF: A Low-Rank Multimodal Fusion Dangerous Driving Behavior Recognition Method Based on FMCW Signals. Electronics 2022, 11, 3800. [Google Scholar] [CrossRef]
- Gong, C.; Chen, Y.; Lu, Y.; Li, T.; Hao, C.; Chen, D. VecQ: Minimal Loss DNN Model Compression With Vectorized Weight Quantization. IEEE Trans. Comput. 2021, 70, 696–710. [Google Scholar] [CrossRef]
- Husham Almukhtar, F.; Abbas Ajwad, A.; Kamil, A.S.; Jaleel, R.A.; Adil Kamil, R.; Jalal Mosa, S. Deep Learning Techniques for Pattern Recognition in EEG Audio Signal-Processing-Based Eye-Closed and Eye-Open Cases. Electronics 2022, 11, 4029. [Google Scholar] [CrossRef]
- Guo, K.; Zeng, S.; Yu, J.; Wang, Y.; Yang, H. [DL] A survey of FPGA-based neural network inference accelerators. ACM Trans. Reconfigurable Technol. Syst. TRETS 2019, 12, 1–26. [Google Scholar] [CrossRef]
- Li, H.; Yue, X.; Wang, Z.; Wang, W.; Tomiyama, H.; Meng, L. A survey of Convolutional Neural Networks —From software to hardware and the applications in measurement. Meas. Sens. 2021, 18, 100080. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 770–778. [Google Scholar]
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4700–4708. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 4510–4520. [Google Scholar]
- Kuang, J.; Shao, M.; Wang, R.; Zuo, W.; Ding, W. Network pruning via probing the importance of filters. Int. J. Mach. Learn. Cybern. 2022, 13, 2403–2414. [Google Scholar] [CrossRef]
- Li, Y.; Gu, S.; Mayer, C.; Gool, L.V.; Timofte, R. Group sparsity: The hinge between filter pruning and decomposition for network compression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 8018–8027. [Google Scholar]
- Shawahna, A.; Sait, S.M.; El-Maleh, A. FPGA-based accelerators of deep learning networks for learning and classification: A review. IEEE Access 2018, 7, 7823–7859. [Google Scholar] [CrossRef]
- Misra, J.; Saha, I. Artificial neural networks in hardware: A survey of two decades of progress. Neurocomputing 2010, 74, 239–255. [Google Scholar] [CrossRef]
- Han, S.; Liu, X.; Mao, H.; Pu, J.; Pedram, A.; Horowitz, M.A.; Dally, W.J. EIE: Efficient inference engine on compressed deep neural network. ACM SIGARCH Comput. Archit. News 2016, 44, 243–254. [Google Scholar] [CrossRef]
- Chen, Y.H.; Emer, J.; Sze, V. Eyeriss: A spatial architecture for energy-efficient dataflow for convolutional neural networks. ACM SIGARCH Comput. Archit. News 2016, 44, 367–379. [Google Scholar] [CrossRef]
- Hameed, R.; Qadeer, W.; Wachs, M.; Azizi, O.; Solomatnikov, A.; Lee, B.C.; Richardson, S.; Kozyrakis, C.; Horowitz, M. Understanding sources of inefficiency in general-purpose chips. In Proceedings of the 37th Annual International Symposium on Computer Architecture, Saint-Malo, France, 19–23 June 2010; pp. 37–47. [Google Scholar]
- Keckler, S.W.; Dally, W.J.; Khailany, B.; Garland, M.; Glasco, D. GPUs and the Future of Parallel Computing. IEEE Micro 2011, 31, 7–17. [Google Scholar] [CrossRef]
- Chen, S.; Zhao, Q. Shallowing Deep Networks: Layer-Wise Pruning Based on Feature Representations. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 41, 3048–3056. [Google Scholar] [CrossRef]
- He, Y.; Zhang, X.; Sun, J. Channel Pruning for Accelerating Very Deep Neural Networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017. [Google Scholar]
- Gou, J.; Yu, B.; Maybank, S.J.; Tao, D. Knowledge distillation: A survey. Int. J. Comput. Vis. 2021, 129, 1789–1819. [Google Scholar] [CrossRef]
- Huang, Z.; Wang, N. Like what you like: Knowledge distill via neuron selectivity transfer. arXiv 2017, arXiv:1707.01219. [Google Scholar]
- Aghli, N.; Ribeiro, E. Combining weight pruning and knowledge distillation for cnn compression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 3191–3198. [Google Scholar]
- Hinton, G.; Vinyals, O.; Dean, J. Distilling the knowledge in a neural network. arXiv 2015, arXiv:1503.02531. [Google Scholar]
- CIFAR-10 and CIFAR-100 Datasets. Available online: https://www.cs.toronto.edu/~kriz/cifar.html (accessed on 3 October 2021).
- Loshchilov, I.; Hutter, F. SGDR: Stochastic Gradient Descent with Warm Restarts. arXiv 2016, arXiv:1608.03983. [Google Scholar]
Baseline (%) | Pruned Acc. (%) | Acc. ↓ (%) | FLOPs (M) | FLOPs ↓ (%) | Thin Layers | |
---|---|---|---|---|---|---|
ResNet-56 | 93.52 | 93.1 | 0.42 | 50.92 | 60.10 | 10 |
ResNet-110 | 93.76 | 93.34 | 0.42 | 62.34 | 75.75 | 31 |
DenseNet-40 | 94.53 | 94.07 | 0.46 | 210.56 | 28.03 | 10 |
Fused Acc. (%) | Acc. ↓ (%) | FLOPs (M) | FLOPs ↓ (%) | Depth | Fused Layers | |
---|---|---|---|---|---|---|
ResNet-56 | 92.75 | 0.77 | 35.59 | 72.11 | 24 | 32 |
ResNet-110 | 93.04 | 0.72 | 51.28 | 80.05 | 46 | 64 |
DenseNet-40 | 93.66 | 0.87 | 176.10 | 39.81 | 24 | 16 |
ResNet-56 | 93.04 | 0.48 | 46.85 | 63.29 | 40 | 16 |
ResNet-110 | 93.38 | 0.38 | 57.14 | 77.77 | 62 | 48 |
DenseNet-40 | 94.07 | 0.46 | 187.54 | 35.90 | 28 | 12 |
Acc. (%) | Acc. ↓ (%) | FLOPs (M) | FLOPs ↓ (%) | |
---|---|---|---|---|
Baseline | 90.21 | - | 59.2 | - |
After dynamic pruning | 89.56 | 0.65 | 38.75 | 34.54 |
After layer fusion | 89.29 | 0.92 | 37.60 | 36.48 |
Dataset | Model | Original Acc. (%) | Compressed Acc. (%) | Acc. ↓ (%) | Original FLOPs (M) | Compressed FLOPs (M) | FLOPs ↓ (%) |
---|---|---|---|---|---|---|---|
CIFAR10 | ResNet-56 | 93.52 | 92.75 | 0.77 | 127.62 | 35.59 | 72.11 |
ResNet-110 | 93.76 | 93.04 | 0.72 | 257.09 | 51.28 | 80.05 | |
DenseNet-40 | 94.53 | 93.66 | 0.87 | 292.56 | 176.1 | 39.80 | |
ImageNet50 | DenseNet-121 | 90.21 | 89.29 | 0.92 | 59.20 | 37.60 | 36.48 |
Acc. by Proposal (%) | Acc. from Scratch (%) | Acc. Improved (%) | |
---|---|---|---|
ResNet-56 | 92.75 | 91.65 | 1.10 |
ResNet-110 | 93.04 | 92.31 | 0.73 |
DenseNet-40 | 93.66 | 93.25 | 0.41 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, Q.; Li, H.; Meng, L. Deep Learning Architecture Improvement Based on Dynamic Pruning and Layer Fusion. Electronics 2023, 12, 1208. https://doi.org/10.3390/electronics12051208
Li Q, Li H, Meng L. Deep Learning Architecture Improvement Based on Dynamic Pruning and Layer Fusion. Electronics. 2023; 12(5):1208. https://doi.org/10.3390/electronics12051208
Chicago/Turabian StyleLi, Qi, Hengyi Li, and Lin Meng. 2023. "Deep Learning Architecture Improvement Based on Dynamic Pruning and Layer Fusion" Electronics 12, no. 5: 1208. https://doi.org/10.3390/electronics12051208
APA StyleLi, Q., Li, H., & Meng, L. (2023). Deep Learning Architecture Improvement Based on Dynamic Pruning and Layer Fusion. Electronics, 12(5), 1208. https://doi.org/10.3390/electronics12051208