Printing quality real-time control method and system based on image recognition
By performing noise filtering and distortion correction on the image sequence of the printing process, and combining convolutional neural networks and long short-term memory networks for defect feature extraction and trend prediction, the problem of insufficient defect detection accuracy in existing technologies is solved, and high-precision dynamic defect detection and production optimization are achieved.
Patent Information
- Application Number
- CN202511801737.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-04-28
AI Technical Summary
Existing printing quality control technologies struggle to accurately distinguish between normal textures and minor defects in dynamic and complex production scenarios, resulting in insufficient defect detection accuracy.
By acquiring continuous image sequences for noise filtering and geometric distortion correction, using convolutional neural networks to extract defect features, and combining long short-term memory networks for spatiotemporal distribution analysis and trend prediction, control commands are generated to adjust operating parameters.
It achieves high-precision defect detection in complex and dynamic scenarios, has the ability to predict defect trends, ensures product quality stability, and improves production efficiency.
Smart Images

Figure CN121928860A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printing quality control technology, and in particular to a method and system for real-time printing quality control based on image recognition. Background Technology
[0002] Image detection technology is a core branch of modern artificial intelligence, encompassing multiple stages including image sensing, image enhancement, feature extraction, and analysis. This technology has wide applications in industrial manufacturing, autonomous driving, medical image analysis, and public safety monitoring. By automating the analysis of visual information, it enables intelligent perception and judgment of product quality, environmental conditions, or specific events. Especially in manufacturing, image-based quality control is crucial for ensuring product pass rates and improving production efficiency. High-quality printed materials, as an important component of commodities, directly impact brand image and market competitiveness through their appearance quality.
[0003] Currently, in one existing technology, print quality control mainly relies on automated inspection systems based on fixed rules. These systems acquire images of printed materials using high-speed cameras and employ preset thresholds or standard template matching algorithms to perform pixel-level comparisons to identify obvious defects such as ink spots and scratches. However, this static rule-based method has significant limitations in dynamic and complex production scenarios. It has poor dynamic adaptability to defect features and struggles to accurately distinguish normal texture fluctuations from genuine minute defects when faced with changes in printing materials or subtle image distortions caused by high-speed operation.
[0004] In summary, existing technologies suffer from insufficient accuracy in detecting dynamic defects. Summary of the Invention
[0005] This invention provides a real-time printing quality control method and system based on image recognition to solve the problem of insufficient accuracy in dynamic defect detection.
[0006] In a first aspect, to address the aforementioned technical problems, the present invention provides a real-time printing quality control method based on image recognition, comprising: A continuous image sequence is acquired, and image correction processing is performed to obtain a clear image sequence; Based on the clear image sequence, feature extraction and defect region identification statistics are performed to obtain defect quantification results; Based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to construct a dynamic distribution, thereby obtaining a spatiotemporal distribution sequence. Based on the spatiotemporal distribution sequence, time series modeling analysis and trend prediction are performed to obtain defect trend prediction data; If the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold, then a control command is generated to adjust the operating parameters. According to the control instructions, the operating parameters are adjusted, and the image sequence is re-acquired to verify the control effect, thereby obtaining the quality control output.
[0007] Preferably, the step of acquiring a continuous image sequence and performing image correction processing to obtain a clear image sequence includes: Acquire continuous image sequences from printing production line equipment; Based on the continuous image sequence, noise filtering is performed to obtain a denoised image sequence; Based on the denoised image sequence, geometric distortion correction is performed to obtain the corrected image sequence; Based on the corrected image sequence, the grayscale range is adjusted to obtain a clear image sequence.
[0008] Preferably, the step of performing feature extraction and defect region identification statistics based on the clear image sequence to obtain defect quantification results includes: The clear image sequence is input into a pre-trained convolutional neural network model to extract initial feature data containing color, shape, and texture; Based on the initial feature data, color histogram analysis and edge contour extraction are performed to obtain defect feature data; Based on the defect feature data, multidimensional defect feature statistics and fusion are performed to obtain the defect quantification results.
[0009] Preferably, the step of extracting and combining the corresponding spatiotemporal information based on the defect quantification result to construct a dynamic distribution and obtain a spatiotemporal distribution sequence includes: Based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to perform time series analysis, and an initial spatiotemporal sequence data containing time dependencies and defect density is constructed. Based on the initial spatiotemporal sequence data, spatial clustering analysis is performed. If the defect density of the initial spatiotemporal sequence data exceeds a preset accumulation threshold, the defect accumulation region is determined and obtained. Based on the defect accumulation area, the change trajectory is tracked to generate a spatiotemporal distribution sequence.
[0010] Preferably, the step of performing time-series modeling analysis and trend prediction based on the spatiotemporal distribution sequence to obtain defect trend prediction data includes: The spatiotemporal distribution sequence is input into a pre-trained long short-term memory network model to learn the temporal dependencies in the spatiotemporal distribution sequence and generate a defect evolution feature vector. Based on the defect evolution feature vector, analysis and prediction are performed to obtain defect trend prediction data.
[0011] Preferably, if the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold, then a control instruction for adjusting the operating parameters is generated, including: The defect density growth rate is extracted from the defect trend prediction data and compared with a preset control threshold. If it is greater than the preset control threshold, a trigger signal is generated. Based on the trigger signal, calculate and generate preliminary adjustment parameters; Based on the initial adjustment parameters, a smoothing filter is performed to obtain the optimized adjustment parameters; Based on the optimized adjustment parameters, signal conversion is performed to obtain control commands for adjusting operating parameters.
[0012] Preferably, the step of adjusting the operating parameters according to the control command and re-acquiring the image sequence to verify the control effect and obtain the quality control output includes: According to the control command, the device parameter settings are updated and the image is reacquired to obtain new image features; Based on the new image features, the image correction process is repeated to obtain new corrected image data.
[0013] Based on the new corrected image data, the control effect is verified to obtain quality verification data; Based on the quality verification data, the data is classified and processed to obtain the quality control output.
[0014] Secondly, the present invention provides a real-time printing quality control system based on image recognition, comprising: The acquisition and correction module is used to acquire continuous image sequences and perform image correction processing to obtain clear image sequences; The defect quantification module is used to perform feature extraction and defect region identification statistics based on the clear image sequence to obtain the defect quantification result; The sequence construction module is used to extract and combine the corresponding spatiotemporal information based on the defect quantification results to perform dynamic distribution construction and obtain a spatiotemporal distribution sequence; The trend prediction module is used to perform time series modeling analysis and trend prediction based on the spatiotemporal distribution sequence to obtain defect trend prediction data; The instruction generation module is used to generate control instructions for adjusting operating parameters if the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold. The adjustment and verification module is used to adjust the operating parameters according to the control instructions, re-acquire image sequences to verify the control effect, and obtain quality control output.
[0015] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the image recognition-based real-time printing quality control method described in any one of the above.
[0016] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the image recognition-based real-time printing quality control method described above.
[0017] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention performs noise removal and distortion correction on the acquired continuous image sequence, and then uses a convolutional neural network to extract deep features such as color and shape of defects such as ink spots and scratches. This method solves the problem that traditional techniques based on fixed thresholds or template matching cannot accurately distinguish between normal textures and minor defects when faced with image distortion caused by material changes or high-speed operation, thereby significantly improving the accuracy and adaptability of defect detection in complex dynamic scenes.
[0018] (2) This invention constructs a spatiotemporal distribution sequence by combining quantified defect data with time information, and analyzes the sequence using a long short-term memory network to learn the dynamic laws of defect evolution over time and space. This method solves the problem that existing technologies can only identify isolated, static defects and cannot predict their development trends, and realizes the forward-looking prediction of defect accumulation patterns and growth trends, thereby endowing the quality control system with predictive maintenance capabilities.
[0019] (3) This invention compares the predicted data of defect trends with preset thresholds. Once a potential risk of quality deterioration is detected, it can automatically generate control commands and adjust production line operating parameters such as printing speed and ink supply in real time. This method solves the problem of the lack of an automated and timely response mechanism after an anomaly is detected in the prior art. By establishing a closed-loop system of "image analysis-trend prediction-feedback control", it realizes dynamic optimization of the printing process, thereby effectively ensuring the stability of product quality and improving production efficiency. Attached Figure Description
[0020] Figure 1This is a schematic flowchart of the real-time printing quality control method based on image recognition provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the printing quality real-time control system based on image recognition provided in the second embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Reference Figure 1 The first embodiment of the present invention provides a real-time printing quality control method based on image recognition, comprising the following steps: S11: Acquire a continuous image sequence and perform image correction processing to obtain a clear image sequence; S12, based on the clear image sequence, perform feature extraction and defect region identification statistics to obtain defect quantification results; S13, Based on the defect quantification results, extract and combine the corresponding spatiotemporal information to construct a dynamic distribution and obtain a spatiotemporal distribution sequence; S14. Based on the spatiotemporal distribution sequence, perform time series modeling analysis and trend prediction to obtain defect trend prediction data; S15, if the defect trend prediction data indicates that the defect density growth rate exceeds the preset control threshold, then a control command for adjusting the operating parameters is generated. S16, according to the control command, adjust the operating parameters, re-acquire the image sequence to verify the control effect, and obtain the quality control output.
[0023] In step S11, a continuous image sequence is acquired and image correction processing is performed to obtain a clear image sequence, including: Acquire continuous image sequences from printing production line equipment; Based on the continuous image sequence, noise filtering is performed to obtain a denoised image sequence; Based on the denoised image sequence, geometric distortion correction is performed to obtain the corrected image sequence; Based on the corrected image sequence, the grayscale range is adjusted to obtain a clear image sequence.
[0024] First, high-speed cameras deployed on the printing production line continuously acquire images based on a preset frame rate parameter, forming an original image sequence. The frame rate parameter is calculated based on the physical requirements of the minimum defect size to be detected on the production line and the current operating speed of the production line. The method for setting this parameter is as follows: first, based on the detection requirements of the minimum defect size, determine the minimum number of images to be acquired per unit length (e.g., per meter), i.e., the image sampling density; then, multiply this image sampling density by the real-time operating speed of the production line (meters / second) to obtain the minimum frame rate (frames / second) required to ensure that all key details are captured. This calculated value serves as the minimum basis for setting the camera's acquisition frame rate. In practical applications, this can be appropriately increased by a certain percentage (e.g., 10%–20%) to reserve a margin and ensure reliable capture of transient defects.
[0025] Next, for the original image sequence, a mean square filtering method is applied to each image frame. The specific process includes: selecting a two-dimensional sliding window of a preset size. This window size is determined experimentally based on statistical analysis of hundreds of noisy image samples actually collected from the production line. The specific statistical method is as follows: filtering the sample set using windows of different sizes (e.g., 3x3, 5x5, 7x7 pixels), calculating the peak signal-to-noise ratio (PSNR) of each group of results. The PSNR is calculated by dividing the square of the maximum pixel value by the mean square error, and then taking the logarithm of the quotient to the base ten. Then multiply by 10 to get; where the maximum pixel value is usually 255 for 8-bit images, the mean square error is the average of the squared differences between each corresponding pixel between the original image and the filtered image, and the window size with the highest peak signal-to-noise ratio and the lowest image edge blurring effect while effectively filtering out the main noise is selected as the preset value; when performing the filtering operation, the center of the window is covered to each pixel in the image one by one, the gray values of all pixels in the window are read and sorted at each position, the median is taken to replace the original value of the center pixel, and the denoised image sequence is obtained after traversing the entire image.
[0026] Then, a distortion correction algorithm is applied to remap the geometric positions of the denoised image sequence. The key parameters for this step are the camera intrinsic matrix and the distortion correction parameters. The construction and usage process is as follows: First, in an offline environment, dozens of images of a calibration board with a high-precision checkerboard pattern are taken from different angles and distances using the camera to be applied. Second, for each calibration board image, a corner detection algorithm is run. This algorithm calculates the image gradient and edge direction. The calculation process is as follows: a 3x3 Sobel operator is used to convolve the image with the curve. This operator contains templates in both horizontal and vertical directions (a common horizontal template can be used). =[-1,0,1;-2,0,2;-1,0,1] and vertical template (Convolution calculation is performed on y=[1,2,1;0,0,0;-1,-2,-1]), calculating the gray-level change rate (horizontal gradient) and the gray-level change rate (vertical gradient) of each pixel in the horizontal and vertical directions, respectively. Then, the total gradient magnitude and direction are calculated based on these two gradient components. The gradient magnitude is calculated as the square root of the sum of the squares of the horizontal and vertical gradients. The gradient direction is calculated as the arctangent of the vertical and horizontal gradients. The pixel with the maximum curvature change at the intersection of the black and white squares of the checkerboard is identified as the corner point, and the precise pixel coordinates of all checkerboard corner points are automatically extracted.
[0027] Finally, these 2D pixel coordinates are matched with their known real positions in the 3D world coordinate system. The camera projection model is solved using the Levenberg-Marquardt algorithm. This solution process is an iterative optimization process. The algorithm continuously fine-tunes the estimated values of the camera parameters and calculates the error between the position of the 3D world point projected onto the image under the current parameters and the actual detected corner position. By minimizing this reprojection error, the optimal camera parameter solution is found, thereby calculating the unique camera intrinsic matrix and distortion correction parameters. The calculation process is as follows: based on the mathematical expression of the camera projection model, a system of linear equations is constructed using the matched sets of paired 3D and 2D point coordinates. The initial estimated values of the parameters are solved using the direct linear transformation method. Then, these initial values are substituted into the nonlinear optimization model for iterative refinement, and finally, the accurate intrinsic matrix and distortion correction coefficients are obtained.
[0028] During correction, a lookup table of pixel positions is generated based on these parameters. This lookup table records the coordinates of each pixel in the distorted image that should be mapped to the standard coordinate position in the corrected image. The correction operation involves creating a new blank image and iterating through each pixel of the original distorted image, filling its color information into the corresponding standard position in the new image according to the lookup table, and finally reconstructing a geometrically accurate sequence of corrected images.
[0029] Finally, the grayscale range of the corrected image sequence is adjusted using histogram equalization. The steps are as follows: First, traverse all pixels of the corrected image and count the total number of pixels at each grayscale level from 0 to 255 to generate a grayscale histogram of the image. Second, calculate the cumulative distribution function for each grayscale level based on the histogram. The calculation process is as follows: the cumulative distribution function value of a grayscale level is equal to the sum of the number of pixels at all grayscale levels from zero to that grayscale level divided by the total number of pixels in the image. It represents the proportion of pixels in the image whose grayscale value is less than or equal to that grayscale level. Third, generate a grayscale value mapping rule based on the cumulative distribution function. This rule is a lookup table containing the mapping relationship between all original grayscale levels from 0 to 255 and their corresponding new grayscale levels. The generation process is as follows: for each original grayscale level, multiply its corresponding cumulative distribution function value by the maximum grayscale level minus one (e.g., 255), and round the result to the nearest integer. The integer obtained is the new grayscale level corresponding to the original grayscale level in the mapping rule. The rule remaps the original grayscale values to a wider, more uniform grayscale range; fourth, the original grayscale value of each pixel in the image is replaced with a new grayscale value according to this mapping rule, and finally the clear image sequence is obtained.
[0030] In step S12, feature extraction and defect region identification statistics are performed based on the clear image sequence to obtain defect quantification results, including: The clear image sequence is input into a pre-trained convolutional neural network model to extract initial feature data containing color, shape, and texture; Based on the initial feature data, color histogram analysis and edge contour extraction are performed to obtain defect feature data; Based on the defect feature data, multidimensional defect feature statistics and fusion are performed to obtain the defect quantification results.
[0031] First, each frame of the clear image sequence is input into a pre-trained convolutional neural network model to extract initial feature data. The construction process of this pre-trained convolutional neural network model is as follows: First, a training dataset containing tens of thousands of labeled printed images is created, covering normal samples as well as samples containing various ink spots, scratches, and defects; Second, a CNN network structure containing multiple convolutional layers, pooling layers, and fully connected layers is designed. The specific operation of the convolutional layer for local feature perception is as follows: a numerical matrix (convolutional kernel) much smaller than the image is slid across the image from left to right and from top to bottom. At each position, the value in the convolutional kernel is multiplied and summed with the corresponding pixel value of the image it covers to obtain a new value. All new values together form a feature map. The third step is to use the training dataset to perform supervised learning on the designed CNN network. The network weights are continuously optimized through the backpropagation algorithm. The specific operation is as follows: input a training image into the network to obtain a prediction result, calculate the error value between the prediction result and the true label, and then propagate the error value from back to front layer by layer. According to the contribution of each layer to the total error, the weight values in the network of that layer are adjusted proportionally. This process is repeated until the prediction error of the network for the entire training set reaches a preset convergence criterion.
[0032] During extraction, the image passes through each convolutional layer of the model in sequence, generating numerical representations layer by layer from low-order features such as edges and corners to high-order features such as complex textures and local shapes. Finally, the fully connected layer outputs a high-dimensional feature vector, which serves as the initial feature data containing image color, shape, and texture information.
[0033] Next, based on the initial feature data, defect feature data is obtained through two parallel processing methods: First, color histogram analysis is performed. This operation targets the potential defect areas in the image initially marked by the initial feature data, statistically analyzes the pixel intensity distribution of each channel in the RGB or HSV color space, and compares it with a preset standard color distribution model. This standard model is established by statistically averaging the color data of thousands of batches of qualified printed materials. By calculating the difference between the two distributions (such as the Barthel distance), the color deviation parameter of the ink dot defect is quantified.
[0034] Secondly, edge contour extraction is performed. This operation uses the Canny edge detection operator, and the specific operation and calculation process is as follows: First, the image is smoothed to reduce noise interference; then, the gray-level change rate of each pixel in the horizontal and vertical directions, i.e., the image gradient, is calculated. The calculation process is as follows: the horizontal gradient and vertical gradient are calculated separately using the Sobel operator, and the total gradient magnitude is equal to the square root of the sum of the squares of the horizontal gradient and the squares of the vertical gradient; next, the pixels are scanned along the gradient direction, retaining the points with the largest local changes, so that the edge is thinned to a single pixel width. Finally, two thresholds are set, a high threshold and a low threshold. These thresholds are intensity thresholds for the gradient magnitude. They are set based on the analysis of the gradient magnitude distribution of the entire image using the Otsu method. An optimal threshold is automatically calculated that best divides the gradient magnitude of all pixels into "strong" and "weak" categories. This optimal threshold is set as the high threshold, and a fixed percentage (e.g., 50%) of the high threshold is set as the low threshold. Points above the high threshold are identified as strong edges. Starting from a strong edge, all connected points above the low threshold are connected to form a continuous and complete contour line. The specific operation of structurally combining the calculated color deviation parameters and shape geometry parameters is as follows: a data record is created for each detected defect. This record contains multiple preset fields, such as "color deviation value," "shape length," and "shape width." The calculated corresponding parameter values are then filled into these fields to obtain the defect feature data.
[0035] Finally, based on the defect feature data, multi-dimensional defect feature statistics and fusion processing are performed to obtain the final defect quantification result. This process is as follows: First, for each region assigned defect feature data, the total number of pixels it covers is counted to obtain defect size data. Second, the distribution concentration of defect pixels within the region is calculated to obtain defect density data. The calculation process is as follows: defect density equals the total number of defect pixels within the defect region divided by the total number of pixels in the detection window (or image) containing the defect region, then multiplied by 100%. Third, the defect size data and density data are concatenated with the color deviation parameters and shape geometric parameters obtained in the previous step to form a comprehensive feature vector customized for each defect, containing information in all dimensions. This set of comprehensive feature vectors is the structured defect quantification result, containing all quantification indicators such as the location, type, size, and density of each defect.
[0036] In step S13, based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to perform dynamic distribution construction, resulting in a spatiotemporal distribution sequence, including: Based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to perform time series analysis, and an initial spatiotemporal sequence data containing time dependencies and defect density is constructed. Based on the initial spatiotemporal sequence data, spatial clustering analysis is performed. If the defect density of the initial spatiotemporal sequence data exceeds a preset accumulation threshold, the defect accumulation region is determined and obtained. Based on the defect accumulation area, the change trajectory is tracked to generate a spatiotemporal distribution sequence.
[0037] First, the defect quantification results output from the previous step, which include various quantification indicators for each defect, are subjected to time series correlation processing to construct initial spatiotemporal sequence data. The specific processing steps are as follows: A collection timestamp field is added to each independent defect feature vector, precisely recording the time when the defect image frame was collected; subsequently, the continuously collected defect feature vectors with timestamps are arranged in chronological order to form a data stream, which constitutes the initial spatiotemporal sequence data containing defect time dependencies and defect density.
[0038] Next, based on the initial spatiotemporal sequence data, spatial clustering analysis is performed to determine and obtain the defect accumulation area. The analysis process is as follows: First, a preset spatial grid is divided on the logical coordinate system of the printed material. This spatial grid is a logical matrix that virtually divides the entire printed material surface into multiple cells. The division density is set after statistical analysis of historical reject data. The typical physical size of the key defect accumulation area causing quality problems is determined, and the cell size is set slightly smaller than this typical size to ensure detection sensitivity and positioning accuracy.
[0039] The second step is to set a time window. The time window is set based on the statistical analysis of the defect evolution rate, that is, to analyze the average time required from the appearance of the initial defect to the development of a serious accumulation state in history, and set the time window to one-half to one-third of the average time to ensure that the system can respond in time before the defect worsens, while avoiding false alarms due to the time window being too short.
[0040] The third step is to iterate through each cell and calculate the average defect density of all defects falling into that cell within a set time window. The fourth step is to compare the calculated average defect density with a preset accumulation threshold. If the calculated value exceeds the threshold, the cell is marked as a defect accumulation area. The accumulation threshold is set based on statistical analysis of the critical defect density values that led to the scrapping of batch products in historical production data. 80% of the statistical average is taken as the warning threshold. The 80% ratio is determined through receiver operating characteristic curve analysis, aiming to achieve the optimal balance between warning sensitivity and false alarm rate. Specifically, on the historical dataset, multiple different ratios, including 70%, 80%, and 90%, are tested as thresholds, and their corresponding true positive rate (correct warning) and false positive rate (false warning) are calculated respectively. Finally, the ratio that maximizes the true positive rate while keeping the false positive rate at an acceptable low level (e.g., below 5%) is selected as the final setting value.
[0041] Finally, based on the defect accumulation area, the change trajectory is tracked to generate the final spatiotemporal distribution sequence. This tracking process involves the system continuously updating and recording the state (normal or defect accumulation) of each spatial grid cell at fixed time intervals (e.g., every minute). By connecting the states of the same cell at consecutive time points, a defect state evolution sequence for that location is formed. Combining the evolution sequences of all cells creates a dynamic distribution map that reflects the generation, development, or dissipation of the defect accumulation area across the entire printed surface over time; this dynamic distribution map is the spatiotemporal distribution sequence.
[0042] In step S14, based on the spatiotemporal distribution sequence, time series modeling analysis and trend prediction are performed to obtain defect trend prediction data, including: The spatiotemporal distribution sequence is input into a pre-trained long short-term memory network model to learn the temporal dependencies in the spatiotemporal distribution sequence and generate a defect evolution feature vector. Based on the defect evolution feature vector, analysis and prediction are performed to obtain defect trend prediction data.
[0043] First, the spatiotemporal distribution sequence representing the dynamic changes in the defect accumulation region generated in the previous step is input into a pre-trained Long Short-Term Memory (LSTM) network model. The model construction and training process is as follows: First, a large amount of spatiotemporal distribution sequence data from historical production processes is collected as training samples, and each sample is labeled with the actual defect density result occurring one time period later (e.g., 10 minutes), forming a training dataset. Second, a network structure containing an input layer, multiple LSTM hidden layers, and an output layer is constructed. Its key parameters include the number of hidden layers and the number of neurons in each hidden layer. These parameters are set based on cross-validation experiments: that is, multiple model combinations with different numbers of layers and neurons are built, trained using partial training data, and the prediction accuracy of each combination is tested on independent validation datasets. Finally, the structural parameters with the highest prediction accuracy are selected without excessively increasing the computational burden.
[0044] The third step is to train the network using the training dataset. The backpropagation algorithm is used to iteratively adjust the weight parameters inside the network based on the error between the predicted result and the true label. The algorithm is as follows: First, a sequence of data is input into the network for a complete forward propagation. The error between the final output and the true label is calculated. The calculation process is as follows: The mean squared error function is used to subtract the corresponding data point of the true label from each predicted data point to obtain the difference. Then, all differences are squared and summed, and the average value is taken to obtain the total quantized error.
[0045] Then, the error is backpropagated back along the time steps to the beginning of the sequence, and the gradient of the contribution of each weight to the final error at each time step is calculated. The calculation process is as follows: starting from the last time step of the sequence, the direct contribution of the output layer weights to the total error is first calculated; then, the error is backpropagated to the previous time step, the influence of the hidden layer state at that time step on the state at the next time step is calculated, and combined with the error contribution at the next time step, the indirect contribution of each weight (including the weights of the input gate, forget gate, and output gate) to the total error at the current time step is calculated; this process is repeated step by step forward until the first time step of the sequence, and finally the contribution of each weight at all time steps is accumulated to obtain the total gradient of that weight.
[0046] The process of performing a small update is as follows: based on the calculated gradient direction, each weight value is subtracted by a small value equal to the preset learning rate multiplied by the gradient value of that weight. This ensures that the weight adjustment is carried out in the direction of reducing the total error, until the error between the model's predicted value and the true value is less than the preset convergence criterion. The convergence criterion is set based on monitoring the error change of the model on the validation dataset. When the error no longer decreases significantly for several consecutive training cycles, the model is considered to have reached its optimal performance. The error value at this point is defined as the convergence criterion, thereby preventing the model from overfitting.
[0047] During prediction, the spatiotemporal distribution sequence is converted into a multidimensional time series vector and input into the model. The specific process of selective memorization and forgetting in the LSTM unit of the model is as follows: At each time step, the "forget gate" inside the unit decides which no longer important historical information to discard from long-term memory based on the current input and the state of the previous time step; at the same time, the "input gate" decides which new information in the current input is worth recording in long-term memory; finally, the "output gate" combines the current input and the updated long-term memory to decide what information to output as the short-term state of the current time step, thereby learning and capturing the long-term dependency of defect density evolution over time. After processing the entire input sequence, the final state of the LSTM hidden layer is output as a highly condensed and numerical representation of the entire historical defect evolution process, namely the defect evolution feature vector.
[0048] Next, based on the defect evolution feature vector, analysis and prediction are performed to obtain the final defect trend prediction data. This process involves: passing the defect evolution feature vector to the network's output layer; the output layer performing a linear transformation and analysis on the high-dimensional vector; specifically, multiplying the vector with the output layer's weight matrix; projecting it from the high-dimensional space of the hidden layer to a preset low-dimensional output space with clear physical meaning; and mapping it to a preset output dimension.
[0049] It should be noted that the low-dimensional output space is a structured numerical vector, whose setting is based on the specific objectives of the prediction task: if it is necessary to predict the defect density of N spatial grid cells over the next M time steps, then the dimension of the output space is N multiplied by M, and each element in the vector uniquely corresponds to the predicted defect density value of a specific grid cell at a specific time in the future. The preset output dimension is set based on the specific requirements of the prediction task, and its value is equal to the number of spatial grid cells to be predicted multiplied by the number of future time steps to be predicted. This output is the defect trend prediction data, which is a structured numerical set that specifically includes the predicted defect density value of each spatial grid cell within a future prediction time period (e.g., the next 5 minutes), as well as the defect density growth rate calculated from the continuous prediction values.
[0050] In step S15, if the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold, then a control instruction for adjusting the operating parameters is generated, including: The defect density growth rate is extracted from the defect trend prediction data and compared with a preset control threshold. If it is greater than the preset control threshold, a trigger signal is generated. Based on the trigger signal, calculate and generate preliminary adjustment parameters; Based on the initial adjustment parameters, a smoothing filter is performed to obtain the optimized adjustment parameters; Based on the optimized adjustment parameters, signal conversion is performed to obtain control commands for adjusting operating parameters.
[0051] First, from the defect trend prediction data obtained in the previous step, the predicted defect density growth rate of each spatial grid cell is extracted and compared one by one with a preset control threshold. The control threshold is set based on analyzing the correlation between the defect density growth rate and the final product pass rate in historical production data. A critical point is determined where the product failure rate will significantly increase when the growth rate exceeds this value, and this critical point is used as the control threshold. If the growth rate of any cell exceeds this threshold, the system generates an internal digital trigger signal (e.g., a Boolean flag indicating "true") to initiate the subsequent adjustment process.
[0052] Next, based on the trigger signal, the system activates a preset feedback control rule base to calculate and generate preliminary adjustment parameters. This rule base is built upon a large amount of experimental data and defines the mapping relationship between different levels of defect density growth rate excess and the adjustment range of key operating parameters such as printing speed and ink supply. The calculation process involves searching the rule base for the corresponding parameter adjustment based on the current excess growth rate value, such as "reducing the printing speed by 5 meters per minute" and "increasing the ink supply by 2%." These specific values are the preliminary adjustment parameters.
[0053] Then, to avoid the impact of drastic parameter changes on the equipment, a smoothing filter is performed based on the initial adjustment parameters to obtain optimized adjustment parameters. The specific operation of this process is as follows: a weighted moving average algorithm is used, and the specific process of weighted averaging is as follows: First, a set of weight coefficients is set, which is determined through simulation tests on historical adjustment data. That is, multiple different weight combinations are tested (e.g., [0.5, 0.3, 0.2] or [0.7, 0.2, 0.1]), and the system response characteristics under each weight are evaluated, including overshoot, settling time, and steady-state error. Finally, a set of weight coefficients that enables the system response to be fast, stable, and with minimal overshoot is selected, and the sum of all weight coefficients is required to be 1. Second, the latest adjustment value is multiplied by the highest weight, the second newest adjustment value is multiplied by the second highest weight, and the oldest adjustment value is multiplied by the lowest weight. Third, all products are added together, and the sum is the final optimized adjustment parameter. This method mitigates the magnitude of a single adjustment. The specific steps are as follows: Since the final output optimized adjustment parameters are a mixture of the current large adjustment demand and the past small or no adjustment state, their value is "pulled back" by historical data, thus avoiding a direct jump from a stable state to a drastically different new state. This makes the parameter adjustment process a smooth and gradual one, resulting in a set of optimized adjustment parameters with stable changes.
[0054] Finally, based on the optimized adjustment parameters, signal conversion is performed to obtain control commands that the device can directly execute to adjust operating parameters. This conversion process involves translating the optimized numerical parameters using a preset conversion protocol. This preset protocol is a lookup table or linear function established during system initialization, defining the correspondence between engineering values and electrical signals. Its setting strictly adheres to the hardware technical manual provided by the equipment manufacturer, which specifies, for example, the voltage range for controlling motor speed (e.g., 0-10V) or the digital signal range for controlling valve opening (e.g., 4-20mA). The protocol's function is to accurately convert the optimized engineering values (e.g., target printing speed) into physical signals (e.g., voltage or current) that can drive the hardware to perform corresponding actions, based on the calibration curve or conversion function provided by the equipment manufacturer. For example, an engineering value like "92 m / min" is accurately converted into a voltage signal like "8.5V" that can drive the hardware to perform corresponding actions. The resulting electrical signal or data packet is the control command.
[0055] In step S16, according to the control command, the operating parameters are adjusted, and the image sequence is re-acquired to verify the control effect, resulting in a quality control output, including: According to the control command, the device parameter settings are updated and the image is reacquired to obtain new image features; Based on the new image features, the image correction process is repeated to obtain new corrected image data.
[0056] Based on the new corrected image data, the control effect is verified to obtain quality verification data; Based on the quality verification data, the data is classified and processed to obtain the quality control output.
[0057] First, based on the control commands generated in the previous step, the equipment parameters are updated and images are reacquired. This process involves sending the control commands to the corresponding execution units in the printing production line, driving their physical components to adjust the operating parameters. Specifically, if the printing speed is adjusted, the command signal changes the output frequency of the servo motor controller, thereby precisely changing the rotational speed of the main roller motor; if the ink supply is adjusted, the command signal controls the opening of the solenoid valve or the flow rate of the ink pump to change the amount of ink ejected per unit time. After the parameter adjustments are completed, the high-speed camera is immediately triggered to acquire a continuous image sequence under the new operating parameters, serving as the original image data reflecting the adjustment effect.
[0058] Next, the original image data undergoes image correction processing that is exactly the same as described in step S11. This processing includes noise filtering, geometric distortion correction, and grayscale range adjustment, ultimately resulting in clear, distortion-free new corrected image data.
[0059] Then, based on the new corrected image data, the control effect is verified to obtain quality verification data. The verification process is as follows: First, the same defect quantification process as step S12 is performed on the new corrected image data to calculate a series of new quantitative indicators such as the adjusted defect density and size; Second, these new quantitative indicators are compared with the quantitative indicators recorded before adjustment to calculate the rate of change of defect density. The calculation process is as follows: subtract the adjusted defect density from the defect density before adjustment, divide the difference by the defect density before adjustment, and finally multiply by 100%; Third, the new image features are compared pixel-level with a preset standard quality template. The standard quality template is a "golden sample" image collected under ideal conditions and confirmed to be without any flaws. Its setting is based on the original design drawing of the product or the first article inspection qualified product. A comprehensive image similarity score is calculated. The similarity score calculation process is as follows: divide the image into multiple windows, compare the similarity of the new image window with the corresponding window of the template image in terms of brightness, contrast and structure, and finally average the scores of all windows to obtain a final score between 0 and 1. The set of values composed of the defect density change rate and the image similarity score is the quality verification data.
[0060] Finally, based on the quality verification data, classification processing is performed to obtain the final quality control output. This classification processing relies on a pre-set decision tree model. The training process of this model is as follows: First, a sample set containing thousands of sets of quality verification data and their corresponding manual evaluation results ("adjustment successful", "poor effect") is collected as training data. Second, a standard decision tree generation algorithm such as C4.5 or CART is selected. This algorithm automatically finds the features that can most effectively distinguish different evaluation results (e.g., "similarity score is greater than 0.95") by calculating information gain or Gini index, and uses them as splitting nodes to recursively construct the entire tree. The path of this tree is the decision tree rule. The model parameter selection (e.g., the maximum depth of the tree) is determined by testing the classification accuracy of different parameter combinations on the validation set, and the parameter combination with the highest accuracy is selected. During classification, the current quality verification data is input into the root node of the decision tree, and the tree is judged layer by layer according to the internal node rules until a leaf node is reached. The category of the leaf node (e.g., "qualified") is the final classification result. The classification result is the quality control output, which is a structured information containing clear conclusions and a summary of key verification data, used for system archiving or presentation to operators.
[0061] In summary, this invention achieves dynamic defect monitoring and adaptive adjustment of production parameters through the deep integration of image processing, neural network analysis, and feedback control, significantly improving printing quality stability and production efficiency.
[0062] Reference Figure 2 The second embodiment of the present invention provides a real-time printing quality control system based on image recognition, comprising: The acquisition and correction module is used to acquire continuous image sequences and perform image correction processing to obtain clear image sequences; The defect quantification module is used to perform feature extraction and defect region identification statistics based on the clear image sequence to obtain the defect quantification result; The sequence construction module is used to extract and combine the corresponding spatiotemporal information based on the defect quantification results to perform dynamic distribution construction and obtain a spatiotemporal distribution sequence; The trend prediction module is used to perform time series modeling analysis and trend prediction based on the spatiotemporal distribution sequence to obtain defect trend prediction data; The instruction generation module is used to generate control instructions for adjusting operating parameters if the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold. The adjustment and verification module is used to adjust the operating parameters according to the control instructions, re-acquire image sequences to verify the control effect, and obtain quality control output.
[0063] It should be noted that the image recognition-based real-time printing quality control system provided in this embodiment of the invention is used to execute all the process steps of the image recognition-based real-time printing quality control method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0064] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a real-time printing quality control program based on image recognition. When the processor executes the computer program, it implements the steps in the various embodiments of the above-described real-time printing quality control method based on image recognition, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as the defect quantification module.
[0065] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0066] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0067] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting all parts of the electronic device via various interfaces and lines.
[0068] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0069] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0070] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0071] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A real-time printing quality control method based on image recognition, characterized in that, include: A continuous image sequence is acquired, and image correction processing is performed to obtain a clear image sequence; Based on the clear image sequence, feature extraction and defect region identification statistics are performed to obtain defect quantification results; Based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to construct a dynamic distribution, thereby obtaining a spatiotemporal distribution sequence. Based on the spatiotemporal distribution sequence, time series modeling analysis and trend prediction are performed to obtain defect trend prediction data; If the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold, then a control command is generated to adjust the operating parameters. According to the control instructions, the operating parameters are adjusted, and the image sequence is re-acquired to verify the control effect, thereby obtaining the quality control output.
2. The real-time printing quality control method based on image recognition according to claim 1, characterized in that, The process of acquiring a continuous image sequence and performing image correction processing to obtain a clear image sequence includes: Acquire continuous image sequences from printing production line equipment; Based on the continuous image sequence, noise filtering is performed to obtain a denoised image sequence; Based on the denoised image sequence, geometric distortion correction is performed to obtain the corrected image sequence; Based on the corrected image sequence, the grayscale range is adjusted to obtain a clear image sequence.
3. The real-time printing quality control method based on image recognition according to claim 1, characterized in that, The step of performing feature extraction and defect region identification statistics based on the clear image sequence to obtain defect quantification results includes: The clear image sequence is input into a pre-trained convolutional neural network model to extract initial feature data containing color, shape, and texture; Based on the initial feature data, color histogram analysis and edge contour extraction are performed to obtain defect feature data; Based on the defect feature data, multidimensional defect feature statistics and fusion are performed to obtain the defect quantification results.
4. The real-time printing quality control method based on image recognition according to claim 1, characterized in that, The step of extracting and combining the corresponding spatiotemporal information based on the defect quantification results to construct a dynamic distribution and obtain a spatiotemporal distribution sequence includes: Based on the defect quantification results, the corresponding spatiotemporal information is extracted and combined to perform time series analysis, and an initial spatiotemporal sequence data containing time dependencies and defect density is constructed. Based on the initial spatiotemporal sequence data, spatial clustering analysis is performed. If the defect density of the initial spatiotemporal sequence data exceeds a preset accumulation threshold, the defect accumulation region is determined and obtained. Based on the defect accumulation area, the change trajectory is tracked to generate a spatiotemporal distribution sequence.
5. The real-time printing quality control method based on image recognition according to claim 4, characterized in that, The step of performing time-series modeling analysis and trend prediction based on the spatiotemporal distribution sequence to obtain defect trend prediction data includes: The spatiotemporal distribution sequence is input into a pre-trained long short-term memory network model to learn the temporal dependencies in the spatiotemporal distribution sequence and generate a defect evolution feature vector. Based on the defect evolution feature vector, analysis and prediction are performed to obtain defect trend prediction data.
6. The real-time printing quality control method based on image recognition according to claim 1, characterized in that, If the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold, then a control instruction for adjusting the operating parameters is generated, including: The defect density growth rate is extracted from the defect trend prediction data and compared with a preset control threshold. If it is greater than the preset control threshold, a trigger signal is generated. Based on the trigger signal, calculate and generate preliminary adjustment parameters; Based on the initial adjustment parameters, a smoothing filter is performed to obtain the optimized adjustment parameters; Based on the optimized adjustment parameters, signal conversion is performed to obtain control commands for adjusting operating parameters.
7. The real-time printing quality control method based on image recognition according to claim 1, characterized in that, The process of adjusting operating parameters according to the control command, re-acquiring image sequences to verify the control effect, and obtaining quality control output includes: According to the control command, the device parameter settings are updated and the image is reacquired to obtain new image features; Based on the new image features, the image correction process is repeated to obtain new corrected image data; Based on the new corrected image data, the control effect is verified to obtain quality verification data; Based on the quality verification data, the data is classified and processed to obtain the quality control output.
8. A real-time printing quality control system based on image recognition, characterized in that, include: The acquisition and correction module is used to acquire continuous image sequences and perform image correction processing to obtain clear image sequences; The defect quantification module is used to perform feature extraction and defect region identification statistics based on the clear image sequence to obtain the defect quantification result; The sequence construction module is used to extract and combine the corresponding spatiotemporal information based on the defect quantification results to perform dynamic distribution construction and obtain a spatiotemporal distribution sequence; The trend prediction module is used to perform time series modeling analysis and trend prediction based on the spatiotemporal distribution sequence to obtain defect trend prediction data; The instruction generation module is used to generate control instructions for adjusting operating parameters if the defect trend prediction data indicates that the defect density growth rate exceeds a preset control threshold. The adjustment and verification module is used to adjust the operating parameters according to the control instructions, re-acquire image sequences to verify the control effect, and obtain quality control output.