Distinguishing Between Honey Bee and Bumble Bee

Distinguishing Between Honey Bee and Bumble Bee

Distinguishing Between Honey Bee and Bumble Bee

Abhishek Thakur & Eben Olson

 

The Challenge

Metis (www.thisismetis.com) recently organized a challenge on DrivenData (www.drivendata.org). The goal of the challenge was to classify bees between honey bee and bumble bee using the images collected from BeeSpotter (www.beespotter.org) . This report describes how we obtained an AUC of 0.9956 (almost perfect separation) using convolutional neural networks.

Why Classify Bees?

Wild bees are important pollinators and the spread of colony collapse disorder has only made their role more critical. Right now it takes a lot of time and effort for researchers to gather data on wild bees. Using data submitted by citizen scientists, Bee Spotter is making this process easier. However, they still require that experts examine and identify the bee in each image.

The Dataset

The training dataset consisted of 3969 bee images and the test set consisted of 992 images.

Initial Model

We started with a basic initial model with the following layers:

It is seen that the net doesn’t learn almost anything. We didn’t invest much time in tuning this network and since pretrained networks were allowed, we moved forward towards finetuning some pretrained networks. This is discussed below.

Fine-tuning a GoogleNet Model using Caffe

We finetuned a googlenet model using caffe and achieved great results. Finetuning using caffe is an easy task.

Our solver looked something like this:

Since there were only two categories to distinguish between, we didn’t need 1000 outputs and this was changed to 2. The next steps included creating the training and validation files to be used in train_val.prototxt. The following ipython snapshot shows how the training and validation sets were created:


Changes in train_val.prototxt:

Changes in solver.prototxt

Changes in deploy.prototxt:

After this, the model can easily be finetuned using the following command:

  • /PATH_TO_CAFFE/caffe train -solver ./solver.prototxt -weights ./models/bvlc_googlenet.caffemodel

Results:

For each of the inception outputs in googlenet, we extracted the features and passed it through logistic regression model. Following plot shows how finetuned googlenet performed better than pretrained weights:

In the following plot we didn’t use any validation set. Everything else remained same as the above plot.

We also generated t-SNE projections of the 1024-dimensional output from the final pooling layer. This provides a visual indicator of how well the network can separate the classes.

The following plots show the t-sne projection of the predictions made:

As expected, a randomly initialized network produces no separation. The pretrained network displays some clustering, but it is not well separated, while the fine-tuned network produces two nearly distinct clusters.

Finally, a blend of 3 fine-tuned googlenet model gave an AUC of 0.9951 on public leaderboard and 0.9956 on private leaderboard.

Deepdream on finetuned network

The Deepdream technique creates visually interesting images by repeatedly making small changes to enhance the strongest filter activations of a particular layer or layers. This can give an indication of the sorts of patterns which are detected by the layer.

Output of inception_4c:

*Initialized with an image of clouds:

*Random (noise) initial image:

More layer visualizations:

Some of the selected visualizations from different layers of finetuned googlenet:

Nicolas Gaude

Director of Engineering @density.Io

8y

excellent post !

Like
Reply
Zach Hu

Engineer at Earnest

8y

Amazing

Like
Reply
Vikramjit S.

Global Data Architect @ AWS

8y

nicely written !!

Marios Michailidis

Data Scientist at H2O.ai, Fellow ,PhD, Kaggle GrandMaster

8y

I hope you did not get bitten during the training process!

Like
Reply

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics