“The only way to find the counterfeit is to inspect each shipment by hand”
This is basically what the Amazon transparency program is. Is tracks each item from manufacturer all the way through to your door with unique code scanned along the way. You can use the app to see where it came from.
This tells me why companies do not leave decisions on just developers. If we were in a company, someone had developed a machine learning app by now for a problem which needs no ML in the first place.