Printing defect data generation method, printing defect detection method and device

By aligning and color-standardizing the printed object image with the reference image, simulated printing defect samples are generated. Combined with target detection and classification networks, the problems of low efficiency and insufficient algorithm robustness of traditional manual detection are solved, and efficient and accurate automatic detection of printing defects is achieved.

CN120411099BActive Publication Date: 2025-09-16MICROPATTERN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510911375.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-09-16
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

In the color printing process, traditional manual visual inspection is inefficient and has the risk of missed detections. Existing algorithms find it difficult to accurately identify printing defects in complex backgrounds. Especially in high-security printing areas such as cards, the robustness of personalized information and the ability to collaboratively detect multiple defects are insufficient, and unbalanced data samples lead to serious overfitting and missed detections.

Method used

By obtaining a real defect-free printed object image and aligning it with a reference image, and performing color standardization, the print volume distribution is estimated in the CMY color space, and training samples simulating printing defects are generated. The target detection, segmentation and classification networks are then collaboratively optimized to generate diverse defect samples for training the detection model.

Benefits of technology

It improves the accuracy and generalization ability of printing defect detection, reduces the misjudgment rate, and realizes efficient and accurate automated detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411099B_ABST
    Figure CN120411099B_ABST
Patent Text Reader

Abstract

The present invention discloses a printing defect data generation method, a printing defect detection method and a device, which relate to the technical field of printing defect detection. The method performs processing based on a precisely aligned first reference image and an image to be processed, extracts candidate defect areas from the image to be processed through target detection, target segmentation or anomaly detection algorithms, and inputs the candidate areas and their corresponding areas in the first reference image into a twin classification network for authenticity judgment. A printing defect data generation method based on color space decoupling is proposed: first, the second reference image is aligned with the defect-free image to be processed and color standardization is performed, and the printing amount distribution of each color channel is estimated in the CMY color space, and printing defects are simulated in a single-channel printing amount attenuation manner. A training image containing missing defects and color deviation defects is generated through color space conversion. Through the coordinated optimization of data generation and detection algorithms, the accuracy and generalization ability of printing defect detection are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printing defect detection, and in particular to a printing defect data generation method, a printing defect detection method and a printing defect detection device. Background Art

[0002] During the color printing process, equipment failure may cause a variety of printing defects, including missing prints, color deviation, irregular stripes caused by ribbon wrinkles, and impurities. Especially in the field of high-security printing such as cards and certificates, the traditional quality control method that relies on manual visual inspection is not only inefficient (the average inspection time for a single piece is more than 3 seconds), but also has the risk of missed inspections. In order to achieve efficient and accurate quality inspection, automated inspection technology based on computer vision has become an inevitable choice, but it must meet three core requirements: (1) The inspection accuracy must reach a microscopic resolution of 0.1mm²; (2) The algorithm must have the ability to collaboratively detect multiple defects, including but not limited to the above-mentioned printing defect types; (3) In some special scenarios such as card and certificate printing, the printed text or image has personalized features (such as personalized names, ID numbers, portraits, etc.), and the algorithm must be able to maintain robustness when printing personalized information.

[0003] The implementation of this technology mainly faces the following technical challenges:

[0004] First, multiple interfering factors exist in the imaging process: color distortion generated during the printing process and interference from ambient light in the imaging environment combine to create a complex color shift, making it difficult for traditional color difference determination methods to accurately identify true color differences. Furthermore, the complex background patterns on the printed surface and the highly reflective nature of post-processed anti-counterfeiting elements can easily cause dynamic range compression in the imaging system (typically manifested as a loss of detail in highlight areas), leading to false detection of artifacts.

[0005] Secondly, defect recognition presents algorithmic challenges: the nonlinear deformation characteristics of wrinkles and streaks, combined with the diverse morphologies of random impurities, make it difficult for traditional rule-based image processing algorithms to effectively generalize. In particular, the unpredictable nature of personalized text and image features in card printing cannot be captured through conventional sample learning, placing even higher demands on the robustness and adaptability of algorithms.

[0006] Furthermore, there is a data bottleneck in model training: in practical applications, it is impossible to collect samples of all types of printing defects. The existing defect samples are not only limited in number, but also have serious imbalanced category distribution problems, which makes traditional supervised learning models prone to overfitting and missed detection.

[0007] In response to the above technical bottlenecks, it is urgent to develop intelligent, high-precision detection solutions to achieve real-time and accurate identification of printing defects under complex working conditions.

[0008] In the analysis of the causes of printing defects, there is a clear correspondence between different defect types and abnormal performance of the CMYK four-color channels:

[0009] Missing print: This defect occurs when none of the four CMYK inks effectively adhere to a specific area, resulting in a blank area with no print at all. This defect is often caused by a malfunction in the ink supply system or an abnormal surface condition on the substrate, resulting in total ink rejection.

[0010] Color shift defects: caused by anomalies in single or multi-color channels, can be divided into two categories:

[0011] (1) Channel missing color deviation: When the ink in any of the C / M / Y channels is not attached, it will cause the complementary color to develop (C missing will show a red tone, M missing will show a green tone, and Y missing will show a blue tone). For grayscale printing, K ink is usually used for printing. When K is missing, it will cause grayscale printing missing defects.

[0012] (2) Insufficient ink volume type color deviation: The ink volume of one or more channels does not reach the set value (such as the ink volume of channel C is reduced by 50%), causing the color space coordinates to deviate from the standard value

[0013] Wrinkle stripes: Essentially a dynamic printing defect, the wrinkle deformation of the ribbon causes a sudden drop in the transfer rate of the four-color ink in a local area, presenting intermittent linear loss characteristics at the microscopic scale

[0014] Impurity contamination: manifested as exogenous substances (such as black impurities) covering the area, causing double anomalies:

[0015] (1) Physical covering causes loss of the underlying four-color printing information (positive loss)

[0016] (2) Impurities themselves produce abnormal response values ​​in four-color channel imaging (reverse interference)

[0017] This mechanism model reveals the essential characteristics of printing defects: from the perspective of four-color channel separation, all defects can be deconstructed into abnormal gain (impurity interference) or abnormal attenuation (missing / insufficient ink) of a specific channel. Summary of the Invention

[0018] In order to solve the problems of printing defect detection in the prior art, the present invention provides a printing defect data generation method, a printing defect detection method and a device. The following technical solutions are adopted:

[0019] A method for generating printing defect data comprises the following steps:

[0020] Step 1: obtaining a true, defect-free printed object image as a to-be-processed image, and obtaining a printed object image containing only a background without printed text or images as a second reference image;

[0021] Step 2: align the image to be processed and the second reference image;

[0022] Step 3: normalize the second reference image so that the average brightness, average hue, and average saturation of the second reference image and the image to be processed in the non-printing area are equal, thereby obtaining a standardized reference image;

[0023] Step 4, converting the standardized reference image and the image to be processed into the CMY color space;

[0024] Step 5, calculating the difference between the normalized image and the image to be processed in a single color channel;

[0025] Step 6, setting the printing defect area;

[0026] Step 7: For the defect area, generate a first defect sample based on the standardized reference image on a single color channel and linear weighting of the difference value;

[0027] Step 8: For the defect area, generate a second defect sample based on the pixel value of the image to be processed on a single color channel multiplied by the second attenuation coefficient;

[0028] Step 9: Convert the defect sample data generated in steps 7 and 8 into RGB color space.

[0029] By employing this technical solution, the second reference image is first registered and aligned with the defect-free image to be processed, and color normalization is performed. The print volume distribution of each color channel is estimated in the CMY color space, and printing defects are simulated using a single-channel print volume attenuation method. After color space conversion, training images containing missing defects and color cast defects are generated. This allows for efficient, automated batch generation of defect samples required for detection model training.

[0030] Optionally, the formula for calculating the difference value in step 5 is:

[0031] ;

[0032] is the difference between the normalized image and the image to be processed on a single color channel, , , i∈{C,M,Y} represents the C, M and Y channels of the image to be processed and the reference image respectively.

[0033] By adopting the above technical solution, the amount of printing ink required to be added to C, M and Y from the standardized reference image to the image to be processed can be accurately estimated. , i∈{C,M,Y}, so as to facilitate the subsequent removal or attenuation of the printing ink volume to simulate printing omissions or printing color deviation defects.

[0034] Optionally, step 6 includes the following sub-steps:

[0035] Step 61: training an object segmentation network to segment the printed area from the normal sample;

[0036] Step 62: Obtain a defect label from a real defect sample to obtain a label image;

[0037] Step 63: rotating, scaling, and translating the label image to obtain a changed label image;

[0038] Step 64: Intersect the changed label image with the printed area to obtain the defective area.

[0039] By adopting the above technical solution, on the one hand, defect areas with diverse shapes, sizes and positions can be obtained, and on the other hand, the subsequent defect generation area is limited to the printing area, avoiding operations on the non-printing area; by adopting this technical solution, the generated defects are closer to the actual defects.

[0040] Optionally, in step 7, the first defect sample is generated according to the following formula:

[0041] ;

[0042] is the first defective sample, Is an indicative function that produces 1 with probability p and 0 otherwise. is the first attenuation coefficient, which is a random number in the interval [0,1]. When , the generated sample is a printed missing sample; when and When , a printed color cast sample is generated. hour, The value of is equal to Ri, which is equivalent to the value before printing text or image, so as to simulate the printing missing sample. and hour, , i∈{C,M,Y} represents the attenuation coefficients on the C, M and Y channels respectively, Indicates the amount of printed ink. When the attenuation coefficient is less than 1, it indicates insufficient ink on that channel, thus simulating a printed color shift. If only one of the three channels has an attenuation coefficient less than 1, a single-channel printed color shift can be simulated. If two of the three channels have an attenuation coefficient less than 1, a two-channel printed color shift can be simulated. If all three channels have an attenuation coefficient less than 1, a three-channel printed color shift can be simulated.

[0043] Optionally, in step 8, a second defect sample is generated according to the following formula:

[0044] ;

[0045] is the second attenuation coefficient, which is a random number in the interval [0,1].

[0046] By adopting this technical solution, the ink volume of a single color channel can be directly attenuated without the need for a standardized reference image, making it more suitable for printing areas with light backgrounds. When the area to be printed has a light background (such as a white background) on the second reference image, the printed color deviation samples generated using this solution are more consistent with actual conditions. On the one hand, some errors may occur in the registration and alignment of the processed image and the second reference image. On the other hand, the combined color deviation caused by color distortion during the printing process and interference from the imaging ambient light can affect the color standardization results. These two aspects of printing can lead to errors in the difference value estimation of a single color channel, resulting in artifacts in the generated first defective color deviation sample that do not match the actual defect. The second defect sample generation scheme can avoid this problem.

[0047] A printing defect detection method comprises the following steps:

[0048] Step a, using defect data generated by a printing defect data generation method and real defect data to train an object detector, where the object detector is used to detect defective objects;

[0049] Step b, using defect data generated by a printing defect data generation method and real defect data to train a defect target segmentor, where the defect target segmentor is used to segment defect targets;

[0050] Step c: using real defect-free data to train an anomaly detector, the anomaly detector is used for anomaly detection;

[0051] Step d: using defect data generated by a printing defect data generation method, real defect data, and a first reference image corresponding to the defect data to train a twin classification network for defect classification;

[0052] In step e, the real test data is subjected to target detection, target segmentation or anomaly detection using the trained target detector, defect target segmentor or anomaly detector to obtain candidate defect areas.

[0053] Optionally, step f is also included, obtaining the corresponding area of ​​the candidate defect area on the first reference image, and sending it to the twin classification network for classification to determine whether the candidate area is a defect.

[0054] By adopting the above technical solution, an object detector is trained using the generated defect data and real defect data to detect defective objects. Here, the YOLO series of object detection algorithms can be used.

[0055] Using the generated defect data and the official defect data, a defect object segmenter is trained to segment defect objects. Object segmentation algorithms such as Unet and HRNet can be used here, and online difficult sample mining loss functions and focal loss are used to address the class imbalance problem.

[0056] Use real, defect-free data to train an anomaly detector for anomaly detection. The RealNet algorithm can be used here.

[0057] Using the generated defect data, official data, and their corresponding first reference images, a twin classification network is trained for defect classification. The first reference image and the image to be processed must first be aligned. Then, the defect regions of each image are captured to form an image pair, which is then fed into the twin classification network for training. The first reference image can help reduce false positives.

[0058] A printing defect detection device includes an imaging device, a storage medium, and a processor. The imaging device is used to obtain an image of a printed product to be detected. The storage medium stores a reference image and a detection program designed using a printing defect detection method. The storage medium communicates with the imaging device to exchange the image of the printed product to be detected. The processor is communicatively connected to the storage medium, inputs the image of the printed product to be detected into the detection program, runs the detection program to output the printing defect detection results, and stores the printing defect detection results in the storage medium.

[0059] Optionally, a display device is further included, which is communicatively connected to the storage medium and is used to display the printing defect detection results.

[0060] In summary, the present invention includes at least the following beneficial technical effects:

[0061] The present invention can provide a printing defect data generation method, a printing defect detection method and a device, which are based on the processing of a precisely aligned first reference image and an image to be processed. First, candidate defect areas are extracted from the image to be processed through target detection, target segmentation or anomaly detection algorithms. Subsequently, the candidate areas and their corresponding areas in the first reference image are input into a twin classification network for authenticity judgment. In order to improve the performance of the model, a printing defect data generation method based on color space decoupling is proposed: first, the second reference image is aligned with the defect-free image to be processed and color standardization is performed. By estimating the print volume distribution of each color channel in the CMY color space, printing defects are simulated in a single-channel print volume attenuation manner, and a training image containing missing defects and color deviation defects is generated through color space conversion. Through the coordinated optimization of data generation and detection algorithms, the accuracy and generalization ability of printing defect detection are effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of a method for generating printing defect data according to the present invention. DETAILED DESCRIPTION

[0063] The present invention will be further described in detail below with reference to the accompanying drawings.

[0064] The embodiments of the present invention disclose a printing defect data generating method, a printing defect detection method and a printing defect detection device.

[0065] Reference Figure 1 , a method for generating printing defect data, comprising the following steps:

[0066] Step 1: obtaining a true, defect-free printed object image as a to-be-processed image, and obtaining a printed object image containing only a background without printed text or images as a second reference image;

[0067] Step 2: align the image to be processed and the second reference image;

[0068] Step 3: normalize the second reference image so that the average brightness, average hue, and average saturation of the second reference image and the image to be processed in the non-printing area are equal, thereby obtaining a standardized reference image;

[0069] Step 4, converting the standardized reference image and the image to be processed into the CMY color space;

[0070] Step 5, calculating the difference between the normalized image and the image to be processed in a single color channel;

[0071] Step 6, setting the printing defect area;

[0072] Step 7: For the defect area, generate a first defect sample based on the standardized reference image on a single color channel and linear weighting of the difference value;

[0073] Step 8: For the defect area, generate a second defect sample based on the pixel value of the image to be processed on a single color channel multiplied by the second attenuation coefficient;

[0074] Step 9: Convert the defect sample data generated in steps 7 and 8 into RGB color space.

[0075] By employing this technical solution, the second reference image is first registered and aligned with the defect-free image to be processed, and color normalization is performed. The print volume distribution of each color channel is estimated in the CMY color space, and printing defects are simulated using a single-channel print volume attenuation method. After color space conversion, training images containing missing defects and color cast defects are generated. This allows for efficient, automated batch generation of defect samples required for detection model training.

[0076] Optionally, the formula for calculating the difference value in step 5 is:

[0077] ;

[0078] is the difference between the normalized image and the image to be processed on a single color channel, , , i∈{C,M,Y} represents the C, M and Y channels of the image to be processed and the reference image respectively.

[0079] By adopting the above technical solution, the amount of printing ink required to be added to C, M and Y from the standardized reference image to the image to be processed can be accurately estimated. , i∈{C,M,Y}, so as to facilitate the subsequent removal or attenuation of the printing ink volume to simulate printing omissions or printing color deviation defects.

[0080] Optionally, step 6 includes the following sub-steps:

[0081] Step 61: training an object segmentation network to segment the printed area from the normal sample;

[0082] Step 62: Obtain a defect label from a real defect sample to obtain a label image;

[0083] Step 63: rotating, scaling, and translating the label image to obtain a changed label image;

[0084] Step 64: Intersect the changed label image with the printed area to obtain the defective area.

[0085] By adopting the above technical solution, on the one hand, defect areas with diverse shapes, sizes and positions can be obtained, and on the other hand, the subsequent defect generation area is limited to the printing area, avoiding operations on the non-printing area; by adopting this technical solution, the generated defects are closer to the actual defects.

[0086] Optionally, in step 7, the first defect sample is generated according to the following formula:

[0087] ;

[0088] is the first defective sample, Is an indicative function that produces 1 with probability p and 0 otherwise. is the first attenuation coefficient, which is a random number in the interval [0,1]. When , the generated sample is a printed missing sample; when and When , a printed color cast sample is generated. hour, The value of is equal to Ri, which is equivalent to the value before printing text or image, so as to simulate the printing missing sample. and hour, , i∈{C,M,Y} represents the attenuation coefficients on the C, M and Y channels respectively, Indicates the amount of printed ink. When the attenuation coefficient is less than 1, it indicates insufficient ink on that channel, thus simulating a printed color shift. If only one of the three channels has an attenuation coefficient less than 1, a single-channel printed color shift can be simulated. If two of the three channels have an attenuation coefficient less than 1, a two-channel printed color shift can be simulated. If all three channels have an attenuation coefficient less than 1, a three-channel printed color shift can be simulated.

[0089] Optionally, in step 8, a second defect sample is generated according to the following formula:

[0090] ;

[0091] is the second attenuation coefficient, which is a random number in the interval [0,1].

[0092] By adopting this technical solution, the ink volume of a single color channel can be directly attenuated without the need for a standardized reference image, making it more suitable for printing areas with light backgrounds. When the area to be printed has a light background (such as a white background) on the second reference image, the printed color deviation samples generated using this solution are more consistent with actual conditions. On the one hand, some errors may occur in the registration and alignment of the processed image and the second reference image. On the other hand, the combined color deviation caused by color distortion during the printing process and interference from the imaging ambient light can affect the color standardization results. These two aspects of printing can lead to errors in the difference value estimation of a single color channel, resulting in artifacts in the generated first defective color deviation sample that do not match the actual defect. The second defect sample generation scheme can avoid this problem.

[0093] A printing defect detection method comprises the following steps:

[0094] Step a, using defect data generated by a printing defect data generation method and real defect data to train an object detector, where the object detector is used to detect defective objects;

[0095] Step b, using defect data generated by a printing defect data generation method and real defect data to train a defect target segmentor, where the defect target segmentor is used to segment defect targets;

[0096] Step c: using real defect-free data to train an anomaly detector, the anomaly detector is used for anomaly detection;

[0097] Step d: using defect data generated by a printing defect data generation method, real defect data, and a first reference image corresponding to the defect data to train a twin classification network for defect classification;

[0098] In step e, the real test data is subjected to target detection, target segmentation or anomaly detection using the trained target detector, defect target segmentor or anomaly detector to obtain candidate defect areas.

[0099] Optionally, step f is also included, obtaining the corresponding area of ​​the candidate defect area on the first reference image, and sending it to the twin classification network for classification to determine whether the candidate area is a defect.

[0100] By adopting the above technical solution, an object detector is trained using the generated defect data and real defect data to detect defective objects. Here, the YOLO series of object detection algorithms can be used.

[0101] Using the generated defect data and the official defect data, a defect object segmenter is trained to segment defect objects. Object segmentation algorithms such as Unet and HRNet can be used here, and online difficult sample mining loss functions and focal loss are used to address the class imbalance problem.

[0102] Use real, defect-free data to train an anomaly detector for anomaly detection. The RealNet algorithm can be used here.

[0103] Using the generated defect data, official data, and their corresponding first reference images, a twin classification network is trained for defect classification. The first reference image and the image to be processed must first be aligned. Then, the defect regions of each image are captured to form an image pair, which is then fed into the twin classification network for training. The first reference image can help reduce false positives.

[0104] A printing defect detection device includes an imaging device, a storage medium, and a processor. The imaging device is used to obtain an image of a printed product to be detected. The storage medium stores a reference image and a detection program designed using a printing defect detection method. The storage medium communicates with the imaging device to exchange the image of the printed product to be detected. The processor is communicatively connected to the storage medium, inputs the image of the printed product to be detected into the detection program, runs the detection program to output the printing defect detection results, and stores the printing defect detection results in the storage medium.

[0105] Optionally, a display device is further included, which is communicatively connected to the storage medium and is used to display the printing defect detection results.

[0106] The following uses a specific embodiment to illustrate the implementation principle of a printing defect data generation method, a printing defect detection method and a device:

[0107] In the card printing industry, the printing quality of portraits is crucial. Portrait printing is divided into color and grayscale printing. For color printing, common printing defects include missing prints, color spots and dots caused by color deviation, linear defects caused by ribbon wrinkling and deformation, and impurity contamination defects (such as black spots on faces that resemble moles, and black stripes on portraits that resemble irregular curves). For grayscale printing, missing prints are a common printing defect. In practical applications, obtaining a large number of defect samples is difficult (for example, in grayscale prints of portraits, the proportion of defect samples is approximately 0.7%). Furthermore, the distribution of defect types among the defect samples that are obtained is uneven (for example, in color prints of portraits, color spots and dots account for 80%, while impurity contamination defects account for 9%). Limited by the number and uneven distribution of defect samples, it is difficult to train a sufficiently robust model for defect detection or segmentation. To address this issue, by analyzing the causes of printing defects, the following solution is adopted to generate a sufficient number of defect samples.

[0108] A method for generating printing defect data comprises the following steps:

[0109] Step 1: Obtain a real, defect-free printed object image as the image to be processed; image the card without a printed portrait to obtain a second reference image; obtain a large number of real, defect-free sample images to generate a variety of defect samples.

[0110] Step 2: Align the image to be processed with the second reference image. This registration and alignment can be performed using a feature point matching algorithm. To avoid mismatches caused by interference from the printed portrait and improve matching accuracy, feature points in the non-portrait printed area can be selected for matching. The portrait printed area can be obtained by training a portrait segmentation algorithm. The portrait segmentation algorithm segments the image to be processed, obtaining the portrait area. The non-portrait printed area is then removed by removing the portrait area.

[0111] Step 3: Normalize the second reference image so that the average brightness, average hue, and average saturation of the second reference image and the image to be processed in the non-printed areas are equal, thereby obtaining a standardized reference image. For example, the image is first converted from RGB color space to HSV color space. In the HSV color space, the average brightness, average hue, and average saturation of the second reference image and the image to be processed are calculated for the non-portrait printed areas, respectively. The grayscale, hue, and saturation of the second reference image are adjusted so that the average brightness, average hue, and average saturation of the adjusted image are equal to those of the image to be processed, respectively. Finally, the image is converted back from HSV space to RGB space. The adjusted image is the standardized reference image.

[0112] Step 4, converting the standardized reference image and the image to be processed into the CMY color space;

[0113] Step 5: Calculate the difference between the normalized image and the image to be processed in a single color channel according to the following formula;

[0114] ;

[0115] According to the above formula, the amount of printing ink required to be added to C, M and Y from the standardized reference image to the image to be processed can be accurately estimated. , i∈{C,M,Y}, so as to facilitate the subsequent removal or attenuation of the printing ink volume to simulate printing omissions or printing color deviation defects.

[0116] Step 6, setting the printing defect area;

[0117] Step 7: For the defect area, generate the first defect sample according to the following formula:

[0118] ;

[0119] is the first defective sample, Is an indicative function that produces 1 with probability p and 0 otherwise. is the first attenuation coefficient, which is a random number in the interval [0,1]. hour, The value of is equal to Ri, which is equivalent to the value before printing text or image, so as to simulate the printing missing sample. and hour, , i∈{C,M,Y} represents the attenuation coefficients on the C, M and Y channels respectively, Indicates the amount of printed ink. When the attenuation coefficient is less than 1, it indicates insufficient ink on that channel, thus simulating a printed color shift. If only one of the three channels has an attenuation coefficient less than 1, a single-channel printed color shift can be simulated. If two of the three channels have an attenuation coefficient less than 1, a two-channel printed color shift can be simulated. If all three channels have an attenuation coefficient less than 1, a three-channel printed color shift can be simulated.

[0120] According to the above scheme, print missing samples and print color deviation samples are generated.

[0121] Step 8: For the defect area, generate a second defect sample according to the following formula:

[0122] ;

[0123] is the second attenuation coefficient, which is a random number in the interval [0,1].

[0124] By adopting this technical solution, the ink volume of a single color channel can be directly attenuated without the need for a standardized reference image, making it more suitable for printing areas with light backgrounds. When the area to be printed has a light background (such as a white background) on the second reference image, the printed color deviation samples generated using this solution are more consistent with actual conditions. On the one hand, some errors may occur in the registration and alignment of the processed image and the second reference image. On the other hand, the combined color deviation caused by color distortion during the printing process and interference from the imaging ambient light can affect the color standardization results. These two aspects of printing can lead to errors in the difference value estimation of a single color channel, resulting in artifacts in the generated first defective color deviation sample that do not match the actual defect. The second defect sample generation scheme can avoid this problem.

[0125] Step 9: Convert the defect sample data generated in steps 7 and 8 into RGB color space.

[0126] By employing this technical solution, the second reference image is first registered and aligned with the defect-free image to be processed, and color normalization is performed. The print volume distribution of each color channel is estimated in the CMY color space, and printing defects are simulated using a single-channel print volume attenuation method. After color space conversion, training images containing missing defects and color cast defects are generated. This allows for efficient, automated batch generation of defect samples required for detection model training.

[0127] Optionally, step 6 includes the following sub-steps:

[0128] Step 61: training a portrait segmentation network to segment the portrait area, i.e., the printed area, from the normal sample;

[0129] Step 62: Obtain a defect label from a real defect sample to obtain a label image;

[0130] Step 63: rotating, scaling, and translating the label image to obtain a changed label image;

[0131] Step 64: Intersect the changed label image with the printed area to obtain the defective area.

[0132] By adopting the above technical solution, on the one hand, defect areas with diverse shapes, sizes and positions can be obtained, and on the other hand, the subsequent defect generation area is limited to the printing area, avoiding operations on the non-printing area; by adopting this technical solution, the generated defects are closer to the actual defects.

[0133] In addition, labeled images can also be obtained from data in other fields, such as road segmentation datasets, to generate linear missing defect samples similar to those caused by ribbon wrinkle deformation.

[0134] For grayscale printed portraits, a print missing defect sample can be generated by limiting the characteristic function in the first defect sample generation formula to 0.

[0135] After generating a sufficient number of defect samples, the generated samples and real samples are used together to train the printing defect detection model. The specific technical solution is as follows:

[0136] A printing defect detection method comprises the following steps:

[0137] In step a, an object detector is trained using defect data generated by a printing defect data generation method and real defect data. The object detector is used to detect defective objects. For example, the YOLO series of object detection algorithms can be trained with a large amount of generated defect data, and then fine-tuned using the generated data and real data. The ratio of generated data to real data during fine-tuning can be 1:1, and there is no restriction here.

[0138] In step b, a defect object segmentor is trained using defect data generated by a printing defect data generation method and real defect data. The defect object segmentor is used to segment defect objects. Examples include object segmentation algorithms such as UNet and DeepLab. The segmentor uses an online hard sample mining loss function and focal loss to address class imbalance. Training can be performed first using generated data, followed by fine-tuning based on both the generated data and real data.

[0139] In step c, an anomaly detector is trained using real defect-free data. The anomaly detector is used for anomaly detection. The RealNet algorithm can be used here, or other anomaly detection algorithms can be used.

[0140] Step d, using the generated defect data and formal data and their corresponding first reference images, train a twin classification network for defect classification. The first reference image here is a portrait print manuscript. It is necessary to first align the first reference image with the image to be processed, and then intercept the respective defect areas to form an image pair, which is input into the twin classification network for training. With the help of the information of the first reference image, false alarms can be reduced. For example, black impurities on a person's face are easily confused with black moles on the face. They cannot be distinguished based on defect target detectors, defect target segmenters or anomaly detectors alone, but with the help of the first reference image, these two situations can be distinguished. For example, buttons or fine textures on clothes can easily cause false alarms in defect target detectors, defect target segmenters or anomaly detectors. Using a twin network to introduce the information of the first reference image can reduce such false alarms.

[0141] In step e, the real test data is subjected to target detection, target segmentation or anomaly detection using the trained target detector, defect target segmentor or anomaly detector to obtain candidate defect areas.

[0142] In step f, the corresponding region of the candidate defect region on the first reference image is obtained and fed into the twin classification network for classification to determine whether the candidate region is a defect. The twin network can use a ResNet as the backbone network, combined with an attention mechanism module and a fully connected layer for classification, without limitation here.

[0143] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating printing defect data, characterized in that: The following steps are involved: Step 1: obtaining a true, defect-free printed object image as a to-be-processed image, and obtaining a printed object image containing only a background without printed text or images as a second reference image; Step 2: align the image to be processed and the second reference image; Step 3: normalize the second reference image so that the average brightness, average hue, and average saturation of the second reference image and the image to be processed in the non-printing area are equal, thereby obtaining a standardized reference image; Step 4, converting the standardized reference image and the image to be processed into the CMY color space; Step 5, calculating the difference between the normalized reference image and the image to be processed in a single color channel; Step 6, setting the printing defect area; Step 7: For the defect area, generate a first defect sample based on the standardized reference image on a single color channel and linear weighting of the difference value; Step 8: For the defect area, generate a second defect sample based on the pixel value of the image to be processed on a single color channel multiplied by the second attenuation coefficient; Step 9: Convert the defect sample data generated in steps 7 and 8 into RGB color space.

2. The method for generating printing defect data according to claim 1, wherein: The formula for calculating the difference value in step 5 is: ; is the difference between the normalized reference image and the image to be processed on a single color channel, , , i∈{C,M,Y} represents the C, M and Y channels of the image to be processed and the normalized reference image respectively.

3. The method for generating printing defect data according to claim 1, wherein: Step 6 includes the following sub-steps: Step 61: training an object segmentation network to segment the printed area from the normal sample; Step 62: Obtain a defect label from a real defect sample to obtain a label image; Step 63: rotating, scaling, and translating the label image to obtain a changed label image; Step 64: Intersect the changed label image with the printed area to obtain the defective area.

4. The method for generating printing defect data according to claim 1, wherein: In step 7, the first defect sample is generated according to the following formula: ; is the first defective sample, Is an indicative function that produces 1 with probability p and 0 otherwise. is the first attenuation coefficient, which is a random number in the interval [0,1]. When , the generated sample is a printed missing sample; when and , a printed color cast sample is generated.

5. The method for generating printing defect data according to claim 1, wherein: In step 8, the second defect sample is generated according to the following formula: ; is the second attenuation coefficient, which is a random number in the interval [0,1], T i , i∈{C,M,Y} represents the C, M and Y channels of the image to be processed.

6. A printing defect detection method, characterized in that: The following steps are involved: Step a, using the defect data generated by the printing defect data generation method according to any one of claims 1 to 5 and real defect data to train a target detector, the target detector being used to detect defective targets; Step b, using the defect data generated by the printing defect data generation method according to any one of claims 1 to 5 and real defect data to train a defect target segmentor, wherein the defect target segmentor is used to segment defect targets; Step c: using real defect-free data to train an anomaly detector, the anomaly detector is used for anomaly detection; Step d: training a twin classification network for defect classification using the defect data generated by the printing defect data generation method according to any one of claims 1 to 5, the actual defect data, and a first reference image corresponding to the defect data; the first reference image is a printed original; In step e, the real test data is subjected to target detection, target segmentation or anomaly detection using the trained target detector, defect target segmentor or anomaly detector to obtain candidate defect areas.

7. The printing defect detection method according to claim 6, characterized in that: The method also includes step f, obtaining the corresponding area of ​​the candidate defect area on the first reference image, and sending it to the twin classification network for classification to determine whether the candidate defect area is a defect.

8. A printing defect detection device, characterized in that: The invention comprises an imaging device, a storage medium, and a processor, wherein the imaging device is used to obtain an image of a printed matter to be detected, the storage medium stores a reference image and a detection program designed using a printing defect detection method according to claim 6 or 7, the storage medium communicates with the imaging device to exchange the image of the printed matter to be detected, the processor is communicatively connected to the storage medium, inputs the image of the printed matter to be detected into the detection program, runs the detection program to output a printing defect detection result, and stores the printing defect detection result in the storage medium.

9. The printing defect detection device according to claim 8, characterized in that: It also includes a display device, which is communicatively connected to the storage medium and is used to display the printing defect detection results.

Citation Information

Patent Citations

  • General printing defect detection method based on deep learning and model thereof

    CN111709909A

  • Printing defect detection method, device and equipment and storage medium

    CN118446950A