An industrial defect segmentation system based on deterministic perception and propagation

CN119107284BActive Publication Date: 2026-09-04THE ACAD OF TIANJIN UNIV HEFEI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411071816.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2026-09-04
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

[0006]本发明提供了一种基于确定性感知与传播的工业缺陷分割系统,以解决现有技术工业缺陷检测分割方法存在的忽略了模型在预测过程中产生的确定性信息,导致模型容易被与目标相似的背景区域所误导,难以将图像中不确定区域中的目标部分完整地分割出来的问题

Benefits of technology

[0025]This invention proposes an industrial defect segmentation system based on deterministic perception and propagation. The deterministic perception module (CAM) quantifies the uncertainties in the inference process and results, thereby further mining deterministic cues about the target in the image. This helps the model learn more accurately about the target and avoids being misled by uncertain regions in the background. The deterministic information enhancement module (CEM) enhances features using deterministic cues, improving the model's attention to deterministic regions within the target and avoiding interference from background noise and redundant information. The deterministic propagation module (CPM) gradually infers surrounding uncertain regions using known deterministic cues, thus progressively improving defect segmentation performance. Through the synergistic effect of these key modules, this invention can more accurately detect and segment hidden industrial defects, providing a reliable quality control method for industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119107284B_ABST
    Figure CN119107284B_ABST
Patent Text Reader

Abstract

The application discloses an industrial defect segmentation system based on deterministic perception and propagation, comprising a feature extraction part, a deterministic perception part, a deterministic information enhancement part and a deterministic propagation part; wherein the feature extraction part extracts high-dimensional features of four different scales; the deterministic perception part obtains a deterministic attention map by a deterministic perception module CAM and sends the deterministic attention map to the feature enhancement part; the deterministic information enhancement part obtains target deterministic regional features improved in spatial and channel attention by four deterministic information enhancement modules CEM and sends the target deterministic regional features to the deterministic propagation part; and the deterministic propagation part obtains industrial defect prediction segmentation maps of different scales by three deterministic propagation modules CPM. The application can avoid being misled by uncertain regions in the background, avoid the interference of noise and redundant information in the background, can more accurately detect and segment industrial hidden defects, and provides a reliable quality control means for industrial production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to industrial defect detection systems, specifically an industrial defect segmentation system based on deterministic perception and propagation. Background Technology

[0002] Industrial defects refer to various observable and detectable flaws on the surface of industrial products caused by adverse factors such as mechanical impact, workpiece friction, oxidation corrosion, and material defects during the industrial production process. Industrial defects can not only lead to product performance failure but also pose production safety hazards; therefore, industrial defect detection is of indispensable importance in industrial production.

[0003] With the rapid development of industrial intelligence, higher demands are being placed on the accuracy and efficiency of defect detection. Currently, most defect identification technologies still rely on machine-assisted manual inspection, which suffers from problems such as high error rates, poor timeliness, susceptibility to human factors, and a lack of flexibility and applicability. However, with the rapid development of machine vision, its high precision, speed, and stability have demonstrated significant advantages in defect identification, making it a key means to achieve automated and intelligent inspection.

[0004] In recent years, significant progress has been made in industrial defect detection based on deep learning methods. From a data perspective, addressing the problem of insufficient defect data, a few-shot learning paradigm is employed. This paradigm learns the distribution differences between images to distinguish different categories, enabling the model to better generalize and identify unknown categories. To address the difficulty of defect data annotation, weak supervision and self-supervision methods are used, employing features mined by the model itself as pseudo-labels. Weak localization of defects can be achieved using only these pseudo-labels. From a model structure design perspective, defect detection models based on Convolutional Neural Networks (CNNs), Transformers, and hybrid Transformer-CNN models have been designed, providing a network foundation for extracting target features from complex image information and achieving more accurate defect detection. From a model optimization and improvement perspective, researchers are dedicated to designing more efficient multi-scale feature fusion methods and achieving adaptive extraction of different defect features through various attention mechanisms. Furthermore, considering practical application needs, techniques such as model pruning and model lightweighting have been applied to model compression design to achieve real-time defect detection in the production process.

[0005] While existing methods can detect most easily identifiable industrial defects, they struggle to accurately segment some highly concealed defects with unclear edges. This is because existing methods often ignore the deterministic information generated by the model during the prediction process, making the model susceptible to being misled and confused by background areas similar to the target, and making it difficult to distinguish these uncertain areas in the image. Therefore, the deterministic information predicted by existing technology models is crucial for the complete identification and accurate segmentation of defects. Summary of the Invention

[0006] This invention provides an industrial defect segmentation system based on deterministic perception and propagation to solve the problem that existing industrial defect detection and segmentation methods ignore the deterministic information generated by the model during the prediction process, which makes the model easily misled by background regions similar to the target and makes it difficult to completely segment the target part in uncertain regions of the image.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] An industrial defect segmentation system based on deterministic perception and propagation includes a feature extraction part, a deterministic perception part, a deterministic information enhancement part, and a deterministic propagation part; wherein the feature extraction part extracts high-dimensional features at four different scales from the industrial defect to be detected image, and sends the high-dimensional features at the fourth scale to the deterministic perception part, and sends the high-dimensional features at all four scales to the deterministic information enhancement part.

[0009] The deterministic perception component includes a deterministic perception module (CAM). The CAM first quantifies uncertainty based on high-dimensional features at a fourth-level scale using the Monte Carlo Dropout method, resulting in four predicted segmentation maps. Then, the CAM obtains an average predicted map and an inferred uncertainty map based on the four predicted segmentation maps. Next, the CAM obtains an inferred deterministic map based on the inferred uncertainty map and a predicted deterministic map based on the average predicted map. Finally, the CAM concatenates the inferred deterministic map and the predicted deterministic map, then performs convolution and Min-Max normalization sequentially before multiplying it with the average predicted map to obtain a deterministic attention map, which is then fed into the feature enhancement component.

[0010] The deterministic information enhancement section includes four deterministic information enhancement modules (CEMs). Each CEM corresponds to a high-dimensional feature at a four-level scale, and each CEM also inputs a deterministic attention map. In each CEM, the size of the deterministic attention map is first adjusted to match the size of the corresponding high-dimensional feature. Then, a spatial attention mechanism is used to focus on the target deterministic region within the corresponding high-dimensional feature based on the adjusted deterministic attention map, thereby obtaining spatial attention-improved features. Finally, each CEM uses a channel attention mechanism to focus on important channels related to the defect segmentation task within the spatial attention-improved features, thereby obtaining spatially and channel-attention-improved target deterministic region features, which are then fed into the deterministic propagation section.

[0011] The deterministic propagation component includes three deterministic propagation modules (CPMs). The first CPM takes into account the target deterministic region features output by the deterministic information enhancement module (CEM) corresponding to the fourth-level scale high-dimensional features, and the target deterministic region features output by the third-level scale high-dimensional features. The second CPM takes into account the target deterministic region features output by the second-level scale high-dimensional features and the improved features output by the first CPM. The third CPM takes into account the target deterministic region features output by the first-level scale high-dimensional features and the improved features output by the second CPM.

[0012] In each deterministic propagation module (CPM), the input high-level and low-level features are first concatenated by channels, followed by CBR processing and convolutional channel adjustment to obtain fused features. Next, each CPM separates the fused features into four groups of separated features by channels, and performs CBR processing through four branches. The first group of separated features is processed by the first branch to obtain the first branch output features. The first branch output features are added to the second group of separated features, then processed by the second branch to obtain the second branch output features. The second branch output features are then separated by the third group of separated features. The features are summed and then processed by CBR in the third branch to obtain the output features of the third branch. The output features of the third branch are summed with the features separated in the fourth group and then processed by CBR in the fourth branch to obtain the output features of the fourth branch. The output features of the first to fourth branches are concatenated by channel to obtain the concatenated features. Then, each deterministic propagation module (CPM) adjusts the channels of the concatenated features through convolution and performs residual connection with the fused features, and then performs CBR processing to integrate contextual information, thereby obtaining improved features. Finally, each deterministic propagation module (CPM) performs convolution processing on the improved features to obtain the industrial defect prediction segmentation map.

[0013] Therefore, through the three deterministic propagation modules (CPM) in the deterministic propagation section, three industrial defect prediction segmentation maps of different scales are obtained, and the industrial defect prediction segmentation map output by the third deterministic propagation module (CPM) is used as the final prediction result.

[0014] Furthermore, the feature extraction part is a PVTv2 network.

[0015] Furthermore, the deterministic perception module CAM calculates the mean of the elements in the four predicted segmentation maps to obtain the average predicted map.

[0016] The deterministic perception module CAM calculates the standard deviation of elements in four predicted segmentation maps to obtain an inference uncertainty map.

[0017] Furthermore, the deterministic perception module CAM normalizes the inference uncertainty graph using Min-Max, then inverts and adds 1 to obtain the inference deterministic graph.

[0018] The deterministic perception module CAM uses the Sigmoid function to activate the average prediction map, thereby obtaining a predictive deterministic map.

[0019] Furthermore, in each deterministic information enhancement module (CEM), when focusing attention through the spatial attention mechanism, the adjusted deterministic attention map is multiplied by the corresponding level-scale high-dimensional feature and then added to the corresponding level-scale high-dimensional feature, and then CBR processing is performed to obtain the spatial attention improved feature.

[0020] Furthermore, when focusing attention in each deterministic information enhancement module (CEM) through the channel attention mechanism, the spatial attention improvement features are first subjected to global average pooling to obtain compressed information. Then, the compressed information is linearly mapped and transformed, and then normalized by the Sigmoid function to obtain channel attention. Finally, the channel attention is multiplied by the spatial attention improvement features, and then CBR processing is performed to obtain the target deterministic region features with spatial and channel attention improvements.

[0021] Furthermore, in each deterministic propagation module (CPM) of the deterministic propagation part, the CBR processing of the first branch includes 3×3 convolution, batch normalization, and ReLU activation, while the CBR processing of the second to fourth branches includes 3×3 dilated convolution, batch normalization, and ReLU activation, respectively, and the dilation rate of the dilated convolution increases from the second to the fourth branch.

[0022] This invention provides an industrial defect segmentation system, CGNet, based on deterministic perception and propagation. It consists of a feature extraction part, a deterministic perception part, a deterministic information enhancement part, and a deterministic propagation part. The CGNet as a whole is a multi-stage model of perception-enhancement-refinement. In the defect segmentation process, CGNet starts by identifying deterministic regions and gradually propagates to uncertain regions, following a processing procedure from known to unknown and from simple to complex, and adhering to human visual recognition mechanisms. This strategy helps to gradually and accurately identify and segment targets in complex images.

[0023] First, this invention extracts image features using PVTv2 as the feature extraction component. Then, a deterministic perception component identifies specific regions in the image, uncovering deterministic cues about the target, such as clear boundaries, color, or texture features. After the deterministic perception component identifies these regions, a deterministic information enhancement component strengthens the model's attention to these specific regions within the target, while avoiding interference from background noise and redundant information. Finally, a deterministic propagation component analyzes the relationship between these regions and surrounding pixels, inferring the attributes of uncertain regions and extending to surrounding uncertain regions, thereby gradually and accurately segmenting the target region to obtain the final segmentation result.

[0024] Compared with the prior art, the advantages of the present invention are:

[0025] This invention proposes an industrial defect segmentation system based on deterministic perception and propagation. The deterministic perception module (CAM) quantifies the uncertainties in the inference process and results, thereby further mining deterministic cues about the target in the image. This helps the model learn more accurately about the target and avoids being misled by uncertain regions in the background. The deterministic information enhancement module (CEM) enhances features using deterministic cues, improving the model's attention to deterministic regions within the target and avoiding interference from background noise and redundant information. The deterministic propagation module (CPM) gradually infers surrounding uncertain regions using known deterministic cues, thus progressively improving defect segmentation performance. Through the synergistic effect of these key modules, this invention can more accurately detect and segment hidden industrial defects, providing a reliable quality control method for industrial production. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the overall structure of Embodiment 1 of the present invention.

[0027] Figure 2 This is a schematic diagram of the deterministic perception module CAM structure in Embodiment 1 of the present invention.

[0028] Figure 3 This is a schematic diagram of the CEM structure of each deterministic information enhancement module in Embodiment 1 of the present invention.

[0029] Figure 4 This is a schematic diagram of the CPM structure of each deterministic propagation module in Embodiment 1 of the present invention.

[0030] Figure 5 This is a diagram showing the experimental results of Embodiment 2 of the present invention. Detailed Implementation

[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0032] Example 1

[0033] like Figure 1 As shown, this embodiment discloses an industrial defect segmentation system based on deterministic perception and propagation, named CGNet, which includes a feature extraction part, a deterministic perception part, a deterministic information enhancement part, and a deterministic propagation part. Detailed descriptions are as follows:

[0034] 1. Feature extraction section.

[0035] Due to its powerful feature extraction capabilities and high robustness, the PVTv2 network has become one of the mainstream visual Transformer benchmark models. Therefore, in this embodiment, CGNet uses the PVTv2-B5 network as the feature extraction part to extract multi-scale features of the image.

[0036] Suppose the input industrial defect detection image I has a size of W×H×3, where W and H represent the width and height of the image, respectively. In this embodiment of CGNet, the PVTv2-B5 network extracts high-dimensional features f at four different scales from the industrial defect detection image I. k ,k∈{1,2,3,4}, the resolution of each feature is respectively The number of feature channels are 64, 128, 320, and 512, respectively. This set of features, ranging from high resolution and weak semantics to low resolution and strong semantics, enables comprehensive and multi-scale feature extraction of images.

[0037] The high-dimensional feature f4 at the fourth scale obtained by the PVTv2-B5 network is fed into the deterministic perception part, and the high-dimensional features f1, f2, f3, and f4 at a total of four scales obtained by the PVTv2-B5 network are fed into the deterministic information enhancement part.

[0038] 2. Deterministic perception section.

[0039] In this embodiment of CGNet, the deterministic perception part includes a deterministic perception module (CAM). The CAM is used to perceive the uncertainties present in the model's inference process and results, thereby further mining deterministic cues about the target in the image. This helps the model accurately learn deterministic information about the target and avoids being misled by uncertain regions in the background, leading to incorrect target segmentation or confusion. The structural diagram of the deterministic perception module CAM is shown below. Figure 2 As shown, given input features, the deterministic perception module performs initial segmentation of the target. During this process, the Monte Carlo Dropout method is used to quantify the uncertainty generated during model inference, and the model's prediction uncertainty is calculated using the classification probabilities in the segmentation map. The uncertainty is normalized and scaled to between 0 and 1; inverting and adding one yields the deterministic value. The deterministic map represents the model's confidence in classifying corresponding pixels in the image region during inference and prediction. Multiplying the prediction result map with the deterministic map yields the deterministic map of the target region, i.e., deterministic cues about the target. The output of the deterministic perception module is then input into the deterministic information enhancement module to enhance the features.

[0040] In this embodiment of CGNet, the data processing procedure of the deterministic perception module CAM is as follows:

[0041] (2.1) The high-dimensional feature f4 at the fourth scale extracted by the PVTv2-B5 network is input into the deterministic perception module CAM. The deterministic perception module CAM first uses the Monte Carlo Dropout method to quantify the uncertainty generated during model inference. Specifically, the deterministic perception module CAM uses a 1×1 convolution to initially segment the defect target in the high-dimensional feature f4 at the fourth scale, sets the Dropout rate of the 1×1 convolution to 0.25, and performs four forward propagations, thereby obtaining four predicted segmentation maps M. i ,i∈{1,2,3,4}.

[0042] (2.2) Then the deterministic perception module CAM is based on four predicted segmentation maps M i Obtain the average prediction map The uncertainty map is then used as the basis for inference. Next, the deterministic perception module (CAM) obtains an inferred deterministic map based on the uncertainty map, and a predicted deterministic map based on the average prediction map. Details are as follows:

[0043] The deterministic perception module CAM computes four predicted segmentation maps M i The mean of the elements in the middle is used to obtain the average prediction map. As shown in formula (1):

[0044]

[0045] The deterministic perception module CAM then uses the Sigmoid function to evaluate the average prediction map. Activation is performed to obtain the classification probability p of each pixel being predicted as either background or target. i,j Thus, the predictive deterministic graph is obtained. Classification probability p i,j The closer the value is to 0, the greater the probability that the pixel is classified as background; classification probability p i,j The closer the value is to 1, the higher the probability that the pixel is classified as an object. When the classification probability is close to 0.5, the model has a harder time distinguishing between the object and the background, resulting in lower prediction certainty for that point; when the classification probability is close to 0 or 1, the model can more easily distinguish between the object and the background, resulting in higher prediction certainty for that point. The Sigmoid function is used to evaluate the average prediction image. Activation is performed as shown in formula (2):

[0046]

[0047] In equation (2), For the average prediction chart σ(·) is the Sigmoid activation function.

[0048] The deterministic perception module CAM computes four predicted segmentation maps M i The standard deviation of the elements is used to obtain the uncertainty plot. Then, the uncertainty plot is normalized using Min-Max, inverted, and incremented by 1 to obtain the deterministic plot. As shown in formula (3):

[0049]

[0050] In equation (3), std(·) is the standard deviation function; Norm Min-Max (·) represents Min-Max normalization.

[0051] (2.3) Finally, the deterministic perception module CAM infers the deterministic graph. and predictive deterministic graph After concatenating by channel, a 1×1 convolution is used for deterministic adaptive adjustment and selection, followed by Min-Max normalization and comparison with the average prediction map. Multiplying these together yields the deterministic attention map (MAP). conf And then fed into the feature enhancement part. Deterministic Attention Map (MAP) conf The closer the element value is to 1, the higher the certainty of that pixel in the target region; Deterministic Attention Map (MAP) conf The closer the value of the element is to 0, the lower the certainty of the pixel in the target area. The processing procedure is shown in formula (4):

[0052]

[0053] In equation (4), For the average predicted segmentation map; To infer the deterministic graph; For predicting the deterministic graph; [·] represents the channel concatenation operation; Conv(·) is a 1×1 convolution; Norm Min-Max (·) represents Min-Max normalization.

[0054] 3. Enhanced Deterministic Information Section.

[0055] In this embodiment of CGNet, the deterministic information enhancement part includes four deterministic information enhancement modules (CEMs). Each of the four CEMs corresponds to a high-dimensional feature at a four-level scale, and each CEM also receives the deterministic attention map. The outputs of the four CEMs are then fed into the deterministic propagation part for deterministic propagation.

[0056] Each Deterministic Information Enhancement Module (CEM) enhances features using spatial and channel attention mechanisms and deterministic cues perceived by CAM. This enhances the model's attention to specific regions within the target, avoiding interference from background noise and redundant information. The structure of each CEM is as follows: Figure 3 As shown, the data processing procedure for each deterministic information enhancement module (CEM) is as follows:

[0057] (3.1) In each deterministic information enhancement module (CEM), the deterministic attention map (MAP) is first enhanced by bilinear interpolation. conf The size of the sampled data is adjusted to match the corresponding level of the high-dimensional features in the input, resulting in the adjusted deterministic attention map MAP′. conf .

[0058] (3.2) In each deterministic information enhancement module (CEM), the spatial attention mechanism is used based on the adjusted deterministic attention graph (MAP′). conf Focusing attention on the target-deterministic regions within the corresponding high-dimensional features at the corresponding scale, we obtain the spatial attention-enhanced feature F. SA .

[0059] Specifically, when focusing attention through spatial attention mechanisms, the adjusted deterministic attention map MAP' is first... conf The feature is multiplied by the corresponding high-dimensional feature and then added back to the corresponding high-dimensional feature to preserve detail. Then, CBR processing is performed, which includes 3×3 convolution, batch normalization, and ReLU activation operations, resulting in the spatial attention-enhanced feature F. SA As shown in formula (5):

[0060] F SA =CBR(MAP′) conf ×F+F) (5)

[0061] In equation (5), F represents the corresponding level scale high-dimensional feature of the input; CBR represents 3×3 convolution, batch normalization and ReLU activation operations.

[0062] (3.3) In each deterministic information enhancement module (CEM), the important channels related to the defect segmentation task in the spatial attention improvement features are focused on through the channel attention mechanism, thereby obtaining the target deterministic region features F of spatial and channel attention improvement. SA+CA And then sent to the deterministic propagation section.

[0063] Specifically, when focusing attention through the channel attention mechanism, the spatial attention improvement feature F is first applied. SAGlobal average pooling is performed on each channel to obtain the maximum pixel value in each channel, thereby compressing the feature information. Then, a one-dimensional 1×1 convolution is used to linearly map and transform the compressed information, followed by normalization to between 0 and 1 using the Sigmoid function, thus obtaining the channel attention. Finally, the channel attention and spatial attention are combined to improve the feature F. SA After multiplication, CBR processing is performed, which includes 1×1 convolution, batch normalization, and ReLU activation operations, thereby obtaining the spatially and channel-attention-enhanced target deterministic region features F. SA+CA As shown in formula (6):

[0064] F SA+CA =CBR(Conv1d(GlobalAvgPool(F SA ))*F SA (6)

[0065] In equation (6), F SA Spatial attention is used to improve the features of the input; GlobalAvgPool(·) is global average pooling; Conv1d is one-dimensional convolution; CBR is 1×1 convolution, batch normalization and ReLU activation operation.

[0066] Finally, the target deterministic region features F output by the four deterministic information enhancement modules CEM are... SA+CA It is then sent to the deterministic propagation section for deterministic propagation.

[0067] 4. Deterministic transmission section.

[0068] In this embodiment of CGNet, the deterministic propagation part includes three deterministic propagation modules (CPMs). The first CPM takes into account the target deterministic region features F output by the deterministic information enhancement module (CEM) corresponding to the fourth-level scale high-dimensional features. SA+CA And the target deterministic region feature F output by the CEM module corresponding to the third-level high-dimensional features. SA+CA The second deterministic propagation module, CPM, takes as input the deterministic information enhancement module, CEM, which outputs the target deterministic region feature F corresponding to the second-level scale high-dimensional features. SA+CA In addition to the improved features output by the first deterministic propagation module CPM, the target deterministic region features F output by the deterministic information enhancement module CEM corresponding to the first-level scale high-dimensional features input to the third deterministic propagation module. SA+CA And improved features of the output of the second deterministic propagation module, CPM.

[0069] Each deterministic propagation module (CPM) is responsible for analyzing the relationship between these deterministic target regions and surrounding pixels, thereby inferring the attributes of uncertain regions. It then extends this inference to surrounding uncertain regions, progressively and accurately segmenting the target region to obtain the final segmentation result. This propagation mechanism avoids being misled by uncertain regions and reduces false identification and segmentation of non-target regions. The structure of each CPM is as follows: Figure 4 As shown, each deterministic propagation module (CPM) outputs improved features and an industrial defect prediction segmentation map at the corresponding scale. The specific data processing procedure for each CPM module is as follows:

[0070] (4.1) To maintain spatial consistency of features, each deterministic propagation module (CPM) first uses bilinear interpolation to transform the input higher-level scale features F... h Upsampling is adjusted to match the lower-scale feature F l Same size, and adjust the higher-level scale feature F h Compared with lower-level scale features F l After channel splicing, the spliced ​​features are obtained.

[0071] For the first deterministic propagation module CPM, its input is the target deterministic region feature F output by the deterministic information enhancement module CEM, which corresponds to the fourth-level scale high-dimensional feature. SA+CA And the target deterministic region feature F output by the CEM module corresponding to the third-level high-dimensional features. SA+CA The target deterministic region feature F corresponding to the fourth level scale. SA+CA Considered as a higher-level scale feature F h The target deterministic region feature F corresponding to the third-level scale SA+CA Considered as a lower-level scale feature F l Therefore, in the first deterministic propagation module CPM, the target deterministic region features F corresponding to the fourth scale are... SA+CA Adjusted to target deterministic region feature F corresponding to the third-level scale SA+CA Once the dimensions are consistent, then the parts are assembled.

[0072] For the second deterministic propagation module CPM, its input is the target deterministic region feature F output by the deterministic information enhancement module CEM, which corresponds to the high-dimensional features at the second-level scale. SA+CA And the improved features output by the first deterministic propagation module CPM, where the improved features output by the first deterministic propagation module CPM are regarded as higher-level scale features F. h The target deterministic region feature F corresponding to the second-level scale SA+CA Considered as a lower-level scale feature F lTherefore, in the second deterministic propagation module (CPM), the improved features output by the first deterministic propagation module (CPM) are adjusted to the target deterministic region features F corresponding to the second-level scale. SA+CA Once the dimensions are consistent, then the parts are assembled.

[0073] For the third deterministic propagation module CPM, its input is the target deterministic region feature F output by the deterministic information enhancement module CEM, which corresponds to the high-dimensional features at the first-level scale. SA+CA And the improved features output by the second deterministic propagation module CPM, where the improved features output by the second deterministic propagation module CPM are regarded as higher-level scale features F. h The target deterministic region feature F output by the deterministic information enhancement module CEM corresponding to the first-level high-dimensional features. SA+CA Considered as a lower-level scale feature F l Therefore, in the third deterministic propagation module (CPM), the improved features output by the second deterministic propagation module (CPM) are adjusted to the target deterministic region features F corresponding to the first-level scale. SA+CA Once the dimensions are consistent, then the parts are assembled.

[0074] Then, in each deterministic propagation module (CPM), the concatenated features are processed by CBR to extract the fused features. This CBR processing includes 3×3 convolution, batch normalization, and ReLU activation. Next, the channels are adjusted by 1×1 convolution, thus obtaining the fused feature C, as shown in formula (7):

[0075] C = Conv(CBR([U(F) h ),F l ])) (7)

[0076] In equation (7), U(·) represents the target deterministic region feature F corresponding to the higher-level, higher-dimensional features. SA+CA Bilinear interpolation upsampling; [·] indicates channel concatenation; CBR indicates 3×3 convolution, batch normalization, and ReLU activation operations; Conv indicates 1×1 convolution.

[0077] (4.2) In order to preserve image detail information during feature extraction, each deterministic propagation module (CPM) separates the fused feature C into four groups of separated features c according to channels. i ,i∈{1,2,3,4}, and CBR processing is performed through four parallel branches.

[0078] In each deterministic propagation module (CPM), the second to fourth branches of the four parallel branches perform CBR processing with convolutions at different dilation rates to extract local and global features of the image under different receptive fields. Specifically, the first branch's CBR processing includes 3×3 convolution, batch normalization, and ReLU activation, while the second to fourth branches' CBR processing each includes 3×3 dilated convolution, batch normalization, and ReLU activation, with the dilation rate of the dilated convolution increasing from the second to the fourth branch.

[0079] The first set of separated features c1 is processed by CBR in the first branch to obtain the first branch output feature c′1. The first branch output feature c′1 is added element-wise to the second set of separated features c2 and then processed by CBR in the second branch to obtain the second branch output feature c′2. The second branch output feature c′2 is added element-wise to the third set of separated features c3 and then processed by CBR in the third branch to obtain the third branch output feature c′3. The third branch output feature c′3 is added element-wise to the fourth set of separated features c4 and then processed by CBR in the fourth branch to obtain the fourth branch output feature c′4. The semantic information is enhanced by adding elements-wise. The existing semantic information is enhanced by adding features across branches and gradually expanding convolution, and the receptive field is expanded from local to global, realizing the gradual propagation of the current deterministic information to the surrounding uncertain areas. Then, the first to fourth branch output features c′1, c′2, c′3, and c′4 are concatenated by channel to obtain the concatenated feature C′. The specific process is shown in formulas (8)-(10).

[0080] c′1=CBR(c1) (8)

[0081] c′ k =DCBR d=k (c′ k-1 +c k ),k∈{2,3,4} (9)

[0082] C′=[c′1,c′2,c′3,c′4] (10)

[0083] In equations (8)-(10), CBR represents 3×3 convolution, batch normalization, and ReLU activation operations; DCBR d=k [ ] represents the 3×3 dilated convolution, batch normalization, and ReLU activation operations with a dilation rate of k, i.e., the CBR processing of the corresponding branch; [·] represents channel splicing.

[0084] (4.3) In each deterministic propagation module (CPM), the concatenated feature C′ is adjusted and scaled using a 1×1 convolution, then residually connected to the fused feature C, and finally CBR processing is performed to integrate contextual information, thereby obtaining the improved feature F′ at the corresponding scale of the deterministic propagation module CPM. h The CBR processing in this study includes 3×3 convolution, batch normalization, and ReLU activation. Finally, the improved feature F′ obtained from each deterministic propagation module CPM is calculated. h A 1×1 convolution process is performed to obtain the industrial defect prediction segmentation map P at the corresponding scale. Specifically, it is shown in formula (11):

[0085] P = Conv(F′) h )=Conv(CBR(Conv(C′)+C)) (11)

[0086] In equation (11), CBR is a 3×3 convolution, batch normalization and ReLU activation operation; Conv is a 1×1 convolution.

[0087] In this embodiment, the improved feature F′ obtained by the first deterministic propagation module CPM is h The input is fed into the second deterministic propagation module CPM as a higher-level scale feature F. h The improved feature F′ obtained by the second deterministic propagation module CPM h The input is fed into the third deterministic propagation module CPM as a higher-level scale feature F. h This allows for more refined predictions by combining low-level features.

[0088] Therefore, through the three deterministic propagation modules (CPM) in the deterministic propagation part, three industrial defect prediction segmentation maps of different scales are obtained, and the industrial defect prediction segmentation map output by the third deterministic propagation module (CPM) is used as the final prediction result. Furthermore, during the training of CGNet in this embodiment, all three industrial defect prediction segmentation maps participate in supervised training as part of the loss function, but the final prediction result is the industrial defect prediction segmentation map output by the third deterministic propagation module (CPM).

[0089] The loss function for training CGNet in this embodiment is explained below:

[0090] Unlike the standard IoU and BCE loss for segmentation tasks, and Weighted intersection-union (IOU) and binary cross-entropy (BCE) losses, representing global and local (pixel-level) constraints, increase the weight of hard-to-distinguish pixels, highlighting the importance of hard-to-distinguish regions. and The loss is calculated as shown in formulas (12) and (13):

[0091]

[0092] In formulas (12) and (13), I() is an indicator function; γ is an adjustable hyperparameter; l∈{0,1} represents two labels; G ij and p ij Let Pr(p) represent the predicted and true values ​​of the pixel at position (i, j) in the image, respectively; ij =l|ψ) represents the predicted probability.

[0093] α ij This represents the element at position (i, j) in the weight matrix α. and In this algorithm, each pixel is assigned a weight α. Pixels that are difficult to distinguish correspond to larger α values, while pixels that are easy to distinguish are assigned smaller α values. α can be considered an indicator of pixel importance, calculated based on the difference between the center pixel and its surrounding pixels. ij As shown in formula (14):

[0094]

[0095] In formula (14), A ij (i, j) represents the region (usually an 8-neighborhood) surrounding pixel (i, j) in the truth map G; (m, n) represents the region belonging to A. ij Points within the region, where m is the x-coordinate and n is the y-coordinate; G mn This represents the predicted value at position (m, n) in the truth map; in formula (14) This indicates that region A ij The sum of the truth values ​​of all points within the range. For all pixels, α ij ∈[0,1]. If α ij If α is large, then the pixel at (i, j) is significantly different from its surrounding pixels. Therefore, it is an important pixel (e.g., an edge or a hole) and deserves more attention. Conversely, if α... ij If it is very small, it is considered an ordinary pixel and not worth paying attention to.

[0096] Based on the above theory, the output prediction map is upsampled to the same size as the ground truth map G. Then, the loss function L used for the final training in CGNet in this embodiment is as shown in formula (15):

[0097]

[0098] In formula (15), G is the target truth map; The average prediction plot in CAM; P iThis is the prediction graph for the i-th CPM output.

[0099] Example 2

[0100] This embodiment is a comparative experiment between CGNet described in Embodiment 1 and other SOTA methods in the field of industrial camouflage defect segmentation. The specific details are as follows:

[0101] (A) Experimental Setup

[0102] This experimental example uses an NVIDIA RTX 3090 GPU (24GB RAM), and the CGNet model code is built using Python and PyTorch frameworks. Additionally, as described in Example 1, CGNet uses the Adam optimizer to update model parameters, with an initial learning rate of 1e-4, training for 150 epochs, a batch size of 8, and input image dimensions uniformly adjusted to 384×384 pixels.

[0103] (B) Dataset and Evaluation Metrics

[0104] This experimental example uses CDS2K as the training and testing dataset for CGNet described in Example 1. Released in 2023 by Vanden et al., CDS2K is the first benchmark dataset for masquerading industrial defects for application scenarios, compiled from various established industrial defect libraries. The dataset contains 2492 samples, including 1330 positive samples and 1162 negative samples. The training and testing sets are divided in an 8:2 ratio. 1064 images from the positive samples are randomly selected as the training set, and 266 images are used as the test set for algorithm performance verification. Figure 5 The results of segmenting some of the test data are shown.

[0105] The experimental example used to evaluate the prediction performance of the CGNet model described in Example 1 mainly included the mean absolute error (M) and the F-metric (F). β ), Enhanced matching index (E) φ ), structural metric (S) α Among these, the smaller the MAE value and the larger the values ​​of other indicators, the better the model performance.

[0106] (C) Comparison of experimental performance

[0107] In this experimental example, the CGNet described in Example 1 and other state-of-the-art methods in the field of industrial camouflage defect segmentation (based on the benchmark methods introduced in the dataset-related paper Advances in Deep Concealed Scene Understanding) were compared using quantitative metrics. The dataset partitioning and experimental hyperparameter settings for the other methods were the same as those in this experiment. The comparative experimental results are shown in Table 1.

[0108] Table 1 Comparison of experimental results

[0109]

[0110] from Figure 5 As can be seen, CGNet described in Example 1 exhibits excellent segmentation performance in detecting various types of industrial defects, achieving accurate segmentation of hidden defects. Table 1 shows that, compared with existing cutting-edge hidden defect detection methods, CGNet described in Example 1 achieves significant improvements in all indicators, demonstrating its superiority and feasibility in practical industrial applications.

[0111] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. These embodiments are merely descriptions of preferred embodiments and are not intended to limit the scope or concept of the invention. The specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. Such combinations, as long as they do not violate the spirit of the present invention, should also be considered as part of this disclosure. To avoid unnecessary repetition, the present invention will not further describe the various possible combinations.

[0112] This invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this invention and without departing from the design idea of ​​this invention, all modifications and improvements made by those skilled in the art to the technical solutions of this invention should fall within the protection scope of this invention. The technical content for which protection is sought in this invention has been fully described in the claims.

Claims

1. An industrial defect segmentation system based on deterministic perception and propagation, characterized in that, It includes feature extraction, deterministic perception, deterministic information enhancement, and deterministic propagation. The feature extraction part extracts high-dimensional features at four different scales from the industrial defect detection image, and sends the high-dimensional features at the fourth scale to the deterministic perception part, and sends the high-dimensional features at all four scales to the deterministic information enhancement part. The deterministic perception component includes a deterministic perception module (CAM). The CAM first quantifies uncertainty based on high-dimensional features at a fourth-level scale using the Monte Carlo Dropout method, resulting in four predicted segmentation maps. Then, the CAM obtains an average predicted map and an inferred uncertainty map based on the four predicted segmentation maps. Next, the CAM obtains an inferred deterministic map based on the inferred uncertainty map and a predicted deterministic map based on the average predicted map. Finally, the CAM concatenates the inferred deterministic map and the predicted deterministic map, then performs convolution and Min-Max normalization sequentially before multiplying it with the average predicted map to obtain a deterministic attention map, which is then fed into the deterministic information enhancement component. The deterministic information enhancement part includes four deterministic information enhancement modules (CEMs). Each of the four CEMs corresponds to a high-dimensional feature at a four-level scale, and each CEM also inputs the deterministic attention map. In each CEM, the size of the deterministic attention map is first adjusted to match the input high-dimensional feature at the corresponding level. Then, a spatial attention mechanism is used to focus on the deterministic region of the target in the high-dimensional feature at the corresponding level based on the adjusted deterministic attention map, thereby obtaining the spatial attention improved feature. Finally, each deterministic information enhancement module (CEM) focuses on important channels related to the defect segmentation task in the spatial attention improvement features through a channel attention mechanism, thereby obtaining the target deterministic region features of spatial and channel attention improvement and sending them into the deterministic propagation part; The deterministic propagation component includes three deterministic propagation modules (CPMs). The first CPM takes into account the target deterministic region features output by the deterministic information enhancement module (CEM) corresponding to the fourth-level scale high-dimensional features, and the target deterministic region features output by the third-level scale high-dimensional features. The second CPM takes into account the target deterministic region features output by the second-level scale high-dimensional features and the improved features output by the first CPM. The third CPM takes into account the target deterministic region features output by the first-level scale high-dimensional features and the improved features output by the second CPM. In each deterministic propagation module (CPM), the input features at higher and lower scales are first concatenated by channels, followed by CBR processing and convolutional adjustment of channels to obtain fused features. Next, each CPM separates the fused features into four groups of separated features by channels, and performs CBR processing through four branches. The first group of separated features is processed by the first branch to obtain the first branch output feature. This first branch output feature is added to the second group of separated features and then processed by the second branch to obtain the second branch output feature. The second branch output feature is added to the third group of separated features and then processed by the third branch to obtain the third branch output feature. The third branch output feature is added to the fourth group of separated features and then processed by the fourth branch to obtain the fourth branch output feature. The first to fourth branch output features are then concatenated by channels to obtain the concatenated feature. Finally, each CPM adjusts the channels of the concatenated feature through convolution and performs a residual connection with the fused feature, followed by CBR processing to integrate contextual information, thereby obtaining the improved feature. Finally, each deterministic propagation module (CPM) performs convolution processing on the improved features to obtain the industrial defect prediction segmentation map; Therefore, through the three deterministic propagation modules (CPM) in the deterministic propagation section, three industrial defect prediction segmentation maps of different scales are obtained, and the industrial defect prediction segmentation map output by the third deterministic propagation module (CPM) is used as the final prediction result.

2. The industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, The feature extraction part is a PVTv2 network.

3. The industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, The deterministic perception module CAM calculates the mean of elements in four predicted segmentation maps to obtain an average predicted map. The deterministic perception module CAM calculates the standard deviation of elements in four predicted segmentation maps to obtain an inference uncertainty map.

4. The industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, The deterministic perception module CAM normalizes the inference uncertainty graph using Min-Max, then inverts the normalization and adds 1 to obtain the inference deterministic graph. The deterministic perception module CAM uses the Sigmoid function to activate the average prediction map, thereby obtaining a predictive deterministic map.

5. An industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, In each deterministic information enhancement module (CEM), when focusing attention through the spatial attention mechanism, the adjusted deterministic attention map is multiplied by the corresponding level-scale high-dimensional feature and then added to the corresponding level-scale high-dimensional feature. Then, CBR processing is performed to obtain the spatial attention improved feature.

6. An industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, When focusing attention in each deterministic information enhancement module (CEM) through the channel attention mechanism, the spatial attention enhancement features are first subjected to global average pooling to obtain compressed information. Then, the compressed information is linearly mapped and transformed, and then normalized by the Sigmoid function to obtain channel attention. Finally, the channel attention is multiplied by the spatial attention enhancement features, and then CBR processing is performed to obtain the target deterministic region features with spatial and channel attention enhancement.

7. An industrial defect segmentation system based on deterministic perception and propagation according to claim 1, characterized in that, In each deterministic propagation module (CPM) of the deterministic propagation part, the CBR processing of the first branch includes 3×3 convolution, batch normalization, and ReLU activation. The CBR processing of the second to fourth branches includes 3×3 dilated convolution, batch normalization, and ReLU activation, respectively. Furthermore, the dilation rate of the dilated convolution increases from the second to the fourth branch in the CBR processing.

Citation Information

Patent Citations

  • Multi-scale polyp segmentation method and system based on PVT

    CN117132774A

  • Colon polyp image segmentation method based on shape perception and feature enhancement

    CN117934510A