FLOWERS RECOGNITION
- maheshkamineni35
- Mar 25, 2022
- 2 min read
Updated: Apr 22, 2022

Convolution Neural Network
It is a type of neural network used in image recognition and to process pixel data.
A convolutional neural network, or CNN, is a deep learning neural network designed for processing structured arrays of data such as images. Convolutional neural networks are widely used in computer vision and have become the state of the art for many visual applications such as image classification, and have also found success in natural language processing for text classification.
Convolutional neural networks are very good at picking up on patterns in the input image, such as lines, gradients, circles, or even eyes and faces. It is this property that makes convolutional neural networks so powerful for computer vision. Unlike earlier computer vision algorithms, convolutional neural networks can operate directly on a raw image and do not need any preprocessing.

The main focus of this assignment is to recognize the flower type in an image.
It is done by using using convolutional neural networks.
I have imported dataset from Kaggle
Source: Flowers Recognition | Kaggle
The dataset contains total 4242 images of flowers.
The images are divided into five classes: chamomile, tulip, rose, sunflower, dandelion.
For each class there are about 800 images. Images are not high resolution, about 320x240 pixels. Images are not reduced to a single size, they have different proportions.
I have used google Collab for an assignment and I imported all images in a workspace.
then I imported some packages .
The packages that I have used is
numpy , pandas, matplotlib and seaborn for data visualization.
sklearn.model_selection for train_test_split and metrics like accuracy score.
Tensorflow
CNN dropour,flatten,Activation,Conv2D,MaxPooling2D,Batch Normalization.

Pre-Processing Data
This step is to Process the data to split into flower types like rose, tulip, sunflower etc.

the next step is to make train data

To visualize the classes used the seaborn library
The plotting I have used is countplot.

Model Developing
The images are converted into arrays and the labels are encoded.
Then the 2D convolution layers has been implemented. Then filter size and kernal size has been defined
Then the pooling layer has been implemented. The purpose of implementing pooling layer is to eradicate the noise in the images and to reduce the computation time of the model.

I interpreted the model using SGD optimizer

Fit the model on training data and validate on testdata.
To get High Accuracy I increased the size of Epoch

To find out the results of the model. I used the accuracy and loss generated by model for both training and test and comparison between them
To find out the loss ,sum of differnce between the actual values and predicted values


The loss is around 0.4 and 0.7 for train and test data.
and the accuracy for train and test data is 0.25 and 0.28

This indicates lower loss and lower accuracy.
for lower loss and higher accuracy I changed the optimizer to adam and size of an epoch to 50.

Hence now the accuracy for train and test is 0.75 and 0.85
Source Code
References:
Image References:
Learning References:
Project Reference's and Contributions.
Links | How I used the reference ? | What Value I made over the reference? |
I understood and used this as reference. | The model optimizer I have used is SGD and I increased the size of epoch ,so that I increased the accuracy from 18 to 27 and when I use the Adam optimizer it increased to 85. | |
| | |



Comments