Flask Based Convolutional Neural Network for Inverted Flower Classification
Segun sodimu
Ogun State
- 0 Collaborators
This project is developed for botanist and enthusiast who are keen on learning more about plants. It provides the user with the ability to classify a plant leaf to its scientific names such as Acer Capillipes, Alnus Rubra, Populus Adenopoda and e.t.c from a web interface. ...learn more
Project status: Published/In Market
Groups
DeepLearning,
Student Developers for AI
Intel Technologies
Intel Integrated Graphics
Overview / Usage
The aim of this project is to help botanist and plant enthusiast to quickly help in predicting and classifying plant leaves to its scientific names such as Acer Capillipes, Alnus Rubra, Populus Adenopoda and e.t.c
The primary usage of this application/model is from a web browser for convience. The user starts the web server written in flask and then upload the flower he/she wants to predict.
Methodology / Approach
The dataset is already in a 2 channel format, i.e Black and white. We imported Keras library which a popular deep learning framework built on top of Tensorflow, theano, cntk and caffe2 for fast prototyping of deep learning application.
-
The Input layer contains a convolutional2D layer with filter size of 32 and strides of 3x3.
-
Maxpooling with a stride of 2x2 is added to get the important features and reduced the input dimension
-
Flatten is used to convert the result of maxpool in matrix format to a vector.
-
Fully connected latyer with cell of 256 neurons and activation function is added to absorblayer the result of the flatten layer.
-
Output layer with softmax activation function & 99 neurons (which is the total number of classes we have in the training set)
-
Model compilation parameters include the following
- optimizer='adam',
- loss='categorical_crossentropy',
- metrics=['accuracy']
We used ImageDataGenerator to train our model which allows us to add augmentation to our dataset to make the dataset larger.
Training the Model
-
Download or git clone the repository
-
From your terminal, run `pip install`
-
Train the model by running `python classifier.py`
you will see the progress of the training on the console
Predicting Sample flower
-
Open another terminal and run `python run.py`.
-
From you browser, logon to `http://127.0.0.1:5000/\`
-
upload a sample flower and this will redirect you to the result page
Technologies Used
Python3
TensorFlow
Keras
Flask
Numpy
Pillow
Repository
https://github.com/princesegzy01/ConvNet-Flower-Classification