https://github.com/knightron0/android_plushie
Simple classifier for android plushies.
https://github.com/knightron0/android_plushie
android-plushie keras tensorflow
Last synced: 2 months ago
JSON representation
Simple classifier for android plushies.
- Host: GitHub
- URL: https://github.com/knightron0/android_plushie
- Owner: knightron0
- Created: 2019-12-20T16:58:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-27T06:03:39.000Z (over 5 years ago)
- Last Synced: 2025-02-26T10:46:44.937Z (over 1 year ago)
- Topics: android-plushie, keras, tensorflow
- Language: Python
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Classifier Model with Tensorflow and Keras to detect Android Plush Toys
# Data Collection and Pre-processing
A conventional dataset for Android Plushies was not readily available, so I had to collect the data manually. I simply scraped the images from a simple Google search which contained an Android Plushie in them. But these images were just 54 in number, so I used a widely known technque to expand data known as *Data Augmentation* I carried out this process with the help of **OpenCV** and **Numpy**. I generated new images using the following techniques.
- Addition of Salt and Pepper Noise
- Addition of Gaussian Noise
- Inverting Colours
- Flipping the Image
- Addition of Speckle Noise
- Conversion to Grayscale
PS: Before augmenting the data, I also resized all of the images to 225x225 pixels, to provide the network with a fixed input.
After this process, I ended up with 1080 images that contained Android Plushies.
Now, all I had to do was to collect images that did not contain Android Plushies. For this, I recorded a small video around my house and then run the footage through **ffmpeg** which extracted the frames at a certain frame rate and ended up with around ~1110 images.
I resized all of these images to 225x225 pixels as done before and my data was ready.
# Building the Network
I used Keras with Tensorflow to build my Neural Network. It consisted of 2 hidden layers of 500 nodes each with the *Relu* activation function. The output layer used the *Softmax* activation function with converted the output to a list of probabilities of each class, in this case 2. I first created a .h5 model (using Keras) and then used the *tf.lite.TFLiteConverter* to convert it to a .tflie model.
# Training the Network
Due to a small amount of data, I ran the network through very few epochs to prevent overfitting. Using hit and trial, I decided that 20 Epochs would be the most suitable number of epochs.
PS: Due to Github's file size restriction, the data and the model is [here](https://drive.google.com/open?id=1k3lto3AvX1WPVQIDQ6lxGr3CcJxL-12k).