A Classification Algorithm For Date Fruits: March 2020

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/341152739

A Classification Algorithm for Date Fruits

Conference Paper · March 2020


DOI: 10.23919/INDIACom49435.2020.9083706

CITATIONS READS
5 588

6 authors, including:

Adnan Abi Sen Nour Mahmoud Bahbouh


Islamic Univsity of Al-Maddenah Islamic University; community service deanship
56 PUBLICATIONS   616 CITATIONS    22 PUBLICATIONS   68 CITATIONS   

SEE PROFILE SEE PROFILE

Ahmad Alkhodre Manar Aljabri


Islamic University of Medina Umm Al-Qura University
38 PUBLICATIONS   189 CITATIONS    1 PUBLICATION   5 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

An LBS-based Framework for Tracking and Detecting Infected People by Covid-19 View project

Preserving Privacy in the Smart City Applications View project

All content following this page was uploaded by Adnan Abi Sen on 12 May 2020.

The user has requested enhancement of the downloaded file.


Proceedings of the 14th INDIACom; INDIACom-2020; IEEE Conference ID: 49435
2020 7 International Conference on “Computing for Sustainable Global Development”, 12 th - 14th March, 2020
th

Bharati Vidyapeeth's Institute of Computer Applications and Management (BVICAM), New Delhi (INDIA)

A Classification Algorithm for Date Fruits


Adnan Ahmed Abi Sen Nour Mahmoud Bahbouh Ahmad B.Alkhodre
Faculty of computer and information Faculty of computer and information Faculty of computer and information
systems, Islamic University systems, Islamic University systems, Islamic University
Al-Madinah, SAUDI ARABIA Al-Madinah, SAUDI ARABIA Al-Madinah, SAUDI ARABIA
adnanmnm@hotmail.Com nour_ita1987@hotmail.com aalkhodre@iu.edu.sa

Ashwaq Mohammed Aldhawi Fatmah Ahmad Aldham Manar Ibrahim Aljabri


College of computer and information College of computer and information College of computer and information
systems, Umm Al-Qura University systems, Umm Al-Qura University systems, Umm Al-Qura University
Mecca, SAUDI ARABIA Mecca, SAUDI ARABIA Mecca, SAUDI ARABIA
ashwaq.aldawi@gmail.com dham.f@live.com manar.ibr.aljabri@gmail.com

Abstract— Date fruits are very popular in Saudi Arabia and This research will present a new method to create an
around the world. Date fruits have several sizes, colors, taste and automatic classification and sorting of many types of dates,
value. There are a lot of challenges facing the date industry. One especially the popular four types (Ajwa, Mabroom, Sagai and
of the most significant challenges is the classification and sorting Sukkary). This method will be based on machine learning
of dates without any physical measurement. This research technologies. The used dataset for testing has many images of
presents comparison among many automatic classification the aforementioned four kinds of dates. The main challenges in
algorithms with six proposed features mainly relying on (color, this process is that a lot of dates share the same or similar
size, and texture). The dataset contains images of four main types characteristics externally. Another challenge is the acquisition
of dates in Saudi Arabia. The results from testing proved the
of a large dataset of date fruit, which is a decisive factor in the
viability of the selected features of dates according to different
metrics of accuracy, in addition to the confusion matrix. Also, the
accuracy of the classification.
results showed that the Support Vector Machine model has This research is constructed as following: after the
overcome others (Neural Network, Decision Tree, and Random introduction, we present the related works. After that the used
Forest models), bearing in mind that the used dataset was small. proposed features, and classification models will be presented.
The accuracy of the Vector Machine was 0.738, while others were Finally, the results and recommendations will be demonstrated.
between 0.6 and 0.69. These percentages would be enhanced in
the real environment, if the same camera and same conditions are
available. II. LITERATURE REVIEWS
Due to the importance of date fruits, many studies
Keywords — date fruits; classification; sorting; machine discussed the benefits of this fruit [4-5]. Moreover, there are
learning; SVM; decision tree; regression. many studies discussing date fruits and their classification
based on different features, by several methods, and for various
I. INTRODUCTION goals [6].
Computer Vision has proven its predictive capabilities on The classification process itself has become one of the most
an image dataset. It is being used heavily in industrial important functions in many recent applications which use auto
applications, including image recognition and detection, image detecting, sorting, predicting, etc. to make our life more
segmentation, object tracking, and so on [1]. sophisticated, safe, and flexible [7-8].
Date fruit are popular in Saudi Arabia and can commonly A case study [9] showed the automatic classification of
be bought from supermarkets around the world. Date fruit has dates in smart cities lead to customer satisfied due to deep
different sizes, colors, taste and value. The economic market learning techniques, in addition to fog and cloud computing
for the date fruit industry in Saudi Arabia attracts a lot of [10-13], other many aspects associated with privacy,
attention from the government agencies as well as the private security, and management are discussed in [29-36].
sector [2], where the share of the Gulf cooperation council in
the total export value of the world was about 25% [3]. Other studies [6, 14] demonstrated the main steps for image
classifications, then [15] followed these steps based on multi-
There are many challenges that continually confront owners features (mean of color for each component: Red, Green, and
of date fruit, like sorting the dates and recognizing its aspects, Blue, in addition to Standard Deviation). Also, it used area and
which can be resolved significantly by using one of the perimeter of date beside the Entropy of texture.
available machine learning techniques [3].
In [16], researchers focused on the auto-detection for
infected fruits depending on colors. Other works [17-18] used
A Classification Algorithm for Date Fruits

the neural network to classify dates, determining the level of A. Step1 – Select the Dataset and Preprocessing
quality, or predicting the quantities of production. The selected dataset contains four classes, namely: Ajwa,
Studies [19-20] confirmed that the color, texture, and shape Mabroom, Sagai and Sukkary, as depicted in Figure 3. The
can provide a high accuracy for classification and can dataset is not available online, however it can be accessed by
determine the quantity, quality, and maturity level of dates. contacting the authors from this URL:
Other research went as far as applying the classification [https://www.sciencedirect.com/science/article/pii/S0167739X1733056X]
method based on the internal elements and components of dates The dataset was not balanced where the number of images
as the level of sugar and rate of fibers [21]. [22-23] studied the in each class was different (Ajwa:105, Mabroom:92, Sagai:47,
relation between the hardness with moisture based on physical and Sukkary:81). The images of this dataset was not taken by
and chemical properties to analyze the level of quality of fruits. the same camera and conditions like size, angle, and
[24] Also depended the color of dates to classify them. While background were not maintained. Rather, the images were
[25] used Support Vector Machine (SVM) based on shape, searched and collected from Google pics. Thus, more
texture, and color to decision if the date fruit is valid or not. challenges arose, which were useful to test the robustness of
As some researchers suggested, a harvest robot relies on a the classification method.
classification algorithm to get the date fruit from palm trees
automatically [26].
In [27] a system is used to classify different types of fruits
based on extract features from images. The features are color
and texture. SVM classifier is used, and the supermarket
products are used as a data set that contains 941 fruit images.
The overall classification accuracy for this system is 95.3%.
Figure 1 shows the system’s stages to classified fruits.

Fig. 3. Four used classes/types of Dates

To remove bias in the selected dataset, and in the same time


increase the size of it, this research applied resampling
(oversampling) in the data level (such as augmentation), it
Fig. 1. Diagram for fruits classification system
selected random items and regenerated new items with some
changes in the size and the angle of images to create new ones.
In [28], the research presents an automatic system to
classify different type of dates based on texture and shape. 800 We split the data into 3 segments: 70% was for training,
different images of dates are used as a dataset. Multiclass SVM 20% for testing and 10% of the data was used as validation
was used as a classifier. The best accuracy for this system was data.
95%. Figure 2 shows the system.

Fig. 4. Proposed features of the research


Fig. 2. Diagram for dates classification system

B. Step2 – Extract the Features


III. PROPOSED SYSTEM
The proposed features for the previous methods were:
As with most machine learning approaches, there are main
steps from the start to end. The details of our steps were: 1- Color: this research used two features related to color
on two sides of date fruit. To increasingly distinguish
Proceedings of the 13th INDIACom; INDIACom-2019; IEEE Conference ID: 428xx
2019 6 International Conference on “Computing for Sustainable Global Development”, 13th - 15th March, 2019
th

among types, we noted after studying many samples, IV. RESULTS AND COMPARISON
that the Red value of the left point in addition to the This research applied many different metrics for
difference between Blue values of both points gives comparison between the four classifiers (SVM, DT, RF, and
the largest level of variation between the four types of NN). The following tables and figures depict the returned
dates. results.
2- Width of date fruit
3- Height of date fruit A. Support Vector Machines Classifier (SVM)
4- Ratio of width on height
5- Structure: we used the Canny-filter with lower and
higher threshold parameters (50, 100) to find the edges
in the image, then we calculated the ratio of white
pixels to black ones. This ratio determines if the
surface of the dates are smooth or otherwise. B. Decision Tree classifier(DT)

C. Step3 – Select the Classifcation Method


We employed different machine learning methods to
classify dates and then pick the best one; that is the algorithm
which has the highest per-class accuracy. In this way, we will C. Random Forest Classifier (RF)
be able to get a high preforming classifier.
We experimented with the following methods:
1. Support Vector Machines (SVM)
2. Decision Tree Classifier (DT)
3. Random Forest Classifier (RF) D. Neural Network Classifier(NN)
4. Neural Networks (NN)

Previous results clearly show that the SVM has the best
accuracy, then the NN, according to all kinds of dates.

Fig. 5. Proposed Method Steps

D. Step4 – Testing and Resutls


The research used Python for implementation where Python
contains a lot of libraries for machine learning and Fig. 6. Python pseudo code for proposed method
classification algorithms. The figure 6 depicts the main part of
Python code which is used for extracting features and applying Moreover, the confusion matrix confirmed the previous resutls
classification techniques. and the next figures (Figures 7, 8, 9, and 10) present that.
A Classification Algorithm for Date Fruits

class every time. So, it is not advisable to select the decision


tree algorithm.

Fig. 7. Confusion matrix of SVM


Fig. 10. Confusion matrix of NN

The second thing to note is that the performance of the


Neural Networks is lower than SVM. This is due to the fact
that the number of images we have is low. Since the neural
network has a high hunger for data, this low amount of
available data is not allowing the neural network to perform
well.
To summarize, SVM achieved the best result and accuracy
of classification when the number of images in the training data
was small.

V. CONCLUSION
In this research, we proposed six features for date fruits,
Fig. 8. Confusion matrix of DT
then we presented several approaches of machine learning for
classification. It has been observed that the SVM Classifier
outperforms the Neural Networks, Random Forest and the
decision trees classifier. The results produced by our
experiment could be significantly improved by obtaining more
data, since the data was only a few hundred images. Due to
this, the classifiers are not able to achieve optimal performance.
In the future, this reseach can be extended to two new
applications. The first one is the Automatic date separator in
the packaging factories, while the second project is automatic
detection for defected dates. Moreover, it will try to create a
hybrid model that integrates more than one model to enhance
the accuracy of classifcation.

REFERENCES
[1] Torras, C. (Ed.). (2012). Computer vision: theory and industrial
applications. Springer Science & Business Media.
Fig. 9. Confusion matrix of RF [2] Nasser, L. A. (2017). Fungal Contamination and Invertase Activity in
Dates and Date Products in Saudi Arabia. American Journal of Food
Technology, 12, 295-300.
There are 2 interesting things to observe in this experiment.
First is the fact that for the decision tree classifier, the per-class [3] Dhehibi, B., Salah, M. B., & Frija, A. (2018). Date Palm Value Chain
Analysis and Marketing Opportunities for the Gulf Cooperation Council
precision, recall and f1-score for the class name “Sagai” is 0. (GCC) Countries. In Agricultural Economics. IntechOpen.
That means if we use this algorithm, we will misclassify this [4] Farooqui, S., Khan, W., Pandey, S., & Hussain, Z. (2019). STUDY OF
SUSTENANCE PROPERTIES OF DATES.
Proceedings of the 13th INDIACom; INDIACom-2019; IEEE Conference ID: 428xx
2019 6 International Conference on “Computing for Sustainable Global Development”, 13th - 15th March, 2019
th

[5] hen, J., Liu, X., Li, Z., Qi, A., Yao, P., Zhou, Z., ... & Tsim, K. W. based on hardness. Journal of Agricultural and Marine Sciences
(2017). A review of dietary Ziziphus jujuba Fruit (Jujube): developing [JAMS], 22(1), 36-41.
health food supplements for brain protection. Evidence-Based [25] Alzu’bi, R., Anushya, A., Hamed, E., Al Sha’ar, E. A., & Vincy, B. A.
Complementary and Alternative Medicine, 2017. (2018, April). Dates fruits classification using SVM. In AIP Conference
[6] Fernandez, G. (2010). Statistical data mining using SAS applications. Proceedings (Vol. 1952, No. 1, p. 020078). AIP Publishing.
CRC press. [26] Altaheri, H., Alsulaiman, M., & Muhammad, G. (2019). Date fruit
[7] amin, M. (2019). Managing Crowds with Technology: Cases of Hajj classification for robotic harvesting in a natural environment using deep
and Kumbh Mela. International Journal of Information Technology, 11 learning. IEEE Access, 7, 117115-117133.
(2), 229–237, doi: https://doi.org/10.1007/s41870-018-0266-1. [27] R. S. S. Kumari and V. Gomathy, "Fruit Classification using Statistical
[8] oofi, A. A., & Awan, A. (2017). Classification techniques in machine Features in SVM Classifier," 2018 4th International Conference on
learning: applications and issues. Journal of Basic and Applied Electrical Energy Systems (ICEES), Chennai, 2018, pp. 526-529.
Sciences, 13, 459-465. [28] Muhammad, Ghulam. (2015), "Date fruits classification using texture
[9] Hossain, M. S., Muhammad, G., & Amin, S. U. (2018). Improving descriptors and shape-size features". Engineering Applications of
consumer satisfaction in smart cities using edge computing and caching: Artificial Intelligence. 37.10.1016/j.engappai.2014.10.001.
A case study of date fruits classification. Future Generation Computer [29] Mohammad Yamin, Yazed Alsaawy, Ahmed B. Alkhodre, Adnan
Systems, 88, 333-341. Ahmed Abi Sen (2019). An Innovative Method for Preserving Privacy in
[10] Sen, A. A. A., Eassa, F. A., & Jambi, K. (2017, November). Preserving Internet of Things. Sensors 2019, 19, 3355; doi: 10.3390/s19153355.
Privacy of Smart Cities Based on the Fog Computing. In International [30] Yamin, M. & Abi Sen, A. A. (2018). Improving Privacy and Security of
Conference on Smart Cities, Infrastructure, Technologies and User Data in Location Based Services. International Journal of
Applications (pp. 185-191). Springer, Cham. Ambient Computing and Intelligence, 9 (1), 19-42, doi:
[11] Fouz, F., & Sen, A. A. (2016). PERFORMANCE AND SCHEDULING 10.4018/IJACI.2018010102.
OF HPC APPLICATIONS IN CLOUD. Journal of Theoretical & [31] Adnan A. Abi Sen, Fathy B. Eassa, Mohammad Yamin, and Kamal
Applied Information Technology, 85(3). Jambi (2018). Double Cache Approach with Wireless Technology for
[12] Sen, A. A. A., Eassa, F. A., Jambi, K., & Yamin, M. (2018). Preserving Preserving User Privacy. Wireless Communications and Mobile
privacy in internet of things: a survey. International Journal of Computing. Volume 2018, Article ID 4607464, 11 pages.
Information Technology, 10(2), 189-200. doi:10.1155/2018/4607464
[13] Yamin, M., Alsaawy, Y., B Alkhodre, A., Sen, A., & Ahmed, A. (2019). [32] Abdullah M Basahel, Mohammad Yamin, and Adnan Ahmed Abi
An Innovative Method for Preserving Privacy in Internet of Sen@019). Enhancing Security of Transmitted Data by Improved
Things. Sensors, 19(15), 3355. Steganography Method. IJCSNS. 19(4), 239-244.
[14] Thamilselvan, P., & Sathiaseelan, J. (2015). A comparative study of data [33] Abdullah M. Basahel, Adnan Ahmed Abi Sen, Mohammad Yamin, and
mining algorithms for image classification. International Journal of Sarah Alqahtani (2019). Bartering Method for Improving Privacy of
Education and Management Engineering, 5(2), 1-9. LBS. IJCSNS. 19(2), 207-213.
[15] Haidar, A., Dong, H., & Mavridis, N. (2012, October). Image-based date [34] Y. Alsaawy, A. Alkhodre, F. A. Eassa and A. A. A. Sen, "Triple Cache
fruit classification. In 2012 IV International Congress on Ultra Modern Approach for Preserving Privacy and Enhancing Performance of LBS,"
Telecommunications and Control Systems (pp. 357-363). IEEE. 2019 6th International Conference on Computing for Sustainable Global
[16] Teena, M., Manickavasagan, A., Al-Sadi, A. M., Al-Yahyai, R., & Development (INDIACom), New Delhi, India, 2019, pp. 1277-1281.
Deadman, M. L. (2016). RGB color imaging to detect Aspergillus flavus [35] A. A. A. Sen and A. M. Basahel, "A Comparative Study between
infection in dates. Emirates Journal of Food and Agriculture, 683-688. Security and Privacy," 2019 6th International Conference on Computing
[17] Hambali, H. A., Abdullah, S. L. S., Jamil, N., & Harun, H. (2017). Fruit for Sustainable Global Development (INDIACom), New Delhi, India,
Classification using Neural Network Model. Journal of 2019, pp. 1282-1286.
Telecommunication, Electronic and Computer Engineering (JTEC), 9(1- [36] N. ALMohammadi, A. A. A. Sen, H. Borie, A. AlMuhammadi, A.
2), 43-46. Alkhodre and M. Yamin, "A Framework for Enhancing Relief System of
[18] Alrajeh, K. M., & Alzohairy, T. A. (2012). Date fruits classification Health Domain by IoT," 2019 6th International Conference on
using MLP and RBF neural networks. International Journal of Computing for Sustainable Global Development (INDIACom), New
Computer Applications, 41(10). Delhi, India, 2019, pp. 1326-1330.
[19] Muhammad, G. (2014, October). Automatic Date Fruit Classification by
Using Local Texture Descriptors and Shape-Size Features. In 2014
European Modelling Symposium (pp. 174-179). IEEE.
[20] Najeeb, T., & Safar, M. (2018, March). Dates Maturity Status and
Classification Using Image Processing. In 2018 International
Conference on Computing Sciences and Engineering (ICCSE) (pp. 1-6).
IEEE.
[21] Hasnaoui, A., Elhoumaizi, A., Hakkou, A., Wathelet, B., & Sindic, M.
(2011). Physico-chemical characterization, classification and quality
evaluation of date palm fruits of some Moroccan cultivars. Journal of
Scientific Research, 3(1), 139-149.
[22] Singh, V., Guizani, N., Al-Alawi, A., Claereboudt, M., & Rahman, M. S.
(2013). Instrumental texture profile analysis (TPA) of date fruits as a
function of its physico-chemical properties. Industrial crops and
products, 50, 866-873.
[23] Aiadi, O., & Kherfi, M. L. (2017). A new method for automatic date
fruit classification. International Journal of Computational Vision and
Robotics, 7(6), 692-711.
[24] Manickavasagan, A., Al-Shekaili, N. H., Al-Mezeini, N. K., Rahman, M.
S., & Guizani, N. (2018). Computer vision technique to classify dates

View publication stats

You might also like