CN7023 AI & machine Vision Coursework

Convolutional neural network for fruit classification

Abstract:

The complexity in agriculture process is disease detection in crops and fruits in early stages. The diseases in crops and fruit will affect the growth of economic as well as food products of a country. With the use of various technological development, the disease identification can be done for avoiding great loss. Deep learning methods are more effective to provide the prediction results based on images. The advanced methods are used to provide classification of fruits based on the features.  In this work, the convolutional neural network method is used for fruit identification and classification. Three different categories of fruits are used in this classification process. The convolutional neural network model produced good accuracy in this fruit disease prediction and classification.

Keywords: Deep learning, Convolutional Neural Network, Classification, feature based classification, accuracy.

Introduction

The artificial intelligence plays an important role in various fields including agricultural domain. The deep learning methods are used in agriculture domain for various classification and prediction process such as classification of leafs, prediction of leaf diseases, Plant disease classification, Approximation of yields, prediction of weather and prediction of soil Moisture. The deep learning methods are effective in Natural Language Processing and Speech recognition software. The major benefit of using these deep learning methods is handling the massive amount of images for making classification. For providing classification results using deep learning the appropriate model should be selected and trained with class label. The accuracy produced in training period and testing period are considered to define the model efficiency (Vishali Aggarwal., 2018). This technique is useful for farmers to increase the productivity using early diagnosis methods of deep learning. This can also decrease the labor work for this disease classification and other classification process in agricultural domain (Neterer JR., 2018).

Objectives:

Get Assignment Help from Industry Expert Writers (1)

In this work, the analysis of convolutional neural network model for image classification is presented. The different architecture models for image classification are highlighted. The training and testing accuracy for fruit image classification is highlighted. The Matlab work is presented for representing the execution results using Convolutional Neural network model for Fruit image classification.

An Overview of Report:

In this work, we aimed to produce the good classification accuracy using deep learning method with fruit dataset. The dataset was retrieved from Kaggle repository. The dataset was divided into 70: 30 ratio. From the whole dataset, 70% of data will be used for training with three different class label namely, Raspberry, Strawberry and tomato. Then the test dataset is used for model efficiency checking. The validation process will be done by using 10% of data from the collected dataset.

Simulations

Description of Dataset

For this work, the Fruit dataset is used. This dataset is collected from Kaggle repository. In this dataset, there are 44406 images with 320 X 258 pixel size.  These images are collected from different places which represent different features like light, shadow, different shape, variation in pose and sunshine. There are three different class labels presented in this dataset. This dataset consist Raspberry, strawberry and Tomato fruit images. In this dataset, the raspberry fruits are presented with 5,224 images. The Strawberry fruit consist 5233 images in this fruit dataset. In tomato class there are 5222 images presented.

This picture shows that there are three different target classes for fruit classification namely Raspberry, Strawberry and Tomato. These images were collected and stored in this dataset from various palces.

Encoding of dataset

Label encoding is used for converting the labels into numeric format for better understanding by the machine. In this work, the deep learning methods are used (A. Qayyum, 2017). These methods are effective to handle the images and classify the images using feature. The colour, shape and texture features are considered while classifying the images of fruit. The background images and irrelevant regions of images are removed when making classification. The filters are used for selecting the important features from the image segmentation part.

Architecture Model used for Image classification

Convolutional Neural Network:

The convolutional neural network is one of the best models of deep learning. This model provides best classification results using vast amount of images. This model can also be used for image classification, detection of object and recognition of images (M. Frid-Adar, 2018). Feature extraction plays major role in classification of images using convolutional neural network. There are different filters used for image classification.  The filters are used to exploit the spatial locality of one particular image. The feature map is used to get the dot products of two matrixes. These are also known as Activation Maps. The training will be given for the convolutional neural network model with sample dataset. The use of training will provide the transfer learning approach to find the effective features from that particular image part. The training process of convolutional neural network model includes preparing a dataset for classification with assigning paths and label creation. In this training process, the resizing of image is carried out. This process prepared all the images for providing better classification results. The normalization methods are used for removing the noisy images from the dataset.

AlexNet:

Get Assignment Help from Industry Expert Writers (1)

In this work, the AlexNet architecture model type is used for fruits image classification. This is one of the simplest models of Convolutional Neural Network. This AlexNet model consist Convolutional Layer, batch Normalization layer, Max pooling layer, Flatten layer and Dense Layer for making classification with dataset. In convolutional neural network, the image data array is created using feature map (V. Sharma and K. C. Juglan., 2018). This provides the convolutional process which can occurs between the filters and images transferred in a convolutional neural network. The batch normalization process is used in AlexNet for providing additional layer that performs operation on input images. These input images are taken from previous layer. In this layer standardize and normalization operations can be done with the input values (K. Shankar, 2020).  The Max pooling is used for calculating the maximum value of feature maps. The flatten layer considers the shape and flattens from input images with one dimensional array. The dense layer consist more number of neurons within the network for making classification images. For activation process, we use ReLu activation function. Other than this method, Softmax activation function can also selected by various researcher for image classification (S. K. Lakshmanaprabu, 2019).

Training Process

The training phase is used to train the model to learn for producing proper output.  In this pahse, the training dataset is used for providing relevant features to address the class. The training dataset contains data with class label. During training process the set of weights in network is used to calculate to prove the classification is good or bad. In this work, the maximum numbers of epochs are used to provide training for the model.  The maximum rate of epochs used in this model is 200. The epochs are used to pass the dataset in forward and backward direction in the network at one time. There are some steps followed in training phase to classify the fruit images based on their features. Those are selection of dataset, using neural network, using strategy for training, selection of model, using test dataset for analysis and deployment of model.  The gradient Backward Propagation method is used to find the weights in neural network.

Validation

The model validation is one of the process in deep learning for image classification. This validation process evaluates the trained model with less amount of dataset. In validation phase, the dataset does not contain any class label for prediction. Based on the training, the model needs to classify the data. Then the accuracy is cross verified to check the efficiency of trained model. In this process, 10% of data from fruit dataset is used to provide unbiased evaluation to check the fitness of model. The error rate is identified in this validation process regarding the used deep learning model.

Testing

This testing phase ensures the efficiency of used model in specific problem classification process. for testing 20% of data samples are used. data samples without class label is used for testing process. The accuracy of used model can be calculated using true positive, true negative and false positive, false negative rate. These values are used to calculate the accuracy, sensitivity, specificity, Precision and recall for used Convolutional Neural Network model.

Used Learning Algorithm

AlexNet Architecture type is used in this work. This is one of the effective and simple convolutional neural network model which is widely used for classification.  The AlexNet model is trained with 70% of data samples which are separated from fruit dataset. The data samples are randomly selected and arranged for training, testing and validation.

Results Obtained

The implementation results for fruit classification are presented in this report. The main consideration of deep learning technique is requirement of huge amount of data. In this work, there are 15,679 fruit images used with three different categories such as Raspberry, Strawberry and Tomato. Based In training stage, the used Convolutional Neural Network model produced 97.39% accuracy. In testing stage, this model achieved 95.91% accuracy for fruit classification.

Percentage of Accuracy in training and Testing

The accuracy achieved in training phase and testing phase is presented in this work. The accuracy is calculated with the correct finding percentage and the error rate produced by that classification model.

Training Accuracy:

The training accuracy

Fig.No:4 Training accuracy of Fruit classification using Convolutional Neural Network

This Picture provides the accuracy details in training time. For training process, 70% of data is used with class label. The AlexNet model achieved 97.39% accuracy in fruit classification process. The epoch level for this accuracy calculation is 200.

Testing Accuracy

Fig.No: 5 Testing Accuracy of Fruit Classification using Convolutional Neural Network

This image represents the overall accuracy in testing time. For testing 20% of data is used. This chart highlights that the AlexNet model achieved 95.91% accuracy in fruit image classification.

Accuracy Curve for training, testing and validation

The accuracy curve for training, testing and validation is presented with maximum number of epochs used for classification. The training accuracy showed the classification of three different fruits based on color, shape and textures. In training phase, this AlexNet model learned all these features to find the difference among these things. 70% of data with class label is used to train the model to find the similarities and difference among the fruits. After training phase, this model has involved in testing phase. In this phase, the new dataset without class label is used for classification. The efficiency of this AlexNet model is identified using the correctly and incorrectly classified instances. The validation accuracy is calculated based on the ability of that model in classifying the images with validation dataset.

Confusion Matrix

The confusion matrix method is used for describing the performance of used AlexNet model in classification of three different fruits. The confusion matrix represents the Accuracy, Precision, Recall, Sensitivity, Specificity and ROC. The accuracy of that model in classification is calculated with four different values namely True Positive rate, True Negative Rate, False Positive Rate and False Negative Rate.

In this Picture, the Accuracy of each class is highlighted. For the classification of Raspberry fruit, the AlexNet model achieved 95.5% accuracy. In strawberry class, 95.9% accuracy is achieved using this model.  In tomato class, the AlexNet model produced 95.9% accuracy. The remaining values in each class represent the error rate. These values are considered as True Negative values and the false negative values.

The Formula for calculating accuracy is

Accuracy =

This formula is used for calculating the overall accuracy in training and testing phase. In this formula TP represents True Positive, FP represents False Positive, TN represents True Negative and FN represents False Negative.

Critical Analysis of Results

From this implementation, it is showed that deep learning models are more efficient in image classification. The deep learning methods are statistical techniques which are used for classification patterns. There are some limitations in deep learning like training phase is required for classification. There are different architecture model in convolutional neural network. For this work, the Alex Net model was selected and used. The implementation part contains three major sections like training phase, testing phase and validation phase. The dataset is collected and divided for three segments with 70:20:10 ratio. The 70% of data is used for training, 20% of data is used for testing and 10% of data is used for validation. The results in training and testing phases are presented in this work.

Conclusion

The Convolutional neural network contains various combination of layer process such as convolutional layer, pooling layer, fully connected layer and activation function process. The performance differs based on the architecture from convolutional neural network. The AlexNet architecture is selected and used for fruit classification. The dataset is collected from Kaggle repository. In training phase, the feature map is used for finding the important feature for making classification. In training dataset, the random data samples with class label are used to train the model. But the testing and validation phase, the class labels are not presented. Based on the correctly and incorrectly classification, the accuracy of Convolutional Neural Network model is evaluated. From the results, it is highlighted that, the Alex Net model achieved 97.39% of accuracy in training and 95.91% accuracy in testing. The confusion matrix results proved that the produced results are good because the error rate in classification of Raspberry, Strawberry and Tomato are very low. The Convolutional Neural Network model produced 95.91% accuracy in fruit classification.

References:

Bibliography

  1. Qayyum, S. M. A. M. A. a. M. M., 2017. Medical image retrieval using deep convolutional neural network. Neurocomputing, pp. Vol-266, pp. 8-20.
  2. Shankar, A. R. W. S. D. G. S. K. L. A. K. a. H. M. P., 2020. Automated detection and classification of fundus diabetic retinopathy images using synergic deep learning model. Pattern Recognition Letters, pp. vol. 133, pp. 210-216.
  3. Frid-Adar, I. D. E. K. M. A. J. G. a. H. G., 2018. GAN-based synthetic medical image augmentation for increased CNN performance in liver lesion classification. ArXiv.

Neterer JR., G. O., 2018. Deep learning in natural language processing. Proceedings of the West Virginia academy of science, pp. Vol-90, issue-1.

  1. K. Lakshmanaprabu, S. N. M. K. S. N. A. a. G. R., 2019. Optimal deep learning model for classification of lung cancer on CT images. future generation computer systems, pp. vol. 92, pp. 374-382.
  2. Sharma and K. C. Juglan., 2018. Automated classification of fatty and normal liver ultrasound images based on mutual information feature selection. IRBM, pp. vol. 39, no. 5, pp. 313-323.

Vishali Aggarwal., G., 2018. A review:deep learning technique for image classification. ACCENTS Transactions on Image Processing and Computer Vision, pp. Vol-4, issue- 11.

………………………………………………………………………………………………………………………..

Know more about UniqueSubmission’s other writing services:

Assignment Writing Help

Essay Writing Help

Dissertation Writing Help

Case Studies Writing Help

MYOB Perdisco Assignment Help

Presentation Assignment Help

Proofreading & Editing Help

Leave a Comment