All Projects → jtheiner → SketchRecognition

jtheiner / SketchRecognition

Licence: other
Model and Android app for sketch recognition using Google's quickdraw dataset

Programming Languages

python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SketchRecognition

meta-st-stm32mpu-ai
This repository contains the OpenEmbedded meta layer to install AI frameworks and tools for the STM32MP1
Stars: ✭ 32 (+14.29%)
Mutual labels:  image-classification, tensorflow-lite
kaggle brain-tumor-3D
Predict the status of a genetic biomarker important for brain cancer treatment
Stars: ✭ 20 (-28.57%)
Mutual labels:  image-classification
caltech birds
A set of notebooks as a guide to the process of fine-grained image classification of birds species, using PyTorch based deep neural networks.
Stars: ✭ 29 (+3.57%)
Mutual labels:  image-classification
AMP-Regularizer
Code for our paper "Regularizing Neural Networks via Adversarial Model Perturbation", CVPR2021
Stars: ✭ 26 (-7.14%)
Mutual labels:  image-classification
MobileNetV2-PoseEstimation
Tensorflow based Fast Pose estimation. OpenVINO, Tensorflow Lite, NCS, NCS2 + Python.
Stars: ✭ 99 (+253.57%)
Mutual labels:  tensorflow-lite
aws-rekognition
A Laravel Package/Facade for the AWS Rekognition API
Stars: ✭ 20 (-28.57%)
Mutual labels:  image-classification
VoiceNET.Library
.NET library to easily create Voice Command Control feature.
Stars: ✭ 14 (-50%)
Mutual labels:  image-classification
PlayerDetection
Player detection and ball detection in football matches using image processing(opencv).
Stars: ✭ 50 (+78.57%)
Mutual labels:  image-classification
al-fk-self-supervision
Official PyTorch code for CVPR 2020 paper "Deep Active Learning for Biased Datasets via Fisher Kernel Self-Supervision"
Stars: ✭ 28 (+0%)
Mutual labels:  image-classification
coursera-ai-for-medicine-specialization
Programming assignments, labs and quizzes from all courses in the Coursera AI for Medicine Specialization offered by deeplearning.ai
Stars: ✭ 80 (+185.71%)
Mutual labels:  image-classification
cifar-tensorflow
No description or website provided.
Stars: ✭ 18 (-35.71%)
Mutual labels:  image-classification
live-cctv
To detect any reasonable change in a live cctv to avoid large storage of data. Once, we notice a change, our goal would be track that object or person causing it. We would be using Computer vision concepts. Our major focus will be on Deep Learning and will try to add as many features in the process.
Stars: ✭ 23 (-17.86%)
Mutual labels:  image-classification
pyro-vision
Computer vision library for wildfire detection
Stars: ✭ 33 (+17.86%)
Mutual labels:  image-classification
general backbone
No description or website provided.
Stars: ✭ 37 (+32.14%)
Mutual labels:  image-classification
mruby-tflite
MRuby binding for TensorFlow Lite
Stars: ✭ 14 (-50%)
Mutual labels:  tensorflow-lite
ALPR System
Automatic License Plate Recognition System for Vietnamese Plates
Stars: ✭ 71 (+153.57%)
Mutual labels:  image-classification
HSI-Traditional-to-Deep-Models
Pytorch and Keras Implementations of Hyperspectral Image Classification -- Traditional to Deep Models: A Survey for Future Prospects.
Stars: ✭ 72 (+157.14%)
Mutual labels:  image-classification
GFNet
[NeurIPS 2021] Global Filter Networks for Image Classification
Stars: ✭ 199 (+610.71%)
Mutual labels:  image-classification
pico-mnist
Number recognition with MNIST on Raspberry Pi Pico + TensorFlow Lite for Microcontrollers
Stars: ✭ 44 (+57.14%)
Mutual labels:  tensorflow-lite
Reproducibilty-Challenge-ECANET
Unofficial Implementation of ECANets (CVPR 2020) for the Reproducibility Challenge 2020.
Stars: ✭ 27 (-3.57%)
Mutual labels:  image-classification

Sketch Recognition

This repository contains a Keras model for Google's quickdraw dataset to classify sketches, an Android app for demonstration and describes the whole workflow to integrate a custom model to an Android app applying Tensorflow Lite.

Global project structure:

  • "Android" folder: Includes the Android Studio Project of the SketchRecognition App
  • "SketchRecognition" folder: Directory for the complete recognition task
  • "ModelTransform" folder: Scripts for model conversion (Keras -> Tensorflow -> TFLite)

Dataset

I used a subset from Google's quickdraw dataset (see Quick, draw!) which contains more than 50 million drawings across 345 categories. For this project I used the simplified drawings stored in Numpy bitmaps. These bitmaps contain 28x28 grayscale images.

Model

I used a CNN architecture presented by Tensorflow's MNIST tutorial with a few modifications.

Results of sketch recognition:

# classes # training data # test data top-1 accuracy top-3 accuracy
20 8000 2000 89.76% 95.34%
345 4000 1000 65.57% 82.71%

The much higher top-3 accuracy using 345 classes is justified by the fact that there are some quite similar classes inside the dataset.

Confusion matrix for 20 classes:

To reproduce the presented results use this instruction

Structure of "SketchRecognition"

The folder "preparation_helper" contains Python and Shell scripts for preprocessing steps like dataset download, dataset instances reduction and dataset split in train and test set. "recognition" is the python project for the classification task. Besides it contains a "models" directory for all generated results (training process, images, frozen model, list of labels).

How to prepare the dataset:

  1. Download the full dataset (ca. 40GB) via script or download a subset manually (Link) and put the files into a "dataset" directory inside "SketchRecognition".

  2. Adapt the parameters in split_train_test.py to setup the directories, to reduce the number of instances per class you want to keep and split the dataset in train and test data. Then run the script.

Full sketch recognition task:

The classification.py script contains model training, visualisation and evaluation. Before run, adapt the dataset path. The main function describes the complete workflow from preprocessing over the model training to the evaluation. So feel free to make changes. Again, you can decide how many instances you want to use for training and test in total.

System Environment used for this task:

Ubuntu 18.04
Python 3.6.5 with Anaconda
Keras version 2.2.0
Tensorflow version 1.8.0

Android App

The Model Conversion and Integration Task

How to convert the frozen Keras model to Tensorflow Lite:

  1. Convert generated Keras model (*.h5) to tensorflow frozed graph (*.pb). Run the nice script keras_to_tensorflow.py written by Amir H. Abdi (see Repo), but before specify parameters like input and output file names.
  2. Take the generated tensorflow model (*.pb) and convert it to tensorflow lite using toco. You can run the toco.sh script. Important note: Use the correct input and output array names and also the correct input shape size. To inspect and verify these settings you can modify and run pb_view.py which loads the frozen tensorflow graph (*.pb).

How to integrate into the Android App:

Take the generated Tensorflow Lite model (.tflite) and the related "labels.csv" which were generated in the training task and move it to androids "assets" directory.

System Environment:

macOS High Sierra v. 10.13.6
Android Studio 3.1.3
Python 3.6.3 with Anaconda
Keras 2.1.6
Tensorflow 1.7.0 (For model conversion Tensorflow 1.7 is required!)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].