All Projects → damianmoore → tensorflow-image-classifier

damianmoore / tensorflow-image-classifier

Licence: GPL-3.0 license
Easily train an image classifier and then use it to label/tag other images

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to tensorflow-image-classifier

tensorflow-image-classifier
image classifier, retrained for specific classes
Stars: ✭ 58 (+100%)
Mutual labels:  image-classification, image-classifier, tensorflow-image-classifier
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 (+175.86%)
Mutual labels:  image-classification, image-recognition, convolutional-neural-network
ML4K-AI-Extension
Use machine learning in AppInventor, with easy training using text, images, or numbers through the Machine Learning for Kids website.
Stars: ✭ 18 (-37.93%)
Mutual labels:  classifier, image-classification, image-classifier
tensorflow-image-recognition-chrome-extension
Chrome browser extension for using TensorFlow image recognition on web pages
Stars: ✭ 88 (+203.45%)
Mutual labels:  image-classification, image-recognition
Computer-Vision-Project
The goal of this project was to develop a Face Recognition application using a Local Binary Pattern approach and, using the same approach, develop a real time Face Recognition application.
Stars: ✭ 20 (-31.03%)
Mutual labels:  classifier, photos
Keras transfer cifar10
Object classification with CIFAR-10 using transfer learning
Stars: ✭ 120 (+313.79%)
Mutual labels:  classifier, image-classification
Image-Classification
Pre-trained VGG-Net Model for image classification using tensorflow
Stars: ✭ 29 (+0%)
Mutual labels:  image-classification, image-recognition
TensorFlow-Multiclass-Image-Classification-using-CNN-s
Balanced Multiclass Image Classification with TensorFlow on Python.
Stars: ✭ 57 (+96.55%)
Mutual labels:  image-classification, image-recognition
jpetstore-kubernetes
Modernize and Extend: JPetStore on IBM Cloud Kubernetes Service
Stars: ✭ 21 (-27.59%)
Mutual labels:  image-classification, image-recognition
rps-cv
A Rock-Paper-Scissors game using computer vision and machine learning on Raspberry Pi
Stars: ✭ 102 (+251.72%)
Mutual labels:  image-classification, image-recognition
UnityProminentColor
Tool to gather main colors of an image using Unity.
Stars: ✭ 40 (+37.93%)
Mutual labels:  image-classification, image-recognition
Custom-CNN-based-Image-Classification-in-PyTorch
No description or website provided.
Stars: ✭ 41 (+41.38%)
Mutual labels:  image-classification, image-classifier
Bag-of-Visual-Words
🎒 Bag of Visual words (BoW) approach for object classification and detection in images together with SIFT feature extractor and SVM classifier.
Stars: ✭ 39 (+34.48%)
Mutual labels:  classifier, image-classification
TensorFlow-Binary-Image-Classification-using-CNN-s
Binary Image Classification in TensorFlow
Stars: ✭ 26 (-10.34%)
Mutual labels:  image-classification, image-recognition
Transfer Learning Suite
Transfer Learning Suite in Keras. Perform transfer learning using any built-in Keras image classification model easily!
Stars: ✭ 212 (+631.03%)
Mutual labels:  image-classification, image-recognition
Vit
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Stars: ✭ 176 (+506.9%)
Mutual labels:  image-classification, image-recognition
zalo-landmark
Zalo AI Challenge - Landmark Identification
Stars: ✭ 39 (+34.48%)
Mutual labels:  image-classification, image-recognition
Idenprof
IdenProf dataset is a collection of images of identifiable professionals. It is been collected to enable the development of AI systems that can serve by identifying people and the nature of their job by simply looking at an image, just like humans can do.
Stars: ✭ 149 (+413.79%)
Mutual labels:  image-classification, image-recognition
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (+462.07%)
Mutual labels:  image-classification, image-recognition
Paper-Notes
Paper notes in deep learning/machine learning and computer vision
Stars: ✭ 37 (+27.59%)
Mutual labels:  image-classification, image-recognition

tensorflow-image-classifier

With this tool you will be able to easily train an image classifier and then use it to classify other images.

We use a technique called transfer learning where we take a model called Inception v3 that has already been trained by Google on the ImageNet challenge dataset. This model is flexible enough that we only need to replace the final layer of the graph with our own training. This is much faster than doing the deep learning from scratch.

This project mainly follows the TensorFlow for Poets tutorial.

The quality of your classifier will depend mostly on how good your labelled dataset is. I will be posting some tools to aid in creating a good dataset soon.

Requirements

  • Docker
  • git clone this project in a directory
  • Sample images in labelled directories (though you can use an example dataset shown below)

Getting started with an example dataset

The best way to get started is to try it out with an example dataset. Here we download a labelled dataset of flowers, move the photos into position, train the model against the dataset then use it to classify an image.

git clone [email protected]:damianmoore/tensorflow-image-classifier.git
./download_example_dataset.sh
./train.sh tf_files flowers -s 500  # This is the bit that will take a while to run (~20 mins on my laptop using the reduced dataset)
./classify.sh tf_files flowers tf_files/flowers/data/daisy/11124324295_503f3a0804.jpg

It should output something similar to the following probabilities:

daisy (score = 0.93466)
sunflowers (score = 0.04375)
dandelion (score = 0.01565)
tulips (score = 0.00516)
roses (score = 0.00078)

Directory setup

You need a directory that will hold the tensorflow data, your images and the output graphs - this is usually called tf_files. Make a classifier directory in it which is the name of the classifier you are building. Inside that should be a directory data where you should put directories for each of the classification labels and then images within those.

For example:

tf_files/
tf_files/flowers/
tf_files/flowers/data
tf_files/flowers/data/daisy
tf_files/flowers/data/dandelion
tf_files/flowers/data/sunflowers

Training

Train against the image samples for your classifier with 500 steps:

./train.sh path_to_tf_files classifier_name -s 500

Creating bottlenecks is the most time-consuming part and has to be done for each of the images. These bottlenecks are cached to disk though in tf_files/bottlenecks so only has to be done if new images are added. After the bottlenecks have been created, the main training and validation steps happen. The default (if no -s parameter is provided) is 4000 steps. The more steps you use for training, the more accurate the classificaiton should be, though you will hit a point of diminishing returns.

Classifying

Classify an image against the trained graph:

./classify.sh path_to_tf_files classifier_name yourfile.jpg

The results are ordered with the strongest matches at the top along with the probability scores. A score of 0.93, for example, means the classifier is 93% sure of the label being correct.

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