Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Hi(ve)! 🐝

This repo is the result of some work done in the Startup Weekend AI in Paris. :neckbeard:

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.

Take aways

  • 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).

The training phase is interesting in terms of overfitting: Training phase

We can see that we reach 0% (😱) error on the training set which means we completely overfit the data, yet the generalization on the dev set keeps improving until no learning is possible anymore.

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.


  • Run the ./vgg/ script to download pretrained vgg weights

  • Run python vgg/ to use a proper Saver to save the graph and weights (You can run python vgg/ to check that results are the same)

  • Finally you can check the file models/ to see how i add my personnal classifier on top of the CNN and run python --model complex to train it

  • If you want to train the simple model, jsut use python


virtualenv env -p python3.5
source env/bin/activate
pip install -r requirements.txt
# To install TensorFlow:

Running the models

You can test both models by running python script.

And finally you can even export a frozen model using python if you want to use it in production with TensorFlow in a more convenient way.



(Check the LICENCE file)


A simple bees larvae detector in Deep learning




No releases published


No packages published