This model aims to count the leaves in the input images and it can count the images that have leaves of 1,2,3,4 or 6. This problem can be configured as classification or regression problem and here we will compare between these two methodologies.
Name :Leaf counting dataset
Description: The dataset is plant images at different resolutions captured with a variety of cameras. There are images showing plants with approximatelty 1,2,3,4 and 6 leafs. The images are part of a Leaf counting dataset which can be downloaded from the Aarhus University, Denmark.
Link to download:
you can download the dataset from the original website hereOriginal data
you can download the splitted folders for train and test from hereSplitted version
To run this notebook, so download the splitted vesion and extract them in the same directory.
Samples from the data:
Perfoming data normalization and resizing to make the images ready for modeling
According to the problem of detecting the number of leaves so the colors not important to differentiate between the classes, so I converted the dataset to gray scale and try to segment only the planet and remove the background.
You can download the preprocessed dataset from here Download
To increase the number of images to make the model learn more from the data we performed some augmentation such as flipping, small rotation, shear, random crops and zoom.
Classification using VGG .
Regresssion also using VGG and customize the last layer to be 1 node linear.
In the these appraoches I also used some regularization and batch normalization.