Giter VIP home page Giter VIP logo

trasholution-ml's Introduction

Trasholution-ML

Github Repository for the Machine Learning side of Trasholution

(Bangkit 2023 Capstone Project C23-PS250 Team)

  • For the main repository you can go to this repository

Directory in this repository

Trasholution-ML
├── ML-FastAPI-app
│   ├── app
│   │   ├── model
│   │   │   ├── [PLACE THE MODEL IN THIS FOLDER]
│   │   │   └── README.md
│   │   ├── __init__.py
│   │   └── main.py
│   ├── .dockerignore
│   ├── Dockerfile
│   └── requirements.txt
├── Training Notebooks
│   ├── training_model_waste_classification_v2_1.ipynb
│   └── training_model_waste_classification_v2_2.ipynb
├── .gitignore
└── README.md

Model Training

Dataset

  • Datasets used to train the model can be accessed on Google Drive and Kaggle Dataset.
  • In this dataset there are 8 class of trash/waste type; Electronic_Waste, Food_Scraps, Glass, Metalic_Materials, Organic_Vegetation_Waste, Paper, Plastic, and Textile.
  • This number of image in this dataset are split into 3 part per image class:
    • Training data : 80% of 520 images (416 images per image class).
    • Validation data : 10% of 520 images (52 images per image class).
    • Testing data : 10% of 520 images (52 images per image class).
  • This dataset consist of image taken from scraping the internet.

Jupyter Notebooks for Training Models

  • At first, we develop two kind of model with version 1 created from scratch and version 2 are from transfer learning.
  • From our early test we found that the version 1 only able to reach the testing accuracy of 73%, meanwhile the first complete iteration of version were able to reach testing accuracy of approx. 89%.
  • Therefore we decided to drop the version 1 model to keep improving the version 2 model.
  • When we first tried to develop the version 2 model, we tried to compare the result of 3 base model that is the VGG16, Inception V3, and Xception to our dataset. And we found that the with Xception as base model have the highest score out of the three.
  • Jupyter notebooks used in training the model are in the /Training Notebooks/ folder:
    • training_model_waste_classification_v2_1.ipynb used to train the model-waste_classification-v2_1.h5 model
      • This model architecture are a little bit different from the previous model in terms of the number of hidden layer in the fully reconected layer (Dense layer).
    • training_model_waste_classification_v2_2.ipynb used to train the model-waste_classification-v2_2.h5 model
      • This model architecture differ from the previous version in terms of fine tuning the transfer learning model with the last 6 layers (the block 14 group of Xception model layers) are fine-tuned to the this dataset.

Exported Models

  • The exported model can be accessed here (Google Drive):
    • model-waste_classification-v2.zip (TensorFlow SavedModel format) has an accuracy score of:
      • training : 99.82%
      • validation : 89.90%
      • testing : 89.18%
    • model-waste_classification-v2_1.h5 (Keras HDF5 format) has an accuracy score of:
      • training : 99.07%
      • validation : 89.90%
      • testing : 90.38%
    • model-waste_classification-v2_2.h5 (Keras HDF5 format) has an accuracy score of:
      • training : 99.07%
      • validation : 92.07%
      • testing : 92.06%
  • The model that is currently in use for deployment is the model-waste_classification-v2_2.h5.

Model Deployment

  • /ML-FastAPI-app/ folder contains the web app FastAPI implementation for the model deployment in GCP Cloud Run.
  • /ML-FastAPI-app/model/ folder contain the model for creating Docker Image. Due to Git file size limit at 100MB, you can download the exported model in the Exported Models section above.
  • The Docker Image for model deployment in Cloud Run can be found on Docker Hub.
  • Docker Image that is currently in deployment in GCP Cloud Run is the latest tag (rafaelmahesa/ml-waste-image:latest).

trasholution-ml's People

Contributors

rafaelmahesa avatar orysxincode avatar

Watchers

 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.