Submitted:
30 May 2023
Posted:
31 May 2023
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Data Acquisition
2.2. Data Augmentation
2.3. Feature Extraction
2.3.1. NasNet-A (mobile)
2.3.2. MobileNetV3 (small)
2.3.3. EfficientNetB0
2.4. Training of CNN architectures
2.5. Model Evaluation
2.6. Confusion Matrix
2.7. Deployment platforms
2.7.1. Mobile application development
2.7.2 Raspberry Pi 4
| Processor | Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz |
|---|---|
| RAM | 8GB LPDDR4-3200 SDRAM |
| Bluetooth | Bluetooth 5.0, BLE |
| Wi-Fi | 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless |
| USB | 2 USB 3.0 ports; 2 USB 2.0 ports |
| Ethernet | Gigabit Ethernet |
| HDMI | 2 × micro-HDMI ports (up to 4kp60 supported) |
| Storage | MicroSD Card Slot |
| Power Supply | 5.1V 3A USB Type C Power |
| Dimensions | 85.6mm × 56.5mm |
| Operating temperature | 0 to 50°C |
3. Results and discussion
3.1. Performance of the models
| Model | Training | Validation | Testing | Time per image (ms) | |||
|---|---|---|---|---|---|---|---|
| Loss | Accuracy | Loss | Accuracy | Loss | Accuracy | ||
| NasNet-A (mobile) | 0.499 | 0.946 | 0.459 | 0.959 | 0.455 | 0.968 | 38.36 |
| MobileNetV3 | 0.465 | 0.966 | 0.427 | 0.981 | 0.425 | 0.990 | 26.82 |
| EfficientNetB0 | 0.495 | 0.950 | 0.442 | 0.977 | 0.426 | 0.981 | 42.86 |
3.2. Performance of the deployed MobileNetV3 model
4. Conclusion
Author Contributions
Funding
Acknowledgements
Conflicts of Interest
References
- Food and Agriculture Organization (FAO). FAOSTAT Statistical Database of the United Nation Food and Agriculture Organization (FAO) statistical division; FAO: Rome, 2020. [Google Scholar]
- Singh, N. Pulses: an overview. Journal of Food Science and Technology 2017, 54, 853–857. [Google Scholar] [CrossRef]
- Havemeier, S.M.; Slavin, J. Pulses and Legumes: Nutritional Opportunities and Challenges. Cereal Foods World 2020, 65. [Google Scholar]
- Shevkani, K.; Singh, N.; Chen, Y.; Kaur, A.; Yu, L. Pulse proteins: secondary structure, functionality and applications. Journal of food science and technology 2019, 56, 2787–2798. [Google Scholar] [CrossRef]
- Barker, B. (2019). Understanding protein in pulses. Pulse Advisor. Saskatchewan Pulse Growers. pp.1.
- Wood, J.A.; Grusak, M.A. Nutritional value of chickpea. Chickpea breeding and management 2007, 101–142. [Google Scholar]
- Tiwari, U.; Bawa, A.S. Pulses: quality standards and evaluation. In Pulse Foods; Academic Press, 2021; pp. 351–368. [Google Scholar]
- Canadian Grain Commission. Pulse crops methods and tests. Winnipeg, MB, Canada, 2021. Available online: https://www.grainscanada.gc.ca/en/grain-research/export-quality/pulses/methods-tests.html (accessed on 20 May 2022).
- Pourdarbani, R.; Sabzi, S.; Kalantari, D.; Hernández-Hernández, J.L.; Arribas, J.I. A computer vision system based on majority-voting ensemble neural network for the automatic classification of three chickpea varieties. Foods 2020, 9, 113. [Google Scholar] [CrossRef]
- Maes, W.H.; Steppe, K. Perspectives for remote sensing with unmanned aerial vehicles in precision agriculture. Trends in plant science 2019, 24, 152–164. [Google Scholar] [CrossRef]
- Russakovsky, O.; Deng, J.; Su, H.; Krause, J.; Satheesh, S.; Ma, S.; Huang, Z.; Karpathy, A.; Khosla, A.; Bernstein, M.; Berg, A.C. Imagenet large scale visual recognition challenge. International journal of computer vision 2015, 115, 211–252. [Google Scholar] [CrossRef]
- Saha, D.; Manickavasagan, A. Chickpea varietal classification using deep convolutional neural networks with transfer learning. Journal of Food Process Engineering 2022, 45, e13975. [Google Scholar] [CrossRef]
- Osroosh, Y.; Khot, L.R.; Peters, R.T. Economical thermal-RGB imaging system for monitoring agricultural crops. Computers and Electronics in Agriculture 2018, 147, 34–43. [Google Scholar] [CrossRef]
- Nasir, A.; Arshah, R.A.; Ab Hamid, M.R.; Fahmy, S. An analysis on the dimensions of information security culture concept: A review. Journal of Information Security and Applications 2019, 44, 12–22. [Google Scholar] [CrossRef]
- Hsu, T.C.; Yang, H.; Chung, Y.C.; Hsu, C.H. A Creative IoT agriculture platform for cloud fog computing. Sustainable Computing: Informatics and Systems 2020, 28, 100285. [Google Scholar] [CrossRef]
- Morais, R.; Silva, N.; Mendes, J.; Adão, T.; Pádua, L.; López-Riquelme, J.A.; Pavón-Pulido, N.; Sousa, J.J.; Peres, E. mySense: A comprehensive data management environment to improve precision agriculture practices. Computers and Electronics in Agriculture 2019, 162, 882–894. [Google Scholar] [CrossRef]
- AOAC. Official Methods of Analysis, 18th ed.; Association of Official Analytical Chemists: Arlington, VA, USA, 2005. [Google Scholar]
- Shorten, C.; Khoshgoftaar, T. M. A survey on image data augmentation for deep learning. Journal of big data 2019, 6, 1–48. [Google Scholar] [CrossRef]
- Perez, L.; Wang, J. The effectiveness of data augmentation in image classification using deep learning. arXiv 2017, arXiv:1712.04621. [Google Scholar]
- Vallabhajosyula, S.; Sistla, V.; Kolli VK, K. Transfer learning-based deep ensemble neural network for plant leaf disease detection. Journal of Plant Diseases and Protection 2022, 129, 545–558. [Google Scholar] [CrossRef]
- Tan, M.; Le, Q. (2019, May). Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning (pp. 6105-6114). PMLR.
- Loni, M.; Sinaei, S.; Zoljodi, A.; Daneshtalab, M.; Sjödin, M. DeepMaker: A multi-objective optimization framework for deep neural networks in embedded systems. Microprocessors and Microsystems 2020, 73, 102989. [Google Scholar] [CrossRef]
- Young, S.R.; Rose, D.C.; Karnowski, T.P.; Lim, S.H.; Patton, R.M. (2015). Optimizing deep learning hyper-parameters through an evolutionary algorithm. In Proceedings of the workshop on machine learning in high-performance computing environments (pp. 1-5).
- Saxen, F.; Werner, P.; Handrich, S.; Othman, E.; Dinges, L.; Al-Hamadi, A. (2019, September). Face attribute detection with mobilenetv2 and nasnet-mobile. In 2019 11th International Symposium on Image and Signal Processing and Analysis (ISPA) (pp. 176-180). IEEE.
- Koonce, B.; Koonce, B. MobileNetV3. Convolutional Neural Networks with Swift for Tensorflow: Image Recognition and Dataset Categorization 2021, 125-144.
- Montalbo, F.J.P.; Alon, A.S. Empirical analysis of a fine-tuned deep convolutional model in classifying and detecting malaria parasites from blood smears. KSII Transactions on Internet and Information Systems (TIIS) 2021, 15, 147–165. [Google Scholar]
- Lei, Y.; Hu, T.; Tang, K. Generalization performance of multi-pass stochastic gradient descent with convex loss functions. The Journal of Machine Learning Research 2021, 22, 1145–1185. [Google Scholar]
- Chandel, N.S.; Chakraborty, S.K.; Rajwade, Y.A.; Dubey, K.; Tiwari, M.K.; Jat, D. Identifying crop water stress using deep learning models. Neural Computing and Applications 2021, 33, 5353–5367. [Google Scholar] [CrossRef]
- Zhou, L.; Zhang, C.; Liu, F.; Qiu, Z.; He, Y. Application of deep learning in food: a review. Comprehensive reviews in food science and food safety 2019, 18, 1793–1811. [Google Scholar] [CrossRef]
- Gonzalez-Huitron, V.; León-Borges, J.A.; Rodriguez-Mata, A.E.; Amabilis-Sosa, L.E.; Ramírez-Pereda, B.; Rodriguez, H. Disease detection in tomato leaves via CNN with lightweight architectures implemented in Raspberry Pi 4. Computers and Electronics in Agriculture 2021, 181, 105951. [Google Scholar] [CrossRef]
- Elwirehardja, G.N.; Prayoga, J.S. Oil palm fresh fruit bunch ripeness classification on mobile devices using deep learning approaches. Computers and Electronics in Agriculture 2021, 188, 106359. [Google Scholar]
- Ye, J.; Li, X.; Zhang, X.; Zhang, Q.; Chen, W. Deep learning-based human activity real-time recognition for pedestrian navigation. Sensors 2020, 20, 2574. [Google Scholar] [CrossRef]
- Zebin, T.; Scully, P.J.; Peek, N.; Casson, A.J.; Ozanyan, K.B. Design and implementation of a convolutional neural network on an edge computing smartphone for human activity recognition. IEEE Access 2019, 7, 133509–133520. [Google Scholar] [CrossRef]
- Jain, S.; Vaibhav, A.; Goyal, L. (2014, February). Raspberry Pi based interactive home automation system through E-mail. In 2014 International Conference on Reliability Optimization and Information Technology (ICROIT) (pp. 277-280). IEEE.
- Abd Elaziz, M.; Dahou, A.; Alsaleh, N.A.; Elsheikh, A.H.; Saba, A.I.; Ahmadein, M. Boosting COVID-19 image classification using MobileNetV3 and aquila optimizer algorithm. Entropy 2021, 23, 1383. [Google Scholar] [CrossRef]
- Mahbod, A.; Schaefer, G.; Wang, C.; Dorffner, G.; Ecker, R.; Ellinger, I. Transfer learning using a multi-scale and multi-network ensemble for skin lesion classification. Computer methods and programs in biomedicine 2020, 193, 105475. [Google Scholar] [CrossRef]
- Xie, W.; Wei, S.; Zheng, Z.; Yang, D. A CNN-based lightweight ensemble model for detecting defective carrots. Biosystems Engineering 2021, 208, 287–299. [Google Scholar] [CrossRef]






| Parameter | Value |
|---|---|
| Rotation Range | 40 |
| Horizontal Flip | True |
| Width Shift Range | 0.2 |
| Height Shift Range | 0.2 |
| Shear Range | 0.2 |
| Zoom Range | 0.2 |
| Stage | Operator | Resolution | Channels | Layers |
|---|---|---|---|---|
| 1 | Conv2D, 3x3 | 224 x 224 | 3 | 1 |
| 2 | Reduction Cell | 111 x 111 | 32 | 2 |
| 3 | Normal Cell | 28 x 28 | 44 | 4 |
| 4 | Reduction Cell | 28 x 28 | 88 | 1 |
| 5 | Normal Cell | 14 x 14 | 88 | 4 |
| 6 | Reduction Cell | 14 x 14 | 176 | 1 |
| 7 | Normal Cell | 7 x 7 | 176 | 4 |
| Stage | Operator | Resolution | Channels | Layers |
|---|---|---|---|---|
| 1 | Conv2d, 3x3 | 224 x 224 | 3 | 2 |
| 2 | Bottleneck, 3x3 | 112 x 112 | 16 | 2 |
| 3 | Bottleneck, 3x3 | 56 x 56 | 16 | 2 |
| 4 | Bottleneck, 3x3 | 28 x 28 | 24 | 1 |
| 5 | Bottleneck, 3x3 | 28 x 28 | 24 | 2 |
| 6 | Bottleneck, 3x3 | 14 x 14 | 40 | 1 |
| 7 | Bottleneck, 3x3 | 14 x 14 | 40 | 1 |
| 8 | Bottleneck, 3x3 | 14 x 14 | 40 | 1 |
| 9 | Bottleneck, 3x3 | 14 x 14 | 48 | 1 |
| 10 | Bottleneck, 3x3 | 14 x 14 | 48 | 2 |
| 11 | Bottleneck, 3x3 | 7 x 7 | 96 | 1 |
| 12 | Bottleneck, 3x3 | 7 x 7 | 96 | 1 |
| 13 | Conv2d, 1x1 | 7 x 7 | 96 | 1 |
| 14 | Pool | 7 x 7 | 576 | 1 |
| 15 | Conv2D, 1x1, NBH | 1 x 1 | 576 | 1 |
| 16 | Conv2D, 1x1, NBH | 1 x 1 | 1024 | 1 |
| Stage | Operator | Resolution | Channels | Layers |
|---|---|---|---|---|
| 1 | Conv2d, 3x3 | 224 x 224 | 32 | 1 |
| 2 | MBConv1, k 3x3 | 112 x 112 | 16 | 1 |
| 3 | MBConv6, k 3x3 | 112 x 112 | 24 | 2 |
| 4 | MBConv6, k 5x5 | 56 x 56 | 40 | 2 |
| 5 | MBConv6, k 3x3 | 28 x 28 | 80 | 3 |
| 6 | MBConv6, k 5x5 | 14 x 14 | 112 | 3 |
| 7 | MBConv6, k 5x5 | 14 x 14 | 192 | 4 |
| 8 | MBConv6, k 3x3 | 7 x 7 | 320 | 1 |
| 9 | Conv2D, 1x1 | 7 x 7 | 1280 | 1 |
| Parameters | Values |
|---|---|
| Max Epochs | 5 |
| Mini Batch Size | 32 |
| Optimizer | Stochastic Gradient Descent (SGD) |
| Initial Learning Rate | 0.005 |
| Momentum | 0.9 |
| Loss Function | Categorical Cross entropy |
| Consul | Cory | Leader | Orion | Specificity | Sensitivity | |
|---|---|---|---|---|---|---|
| Consul | 57 | 0 | 0 | 0 | 1 | 1 |
| Cory | 0 | 54 | 0 | 0 | 1 | 1 |
| Leader | 0 | 0 | 46 | 4 | 0.982 | 0.921 |
| Orion | 0 | 0 | 3 | 56 | 0.975 | 0.949 |
| Precision | 1 | 1 | 0.938 | 0.933 |
| Consul | Cory | Leader | Orion | Specificity | Sensitivity | |
|---|---|---|---|---|---|---|
| Consul | 61 | 0 | 0 | 0 | 1 | 1 |
| Cory | 0 | 58 | 0 | 0 | 1 | 1 |
| Leader | 0 | 0 | 50 | 0 | 0.988 | 1 |
| Orion | 0 | 0 | 2 | 49 | 1 | 0.961 |
| Precision | 1 | 1 | 0.961 | 1 |
| Consul | Cory | Leader | Orion | Specificity | Sensitivity | |
|---|---|---|---|---|---|---|
| Consul | 49 | 0 | 0 | 0 | 1 | 1 |
| Cory | 0 | 50 | 0 | 0 | 1 | 1 |
| Leader | 0 | 0 | 54 | 2 | 0.988 | 0.964 |
| Orion | 0 | 0 | 2 | 63 | 0.987 | 0.969 |
| Precision | 1 | 1 | 0.964 | 0.969 |
| Consul | Cory | Leader | Orion | Specificity | Sensitivity | |
|---|---|---|---|---|---|---|
| Consul | 100 | 0 | 0 | 0 | 1 | 1 |
| Cory | 0 | 100 | 0 | 0 | 1 | 1 |
| Leader | 0 | 0 | 100 | 0 | 1 | 1 |
| Orion | 0 | 0 | 0 | 100 | 1 | 1 |
| Precision | 1 | 1 | 1 | 1 |
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 (http://creativecommons.org/licenses/by/4.0/).