This project has been moved to https://gitlab.com/archiekennedy/cobalt, consider this repository outdated.
Convolutional residual neural network for image-based object classification, used in this Android app.
Based on the WRN architecture, training and validation data taken from the CIFAR-100 data set.
Capable of reaching about 74% accuracy after 80000 training steps (just over 22 hours with a GTX 1070 8GB).
If you run out of memory try using a smaller batch size, for best results use powers of 2.
Linux (or anything that supports shebangs):
./cobalt.py --help
Windows:
python cobalt.py --help
./cobalt.py --train 40000
./cobalt.py --accuracy
./cobalt.py -t 80000 --export network
To represent training graphically:
- Navigate to the cobalt directory.
- Run
tensorboard --logdir=data/log
orpython -m tensorboard.main --logdir=data/log
on Windows (replacedata
with whatever you set using--save
). - Open localhost:6006 in your browser.
Make sure you have a 64-bit operating system.
If you're running something Debian based:
sudo apt-get update
sudo apt-get install python3-pip python3-dev python3-tk
sudo python3 -m pip install -U setuptools
sudo python3 -m pip install -U tensorflow numpy
Training is a lot faster with a graphics card, but getting it running is an involved process:
sudo apt-get update && sudo apt-get install python3-pip python3-dev python3-tk
- Install CUDA Toolkit 9.0 from here by following this guide.
- Get the cuDNN SDK 7.0.5 for CUDA 9.0 from here, follow the cuDNN Install Guide PDF for that specific version.
sudo apt-mark hold libcudnn7 libcudnn7-dev
sudo pip3 install -U setuptools && sudo python3 -m pip install -U tensorflow-gpu
- Get Python from here (download the x86-64 version), make sure to tick Add Python 3.6 to PATH during installation.
- Download this file and run it with
python get-pip.py
to install pip. python -m pip install -U setuptools
python -m pip install -U tensorflow numpy
To use this with your own code, save the trained network as a .pb file with --export
.
If you use Java have a look at this class from my app for an example on using the TensorFlowInferenceInterface, or read this tutorial.
TensorFlow offers the SavedModel loader, read about it here.
Protocol Buffers support a few other languages and people are working on adding more.
ImageNet Classification with Deep Convolutional Neural Networks (Alex Krizhevsky, Ilya Sutskever & Geoffrey Hinton, 2012).
Dropout: A Simple Way to Prevent Neural Networks from Overfitting (Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever & Ruslan Salakhutdinov, 2014).
Wide Residual Networks (Sergey Zagoruyko & Nikos Komodakis, 2016).
A Method for Solving a Convex Programming Problem with Convergence Rate O(1/K2) (Yurii Nesterov, 1983).
Deep Residual Learning for Image Recognition (Kaiming He, Xiangyu Zhang, Shaoqing Ren & Jian Sun, 2015).
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift (Sergey Ioffe & Christian Szegedy, 2015).
Magnus Pedersen and his excellent repository.
A thanks to Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton for maintaining the CIFAR-100 data set.
Learning Multiple Layers of Features from Tiny Images (Alex Krizhevsky, 2009).
This repository uses the MIT License.
TensorFlow is released under the Apache License, Version 2.0.