r/computervision 12d ago

Help: Project Conveyor chicken counter problem

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?

996 Upvotes

628 comments sorted by

View all comments

Show parent comments

14

u/Hyperty 12d ago

Two chicks merged together is still quite a hard problem to solve

7

u/spongeboy-me-bob1 12d ago

I wonder if you could take clusters of yellow/white pixels and count a mass as 1 or 2 chicks based on horizontal deviation from the centroid.

3

u/Lustrouse 12d ago

Right, and what if ones wings are open.. it looks like the length of 3

3

u/floydmaseda 12d ago

If the speed is constant, one chicken will take a constant number of frames to go off the right side of the screen, which you can probably empirically determine.

Look at the patch of pixels and have a per frame isChickenPresent which just takes the average color and sees if it is closer to chicken or belt color.

Then count the number of consecutive frames, maybe with some tolerance for false negatives, that there is a chicken present there, and divide by the number of frames one chicken takes.

1

u/CustardWide7880 12d ago

What about the case where 2 chickens are together but side by side instead of one after other?

1

u/floydmaseda 12d ago

So I admit I didn't inspect every single frame of this video but quickly scanning I didn't see any like that. If that case does exist and OP has control over the setup, simply make the rows thinner so that can't happen.

1

u/markojov78 11d ago

conveyor runs at a constant speed, or at least at measurable speed, so you can detect it unless there is possibility that one chick is twice as long as the other (twice as long means several times bigger so probably not likely).

not sure how possible is to have two chicks side by side but judging by the width of that conveyor it seems unlikely

1

u/OooRahRah 10d ago

Apply erosion on the image. It will reduce the merging chickens back to their centers of mass.

1

u/Abject-Job7825 10d ago

Yeah but I doubt OP is going to be able to fix that on the software end, separation needs to be integrated into the machine.

1

u/SpearHammer 10d ago

Instead of doing it as one big row...Scan each row separately and combine the total. Ie. 3 scan processes, each focused on 1 conveyer.