International Journal of Academic Engineering Research (IJAER) ISSN: 2643-9085 Vol. 3 Issue 12, December – 2019, Pages: 41-45 www.ijeais.org/ijaer 41 Grape Type Classification Using Deep Learning Hosni Qasim El-Mashharawi, Samy S. Abu Naser, Izzeddin A. Alshawwa, Mohammed Elkahlout Department of Information Technology, Faculty of Engineering and Information Technology Al-Azhar University Gaza – Palestine Abstract: A grape is a fruit, botanically a berry, of the deciduous woody vines of the flowering plant genus Vitis. it can be eaten fresh or they can be used for making jam, grape juice, jelly, grape seed extract, raisins, and grape seed oil. Grapes are a nonclimacteric type of fruit, generally occurring in clusters. Grapes are a type of fruit that grow in clusters of 15 to 300, and can be crimson, black, dark blue, yellow, green, orange, and pink. "White" grapes are actually green in color, and are evolutionarily derived from the purple grape. Mutations in two regulatory genes of white grapes turn off production of anthocyanins, which are responsible for the color of purple grapes. Grapes are typically an ellipsoid shape resembling a prolate spheroid. In this paper, machine learning based approach is presented for identifying type Grapes with a dataset that contains 4,565 images use 2,393 images for training, 1,026 images for validation and 1,146 images for testing. A deep learning technique that extensively applied to image recognition was used. use 70% from image for training and 30% from image for validation. Our trained model achieved an accuracy of 100% on a held-out test set, demonstrating the feasibility of this approach. Keywords: Type Grape, Deep Learning, Classification, Detection. INTRODUCTION There are many types of grapes including green, red, black, yellow and pink. They grow in clusters and come in seeded and seedless varieties. Grapes are grown in temperate climates across the world, including Southern Europe, Africa, Australia and North and South America. The majority of grapes grown in the US are from California. Grapes offer a wealth of health benefits due to their high nutrient and antioxidant contents. Here are the top health benefits of eating grapes: 1) Cancer Resveratrol is also present in red wine. Few studies have looked at the association between red wine and cancer risk in humans, but it has been shown that high intakes of alcohol on a consistent basis can increase the risk of cancer. Moderation is key. 2) Heart health Animal studies have indicated that quercetin and resveratrol may reduce the risk of atherosclerosis and protect against the damage caused by low-density lipoprotein (LDL), or "bad" cholesterol. These studies have mostly used doses of these flavonoids far higher than those usually consumed by humans. The polyphenols in grapes, such as resveratrol, are thought to have antioxidant, lipid-lowering, and anti-inflammatory actions that may help reduce the risk of cardiovascular disease (CVD). They may achieve this by preventing platelet build-up and reducing blood pressure and the risk of irregular heart rhythms. 3) Blood pressure Increasing potassium intake may help reduce the negative effects of too much sodium in the diet. Grapes have a high potassium content. This suggests they can help reduce the effects of sodium in people with high blood pressure. Fiber is important for maintaining a healthy cardiovascular system, including heart health and blood pressure. Grapes are a good source of fiber. Deep Learning is an Artificial Intelligence (AI) subfield that imitates the works of a human brain in processing data and producing patterns for use in decision making. Deep learning is a subset of machine learning in artificial intelligence that has networks the skills of learning from data that is unlabeled or unstructured. In this work, we show that a Deep Convolutional Neural Network (CNN) does well in classifying grape type. In computer vision, CNNs have been known to be powerful visual models that yield hierarchies of features enabling accurate segmentation. They are also known to perform predictions relatively faster than other algorithms while maintaining competitive performance at the same time. DEEP LEARNING International Journal of Academic Engineering Research (IJAER) ISSN: 2643-9085 Vol. 3 Issue 12, December – 2019, Pages: 41-45 www.ijeais.org/ijaer 42 Deep learning (also known as deep structured learning or hierarchical learning) is part of a broader family of machine learning methods based on learning data representations, as opposed to task-specific algorithms. Learning can be supervised, semisupervised or unsupervised. In deep learning, each level learns to transform its input data into a slightly more abstract and composite representation. In an image recognition application, the raw input may be a matrix of pixels; the first representational layer may abstract the pixels and encode edges; the second layer may compose and encode arrangements of edges; the third layer may encode a nose and eyes; and the fourth layer may recognize that the image contains a face. Importantly, a deep learning process can learn which features to optimally place in which level on its own. (Of course, this does not completely obviate the need for hand-tuning; for example, varying numbers of layers and layer sizes can provide different degrees of abstraction). TYPES OF MACHINE LEARNING ALGORITHMS There some variations of how to define the types of Machine Learning Algorithms but commonly they can be divided into categories according to their purpose and the main categories are the following:  Supervised learning Supervised learning is a learning model built to make prediction, given an unforeseen input instance. A supervised learning algorithm takes a known set of input dataset and its known responses to the data (output) to learn the regression/classification model. A learning algorithm then trains a model to generate a prediction for the response to new data or the test dataset.  Unsupervised Learning Unsupervised learning is the training of an artificial intelligence (AI) algorithm using information that is neither classified nor labeled and allowing the algorithm to act on that information without guidance, An AI system may group unsorted information according to similarities and differences even though there are no categories provided. AI systems capable of unsupervised learning are often associated with generative learning models, although they may also use a retrieval-based approach (which is most often associated with supervised learning). Chatbots, self-driving cars, facial recognition International Journal of Academic Engineering Research (IJAER) ISSN: 2643-9085 Vol. 3 Issue 12, December – 2019, Pages: 41-45 www.ijeais.org/ijaer 43 programs, expert systems and robots are among the systems that may use either supervised or unsupervised learning approaches. STUDY OBJECTIVES 1Demonstrating the feasibility of using deep convolutional neural networks to classify Type Apple. 2Developing a model that can be used by developer to create smartphones application or web site to detect Type Apple. DATASET The dataset used, provided by Kaggle, contains a set of 4,565 images use 2,393 images for training, 1,026 images for validation and 1,146 images for testing belonging to 6 species from grape. Figure 1: Samples of grapes The output 13 classes as follow:  class (0): Grape Blue.  class (1): Grape Pink.  class (2): Grape White.  class (3): Grape White 2.  class (4): Grape White 3.  class (5): Grape White 4. The images were resized into 150×150 for faster computations but without compromising the quality of the data. METHODOLOGY International Journal of Academic Engineering Research (IJAER) ISSN: 2643-9085 Vol. 3 Issue 12, December – 2019, Pages: 41-45 www.ijeais.org/ijaer 44 In this section we describe the proposed solution as selected convolutional network (ConvNet) architecture and discuss associated design choices and implementation aspects. MODEL Our model takes raw images as an input, so we used Convolutional Neural Networks (CNNs) to extract features, in result the model would consist from (features extraction), which was the same for full-color approach and gray-scale approach, it consist of 4 Convolutional layers with Relu activation function, each followed by Max Pooling layer. Layer (type) Output Shape Param # conv2d_5 (Conv2D) (None, 148, 148, 32) 896 max_pooling2d_5 (MaxPooling2) (None, 74, 74, 32) 0 conv2d_6 (Conv2D) (None, 72, 72, 64) 18496 max_pooling2d_6 (MaxPooling2) (None, 36, 36, 64) 0 conv2d_7 (Conv2D) (None, 34, 34, 128) 73856 max_pooling2d_7 (MaxPooling2) (None, 17, 17, 128) 0 conv2d_8 (Conv2D) (None, 15, 15, 128) 147584 max_pooling2d_8 (MaxPooling2) (None, 7, 7, 128) 0 flatten_2 (Flatten) (None, 6272) 0 dropout_2 (Dropout) (None, 6272) 0 dense_3 (Dense) (None, 512) 3211776 dense_4 (Dense) (None, 13) 6669 SYSTEM EVALUATION We used the original grape dataset that consists of 4,565 images after resizing the images to 150x150 pixels. We divided the data into training (70%), validation (30%). The training accuracy was 99.99% and the validation accuracy was 100%. CONCLUSION We proposed a solution to help people determine the type of grape more accurately, 100% accurately for your best model , builds a model using deep learning convolutional neural networks and uses this model to predict the type of (previously unseen) images of grape with a network from 4 layers and a dropout of 0.2 , that takes grape images with 6 different species an input. International Journal of Academic Engineering Research (IJAER) ISSN: 2643-9085 Vol. 3 Issue 12, December – 2019, Pages: 41-45 www.ijeais.org/ijaer 45 REFFERENCES 1. Werbos, P.J. (1975). Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences. 2. Bengio, Y.; Courville, A.; Vincent, P. (2013). "Representation Learning: A Review and New Perspectives". IEEE Transactions on Pattern Analysis and Machine Intelligence. 35 (8): 1798–1828. arXiv:1206.5538. 3. Bengio, Yoshua; LeCun, Yann; Hinton, Geoffrey (2015). "Deep Learning". Nature. 521 (7553): 436–444. 4. https://www.sciencedirect.com/topics/computer-science/supervised-learning 5. https://towardsdatascience.com/types-of-machine-learning-algorithms-you-should-know-953a08248861 6. https://www.sciencedirect.com/topics/computer-science/supervised-learning