Little Lego Mindstorm conveyor belt
Shaker tray to separate individual pieces to send them down the belt
Camera + arduino
OpenAI API
Snap a picture for each one and upload it, along with a question “Is this a pretzel?”
Parse the answer and route the conveyor accordingly
Presto. Probably about $5 and one hour or so for each bag you want to sort. What’s not to like.