Plant Leaf Classification Using Deep Learning, Transfer Learning and ML Algorithms

Vibhav Sharma
5 min readJun 16, 2020

--

INTRODUCTION

  • Why Leaf Classification ?

From long time ago, people have already learned to identify different kinds of plants by examining their leaves. Nowadays, leaf Morphology, Taxonomy and Geometric Morphometrics are still actively investigated. Leaves are beautiful creations of nature, people today are frequently inspired by them for creations of art works. For example, Candian people use a maple leaf as the center of their flag. It would very nice if computers can help create leaves automatically from scratches. We assume this is a very difficult task. In order to make a beginner’s start, it may be beneficial to investigate what makes different leaves different from each other.

This is a classification problem. Features learned from classification may help us have a peek at a glimpse of nature’s genius idea when it decides to make such creations. In industry, automatic recognition of plants is also useful for tasks such as species identification/reservation, automatic separate management in botany gardens or farms uses plants to produce medicines. It is also a good practice for me to learn things that are beyong textbooks.

Welcome to this field of enhancement 🐱‍🚀, Chronologically we have applied some of the best practiced techniques available at global platform for our research field.

Lets Understand the basic principle behind each of them ✌

Data Pre-processing :

If you are a newbie and wonder how things 🤷‍♂️ work in field of AI and Machine Learning, its recommended to give few min read on this.

  • For research purpose we have used Swedish Leaf Dataset which is divided into 15 classes of leaves, However the quantity of dataset is not suitable for studying classification with DeepConv nets or any other technique mentioned above.
Swedish Leaf Dataset Images with all 15 classes

Therefore making it challenging for us to increase the size of the dataset. We applied technique of Augmentation to overcome the problem.

  • What is Augmentation in Data pre-processing?
  • Augmentation Technique is basically used to change the orientation and layout of a particular image and creating multiple copies for the same image as shown :
Multiple augmentation techniques applied on a single image randomly

Another Challenge was to resize the each image to a default size as different size images are generally difficult to process.

  • For this we resized the whole dataset images to be of 224*224 pixels
  • Also for DeepConv-Nets we have to transform image platform from RGB to Grayscale for better results :
Image transformation only for DeepConv-Nets

Training Methods :

1. DeepConv-Nets :

  • Basic idea is to design a suitable CNN architecture for the given problem and train the model on our preprocessed dataset so that system is able to detect the target class of the leaf automatically.
  • CNN Architecture Proposed for our Problem :
2 Conv-Layer with max_pooling ,strides and padding kept to be same + 1 Dense Layer for the output of 15 classes

2. Transfer Learning :

  • It focuses on storing the knowledge gained while solving one problem and applying it to a different but related problem. So we can use some of the prebuild architecture of CNN related to leaf classification and apply it on our preprocessed dataset just to check our performance.

3. Machine Learning :

As the machine learning algorithms don’t extract features by itself, we extracted some features like :

  • · Harlick: used to extract the texture information of the image.
  • · Hu-moments: used to describe, characterize, and quantify the shape of an object in an image.
  • · HSV Histogram: converted the image to HSV (Hue, Saturation, Value) color space and calculated the color histogram.

The extraction of features will make the model more accurate in classifying the image to the target class.

Experimental Results :

  • Machine Learning :
Table 1

In machine learning, we used two approaches to the classification of the images. Those two are:

· Pixels values as the input

· Extracted features as input

The accuracies obtained by those two methods are recorded in Table 1

  • Transfer Learning : The best way to reduce the overfitting of a model when we have a limited number of images is to use the pre-defined architectures. The last layer of the pre-trained networks replaced with a dense layer of 15 nodes. Acquired accuracies by training multiple Pre-trained networks listed down in Table 2
Table 2 showing results obtained by different pre-trained networks with the best graph shown for the validation accuracy provided by ResNet50
  • DeepConv-Nets : We trained different structures of Deep Conv-Net by modifying the architecture and hyperparameters and some of the results is shown below with modified Dataset :
Table showing some of the results experimented on modified dataset as well as architecture and Graph showing the best result obtained from the the given Model’s
  • After going through rigorous Training in DeepConv-Nets, Transfer Learning and applying multiple ML algorithms following were the best suited results for validation_accuracy of each category :
Table Showing Final Results achieved for the Research

Conclusion / Overview :

  • We were able to propose an automatic plant species identification approach which is employed using computer vision and machine learning techniques to classify plant leaf images.
  • The study has been conducted in phases like image pre-processing, image segmentation, feature extraction and finally classification of the image.This was done using three approaches ,namely , Machine Learning ,Transfer Learning and Deep Learning.
  • The system was tested on Swedish dataset and attained an average accuracy of 97.26%. The model could automatically classify 15 different plant species.
Overview of the Architecture proposed in the Research

Thank you for your time 🙌 , Feel free to write any suggestions below… If you feel like you have gained some knowledge , don’t forget to give an applaud 👏

Collaborators :

--

--

Responses (1)