The present application relates to the technical field of printed matter detection, and relates to a printed matter online detection method and
system based on
machine vision, which comprises the following steps: acquiring a printed matter image
library, classifying features of the printed matter image
library to obtain a plurality of feature image libraries, training a pre-constructed discrimination model by using a training matrix set, a defect matrix set, a positive
verification matrix set and a negative
verification matrix set to obtain a defect discrimination model, constructing a
generative adversarial network based on the pre-constructed VAE
encoder and the defect discrimination model, discriminating a to-be-detected
feature matrix based on a
weight coefficient group and a plurality of completed adversarial networks to obtain a printing defect index, and confirming a plurality of printing defect images based on a plurality of printing defect indexes and a plurality of to-be-detected images to complete online detection of the printed matter. The present application can improve the accuracy and robustness of printed matter defect detection and improve the printed matter detection efficiency.