Pattern Classification Using Quantized Neural Networks for FPGA-Based Low-Power IoT Devices
Abstract
:1. Introduction
- The paper analyzes the effect of pattern classification on various DNN classifiers on a IoT based hardware platform, including CNN, QNN, and BNN, and their implementation on an FPGA based IoT platform.
- The hardware used in the work is low power, compatible with Python, and mobile, which can also connect to the cloud, making it more compatible with IoT devices.
- Using the architecture of a BNN, we can reduce the computing time without much variation in the accuracy.
- We use the MNIST and CIFAR-10 databases for our analysis in terms of the prediction accuracy, weight bit error rate, RoC curve, and execution time on the PYNQ Z2 FPGA board.
2. Related Work
3. Background and System Concept
3.1. Convolution Neural Network (CNN)
3.2. Binarized Neural Network (BNN)
3.3. Quantized Neural Network (QNN)
- Exporting DNN weights and encoding them in a suitable format for on-target inference.
- Creating an inference program based on the DNN’s architecture.
- Compiling the program.
- Uploading a weighted inference program to the IoT platform.
3.4. Overall Process for Deploying the Algorithms
- Import the MNIST and CIFAR-10 database sets.
- Set the parameters required for training.
- Load a DNN classifier, i.e., CNN, BNN, or QNN.
- Perform DNN on the CPU and also on the FPGA-based IoT device.
- Observe and analyze the parametric results.
4. Results and Discussion
4.1. MNIST Dataset
4.2. CIFAR-10
4.3. Performance Measures
- Prediction accuracy
- Weight bit error
- RoC curve
- Power consumption
- Execution time.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Kousik, N.; Natarajan, Y.; Raja, R.A.; Kallam, S.; Patan, R.; Gandomi, A.H. Improved salient object detection using hybrid Convolution Recurrent Neural Network. Expert Syst. Appl. 2021, 166, 114064. [Google Scholar] [CrossRef]
- Pérez-Hernández, F.; Tabik, S.; Lamas, A.; Olmos, R.; Fujita, H.; Herrera, F. Object detection binary classifiers methodology based on deep learning to identify small objects handled similarly: Application in video surveillance. Knowl.-Based Syst. 2020, 194, 105590. [Google Scholar] [CrossRef]
- Zhao, Z.Q.; Zheng, P.; Xu, S.t.; Wu, X. Object detection with deep learning: A review. IEEE Trans. Neural Netw. Learn. Syst. 2019, 30, 3212–3232. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Wang, W.; Lai, Q.; Fu, H.; Shen, J.; Ling, H.; Yang, R. Salient object detection in the deep learning era: An in-depth survey. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 3239–3259. [Google Scholar] [CrossRef] [PubMed]
- Ghatwary, N.; Zolgharni, M.; Ye, X. Early esophageal adenocarcinoma detection using deep learning methods. Int. J. Comput. Assist. Radiol. Surg. 2019, 14, 611–621. [Google Scholar] [CrossRef] [Green Version]
- Liu, L.; Ouyang, W.; Wang, X.; Fieguth, P.; Chen, J.; Liu, X.; Pietikäinen, M. Deep learning for generic object detection: A survey. Int. J. Comput. Vis. 2020, 128, 261–318. [Google Scholar] [CrossRef] [Green Version]
- Wu, X.; Sahoo, D.; Hoi, S.C. Recent advances in deep learning for object detection. Neurocomputing 2020, 396, 39–64. [Google Scholar] [CrossRef] [Green Version]
- Chen, Y.; Jiang, H.; Li, C.; Jia, X.; Ghamisi, P. Deep feature extraction and classification of hyperspectral images based on convolutional neural networks. IEEE Trans. Geosci. Remote Sens. 2016, 54, 6232–6251. [Google Scholar] [CrossRef] [Green Version]
- Li, K.; Wan, G.; Cheng, G.; Meng, L.; Han, J. Object detection in optical remote sensing images: A survey and a new benchmark. ISPRS J. Photogramm. Remote. Sens. 2020, 159, 296–307. [Google Scholar] [CrossRef]
- Lin, Z.; Yih, M.; Ota, J.M.; Owens, J.D.; Muyan-Özçelik, P. Benchmarking deep learning frameworks and investigating FPGA deployment for traffic sign classification and detection. IEEE Trans. Intell. Veh. 2019, 4, 385–395. [Google Scholar] [CrossRef]
- Zhu, J.; Wang, L.; Liu, H.; Tian, S.; Deng, Q.; Li, J. An efficient task assignment framework to accelerate DPU-based convolutional neural network inference on FPGAs. IEEE Access 2020, 8, 83224–83237. [Google Scholar] [CrossRef]
- Blaiech, A.G.; Khalifa, K.B.; Valderrama, C.; Fernandes, M.A.; Bedoui, M.H. A survey and taxonomy of FPGA-based deep learning accelerators. J. Syst. Arch. 2019, 98, 331–345. [Google Scholar] [CrossRef]
- Li, S.; Luo, Y.; Sun, K.; Yadav, N.; Choi, K.K. A novel FPGA accelerator design for real-time and ultra-low power deep convolutional neural networks compared with titan X GPU. IEEE Access 2020, 8, 105455–105471. [Google Scholar] [CrossRef]
- Giefer, L.A.; Staar, B.; Freitag, M. FPGA-Based Optical Surface Inspection of Wind Turbine Rotor Blades Using Quantized Neural Networks. Electronics 2020, 9, 1824. [Google Scholar] [CrossRef]
- Chu, T.; Luo, Q.; Yang, J.; Huang, X. Mixed-precision quantized neural networks with progressively decreasing bitwidth. Pattern Recognit. 2021, 111, 107647. [Google Scholar] [CrossRef]
- Qin, H.; Gong, R.; Liu, X.; Bai, X.; Song, J.; Sebe, N. Binary neural networks: A survey. Pattern Recognit. 2020, 105, 107281. [Google Scholar] [CrossRef] [Green Version]
- Austin, J.; Kennedy, J. Presence, a hardware implementation of binary neural networks. In Proceedings of the International Conference on Artificial Neural Networks, Skövde, Sweden, 2–4 September 1998; Springer: London, UK, 1998; pp. 469–474. [Google Scholar]
- Kumar, V.; Baskar, D.; Arunsi, M.; Jenova, R.; Majid, M. VLSI design and implementation of High-performance Binary-weighted convolutional artificial neural networks for embedded vision based Internet of Things (IoT). Procedia Comput. Sci. 2019, 163, 639–647. [Google Scholar]
- Reiter, P.; Karagiannakis, P.; Ireland, M.; Greenland, S.; Crockett, L. FPGA acceleration of a quantized neural network for remote-sensed cloud detection. In Proceedings of the 7th International Workshop on On-Board Payload Data Compression, Virtual, 21–23 September 2020. [Google Scholar]
- Cheng, W.; Lin, C.; Shih, Y.Y. An Efficient Implementation of Convolutional Neural Network With CLIP-Q Quantization on FPGA. IEEE Trans. Circuits Syst. I Regul. Pap. 2022, 69, 4093–4102. [Google Scholar] [CrossRef]
- Lybrand, E.; Saab, R. A Greedy Algorithm for Quantizing Neural Networks. J. Mach. Learn. Res. 2021, 22, 156-1. [Google Scholar]
- Yu, H.; Han, Q.; Li, J.; Shi, J.; Cheng, G.; Fan, B. Search what you want: Barrier panelty nas for mixed precision quantization. In Proceedings of the European Conference on Computer Vision, Glasgow, UK, 23–28 August 2020; Springer: Cham, Switzerland, 2020; pp. 1–16. [Google Scholar]
- Bartan, B.; Pilanci, M. Training quantized neural networks to global optimality via semidefinite programming. In Proceedings of the International Conference on Machine Learning, Virtual, 18–24 July 2021; pp. 694–704. [Google Scholar]
- Chen, J.; Liu, L.; Liu, Y.; Zeng, X. A learning framework for n-bit quantized neural networks toward FPGAs. IEEE Trans. Neural Netw. Learn. Syst. 2020, 32, 1067–1081. [Google Scholar] [CrossRef] [Green Version]
- Wang, Z.; Lu, J.; Tao, C.; Zhou, J.; Tian, Q. Learning Channel-Wise Interactions for Binary Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 568–577. [Google Scholar]
- Jain, D.K. An evaluation of deep learning based object detection strategies for threat object detection in baggage security imagery. Pattern Recognit. Lett. 2019, 120, 112–119. [Google Scholar]
- Ariji, Y.; Yanashita, Y.; Kutsuna, S.; Muramatsu, C.; Fukuda, M.; Kise, Y.; Nozawa, M.; Kuwada, C.; Fujita, H.; Katsumata, A.; et al. Automatic detection and classification of radiolucent lesions in the mandible on panoramic radiographs using a deep learning object detection technique. Oral Surg. Oral Med. Oral Pathol. Oral Radiol. 2019, 128, 424–430. [Google Scholar] [CrossRef] [PubMed]
- Novac, P.E.; Hacene, G.B.; Pegatoquet, A.; Miramond, B.; Gripon, V. Quantization and Deployment of Deep Neural Networks on Microcontrollers. Sensors 2021, 21, 2984. [Google Scholar] [CrossRef] [PubMed]
- Belabed, T.; Quenon, A.; Da Silva, V.R.G.; Sakuyama, C.A.V.; Souani, C. Full Python Interface Control: Auto Generation And Adaptation of Deep Neural Networks For Edge Computing and IoT Applications FPGA-Based Acceleration. In Proceedings of the 2021 International Conference on INnovations in Intelligent SysTems and Applications (INISTA), Kocaeli, Turkey, 25–27 August 2021; pp. 1–6. [Google Scholar]
- Deng, L. The mnist database of handwritten digit images for machine learning research [best of the web]. IEEE Signal Process. Mag. 2012, 29, 141–142. [Google Scholar] [CrossRef]
- Doon, R.; Rawat, T.K.; Gautam, S. Cifar-10 classification using deep convolutional neural network. In Proceedings of the 2018 IEEE Punecon, Pune, India, 30 November–2 December 2018; pp. 1–5. [Google Scholar]
Model | CPU | ZYNQ Z2 Board |
---|---|---|
MNIST | 0.3 ms | 2.9 ms |
CIFAR-10 | 20 ms | 160 ms |
Model | CPU | ZYNQ Z2 Board |
---|---|---|
MNIST | 0.6 ms | 4.7 ms |
CIFAR-10 | 24 ms | 174 ms |
Model | CPU | ZYNQ Z2 Board |
---|---|---|
MNIST | 0.7 ms | 5.8 ms |
CIFAR-10 | 27 ms | 180 ms |
Dataset | Inference Time (s) | Accuracy (%) |
---|---|---|
MNIST (FP 32) | 79.56 × | 98.3 |
CIFAR-10 (FP 32) | 385.74 × | 82.3 |
Dataset | Inference Time (s) | Accuracy (%) |
---|---|---|
MNIST (FP 32) | 8.41 × | 95.5 |
CIFAR-10 (FP 32) | 327.74 × | 79.22 |
Platform | Precision | Power Consumption |
---|---|---|
MNIST FPGA | FP 32 | 2.70 W |
MNIST FPGA | INT 8 | 2.54 W |
CIFAR-10 FPGA | FP 32 | 2.94 W |
CIFAR-10 FPGA | INT 8 | 2.66 W |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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
Biswal, M.R.; Delwar, T.S.; Siddique, A.; Behera, P.; Choi, Y.; Ryu, J.-Y. Pattern Classification Using Quantized Neural Networks for FPGA-Based Low-Power IoT Devices. Sensors 2022, 22, 8694. https://doi.org/10.3390/s22228694
Biswal MR, Delwar TS, Siddique A, Behera P, Choi Y, Ryu J-Y. Pattern Classification Using Quantized Neural Networks for FPGA-Based Low-Power IoT Devices. Sensors. 2022; 22(22):8694. https://doi.org/10.3390/s22228694
Chicago/Turabian StyleBiswal, Manas Ranjan, Tahesin Samira Delwar, Abrar Siddique, Prangyadarsini Behera, Yeji Choi, and Jee-Youl Ryu. 2022. "Pattern Classification Using Quantized Neural Networks for FPGA-Based Low-Power IoT Devices" Sensors 22, no. 22: 8694. https://doi.org/10.3390/s22228694
APA StyleBiswal, M. R., Delwar, T. S., Siddique, A., Behera, P., Choi, Y., & Ryu, J.-Y. (2022). Pattern Classification Using Quantized Neural Networks for FPGA-Based Low-Power IoT Devices. Sensors, 22(22), 8694. https://doi.org/10.3390/s22228694