ayoub-berdeddouch / cat-dog

Flask app for Classification of Dog/Cat using (CNN) with transfer learning @MobileNetV2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building a Flask app on Image Classification of Dog/Cat Dataset implemented by Convolutional Neural Network (CNN)

Ayoub Berdeddouch

This is the project that we finished after ML ZoomCamp by @ Alexey Grigorev

INTRODUCTION

1. The Dog vs. Cat Dataset

Dogs vs. Cats dataset provided by Microsoft Research contains 25,000 images of dogs and cats with the labels

  • 1 = dog
  • 0 = cat

2. Project goals

  • Building a deep neural network using TensorFlow & Transfer Learning to classify dogs and cats images.

  • Making a Flask application so user can upload their photos and receive the prediction.

3. Project plan

During this project, we tackled these steps:

A. Build the model

B. Build the Flask app

Front end

  • HTML
    • How to connect frontend to backend
    • How to draw a number on HTML
    • How to make UI looks good

Back end

  • Flask
    • How to set up Flask
    • How to handle backend error
    • How to make real-time prediction
    • Combine the model with the app

HOW IT WORK: CONVOLUTIONAL NEURAL NETWORK (CNN)

In deep learning, a convolutional neural network (CNN, or ConvNet) is a class of deep neural networks, most commonly applied to analyzing visual imagery. (Wiki)

For this project, we used pre-trained model MobileNetV2 from keras. MobileNetV2 is a model that was trained on a large dataset to solve a similar problem to this project, so it will help us to save lots of time on buiding low-level layers and focus on the application.

Note: You can learn more about CNN architecture here chapter 8.

MODEL PERFOMANCE SUMARY

Our model has the accuracy of 99 % for the train dataset and 98.67 % for the test dataset.

FLASK APPLICATION

Homepage

Example of results

Cat Exemple

Dog Exemple

About

Flask app for Classification of Dog/Cat using (CNN) with transfer learning @MobileNetV2


Languages

Language:HTML 80.4%Language:Python 17.9%Language:JavaScript 1.7%