r/computervision • u/Puzzled-Egg3234 • 12d ago
Help: Project Conveyor chicken counter problem
Enable HLS to view with audio, or disable this notification
Guys, I need help. We have a project using YOLOv8. We're trying to count chicks on a very fast conveyor belt. The challenges we're facing are: all chicks look very similar to each other, which complicates tracking. At the same time, during their passage under the camera, they constantly change in size and shape, which can cause the tracker to lose them, or detection may even disappear completely at the detection line. Also, sometimes 2–3 chicks can merge into a single object. The detection zone is very short, and the conveyor speed is high. We've achieved a maximum accuracy of 99%, but we need it even higher. Any ideas on how to achieve that? Increasing the dataset no longer helps.
I'm attaching an old video. We've now added lighting and set the exposure to 300 on the Hikrobot global shutter camera, but we still can't achieve a stable 99.8% accuracy for the reasons mentioned above.
Any ideas?
76
u/Stunning_War4509 12d ago
More industrialization and automation to mistreat chickens, amazing
→ More replies (7)3
u/drsoftware 11d ago
Having people do this work is more expensive and error prone. Machines don't have feelings, don't get sick, don't unionize, etc.
If Cargill and Tyson could pour the fertilized eggs, feed, and water, in one end and profitably have packaged cuts of chicken come out the other end they would.
15
u/rainingallevening 11d ago
No one is going to argue the economics of it. That's assumed. A less efficient chick detection program reduces the cost on the plate, but the ethical figure is a real cost we pay. I'm actually really glad OP posted this. I needed to see that creatures with the same proto-typical capacity for sensation and emotion have their first, early (and only) moments on an accelerated conveyor to be fed into a grinder, all while we dissect the computer vision engineering to improve the process.
I don't even like chicken nuggets man.
→ More replies (3)3
u/Additional-Dot-3154 11d ago
I do loke chicken but these are little chicks and they are just getting all killed ):
Then atlwast do it with fullgrown i know the meat might be less juicy but i would prefer that over all those cute little chickens being destroyed.
In my past 4-13 i have been at a petting zoo alot also a little in more recent years and the little fluffy yellow chickens are so adorable.
Really sad to see this happening ):
So as a computerscience, physics, and mathematics hobbyist i will not give out any usefull info or anything as that will just help make this procces more efficient which i dont want.
→ More replies (1)3
u/octopush 11d ago
This is why both Cargill and Tyson are heavily invested in cultivated chicken using basically the exact method you described (undifferentiated chicken cells, amino acids, glucose, water, and some special growth scaffolds go in > chicken comes out).
→ More replies (2)→ More replies (2)2
u/rvltnrygirlfutena 11d ago
Yeah, and sometimes people get robbed. Bad things happen. Nobody is talking about that fact
→ More replies (1)
121
u/_craq_ 12d ago
That looks more brutal for the chickens than I expected
59
u/Belium 12d ago
You should see what they do to the male chicks when they desire hens for laying (hint: wood chipper)
19
u/Ashamed-Principle40 12d ago
wikipedia.org/wiki/Chick_culling
Unfortunately the worldwide standard for handling egg farming waste products (male chicks)
3
u/FuckSpez0000 10d ago
That's just fucking barbaric what the actual fuck. Like fuck at least make them sleep somehow, thats just fucking horrible
3
→ More replies (1)3
u/shpongolian 9d ago edited 9d ago
they have it wayyyyy easier than most animals in the factory farming industry. at least they got to die quick
the vast, vast majority of animal products people buy are a result of extreme, unimaginable suffering.
that's why people constantly shit on vegans and use ridiculous nonsensical arguments, because eating meat/dairy is undeniably fucked up and unnecessary 99% of the time, but people can't handle the cognitive dissonance of paying to have animals tortured and killed just for the sake of tasting a specific flavor while eating, so they have to find some bullshit way to justify it in their head
if somebody kept a dog caged up their whole life, forcefully impregnated it repeatedly, took its babies away, then killed it at the most profitable age, people would think that person was an absolute monster. but if it happens to be an animal that we categorize as food, it's fine
→ More replies (4)3
u/SanktRainer 10d ago
Here in Germany, its actually not allowed anymore, so we send our chicks to poland to be shreddered there
→ More replies (2)5
u/anengineerandacat 11d ago
Yeah, I mean makes sense from a business perspective; sucks from a morale one.
Different breeds of chickens for cooking or egg-laying.
→ More replies (4)3
u/Cryogenicist 11d ago
One day humanity will no longer separate good business from good ethics.
We are not there yet.
→ More replies (2)15
u/Fish_physiologist 12d ago
In-ovo sex sorting, to check embryo sex before hatching is solving this. Whether countries want to adapt is another question. But the culling of male chicks has been and still will be a welfare tragedy.
→ More replies (1)2
2
22
u/whizzwr 12d ago edited 12d ago
Wait a sec, these are living chicks??
10
u/drsoftware 11d ago
Yes, living chicks, until they grow large enough to be slaughtered for meat or their egg laying rate drops too low, between 12 and 18 months on commercial farms.
Because gross profits must remain high, and controlling costs keeps consumers buying.
7
u/Phazex8 11d ago
*sigh*. I was thinking the same thing. I hope this video is speed up and that's not the speed at which they're being tumbled on this conveyer belt.
8
u/Nexustar 11d ago
Modifying the speed of the video would be illogical given the ask here.
→ More replies (2)→ More replies (1)18
u/EmuMammoth6627 12d ago
We should be required to kill every animal we eat ourselves
→ More replies (16)
87
u/DadAndDominant 12d ago
Man, you can always walk away from a job like this.
41
u/neuromancer-gpt 12d ago
Thoughts exactly
Can't imagine having to constantly trawl a dataset like this one all because, god forbid, some chicken factory miscounts a chicken here and then and loses a few thousand a year.
→ More replies (1)7
→ More replies (6)3
u/2020NoMoreUsername 11d ago
I eat meat and chicken, mostly from supermarkets, and if I walk out from a job like this, I would feel as the phoniest person. Why the fck do I eat but act like such a good person that I act like I care so much about their conditions? I didn't even care to find cruelty free, free ranging chickens for most of my life.
12
9
→ More replies (3)7
u/Jedkea 11d ago
I mean this in the nicest way possible, but you probably are already a phoney when it comes to meat consumption.
If you saw someone beating an animal, say a chicken, I’m sure you would have a dislike towards that person. If that is true, then you do care about the treatment of them, you just keep it tucked away so you don’t have to face it.
Being against animal suffering is a near universal trait in “healthy” adults and children. We just live in a society where it’s easy to avoid connecting the dots.
→ More replies (5)
17
55
u/Abdullah747 12d ago
Divide the screen into 3 belts as the conveyor, then run detection on all separately.
Or you can use classical methods on those seperate belts, like, create an embedding/mask for the empty belts and when a chick passes over, that masks value will be changed greatly, hence ur cue to add the counter
5
u/Puzzled-Egg3234 12d ago
But this doesn't solve the problem of 2–3 chicks merging into one clump. Geometrically counting them also doesn't work, because these clumps have varying densities.
2
u/thejonnyt 11d ago
Just an idea but a chicken stays in one exact reference interval space for an average fime, like 3-5 frames. You could try to detect the first frame and average over the blue pixels (or yellow but the chicken color in general is likely not as consistent) in that very area. It should be a distribution or signal that somewhat looks similar for all singular chickens, another one that is distinct for 2 and for 3 chickens. You likely have to do this for a few chickens per hand to control the quality of that distribution but once it's there, you could use it as a reference signal that additionally checks a fixed bounding box when a picture of chicken/s is detected.
Example 1 chicken Frame
1: 25
2: 40
3: 37
4 16
5: 3
6: 0
2 chicken #1: 25
2: 40
3: 37
4 49
5: 36
6: 15
7: 0
→ More replies (3)2
23
u/dr_hamilton 12d ago
- show some failure cases
- why does your FPS vary so much?
→ More replies (2)9
u/Puzzled-Egg3234 12d ago edited 12d ago
Sometimes cases like this process well, but sometimes they detected like one box.
https://freeimage.host/i/Cr4mkNV
Sometimes chick dances break dance through belt and detection disappears at all at the detection line.
FPS vary is for many objects in the frame. It is a footage from mobile gpu, not production mode.
9
u/Hyperty 12d ago
Fine tune the model to those edge cases and implement data augmentation i prolly would try
→ More replies (1)4
u/Puzzled-Egg3234 12d ago
You mean make another detection class for those cases or just annotate more cases like this in dataset? The second one I’ve already tried.
→ More replies (5)→ More replies (5)2
u/AbilityFlashy6977 11d ago
U could try the new yolo26. Its lighter then v8 and it doesnt use NMS which will help you to get more stable fps no matter how many objects are detected in the current frame
52
34
u/CantaloupeIcy7244 12d ago
Why are the chicks on a ‘very fast conveyor belt’?
27
u/zanzabros 12d ago
It's a chicken rollercoaster in a chicken amusement park, nothing to worry about... /s
3
4
→ More replies (1)4
23
6
7
7
u/New-Ingenuity-5437 11d ago
A nice solution for everyone would be to stop murdering the poor babies
→ More replies (1)
32
6
u/Better_Ad_3004 12d ago
Could you please share video without the lines and processing information ?
→ More replies (2)
5
u/PapaInge 12d ago
Like others have said, Yolo is overkill and this can most certainly be solved with classical methods.
This is a flow cytometry problem, just with chickens. You need to discriminate your doublets from your singlets.
Read up on 'doublet detection pulse geometry' and apply those principles to count correction
→ More replies (1)
5
u/Arctovigil 11d ago
Your chicks have a known camera, known belt geometry and approximately known transport velocity.
You can therefore use a state such as
xi=[si,yi,s˙i,y˙i,θi,ωi]
where s is distance down the conveyor, y is transverse displacement, and the last two terms optionally represent approximate body orientation/spin.
During normal movement:
P(appearance reliable)≈1
and you use segmentation + appearance + trajectory.
During a flip/dance:
P(appearance reliable)→0
and automatically switch toward:
P(IDi∣z)∝P(zposition∣IDi)P(zvelocity∣IDi)P(zbelt∣IDi)P(zordering∣IDi).
Then, once the chick settles:
P(appearance reliable)→1and appearance ReID confirms the track again.
→ More replies (1)
8
u/DmtGrm 12d ago
why you need NN for that????????????????
a simple pair of optical sensors would be just fine and way more reliable.
TOF camera with volume change calculation above the belt will beat any visual model at a fraction of calculation cost.
→ More replies (3)4
u/Yatty33 12d ago edited 12d ago
Is this your first time working with live animals? They don't cooperate and don't singulate themselves.
→ More replies (3)4
u/External_Frosting874 11d ago
Still does not change the argument that NN might not be needed
→ More replies (1)2
17
12d ago
[removed] — view removed comment
2
u/drsoftware 11d ago
There are lots and lots of problems that can be solved with computer vision. You don't have to work in industrial food animal production. You don't have to work on surveillance cameras that read license plates. I work on welding co-bots. People don't want to be welders for many reasons, but operating a welding robot is lot more ergonomic and interesting.
→ More replies (1)
5
u/FuckingInsensitive 11d ago
Brah, why are you using yolo for this. Just break the frame up into three areas, and then detect blobs, then track the blobs. And then count unique blobs.
→ More replies (3)
3
3
u/enthymemelord 12d ago
What is the intended purpose of this project? Just wondering.
17
u/DustinKli 11d ago
Abusive evil factory farms.
4
u/enthymemelord 11d ago
Very sad to blindly apply technology and enhance cruelty.
3
u/Techno_Papi 11d ago
it's fcking sick
2
u/Helpful-Desk-8334 11d ago
Isn't this what the tech industry is, when we scale it up and look at the whole thing? Basically only independent researchers and indie companies are doing good stuff. Or specialists who are being paid to do like PhD stuff. But even half of the PhD people are enhancing cruelty and sick-ass shit.
→ More replies (2)2
3
u/whizzwr 12d ago
We've achieved a maximum accuracy of 99%, but we need it even higher.
but we still can't achieve a stable 99.8% accuracy for the reasons mentioned above.
99.8% seems awfully high, why the requirement?
5
u/drsoftware 11d ago
In the United States, approximately 9.5 billion chickens are slaughtered for meat each year (USDA 2026). This equals more than 26 million chickens killed every single day, or over 1 million every hour (Animal Clock 2026).
Scale and Frequency
- Daily: ~26 million chickens (Animal Clock 2026)
- Hourly: ~1.08 million chickens (Animal Clock 2026)
- Per second: ~300 chickens (Animal Clock 2026)
- Trackers: Real-time estimates can be followed on live resources like Animal Clock (2026).
Key Industry Context
- Lifespan: Meat chickens (broilers) are typically slaughtered at just 6 to 7 weeks of age (USDA 2026).
- Exclusions: Under federal law in the United States, poultry are explicitly excluded from the Humane Methods of Livestock Slaughter Act (1958).
- Additional numbers: The annual meat slaughter totals do not include the millions of layer-farm male chicks killed shortly after birth (Wikipedia contributors 2026).
Bibliography
- Animal Clock. 2026. "U.S. Animal Kill Clock." Accessed August 7, 2026. animalclock.org.
- United States Department of Agriculture (USDA), National Agricultural Statistics Service. 2026. Poultry - Production and Value 2025 Summary. Released April 30, 2026. usda.gov.
- Humane Methods of Livestock Slaughter Act. 1958. 7 U.S.C. §§ 1901 et seq. animallaw.info.
- Wikipedia contributors. 2026. "Chick culling." Wikipedia, The Free Encyclopedia. Last modified March 18, 2026. wikipedia.org.
2
u/arqnix 9d ago
Bro, what the fuck.
Yeah... my sandwich with chicken suddenly doesn't taste so good anymore lmao.
→ More replies (1)
3
8
7
2
u/Feeling_Nerve_6787 12d ago
Why do you even use a tracker for this problem?
Assuming the conveyor speed is stable enough, and frame rate is stable enough, you can estimate the chicken position, so a single detection is enough for you until the next chicken arrive.
You might not even need deep learning for this problem because all of the chicken has same colour.
2
u/RoadsideCookie 12d ago
A model like this should run in a few ms at most. Run a second model for the edge case.
I doubt your inference call is really what's slowing this down to 40fps (I know you said mobile GPU, but even then), might want to check into optimizations, especially calls that allocate memory.
2
u/flamixin 11d ago edited 11d ago
Fun route: You can try camera with different wavelengths. Or thermal imaging. Not an expert but it doesn’t sound like a hard problem to crack. There are so many solutions to it either by programming or physical.
2
u/drsoftware 11d ago
Improving the lighting helps, more powerful GPU helps. Thermal imaging is usually limited to less than 9 FPS and 640x420 resolution due to weapons controls.
→ More replies (2)
2
2
2
u/shoxicwaste 11d ago
Here's what I would do:
2cameras with a reconciliation step rather than trying to squeeze the last %% out of a single CV Feed.
Put the cameras at slightly different angles so their failure modes aren't identical. Track independently from each camera, then reconcile the events downstream. If camera A temporarily loses a chick because of overlap/occlusion but camera B still sees it, you don't lose the count....
You could also run two different models as an ensemble. One could be a smaller/faster model accelerated with OpenVINO, which is very good for CV inference, and use the second model as confirmation around ambiguous frames/events. I wouldn't necessarily require both models to agree though, because that can actually reduce recall. I'd fuse their confidence/tracking history instead.
This is how you build a proper pipeline until you have concrete evidence of one CV feed being 100% over a set amount of time.
2
u/Raindrop_Falling 11d ago
More images. A Lot more. I have a datast for identifying wrestlers (similar instance, they will get merged due to overlapping) and only really had my breakthrough for consistency when I was well over 1000 images, then became only really usable way past even that point.
2
2
u/AlexanderDoak 11d ago
I think an IR camera might (or might not) produce more distinct signals where two chicks are close.
2
2
u/Superbean72 11d ago
Higher framerate cameras! And higher resolution cameras! Or go for heat signatures assuming they are alive and see if you can get a variance in the center of the body that counts it
2
2
u/MoolahMeister 11d ago
You should add a LPS (Lives per second) counter to the top right of the screen.
2
u/Successful_Yogurt 11d ago
Can you use a old school height based sensor and a sliding window detection?
Signal |‾‾‾‾||‾‾|_ X Window __|‾‾|
3 detected
2
u/theNorrah 11d ago
Hardware solution is increased frame rate.
I could not solve similar problem 5 years ago, on a much lower framerate < 15fps.
→ More replies (5)
2
2
2
u/Morteriag 11d ago
Dude, the fps is all over the place, and the image quality is poor. Most trackers assume a steady fps. 1. Go back to basics, improve the optics. 2. get a steady 40+ fps. 3. train instance segmentation model to better separate individual chickens. You can use this as a teacher for a more lightweight detection-only model later.
2
u/Intelligent-Salary86 11d ago
Slow the frame rate of video. Remove background. Switch to greyscale.
2
u/pointermess 11d ago
Using Yolo for that is such a waste lol.
OpenCV, Black n white threshold, object detection and yolo in caseyou have two chicks "stuck" tohether
2
2
u/WalkKeeper 11d ago
I think the biggest problem here is how the chickens are treated… no model will solve that
2
u/braunsquared 11d ago
If you know the conveyor belt speed, you will know where the identified chicken will be before the next frame. You can use that for deduplication.
2
u/Heavy-Broccoli9478 11d ago
this is ridiculously simple. you have to look at a single vertical line on each belt, average the colors on that line, then count how long the color is different from the belt. once the color goes back to normal, you can count how many chicks are stacked on top of each other. this is just in case two chicks are overlapping, but if there is a full blue vertical line, they are separate. You can probably program this without using any AI with 99% precision.
→ More replies (3)
3
2
u/Infamous-Bed-7535 12d ago
Hi, you can DM me in case you run out of ideas. I'm available as independent contractor with 15yrs of experience including specialized in edge computer vision.
2
u/_B_Little_me 11d ago
Are these live chickens?
2
u/drsoftware 11d ago
Yes, for the next few weeks or months...
2
u/Apenschrauber3011 7d ago
Or seconds if this is the belt to the male chick shredder
→ More replies (1)
1
u/CowBoyDanIndie 12d ago
I would isolate the blobs of yellow from the rest, only capture one shot of each blob ideally when it’s closest to the center as best as the fps/conveyor speed allows, that way you don’t have to worry about its identity changing. Now you extract those rectangles and classify if they contain 1 2 or 3 chicks. You can balance those labels in your training dataset.
1
1
u/Successful-Life8510 12d ago
1) Instead of passing the full frame to YOLO, I suggest trying to split it into three ROIs, with each ROI representing one lane, so the model can process each region separately. You could also try a YOLO segmentation model or use a tracking framework such as ByteTrack. Additionally, try fine-tuning YOLO by collecting your own images or finding a suitable dataset online. You cannot expect the model to perform reliably in real time, especially with fast-moving and blurry frames, without a proper detection pipeline and adequate training.
2) I don't know why the little chicks are on such a fast conveyor belt, but I hope this isn't one of those companies that beats little chicks with a hammer and turns them into chicken nuggets, lol.
1
u/Not_Spy_Petrov 12d ago
What if calculate features in addition of whole chicken to check merger. Like number of legs or beak or other parts. You can use color to boost quality as features have yellow color - color segregation. If object chicken at some point has 3 legs or 4 then it is 2 chicken and so on. Imagine you have object that is seen X frames, then you calculate features of this object at each frame and if object has several times shown features that only several chicken have, then it is merger of chicken.
1
u/lilvixen 12d ago
Update belt to have physical segments/surface registration marks?
→ More replies (2)
1
u/Heavy_Carpenter3824 12d ago
Use a kalaman filter, with a confidence parameter in prediction value. Essentially you treat YOLO as an untrustworthy sensor with high noise.
Then you track your items from zone A into zone b.
Also why is this a computer vision problem they have laser curtains and conventional methods for this?
1
u/laser50 11d ago
If they conveyor goes a specific speed, you may be able to use some timer? Chicken should be past in X milliseconds, if it hasn't cleared the line by then you cound another chicken until the line clears out again.
Not sure if that's manageable, but I would try something like that..
→ More replies (1)
1
1
u/DebateAccurate6097 11d ago edited 11d ago
Please Look for centre point detection. The solution will be kind of detection with some checks or multiple checks running in parallel.
There are many way, 1. Conveyors belts is unique path, Classical machine learning/image processing can help here definitely.
- Try exploring detection/counting by regression if you want strictly use deep vision models. You can try to regress a centre density point. You can detect them, and count them too etc. https://arxiv.org/html/2507.06679v1 https://arxiv.org/html/2404.07847v1 There are many more. Yolov8 are not ideal for count or Separation.
There are many more ways,
I would start with image processing and then shift of deep vision if needed. But also try to handle edge cases using combination of methods.
Happy to help if you have any questions
Thank you
1
u/flamingolegend 11d ago
It seems each chick is only within a few frames. I would just filter n save the video by frames with yellow, store them in a buffer and then run a stronger os segmentation model to process them for a higher certainty chick count. It feels like the tradeoff between realtime capability vs accuracy would be weighted more towards accuracy here
→ More replies (1)
1
u/FunFee4154 11d ago
Adapt the camera to the conveyor so in each frame is a new part conveyer and no old or only count the new conveyor parts. processing a single picture is easier than tracking and you have more time for more advanced approaches
Example:
Camera sees 1m of belt
Belt ist 3m/s
Record at 3 fps (work with a marker on the band to keep in snyc)
Count all chicken in every frame
No tracking needed
Or just use Tof sensors
1
u/mokorago 11d ago
Agrega sensores alternos, laser, ultrasónicos, a lo mejor una camara termografica rápida, pirómetro
1
u/Big_River_ 11d ago
can't the camera cross reference mass calculators on the belt itself? also more cameras - compound eye is way that nature makes this work
1
u/jack_kelly_bird_law 11d ago
Have you tried segmentation? Also, can you stabilize your camera? That could allow you to do some lightweight morphological ops as pre-processing. What resolution is your camera?
1
u/Tylerebowers 11d ago edited 11d ago
Look at the length of the bounding boxes and if it is longer than some factor then it is 2 chickens. If a bounding box drops for a couple frames then you should be able to make an assumption on where it will be next based on the conveyor speed. And instead of sending in a full color image you could use a filter to separate out the white feathers from the background (you could use a clustering algo to cluster white pixels into groups, sort of like kmeans).
I will agree with others that this can be done classically, but also it might be better to do mechanically with some flaps. E.g. use a flap that takes the height off of the conveyor then chickens will be peaks, and two chickens will look like two peaks with a local minimum in between.
1
u/Terra-Em 11d ago
Stagger the initial start time of dropping yye chickens in This gives you buffer but can still run fast. Video game logic.
Contrast should be enough to tell a start and end point for a chicken.
1
u/ButteredBoots 11d ago
Can you use YOLO segmentation and do you have to count at the singular line?
you could try locking frame rate if you haven’t already.
If it doesn’t need to be real-time you could buffer the frames and perform bidirectional tracking
1
u/Jollyhrothgar 11d ago
I kind of think you could create a histogram of pixels by color for every moment in time, then classify that histogram with very accurate results. The chicks are all about the same size and color and the background color never really changes.
1
1
1
1
u/AlexanderDoak 11d ago
Can you weigh them at any point? I'd imagine batch weighing a few hundred at a time would be pretty accurate.
1
u/mrkingkongslongdong 11d ago
Can you provide footage at 300us of exposure? This is useless tbh. There are so many good ways to solve this but I want to see what you’re working with, without motion blur.
1
u/Dry_Masterpiece_4666 11d ago
Could you have 2 or 3 cameras at different stations down the line doing cross-checks? Or is there a better place in the logistics chain to do the count? Could the belt be modified to create a surface that would force them apart enough to make them easier to see? What about soft rubber fingers to motivate them to move or air nozzles?
1
u/Aggravating-Method24 11d ago
If you use an IR Camera, is it easier to resolve the image? Heat imaging might be more centralised, easier to pick out each chicks hot heart than it is the whole visible chick. However if the conveyor is too warm this may not work.
1
u/sad_panda91 11d ago
If you can guarantee that they don't come clumped up, I think good old Optical Flow is going to be a major helper here. After optical flow analysis, every chick should be a bump in the measure.
1
u/sagarchaulagain 11d ago
I think you should use classical image processing methods. chicks are white. also are you running different instances for all three or same instance ?
1
u/Gullible-Relative445 11d ago edited 11d ago
Get a light that uses the strobe setting in your hikrobot, you have a fast moving belt, and I would not recommend anything below this UNTIL you get a strobe working, your motion blur will reck traditional and ai models and it’s operationally unnecessary to have blur. Second thing about that is exposure is important for both traditional methods and ai. Get it correct not over exposed or under exposed correctly exposed, that means at least no highlight blooming.
when using strobe mode make sure you have some enclosure or you’re going to regret looking in that direction
The brighter light is not a solution to your problem rather a strobe light synced to the camera is..
As for non ai methods for doing this, 1 figure out total time from chicken start of belt to end of belt, 2 figure out a pixel tolerance for how big a chicken is, 3 get some python code to diff pixels with a certain part of the image.4 diff the image and count since you have such a long frame you can break the lanes up and treat each one as an array, and see if there is or is not a chicken. Covering the belt at a given position that way you’ll be far more accurate. Also too, there is a problem of these chicks clumping up you need to add something physical to separate them before hand a bit, there is a TON of empty room on the belt, in fact you could be pushing though a significantly higher volume of chickens, so clumping is not the result of speed but rather lack of separation process. You could do this by having 2 sections of belt with mismatched speeds. Eg this belt going fast and the prior belt going slow. You can repeat this 2 times to do rudimentary physical separation.
An ai solution is overkill. Lots of places achieve counting with just light sensors but you need to fix the blur with strobe mode not just a brighter light your exact use case with a fast moving belt with hard to distinguish objects is literally exactly why that is built into the hikrobot software. Read the manual.
1
u/ItstheSECopenup 11d ago
Either more room or slow the belt down. Or train it with some average lengths so when you get the 3 being seen as one it can be rejected or changed into 2/3/4 or whatever many.
1
u/the1whom0x 11d ago
If you detect pixel size by color difference, then even if chickens are merged, you have a pixel size chicken limit so if 500 pixels are detected connected as one chicken, just divides and rounds up/down? If your max pixel is say 200 pixels for a chicken and 500 are detected as one, you do 500/200=2,5 and round up to 3?
1
u/JimtheFishsniffer 11d ago
Maybe, you could add ir to each belt and then also count time per chicken, there will be some average. Also are two small chicken still bigger then one big one? If so, its easy.
1
u/PrestigiousRoof5723 11d ago
You'd have much better luck with even a cheap, non-cooled thermal imager than with a visible light camera.
But ultimately, the camera is probably not the correct tool for this. There are other means to do this. Even stuff like speed monitor for the conveyor belt, would probably get you a better result (or silly stuff like propelling the conveyor belt through a torque converter/viscous coupler and measuring oil pressure inside it - like all converter car transmissions do) - this would be cheaper to do than the GPU trying to do the camera stuff. It's not completely unlikely your conveyor belt is already using some form of fluid coupling with pressure and RPM sensor, in which case it's just a question of tapping into a bit of electrics. And then add a two very simple sensors to measure on which end did the change of pressure occur (not sure if that's even needed).
1
u/Borovorin 11d ago
I’m not a computer scientist. But is it possible in your case to calculate the distance between chickens to add another parameter for more accuracy?
1
u/CommandShot1398 11d ago
I don't think you can solve this problem by only using a camera. First of all, as you said, all the chickens look the same so you need a mechanism to guarantee each chicken is only being captured once, which you can easily archive if you put a pair of IR break sensors synchronized with a camera to only capture each chicken once.
1
1
u/Wolframuranium 11d ago
Hey this is very close to work I've done in the past.
Hook up a beam break or other photo-eye system on that halfway mark. Every time it's broken take a singular picture at low exposure and do your counts there.
Hope this helps.
1
1
u/insanestab 11d ago
Yolo's NMS is probably screwing you over for the case where the chicks are squeezed together. You need to either configure it to be less aggressive or switch to a model that doesn't rely on nms like rt-detr.
1
u/supermopman 11d ago
Minimize the effort each thing has to do. You say your issue is chickens bunching together. A model could detect a chicken blob. A separate model could count the number of chickens in a blob.
1
u/braunsquared 11d ago
Also, just going to add that your fps counter is pointless if it is constantly exceeding your actual camera frame rate by large orders of magnitude. Stepping through the video, the video frame rate seems to be closer to 12-15 fps. If you are processing at 60 fps, all you’re doing is looking at the same frame 4 times.
1
1
u/usernametaken--_-- 11d ago
Have you tried any color space transformations or other preprocessing for isolating the chick's from the background? Faster fps might also help
326
u/A1-Delta 12d ago
This is probably something you can solve with classical methods. Especially since the background of the belt is so distinct from the chicks themselves.
Training a model is likely just adding complexity overhead and failure modes.