It is much the same: a way to detect "bad" items on the transport line, and a way to get them off the line.
Detection is: optical (example: detect color of a soda can - remove it if wrong color), optical with picture analysis (aka "machine visioon", detect wrong shape, missing content, etc), opto-mechanical (example: light-sensors that detect full / empty containers), weight (detects empty containers) and so on. Sound could also be used, but is rarely seen in the wild, mostly due to automated assembly lines producing lots of noise.
Removal is: mechanical (arm, bolt, lever) or force (compressed air...).