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.

60 comments

  1. But what will count the Pis? by Anonymous Coward · · Score: 0

    How many pis to count?

  2. Meh. by Anonymous Coward · · Score: 0

    Call me when they have Beecognition, so they can weed out the terrorbees...

  3. 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 Anonymous Coward · · Score: 0

      Or you could just use 1990s technology with a laser beam across the door...

    2. Re:Counting people? by Anonymous Coward · · Score: 0

      Counting people has been a problem that was extensively studied long before this AI hogwash. They just called it computer vision instead of machine AI. I've read papers about it 15 years ago. Now it's nice that these days an engineer can build such a system using DIY hardware, it's nothing newsworthy.

    3. Re: Counting people? by Anonymous Coward · · Score: 0

      Not a laser sweetheart.

    4. Re:Counting people? by Anonymous Coward · · Score: 0

      You are way behind the tech man, they have been able to do this for well over a decade.

      I took this image and just ran it through a multi task cnn
      https://imagesvc.timeincapp.com/v3/fan/image?url=https://gigemgazette.com/wp-content/uploads/getty-images/2017/11/870151086-auburn-v-texas-a.jpg.jpg

      Annotated it
      https://cdn.deeplearn.lol//home/ben/tmp-deeplearn/0-1a5723b0cf938bc31e8d3ab94ab518a3.jpg

      And then stitched them all together in case you needed some weird wallpaper for your bathroom

      https://cdn.deeplearn.lol/faces-669db1af-2b35-4f7b-9f17-0954501bdf9d

      (Oh and the answer was 1437)

    5. Re:Counting people? by Anonymous Coward · · Score: 0

      One of the "faces" is actually a hand. Still impressive though.

    6. 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.

    7. Re:Counting people? by Anonymous Coward · · Score: 0

      Oddly the hand gets a face match rating of 0.87, I tracked it down in his annotation photo. It's centre-shot approximately one-third of the way down the photo. Additionally, I can count at least 10 faces which the algorithm didnt match in the local area near the hand. But it's clear why the software wouldnt have matched some of these, i.e. the faces were partially or fully obscured, and i know that a face will be attached to a body.

      So not that reliable it seems.

    8. Re:Counting people? by Anonymous Coward · · Score: 0

      More worrying is that the person who posted the information about facial recognition is associated with deeplearn.lol, who appear to be a Scam organisation. With threat alerts and scam information showing up on Norton, Bitcointalk and Moz.com.

    9. 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.
    10. 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.
    11. 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.
    12. 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
    13. Re:Counting people? by Anonymous Coward · · Score: 0

      I posted it, and own the domain, and it's pointed at AWS cloudfront which goes to a S3 bucket I dump files in. Nothing other than pictures/video go into there, so going to go ahead and say it's a false positive. Probably some discrimination for using a .lol gtld.

    14. Re:Counting people? by Anonymous Coward · · Score: 0

      Just ignore the "AI" moniker. We all do in the industry. Machine learning on top of CV systems. Deep neural networks are just a tool, convolutional layers are just a way to reduce manual feature engineering. "AI" has come to mean connectionist approaches with multiple layers or representation learning and transformation.

      Always be aware of who is using the expression "AI" as its meaning is greatly dependent on context.

  4. Can it count... by Anonymous Coward · · Score: 0

    Can it count Eric the half-a-bee as 0.5 ?

  5. everything made by man fails.. by Anonymous Coward · · Score: 0

    there is no valid dispute or fault.. never a better time to consider ourselves in relation to our surroundings, each other, & our well disguised/distracted creative spirits?

  6. 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...
  7. 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...
    1. Re:Raspberry pi? by Darinbob · · Score: 0

      I think all these stories are just marketing. Raspberry Pi is a commercial product. It has many competitors with essentially identical capabilities, some with lower prices. Is Slashdot providing free advertising here, or did they at least get a hefty check under the table?

      Why not just say "Linux based single board computer", or "single board computer", or even "device"?

      This seems similar to Arduino where it suddenly became a fad. I suspect this is due to lots of programmers who just suddenly discovered that you could put software on something other than a PC. They were amazed that 8-bit computers exist. and then surprised that 32-bit computer exist that can fit in your hand, and then suprised that 64-bit computer exist that fit in your hand, but still have not clued into the fact that these are not unique products.

      When are some new "maker" stories going to show up where the base board computer was carefully evaluated amongst several alternatives and the result was not Arduino or Raspberry pi? Or do those people get ignored because they don't get past the Slashdot fad filters?

  8. In Soviet Russia by Anonymous Coward · · Score: 0

    Is it possible to calculate pi using bees?

    1. Re:In Soviet Russia by Joce640k · · Score: 1

      They dance in circles, so, "yes".

      --
      No sig today...
    2. 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...
    3. Re: In Soviet Russia by Anonymous Coward · · Score: 0

      Dance for yo bees dance dance for yo bees.

  9. when talking with bee keepers.. by Anonymous Coward · · Score: 0

    they report 'most' of the bees have gone missing.. rip.. & most of the counting is about trying to figure out how much very little honey is worth? nothing really new in centuries,, now we're going backwards fast... ask any bee.. person

  10. Compete Turing by schure · · Score: 1

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

  11. 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 Anonymous Coward · · Score: 0

      No, it was just a glitch in the Martix. Move along.

    6. 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.
    7. 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)
    8. 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.
    9. 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.

  12. bee rush hour at 4pm explained by Anonymous Coward · · Score: 0

    The peak in the graph at 4 pm comes from the young bees who go out all at the same time for their orientation flight. They need to get a reading on the location of the hive before they go out fouraging. Since its more fun and safer to do the trip together they all go out simultaneously and thus create the rush hour peak in the graph. Nice work!

  13. -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.
  14. 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.

    1. Re:Fundamental Lack of Understanding by Anonymous Coward · · Score: 0

      PS: For clarity my subject refers to the reporter/poster. The guy who built the device knows exactly what he's doing. I really liked his labelling correction using partially trained NN, very clever.

    2. Re:Fundamental Lack of Understanding by Anonymous Coward · · Score: 0

      BeauHD is a fucking moron, so no surprises there.

  15. 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
    4. Re:Better by Anonymous Coward · · Score: 0

      They are not really being changed that often. For my hives I have a large (width of hive but only an inch tall or so) entrance (with a reducer in most of the year) at the bottom. I use corks and 1 inch hole in each brood box and during the summer I pull one cork to provide upper entrances. I usually run 3 deeps for brood. I used to provide upper entrances when doing supers but since I switched to flow hives I don't stack supers since I can drain honey as needed. Since I only have the flow hive on top I don't bother with other upper entrances.

      So if you are keeping track, at the busiest I have one 9x1 entrance and one 1"round entrance. I wouldn't say that is "always being changed"

  16. Eaxactly? I doubt that. by Anonymous Coward · · Score: 0

    Do they have UUIDs? Or does he completely empty the hive and count the one that fly in? Even IF they had UUIDs, does it take more than 10 seconds for a bee to take off? Do all bees in a hive leave the hive at some time?

    I guess we can say that what he is getting is an estimate NOT the exact number of bees in his hives.

    1. 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...
    2. Re:Eaxactly? I doubt that. by Anonymous Coward · · Score: 0

      UUID is unique, DNA is not (think of bacteria for example).

  17. 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.

  18. Githuuubbb!!! by Anonymous Coward · · Score: 0

    NOOOO Githuuuuubbbb!!!!

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

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

      --
      Have gnu, will travel.
  19. Machine learning? by Anonymous Coward · · Score: 0

    pictures of the hive door ... the things that are likely to be bees

    I am not an expert in bee keeping or so, but my limited experience with bee hive doors tells me that most things in their vicinity are actually bees.

    1. Re:Machine learning? by Anonymous Coward · · Score: 0

      and if you have anything besides bees near the entrance, you will certainly have a lot of extra bees there to help

  20. Total... by Anonymous Coward · · Score: 0

    .. violations of those bees privacy rights + it's just creepy ! :P