This repo is the result of some work done in the Startup Weekend AI in Paris.
It contains two models:
- The first one is a very simple model based on CNN up-to-date best practice, reaching 98% percent accuracy
- The second one is a fine-tuned model fron vgg-19 which took too long to be retrained (no kidding...)
DISCLAIMER This repo does not contains the trainings/dev/test sets due to proprietary concerns.
- The simple model which take 3MB of memories and 6ms (on titan X) to compute an image is god damn accurate!
Completely blowing up previous bees larvae detections i know of using OpenCV, and this was achieved thanks to only 2000 training samples which is a very small dataset. Also, it took less than 10 minutes to train it
This validate again and gain the fact that deep learning is very well suited to handle real life data and its variability.
- The second model is not really useful for bees larvae detection, yet it shows how it is easy to fine-tune a model using TensorFlow (The VGG-19 model was taken from this site).
We can see that we reach 0% (
This is a clear indicator that more data would improve even more the accuracy, also we probably can simplify it even further and improve performance for this simple binary classifier.
./vgg/download.shscript to download pretrained vgg weights
python vgg/vgg.pyto use a proper Saver to save the graph and weights (You can run
python vgg/tf-vgg.pyto check that results are the same)
Finally you can check the file
models/bee.pyto see how i add my personnal classifier on top of the CNN and run
python train.py --model complexto train it
If you want to train the simple model, jsut use
virtualenv env -p python3.5 source env/bin/activate pip install -r requirements.txt # To install TensorFlow: https://www.tensorflow.org/versions/r0.11/get_started/index.html
Running the models
You can test both models by running
python test.py script.
And finally you can even export a frozen model using
python freeze.py. if you want to use it in production with TensorFlow in a more convenient way.
(Check the LICENCE file)