Skip to content

This is a fruit and vegetable classification project that uses a Convolutional Neural Network (CNN) with the Google Inception pre-trained model. The model is trained using Stochastic Gradient Descent and tested on a validation set to achieve 100% accuracy.

Notifications You must be signed in to change notification settings

RISHIKREDDYL/Fruit-Image-Classification-with-MATLAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fruit-Image-Classification-with-MATLAB

This code implements a fruit and vegetable classification using a pre-trained Google Inception neural network. The dataset used consists of 33 different fruits and vegetables classes. The validation and test accuracy of this model are both 100%.

Dataset

The dataset used in this project can be found at Kaggle.

Implementation Details

The code starts by loading the image data and then reducing all labels to 200 images, before splitting the dataset between training, validation, and testing sets. The pre-trained GoogleNet is then loaded, and the last layers are replaced for the classification task. The new feature learner and classifier layer are defined, and the layer graph is replaced with the new layers.

The model is trained using stochastic gradient descent with momentum (SGDM) as the optimization algorithm. The training options include a learn rate schedule, a learn rate drop factor, a learn rate drop period, a mini-batch size, and a maximum number of epochs. The model is trained for five epochs, and the validation data is used to validate the model every 50 iterations.

After training the model, it is saved along with the training progress. The test set is then classified, and a confusion matrix is created to show the performance of the model. The accuracy is calculated and displayed on the test set.

Usage

To use this code, download the dataset from the Kaggle link mentioned above and modify the path in the code to point to the correct location of the dataset on your system. The code can then be run on any platform that supports MATLAB.

About

This is a fruit and vegetable classification project that uses a Convolutional Neural Network (CNN) with the Google Inception pre-trained model. The model is trained using Stochastic Gradient Descent and tested on a validation set to achieve 100% accuracy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages