Flask Based Convolutional Neural Network for Inverted Flower Classification

Segun sodimu

Segun sodimu

Ogun State

3 0
  • 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

Artificial Intelligence

Groups
DeepLearning, Student Developers for AI

Intel Technologies
Intel Integrated Graphics

Code Samples [1]

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.

  1. The Input layer contains a convolutional2D layer with filter size of 32 and strides of 3x3.

  2. Maxpooling with a stride of 2x2 is added to get the important features and reduced the input dimension

  3. Flatten is used to convert the result of maxpool in matrix format to a vector.

  4. Fully connected latyer with cell of 256 neurons and activation function is added to absorblayer the result of the flatten layer.

  5. Output layer with softmax activation function & 99 neurons (which is the total number of classes we have in the training set)

  6. 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

  1. Download or git clone the repository

  2. From your terminal, run `pip install`

  3. Train the model by running `python classifier.py`

you will see the progress of the training on the console

Predicting Sample flower

  1. Open another terminal and run `python run.py`.

  2. From you browser, logon to `http://127.0.0.1:5000/\`

  3. 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

Comments (0)