AI at the edge is enabling the push toward defect-free factories