Sounds like an ideal job for image recognition. Provided you have, or can arrange, good constant lighting at some point on the conveyor and provided there is a reasonably good contrast between biscuits and the conveyor belt.
All it would take is a Pi 4, a Pi camera and the opencv software.
As this is a "skunk works" project I would not worry about using a Raspberry Pi. Who would know? Be sure to provide a decent enclosure to protect it from life in a factory. Plenty of Pi are used in such situations, including inside the factory that makes the Pi!
You will need to a do a bit of programming to get this working. Nothing very complicated as it turns out and in the Python language which is dead easy to get started with.
This simple image recognition does not even need complex Artificial Intelligence it can be done with the basic features provided by OpenCV.
If you want to see how simple it can be check out this series by the excellent teacher Paul McWhorter : AI on the Jetson Nano https://www.youtube.com/playlist?list=P ... ERFFPkOuP4
Despite it's title in the first 27 parts of the series there is nothing we would call Artificial Inteligence presented yet. He has done a lot to show what you can do easily with opencv. You can ignore all the Jetson Nano specific parts and just take away what you need for OpenCV which will run the same on the Pi all be it slower. The Jetson Nano uses the Pi camera so the video capture stuff will work.
Of course, with that job done and under your belt you might find a ton of other applications for image analysis in your factory, Perhaps even graduating to the AI stuff that one can do on devices like the Jetson Nano.
I would not say a Pi 4 was over kill for this. Not when you consider you will want a display to check the biscuit detection is working properly, networking to get the alarm out and so on.
Sounds like a fun project to me.
Memory in C++ is a leaky abstraction .