GithubHelp home page GithubHelp logo

bridgecrew-perf7 / image-classification-model-deployment-5 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sadhityadimas/image-classification-model-deployment

0.0 0.0 0.0 20.03 MB

Convert Trained Image Classification model into Tflite

Jupyter Notebook 100.00%

image-classification-model-deployment-5's Introduction

Image-Classification-Model-Deployment

Convert Trained Image Classification model into Tflite

Dicoding-Image-Classification-Submission

Library Used

  • Tensorflow
  • Keras
  • matplotlib
  • Numpy
  • Pandas
  • Kaggle

Data set composition

type buildings forest mountain sea street total
0 train 2191 2271 2512 2274 2382 11630
1 val 437 474 525 510 501 2447

Step by Step Model Building

Display random images to examine

Rescaling Image

Image Augmenting (train set only)

  • Rotation
  • Horizontal flip
  • Zoom range
  • Shear
  • Fill mode nearest
  • Data generating
  • resizing image to 150x150
  • batch size 128
  • class mode categorical

Build Convnet

  • 1 hidden layer (perceptron 128 units)
  • output layer 'Softmax'
  • model = keras.Sequential([
  • layers.Conv2D(32, (3,3), activation = 'relu', input_shape= (150,150,3)),
  • layers.MaxPooling2D(pool_size=(2, 2)),
  • layers.Conv2D(64,(3,3), activation= 'relu'),
  • layers.MaxPooling2D(pool_size=(2, 2)),
  • layers.Conv2D(128,(3,3), activation= 'relu'),
  • layers.MaxPooling2D(pool_size=(2, 2)),
  • layers.Flatten(),
  • layers.Dropout(0.5),
  • layers.Dense(128, activation= 'relu'),
  • layers.Dense(5, activation= 'softmax')
  • ])

Adding Loss Function and Optimizer

  • loss : categorical cross entropy
  • optimizer adam
  • metrics accuracy

Adding Custom Early stop function using Callback from tensorflow

  • Model will stop training once val accuracy reaches atleast 85%

Training the model

  • epoch : 40
  • steps per epoch : 20
  • verbose : 1
  • validation steps : 10
  • callbacks

Results

  • Best Validation Loss: 0.41

  • Best Validation Accuracy: 0.86

  • Loss

  • Accuracy

Convert Model to Tflite

  • Name trainde model to my model.tflite

image-classification-model-deployment-5's People

Contributors

sadhityadimas 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.