Giter Site home page Giter Site logo

sky9743 / image-classification-transfer-learning-heroku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thepankj/image-classification-transfer-learning-heroku

0.0 0.0 0.0 58.23 MB

A multiclass image classification project, used transfer learning to use pre-trained models such as InceptionNet to classify images of butterflies into one of 50 different species.

Home Page: https://butterfly-classification.herokuapp.com/

Shell 0.02% Python 0.28% Jupyter Notebook 99.69%

image-classification-transfer-learning-heroku's Introduction

Multiclass Image Classification using Transfer Learning

Introduction

In machine learning, Transfer Learning is the process of using knowledge previously acquired by solving a problem on a new (current) problem, with or without changes to the knowledge.

This is possible because when a model is trained, the initial neurons of a CNN architecture extract only the high level information, which gets narrowed down to information about the specific classes with each neural layer. For example, if a model is trained to recognize flowers, it can be further trained to classify different flower species.

In this project, I have used 4 pre-trained models to predict the species of butterflies.

The full notebook is availavle here

Dataset

The dataset for this project is taken from my Kaggle profile here

The directory structure is in the following format:

Train   
│
└───adonis
│   │   000.jpg
│   │   001.jpg
│   │   ...
│
└───american anoot
│   │   000.jpg
│   │   001.jpg
│   │   ...
│
└───an 88
│   │   000.jpg
│   │   001.jpg
│   │   ...
...
...

...
│
└───zebra long wing
    │   000.jpg
    │   001.jpg
    │   ...

The dataset has around 4000 images of 50 different species of butterflies. NUmber of images of each species

Methodology

To build the classifier, I used pretrained models from Keras Applications. I took just the base of the models ans added more layers to make it fit for this problem.

Then I saved the models and used StreamLit to create a webapp which can take in an image and predict to which class it may belong to.

For the deployment, I used Heroku. The final site is this Website Deployed

Result

The best accuracy is given by ResNet with 82% accuracy ans the worst is by VGG16 with 71.75% accuracy.

Difficulties & Challenges Faced

  • Did not know what ImageDataGenerator and flow_from_directory returns. So had difficulty to pass new images for prediction to the models. But it's basically a 4D Numpy array.
  • The training was done on Colaboratory. To create and test the app, I had to download the trained model and run it locally, but due to low specs, it couldn't run on my laptop. So tried using ngrok on Colab which didn't work, but an alternative, remote.it worked perfectly.
  • To deploy the app on Heroku, I used tensorflow 2.5.0 whid has a huge size so the slug was exceeding the limits (500MB). Then I used tensorflow-cpu 2.5 and it worked.

image-classification-transfer-learning-heroku's People

Contributors

thepankj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.