Product failure detection for production lines using a data-driven model