
Counting Bees on a Raspberry Pi with a ConvNet - burningion
http://matpalm.com/blog/counting_bees/
======
2dollars27cents
Awesome! Make a nice enclosure and you have a niche hardware product.

------
anonfunction
Once you get the JeVois[1] it would be interesting to run the "Background
subtraction to detect moving objects"[2] model and see how that compares.

1\. [https://www.jevoisinc.com/products/jevois-a33-smart-
machine-...](https://www.jevoisinc.com/products/jevois-a33-smart-machine-
vision-camera)

2\.
[http://jevois.org/moddoc/DemoBackgroundSubtract/modinfo.html](http://jevois.org/moddoc/DemoBackgroundSubtract/modinfo.html)

------
make3
the protect is very cool. As a professional deep learning researcher myself,
the author couldn't made a few things to make his life more simple, and for
better results. For example, using "Image translation" (encoder decoder
structure) is what is used everywhere in the regular semantic segmentation
models, of which there are many pretrained and already available for low
computing power mobile, and which would have saved the author a lot of time by
bit having to hand label images, and would likely have done a better job
because they were trained on gigantic datasets instead of relatively few hand
labeled images.

The normal way to do this would be to use mobile net v2 with the tensorflow
image detection pipeline:

[https://github.com/tensorflow/models/blob/master/research/ob...](https://github.com/tensorflow/models/blob/master/research/object_detection/README.md)

------
Langhalsdino
Awesome job!! It look pretty similar to, what the german startup apic.ai is
doing :) Here is the google translator link:
[https://translate.google.com/translate?hl=en&sl=auto&tl=en&u...](https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fapic.ai)

------
alehul
Does anyone have an idea roughly how long this would take to build?

I'm new to CS and I'm always seeing all these cool projects I want to work on,
but I don't know how much of a time commitment it really is to build a side
project like this.

~~~
malux85
It is strongly a factor of the skill of the builder.

Juniors will probably get tripped up getting the environment setup

Medium level will probably get a simple one working OK but be unable to tune
it (e.g. get stuck in execution speed or a false positive problem)

Senior engineers might be able to do it in 1-2 focused days.

But regardless of your skill level you should just attempt it. It doesn’t
matter if you don’t get all the way through, you will learn loads in the
process, and if you get stuck your subconscious will wittle away and you’ll
have some lighting bolt moment while you’re in the shower, or biking, or
playing games. If you’re new to the field go for it! If you get stuck and need
some direction, feel free to email me

------
amelius
Say you'd train this on images of bees of some size. Would the same net also
work for bees which appear to be (e.g.) twice as large?

~~~
mat_kelcey
no, it won't directly. conv nets handle translation invariance but not scale
invariance. having said that there's no reason you can't use aggressive data
augmentation for this (resizing before patch sampling). i wonder how much the
semi supervised approach might help too; if you've labelled _only_ small bees
in a subset of the data, trained a model, applied to a larger dataset &
retrained there will be a small amount of detections (that are true positives)
to bees that are slightly larger (and smaller) than the ones you labelled....
(maybe?)

~~~
amelius
Ok. Why isn't there a kind of network function that works with scaling, like
convolution works with translation?

------
loser777
>the first baseline was to freeze the tensorflow graph and just run it
directly on the pi. this works without any problem, it's just the pi can only
do 1 image / second :/

I wonder if this was done using full blown tensorflow, which might be leaving
a lot of performance on the table. There are currently some efforts to improve
the efficiency/optimization of getting a network to run well on the modest
hardware of a pi e.g., tensorflow lite:
[https://www.tensorflow.org/mobile/tflite/](https://www.tensorflow.org/mobile/tflite/)
tvm: tvm.ai

~~~
mat_kelcey
That's just a sanity check; the end goal is some accelerated hardware ( neural
ompute stick / jevois / etc)

------
eggie5
"my first quick experiment was a patch based "bee / no bee in image" detector.
"

What are these patches and what was your intuition on starting w/ it?

~~~
mat_kelcey
Just a randomly sampled 32x32 patch, intution being most bees in image aren't
bigger

------
make3
fully convolutional neural networks: [https://www.quora.com/How-is-Fully-
Convolutional-Network-FCN...](https://www.quora.com/How-is-Fully-
Convolutional-Network-FCN-different-from-the-original-Convolutional-Neural-
Network-CNN)

------
celestialcheese
This is extremely cool - great work!

------
amar65
Awesome project & blog!

------
roel_v
But what does it count now, exactly? Only the number of bees in the air in
some space before the hive, right? It doesn't even say if they're going in or
out? What exactly can be measured with this metric, apart from a very generic
'activity level'? Can it detect swarming, robbing, total bee count of a hive,
bearding, anything useful?

~~~
vvanders
Looks like the whole thing is up on GitHub so you're free to do what you want
with it.

Honestly, your comment comes off as complaining that the in-flight wifi is too
slow. He found an interesting problem and did a great job documenting his
process + approach, if that doesn't belong in HN I don't know what does.

