Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 3.27 KB

README.md

File metadata and controls

78 lines (65 loc) · 3.27 KB

Machine Learning Model Gizilo

This repository contains machine learning for gizilo apps. The modles include image classification and nutrition grade system.

Models Image

We pre trained models and do fine tune transfer learning. We also try build from scratch without help pre trained models

Model Accuracy Val Accuracy
Scratch 0.74 0.26
InceptionV3 0.84 0.75
Resnet50V2 1.00 0.63
MobileNetV2 0.96 0.67

Models Nutrition

We trained nutrition models from scratch without help pre trained models.

Model Accuracy Val Accuracy
Model 0.99 0.98

Dataset

We have to datset, one image and another one is nutrition list.

Dataset Link
Image Datset
Nutrition Dataset

How to reproduce this model

To reproduce this model you can follow this step:

  1. Download what model you cen reproduce
Type Dataset Link Model Link
Nutrition Data Train Notebook
Image (scratch) Link included in notebook Train Notebook
Image (InceptionV3) Link included in notebook Train Notebook
Image (Resnet50V2) Link included in notebook Train Notebook
Image (MobileNetV2) Link included in notebook Train Notebook
  1. Now after download the notebook and dataset you upload the notebook and dataset to use Kagggle or Google Collab for free resource training.
  2. After that you can run the kernel and run each cell.

Deployment nutrition model using docker

  1. Clone the project
git clone https://github.com/annwarsa/model-gizilo.git
  1. Navigate to deployment folder
cd model-gizilo/deployment
  1. Run docker compose
docker compose up -d

NOTE: If the model cannot be loaded, you can try saving it again in a virtual machine, which will be deployed, so it will have the same environment.

The api will be at localhost:8080/api/v1/nutrient. To test and get the result you can use rest api tools such as postman or equivalent, and following this:

  • Endpoint: localhost:8080/api/v1/nutrient
  • Method: POST
  • Payload:
    {
        "fat": 1,
        "sugar": 1,
        "sodium": 1
    }
  • Response:
    {
        "result": "A"
    }