A Novel Classification Model of Date Fruit Dataset Using Deep Transfer Learning
Abstract
:1. Introduction
- We design a novel date fruit dataset collected by picturing 3228 date images classified into 27 classes.
- We provide a comprehensive review of existing date fruit datasets with their characteristics, limitations, and proposed classification method.
- We manage and process the imbalanced classes using a class weight approach that assigns a higher value to a minority population.
- The overall weight is calculated by measuring the weight for each assigned class and their training samples. The weighted average is calculated by calculating all assigned class weights.
- We apply different machine learning algorithms as a baseline score for the classification of date fruit.
- We apply deep transfer learning using DenseNet architecture based on CNN that provides efficient overhead with less than half the number of parameters compared to other models.
- We perform fine-tuning on the feature extraction model to enhance the validation accuracy.
- The fully connected layer of the model is fine-tuned to achieve the best classification configurations of the model.
- We perform a regularization process on the classification layer to reduce the complexity of the deep learning network.
2. Related Works
2.1. Background of Date Fruit
2.2. State of the Art in Datasets
2.3. Major Limitations of the Existing Datasets
2.4. Research Gap Finding
3. Proposed Date Fruit Dataset
3.1. Image Acquisition
3.2. Proposed Model Flowchart
3.3. Dataset Classes
4. Experimental Results
4.1. Stage 1: Traditional Machine Learning Models
4.2. Stage 2: Deep Transfer Learning Model
4.3. Stage 3: Tuning Feature Extraction Part of Deep Learning Model
4.4. Stage 4: Model-Tuning Classification
4.5. Stage 5: Regularization of Model Classification Layers
5. Overall Classification of Dates’ Fruit Classes
6. Conclusions and Future Works
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- The Food and Agriculture Organization. Available online: http://www.fao.org/faostat/en/#data/QC/visualize (accessed on 28 November 2022).
- Altaheri, H.; Alsulaiman, M.; Muhammad, G. Date Fruit Classification for Robotic Harvesting in a Natural Environment using Deep Learning. IEEE Access 2019, 7, 117115–117133. [Google Scholar] [CrossRef]
- Sa, I.; Ge, Z.; Dayoub, F.; Upcroft, B.; Perez, T.; McCool, C. DeepFruits: A Fruit Detection System using Deep Neural Networks. Sensors 2016, 16, 1222. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Castro, W.; Oblitas, J.; De-La-Torre, M.; Cotrina, C.; Bazan, K.; Avila-George, H. Classification of Cape Gooseberry Fruit According to its Level of Ripeness using Machine Learning Techniques and Different Color Spaces. IEEE Access 2019, 7, 27389–27400. [Google Scholar] [CrossRef]
- Cardenas-Pérez, S.; Chanona-Pérez, J.; Méndez, J.; Domínguez, G.; Santiago, R.; Perea-Flores, M.; Vazquez, I. Evaluation of the Ripening Stages of Apple (Golden Delicious) by Means of Computer Vision System. Biosyst. Eng. 2017, 159, 46–58. [Google Scholar] [CrossRef]
- Lal, S.; Behera, S.; Sethy, P.K.; Rath, A. Identification and Counting of Mature Apple Fruit Based on Bp Feed Forward Neural Network. In Proceedings of the IEEE Third International Conference on Sensing, Signal Processing and Security (ICSSS), Chennai, India, 19 October 2017. [Google Scholar] [CrossRef]
- Yu, Y.; Velastin, S.; Yin, F. Automatic Grading of Apples Based on Multi-Features and Weighted K- Means Clustering Algorithm. Inf. Process. Agric. 2019, 7, 556–565. [Google Scholar] [CrossRef]
- Jaramillo-Acevedo, C.; Choque-Valderrama, W.; Guerrero-Álvarez, G.; Meneses-Escobar, C. Hass Avocado Ripeness Classification by Mobile Devices using Digital Image Processing and Ann Methods. Int. J. Food Eng. 2020, 16, 1–8. [Google Scholar] [CrossRef]
- Huang, P.; Zhu, L.; Zhang, Z.; Yang, C. Row End Detection and Head Land Turning Control for An Autonomous Banana-Picking Robot. Machines 2021, 9, 103. [Google Scholar] [CrossRef]
- Kipli, K.; Zen, H.; Sawawi, M.; Noor, M.; Julai, N.; Junaidi, N.; Razali, M.; Chin, L.; Masra, S.H. Image Processing Mobile Application for Banana Ripeness Evaluation. In Proceedings of the IEEE International Conference on Computational Approach in Smart Systems Design and Applications (ICASSDA), Kuching, Malaysia, 30 September 2018. [Google Scholar] [CrossRef]
- Mazen, F.; Nashat, A. Ripeness Classification of Bananas Using an Artificial Neural Network. Arab. J. Sci. Eng. 2019, 44, 6901–6910. [Google Scholar] [CrossRef]
- Muhammad, G. Automatic Date Fruit Classification by Using Local Texture Descriptors and Shape-Size Features. In Proceedings of the IEEE European Modelling Symposium, Pisa, Italy, 13 July 2015. [Google Scholar] [CrossRef]
- Luo, L.; Liu, W.; Lu, Q.; Wang, J.; Wen, W.; Yan, D.; Tang, Y. Grape Berry Detection and Size Measurement Based on Edge Image Processing and Geometric Morphology. Machines 2021, 9, 233. [Google Scholar] [CrossRef]
- Pourdarbani, R.; Ghassemzadeh, H.; Seyedarabi, H.; Nahandi, F.; Vahed, M. Study on an Automatic Sorting System for Date Fruits. J. Saudi Soc. Agric. Sci. 2015, 14, 83–90. [Google Scholar] [CrossRef] [Green Version]
- Abdulkadir, A. Application of Image Processing and Neural Networks in Determining the Readiness of Maize. In Proceedings of the ACM 2nd International Conference on Machine Learning and Soft Computing, New York, NY, USA, 2–4 February 2018. [Google Scholar] [CrossRef]
- Nandi, C.; Tudu, B.; Koley, C. A Machine Vision-Based Maturity Prediction System for Sorting of Harvested Mangoes. IEEE Trans. Instrum. Meas. 2014, 63, 1722–1730. [Google Scholar] [CrossRef]
- Thinh, N.; Thong, N.; Cong, H.; Phong, T. Mango Classification System based on Machine Vision and Artificial Intelligence. In Proceedings of the IEEE International Conference on Control, Mechatronics and Automation (ICCMA), Delft, The Netherlands, 10 February 2020. [Google Scholar] [CrossRef]
- Arthur, Z.; Hugo, E.; Juliana, A. Computer Vision based Detection of External Defects on Tomatoes using Deep Learning. Biosyst. Eng. 2020, 190, 131–144. [Google Scholar] [CrossRef]
- Kaur, S.; Girdhar, A.; Gill, J. Computer Vision-based Tomato Grading and Sorting. Adv. Data Inf. Sci. 2018, 38, 75–84. [Google Scholar] [CrossRef]
- Chen, M.; Tang, Y.; Zou, X.; Huang, Z.; Zhou, H.; Chen, S. 3D Global Mapping of Large Scale Unstructured Orchard Integrating Eye-In-Hand Stereo Vision and Slam. Comput. Electron. Agric. 2021, 187, 106237. [Google Scholar] [CrossRef]
- Faisal, M.; Alsulaiman, M.; Arafah, M.; Mekhtiche, M. IHDS: Intelligent Harvesting Decision System for Date Fruit Based on Maturity Stage using Deep Learning and Computer Vision. IEEE Access 2020, 8, 167985–167997. [Google Scholar] [CrossRef]
- Najeeb, T.; Safar, M. Dates Maturity Status and Classification using Image Processing. In Proceedings of the IEEE International Conference on Computing Sciences and Engineering (ICCSE), Kuwait, Kuwait, 7 June 2018. [Google Scholar] [CrossRef]
- Altaheri, H.; Alsulaiman, M.; Muhammad, G.; Amin, S.; Bencherif, M.; Mekhtiche, M. Date Fruit Dataset for Intelligent Harvesting. Data Brief 2019, 26, 104514. [Google Scholar] [CrossRef]
- Scaria, B.; Aziz, N.; Siddiqi, M. AI based Robotic Systems for the Quality Control of Date Palm Fruits-A Review. In Proceedings of the IEEE International Conference on Digitization (ICD), Sharjah, United Arab Emirates, 2 June 2020. [Google Scholar] [CrossRef]
- Diboun, I.; Mathew, S.; Al-Rayyashi, M.; Elrayess, M.; Torres, M.; Halama, A.; Meret, M.; Mohney, R.; Karoly, E.; Malek, J. Metabolomics of Dates (Phoenix Dactylifera) Reveals a Highly Dynamic Ripening Process Accounting for Major Variation in Fruit Composition. BMC Plant Biol. 2015, 15, 291. [Google Scholar] [CrossRef] [Green Version]
- Nasiri, A.; Garavand, A.; Zhang, Y. Image-Based Deep Learning Automated Sorting of Date Fruit. Postharvest Biol. Technol. 2019, 153, 133–141. [Google Scholar] [CrossRef]
- Quaglia, M.; Santinelli, M.; Sulyok, M.; Onofri, A.; Covarelli, L.; Beccari, G. Aspergillus, Penicillium and Cladosporium Species Associated with Dried Date Fruits Collected in the Perugia (Umbria, Central Italy) Market. Int. J. Food Microbiol. 2020, 322, 108585. [Google Scholar] [CrossRef]
- Ammari, A.; Khriji, L.; Awadalla, M. HW/SW Co-‘esign For Dates Classification on Xilinx Zynq Soc. In Proceedings of the IEEE International Conference on Open Innovations Association (FRUCT), Yaroslavl, Russia, 20–24 April 2020. [Google Scholar] [CrossRef]
- Hakami, A.; Arif, M. Automatic Inspection of the External Quality of the Date Fruit. Procedia Comput. Sci. 2019, 163, 70–77. [Google Scholar] [CrossRef]
- Abi Sen, A.; Bahbouh, N.; Alkhodre, A.; Mohammed, A.; Aldham, F.; Aljabri, M. A Classification Algorithm for Date Fruits. In Proceedings of the IEEE International Conference on Computing for Sustainable Global Development (INDIACom), New Delhi, India, 4 May 2020. [Google Scholar] [CrossRef]
- Tan, K.; Lee, W.; Gan, H.; Wang, S. Recognizing Blue Berry Fruit of Different Maturity using Histogram Oriented Gradients and Color Features in Outdoor Scenes. Biosyst. Eng. 2018, 176, 59–72. [Google Scholar] [CrossRef]
- Video to Pic- Share Nice Photo. Available online: https://apps.apple.com/us/app/video-to-pic-share-nice-photo/id1438004105 (accessed on 22 November 2022).
- Colorsync Utility. Available online: https://support.apple.com/en-ca/guide/colorsync-utility/welcome/mac (accessed on 24 November 2022).
- Hamdi, M.; Ksibi, A.; Ayadi, M.; Elmannai, H.; Alzahrani, A. Machine-Learning-Based COVID-19 Detection with Enhanced cGAN Technique Using X-ray Images. Electronics 2022, 11, 3880. [Google Scholar] [CrossRef]
- Tang, Y.; Chen, M.; Wang, C.; Luo, L.; Li, J.; Lian, G.; Zou, X. Recognition and Localization Methods for Vision-Based Fruit Picking Robots: A Review. Front. Plant Sci. 2020, 11, 510. [Google Scholar] [CrossRef] [PubMed]
- Ezz, M.; Mostafa, A.; Elshenawy, A. Challenge-Response Emotion Authentication Algorithm Using Modified Horizontal Deep Learning. Intell. Autom. Soft Comput. (IASC) 2023, 35, 3659–3675. [Google Scholar] [CrossRef]
Reference | Classification |
---|---|
[4] | Cape gooseberry |
[5,6,7] | Apple |
[8] | Hass avocado |
[9,10,11] | Banana |
[12] | Blueberry |
[13] | Grape Berry |
[14] | Dates |
[15] | Maize |
[16,17] | Mangoes |
[18,19] | Tomato |
Kind | Specs |
---|---|
Canon | EOS 4000D DSLR EF-S 18–55 mm |
iPhone 12 | 12 megapixel, f/1.6, 26 mm (wide), 1.4 mm, dual pixel PDAF, OIS |
Samsung Galaxy S9 | 12 megapixel, f/1.5–2.4, 26 mm (wide), 1/2.55″, 1.4 mm, dual-pixel PDAF, OIS |
Source | Dataset | Characteristics | Limitations | The Proposed Dataset Strength |
---|---|---|---|---|
CSRR [2] | Two Canon cameras (EOS-1100D and EOS-600D) | The dataset has 8079 images. | Few classes. | Overcame the limitations of CSRR by increasing the number of classes. |
DMSC [22] | Canon Camera fitted with EFS 18–55 mm lens | They considered the growth stages as classes. | Could not differentiate the background area from being a cold area. | Increasing the number of classes and having more image collection methods. |
DLASDF [26] | RGB video camera | They considered the maturity stages of date fruits. | Only five classes, namely, Naboot Saif, Khalals, Barhi, Meneifi, and Sullaj. | Overcame the limitations of DLASDF by increasing the number of classes and having more image collection methods. |
APCP [27] | N/A | Analyzed the possibility of fungal species and relevant infection by fungal secondary metabolites of dates. | It had a total of 20 dried-date samples of two classes. | It overcame the limitations of APCP by increasing the number of classes and having more image collection methods. |
HW/SW Co- Design [28] | Camera and two fluores- cent lights | Date features were categorized using color, size shape, and skin features. | It had 600 images presenting six classes. | Increasing the number of classes and the number of class instances. |
AIEQDF [29] | Nikon digital camera, two fluorescent lights, white pallet | 566 images: 275 images for good-quality dates and 291 images for sugaring dates. | The dataset had only two classes. | Increasing the number of classes and having more accurate images. |
CADF [30] | Google Images | It had a total of 325 images representing four classes. | The dataset had four classes only, with an unbalanced number of images in each class. | Having more realistic image collection methods. |
ADFCLT [31] | iPhone 5 mobile camera | It had 80 different images belonging to four date types. | The dataset was quite small. | Overcame the limitations of the paper by increasing the classes’ number with more scientific image collection methods. |
# | Date Name | Number of Images | Color | Shape | Texture | Percentages of Image Collection Environment | ||
---|---|---|---|---|---|---|---|---|
Farms | Shops | Social Event | ||||||
1 | Al-ajwa | 112 | Red | Ovoid | Sheen crust | 77% | 20% | 13% |
2 | Al-helwa | 100 | Red | Cylindrical | Soft and mushy | 88% | 5% | 7% |
3 | Al-helwa macnooz | 155 | Black | Cylindrical | Solid and sticky | 10% | 77% | 13% |
4 | Al-husseiniya | 91 | Brown | Cordate | Solid and dry | 80% | 9% | 11% |
5 | Al-hyza | 50 | Yellow | Cylindrical | Soft crust | 74% | 11% | 15% |
6 | Al-barhi | 120 | Yellow | Cordate | Soft solid | 70% | 13% | 17% |
7 | Al-bowytha | 180 | Brown | Fusiform | Soft crimped | 60% | 17% | 23% |
8 | Al-kelas | 152 | Brown | Ovoid | Soft sticky | 22% | 50% | 28% |
9 | Al-khasab | 106 | Black | Globose | Solid sheen | 55% | 20% | 25% |
10 | Al-khasab Khalal | 139 | Red | Globose | Solid sheen | 67% | 14% | 19% |
11 | Al-maktoumi | 126 | Yellow | Cordate | Solid | 54% | 20% | 26% |
12 | Al-mabroum | 118 | Dark yellow | Cylindrical | Soft crimped and resin-like | 10% | 77% | 13% |
13 | Al-majdool | 115 | Brown | Fusiform | Resin-like | 79% | 9% | 12% |
14 | Al-masyihia | 31 | Yellow | Globose | Soft and syrupy | 66% | 15% | 19% |
15 | Al-muraaya | 50 | Yellow | Ovoid | Even-textured | 64% | 16% | 20% |
16 | Salma | 236 | Yellow | Ovoid | Even-textured | 90% | 4% | 6% |
17 | Soor | 142 | Yellow | Conical | Coarse, chewy | 9% | 79% | 12% |
18 | Al-shagra | 112 | Blond | Cylindrical | Resin-like | 13% | 69% | 18% |
19 | Al-sagai | 146 | Blond | Cylindrical | Resin-like | 20% | 55% | 25% |
20 | Al-skari | 131 | Brown | Cordate | Even-textured | 50% | 42% | 8% |
21 | Al-skri magrosh | 102 | Golden | Conical | Slimy | 82% | 8% | 10% |
22 | Al-asylaa | 121 | Yellow | Cylindrical | Sleek | 27% | 51% | 22% |
23 | SagaiIRAQ | 69 | Yellow | Cylindrical | Satiny | 76% | 10% | 14% |
24 | NbotAli | 141 | Brown | Conical | Scabrous | 50% | 30% | 20% |
25 | Al-rashudia | 162 | Brown | Cylindrical | Satiny | 50% | 35% | 15% |
26 | Ruthant Al-Shrq | 132 | Brown | Fusiform | Satiny | 92% | 3% | 5% |
27 | Al-hilalia | 104 | Yellow | Globose | Mild | 67% | 14% | 19% |
DFC Systems | Methodology | Applied Datasets | Classification Accuracy |
---|---|---|---|
IHDS [23] | CV—DL | CSRR | 99.4% |
CADF [30] | SVM—DT—RF—NN | Self-built dataset CADF | 91% for SVM 65% for DT 56% for RF 69% for NN |
DMSC [22] | MATLAB built-in function | Unavailable self-built dataset | 100% |
HW/SW co-design [28] | ANN network | Self-built dataset with 6 classes of 600 images | 97.26% |
AIEQDF [29] | Key-point detection methods, feature classification algorithms, and SVM | Self-built dataset with 2 classes of 500 images | 99% |
ADFCLT [12] | SVM | Self-built dataset with 4 classes of 80 images | 99% |
APCP [27] | Identified through stereomicroscope and microscopic observation of seven-day colonies | Self-built dataset with 2 classes of 20 images | 94% |
DLASDF [26] | CNNs—transfer learning with fine-tuning using two pretrained CNN models: AlexNet and VGGNet | Self-built dataset with 5 classes and 8000 images | >97.25% |
Model | Features (Pixel Intensity) | Features (Color Distribution) |
---|---|---|
K-nearest neighbor (KNN) | 0.36 | 0.82 |
Decision tree (DT) | 0.21 | 0.60 |
L2 logistic regression (LR) | 0.34 | 0.66 |
Random forest (RF) | 0.49 | 0.85 |
Adaptive boosting (AB) | 0.11 | 0.15 |
Support vector machine (SVM) | 0.43 | 0.85 |
Gaussian NB | 0.31 | 0.48 |
Model | Validation Accuracy |
---|---|
VGG19 | 0.8421 |
VGG16 | 0.8483 |
DenseNet121 | 0.9412 |
Inception | 0.8916 |
ResNet152V2 | 0.8947 |
InceptionResNetV2 | 0.8793 |
DenseNet169 | 0.9412 |
EfficientNetV2M | 0.13 |
DenseNet201 | 0.9567 |
Model | Validation Accuracy |
---|---|
DenseNet201(702) | 0.9505 |
DenseNet201(699) | 0.9443 |
DenseNet201(695) | 0.9567 |
DenseNet201(692) | 0.9536 |
Model | Dense Layer | Validation Accuracy |
---|---|---|
DenseNet201(695) | 1024 | 0.9505 |
DenseNet201(695) | 128 | 0.9102 |
DenseNet201(695) | 1,024,512 | 0.9536 |
DenseNet201(695) | 3000 | 0.9474 |
Regularization Rate | Validation Accuracy |
---|---|
0.000090 | 0.9567 |
0.00011 | 0.9628 |
0.00012 | 0.9598 |
0.00015 | 0.9721 |
Dataset Name | Precision | Recall | F1-Score |
---|---|---|---|
Al-ajwa | 1.00 | 1.00 | 1.00 |
Al-asylaa | 0.92 | 0.85 | 0.88 |
Al-barhi | 0.71 | 1.00 | 0.83 |
Al-bowytha | 0.90 | 1.00 | 0.95 |
Al-helwa | 1.00 | 0.90 | 0.95 |
Al-helwa_macnooz | 0.94 | 1.00 | 0.97 |
Al-hilalia | 1.00 | 1.00 | 1.00 |
Al-husseiniya | 1.00 | 1.00 | 1.00 |
Al-hyza | 1.00 | 0.80 | 0.89 |
Al-kelas | 0.94 | 1.00 | 0.97 |
Al-khasab | 0.92 | 1.00 | 0.96 |
Al-khasab_Khalal | 1.00 | 1.00 | 1.00 |
Al-mabroum | 1.00 | 0.83 | 0.91 |
Al-majdool | 1.00 | 1.00 | 1.00 |
Al-maktoumi | 1.00 | 0.85 | 0.92 |
Al-masyihia | 1.00 | 0.75 | 0.86 |
Al-muraaya | 0.83 | 1.00 | 0.91 |
Al-rashudia | 1.00 | 0.88 | 0.94 |
Al-sagai | 0.88 | 1.00 | 0.94 |
Al-sakari_majrosh | 1.00 | 1.00 | 1.00 |
Al-shagra | 0.90 | 0.75 | 0.82 |
Al-skari | 0.93 | 1.00 | 0.96 |
NbotAli | 1.00 | 0.86 | 0.92 |
Ruthant_Al-Shrq | 1.00 | 1.00 | 1.00 |
SagaiIRAQ | 1.00 | 1.00 | 1.00 |
Salma | 1.00 | 1.00 | 1.00 |
Soor | 1.00 | 1.00 | 1.00 |
Macro AVG | 0.96 | 0.94 | 0.95 |
Weighted AVG | 0.96 | 0.95 | 0.95 |
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
Alsirhani, A.; Siddiqi, M.H.; Mostafa, A.M.; Ezz, M.; Mahmoud, A.A. A Novel Classification Model of Date Fruit Dataset Using Deep Transfer Learning. Electronics 2023, 12, 665. https://doi.org/10.3390/electronics12030665
Alsirhani A, Siddiqi MH, Mostafa AM, Ezz M, Mahmoud AA. A Novel Classification Model of Date Fruit Dataset Using Deep Transfer Learning. Electronics. 2023; 12(3):665. https://doi.org/10.3390/electronics12030665
Chicago/Turabian StyleAlsirhani, Amjad, Muhammad Hameed Siddiqi, Ayman Mohamed Mostafa, Mohamed Ezz, and Alshimaa Abdelraof Mahmoud. 2023. "A Novel Classification Model of Date Fruit Dataset Using Deep Transfer Learning" Electronics 12, no. 3: 665. https://doi.org/10.3390/electronics12030665
APA StyleAlsirhani, A., Siddiqi, M. H., Mostafa, A. M., Ezz, M., & Mahmoud, A. A. (2023). A Novel Classification Model of Date Fruit Dataset Using Deep Transfer Learning. Electronics, 12(3), 665. https://doi.org/10.3390/electronics12030665