Slashdot Mirror


Programmer Creates Bee Counter Using a Raspberry Pi

Programmer Mat Kelsey created a bee counter to see exactly how many bees are hanging out in his hives. "His system, which uses a Raspberry Pi and a machine learning algorithm that recognizes the number of individual bees entering a hive, is used to see bee trends over time and see just how the bees are faring," reports TechCrunch. From the report: The system looks at sets of pictures of the hive door taken every 10 seconds. It then extrapolates out the background, assesses the objects that have moved in the frame, and then counts the things that are likely to be bees. It's a fascinating problem to solve since the bees are constantly moving and because it can also ignore bees that are coming out of the hive. You can download the source on Github and check out his detailed blog post here. Given the need for bee protection as we enter an era of colony collapses, tools like this one are wildly important. Plus it's cool to see a Raspberry Pi do something so complex.

30 of 60 comments (clear)

  1. Counting people? by houghi · · Score: 1

    Would this also be able to count people? Be it at a demonstration, in a store or otherwsie.
    That second one could make it possible for smaller or independent stores to use data analysis of how much customers spend where.

    The longer people stay in a store, the more money they spend, as long as you keep them interested. Also possible to verify the best way to get people into your store (doors that are already open is a huge one)

    --
    Don't fight for your country, if your country does not fight for you.
    1. Re:Counting people? by h33t+l4x0r · · Score: 1

      It then extrapolates out the background, assesses the objects that have moved in the frame, and then counts the things that are likely to be bees

      Would this also be able to count people?

      Yes but only the people that are likely to be bees. A small-ish subset I would imagine.

    2. Re:Counting people? by squiggleslash · · Score: 1

      It will probably count people as long as they're wearing T-shirts with black and yellow stripes. So whatever entity needs the counting done just needs to hand out those T-shirts.

      --
      You are not alone. This is not normal. None of this is normal.
    3. Re:Counting people? by houghi · · Score: 1

      I know it is possible. I was wondering if it was possible to do on a Rpi. Also this counts of a photo, not of multiple photos, like the example with the bees does.

      --
      Don't fight for your country, if your country does not fight for you.
    4. Re: Counting people? by houghi · · Score: 1

      You could use multiple methods, including having somebody at the door counting. Most stores will use a special doormat with a counter on it. However the you still only know the average time people are in the store.

      e.g if 2 people enter and one leaves after 1 minute and 1 after 9, the average is 5 minutes, yet the difference is big. Having a system that sees a guy in a red t shirt and one in a blue one will give already better results. Still not perfect as he could put on a coat, but still better.

      Once you have this data, you can start looking for reasons as to why people do that they do and try to influence that.

      I am well aware of the methods that are possible. The question remains if this is possible with a RPi for people. This pure from a technical point of view. I have seen the data analysis of traffic where it is possible to follow people, trucks, bikes, cars and busses. So the technology is available and open source.

      --
      Don't fight for your country, if your country does not fight for you.
    5. Re:Counting people? by paiute · · Score: 1

      Yes but only the people that are likely to be bees. A small-ish subset I would imagine.

      https://www.youtube.com/watch?...

      --
      If Slashdot were chemistry it would look like this:Cadaverine
  2. Typo by Nova77 · · Score: 1

    Itâ(TM)s Mat Kelcey, no âsâ(TM).

    1. Re:Typo by hcs_$reboot · · Score: 1

      no, unicode is not on the agenda.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
  3. Raspberry pi? by hcs_$reboot · · Score: 1

    Ok, a bee counting algorithm is worth mentioning, but would that be done with a R.pi or a laptop ... not sure.

    --
    Slashdot, fix the reply notifications... You won't get away with it...
  4. Re:In Soviet Russia by Joce640k · · Score: 1

    They dance in circles, so, "yes".

    --
    No sig today...
  5. Compete Turing by schure · · Score: 1

    Omg, it sounds like the RPi is an actual complete Turing computing machine! Unbelievable! /s

  6. Use weight by war4peace · · Score: 2

    Weigh the hive during the night when all bees are in, weigh it during the day when working bees are out, extrapolate based on weight of a bee and how many bees (as a percentage) are gatherers, which is a known quantity for a hive, on average.

    --
    ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
    1. Re:Use weight by OolimPhon · · Score: 3, Informative

      Um, no. You're forgetting all the pollen and nectar the bees are bringing back.

      The hive will weigh more each night than the night before. You also have to allow for the bees that are being eaten or otherwise die away from the hive during the day.

    2. Re:Use weight by ledow · · Score: 1

      Weight changes constantly with addition/consumption of honey.

      You'd have a hard time spotting the amount of bees from weight alone.

    3. Re:Use weight by war4peace · · Score: 2

      Clearly I know nothing about bees :)
      Thank you, I seem to have overlooked a lot of factors.

      --
      ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
    4. Re:Use weight by hcs_$reboot · · Score: 1

      Someone thanking someone else on slashdot ... times change!

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    5. Re: Use weight by houghi · · Score: 1

      So how do you get that percentage? The best way is to kill all the bees and then count them. The result will be fixed and the counting repeatable. And if you want to count live bees, that number is an average of 0 with this method.

      As a sidenote: remember that medical research causes cancer in rats. (Just to show how serious i am)

      --
      Don't fight for your country, if your country does not fight for you.
    6. Re: Use weight by war4peace · · Score: 1

      Someone else already pointed out flaws in my assumptions, it's okay :)

      --
      ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
    7. Re: Use weight by houghi · · Score: 1

      Mine is however rock solid. Kill all the bees! :-D

      --
      Don't fight for your country, if your country does not fight for you.
    8. Re:Use weight by Anonymous Coward · · Score: 1

      And don't forget that the majority of bees are not out of the hive. Everyone thinks of the foragers when they think of worker bees. But in actuality, foragers are only a percentage of the older worker bees. So the younger bees (cell cleaners, nurse bees, wax bees, queen attendants) are always in the hive. And of the older worker bees, really only foragers, water carriers and mortuary are outside of the hive (and not all at once). Guard bees, honey sealing, comb building, airflow, propolis, etc. are all inside....oh and drones only go out to mate...lazy bastards.

  7. -only if they start flying ;-) by Herve5 · · Score: 1

    In fact no, but the main expectation is probably that bees will look like dots in the image, while 'complete customers' will be more complex shapes?

    --
    Herve S.
  8. Fundamental Lack of Understanding by Anonymous Coward · · Score: 1

    Training neural networks requires considerable computing power.

    Implementing a trained neural network is utterly trivial, so it is not surprising at all that a RPi is capable of performing this task.

  9. Re:In Soviet Russia by hcs_$reboot · · Score: 1

    Take 3.1415926535897932384626433832795028 bees on a table and count them.

    --
    Slashdot, fix the reply notifications... You won't get away with it...
  10. Better by hcs_$reboot · · Score: 2

    Connect a tube to the entrance and count what happens within the tube - way more accurate imo

    --
    Slashdot, fix the reply notifications... You won't get away with it...
    1. Re:Better by Viol8 · · Score: 1

      Indeed. Or if thats not practical just a simple video decoder that can recognise blobs moving to the left or to the right. I don't see why machine learning is required for this other than its the IT phrase du jour that garners headlines.

    2. Re:Better by swillden · · Score: 2

      a simple video decoder that can recognise blobs moving to the left or to the right.

      Sure. But ML would be the easiest way (in terms of developer time) to construct that video decoder. Which is exactly what this guy did. He could probably have increased accuracy by adding a clear tube and pointing the camera at the tube (I think that's what hcs_$reboot was suggesting), but on the other hand what he's really interested in are trends, not absolute numbers, so it's likely that his solution is good enough. And he avoided having to modify the hive in a way that might disturb the bees.

      This is typical of many uses of ML these days, where it's used to do something that could be done with simpler tools but with more human brainpower and/or effort. But why bother? If the general-purpose tool does the job adequately and with less effort, use it.

      To use a construction analogy, sure there's no reason to screw drywall, nails are perfectly effective at holding it and hammers and nails are much simpler mechanically and cheaper than a battery-powered driver and screws. But it's faster and easier to drive screws than pound nails. For non-experts, at least; really experienced drywallers are crazy fast at driving nails -- tap, boom, next. I guess that part of the analogy holds up as well... if you are an engineer with a great deal of experience at writing custom video decoders you can probably write one faster than you can train a neural network to do the same job.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    3. Re:Better by paiute · · Score: 1

      Hive entrances are always being changed depending on several factors, so one tube is not optimal at all times.

      --
      If Slashdot were chemistry it would look like this:Cadaverine
  11. Re:Eaxactly? I doubt that. by hcs_$reboot · · Score: 1

    Do they have UUIDs?

    That's called DNA

    --
    Slashdot, fix the reply notifications... You won't get away with it...
  12. To what end? by drdread66 · · Score: 1

    I'm not sure what benefit this really offers, aside from being an interesting project. There was another bee project a while back that recorded hive temperature and aggregate weight -- that thing was able to measure the total weight of bees in the hive with sufficient accuracy that you could easily spot the times when the foragers were leaving the hive and returning later in the day.

    FWIW I am an amateur beekeeper and I don't think I would use the bee-counting Rpi gizmo. I would much rather wander out to my bee yard and just stare at each hive for a few seconds. The only thing the Rpi approach would get me is an alarm if the activity is below "normal" for the hive...that would enable me to be lazy and ignore my hives for extended periods. Not sure this is a good thing. But honestly, my once-a-week checkins ( 5 minutes to check in on 5 hives) are totally sufficient for normal conditions.

  13. Re:Githuuubbb!!! by PPH · · Score: 1

    Don't worry. Microsoft will be releasing Bee# pretty soon.

    --
    Have gnu, will travel.