Printing quality defect detection method and storage medium
Through the combination of feature extraction network and fully connected network, the problem of few printing quality detection types and low accuracy in the existing technology is solved, and high-accuracy detection of complex graphic labels is achieved.
Patent Information
- Application Number
- CN202110417370.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-04-19
AI Technical Summary
Existing printing quality defect detection methods based on template matching have few detection types and are difficult to improve accuracy. In particular, the detection effect for complex graphic labels is poor and the misjudgment rate is high.
The feature extraction network is used to perform feature extraction and related operations on the image to be detected and the template image. Through the fusion of relevant semantic feature data and multi-scale features, the fully connected network is input to determine printing quality defects. The feature extraction network with shared weights reduces the dependence on experience. And improve the adaptability of detection.
It improves the accuracy and adaptability of printing quality defect detection, reduces the misjudgment rate, can effectively detect a variety of printing defects, and is suitable for complex graphic labels.
Smart Images

Figure CN113034492B
Abstract
Description
Technical Field
[0001] The invention relates to the field of machine vision, and in particular to a printing quality defect detection method and a storage medium. Background Art
[0002] Printed labels are widely used as product identification. They can record key product information, thus becoming an effective carrier for enterprises to track products, monitor quality and manage production. They can also be used as an effective tool for ordinary consumers to check products. Currently, most product labels are printed by printing machines. In the modern fast printing production process, various printing defects and errors are difficult to avoid due to many uncertain factors such as production process, environment and equipment. Common printing quality defects include poor printing, blur, screen printing offset and skew, fat oil, missing characters, dark, bright, pitting / white spots, burrs, continuous ink / blocked ink, slight screen printing color difference, etc. Figures 1 to 8 As shown. Unqualified printed labels flowing into the market with products will inevitably cause losses to manufacturers and trouble to consumers. Therefore, the quality inspection of printed labels has become increasingly valued by manufacturers. The automated inspection system based on machine vision has the advantages of fast inspection speed and high accuracy, which can effectively reduce the labor costs of manufacturers and has become an industry trend.
[0003] At present, most of the printing quality defect detection methods based on machine vision are based on template matching. This method matches the image to be detected with the template image without printing quality defects for similarity. When the similarity is small, it is determined that the image to be detected has printing quality defects. The detection method based on template matching is a global detection method, which is easily affected by noise. It has a good detection effect for labels with relatively simple content, but for labels that contain complex graphics such as logo graphics, illustrative case graphics, barcode graphics, and character graphics, the importance of the graphics in the label is not completely related to the size of the graphics. The commonly used detection method based on template matching does not set different weights for the corresponding areas in the image or use different methods for detection according to the importance of different graphics, which often leads to a high misjudgment rate.
[0004] The main method currently used in the industry is the golden template matching method, which first determines the moving position and deflection direction of the image to be detected relative to the template image, calculates the transformation parameters of the rigid transformation that aligns the image to be detected with the template image, transforms the image to be detected according to the transformation parameters to align it with the template image, and then compares the image to be detected with the template image pixel by pixel, or compares the regional features after Blob analysis to determine whether the image to be detected has printing quality defects. The above method has the following defects: (1) When transforming the image to be detected, it is necessary to ensure a high positioning accuracy. If position offset occurs, the probability of false detection will be greatly increased when comparing the image to be detected with the template image pixel by pixel; (2) The types of defects that can be detected are relatively small, and only defects such as screen printing offset and skew can be detected among the above defects. It cannot achieve ideal results for other types of defects and is difficult to apply to actual industrial production processes. Summary of the invention
[0005] The present application provides a printing quality defect detection method and a computer-readable storage medium, aiming to solve the problem that the existing printing quality defect detection method has a small number of detection types and is difficult to improve the accuracy.
[0006] According to the first aspect, an embodiment provides a printing quality defect detection method, comprising:
[0007] Acquire an image to be inspected and a template image without printing quality defects;
[0008] Inputting the image to be detected and the template image into respective feature extraction networks to obtain a feature map of the image to be detected and a feature map of the template image;
[0009] Performing a correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map, and using the correlation operation result map as a correlation feature map;
[0010] Performing feature extraction on the relevant feature graph to obtain relevant semantic feature data, and performing multi-scale feature fusion on the relevant feature graph to obtain segmentation semantic feature data;
[0011] The relevant semantic feature data and the segmented semantic feature data are fused and input into a fully connected network to obtain a decision vector;
[0012] It is determined whether the image to be inspected has a printing quality defect according to the decision vector.
[0013] According to the second aspect, an embodiment provides a printing quality defect detection method, comprising:
[0014] Acquire an image to be inspected and a template image without printing quality defects;
[0015] Inputting the image to be detected and the template image into respective feature extraction networks to obtain a feature map of the image to be detected and a feature map of the template image;
[0016] Performing a correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map;
[0017] After convolution and activation processing, the template image feature map is fused with the relevant operation result map to obtain a relevant feature map, feature extraction is performed on the relevant feature map to obtain relevant semantic feature data, and multi-scale feature fusion is performed on the relevant feature map to obtain segmentation semantic feature data;
[0018] The relevant semantic feature data and the segmented semantic feature data are fused and input into a fully connected network to obtain a decision vector;
[0019] It is determined whether the image to be inspected has a printing quality defect according to the decision vector.
[0020] In one embodiment, the performing of a correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map includes:
[0021] For each point x1(x 1x ,x 1y ), calculate the feature vector at this point and the feature map of the image to be detected in the range [x 1x -d,x 1x +d]×[x 1y -d,x 1y +d], the cosine similarity of the feature vectors at each point in the (2d+1) 2 The calculation results constitute a related feature vector, and the related feature vectors constitute the related operation result graph; wherein x 1x is the row coordinate, x 1y is the column coordinate, and d is the preset range value.
[0022] In one embodiment, the step of performing multi-scale feature fusion on the relevant feature graph to obtain segmentation semantic feature data includes:
[0023] The relevant feature map is input into a preset first convolutional neural network, feature maps of different scales of the relevant feature map are obtained from the hidden layer of the first convolutional neural network, the feature maps of different scales of the relevant feature map are respectively pooled to obtain feature maps representing features of different scales, and the feature maps representing features of different scales are fused to obtain the segmentation semantic feature data.
[0024] In one embodiment, extracting features from the relevant feature graph to obtain relevant semantic feature data includes:
[0025] The relevant feature map is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
[0026] In one embodiment, extracting features from the relevant feature graph to obtain relevant semantic feature data includes:
[0027] A feature map having the same scale as the relevant feature map is obtained from the hidden layer of the first convolutional neural network, and is fused with the relevant feature map. The fused image is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
[0028] In one embodiment, the pooling process is channel global maximum pooling.
[0029] In one embodiment, the feature extraction network of the image to be detected and the feature extraction network of the template image share weights.
[0030] In one embodiment, the decision vector includes two elements, which respectively represent the probability of the presence of a printing quality defect and the probability of the absence of a printing quality defect.
[0031] According to the third aspect, an embodiment provides a computer-readable storage medium, on which a program is stored, and the program can be executed by a processor to implement the method as described in the first aspect or the second aspect above.
[0032] According to the printing quality defect detection method and computer-readable storage medium of the above-mentioned embodiment, the feature extraction network extracts the feature graphs of the image to be detected and the template image respectively, performs correlation operation on the feature graph of the image to be detected and the feature graph of the template image, and finally obtains the correlation feature graph; extracts the feature graph of the correlation feature graph to obtain the relevant semantic feature data, performs multi-scale feature fusion to obtain the segmentation semantic feature data, and inputs the relevant semantic feature data and the segmentation semantic feature data into a fully connected network after fusion to obtain the decision vector, and judges whether the image to be detected has printing quality defects according to the decision vector. Since the feature graphs of the image to be detected and the template image are extracted by the feature extraction network, the automatic extraction and selection of features are realized, the dependence on the experience of the staff is reduced, which is conducive to reducing the debugging difficulty and improving the debugging efficiency of the detection equipment; at the same time, the correlation operation of the image is converted into the correlation operation of the feature, and the similarity of the image features is used for comparison and judgment, so that the detection method can adapt to environmental changes and position changes, and improve the accuracy of detection; and the relevant semantic feature data obtained by feature extraction and the segmentation semantic feature data obtained by multi-scale feature fusion are fused for the detection of printing quality defects, so that the detection source information is richer, and more representative features can be obtained, thereby improving the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a schematic diagram of a template image;
[0034] Figure 2 A schematic diagram of a poorly printed image;
[0035] Figure 3 is a schematic diagram of a blurred image;
[0036] Figure 4 It is a schematic diagram of the screen printing offset and skewed image;
[0037] Figure 5 is a schematic diagram of a fat oil image;
[0038] Figure 6 Schematic diagram of an image with missing characters;
[0039] Figure 7 It is a schematic diagram of a dark image;
[0040] Figure 8 Schematic diagram of a bright image;
[0041] Fig. 9 A flowchart of a method for detecting printing quality defects according to an embodiment;
[0042] Fig.10 A schematic diagram of the principle of the printing quality defect detection method of the present application;
[0043] Fig.11 A schematic diagram of the structure of a complete network model for printing quality defect detection according to an embodiment;
[0044] Fig.12 A schematic diagram of the structure of a complete network model for printing quality defect detection according to another embodiment. DETAILED DESCRIPTION
[0045] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0046] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0047] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).
[0048] Please refer to Fig. 9 and Fig.10 , a printing quality defect detection method in one embodiment of the present application includes steps 110 to 160, which are described in detail below.
[0049] Step 110: Acquire the image to be tested and the template image without printing quality defects. The image to be tested can be taken by any type of camera device; the template image can be a pre-collected and stored image without printing quality defects. When it is necessary to perform printing quality defect detection on the printed product, these stored template images can be read and compared with the image to be tested.
[0050] Step 120: Input the image to be detected and the template image into their respective feature extraction networks to obtain the feature map of the image to be detected and the feature map of the template image. The original pixel grayscale information of the image belongs to the lower-level features of the image, which contains very little semantic information and has limited feature expression capabilities. Therefore, the feature extraction network is first used to extract features of the image to be detected and the template image to obtain higher-level features of the image, which is equivalent to further understanding the image, so as to facilitate better analysis of the image in subsequent steps.
[0051] The feature extraction networks of the image to be detected and the template image can share weights. This not only reduces the number of weights, but is also equivalent to using the same network to compare the similarities and differences between the two. During the network training stage, the distance between the output images obtained after the image without printing quality defects and the template image are respectively input into the network can be smaller, and the distance between the output images obtained after the image with printing quality defects and the template image are respectively input into the network can be larger, which plays a role similar to supervised learning.
[0052] Please refer to Fig.11 and Fig.12 , the feature extraction network of the image to be detected and the template image can both be a convolutional neural network, and the specific structure of the network can be designed according to actual needs. Fig.11 As shown in the figure, for an input image with 64 channels, convolution and pooling operations can be performed first to obtain a feature map with 128 channels, and then convolution and pooling operations can be performed again to obtain a feature map with 256 channels, thereby obtaining a feature map of the image to be detected or the template image.
[0053] Step 130: perform correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map, and use the correlation operation result map as the correlation feature map. Fig.11 and Fig.12 In the figure, the correlation operation is represented by f. The correlation operation can be realized by calculating the cosine similarity. In order to reduce the amount of calculation, the correlation operation of the feature map of the image to be detected and the feature map of the template image can be limited to a certain range. Specifically, for each point x1(x 1x ,x 1y ), calculate the feature vector at this point and the feature map of the image to be detected in the range [x 1x -d,x 1x +d]×[x 1y -d,x 1y +d], the cosine similarity of the feature vectors at each point in the (2d+1) 2 The calculation results form a related feature vector, and the related feature vectors form a related operation result graph, where x 1x is the row coordinate, x 1yis the column coordinate, d is the preset range value, for example, d=7. Here, the feature vector at a certain point in the image refers to the vector composed of the pixels on each channel at that point as elements. If the size of the template image feature map is W×H×C, where W is the width of the template image feature map, H is the height of the template image feature map, and C is the number of channels of the template image feature map, then it can be understood that the size of the correlation operation result map obtained is W×H×(2d+1) 2 The calculation formula of cosine similarity is as follows:
[0054]
[0055] Where x1 and x2 represent points on the feature map of the template image and the feature map of the image to be detected, respectively; h1(x) represents the feature vector at point x on the feature map of the template image; h2(x) represents the feature vector at point x on the feature map of the image to be detected; <> represents the calculation of the cosine value between the two vectors; o represents the displacement; to reduce the amount of calculation, k=0 can be taken.
[0056] Please refer to Fig.12 In one embodiment, after performing correlation operation on the feature map of the image to be detected and the feature map of the template image, the feature map of the template image is convolved and activated, and then fused with the result map of the correlation operation, and the fused result is used as the correlation feature map. In this way, the representation ability and richness of the features are increased, and more information of the template image is also included, which is conducive to comparing the similarities and differences between the image to be detected and the template image. Fig.12 As shown in the figure, the template image feature map is convolved and activated, and then fused with the relevant operation result map by channel splicing, as shown in Fig.12 As shown in FIG. 1 , after convolution and activation processing of the template image feature map, an image with 64 channels is obtained. From the above analysis, it can be seen that when d=7, the number of channels of the correlation operation result map obtained is 225. The channels of the two are spliced to obtain a correlation feature map with 289 channels.
[0057] Step 140: Extract features from the relevant feature graph to obtain relevant semantic feature data, and perform multi-scale feature fusion on the relevant feature graph to obtain segmentation semantic feature data. In this step, the relevant feature graph is further extracted to obtain relevant semantic information that characterizes the correlation between the image to be detected and the template image; at the same time, feature graphs of different scales of the relevant feature graph are calculated, and these feature graphs of different scales are pooled to further extract features to obtain feature graphs that characterize features of different scales, and these feature graphs that characterize features of different scales are fused to obtain segmentation semantic information that has template information and contains feature information of different scales.
[0058] Please refer to Fig.11 and Fig.12 , the feature extraction and multi-scale feature fusion of relevant feature maps can be achieved with the help of convolutional neural networks. Specifically, for the multi-scale feature fusion of relevant feature maps, the relevant feature maps can be input into the first convolutional neural network with pre-set parameters, and feature maps of different scales of the relevant feature maps can be obtained from the hidden layer of the first convolutional neural network. The feature maps of different scales of the relevant feature maps are then pooled to obtain feature maps representing features of different scales. These feature maps representing features of different scales are fused to obtain segmentation semantic feature data, which contains feature information of different scales with template information. The fusion here can be achieved by channel splicing. In addition, the receptive fields of feature maps of different scales are also different, so the final segmentation semantic feature data must also contain feature information of different receptive fields. The specific structure of the first convolutional neural network can be designed according to actual needs. For example, Fig.12 As shown in the figure, for the relevant feature map with 289 channels, a convolution operation with a step length of 1 and a convolution kernel size of 1x1 can be performed to reduce the dimension of the relevant feature map to obtain a feature map with 8 channels, and then a convolution and pooling operation is performed to obtain a feature map with 16 channels, and finally a convolution and pooling operation is performed again to obtain a feature map with 32 channels. For the pooling of each feature map, the maximum pooling can be used, which is conducive to retaining the location information of the feature.
[0059] For feature extraction of the relevant feature map, the relevant feature map can be input into a second convolutional neural network with pre-set parameters to obtain an output feature map, and the output feature map is pooled to obtain relevant semantic feature data. The relevant semantic feature data contains relevant semantic information that characterizes the correlation between the image to be detected and the template image. In one embodiment, a feature map with the same scale as the relevant feature map can be obtained from the hidden layer of the first convolutional neural network, and fused with the relevant feature map. The fused image is input into the second convolutional neural network to obtain an output feature map, thereby enhancing the representation ability and richness of the features. For example, Fig.12 As shown in FIG. 1 , the related feature map is a feature map with 8 channels obtained after the convolution operation with a step size of 1 and a convolution kernel size of 1x1 in the first convolutional neural network. Compared with the related feature map, only the number of channels has changed, and the scale remains unchanged. Then, the feature map with 8 channels can be concatenated with the related feature map to obtain a feature map with 297 channels. The feature map with 297 channels is input into the second convolutional neural network to obtain an output feature map. The specific structure of the second convolutional neural network can be designed according to actual needs, for example, Fig.12As shown in the figure, for a feature map with 297 channels, a pooling operation can be performed first to obtain a feature map with 297 channels of different scales, and then a convolution and pooling operation can be performed to obtain a feature map with 16 channels, and finally a convolution with a convolution kernel size of 1x1 can be performed to obtain an output feature map with 32 channels. For the pooling of each feature map, the maximum pooling can be used, which is conducive to retaining the location information of the feature.
[0060] In order to extract relevant semantic information, the second convolutional neural network needs to retain relatively complete data of relevant feature maps, while the first convolutional neural network is used to extract feature information of different scales and receptive fields, which can reduce the data of relevant feature maps. In order to improve efficiency, the first convolutional neural network can be set as a lightweight neural network compared to the second convolutional neural network, such as Fig.11 and 12 In the example above, the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network. A person skilled in the art can understand that a lightweight neural network refers to a neural network with fewer parameters, less storage space or less computational effort.
[0061] The pooling process for each feature map obtained from the hidden layer of the first convolutional neural network and the output feature map of the second convolutional neural network can be channel global pooling. For each pixel point of the feature map, the feature vector at the point is converted from a size of 1xC to a size of 1x1 after channel global pooling, where C represents the number of channels of the feature map. Then, a feature map of size W×H×C is converted into a feature map of size W×H×1 after channel global pooling, where W is the width of the feature map and H is the height of the feature map. Furthermore, channel global pooling can be channel global maximum pooling, that is, taking the maximum value of the pixel values of C channels, thereby converting the feature vector from a size of 1xC to a size of 1x1. Channel global pooling retains the feature information at each point of the image, reduces parameters, and facilitates fusion and subsequent fully connected network processing.
[0062] Step 150: The relevant semantic feature data and the segmented semantic feature data are fused and input into a fully connected network with pre-set parameters to obtain a decision vector.
[0063] Fusion can be achieved by channel splicing. The fused feature data includes both feature information with template information and different scales and receptive fields, and relevant semantic information that characterizes the correlation between the image to be detected and the template image, making the detection source information richer, the feature expression ability stronger, and it is easy to compare the similarities and differences between the image to be detected and the template image, thereby improving the accuracy of detection.
[0064] The fused feature data is mapped to one-dimensional data to adapt to the input of the fully connected network, and the decision vector is obtained after inputting the fully connected network. The structure of the fully connected network can be designed according to specific needs and is not limited here. In some embodiments, the output layer of the fully connected network can include two neurons, and the outputs of the two neurons are the probabilities of the presence and absence of printing quality defects, respectively. Then the decision vector output by the fully connected network includes two elements, which respectively represent the probabilities of the presence and absence of printing quality defects.
[0065] Step 160: Determine whether the image to be detected has a printing quality defect according to the decision vector. When the decision vector includes two elements, which respectively represent the probability of the presence of a printing quality defect and the absence of a printing quality defect, a judgment can be made based on the probability. When the probability of the presence of a printing quality defect is high, the image to be detected is determined to have a printing quality defect. When the probability of the absence of a printing quality defect is high, the image to be detected is determined to have no printing quality defect. In this way, the printing quality defect detection is transformed from a traditional segmentation problem to a classification problem. Only a binary classification judgment is required to obtain the detection result, which reduces the complexity of the detection method.
[0066] According to the printing quality defect detection method of the above embodiment, the feature extraction network extracts the feature maps of the image to be detected and the template image respectively, realizes the automatic extraction and selection of features, reduces the dependence on the experience of the staff, is conducive to reducing the debugging difficulty, and improves the debugging efficiency of the detection equipment. The feature extraction network of the image to be detected and the feature extraction network of the template image can share weights, thereby reducing the number of weights; the relevant operation of the image is converted into the relevant operation of the feature, and the similarity of the image features is used for comparison and judgment, so that the detection method can adapt to environmental changes and position changes, and improve the accuracy of detection; the relevant semantic feature data obtained by feature extraction and the segmentation semantic feature data obtained by multi-scale feature fusion are fused for use The detection of printing quality defects makes the detection source information richer and can obtain more representative features, thereby improving the accuracy of detection; the relevant semantic feature data and the segmentation semantic feature data are fused and input into the fully connected network to obtain the decision vector. The output layer of the fully connected network can include two neurons, and the outputs of the two neurons are the probabilities of the presence and absence of printing quality defects, respectively. The obtained decision vector includes two elements, which respectively represent the probabilities of the presence and absence of printing quality defects. The probability of judging whether the image to be detected has defects is based on the probability, thereby converting the detection of printing quality defects from the traditional segmentation problem to a classification problem. Only binary classification judgment is required to obtain the detection result, reducing the complexity of the detection method.
[0067] This document is described with reference to various exemplary embodiments. However, those skilled in the art will recognize that changes and modifications may be made to the exemplary embodiments without departing from the scope of this document. For example, various operating steps and components for performing the operating steps may be implemented in different ways (e.g., one or more steps may be deleted, modified, or incorporated into other steps) depending on the specific application or considering any number of cost functions associated with the operation of the system.
[0068] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. In addition, as understood by those skilled in the art, the principles of this article can be reflected in a computer program product on a computer-readable storage medium, which is pre-installed with a computer-readable program code. Any tangible, non-temporary computer-readable storage medium can be used, including magnetic storage devices (hard disks, floppy disks, etc.), optical storage devices (CD to ROM, DVD, Blu Ray disks, etc.), flash memory and / or the like. These computer program instructions can be loaded onto a general-purpose computer, a special-purpose computer or other programmable data processing device to form a machine, so that these instructions executed on a computer or other programmable data processing device can generate a device that implements a specified function. These computer program instructions can also be stored in a computer-readable memory, which can instruct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory can form a manufactured product, including an implementation device that implements a specified function. Computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on a computer or other programmable device to generate a computer-implemented process, so that the instructions executed on a computer or other programmable device can provide steps for implementing a specified function.
[0069] Although the principles of this invention have been shown in various embodiments, many modifications of structures, arrangements, proportions, elements, materials and components particularly suitable for specific environments and operational requirements can be used without departing from the principles and scope of this invention. The above modifications and other changes or amendments will be included in the scope of this invention.
[0070] The foregoing specific description has been described with reference to various embodiments. However, those skilled in the art will recognize that various modifications and changes can be made without departing from the scope of the present disclosure. Therefore, the consideration of the present disclosure will be illustrative rather than restrictive, and all these modifications will be included in its scope. Similarly, the advantages, other advantages and solutions to the problems of various embodiments have been described above. However, the benefits, advantages, solutions to the problems and any elements that can produce these, or make them more clear, should not be interpreted as critical, necessary or necessary. The term "include" and any other variants used in this article are all non-exclusive inclusions, so that the process, method, article or device including the list of elements not only includes these elements, but also includes other elements that are not explicitly listed or do not belong to the process, method, system, article or device. In addition, the term "coupled" and any other variants used in this article refer to physical connections, electrical connections, magnetic connections, optical connections, communication connections, functional connections and / or any other connections.
[0071] Those skilled in the art will appreciate that many changes may be made to the details of the above-described embodiments without departing from the basic principles of the invention. Therefore, the scope of the present invention should be determined solely by the claims.
Claims
1. A printing quality defect detection method, characterized in that: include: Acquire an image to be inspected and a template image without printing quality defects; Inputting the image to be detected and the template image into respective feature extraction networks to obtain a feature map of the image to be detected and a feature map of the template image; Performing a correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map, and using the correlation operation result map as a correlation feature map; Performing feature extraction on the relevant feature graph to obtain relevant semantic feature data, and performing multi-scale feature fusion on the relevant feature graph to obtain segmentation semantic feature data; The relevant semantic feature data and the segmented semantic feature data are fused and input into a fully connected network to obtain a decision vector; It is determined whether the image to be inspected has a printing quality defect according to the decision vector.
2. The method according to claim 1, characterized in that The performing of correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map includes: For each point x1(x 1x ,x 1y ), calculate the feature vector at this point and the feature map of the image to be detected in the range [x 1x -d,x 1x +d]×[x 1y -d,x 1y +d], the cosine similarity of the feature vectors at each point in the (2d+1) 2 The calculation results constitute a related feature vector, and the related feature vectors constitute the related operation result graph; wherein x 1x is the row coordinate, x 1y is the column coordinate, and d is the preset range value.
3. The method according to claim 1, characterized in that The step of performing multi-scale feature fusion on the relevant feature graphs to obtain segmentation semantic feature data includes: The relevant feature map is input into a preset first convolutional neural network, feature maps of different scales of the relevant feature map are obtained from the hidden layer of the first convolutional neural network, the feature maps of different scales of the relevant feature map are respectively pooled to obtain feature maps representing features of different scales, and the feature maps representing features of different scales are fused to obtain the segmentation semantic feature data.
4. The method according to claim 3, characterized in that The step of extracting features from the relevant feature graph to obtain relevant semantic feature data includes: The relevant feature map is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
5. The method according to claim 3, characterized in that The step of extracting features from the relevant feature graph to obtain relevant semantic feature data includes: A feature map having the same scale as the relevant feature map is obtained from the hidden layer of the first convolutional neural network, and is fused with the relevant feature map. The fused image is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
6. The method according to claim 4 or 5, characterized in that The pooling process is channel global maximum pooling.
7. The method according to claim 1, characterized in that The feature extraction network of the image to be detected and the feature extraction network of the template image share weights.
8. The method according to claim 1, characterized in that The decision vector includes two elements, which respectively represent the probability of the presence of a printing quality defect and the probability of the absence of a printing quality defect.
9. A printing quality defect detection method, characterized in that: include: Acquire an image to be inspected and a template image without printing quality defects; Inputting the image to be detected and the template image into respective feature extraction networks to obtain a feature map of the image to be detected and a feature map of the template image; Performing a correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map; After convolution and activation processing, the template image feature map is fused with the relevant operation result map to obtain a relevant feature map, feature extraction is performed on the relevant feature map to obtain relevant semantic feature data, and multi-scale feature fusion is performed on the relevant feature map to obtain segmentation semantic feature data; The relevant semantic feature data and the segmented semantic feature data are fused and input into a fully connected network to obtain a decision vector; It is determined whether the image to be inspected has a printing quality defect according to the decision vector.
10. The method according to claim 9, characterized in that The performing of correlation operation on the feature map of the image to be detected and the feature map of the template image to obtain a correlation operation result map includes: For each point x1(x 1x ,x 1y ), calculate the feature vector at this point and the feature map of the image to be detected in the range [x 1x -d,x 1x +d]×[x 1y -d,x 1y +d], the cosine similarity of the feature vectors at each point in the (2d+1) 2 The calculation results constitute a related feature vector, and the related feature vectors constitute the related operation result graph; wherein x 1x is the row coordinate, x 1y is the column coordinate, and d is the preset range value.
11. The method according to claim 9, characterized in that The step of performing multi-scale feature fusion on the relevant feature graphs to obtain segmentation semantic feature data includes: The relevant feature map is input into a preset first convolutional neural network, feature maps of different scales of the relevant feature map are obtained from the hidden layer of the first convolutional neural network, the feature maps of different scales of the relevant feature map are respectively pooled to obtain feature maps representing features of different scales, and the feature maps representing features of different scales are fused to obtain the segmentation semantic feature data.
12. The method according to claim 11, characterized in that The step of extracting features from the relevant feature graph to obtain relevant semantic feature data includes: The relevant feature map is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
13. The method according to claim 11, characterized in that The step of extracting features from the relevant feature graph to obtain relevant semantic feature data includes: A feature map having the same scale as the relevant feature map is obtained from the hidden layer of the first convolutional neural network, and is fused with the relevant feature map. The fused image is input into a preset second convolutional neural network to obtain an output feature map, and the output feature map is pooled to obtain the relevant semantic feature data; wherein the first convolutional neural network is a lightweight neural network compared to the second convolutional neural network.
14. The method according to claim 12 or 13, characterized in that The pooling process is channel global maximum pooling.
15. The method according to claim 9, characterized in that The feature extraction network of the image to be detected and the feature extraction network of the template image share weights.
16. The method according to claim 9, characterized in that The decision vector includes two elements, which respectively represent the probability of the presence of a printing quality defect and the probability of the absence of a printing quality defect.
17. A computer-readable storage medium, characterized in that: The medium stores a program, which can be executed by a processor to implement the method according to any one of claims 1 to 16.
