0% found this document useful (0 votes)
3 views7 pages

Six Fruits Classification Using Deep Learning

This study presents a deep learning approach using VGG16 convolutional neural networks to classify six types of fruits, achieving a 100% accuracy rate. A dataset of 2677 images was utilized, with the model trained on 70% of the data and validated on 15%. The findings demonstrate the effectiveness of deep learning in fruit classification, highlighting its potential applications in various industries.

Uploaded by

Kedar Sawant
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Six Fruits Classification Using Deep Learning

This study presents a deep learning approach using VGG16 convolutional neural networks to classify six types of fruits, achieving a 100% accuracy rate. A dataset of 2677 images was utilized, with the model trained on 70% of the data and validated on 15%. The findings demonstrate the effectiveness of deep learning in fruit classification, highlighting its potential applications in various industries.

Uploaded by

Kedar Sawant
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

International Journal of Academic Information Systems Research (IJAISR)

ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Six Fruits Classification Using Deep Learning


Tanseem N. Abu-Jamie, Samy S. Abu-Naser, Mohammed A. Alkahlout, Mohammed A. Aish
Department of Information Technology, Faculty
of Engineering and Information Technology,
Al-Azhar University - Gaza, Palestine

Abstract: Fruit grading contributes to the improvement of self-pay and packaging systems in large companies and factories such
as juice factories, pharmaceutical companies, fruit storage companies and supermarkets. Convolutional neural networks can
automatically extract features by directly processing original images, which has attracted wide interest from researchers in fruit
classification terms. However, it is difficult to obtain more accurate identification due to the complexity of class similarity.VGG16
has been used to recognize different types of fruit images. Next, the fruit data set which includes 6 classes also created for network
model training and evaluation performance. Images of a group of fruits were collected and a deep convolutional neural network
was built to identify six types of fruits. Indicating the feasibility of this model, the ratio reached 100%. Inclusive the approach to
training real learning models on large, publicly available image data sets offers a clear path toward easy fruit classification. In
this paper, a machine learning based approach is presented for classifying and identifying 6 different fruits with a dataset that
contains 2677 images.

Keywords: Fruit Classification, Deep Learning, Classification, Detection

1. INTRODUCTION

In food storage and manufacture, fruit is a major component of fresh produce. Fruit Shops Supermarkets or Shops helps in
improving fruit screening and statistics and transportation systems. Fruit grading has always been a relatively complex problem,
because of its wide variety and irregular shape, color in most cases. An enhanced convolutional neural network named VGG16 was
proposed in this study for fruit classification and the main objective of this technique is with the perfect code and how you can use
the already trained CNN (Convolutional Neural Network) to solve the fruit classification problem.. In this paper, we are identifying
and classifying six of different type of fruits so we can take. As we mention in this paper we classify six different fruits, which are
Pineapple, Pineapple Mini, Raspberry, Redcurrant, Strawberry and Strawberry Wedge[1].

2. STUDY OBJECTIVES:

Demonstrating the feasibility of using deep convolutional neural networks to classify fruits.

3. Materials and Methods:

1. Data set:
A total of 2677 images were collected for the fruits to be classified. The images were downloaded from the Kaggle website
to build the CNN . Every picture was crop it to 128, 128 pixels. Figure 1 shows the category and number of fruit images
used in this study. For each type of fruit image use 70% from image for training and 15% from image for validation 15 %
for testing. The generated model was trained based on the training set and evaluated using the test set.

1
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Figure 1: sample from data set

The output 6 classes as follow:


• class (1): Pineapple.
• class (2): Pineapple Mini
• class (3): Raspberry
• class (4): Redcurrant
• class (5): Strawberry
• class (6): Strawberry Wedge
The images were resized into 128 × 128 for faster computations but without compromising the quality of the data.

2. Convolutional Layer:
The convolutional neural networks are a variant of deep networks, which automatically learn simple edge shapes from raw
data, and identify the complex shapes within each image through feature extraction. The convolutional neural networks
include various convolutional layers similar to the human visual system. Among them, the convolutional layers generally
have filters with the kernels of 11 × 11, 9 × 9, 7 × 7, 5 × 5 or 3 × 3. The filter fits weights through training and learning,
while the weights can extract features, just similar to camera filters [2-15].
3. Design :
A CNN consists of an input and an output layer, as well as multiple hidden layers. The hidden layers of a CNN typically
consist of convolutional layers, pooling layers, fully connected layers and normalization layers [1-5]. Description of the
process as a convolution in neural networks is by convention. Mathematically it is a cross correlation rather than a
convolution. This only has significance for the indices in the matrix, and thus which weights are placed at which index[16-
30].

4. Rectified Linear Unit (ReLU)Layer:


is used as a non-linear activation function for each convolutional [Link] suggests that, when the input value is less
than zero, the output value will be set to zero. Using the ReLU, the convolutional layer is able to output the non-linear
feature maps, thereby reducing the risk of overfitting[31-45].

5. Pooling Layer:
The pooling layer is adopted for compressing the feature map after the convolutional layer.
The pooling layer summarizes the output of the neighboring neurons, which reduces the activation
Map size and maintains the unchanged feature. There are two methods in the pooling layer, i.e.

2
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Maximum and average pooling. In this paper, the maximum pooling (mp) method was adopted.
Typically, the mp method remains the maximum pooling area, and it is the most popular pooling
Strategy[46-55].

6. Fully Connected and Dropout Layer:


Fully connected layer (FCL) is used for inference and classification. Similar to the traditional shallow neural network, FCL
also contains many parameters to connect to all neurons in the previous layer. However, the large number of parameters in
FCL may cause the problem of overfitting during training, while the dropout method is a technique to solve this problem.
Briefly, the dropout method is implemented during the training process by randomly discarding units connected to the
neural network. In addition, the dropout neurons are randomly selected during the training step, and its appearance
probability is 0.25. During the test step, the neural network is used without dropout operation[56-60].

7. Model Structure and Training Strategy:


In this study, a convolutional neural network was created to classify fruits (Fig. 3). According to Fig. 3, the input image
with a size of 128 × 128 × 3 was inserted into a network file. The convolutional neural network was a stacked structure
integrating Three layers are fully connected(CNN, max pooling, fully connected)[61-65] (Fig. 2).

Figure 2:componnent CNN

● Input Layer: It represent input image data. It will reshape image into single diminsion array. Example your
image is 64x64 = 4096, it will convert to (4096,1) array.
● Conv Layer: This layer will extract features from image.
● Pooling Layer: This layer reduce the spatial volume of input image after convolution.
● Fully Connected Layer: It connect the network from a layer to another layer
● Output Layer: It is the predicted values layer.

Notably, the last complete communication layer played a role as a classifier, which counts and outputs dozens of different fruits.
To reduce errors, Adam's optimizer was also used in this study, which was superior in its high computational efficiency, low memory
requirements and good suitability for large data or many parameters. The learning rate of the Adam optimizer was set to a constant
of 0.00001, and Cross Entropy Loss as a cost function. Then, the proposed model was trained.

3
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Figure 3: Model Arcjitucture

4. Results and Discussion:


In this section we describe the proposed solution as selected convolutional network (ConvNet) architecture and discuss associated
design choices and implementation aspects

1. Loss and Accuracy rate:


In terms of time and memory consumption in training the model, the curve of loss versus accuracy is effective feature.
Figure 4 presents the loss rate results for a convolution neural network in the training and test sets in 10 repetitions. which
indicates that the convolutional neural network learned the data effectively and can serve as a good model for fruit
recognition.

4
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Figure 4:Loss and Accuracy rate

2. Confusion Matrix:
In this work, the proposed deep learning network CNN was trained on the fruit dataset. Afterwards, the model was
evaluated on the test set, which showed good performance. Figure 5 presents the confusion matrix of the classification
results, where each row represents the actual category, while each column stands for the predicted result.

Figure 5 Confusion Matrix

3. Comparison of Classification Performance:

To evaluate the effectiveness of these models, the as-proposed method was compared with the existing methods for modern
deep learning. The models were evaluated on the test set by the accuracy rate, and avg F1-score (Figure 6). In Figure 6, the
model VGG16 achieved lower false positive and false negative rates, which demonstrates the effectiveness.

5
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

Figure 6: Comparison of Classification Performance


4. System evaluation:

We used the original fruit dataset that consists of 2677 images after resizing the images to 128x128 pixels. We divided
the data into training (70%), validation (15%), testing (15%). The training accuracy was 99.00% and the validation
accuracy was 100% after 20 Epochs. As we shown in figure 7,8.

Figure 7, 8 training and validation accuracy, training and validation loss

CONCLUSION

Fruit classification in a very important task in many field such as industrial or agriculture. In this study, we proposed an approach
that uses deep learning-based learning of images of six different fruit from Kaggle website. We use a pre trained CNN Model
VGG16 fine-tuned. In this paper, we trained and validated the proposed model and tested its performance with un-seen dataset for
testing. The Accuracy rate we achieved was 100%. This indicates that our proposed model can effectively predict and classify
different fruit without error and with full performance.

6
International Journal of Academic Information Systems Research (IJAISR)
ISSN: 2643-9026
Vol. 6 Issue 1, January - 2022, Pages:1-8

References
1. [Link]
2. Al Barsh, Y. I., et al. (2020). "MPG Prediction Using Artificial Neural Network." International Journal of Academic Information Systems Research (IJAISR) 4(11): 7-16.
3. Alajrami, E., et al. (2019). "Blood Donation Prediction using Artificial Neural Network." International Journal of Academic Engineering Research (IJAER) 3(10): 1-7.
4. Alajrami, E., et al. (2020). "Handwritten Signature Verification using Deep Learning." International Journal of Academic Multidisciplinary Research (IJAMR) 3(12): 39-44.
5. [Link]
6. Al-Araj, R. S. A., et al. (2020). "Classification of Animal Species Using Neural Network." International Journal of Academic Engineering Research (IJAER) 4(10): 23-31.
7. Al-Atrash, Y. E., et al. (2020). "Modeling Cognitive Development of the Balance Scale Task Using ANN." International Journal of Academic Information Systems Research (IJAISR) 4(9): 74-81.
8. Alghoul, A., et al. (2018). "Email Classification Using Artificial Neural Network." International Journal of Academic Engineering Research (IJAER) 2(11): 8-14.
9. [Link]
10. [Link]
11. Abu Nada, A. M., et al. (2020). "Age and Gender Prediction and Validation Through Single User Images Using CNN." International Journal of Academic Engineering Research (IJAER) 4(8): 21-24.
12. Abu Nada, A. M., et al. (2020). "Arabic Text Summarization Using AraBERT Model Using Extractive Text Summarization Approach." International Journal of Academic
Information Systems Research (IJAISR) 4(8): 6-9.
13. Abu-Saqer, M. M., et al. (2020). "Type of Grapefruit Classification Using Deep Learning." International Journal of Academic Information Systems Research (IJAISR) 4(1): 1-5.
14. Afana, M., et al. (2018). "Artificial Neural Network for Forecasting Car Mileage per Gallon in the City." International Journal of Advanced Science and Technology 124: 51-59.
15. Al-Araj, R. S. A., et al. (2020). "Classification of Animal Species Using Neural Network." International Journal of Academic Engineering Research (IJAER) 4(10): 23-31.
16. Al-Atrash, Y. E., et al. (2020). "Modeling Cognitive Development of the Balance Scale Task Using ANN." International Journal of Academic Information Systems Research (IJAISR) 4(9): 74-81.
17. Alghoul, A., et al. (2018). "Email Classification Using Artificial Neural Network." International Journal of Academic Engineering Research (IJAER) 2(11): 8-14.
18. Al-Kahlout, M. M., et al. (2020). "Neural Network Approach to Predict Forest Fires using Meteorological Data." International Journal of Academic Engineering Research (IJAER) 4(9): 68-72.
19. Alkronz, E. S., et al. (2019). "Prediction of Whether Mushroom is Edible or Poisonous Using Back-propagation Neural Network." International Journal of Academic and Applied Research (IJAAR) 3(2): 1-8.
20. Al-Madhoun, O. S. E.-D., et al. (2020). "Low Birth Weight Prediction Using JNN." International Journal of Academic Health and Medical Research (IJAHMR) 4(11): 8-14.
21. Al-Massri, R., et al. (2018). "Classification Prediction of SBRCTs Cancers Using Artificial Neural Network ." International Journal of Academic Engineering Research (IJAER) 2(11): 1-7.
22. Al-Mobayed, A. A., et al. (2020). "Artificial Neural Network for Predicting Car Performance Using JNN." International Journal of Engineering and Information Systems (IJEAIS) 4(9): 139-145.
23. Al-Mubayyed, O. M., et al. (2019). "Predicting Overall Car Performance Using Artificial Neural Network." International Journal of Academic and Applied Research (IJAAR) 3(1): 1-5.
24. Alshawwa, I. A., et al. (2020). "Analyzing Types of Cherry Using Deep Learning." International Journal of Academic Engineering Research (IJAER) 4(1): 1-5.
25. Al-Shawwa, M., et al. (2018). "Predicting Temperature and Humidity in the Surrounding Environment Using Artificial Neural Network." International Journal of Academic Pedagogical Research (IJAPR) 2(9):
1-6.
26. Ashqar, B. A., et al. (2019). "Plant Seedlings Classification Using Deep Learning." International Journal of Academic Information Systems Research (IJAISR) 3(1): 7-14.
27. Bakr, M. A. H. A., et al. (2020). "Breast Cancer Prediction using JNN." International Journal of Academic Information Systems Research (IJAISR) 4(10): 1-8.
28. Barhoom, A. M., et al. (2019). "Predicting Titanic Survivors using Artificial Neural Network." International Journal of Academic Engineering Research (IJAER) 3(9): 8-12.
29. Belbeisi, H. Z., et al. (2020). "Effect of Oxygen Consumption of Thylakoid Membranes (Chloroplasts) From Spinach after Inhibition Using JNN." International Journal of
Academic Health and Medical Research (IJAHMR) 4(11): 1-7.
30. Dalffa, M. A., et al. (2019). "Tic-Tac-Toe Learning Using Artificial Neural Networks." International Journal of Engineering and Information Systems (IJEAIS) 3(2): 9-19.
31. Dawood, K. J., et al. (2020). "Artificial Neural Network for Mushroom Prediction." International Journal of Academic Information Systems Research (IJAISR) 4(10): 9-17.
32. Dheir, I. M., et al. (2020). "Classifying Nuts Types Using Convolutional Neural Network." International Journal of Academic Information Systems Research (IJAISR) 3(12): 12-18.
33. El-Khatib, M. J., et al. (2019). "Glass Classification Using Artificial Neural Network." International Journal of Academic Pedagogical Research (IJAPR) 3(2): 25-31.
34. El-Mahelawi, J. K., et al. (2020). "Tumor Classification Using Artificial Neural Networks." International Journal of Academic Engineering Research (IJAER) 4(11): 8-15.
35. El-Mashharawi, H. Q., et al. (2020). "Grape Type Classification Using Deep Learning." International Journal of Academic Engineering Research (IJAER) 3(12): 41-45.
36. Elzamly, A., et al. (2015). "Classification of Software Risks with Discriminant Analysis Techniques in Software planning Development Process." International Journal of
Advanced Science and Technology 81: 35-48.
37. Elzamly, A., et al. (2015). "Predicting Software Analysis Process Risks Using Linear Stepwise Discriminant Analysis: Statistical Methods." Int. J. Adv. Inf. Sci. Technol 38(38): 108-115.
38. Elzamly, A., et al. (2017). "Predicting Critical Cloud Computing Security Issues using Artificial Neural Network (ANNs) Algorithms in Banking Organizations." International
Journal of Information Technology and Electrical Engineering 6(2): 40-45.
39. Habib, N. S., et al. (2020). "Presence of Amphibian Species Prediction Using Features Obtained from GIS and Satellite Images." International Journal of Academic and Applied
Research (IJAAR) 4(11): 13-22.
40. Harz, H. H., et al. (2020). "Artificial Neural Network for Predicting Diabetes Using JNN." International Journal of Academic Engineering Research (IJAER) 4(10): 14-22.
41. Hassanein, R. A. A., et al. (2020). "Artificial Neural Network for Predicting Workplace Absenteeism." International Journal o f Academic Engineering Research (IJAER) 4(9): 62-67.
42. Heriz, H. H., et al. (2018). "English Alphabet Prediction Using Artificial Neural Networks." International Journal of Academic Pedagogical Research (IJAPR) 2(11): 8-14.
43. Jaber, A. S., et al. (2020). "Evolving Efficient Classification Patterns in Lymphography Using EasyNN." International Journal of Academic Information Systems Research (IJAISR) 4(9): 66-73.
44. Kashf, D. W. A., et al. (2018). "Predicting DNA Lung Cancer using Artificial Neural Network." International Journal of Academic Pedagogical Research (IJAPR) 2(10): 6-13.
45. Khalil, A. J., et al. (2019). "Energy Efficiency Predicting using Artificial Neural Network." International Journal of Academic Pedagogical Research (IJAPR) 3(9): 1-8.
46. Kweik, O. M. A., et al. (2020). "Artificial Neural Network for Lung Cancer Detection." International Journal of Academic Engineering Research (IJAER) 4(11): 1-7.
47. Maghari, A. M., et al. (2020). "Books’ Rating Prediction Using Just Neural Network." International Journal of Engineering and Information Systems (IJEAIS) 4(10): 17-22.
48. Mettleq, A. S. A., et al. (2020). "Mango Classification Using Deep Learning." International Journal of Academic Engineering Research (IJAER) 3(12): 22-29.
49. Metwally, N. F., et al. (2018). "Diagnosis of Hepatitis Virus Using Artificial Neural Network." International Journal of Academic Pedagogical Research (IJAPR) 2(11): 1-7.
50. Mohammed, G. R., et al. (2020). "Predicting the Age of Abalone from Physical Measurements Using Artificial Neural Network." International Journal of Academic and Applied Research (IJAAR) 4(11): 7-12.
51. Musleh, M. M., et al. (2019). "Predicting Liver Patients using Artificial Neural Network." International Journal of Academic Information Systems Research (IJAISR) 3(10): 1-11.
52. Oriban, A. J. A., et al. (2020). "Antibiotic Susceptibility Prediction Using JNN." International Journal of Academic Information Systems Research (IJAISR) 4(11): 1-6.
53. Qwaider, S. R., et al. (2020). "Artificial Neural Network Prediction of the Academic Warning of Students in the Faculty of Engineering and Information Technology in Al-Azhar
University-Gaza." International Journal of Academic Information Systems Research (IJAISR) 4(8): 16-22.
54. Sadek, R. M., et al. (2019). "Parkinson’s Disease Prediction Using Artificial Neural Network." International Journal of Academic Health and Medical Research (IJAHMR) 3(1): 1-8.
55. Salah, M., et al. (2018). "Predicting Medical Expenses Using Artificial Neural Network." International Journal of Engineering and Information Systems (IJEAIS) 2(20): 11-17.
56. Salman, F. M., et al. (2020). "COVID-19 Detection using Artificial Intelligence." International Journal of Academic Engineering Research (IJAER) 4(3): 18-25.
57. Samra, M. N. A., et al. (2020). "ANN Model for Predicting Protein Localization Sites in Cells." International Journal of Academic and Applied Research (IJAAR) 4(9): 43-50.
58. Shawarib, M. Z. A., et al. (2020). "Breast Cancer Diagnosis and Survival Prediction Using JNN." International Journal of Engineering and Information Systems (IJEAIS) 4(10): 23-30.
59. Zaqout, I., et al. (2015). "Predicting Student Performance Using Artificial Neural Network: in the Faculty of Engineering and Information Technology." International Journal of
Hybrid Information Technology 8(2): 221-228.
60. Saleh, A. et al. (2020). "Brain Tumor Classification Using Deep Learning." 2020 International Conference on Assistive and Rehabilitation Technologies (iCareTech). IEEE, 2020.
61. Almadhoun, H. et al. (2021). "Classification of Alzheimer’s Disease Using Traditional Classifiers with Pre-Trained CNN." International Journal of Academic Health and Medical Research (IJAHMR) 5(4):17-
21.
62. El-Habil, B. et al. (2022). "Cantaloupe Classification Using Deep Learning.” International Journal of Academic Engineering Research (IJAER) 5(12): 7-17.
63. Alkahlout, M. A. et al. (2022). "Classification of Fruits Using Deep Learning.” International Journal of Academic Engineering Research (IJAER) 5(12): 56-63.
64. Alfarra, A. H. et al. (2022). "Classification of Pineapple Using Deep Learning.” International Journal of Academic Information Systems Research (IJAISR) 5(12): 37-41.
65. Al-Masawabe, M. M. et al. (2022). "Papaya maturity Classification Using Deep Convolutional Neural Networks.” International Journal of Engineering and Information Systems (IJEAIS) 5(12): 60-67.
66. Aldammagh, Z., Abdeljawad, R., & Obaid, T. (2021). Predicting Mobile Banking Adoption: An Integration of TAM and TPB with Trust and Perceived Risk. Financial Internet Quarterly, 17(3), 35-46.
67. Obaid, T. (2021). Predicting Mobile Banking Adoption: An Integration of TAM and TPB with Trust and Perceived Risk. Available at SSRN 3761669.
68. Jouda, H., Abu Jarad, A., Obaid, T., Abu Mdallalah, S., & Awaja, A. (2020). Mobile Banking Adoption: Decomposed Theory of Planned Behavior with Perceived Trust. Available at SSRN 3660403.
69. Obaid, T., Abdaljawad, R., & Mdallalahc, S. A. (2020). Factors Driving E-Learning Adoption In Palestine: An Integration of Technology Acceptance Model And IS Success Model. Available at SSRN
3686490.
70. Obaid, T. F., & Eneizan, B. M. (2016). Transfer of training and post-training on job performance in Middle Eastern countries. Review of Public Administration and
Management, 400(3786), 1-11.
71. Obaid, T. F., Zainon, M. S., Eneizan, P. D. B. M., & Wahab, K. A. TRANSFER OF TRAINING AND POST-TRAINING ON JOB PERFORMANCE IN MIDDLE EASTERN COUNTRIES.

You might also like