Fruit Recognition Using Matlab Code

Goal:

Using edge detection (see matlab's canny edge detector) might be able to get you some boundary information. If you are looking for a smooth object, there will not be very many edges in it. Edit: I tried to adhere to this advice in the most simplistic way. Here are the resulting code and a few samples.

  • To implement a Convolutional Neural Network in Tensorflow which can accurately disntinguish fruits from each other
  • To undergo an incremental devleopment cycle in building the model, starting with a few classes and building upwards

Results:

  • Final model trained to classify 40 fruits. Successful with 92.47% Accuracy
  • Structure of model and statistics about it's success during each step of the design process are in changelog.txt

Data set used: fruits-360 dataset from Horea Muresan, Mihai Oltean, Fruit recognition from images using deep learning, Technical Report, Babes-Bolyai University, 2017

Implementation of TensorFlow Object Detection API on Windows 10 with fruit images without Anaconda Distribution.

No Anaconda Distribution. Use command prompt instead of Anaconda Prompt.

1)Don't use the below commands in 2d.

conda create -n tensorflow1 pip python=3.5

activate tensorflow1

2)Change the command below in 2d

conda install -c anaconda protobuf

to this

pip install protobuf --upgrade

3)Download protoc.exe from here . Copy protoc.exe(in bin folder) to C:tensorflow1modelsresearch.

Then run 2f.

Squirrel sql postgres drivers for mac. 4)Before step6, open C:tensorflow1modelsresearchobject_detectionutilslearning_schedules.py with a text editor.

Change the line 168 from

range(num_boundaries)

to

Sweyntooth

list(range(num_boundaries))

Data can be downloaded from here. 240 training images 60 test images. No problematic image.

3 different types of fruits: Apple, Banana, Orange.

.xml files in data have coordinates of objects.

Sorting

I trained it on a GTX 1050 for 5 hours. Approximately 53000 iterations.

Faster R CNN inception v2 model.

Input ImageOutput Image
Input ImageOutput Image
Input ImageOutput Image
Input ImageOutput Image
Input ImageOutput Image

Credits go to EdgeElectronics. I just followed the steps in the tutorial.