Industrial defect detection optimization methods, devices, systems and storage media
By optimizing the segmentation network model through joint channels and spatial attention mechanisms, and combining feature pyramids and context retrieval modules, the over-detection problem caused by background noise interference is solved, thereby improving the accuracy and detection rate of industrial defect detection.
Patent Information
- Application Number
- CN202210834488.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-07-14
AI Technical Summary
In industrial defect detection, background noise interference leads to a large number of over-detected defects in the segmentation detection results, especially when there are differences in product processes and the defect target size is small, which reduces the detection rate of the system.
A segmentation network model based on joint channels and spatial attention mechanism is adopted, combined with feature pyramid and parallel context retrieval module to optimize prediction parameters, determine the initial position of defective targets, and remove false positive defective targets by distinguishing foreground features and background features.
It effectively reduced the number of over-detected defects in the segmentation detection results, and improved the accuracy and detection rate of defect detection.
Smart Images

Figure CN115082421B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, and more specifically, to an optimized method, apparatus, system, and storage medium for industrial defect detection. Background Technology
[0002] With the development of industrial vision, industrial defect detection has been widely used in various industrial fields, such as the 3C electronics manufacturing industry.
[0003] In the segmentation and inspection tasks of industrial defect detection, the optical image of the product is usually analyzed by a vision system to detect information such as the shape, area and type of defects on the product, thereby locating the defects.
[0004] However, defects and differences in product manufacturing processes lead to background noise interference in optical images, including dirt and scratches, resulting in a large number of over-detected items in the segmentation detection results. Summary of the Invention
[0005] To address the issue of a large number of over-detected defects in segmentation detection results due to background noise interference, this application provides an optimized method, apparatus, system, and storage medium for industrial defect detection.
[0006] The embodiments of this application are implemented as follows:
[0007] The first aspect of this application provides an industrial defect detection optimization method, including the following steps:
[0008] Based on the joint channel and spatial attention mechanism, the prediction parameters of the segmentation network model are optimized to determine the initial location information of the defect target in the image to be detected. The segmentation network model is trained on the image to be detected containing the defect target.
[0009] Based on the feature pyramid of each channel of the image to be detected, the output result of each channel is determined, wherein the output result of each channel is determined by the layer fusion of the feature pyramid;
[0010] Based on the prediction results, foreground and background features are determined. The prediction results include the initial position of the defective target and the output results of each channel.
[0011] Foreground and background features are processed by a parallel context retrieval module to remove false positive defect targets from the image to be detected.
[0012] In conjunction with the first aspect, in one possible implementation, the output result of each channel is determined based on the feature pyramid of each channel of the image to be detected, including:
[0013] Based on the asymmetric convolution module, the convolution result of the feature map of each layer of the feature pyramid is determined;
[0014] Based on regular convolution and skip connections, the results of each convolution layer are connected to determine the output of each channel;
[0015] Each channel of the feature pyramid has a different delay rate coefficient.
[0016] In conjunction with the first aspect, in one possible implementation, foreground and background features are determined based on the prediction results, including:
[0017] The high-level prediction results are upsampled and normalized by class to determine the normalized feature map;
[0018] Foreground and background features are determined by multiplying the normalized feature map with the current layer features, and by multiplying the inverse matrix of the normalized feature map with the current layer features.
[0019] In conjunction with the first aspect, in one possible implementation, each context retrieval module includes multiple branches, each branch including a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
[0020] In conjunction with the first aspect, in one possible implementation, after removing false positive defect targets from the image to be detected by passing foreground and background features through a parallel context retrieval module, the method further includes:
[0021] The output includes the segmentation results of the defective targets.
[0022] In conjunction with the first aspect, in one possible implementation, the segmentation network model is trained from an image to be detected containing defective targets, including:
[0023] Acquire the image to be detected, which contains defective targets;
[0024] A segmentation network model is trained based on the image to be detected, wherein the image to be detected is augmented online during the training process.
[0025] In conjunction with the first aspect, in one possible implementation, online augmentation includes horizontal mirroring, vertical mirroring, preset angle rotation, preset direction translation, and size scaling.
[0026] A second aspect of this application provides an industrial defect detection optimization device, including a joint channel and spatial attention mechanism module, a feature pyramid module, and a filtering module.
[0027] The joint channel and spatial attention mechanism module is used to optimize the prediction parameters of the segmentation network model based on the joint channel and spatial attention mechanism to determine the initial location information of the defect target in the image to be detected. The segmentation network model is trained on the image to be detected containing the defect target.
[0028] The feature pyramid module is used to determine the output result of each channel based on the feature pyramid of each channel of the image to be detected. The output result of each channel is determined by the layer fusion of the feature pyramid.
[0029] The filtering module is used to determine foreground and background features based on the prediction results. The prediction results include the initial position of the defective target and the output results of each channel.
[0030] The filtering module is also used to remove false positive defect targets in the image to be detected by passing foreground and background features through a parallel context retrieval module.
[0031] A third aspect of this application provides an industrial defect detection optimization system, including a memory and a processor. The memory stores an industrial defect detection optimization program, and the processor runs the industrial defect detection optimization program to enable the industrial defect detection optimization system to execute the industrial defect detection optimization method described in the invention.
[0032] A fourth aspect of this application provides a computer-readable storage medium storing an industrial defect detection optimization program, which, when executed by a processor, implements the industrial defect detection optimization method described in the invention.
[0033] The beneficial effects of this application are as follows: Based on the joint channel and spatial attention mechanism, the prediction parameters of the segmentation network model can be optimized, and the initial position information of the defect target in the image to be detected can be further determined; Based on the feature pyramid of each channel of the image to be detected, the output result of each channel can be determined, wherein the output result of each channel is determined by the layer fusion of the feature pyramid; Based on the prediction result, which includes the initial position of the defect target and the output result of each channel, the foreground features and background features can be determined, and the foreground features and background features can be further processed by a parallel context retrieval module to remove false positive defect targets in the image to be detected. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 A schematic flowchart of an industrial defect detection optimization method provided in an embodiment of this application is shown;
[0036] Figure 2This paper illustrates a flowchart of the process for determining the segmentation network model in an industrial defect detection optimization method provided in an embodiment of this application.
[0037] Figure 3 This paper illustrates a flowchart of the process for determining the output result of each channel in an industrial defect detection optimization method provided in an embodiment of this application.
[0038] Figure 4 This paper illustrates a flowchart of the determination of foreground and background features in an industrial defect detection optimization method provided in an embodiment of this application.
[0039] Figure 5 This illustration shows a structural schematic diagram of an industrial defect detection optimization device provided in an embodiment of this application;
[0040] Figure 6 A schematic diagram of the structure of an industrial defect detection optimization system provided in an embodiment of this application is shown. Detailed Implementation
[0041] To make the objectives, implementation methods and advantages of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only some embodiments of this application, and not all embodiments.
[0042] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0043] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0044] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0045] In segmentation detection results, two indicators are usually used for judgment: over-detection and under-detection. Over-detection refers to the presence of FP (False Positives) targets in the classification detection prediction results, that is, false defects are mistakenly identified as real defects.
[0046] For example, in the 3C electronics manufacturing industry, due to defects and differences in product processes, the optical images of products may be over-inspected because there is a lot of background noise interference in the optical images, especially when the size of the defective target is small, which leads to an increase in the number of over-inspected products and thus reduces the detection rate of the system.
[0047] In some implementations, the defect target may also be close to the background, and there may be angular size differences between different types of defects and / or similar defects, which may also lead to an increase in the number of over-inspections and a decrease in the detection rate of the system; for example, there may be angular size differences between different types of defects and / or similar defects, such as the difference between a large area of cracks and a small area of scratches.
[0048] To reduce the number of over-detections in industrial defect detection segmentation, this application provides an industrial defect detection optimization method, apparatus, system, and storage medium. Based on a joint channel and spatial attention mechanism, it can optimize the prediction parameters of the segmentation network model and further determine the initial position information of the defect target in the image to be detected. Based on the feature pyramid of each channel of the image to be detected, it can determine the output result of each channel, wherein the output result of each channel is determined by layer-by-layer fusion of the feature pyramid. Based on the prediction results, which include the initial position of the defect target and the output result of each channel, it can determine the foreground features and background features. Furthermore, the foreground features and background features are further processed by a parallel context retrieval module to remove false positive defect targets in the image to be detected, thereby reducing the number of over-detections in the segmentation detection results.
[0049] The following description, in conjunction with the accompanying drawings, provides a detailed explanation of the industrial defect detection optimization method, apparatus, system, and storage medium according to embodiments of this application.
[0050] Figure 1 This is a flowchart illustrating an industrial defect detection optimization method provided in an embodiment of this application, as shown below. Figure 1 As shown in the figure, this application provides an industrial defect detection optimization method, which includes the following steps:
[0051] S110. Based on the joint channel and spatial attention mechanism, optimize the prediction parameters of the segmentation network model to determine the initial position information of the defect target in the image to be detected. The segmentation network model is trained on the image to be detected containing the defect target.
[0052] The combined channel and spatial attention mechanism, also known as the combined channel attention mechanism and spatial attention mechanism, ensures that key areas that may exist in the image under test are obtained by using spatial attention mechanism and channel attention mechanism at the same time, thereby improving the detection rate of defective targets.
[0053] Both the channel attention mechanism and the spatial attention mechanism are implemented in a non-local attention manner to capture long-range semantic dependencies in terms of channel and spatial location, thereby inferring the initial location information of the defective target from a global perspective.
[0054] When calculating the position of each pixel, the correlation between the single pixel and its neighborhood is calculated, as well as with all positions in the image under test. For pixels in the region of interest, corresponding to multiple different global positions, the weights of the pixels in the region of interest corresponding to different global positions are calculated, and the weights of the pixels in the region of interest are accumulated.
[0055] Based on two categories, each pixel belongs to one of the two categories, and the prediction parameters of the segmentation network model are optimized according to the category.
[0056] Traverse each pixel in the image to be tested, determine the class corresponding to the pixel and the weight of the pixel, and determine the initial position information of the defect target in the image to be detected.
[0057] Figure 2 This is a flowchart illustrating the determination of the segmentation network model in an industrial defect detection optimization method provided in this application embodiment. Before step 110, which optimizes the prediction parameters of the segmentation network model based on a joint channel and spatial attention mechanism to determine the initial location information of the defect target in the image to be detected, the segmentation network model is determined as follows: Figure 2 As shown, determining the segmentation network model includes the following steps:
[0058] S101. Obtain the image to be detected, which contains defective targets.
[0059] S102. Based on the image to be detected, train a segmentation network model, wherein online augmentation is performed on the image to be detected during the training process. Online augmentation includes horizontal mirroring, vertical mirroring, rotation at a preset angle, translation in a preset direction, and scaling.
[0060] It should be understood that what is being trained is the backbone network of the segmentation network model.
[0061] For example, the segmentation network model can be a Unet based on STDC2 as the backbone network. Of course, the segmentation network model can also be other Unets, such as Unets based on ResNet18 / 34 / 50 backbone networks.
[0062] D120. Based on the feature pyramid of each channel of the image to be detected, determine the output result of each channel, wherein the output result of each channel is determined by layer fusion of the feature pyramid.
[0063] The feature image of each channel of the image to be detected is upsampled to obtain the feature pyramid corresponding to each channel, wherein each channel of the feature pyramid has a different delay rate coefficient.
[0064] For example, if the feature image of a certain channel of the image to be detected is 1024*1024, the feature pyramid corresponding to that channel can be obtained by upsampling and has 4 layers, namely the 1024*1024 feature image, the 512*512 feature image, the 256*256 feature image, and the 128*128 feature image.
[0065] The feature pyramid is constructed using different convolutional methods, and the results of each convolutional module are connected using jump-level methods.
[0066] Figure 3 This is a flowchart illustrating the determination of the output result of each channel in an industrial defect detection optimization method provided in this application embodiment, as shown below. Figure 3 As shown, determining the output result for each channel involves the following steps:
[0067] D121. Based on the asymmetric convolution module, determine the convolution result of the feature map of each layer of the feature pyramid.
[0068] The asymmetric convolution fuses features from feature maps of different sizes through multiple convolutional kernels, and for the identified large features, the target structure is acquired.
[0069] It should be understood that for each layer of the feature pyramid, fusion is performed layer by layer based on asymmetric convolutional modules.
[0070] The feature pyramid has different sizes for different layers. The more layers there are, the smaller the size of the corresponding feature map. For small feature maps, asymmetric convolution can reduce the amount of computation and improve the fusion effect.
[0071] D122. Based on regular convolution and skip connections, the results of each convolution layer are connected to determine the output of each channel.
[0072] It should be understood that different convolution operations can be used to fuse semantic information collected from higher levels with texture and contour information collected from lower levels.
[0073] S130. Based on the prediction results, determine the foreground features and background features. The prediction results include the initial position of the defective target and the output results of each channel.
[0074] The prediction results include the initial position of the defect target obtained in step 110 and the output results of each channel obtained in step 120.
[0075] Figure 4This is a schematic diagram illustrating the process of determining foreground and background features in an industrial defect detection optimization method provided in this application embodiment, as shown below. Figure 4 As shown, determining foreground and background features involves the following steps:
[0076] S131. The high-level prediction results are upsampled and normalized by class to determine the normalized feature map.
[0077] Normalization can be achieved by using a sigmoid layer to normalize the sampled results.
[0078] S132. Based on the multiplication of the normalized feature map with the current layer features, and the multiplication of the inverse matrix of the normalized feature map with the current layer features, determine the foreground and background features of the corresponding layer feature image.
[0079] S133. Based on the foreground and background features of each layer of feature images, generate the foreground and background features of the image to be tested.
[0080] D140: By using a parallel context retrieval module, foreground and background features are combined to remove false positive defect targets from the image to be detected.
[0081] Foreground features are retrieved through the first context retrieval module, and background features are retrieved through the second context retrieval module, wherein the first context retrieval module and the second context retrieval module are set up in parallel.
[0082] Each context retrieval module includes multiple branches, each branch including a first convolutional layer, a second convolutional layer, and a dilated convolution, wherein the second convolutional layer is different for each branch.
[0083] For example, each context retrieval module includes four branches. Each branch includes a 3*3 convolutional layer, a k*k convolutional layer, and a 3*3 dilated convolution. The 3*3 convolutional layer is used for channel descent, the k*k convolutional layer is used to extract feature maps (k takes values of 1, 2, 4, 8; or k takes values of 2, 2, 2, 4), and the 3*3 dilated convolution increases the area, that is, it injects holes into the standard convolution to increase the receptive field.
[0084] The training and evaluation approach is adopted. The model parameters are first updated on the training set and then evaluated on the validation set. The accuracy of the validation set is reflected by the intersection-union ratio (IUR) of the predicted area and the labeled area. The IUR ranges from 0 to 1. The larger the IUR, the higher the accuracy.
[0085] In some embodiments, if the intersection-union ratio of the predicted area to the labeled area is 0, the corresponding prediction result is a false positive target.
[0086] It should be understood that, depending on different application requirements and the different degrees of over-detection and under-detection, the judgment threshold of the cross-connection ratio can be adjusted to improve the state of over-detection or under-detection.
[0087] The industrial defect detection optimization method, after step 140, further includes:
[0088] The output includes the segmentation results of the defective targets.
[0089] This application discloses an industrial defect detection optimization method. Based on a joint channel and spatial attention mechanism, it can optimize the prediction parameters of the segmentation network model and further determine the initial position information of the defect target in the image to be detected. Based on the feature pyramid of each channel of the image to be detected, it can determine the output result of each channel, wherein the output result of each channel is determined by layer-by-layer fusion of the feature pyramid. Based on the prediction result, which includes the initial position of the defect target and the output result of each channel, it can determine the foreground features and background features. Furthermore, the foreground features and background features are used through a parallel context retrieval module to remove false positive defect targets in the image to be detected, thereby reducing the number of over-detections in the segmentation detection results.
[0090] Figure 5 This is a schematic diagram of the structure of an industrial defect detection optimization device provided in an embodiment of this application, as shown below. Figure 5 As shown in the figure, this application provides an industrial defect detection optimization device 500, including a joint channel and spatial attention mechanism module 501, a feature pyramid module 502, and a filtering module 503.
[0091] The joint channel and spatial attention mechanism module 501 is used to optimize the prediction parameters of the segmentation network model based on the joint channel and spatial attention mechanism to determine the initial location information of the defect target in the image to be detected, wherein the segmentation network model is trained on the image to be detected containing the defect target.
[0092] The feature pyramid module 502 is used to determine the output result of each channel based on the feature pyramid of each channel of the image to be detected, wherein the output result of each channel is determined by layer fusion of the feature pyramid.
[0093] The filtering module 503 is used to determine foreground and background features based on the prediction results, including the initial position of the defect target and the output results of each channel; it is also used to remove false positive defect targets in the image to be detected by passing the foreground and background features through a parallel context retrieval module.
[0094] In some embodiments, the feature pyramid module 502 is further configured to:
[0095] Based on the asymmetric convolution module, the convolution result of the feature map of each layer of the feature pyramid is determined;
[0096] Based on regular convolution and skip connections, the results of each convolution layer are connected to determine the output of each channel;
[0097] Each channel of the feature pyramid has a different delay rate coefficient.
[0098] In some embodiments, the filtering module 503 is further configured to:
[0099] The high-level prediction results are upsampled and normalized by class to determine the normalized feature map;
[0100] Based on the multiplication of the normalized feature map with the current layer features, and the multiplication of the inverse matrix of the normalized feature map with the current layer features, the foreground features and background features of the corresponding layer feature image are determined.
[0101] Based on the foreground and background features of each layer of feature images, the foreground and background features of the image to be tested are generated.
[0102] In some embodiments, each context retrieval module in the filtering module includes multiple branches, each branch including a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
[0103] In some embodiments, the industrial defect detection optimization apparatus further includes an output module for outputting segmentation results containing defect targets.
[0104] In some embodiments, the industrial defect detection optimization device further includes an acquisition module for acquiring an image to be detected, the image having a defect target; and for training a segmentation network model based on the image to be detected, wherein online augmentation is performed on the image to be detected during the training process. The online augmentation includes horizontal mirroring, vertical mirroring, rotation at a preset angle, translation in a preset direction, and scaling.
[0105] Each module in the aforementioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0106] Figure 6 This is a schematic diagram of the structure of an industrial defect detection optimization system provided in an embodiment of this application, as shown below. Figure 6As shown in the illustration, an industrial defect detection optimization system provided in this application includes a memory and a processor. The memory stores industrial defect detection optimization programs, and the processor runs the industrial defect detection optimization programs to enable the industrial defect detection optimization system to execute industrial defect detection optimization methods. The processor provides computing and control capabilities, and the memory includes a non-volatile storage medium and internal memory.
[0107] When the processor executes the industrial defect detection optimization program, it performs the following steps:
[0108] Based on the joint channel and spatial attention mechanism, the prediction parameters of the segmentation network model are optimized to determine the initial location information of the defective target in the image to be detected. The segmentation network model is trained on the image to be detected containing the defective target. Based on the feature pyramid of each channel of the image to be detected, the output result of each channel is determined. The output result of each channel is determined by layer-by-layer fusion of the feature pyramid. Based on the prediction results, foreground features and background features are determined. The prediction results include the initial location of the defective target and the output result of each channel. The foreground features and background features are then processed by a parallel context retrieval module to remove false positive defective targets in the image to be detected.
[0109] In some embodiments, the output result of each channel is determined based on the feature pyramid of each channel of the image to be detected, including: determining the convolution result of each layer of the feature map of the feature pyramid based on an asymmetric convolution module; and connecting the convolution results of each layer based on regular convolution and skip connections to determine the output result of each channel; wherein each channel of the feature pyramid has a different delay rate coefficient.
[0110] In some embodiments, determining foreground and background features based on prediction results includes: upsampling and class normalizing the prediction results of higher layers to determine a normalized feature map; and determining foreground and background features based on multiplying the normalized feature map with the current layer features and multiplying the inverse matrix of the normalized feature map with the current layer features.
[0111] In some embodiments, each context retrieval module includes multiple branches, each branch including a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
[0112] In some embodiments, after removing false positive defect targets from the image to be detected by passing the foreground features and background features through a parallel context retrieval module, the method further includes: outputting a segmentation result containing the defect targets.
[0113] In some embodiments, the segmentation network model is trained on a detection image containing a defective target, including: acquiring the detection image, which has a defective target; and training the segmentation network model based on the detection image, wherein online augmentation is performed on the detection image during training. The online augmentation includes horizontal mirroring, vertical mirroring, rotation at a preset angle, translation in a preset direction, and scaling.
[0114] This application provides an industrial defect detection optimization system, the implementation principle and technical effects of which are similar to the above-described method embodiments, and will not be repeated here.
[0115] This application provides a computer-readable storage medium storing an industrial defect detection optimization program. When the industrial defect detection optimization program is executed by a processor, it performs the following steps:
[0116] Based on the joint channel and spatial attention mechanism, the prediction parameters of the segmentation network model are optimized to determine the initial location information of the defective target in the image to be detected. The segmentation network model is trained on the image to be detected containing the defective target. Based on the feature pyramid of each channel of the image to be detected, the output result of each channel is determined. The output result of each channel is determined by layer-by-layer fusion of the feature pyramid. Based on the prediction results, foreground features and background features are determined. The prediction results include the initial location of the defective target and the output result of each channel. The foreground features and background features are then processed by a parallel context retrieval module to remove false positive defective targets in the image to be detected.
[0117] In some embodiments, the output result of each channel is determined based on the feature pyramid of each channel of the image to be detected, including: determining the convolution result of each layer of the feature map of the feature pyramid based on an asymmetric convolution module; and connecting the convolution results of each layer based on regular convolution and skip connections to determine the output result of each channel; wherein each channel of the feature pyramid has a different delay rate coefficient.
[0118] In some embodiments, determining foreground and background features based on prediction results includes: upsampling and class normalizing the prediction results of higher layers to determine a normalized feature map; and determining foreground and background features based on multiplying the normalized feature map with the current layer features and multiplying the inverse matrix of the normalized feature map with the current layer features.
[0119] In some embodiments, each context retrieval module includes multiple branches, each branch including a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
[0120] In some embodiments, after removing false positive defect targets from the image to be detected by passing the foreground features and background features through a parallel context retrieval module, the method further includes: outputting a segmentation result containing the defect targets.
[0121] In some embodiments, the segmentation network model is trained on a detection image containing a defective target, including: acquiring the detection image, which has a defective target; and training the segmentation network model based on the detection image, wherein online augmentation is performed on the detection image during training. The online augmentation includes horizontal mirroring, vertical mirroring, rotation at a preset angle, translation in a preset direction, and scaling.
[0122] The computer-readable storage medium provided in this embodiment is similar in principle and technical effect to the method embodiment described above, and will not be repeated here.
[0123] The following paragraphs will compare and list the Chinese terms used in this application specification and their corresponding English terms to facilitate reading and understanding.
[0124] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the discussion in some embodiments above is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the embodiments and various different variations of the embodiments suitable for specific application considerations.
Claims
1. An optimized method for industrial defect detection, characterized in that, include: Based on the joint channel and spatial attention mechanism, the prediction parameters of the segmentation network model are optimized to determine the initial location information of the defect target in the image to be detected. The segmentation network model is obtained by training the image to be detected containing the defect target. Based on the feature pyramid of each channel of the image to be detected, the output result of each channel is determined, wherein the output result of each channel is determined by layer-by-layer fusion of the feature pyramid; The high-level prediction results are upsampled and normalized by class to determine the normalized feature map. The prediction results include the initial position of the defect target and the output result of each channel. Based on the multiplication of the normalized feature map with the current layer features, and the multiplication of the inverse matrix of the normalized feature map with the current layer features, the foreground features and background features of the corresponding layer feature image are determined. Based on the foreground and background features of each layer of feature images, foreground and background features of the image to be detected are generated. The foreground features and background features of the image to be detected are processed by parallel context retrieval modules to remove false positive defect targets in the image to be detected. Each context retrieval module includes multiple branches, and each branch includes a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
2. The industrial defect detection optimization method according to claim 1, characterized in that, The step of determining the output result of each channel based on the feature pyramid of each channel of the image to be detected includes: Based on the asymmetric convolution module, the convolution result of the feature map of each layer of the feature pyramid is determined; Based on regular convolution and skip connections, the results of each convolution layer are connected to determine the output of each channel; Each channel of the feature pyramid has a different delay rate coefficient.
3. The industrial defect detection optimization method according to claim 1, characterized in that, After removing false positive defect targets from the image to be detected by passing the foreground features and the background features through a parallel context retrieval module, the method further includes: The output contains the segmentation results of the defective target.
4. The industrial defect detection optimization method according to claim 1, characterized in that, The segmentation network model is trained on images to be detected containing defective targets, including: Acquire an image to be detected, wherein the image to be detected contains a defective target; Based on the image to be detected, the segmentation network model is trained, wherein the image to be detected is augmented online during the training process.
5. The industrial defect detection optimization method according to claim 4, characterized in that, The online augmentation includes horizontal mirroring, vertical mirroring, preset angle rotation, preset direction translation, and size scaling.
6. An industrial defect detection and optimization device, characterized in that, include: A joint channel and spatial attention mechanism module is used to optimize the prediction parameters of the segmentation network model based on the joint channel and spatial attention mechanism to determine the initial position information of the defect target in the image to be detected, wherein the segmentation network model is trained on the image to be detected containing the defect target; The feature pyramid module is used to determine the output result of each channel based on the feature pyramid of each channel of the image to be detected, wherein the output result of each channel is determined by the feature pyramid by layer fusion; The filtering module is used to upsample and normalize the prediction results of the higher layers to determine a normalized feature map. The prediction results include the initial position of the defect target and the output result of each channel. Based on the multiplication of the normalized feature map with the current layer features and the multiplication of the inverse matrix of the normalized feature map with the current layer features, the foreground features and background features of the corresponding layer feature image are determined. Based on the foreground features and background features of each layer feature image, the foreground features and background features of the image to be detected are generated. The filtering module is further configured to remove false positive defect targets from the image to be detected by passing the foreground features and background features of the image to be detected through a parallel context retrieval module. Each context retrieval module includes multiple branches, and each branch includes a first convolutional layer, a second convolutional layer and a dilated convolution, wherein the second convolutional layer of each branch is different.
7. An industrial defect detection and optimization system, characterized in that, The system includes a memory and a processor, the memory being used to store an industrial defect detection optimization program, and the processor running the industrial defect detection optimization program to enable the industrial defect detection optimization system to perform the industrial defect detection optimization method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an industrial defect detection optimization program, which, when executed by a processor, implements the industrial defect detection optimization method as described in any one of claims 1-5.
Citation Information
Patent Citations
Pulmonary nodule detection and classification method based on multi-attention and multi-task feature fusion
CN114529516A