Researching the CNN Collaborative Inference Mechanism for Heterogeneous Edge Devices
Abstract
:1. Introduction
2. Related Work
3. System Model and Problem Formulation
3.1. System Model
3.2. Time Prediction Model
3.3. Pipeline Model
4. CNN Model-Partitioning Deployment and Optimization Methods
4.1. CNN Model-Partitioning Deployment and Optimization Methods
Algorithm 1: Model Partitioning |
1. Input: model: original model layer_partitions: List of pre-partitioned model layer names 2. Output: split_models: List of sub-models after partition 3. Initialize an empty model list: models = [] 4. for p = 0 to (len(layer_partitions) + 1) do 5. if p == 0 then 6. Save layer_partitions[p] to start 7. else 8. Save layer_partitions[p − 1] to start 9. end if 10. if p == len(layer_partitions) then 11. Set end to model output 12. Print model.output 13. else 14. Set end to layer_partitions[p] 15. end if 16. Construct submodel part ← construct_model(model,start,end,part_name) 17. split_models ← part 18. return split_models 19. end for |
Algorithm 2: Hecofer Deployment |
1. Input: split_models: List of sub-models after segmentation deviIPs: List of IP addresses of edge heterogeneous devices 2. Output: None (implementation model deployment) 3. for i = 0 to len(split_models) − 1 do 4. Set weights_sock to non-blocking mode 5. Set the weights_sock timeout period 6. model_json ← split_models[i] 7. weights_sock.connect ← (deviIPs[i], port) 8. if i != len(split_models) − 1 then 9. nextdevi = deviIPs[i + 1] 10. else 11. nextdevi = devisIP 12. end if 13. Send weights: send_weights(split_models[i].get_weights(), weights_sock, chunk_size) 14. Set model_sock to non-blocking mode 15. Set the model_sock timeout period 16. model_sock.connect ← (deviIPs[i], port) 17. Send nextdeviIP to deviIPs[i] 18. Monitor the model_socket waiting for acknowledgement 19. end for |
4.2. Hecofer Optimization Algorithm
5. Numerical Results
5.1. Experimental Environment
5.2. Experimental Dataset and Network Model
5.3. Evaluation Metrics
6. Experimental Results and Analysis
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Li, W.; Jin, S. Performance evaluation and optimization of a task offloading strategy on the mobile edge computing with edge heterogeneity. J. Supercomput. 2021, 77, 12486–12507. [Google Scholar] [CrossRef]
- Ren, W.; Qu, Y.; Dong, C.; Jing, Y.; Sun, H.; Wu, Q.; Guo, S. A Survey on Collaborative DNN Inference for Edge Intelligence. arXiv 2022, arXiv:2207.07812. [Google Scholar] [CrossRef]
- Ryan, M.D. Cloud computing privacy concerns on our doorstep. Commun. ACM 2011, 54, 36–38. [Google Scholar] [CrossRef]
- Cai, Q.; Zhou, Y.; Liu, L.; Qi, Y.; Pan, Z.; Zhang, H. Collaboration of heterogeneous edge computing paradigms: How to fill the gap between theory and practice. IEEE Wirel. Commun. 2023, 31, 110–117. [Google Scholar] [CrossRef]
- Naveen, S.; Kounte, M.R.; Ahmed, M.R. Low latency deep learning inference model for distributed intelligent IoT edge clusters. IEEE Access 2021, 9, 160607–160621. [Google Scholar] [CrossRef]
- Han, P.; Zhuang, X.; Zuo, H.; Lou, P.; Chen, X. The Lightweight Anchor Dynamic Assignment Algorithm for Object Detection. Sensors 2023, 23, 6306. [Google Scholar] [CrossRef] [PubMed]
- Manessi, F.; Rozza, A.; Bianco, S.; Napoletano, P.; Schettini, R. Automated pruning for deep neural network compression. In Proceedings of the 2018 24th International Conference on Pattern Recognition (ICPR), Beijing, China, 20–24 August 2018; pp. 657–664. [Google Scholar]
- Wu, J.; Leng, C.; Wang, Y.; Hu, Q.; Cheng, J. Quantized convolutional neural networks for mobile devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 4820–4828. [Google Scholar]
- Al-Quraan, M.; Mohjazi, L.; Bariah, L.; Centeno, A.; Zoha, A.; Arshad, K.; Assaleh, K.; Muhaidat, S.; Debbah, M.; Imran, M.A. Edge-native intelligence for 6G communications driven by federated learning: A survey of trends and challenges. IEEE Trans. Emerg. Top. Comput. Intell. 2023, 7, 957–979. [Google Scholar] [CrossRef]
- Gomes, B.; Soares, C.; Torres, J.M.; Karmali, K.; Karmali, S.; Moreira, R.S.; Sobral, P. An Efficient Edge Computing-Enabled Network for Used Cooking Oil Collection. Sensors 2024, 24, 2236. [Google Scholar] [CrossRef] [PubMed]
- Mao, J.; Chen, X.; Nixon, K.W.; Krieger, C.; Chen, Y. Modnn: Local distributed mobile computing system for deep neural network. In Proceedings of the Design, Automation & Test in Europe Conference & Exhibition (DATE), Lausanne, Switzerland, 27–31 March 2017; pp. 1396–1401. [Google Scholar]
- Zhang, S.; Zhang, S.; Qian, Z.; Wu, J.; Jin, Y.; Lu, S. Deepslicing: Collaborative and adaptive cnn inference with low latency. IEEE Trans. Parallel Distrib. Syst. 2021, 32, 2175–2187. [Google Scholar] [CrossRef]
- Hu, B.; Gao, Y.; Zhang, W.; Jia, D.; Liu, H. Computation Offloading and Resource Allocation in IoT-Based Mobile Edge Computing Systems. In Proceedings of the 2023 IEEE International Conference on Smart Internet of Things (SmartIoT), Xining, China, 25–27 August 2023; pp. 119–123. [Google Scholar]
- Chai, Z.; Hou, H.; Li, Y. A dynamic queuing model based distributed task offloading algorithm using deep reinforcement learning in mobile edge computing. Appl. Intell. 2023, 53, 28832–28847. [Google Scholar] [CrossRef]
- Liu, X.; Zheng, J.; Zhang, M.; Li, Y.; Wang, R.; He, Y. Multi-User Computation Offloading and Resource Allocation Algorithm in a Vehicular Edge Network. Sensors 2024, 24, 2205. [Google Scholar] [CrossRef] [PubMed]
- Zhou, L.; Samavatian, M.H.; Bacha, A.; Majumdar, S.; Teodorescu, R. Adaptive parallel execution of deep neural networks on heterogeneous edge devices. In Proceedings of the 4th ACM/IEEE Symposium on Edge Computing, Arlington, VA, USA, 7–9 November 2019; pp. 195–208. [Google Scholar]
- Zhao, Z.; Barijough, K.M.; Gerstlauer, A. Deepthings: Distributed adaptive deep learning inference on resource-constrained iot edge clusters. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2018, 37, 2348–2359. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, Y. DeepMECagent: Multi-agent computing resource allocation for UAV-assisted mobile edge computing in distributed IoT system. Appl. Intell. 2023, 53, 1180–1191. [Google Scholar] [CrossRef]
- Hu, Y.; Imes, C.; Zhao, X.; Kundu, S.; Beerel, P.A.; Crago, S.P.; Walters, J.P.N. Pipeline parallelism for inference on heterogeneous edge computing. arXiv 2021, arXiv:2110.14895. [Google Scholar]
- Hu, C.; Li, B. Distributed inference with deep learning models across heterogeneous edge devices. In Proceedings of the IEEE INFOCOM 2022-IEEE Conference on Computer Communications, Virtual Conference, 2–5 May 2022; pp. 330–339. [Google Scholar]
- Zeng, L.; Chen, X.; Zhou, Z.; Yang, L.; Zhang, J. Coedge: Cooperative dnn inference with adaptive workload partitioning over heterogeneous edge devices. IEEE/ACM Trans. Netw. 2020, 29, 595–608. [Google Scholar] [CrossRef]
- Yang, C.-Y.; Kuo, J.-J.; Sheu, J.-P.; Zheng, K.-J. Cooperative distributed deep neural network deployment with edge computing. In Proceedings of the ICC 2021-IEEE International Conference on Communications, Virtual Event, 14–23 June 2021; pp. 1–6. [Google Scholar]
- Li, Q.; Zhou, M.-T.; Ren, T.-F.; Jiang, C.-B.; Chen, Y. Partitioning multi-layer edge network for neural network collaborative computing. EURASIP J. Wirel. Commun. Netw. 2023, 2023, 80. [Google Scholar] [CrossRef]
- Guo, X.; Pimentel, A.D.; Stefanov, T. AutoDiCE: Fully Automated Distributed CNN Inference at the Edge. arXiv 2022, arXiv:2207.12113. [Google Scholar]
- Shan, N.; Ye, Z.; Cui, X. Collaborative intelligence: Accelerating deep neural network inference via device-edge synergy. Secur. Commun. Netw. 2020, 2020, 8831341. [Google Scholar] [CrossRef]
- Li, N.; Iosifidis, A.; Zhang, Q. Attention-based feature compression for cnn inference offloading in edge computing. In Proceedings of the ICC 2023-IEEE International Conference on Communications, Rome, Italy, 28 May–1 June 2023; pp. 967–972. [Google Scholar]
- Molchanov, P.; Tyree, S.; Karras, T.; Aila, T.; Kautz, J. Pruning convolutional neural networks for resource efficient inference. arXiv 2016, arXiv:1611.06440. [Google Scholar]
- Parthasarathy, A.; Krishnamachari, B. Defer: Distributed edge inference for deep neural networks. In Proceedings of the 2022 14th International Conference on COMmunication Systems & NETworkS (COMSNETS), Bangalore, India, 4–8 June 2022; pp. 749–753. [Google Scholar]
Notation | Description |
---|---|
Inference Task | |
model | |
Number of heterogeneous devices at the edge | |
The i-th edge collaborative device | |
The main edge device | |
sub-models | |
Computational delay | |
Transmission delay | |
Total latency of the reasoning task | |
latency of the device | |
submodel | |
inference tasks |
Method | Type | Parameters | Model Size (MB) | GFLOPS |
---|---|---|---|---|
AlexNet | CNN | 60,965,224 | 233 | 0.7 |
VGG-16 | CNN | 138,357,544 | 528 | 15.5 |
VGG-19 | CNN | 143,667,240 | 548 | 19.6 |
ResNet50 | CNN | 25,610,269 | 98 | 3.9 |
ResNetl01 | CNN | 44,654,608 | 170 | 7.6 |
ResNetl52 | CNN | 60,344,387 | 230 | 11.3 |
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. |
© 2024 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
Wang, J.; Chen, C.; Li, S.; Wang, C.; Cao, X.; Yang, L. Researching the CNN Collaborative Inference Mechanism for Heterogeneous Edge Devices. Sensors 2024, 24, 4176. https://doi.org/10.3390/s24134176
Wang J, Chen C, Li S, Wang C, Cao X, Yang L. Researching the CNN Collaborative Inference Mechanism for Heterogeneous Edge Devices. Sensors. 2024; 24(13):4176. https://doi.org/10.3390/s24134176
Chicago/Turabian StyleWang, Jian, Chong Chen, Shiwei Li, Chaoyong Wang, Xianzhi Cao, and Liusong Yang. 2024. "Researching the CNN Collaborative Inference Mechanism for Heterogeneous Edge Devices" Sensors 24, no. 13: 4176. https://doi.org/10.3390/s24134176
APA StyleWang, J., Chen, C., Li, S., Wang, C., Cao, X., & Yang, L. (2024). Researching the CNN Collaborative Inference Mechanism for Heterogeneous Edge Devices. Sensors, 24(13), 4176. https://doi.org/10.3390/s24134176