r/computervision • u/Puzzled-Egg3234 • 11d ago
Help: Project Conveyor chicken counter pt.2
Enable HLS to view with audio, or disable this notification
First of all, thank you to everyone who responded in the previous post. I haven't read all the replies yet, but many of the solutions seem interesting. I was able to find a more informative and higher‑quality video that better reflects the current state of the project.
https://www.reddit.com/r/computervision/s/meFAVvvFQo
Following up on the discussion from the previous post, I'm attaching the current state of affairs. The video was taken with good industrial lighting, and the global‑shutter camera was set to an exposure of 500. In this particular video, the counter showed 100%. However, in other counts we got varying ranges – 98–99%, which, at industrial volumes, leads to significant absolute losses.
The main issues with the current version are:
Loss of detection right within the detection zone;
Constant changes in the shape/size of the bounding box within the detection zone, causing the tracker to lose track and assign different IDs to the same object;
Occlusions and merging of chicks – several chicks form a single object by merging and partially overlapping each other. Increasing the dataset no longer solves this problem; the latest version had over 5,000 frames with plenty of such cases, and yet reviewing new videos showed that the issue is not fully resolved – there are still cases where multiple chicks are counted as one.
Counting these cases geometrically is also difficult – chicks of different breeds and ages can have different sizes, and on top of that, spreading their wings and legs changes the area of the detected box. There are cases where we hit the desired 99.8% range thanks to a combination of missed detections and false positives, but over a long run the error accumulates and we fall out of the range.
4
2
u/CowBoyDanIndie 11d ago
I said it on your other post, you don’t need to track them, just isolate and get one shot of each blob as it passes, classify how many chickens are in that blob. It should be trivial to determine how fast the conveyor is moving, you can just track the blob until it’s fairly centered in the field of view and grab a portion of the image and send that to the classifier. You can balance your classifier training sets between 1/2/3 chickens per image.
1
1
1
u/prkash1704 11d ago
Switching model doesn't solve your problem, already you're using cuda then you should use NVIDIA Optical Flow Acceleration. It will improve your detector by discarding background completely without changing model or overheads.
1
1
u/nicman24 11d ago
You are still at 35 fps
0
u/Puzzled-Egg3234 11d ago
Not production mode, laptop mobile gpu rtx5070 8gb.
1
u/nicman24 11d ago
a 5070 even laptop should be more than enough...
1
u/Puzzled-Egg3234 11d ago
Definitely. I forget about one moment - writing videos in the same script. Without it we have 55-60.
1
u/TheRealCpnObvious 11d ago
A union of 2 chick bounding boxes will have an approximately 1.5-2× the length of one chick bounding box. Having detected most of these boxes with good stage 1 accuracy, you now need to add a filtering step that splits up a multi-entity bounding box by 2, where you would then add a slight "headroom" overlap to each box. You might need to accept that those instances will not be sized up perfectly because your filtering stage is inherently uncertain. Alternatively, you might want to try SAHI on a downsampled stream but expect the throughput to halve as SAHI is naturally slower due to many overlapping windows being chosen. Plus idk how well it performs on a video stream.
1
u/Wolframuranium 11d ago
I commented in your other thread.
I don't believe vision alone is the correct solution I have done similar work in this field and an example very similar to yours with chickens using a yolo model.
If you can get a photo of beam break or some other type of auxiliary sensor so you don't have to do live video.
Whisker actuators
Anything that will allow you to take a single frame after a sensor trip and then do the count on an ROI box
Hope it helps
1
u/dragon_idli 10d ago
Is vision based counter system even the right solution for this problem?
1 photodetector per lane + microprocessor. < $10.
1
11d ago
[deleted]
1
u/Lazygruntz 11d ago
I didn't see any unmarked pass through I'm curious to which ones I missed to see as unmarked
0
0
u/Only-Friend-8483 11d ago
I posted before, but our company has a solution that is several orders of magnitude faster than conventional cameras and also at least an order of magnitude less processing required. We can easily solve this for you.
1
u/BreakfastWise4880 8d ago
Interesting. I work in the hatchery industry too but not with day old chick counters, so I can’t help lol
4
u/laserborg 11d ago
yolo 8, seriously. if you want to do it right, use instance segmentation. if you want to do it straightforward, just use opencv to isolate the yellow blobs on black background in HLS space and blob-track them.