You are currently viewing Python ML Image Classification App
Python Machine Learning Image Classification App

Python ML Image Classification App

Machine Learning Powered | Image Classification Flask App

Welcome to my project implementation of Real-time Image Classification Web App! This implementation is powered by a robust Machine Learning algorithm at the back-end while the front-end is developed with Flask and BootStrap.

A wide range of techniques in Image Data Analysis, Feature Extraction, Machine Learning, and Web Development have been covered during this implementation.

In addition, a wide range of Data Science, Image Processing, Computer Vision, and Machine Learning libraries and tools have been utilized, such as Scikit-Learn, Scikit-Image, Pandas, Matplotlib, Numpy, OpenCV, Scipy, Anaconda, and Visual Studio Code IDE, etc.

The programming language used for the back-end development is Python 3+, while HTML, CSS, DJango are primarily used for the front-end web interface development, and no database is required.

PROJECT IMPLEMENTATION

Essentially, the steps involved in this implementation are as follows:

  • Data/Image Arrangement and Preparation
  • Data/Image Pre-processing
  • Feature Extraction – with HOG Image Descriptor
  • Machine Learning Model Training
  • Machine Leaning Model Pipelining – Model Finalization
  • Front End Development – Building Flask Web App interface
  • Application Deployment – App Deployed in Python Anywhere

DATASETS | WHAT’S EXPECTED?

There are only 20 classes or categories of image used to train the Machine Learning model that powers this application.
They are the following: [1] Human head, [2] Eagle head, [3] Wolf head, [4] Elephant head, [5] Bear head, [6] Cat head,
[7] Chicken head, [8] Cow head, [9] Deer head, [10. Dog head, [11] Duck head, [12] Lion head, [13] Monkey head, [14] Mouse head, [15] Panda head, [16] Nature, [17] Pigeon head, [18] Rabbit head, [19] Tiger head, [20] Sheep head.

However, a total of 2,676 images which are divided into 20 categories were used to train my Machine Learning model. For better performance, I expect to train with larger number of images in many other different classes/categories.
This is a proposal for future work!

NOTE 1: In order to get a good sense of the outcome of this app, I encourage you to test this app only with images that belong to any of the above-listed 20 categories. Since my model was not trained with any other category of image, proving this app with any image which is not included the list of classes/categories above would return a bad result.

NOTE 2: I want to mention that for each of the 20 classes/categories of images listed above, only the picture of facial or head region were used to train my Machine Learning model and not pictures of the entire object. What this means, therefore, is that providing a full image of an Elephant or Eagle instead of Elephant head or Eagle head will have the app return wrong classification result.

USING THE APP | HOW TO RUN THE APP?

To use this application for your image classification tasks, follow the simple guides below.

  • Download and save only the HEAD region images (.PNG or .JPEG format only) within any of the 20 categories of datasets mentioned above. For quick reference, the categories include: Human head, Eagle head, Wolf head, Elephant head, Bear head, Cat head, Chicken head, Cow head, Deer head, Dog head, Duck head, Lion head, Monkey head, Mouse head, Panda head, Nature, Pigeon head, Rabbit head, Tiger head, Sheep head.
  • Go to the URL https://ekpo.pythonanywhere.com/
  • Upload a single image by clicking on the button that says “Choose File | No file chosen” and click on the “Submit” button.
  • Done! You should instantly see the classification results for the image you uploaded. Example is shown below.
Image Classification with machine learning and flask app
Image Classification with machine learning and flask app

More information regarding the dataset used to train my Machine Learning model can be found on my GitHub page.
For further information regarding this project, please contact the author, Dr. Ekpo Otu here.

Ekpo Otu

Hi, I am Dr. Ekpo Otu and this is my personal platform, where I share a bit of who I am, what I do, what I know, and what I am learning. Essentially, I am a computer science lecturer, researcher, and author | with expertise in Computer Vision, Data Science, Machine Learning, and Artificial Intelligence 📌 Please follow for more - Thanks!

Leave a Reply