Target detection-based printed matter tiny defect identification method
By combining a target detection-based method with a feature extraction network and a localization and classification network, the problem of accurately identifying minute defects in printed materials was solved, achieving fast and accurate defect detection and improving detection efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies struggle to accurately identify minute defects in printed materials against complex backgrounds, resulting in low detection efficiency and susceptibility to subjective factors.
A target detection-based approach is adopted, which uses a feature extraction network and a localization and classification network, combined with cosine similarity and residual structure, to quickly screen out regions that may have defects, and then uses a target detection algorithm to accurately locate and classify them.
It enables rapid and accurate location and classification of minor defects in printed materials, improving detection accuracy and stability, reducing computational workload, and enhancing production efficiency and cost optimization.
Smart Images

Figure CN121685409A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing methods, specifically relating to a method for identifying minute defects in printed materials based on target detection. Background Technology
[0002] In the modern printing industry, high-end printed packaging products are increasingly becoming a part of people's lives. These products have extremely stringent quality requirements for printed materials; even the slightest defect can affect the product's appearance. Traditional manual inspection suffers from low efficiency and high labor intensity. As inspection time increases, it can lead to visual fatigue among inspectors. Furthermore, manual quality inspection is susceptible to subjective factors and struggles to consistently maintain stable inspection standards. Therefore, there is a need to develop automated and intelligent visual inspection technologies.
[0003] Current methods for identifying defects based on techniques such as threshold segmentation, edge detection, and template matching suffer from limitations in capturing precise defect targets, especially when dealing with complex printed patterns and varied textures. These methods often fail to accurately identify defects because the defect area represents a small percentage of the total area of a large-format printed product.
[0004] This invention provides a method for identifying minute defects in printed materials based on target detection, which can identify minute defects in printed materials and ensure the output quality of printed materials. Summary of the Invention
[0005] The purpose of this invention is to provide a method for identifying minute defects in printed materials based on target detection, thereby solving the problem that existing methods are unable to accurately capture defect targets.
[0006] The technical solution adopted in this invention is a method for identifying minor defects in printed materials based on target detection. The specific process is as follows: images of printed samples and printed materials to be detected are collected, and all images are preprocessed. The preprocessed images are input into a feature extraction network for processing. The output features are sequentially subjected to average pooling, convolutional dimensionality reduction, flattening, and cosine similarity calculation to obtain a feature map containing defects. The feature map containing defects is input into a localization and classification network for processing to obtain the detection result.
[0007] The invention is further characterized by: The specific steps are as follows: Step 1: Acquire images of the printed sample and the printed matter to be inspected, and preprocess all images to obtain a color image of the printed sample and a color block image of the printed matter to be inspected; Step 2: Input the color image of the printed sample and the color image of the printed matter to be inspected obtained in Step 1 into the feature extraction network to obtain the feature map of the printed sample after processing and the feature map of the printed matter to be inspected after processing. Step 3: Perform average pooling, convolution dimensionality reduction, flattening, and cosine similarity calculation operations on the feature map of the printed sample obtained in Step 2 and the feature map of the printed matter to be detected, respectively, to obtain n cosine similarity values. Step 4: Arrange the n cosine similarity values obtained in Step 3 in the order of number 0 to n, and take the features with cosine similarity values less than 0.5 as the feature map containing the defect. Step 5: Input the feature map containing defects obtained in Step 4 into the localization and classification network to obtain the detection results.
[0008] In step 1, the preprocessing process is as follows: If the collected print sample images are traversed in a window order from left to right and from top to bottom, each window will produce a color print sample image of the same size. If the collected images of the printed matter to be inspected are traversed in a window order from left to right and from top to bottom, then each window will produce a color block image of the printed matter to be inspected that is of equal size.
[0009] In step 2, the feature extraction network consists of convolutional layers, batch normalization, activation layers, and five residual structures A. The processing procedure of the feature extraction network is as follows: Step 2.1: Perform convolution operations with a kernel size of 3×3 on the color image of the printed sample and the color block image of the printed matter to be detected obtained in Step 1 to obtain the features of the printed sample and the features of the printed matter to be detected. Step 2.2: Perform batch standardization operations on the printed sample features and the printed matter features to be inspected obtained in Step 2.2 to obtain the standardized features of the printed sample and the standardized features of the printed matter to be inspected. Step 2.3: Apply the Mish activation function to the standardized features of the printed sample and the standardized features of the printed matter to be tested obtained in Step 2.2 to obtain the activation features of the printed sample and the activation features of the printed matter to be tested. Step 2.4: Perform five residual structure A processing on the activated features of the printed sample and the activated features of the printed matter to be inspected to obtain the processed feature map of the printed sample and the processed feature map of the printed matter to be inspected.
[0010] The processing procedure for each residual structure A is as follows: the input features are convolved with a kernel size of 3×3 and a stride of 2 to obtain feature A1. Feature A1 is divided into two paths. One path is convolved with a kernel size of 1×1 to output result A1. The other path is convolved with a kernel size of 1×1 to output result B1. Result B1 is processed by n small residual structures A to obtain result C1. Result C1 is convolved with a kernel size of 3×3 to output result D1. Result A1 and result D1 are stacked by channel and then convolved with a kernel size of 3×3 to output feature Nj, j=0,1,2,3,4. The processing of the first small residual structure A is as follows: Result B1 is first subjected to a convolution operation with a kernel size of 1×1, and then a convolution operation with a kernel size of 3×3. The output result is stacked with Result B1 according to the channel to obtain the output result of the first small residual structure A. The processing steps for the second small residual structure A to the nth small residual structure are as follows: first, perform a convolution operation with a kernel size of 1×1 on the output of the previous small residual structure A, then perform a convolution operation with a kernel size of 3×3, and stack the output of the previous small residual structure A with the output of the previous small residual structure A by channel to obtain the output of the current small residual structure A. The first residual structure A contains 1 small residual structure A, the second residual structure A contains 2 small residual structures A, the third residual structure A contains 8 small residual structures A, the fourth residual structure A contains 8 small residual structures A, and the fifth residual structure A contains 4 small residual structures A. The inputs to the first residual structure A are the activation features of the printed sample and the activation features of the printed matter to be detected; the output feature N0 of the first residual structure A is used as the input feature of the second residual structure A; the output feature N1 of the second residual structure A is used as the input feature of the third residual structure A; the output feature N2 of the third residual structure A is used as the input feature of the fourth residual structure A; and the output feature N3 of the fourth residual structure A is used as the input feature of the fifth residual structure A.
[0011] The specific process of step 3 is as follows: Step 3.1: Perform average pooling operations on the feature map of the printed sample after processing and the feature map of the printed matter to be inspected obtained in Step 2, respectively, to obtain the feature map of the printed sample after pooling and the feature map of the printed matter to be inspected after pooling. Step 3.2: Perform a convolution operation with a kernel size of 1×1 on the pooled feature map of the printed sample and the pooled feature map of the printed matter to be detected obtained in Step 3.1 to obtain the convolutioned feature map of the printed sample and the convolutioned feature map of the printed matter to be detected. Step 3.3: Flatten the convolutional feature map of the printed sample and the convolutional feature map of the printed matter to be detected obtained in Step 3.2 to obtain a feature vector set A containing n feature vectors of the printed sample and a feature vector set B containing n feature vectors of the printed matter to be detected. Step 3.4: Perform cosine similarity calculation on the feature vector set A and feature vector set B obtained in step 3.3 to obtain n cosine similarity values.
[0012] In step 5, the localization and classification network consists of convolutional layers, normalization layers, activation function layers, four residual structures B, and three decoupling heads; The processing procedure of the localization and classification network is as follows: Step 5.1: Perform a convolution operation with a kernel size of 3×3 on the feature map containing defects obtained in Step 4 to obtain the convolutional features; Step 5.2: Perform batch normalization on the convolutional features obtained in Step 5.1 to obtain normalized features; Step 5.3: Activate the normalized features obtained in Step 5.2 using the Mish activation function to obtain the activated features; Step 5.4: The activation features obtained in step 5.3 are processed through four residual structures B to obtain the enhanced effective features F1, F2, and F3. Step 5.5: Perform multi-scale feature fusion on features F1, F2, and F3 obtained in step 5.4 to obtain output features F321, F23, and F; Step 5.6: Input the downsampled result of feature F321, the downsampled result of feature F23, and feature F into a decoupling head to obtain the location of the defect target in the printed matter to be detected and the size of the candidate box.
[0013] In step 5.4, the processing procedure for each residual structure B is as follows: the input features are subjected to a convolution operation with a kernel size of 3×3 and a stride of 2 to obtain feature A2. Feature A2 is divided into two paths. One path is subjected to a convolution operation with a kernel size of 1×1 to output result A2. The other path is subjected to a convolution operation with a kernel size of 1×1 to output result B2. Result B2 is processed by n small residual structures B to obtain result C2. Result C2 is subjected to a convolution operation with a kernel size of 3×3 to output result D2. Result A2 and result D2 are stacked by channel and then subjected to a convolution operation with a kernel size of 3×3 to output feature Fi, i=0,1,2,3. The processing of the first small residual structure B is as follows: the result B2 is first convolved with a kernel size of 1×1, and then convolved with a kernel size of 3×3. The output result is stacked with the result B2 according to the channel to obtain the output result of the first small residual structure B. The processing steps for the second small residual structure B to the nth small residual structure B are as follows: first, perform a convolution operation with a kernel size of 1×1 on the output of the previous small residual structure B, then perform a convolution operation with a kernel size of 3×3, and stack the output of the previous small residual structure B with the output of the previous small residual structure B by channel to obtain the output of the current small residual structure B. The first residual structure B contains 2 smaller residual structures B, the second residual structure B contains 8 smaller residual structures B, the third residual structure B contains 8 smaller residual structures B, and the second residual structure B contains 4 smaller residual structures B. The input to the first residual structure B is the activation feature obtained in step 5.3; the output feature F0 of the first residual structure B is used as the input to the second residual structure B; the output feature F1 of the second residual structure B is used as the input to the third residual structure B; and the output feature F2 of the third residual structure B is used as the input to the fourth residual structure B.
[0014] The specific process of step 5.5 is as follows: Feature F3 is upsampled and stacked with feature F2 by channel to obtain feature F32. Feature F32 is upsampled and stacked with feature F1 by channel to obtain feature F321. Feature F321 is downsampled and stacked with feature F32 by channel to obtain feature F23. Feature F23 is downsampled and stacked with feature F3 by channel to obtain feature F.
[0015] In step 5.6, the processing procedure for each decoupling head is as follows: the input is processed by the first convolution module and then divided into two paths. The first path is processed by the second and third convolution modules in sequence, and the output is the classification cls. The second path is processed by the fourth and fifth convolution modules in sequence and the output is the location reg and whether there is a defective target obj. The first, second, third, fourth, and fifth convolutional modules have the same structure, all consisting of convolutional layers, BN layers, and SiLU activation functions. In the first convolutional module, the kernel size of the convolutional layer is 3×3 and the stride is 2. In the second and fourth convolutional modules, the kernel size of the convolutional layer is 3×3 and the stride is 1. In the third and fifth convolutional modules, the kernel size of the convolutional layer is 1×1 and the stride is 1.
[0016] The beneficial effects of this invention are as follows: This invention's method for identifying minute defects in printed materials based on target detection can quickly detect minute defects in large-format, high-end printed packaging products. It uses cosine similarity for preliminary feature screening to identify approximate areas where printing defects may exist, significantly reducing computational workload for subsequent defect localization and classification. Furthermore, through target detection algorithms and deep fusion of residual structural features, it extracts feature information helpful for defect detection, enabling rapid localization of minute defects. This method exhibits high detection accuracy and stability, playing a crucial role in improving enterprise production efficiency and cost optimization. Attached Figure Description
[0017] Figure 1 This is a framework diagram of the method for identifying minute defects in printed materials based on target detection according to the present invention; Figure 2 This is a schematic diagram of the feature extraction network in the method of the present invention; Figure 3 This is a schematic diagram of the residual structure in the localization and classification network in the method of the present invention; Figure 4 This is a schematic diagram of the decoupling head in the method of the present invention. Detailed Implementation
[0018] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0019] Example 1 This invention relates to a method for identifying minute defects in printed materials based on target detection, such as... Figure 1 As shown, the specific steps are as follows: Step 1: Collect images of the printed sample (signed sample, no defects) and the printed matter to be inspected, and preprocess all images to obtain a color image of the printed sample and a color block image of the printed matter to be inspected; The preprocessing process is as follows: If the collected print sample images are traversed in a window order from left to right and from top to bottom, each window will produce a 608×608×3 color print sample image. If the collected images of the printed matter to be inspected are traversed in a window order from left to right and from top to bottom, each window will produce a 608×608×3 color block image of the printed matter to be inspected. The window size is 608×608. Step 2: Input the color image of the printed sample and the color image of the printed matter to be inspected obtained in Step 1 into the feature extraction network to obtain the feature map of the printed sample after processing and the feature map of the printed matter to be inspected after processing. like Figure 2As shown, the feature extraction network consists of convolutional layers, batch normalization, activation layers, and five residual structures A, which are used for the extraction and fusion enhancement of image features. The specific process is as follows: Step 2.1: Perform a convolution operation with a kernel size of 3×3 on the color image of the printed sample and the color block image of the printed matter to be detected obtained in Step 1 to obtain the features of the printed sample and the features of the printed matter to be detected, which are 608×608×32 respectively. Step 2.2: Perform batch standardization operations on the printed sample features and the printed matter features to be inspected obtained in Step 2.2 to obtain the standardized features of the printed sample and the standardized features of the printed matter to be inspected. Among them, the standardized features are all normal distributions with a mean of 0 and a variance of 1, which helps in the subsequent calculation of network gradients; Step 2.3: Apply the Mish activation function to the standardized features of the printed sample and the standardized features of the printed matter to be tested obtained in Step 2.2 to obtain the activation features of the printed sample and the activation features of the printed matter to be tested. The purpose of the Mish activation function is to reduce the workload of gradient calculation, prevent gradient vanishing, and reduce the risk of overfitting to some extent. Step 2.4: Perform five residual structure A processing on the activated features of the printed sample and the activated features of the printed matter to be inspected to obtain the processed feature map of the printed sample and the processed feature map of the printed matter to be inspected. like Figure 3 As shown, the processing procedure for each residual structure A is as follows: the input features are subjected to a convolution operation with a kernel size of 3×3 and a stride of 2 to obtain feature A1. Feature A1 is divided into two paths. One path is subjected to a convolution operation with a kernel size of 1×1 to output result A1. The other path is subjected to a convolution operation with a kernel size of 1×1 to output result B1. Result B1 is processed by n small residual structures A to obtain result C1. Result C1 is subjected to a convolution operation with a kernel size of 3×3 to output result D1. Result A1 and result D1 are stacked by channel and then subjected to a convolution operation with a kernel size of 3×3 to output feature Nj, j=0,1,2,3,4. The processing of the first small residual structure A is as follows: Result B1 is first subjected to a convolution operation with a kernel size of 1×1, and then a convolution operation with a kernel size of 3×3. The output result is stacked with Result B1 according to the channel to obtain the output result of the first small residual structure A. The processing steps for the second small residual structure A to the nth small residual structure are as follows: first, perform a convolution operation with a kernel size of 1×1 on the output of the previous small residual structure A, then perform a convolution operation with a kernel size of 3×3, and stack the output of the previous small residual structure A with the output of the previous small residual structure A by channel to obtain the output of the current small residual structure A. The first residual structure A contains 1 small residual structure A, the second residual structure A contains 2 small residual structures A, the third residual structure A contains 8 small residual structures A, the fourth residual structure A contains 8 small residual structures A, and the fifth residual structure A contains 4 small residual structures A. The inputs to the first residual structure A are the activation features of the printed sample and the activation features of the printed matter to be inspected. The output feature N0 of the first residual structure A has a size of 304×304×64. The output feature N0 of the first residual structure A serves as the input feature of the second residual structure A, and the output feature N1 of the second residual structure A has a size of 152×152×128. The output feature N1 of the second residual structure A serves as the input feature of the third residual structure A, and the output feature N2 of the third residual structure A has a size of 76×76×256. The output feature N2 of the third residual structure A serves as the input to the fourth residual structure A, and the output feature N3 of the fourth residual structure A has a size of 38×38×512. The output feature N3 of the fourth residual structure A serves as the input to the fifth residual structure A, and the output feature N4 of the fifth residual structure A (feature map after processing of the printed sample and feature map after processing of the printed matter to be inspected) has a size of 19×19×1024. Step 3: Perform average pooling, convolution dimensionality reduction, flattening, and cosine similarity calculation operations on the feature map of the printed sample obtained in Step 2 and the feature map of the printed matter to be detected, respectively, to obtain n cosine similarity values. The specific process is as follows: Step 3.1: Perform average pooling operations on the feature map of the printed sample after processing and the feature map of the printed matter to be inspected obtained in Step 2, respectively, to obtain the feature map of the printed sample after pooling and the feature map of the printed matter to be inspected after pooling. Step 3.2: Perform a convolution operation with a kernel size of 1×1 on the pooled feature map of the printed sample and the pooled feature map of the printed matter to be detected obtained in Step 3.1 to obtain the convolutioned feature map of the printed sample and the convolutioned feature map of the printed matter to be detected. The purpose of convolution is to reduce the dimensionality of high-dimensional features and the number of channels to 1. Step 3.3: Flatten the convolutional feature map of the printed sample and the convolutional feature map of the printed matter to be detected obtained in Step 3.2 to obtain a feature vector set A containing n feature vectors of the printed sample and a feature vector set B containing n feature vectors of the printed matter to be detected. Step 3.4: Perform cosine similarity calculation on the feature vector set A and feature vector set B obtained in step 3.3 to obtain n cosine similarity values; Step 4: Arrange the n cosine similarity values obtained in Step 3 in the order of number 0 to n, and take the features with cosine similarity values less than 0.5 as the feature map containing the defect. A higher cosine similarity value usually indicates that the two vectors are close to parallel, meaning that the content of the two regions in the image is similar and there are no defects. A lower cosine similarity value usually indicates that the two vectors are close to orthogonal, meaning that the content of the two regions in the image is dissimilar and there may be defects. Step 5: Input the feature map containing defects obtained in Step 4 into the localization and classification network to obtain the detection results; The localization and classification network consists of convolutional layers, normalization layers, activation function layers, four residual structures B, and three decoupling heads; The specific process is as follows: Step 5.1: Perform a convolution operation with a kernel size of 3×3 on the feature map containing defects obtained in step 4 to obtain a convolutional feature with a size of 608×608×32. Step 5.2: Perform batch normalization on the convolutional features obtained in Step 5.1 to obtain normalized features; Normalized data are those with a mean of 0 and a variance of 1 that conform to a normal distribution. Step 5.3: Activate the normalized features obtained in Step 5.2 using the Mish activation function to obtain the activated features; Processing with the Mish activation function can reduce the amount of gradient calculation, prevent gradient vanishing, and reduce the risk of overfitting to a certain extent. The resulting activation features are low-dimensional features containing rich details. Step 5.4: The activation features obtained in step 5.3 are processed through four residual structures B to obtain the enhanced effective features F1, F2, and F3. The processing steps for each residual structure B are as follows: the input features are convolved with a kernel size of 3×3 and a stride of 2 to obtain feature A2. Feature A2 is divided into two paths. One path is convolved with a kernel size of 1×1 to output result A2. The other path is convolved with a kernel size of 1×1 to output result B2. Result B2 is processed by n small residual structures B to obtain result C2. Result C2 is convolved with a kernel size of 3×3 to output result D2. Result A2 and result D2 are stacked by channel and then convolved with a kernel size of 3×3 to output feature Fi, i=0,1,2,3. The processing of the first small residual structure B is as follows: the result B2 is first convolved with a kernel size of 1×1, and then convolved with a kernel size of 3×3. The output result is stacked with the result B2 according to the channel to obtain the output result of the first small residual structure B. The processing steps for the second small residual structure B to the nth small residual structure B are as follows: first, perform a convolution operation with a kernel size of 1×1 on the output of the previous small residual structure B, then perform a convolution operation with a kernel size of 3×3, and stack the output of the previous small residual structure B with the output of the previous small residual structure B by channel to obtain the output of the current small residual structure B. The first residual structure B contains 2 smaller residual structures B, the second residual structure B contains 8 smaller residual structures B, the third residual structure B contains 8 smaller residual structures B, and the second residual structure B contains 4 smaller residual structures B. The input to the first residual structure B is the activation feature obtained in step 5.3, and the output feature F0 of the first residual structure B has a size of 152×152×128; the output feature F0 of the first residual structure B is used as the input to the second residual structure B, and the output feature F1 of the second residual structure B has a size of 76×76×256; the output feature F1 of the second residual structure B is used as the input to the third residual structure B, and the output feature F2 of the third residual structure B has a size of 38×38×512; the output feature F2 of the third residual structure B is used as the input to the fourth residual structure B, and the output feature F3 of the fourth residual structure B has a size of 19×19×1024. Step 5.5: Perform multi-scale feature fusion on features F1, F2, and F3 obtained in step 5.4 to obtain output features F321, F23, and F; The specific process is as follows: Feature F3 is upsampled and stacked with feature F2 by channel to obtain feature F32. Feature F32 is upsampled and stacked with feature F1 by channel to obtain feature F321. Feature F321 is downsampled and stacked with feature F32 by channel to obtain feature F23. Feature F23 is downsampled and stacked with feature F3 by channel to obtain feature F. This process can effectively fuse features, so that the output features can contain both shallow detailed information and deep semantic information. Step 5.6: Input the downsampled result of feature F321, the downsampled result of feature F23, and feature F into a decoupling head to obtain the location of the defect target in the printed matter to be detected and the size of the candidate box.
[0020] Example 2 Based on Example 1, in step 1, a CCD camera is used to acquire images of the printed sample (signed sample, no defects) and the printed matter to be inspected.
[0021] Example 3 Based on Example 2, in step 2.3, the expression for the Mish activation function is: (1) In equation (1), x These are the input parameters, namely the standardized features of the printed sample obtained in step 2.2 and the standardized features of the printed matter to be inspected; tanh is the hyperbolic tangent function; ln is a constant... e A logarithmic function with base 0; e is a natural constant; Mish is the output value of the activation function, i.e., the activation features of the printed sample and the activation features of the printed matter to be detected.
[0022] Example 4 Based on Example 3, in step 3.1, the expression for average pooling is: (2) In equation (2), output This represents the output value, namely the feature map of the printed sample after pooling and the feature map of the printed matter to be inspected after pooling. k This represents the region size of the feature map where average pooling is performed, with a size of [size missing]. k × k ; These are the feature values of the feature map in the i-th row and j-th column.
[0023] Example 5 Based on Example 4, in step 3.4, the expression for cosine similarity is: (3) In equation (3), , ... Represents the eigenvectors in the eigenvector set A; , ... θ represents the eigenvector in the eigenvector set B; θ is the angle between two vectors; || is the absolute value symbol, or the magnitude of the vector.
[0024] Example 6 Based on Example 5, such as Figure 4 As shown, the processing of the three decoupling heads is as follows: the input is processed by the first convolution module and then divided into two paths. The first path is processed by the second and third convolution modules in sequence and outputs the classification cls. The second path is processed by the fourth and fifth convolution modules in sequence and outputs the location reg and whether there is a defective target obj. The first, second, third, fourth, and fifth convolutional modules have the same structure, all consisting of convolutional layers, BN layers, and SiLU activation functions. In the first convolutional module, the kernel size of the convolutional layer is 3×3 and the stride is 2. In the second and fourth convolutional modules, the kernel size of the convolutional layer is 3×3 and the stride is 1. In the third and fifth convolutional modules, the kernel size of the convolutional layer is 1×1 and the stride is 1.
[0025] This invention provides a method for identifying minute defects in printed materials based on target detection. It overcomes the challenges of easily missing minute defects and significant interference from complex backgrounds, enabling rapid, accurate, and robust localization and classification of minute defects in printed materials.
Claims
1. A method for identifying a minute defect of a printed matter based on target detection, characterized by, The specific process is: collecting the image of the printed manuscript and the printed matter to be detected, and pre-processing all the images, inputting the pre-processed images into a feature extraction network for processing, sequentially performing average pooling, convolution dimension reduction, flattening, and cosine similarity calculation on the output features to obtain a feature map containing defects, and inputting the feature map containing defects into a positioning classification network for processing to obtain a detection result.
2. The target detection-based printed matter micro-defect recognition method according to claim 1, characterized in that, The specific steps are as follows: Step 1, collect the image of the printed manuscript and the printed matter to be detected, and pre-process all the images to obtain a printed manuscript color image and a printed matter color block image to be detected; Step 2, input the printed manuscript color image and the printed matter color block image obtained in step 1 into a feature extraction network to obtain a printed manuscript processed feature map and a printed matter processed feature map to be detected; Step 3, sequentially perform average pooling, convolution dimension reduction, flattening, and cosine similarity calculation on the printed manuscript processed feature map and the printed matter processed feature map obtained in step 2 to obtain n cosine similarities; Step 4, arrange the n cosine similarity values in order of sequence number 0~n, and take the feature with a cosine similarity value less than 0.5 as a feature map containing defects; Step 5, input the feature map containing defects obtained in step 4 into a positioning classification network to obtain a detection result.
3. The target detection-based printed matter micro-defect recognition method according to claim 2, characterized in that, In step 1, the pre-processing process is: The collected printed manuscript image is windowed in the order of left to right and top to bottom, and each window obtains a printed manuscript color image of equal size; The collected printed matter image to be detected is windowed in the order of left to right and top to bottom, and each window obtains a printed matter color block image to be detected of equal size.
4. The target detection-based printed matter micro-defect recognition method according to claim 2, characterized in that, In step 2, the feature extraction network is composed of a convolution layer, a batch normalization, an activation layer, and five residual structure A's; The processing process of the feature extraction network is: Step 2.1, perform convolution operation with a convolution kernel size of 3x3 on the printed manuscript color image and the printed matter color image obtained in step 1 to obtain printed manuscript features and printed matter features to be detected; Step 2.2, perform batch normalization operation on the printed manuscript features and the printed matter features to be detected obtained in step 2.2 to obtain printed manuscript standardized features and printed matter standardized features to be detected; Step 2.3, perform Mish activation function processing on the printed manuscript standardized features and the printed matter standardized features to be detected obtained in step 2.2 to obtain printed manuscript activation features and printed matter activation features to be detected; Step 2.4, perform 5 residual structure A processing on the printed manuscript activation features and the printed matter activation features to be detected to obtain a printed manuscript processed feature map and a printed matter processed feature map to be detected.
5. The target detection-based printed matter micro-defect recognition method according to claim 4, characterized in that, The processing procedure of each residual structure A is: performing convolution operation on the input feature with a convolution kernel size of 3*3 and a step of 2 to obtain feature A1, dividing feature A1 into two paths, performing convolution operation on one path with a convolution kernel size of 1*1 to output result A1, performing convolution operation on the other path with a convolution kernel size of 1*1 to output result B1, performing n small residual structure A processing on result B1 to obtain result C1, performing convolution operation on result C1 with a convolution kernel size of 3*3 to output result D1, stacking result A1 and result D1 according to channels, and performing convolution operation on the stacked result with a convolution kernel size of 3*3 to output feature Nj, j=0, 1, 2, 3, 4; The processing procedure of the first small residual structure A is: performing convolution operation on result B1 with a convolution kernel size of 1*1, and then performing convolution operation on the result with a convolution kernel size of 3*3, and stacking the output result and result B1 according to channels to obtain the output result of the first small residual structure A; The processing procedure of the second small residual structure A to the n-th small residual structure is: performing convolution operation on the output result of the previous small residual structure A with a convolution kernel size of 1*1, and then performing convolution operation on the result with a convolution kernel size of 3*3, and stacking the output result and the output result of the previous small residual structure A according to channels to obtain the output result of the current small residual structure A; There is 1 small residual structure A in the first residual structure A, there are 2 small residual structures A in the second residual structure A, there are 8 small residual structures A in the third residual structure A, there are 8 small residual structures A in the fourth residual structure A, and there are 4 small residual structures A in the fifth residual structure A; The input of the first residual structure A is the printed manuscript activation feature and the to-be-detected printed matter activation feature; the output feature N0 of the first residual structure A is used as the input feature of the second residual structure A; the output feature N1 of the second residual structure A is used as the input feature of the third residual structure A; the output feature N2 of the third residual structure A is used as the input of the fourth residual structure A; and the output feature N3 of the fourth residual structure A is used as the input of the fifth residual structure A.
6. The target detection-based printed matter micro-defect recognition method according to claim 2, characterized in that, The specific process of step 3 is: Step 3.1: performing average pooling operation on the printed manuscript processed feature map and the to-be-detected printed matter processed feature map obtained in step 2 to obtain a printed manuscript pooled feature map and a to-be-detected printed matter pooled feature map; Step 3.2: performing convolution operation on the printed manuscript pooled feature map and the to-be-detected printed matter pooled feature map obtained in step 3.1 with a convolution kernel size of 1*1 to obtain a printed manuscript convolution feature map and a to-be-detected printed matter convolution feature map; Step 3.3: performing flattening operation on the printed manuscript convolution feature map and the to-be-detected printed matter convolution feature map obtained in step 3.2 to obtain a feature vector set A containing n printed manuscript feature vectors and a feature vector set B containing n to-be-detected printed matter feature vectors; Step 3.4: performing cosine similarity calculation on the feature vector set A and the feature vector set B obtained in step 3.3 to obtain n cosine similarity values.
7. The target detection-based printed matter micro-defect recognition method according to claim 2, characterized in that, In step 5, the positioning classification network is composed of a convolutional layer, a normalization layer, an activation function layer, four residual structure B, and three decoupling heads; The processing process of the positioning classification network is as follows: Step 5.1, the feature map containing defects obtained in step 4 is subjected to a convolution operation with a convolution kernel size of 3*3 to obtain a convolution feature; Step 5.2, the convolution feature obtained in step 5.1 is subjected to batch normalization to obtain a normalized feature; Step 5.3, the normalized feature obtained in step 5.2 is activated by a Mish activation function to obtain an activated feature; Step 5.4, the activated feature obtained in step 5.3 is processed through four residual structure B to obtain enhanced effective features F1, F2 and F3; Step 5.5, the features F1, F2 and F3 obtained in step 5.4 are subjected to multi-scale feature fusion to obtain output features F321, F23 and F; Step 5.6, the results of down-sampling the features F321, F23 and F are respectively input into a decoupling head to obtain the position of the defect target in the printed matter to be detected and the size of the candidate frame.
8. The target detection-based printed matter micro-defect identification method according to claim 7, characterized in that, In step 5.4, the processing process of each residual structure B is as follows: the input feature is subjected to a convolution operation with a convolution kernel size of 3*3 and a step size of 2 to obtain a feature A2, the feature A2 is divided into two paths, one path is subjected to a convolution operation with a convolution kernel size of 1*1 to output a result A2, the other path is subjected to a convolution operation with a convolution kernel size of 1*1 to output a result B2, the result B2 is processed through n small residual structures B to obtain a result C2, the result C2 is subjected to a convolution operation with a convolution kernel size of 3*3 to output a result D2, the results A2 and D2 are stacked according to the channel and then subjected to a convolution operation with a convolution kernel size of 3*3 to output a feature Fi, i=0,1,2,3; In step 5.4, the processing process of each residual structure B is as follows: the input feature is subjected to a convolution operation with a convolution kernel size of 3*3 and a step size of 2 to obtain a feature A2, the feature A2 is divided into two paths, one path is subjected to a convolution operation with a convolution kernel size of 1*1 to output a result A2, the other path is subjected to a convolution operation with a convolution kernel size of 1*1 to output a result B2, the result B2 is processed through n small residual structures B to obtain a result C2, the result C2 is subjected to a convolution operation with a convolution kernel size of 3*3 to output a result D2, the results A2 and D2 are stacked according to the channel and then subjected to a convolution operation with a convolution kernel size of 3*3 to output a feature Fi, i=0,1,2,3; The processing process of the first small residual structure B is as follows: the result B2 is subjected to a convolution operation with a convolution kernel size of 1*1, and then subjected to a convolution operation with a convolution kernel size of 3*3, and the output result is stacked with the result B2 according to the channel to obtain the output result of the first small residual structure B; The processing process of the second small residual structure B to the nth small residual structure B is as follows: the output result of the previous small residual structure B is subjected to a convolution operation with a convolution kernel size of 1*1, and then subjected to a convolution operation with a convolution kernel size of 3*3, and the output result is stacked with the output result of the previous small residual structure B according to the channel to obtain the output result of the current small residual structure B; The small residual structures B in the first residual structure B are two, the small residual structures B in the second residual structure B are eight, the small residual structures B in the third residual structure B are eight, and the small residual structures B in the second residual structure B are four; The input of the first residual structure B is the activated feature obtained in step 5.3; the output feature F0 of the first residual structure B is used as the input of the second residual structure B; the output feature F1 of the second residual structure B is used as the input of the third residual structure B; and the output feature F2 of the third residual structure B is used as the input of the fourth residual structure B.
9. The target detection-based printed matter micro-defect recognition method according to claim 7, characterized in that, The specific process of step 5.5 is as follows: After upsampling the feature F3, the feature F3 is stacked with the feature F2 in the channel to obtain a feature F32, the feature F32 is stacked with the feature F1 in the channel after upsampling the feature F32 to obtain a feature F321, the feature F321 is stacked with the feature F32 in the channel after downsampling the feature F321 to obtain a feature F23, and the feature F23 is stacked with the feature F3 in the channel after downsampling the feature F23 to obtain a feature F.
10. The target detection-based printed matter micro-defect recognition method according to claim 7, characterized in that, In step 5.6, the processing process of each decoupling head is as follows: after being processed by the first convolution module, the input is divided into two paths, the first path is sequentially processed by the second convolution module, the third convolution module, and outputs the classification cls, and the second path is sequentially processed by the fourth convolution module and the fifth convolution module, and outputs the positioning reg and whether there is a defective target obj; The first convolution module, the second convolution module, the third convolution module, the fourth convolution module and the fifth convolution module have the same structure and are composed of a convolution layer, a BN layer and a SiLU activation function. Among them, the convolution kernel size of the convolution layer in the first convolution module is 3*3, and the step is 2, the convolution kernel size of the convolution layer in the second convolution module and the fourth convolution module is 3*3, and the step is 1, and the convolution kernel size of the convolution layer in the third convolution module and the fifth convolution module is 1*1, and the step is 1.