Multi-mode image-based multi-task defect segmentation method and system

By building a multimodal feature fusion network and a multi-task segmentation network, the problem of incomplete information of the traditional single-modal image detection method is solved, more efficient defect detection is achieved, and the accuracy and robustness of the detection are improved.

CN118887244AActive Publication Date: 2024-11-01BEIJING ZHIMOU FUTURE TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411377670.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-11-01
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

Traditional single-modal image detection methods are difficult to fully capture the detailed information of product defects, especially when detecting hidden or complex defects, the information is incomplete, resulting in poor defect detection efficiency.

Method used

Using multi-task defect segmentation method based on multi-modal images, by constructing a multi-modal feature fusion network, image data of different modes is fused into a unified feature domain, and a multi-task segmentation network is built, and the network is trained using the training set. Achieve surface defects, internal defects and edge detection.

Benefits of technology

It improves the accuracy and robustness of defect detection, can capture product defect information more comprehensively, and enhances the technical support for industrial automation inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887244A_ABST
    Figure CN118887244A_ABST
Patent Text Reader

Abstract

The invention provides a multi-task defect segmentation method and system based on a multi-modal image. The method comprises the following steps: constructing a multi-modal feature fusion network according to multi-modal image data; processing the image data of different modes by using different branches of the multi-mode feature fusion network, and mapping feature vectors corresponding to the image data of different modes to a unified feature domain through a feature converter to form fusion features; based on the fusion features, constructing a multi-task segmentation network, and training the multi-task segmentation network through a training set constructed by multi-modal image data containing marked defect positions; and utilizing the trained multi-task segmentation network to segment the obtained target multi-modal image so as to output the defect category to which each pixel in the target multi-modal image belongs and the corresponding confidence coefficient. According to the technical scheme provided by the invention, the defect detection efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of defect detection technology, and in particular to a multi-task defect segmentation method and system based on multimodal images. Background Art

[0002] In the field of modern industrial manufacturing, especially in precision manufacturing and automated production lines, product quality control has become increasingly stringent. In order to ensure high product quality standards, manufacturers need to implement efficient defect detection during the production process. The integration and analysis of multimodal image data has become a new trend. This technical requirement aims to more accurately identify product defects, such as surface flaws, internal cracks, or irregular material edges, by collecting information through multiple sensing methods.

[0003] Traditional visual inspection methods often rely only on single-modality image data, such as visible light images or infrared images. Such methods are difficult to fully capture detailed information about product defects.

[0004] Since traditional defect detection methods usually only use image data of a single modality, this leads to incomplete information, especially when detecting hidden or complex defects, single modality data may not provide sufficient diagnostic information. Summary of the invention

[0005] The embodiments of the present application provide a multi-task defect segmentation method and system based on multimodal images to solve the problem of poor defect detection efficiency in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a multi-task defect segmentation method based on multimodal images, comprising: Construct a multimodal feature fusion network based on multimodal image data; Using different branches of the multimodal feature fusion network to process image data of different modalities, and mapping feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form fusion features; Based on the fusion features, a multi-task segmentation network is constructed, and the multi-task segmentation network is trained by a training set constructed by multimodal image data containing labeled defect locations, wherein the multi-task segmentation network is used to simultaneously perform multiple segmentation tasks, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; The acquired target multimodal image is segmented using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level, wherein the confidence level refers to the degree of certainty of the multi-task segmentation network's prediction result on the defect category to which each pixel in the target multimodal image belongs.

[0007] Optionally, constructing a multimodal feature fusion network according to the multimodal image data includes: Designing a multimodal feature extractor, wherein the multimodal feature extractor comprises a plurality of branches, each branch being used for processing image data of a different modality; Extracting feature vectors from the image data of the corresponding modality through the deep convolutional neural network of each branch, and introducing an adaptive attention mechanism in each branch to enhance the feature vectors extracted from the multimodal image data; The feature vectors extracted from image data of different modalities are used to construct a multimodal feature fusion network.

[0008] Optionally, constructing a multi-task segmentation network based on the fusion features includes: Design a multi-head segmentation architecture, wherein the multi-head segmentation architecture includes multiple segmentation heads, each segmentation head is used to process a corresponding segmentation task; Refining the fused features through at least one convolutional layer within each segmentation head to generate a segmentation mask; Based on the segmentation mask, a multi-task segmentation network is constructed.

[0009] Optionally, the training of the multi-task segmentation network using a training set constructed by multimodal image data containing labeled defect locations comprises: Initializing initial parameter values ​​of the multi-task segmentation network using model parameters pre-trained on a large general dataset; For each multimodal image data containing annotated defect positions in the training set, respectively calculate the loss value corresponding to each segmentation task, and calculate the total loss value of the multi-task segmentation network based on the preset multi-task loss function and the loss value of each segmentation task; Based on the total loss value, dynamically adjust the weight of each segmentation task to optimize the performance of the multi-task segmentation network on each segmentation task; By using a back propagation algorithm, the initial parameter values ​​of the multi-task segmentation network are updated according to the adjusted task weights and the total loss value to complete the training of the multi-task segmentation network.

[0010] Optionally, mapping feature vectors corresponding to image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature includes: Through a preset feature fusion function, the feature vectors corresponding to the image data of different modalities are mapped to a unified feature domain to form a fusion feature; Wherein, the preset feature fusion function is defined as:

[0011] in, represents the preset feature fusion function, Represents the weight coefficient, which is used to adjust the Modal Features The importance of Indicates The feature vector corresponding to the modality image data, Represents the cross-term coefficient, which is used to measure the interaction between different modal features. represents the logarithmic term coefficient, which is used to adjust the relative strength of the modal characteristics. It represents the number of image data of different modalities.

[0012] Optionally, calculating the total loss value of the multi-task segmentation network according to a preset multi-task loss function and the loss value of each segmentation task includes: The total loss value of the multi-task segmentation network is calculated by the following formula:

[0013] in, Expressed as the total loss value, Indicates The loss value of the segmentation task is Indicates The weight coefficient of the segmentation task, represents the coefficient for adjusting the sum of squared losses between tasks, represents the coefficient for adjusting the sum of inter-task loss indices, It represents the number of different segmentation tasks in the multi-task segmentation network.

[0014] Optionally, it also includes: An inter-task coordination term is added to the multi-task loss function, wherein the inter-task coordination term is defined as:

[0015] in, represents the inter-task coordination item, Represents the segmentation task The loss value and segmentation tasks The loss value The correlation between Represents the weight coefficient, which is used to adjust the impact of the mean difference between tasks. Represents the segmentation task The loss value The mean of Represents the segmentation task The loss value The mean of The correlation is expressed by the Pearson correlation coefficient Sure, , Represents the segmentation task In the sample The loss value on Represents the segmentation task In the sample The loss value on Represents the segmentation task The loss value The average value of Represents the segmentation task The loss value The average value of represents the number of samples; The adjusted multi-task loss function is expressed as:

[0016] in, represents the adjusted multi-task loss function, is the weight coefficient of the inter-task coordination term.

[0017] In a second aspect, an embodiment of the present application provides a multi-task defect segmentation system based on multimodal images, comprising: A construction module, used for constructing a multimodal feature fusion network according to multimodal image data; A processing module, used to process image data of different modalities using different branches of the multimodal feature fusion network, and map feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature; A training module, configured to construct a multi-task segmentation network based on the fusion features, and train the multi-task segmentation network using a training set constructed from multi-modal image data containing labeled defect locations, wherein the multi-task segmentation network is configured to simultaneously perform multiple segmentation tasks, the multiple segmentation tasks including surface defect segmentation, internal defect segmentation, and edge detection; The output module is used to segment the acquired target multimodal image using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level, wherein the confidence level refers to the degree of certainty of the multi-task segmentation network's prediction result on the defect category to which each pixel in the target multimodal image belongs.

[0018] In a third aspect, an embodiment of the present application provides a computing device, comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the multi-task defect segmentation method based on multimodal images as described in the first aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, which, when executed by a computer, implements the multi-task defect segmentation method based on multimodal images as described in the first aspect.

[0020] In an embodiment of the present application, a multimodal feature fusion network is constructed based on multimodal image data; different branches of the multimodal feature fusion network are used to process image data of different modalities, and feature vectors corresponding to image data of different modalities are mapped to a unified feature domain through a feature converter to form fusion features; based on the fusion features, a multitask segmentation network is constructed, and the multitask segmentation network is trained through a training set constructed by multimodal image data containing labeled defect locations, wherein the multitask segmentation network is used to perform multiple segmentation tasks simultaneously, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; the acquired target multimodal image is segmented using the trained multitask segmentation network to output the defect category and corresponding confidence level of each pixel in the target multimodal image. The technical solution and method provided by the present application can not only improve the performance of industrial image processing systems, but also provide strong technical support for industrial automation detection.

[0021] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 A flowchart of a multi-task defect segmentation method based on multi-modal images provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a multi-task defect segmentation system based on multi-modal images provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0025] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0027] Figure 1 A flowchart of a multi-task defect segmentation method based on multi-modal images is provided for an embodiment of the present application, such as Figure 1 As shown, the method includes: 101. Construct a multimodal feature fusion network based on multimodal image data; Optionally, the "constructing a multimodal feature fusion network based on multimodal image data" in step 101 includes: designing a multimodal feature extractor, the multimodal feature extractor comprising multiple branches, each branch being used to process image data of a different modality; extracting feature vectors from the image data of the corresponding modality through a deep convolutional neural network of each branch, and introducing an adaptive attention mechanism in each branch to enhance the feature vectors extracted from the multimodal image data; and constructing a multimodal feature fusion network based on the feature vectors extracted from the image data of different modalities.

[0028] In this step, the concepts involved in "constructing a multimodal feature fusion network based on multimodal image data" include multimodal feature extractor, deep convolutional neural network (DCNN), adaptive attention mechanism (AAM) and feature vector fusion.

[0029] Multimodal feature extractor: refers to a network structure that can process image data from different modalities (such as visible light images, infrared images, ultrasonic images, etc.) and extract useful features from them. It usually consists of multiple branches, each of which is responsible for processing data of a specific modality.

[0030] Deep Convolutional Neural Network (DCNN): It is a deep learning model that can automatically learn the hierarchical features in images by stacking multiple convolutional layers, pooling layers, and fully connected layers. In a multimodal feature extractor, each branch can be a DCNN to extract features of the corresponding modality image.

[0031] Adaptive Attention Mechanism (AAM): is a mechanism that enables the model to focus on the importance of different parts of the input data. In the process of multimodal feature extraction, AAM can help the model identify which features are most helpful for the final task and give them higher weights.

[0032] Feature vector fusion: refers to integrating feature vectors extracted from different modal image data to form a unified feature representation. This process can be achieved by directly concatenating feature vectors, weighted summation, or other methods.

[0033] In the embodiment of this application, it is assumed that we need to detect surface defects (such as scratches, cracks, etc.) and internal defects (such as bubbles, holes, etc.) of products in an industrial manufacturing environment. To this end, we use two modal data: visible light images and X-ray images. The following describes in detail how to build a multimodal feature fusion network based on these two multimodal image data.

[0034] Design of multimodal feature extractor: We design a multimodal feature extractor with two branches. The first branch is used to process visible light image data, and the second branch is used to process X-ray image data.

[0035] Extract feature vectors through the deep convolutional neural network of each branch: Each branch consists of a DCNN to extract feature vectors in the corresponding modality image. For example, for the visible light image branch, we can use ResNet-50 as the base model for feature extraction. Similarly, for the X-ray image branch, a similar model can be used for feature extraction.

[0036] For the visible light image branch, assuming that the input image size is 224x224, after ResNet-50, the resulting feature map size is 7x7x2048 (i.e., height 7, width 7, and number of channels 2048).

[0037] For the X-ray image branch, assuming that the input image size is also 224x224, after ResNet-50, a 7x7x2048 feature map is also obtained.

[0038] Introducing adaptive attention mechanism: To enhance the effect of feature extraction, we introduce an adaptive attention mechanism after the DCNN of each branch. The adaptive attention mechanism adjusts the weights in the feature map by learning the importance of features at different positions.

[0039] The adaptive attention mechanism can take the form of SENet (Squeeze-and-Excitation Networks), which compresses the feature map into a fixed-length vector through global average pooling (GAP), then generates a weight vector through two fully connected layers, and multiplies this weight vector with the original feature map to achieve feature selection.

[0040] Construct a multimodal feature fusion network based on the feature vectors extracted from image data of different modalities: We fuse the feature vectors processed by the adaptive attention mechanism. We can simply concatenate the feature vectors of the two branches to form a new feature vector as the input for subsequent tasks (such as defect segmentation).

[0041] For example, the feature map after processing by the adaptive attention mechanism is still 7x7x2048. After concatenating the feature maps of the two branches, we get a feature vector of 7x7x4096.

[0042] Through the above steps, we have successfully built a feature fusion network capable of processing multimodal image data, which can capture the information of product defects more comprehensively, thereby improving the accuracy and robustness of detection.

[0043] 102. Using different branches of the multimodal feature fusion network to process image data of different modalities, and mapping feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form fusion features; Optionally, in step 102, “the feature vectors corresponding to the image data of different modalities are mapped to a unified feature domain by a feature transformer to form a fusion feature” includes: mapping the feature vectors corresponding to the image data of different modalities to a unified feature domain by a preset feature fusion function to form a fusion feature; Wherein, the preset feature fusion function is defined as:

[0044] in, represents the preset feature fusion function, Represents the weight coefficient, which is used to adjust the Modal Features The importance of Indicates The feature vector corresponding to the modality image data, Represents the cross-term coefficient, which is used to measure the interaction between different modal features. Represents the logarithmic term coefficient, which is used to adjust the relative strength of the modal characteristics.

[0045] In this step, the concepts involved in "mapping feature vectors corresponding to image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature" include feature fusion function, weight coefficient, cross-term coefficient and logarithmic term coefficient.

[0046] Feature fusion function: is a mathematical function used to map data from different modalities to the same feature domain, thereby forming a unified feature representation. This helps to integrate multimodal information for subsequent processing.

[0047] Weight coefficient ( ): Used to adjust the importance of each modality feature. Different modalities may play different roles in different tasks, so by setting appropriate weight coefficients, the model can pay more attention to those more important features.

[0048] The cross-term coefficient ( ): It is used to measure the interaction between different modal features. By introducing the cross term, the mutual dependence between different modal features can be captured.

[0049] The coefficient of the logarithmic term ( ): used to adjust the relative strength of modal features. The logarithmic term can help the model better handle the proportional relationship between features, especially when the eigenvalues ​​differ greatly.

[0050] In the present application, we continue to use the example of using visible light images and X-ray images to detect product defects in an industrial manufacturing environment mentioned above. The following are the detailed implementation steps: Processing image data of different modalities through different branches of the multimodal feature fusion network: First, we use different branches of the multimodal feature fusion network to process image data of different modalities. Suppose we have two branches, one for processing visible light image data and the other for processing X-ray image data.

[0051] Extract feature vector: Each branch extracts the feature vector of the corresponding modality image through a deep convolutional neural network (DCNN). For example, assuming that we use ResNet-50 as the base model, the dimension of the extracted feature vector is 2048.

[0052] Map feature vectors through a preset feature fusion function: In order to map feature vectors of different modalities to a unified feature domain, we use a preset feature fusion function The feature fusion function is defined as:

[0053] in, Represents the preset feature fusion function.

[0054] Represents the weight coefficient, which is used to adjust the Modal Features The importance of.

[0055] Indicates The feature vector corresponding to the image data of the modality.

[0056] Represents the cross-term coefficient, which is used to measure the interaction between different modal features.

[0057] Represents the logarithmic term coefficient, which is used to adjust the relative strength of the modal characteristics.

[0058] It represents the number of image data of different modalities.

[0059] Set parameters and calculate fusion features: Assume we have two modalities , and given If the extracted feature vector is and , then the fusion feature is calculated as follows:

[0060] First calculate the weighted sum part:

[0061] Then calculate the cross term:

[0062] Finally, calculate the logarithmic part:

[0063] The final fusion features are:

[0064] Through the above steps, we successfully mapped the feature vectors of different modalities to a unified feature domain and formed fusion features. This method can fully utilize the advantages of different modal information and improve the accuracy and robustness of subsequent tasks (such as defect detection).

[0065] 103. Based on the fusion features, a multi-task segmentation network is constructed, and the multi-task segmentation network is trained by a training set constructed by multimodal image data containing labeled defect locations, wherein the multi-task segmentation network is used to simultaneously perform multiple segmentation tasks, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; Optionally, the "constructing a multi-task segmentation network based on the fused features" in step 103 includes: designing a multi-head segmentation architecture, the multi-head segmentation architecture comprising multiple segmentation heads, each segmentation head being used to process a corresponding segmentation task; refining the fused features through at least one convolutional layer within each segmentation head to generate a segmentation mask; and constructing a multi-task segmentation network based on the segmentation mask.

[0066] Optionally, in step 103, “the multi-task segmentation network is trained by using a training set constructed by multi-modal image data containing labeled defect positions” includes: initializing the initial parameter values ​​of the multi-task segmentation network using model parameters pre-trained on a large general data set; for each multi-modal image data containing labeled defect positions in the training set, respectively calculating the loss value corresponding to each segmentation task, and calculating the total loss value of the multi-task segmentation network based on a preset multi-task loss function and the loss values ​​of each segmentation task; The total loss value of the multi-task segmentation network is calculated based on the preset multi-task loss function and the loss value of each segmentation task, including: The total loss value of the multi-task segmentation network is calculated by the following formula:

[0067] in, Expressed as the total loss value, Indicates The loss value of the segmentation task is Indicates The weight coefficient of the segmentation task, represents the coefficient for adjusting the sum of squared losses between tasks, represents the coefficient for adjusting the sum of inter-task loss indices, It represents the number of different segmentation tasks in the multi-task segmentation network.

[0068] Based on the total loss value, dynamically adjust the weight of each segmentation task to optimize the performance of the multi-task segmentation network on each segmentation task; By using a back propagation algorithm, the initial parameter values ​​of the multi-task segmentation network are updated according to the adjusted task weights and the total loss value to complete the training of the multi-task segmentation network.

[0069] In this step, the concepts involved in "building a multi-task segmentation network based on the fusion features, and training the multi-task segmentation network through a training set constructed by multimodal image data with labeled defect locations" include multi-head segmentation architecture, segmentation mask, multi-task loss function, back propagation algorithm, and dynamic adjustment of task weights.

[0070] Multi-head segmentation architecture: a network structure that contains multiple segmentation heads, each of which is responsible for handling a specific segmentation task. This allows the network to perform multiple tasks simultaneously, improving the versatility and efficiency of the model.

[0071] Segmentation mask: It is a two-dimensional array of the same size as the input image, where each element represents the probability or confidence that the corresponding pixel belongs to a certain category. Segmentation mask is used to mark different areas in the image.

[0072] Multi-task loss function: It is a function that comprehensively considers the losses of multiple tasks. It is used to measure the overall performance of the model on multiple tasks and adjust the model parameters accordingly.

[0073] Backpropagation algorithm: is an algorithm for training neural networks by calculating the gradient of the loss function with respect to the network parameters and updating the network parameters based on these gradients to minimize the loss function.

[0074] Dynamically adjust task weights: In multi-task learning, in order to make the model perform balanced on each task, the overall performance of the model can be optimized by dynamically adjusting the weight of each task.

[0075] In the present application, we continue to use the example of using visible light images and X-ray images to detect product defects in an industrial manufacturing environment mentioned above. The following are the detailed implementation steps: Designing a multi-head segmentation architecture: We design a multi-task segmentation network which consists of three segmentation heads for surface defect segmentation, internal defect segmentation, and edge detection, respectively.

[0076] The fused features are refined by at least one convolutional layer inside each segmentation head to generate a segmentation mask: Each segmentation head contains one or more convolutional layers for further processing the fused features. These convolutional layers refine the fused features into a segmentation mask relevant to a specific task.

[0077] For example, for the surface defect segmentation head, we can add two convolutional layers based on the fused features, each convolutional layer is followed by a ReLU activation function, and finally a softmax layer to generate the segmentation mask.

[0078] The same approach is applied to the internal defect segmentation header and the edge detection segmentation header.

[0079] Constructing a multi-task segmentation network based on segmentation masks: After generating the segmentation masks for each segmentation task, we connect these segmentation heads together to form a multi-task segmentation network.

[0080] Initialize the initial parameter values ​​of the multi-task segmentation network using model parameters pre-trained on large general datasets: To avoid training from scratch, we initialize our multi-task segmentation network using model parameters that have been pre-trained on large datasets such as ImageNet.

[0081] For each multimodal image data containing annotated defect locations in the training set, the loss value corresponding to each segmentation task is calculated respectively, and the total loss value of the multi-task segmentation network is calculated based on the preset multi-task loss function and the loss value of each segmentation task: Set the multi-task loss function to:

[0082] in, represents the total loss value, represents the loss value of the j-th segmentation task, represents the weight coefficient of the jth segmentation task, represents the coefficient for adjusting the sum of squared losses between tasks, represents the coefficient for adjusting the sum of inter-task loss indices, It represents the number of different segmentation tasks in the multi-task segmentation network.

[0083] For example, suppose we have three tasks , and given If we calculate , then the total loss value The calculation is as follows:

[0084] Based on the total loss value, dynamically adjust the weight of each segmentation task to optimize the performance of the multi-task segmentation network on each segmentation task: Based on the total loss value and the actual performance of each task, we can dynamically adjust the weight of each task to optimize the overall performance of the model.

[0085] Through the back propagation algorithm, the initial parameter values ​​of the multi-task segmentation network are updated according to the adjusted task weights and the total loss value to complete the training of the multi-task segmentation network: Use the back propagation algorithm to update the network parameters according to the calculated gradients until the model converges.

[0086] Through the above steps, we successfully built and trained a multi-task segmentation network that can simultaneously perform multiple tasks such as surface defect segmentation, internal defect segmentation, and edge detection. This approach not only improves the accuracy and efficiency of detection, but also enhances the robustness and generalization ability of the model.

[0087] 104. Segment the acquired target multimodal image using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level.

[0088] The confidence level refers to the degree of certainty of the prediction result of the multi-task segmentation network on the defect category to which each pixel in the target multimodal image belongs.

[0089] In this step, the concepts involved in "segmenting the acquired target multimodal image using the trained multi-task segmentation network to output the defect category and the corresponding confidence level to which each pixel in the target multimodal image belongs" include target multimodal image, segmentation, defect category and confidence level.

[0090] Target multimodal image: refers to the actual image data that needs to be tested. These images may come from different sensors, such as visible light cameras, infrared cameras, X-ray machines, etc., and are used to comprehensively analyze product defects.

[0091] Segmentation: In this context refers to the process of assigning each pixel in an image to a specific class or label, usually achieved through a Convolutional Neural Network (CNN).

[0092] Defect category: refers to the specific type of defects in the image, such as surface defects, internal defects, etc.

[0093] In the present application, we continue to use the example of using visible light images and X-ray images to detect product defects in an industrial manufacturing environment mentioned above. The following are the detailed implementation steps: Prepare target multimodal images: First, we need to obtain product images to be inspected, which can be real-time images from the production line or test images extracted from the database. Suppose we have a set of target multimodal images including visible light images and X-ray images.

[0094] Input multimodal images to the multi-task segmentation network: Input the acquired target multimodal images into the trained multi-task segmentation network. The network contains three segmentation heads, which are used to process surface defect segmentation, internal defect segmentation and edge detection respectively.

[0095] Processing multimodal image data: Each branch processes the corresponding modality image data and maps the feature vectors of different modalities to a unified feature domain through a feature transformer to form a fusion feature.

[0096] Generate segmentation mask: Use each segmentation head in the multi-task segmentation network to generate a corresponding segmentation mask. Each segmentation head generates a class label and confidence score for each pixel in the input image.

[0097] For example, for the surface defect segmentation head, it generates a 2D array with the same size as the input image, where each element represents the probability that the corresponding pixel belongs to a surface defect. Similarly, the internal defect segmentation head and edge detection segmentation head also generate their own segmentation masks.

[0098] Output: Based on the generated segmentation mask, we can get the defect category and its confidence level for each pixel. Specifically, for each pixel, we can select the category with the highest confidence level as the final classification result for the pixel.

[0099] For example, assuming that the confidence of a pixel in the surface defect segmentation mask is 0.8, the confidence in the internal defect segmentation mask is 0.2, and the confidence in the edge detection segmentation mask is 0.1, the pixel will eventually be classified as a surface defect with a confidence of 0.8.

[0100] Generate final segmentation map: Based on the classification results of each pixel, a final segmentation map is generated. This map clearly marks the defect category to which each area in the image belongs, and comes with the confidence of each category.

[0101] The final segmentation map may look like a colored mask, where different colors represent different defect categories and the depth of the color indicates the confidence level.

[0102] Through the above steps, we use the trained multi-task segmentation network to segment the target multimodal image and output the defect category and corresponding confidence level of each pixel. This method can not only improve the accuracy and efficiency of detection, but also provide detailed defect information for quality control in industrial production, helping engineers to quickly locate the problem.

[0103] Optionally, it further includes: adding an inter-task coordination term to the multi-task loss function, wherein the inter-task coordination term is defined as:

[0104] in, represents the inter-task coordination item, Represents the segmentation task The loss value and segmentation tasks The loss value The correlation between Represents the weight coefficient, which is used to adjust the impact of the mean difference between tasks. Represents the segmentation task The loss value The mean of Represents the segmentation task The loss value The mean of The correlation is expressed by the Pearson correlation coefficient Sure, , Represents the segmentation task In the sample The loss value on Represents the segmentation task In the sample The loss value on Represents the segmentation task The loss value The average value of Represents the segmentation task The loss value The average value of represents the number of samples; The adjusted multi-task loss function is expressed as:

[0105] in, represents the adjusted multi-task loss function, is the weight coefficient of the inter-task coordination term.

[0106] In this step, the concept of "adding inter-task coordination terms to the multi-task loss function" includes inter-task coordination terms, correlation, weight coefficients, and an adjusted multi-task loss function.

[0107] Inter-task coordination item: It is to promote the coordination and cooperation between different tasks in the multi-task learning process, avoid conflicts or mutual influences between tasks, and improve the overall performance of the model.

[0108] Correlation: refers to the statistical relationship between two variables, which can measure the strength and direction of the linear relationship between the two variables. Here, correlation is used to measure the relationship between the loss values ​​of different tasks.

[0109] Weight coefficient: used to adjust the relative importance of different loss terms in the total loss function. By setting appropriate weight coefficients, the contributions of different tasks can be balanced.

[0110] Adjusted multi-task loss function: Based on the original multi-task loss function, an inter-task coordination term is added, so that the model can better coordinate the learning of different tasks during training and improve the overall performance.

[0111] In the present embodiment, we continue to use the previous example of using visible light images and X-ray images for product defect detection in an industrial manufacturing environment, and on this basis, add inter-task coordination terms to improve the multi-task loss function. The following are the detailed implementation steps: Calculate the inter-task coordination term: In order to add the inter-task coordination term to the multi-task loss function, we first need to calculate the inter-task coordination term .

[0112] set up For segmentation tasks The loss value and segmentation tasks The loss value The correlation between them.

[0113] set up For segmentation tasks The loss value The mean of For segmentation tasks The loss value The mean of .

[0114] set up is a weight coefficient used to adjust the impact of mean differences between tasks.

[0115] Inter-task coordination Defined as:

[0116] For example, suppose we have three tasks , and given , if the calculated correlation and mean are:

[0117] The inter-task coordination item The calculation is as follows:

[0118] Adjust the multi-task loss function: Add inter-task coordination terms based on the original multi-task loss function , and get the adjusted multi-task loss function , is the weight coefficient of the inter-task coordination term.

[0119] set up is a weight coefficient used to adjust the contribution of the inter-task coordination term in the total loss function.

[0120] The adjusted multi-task loss function is defined as:

[0121] For example, suppose we have three tasks , and given , if the other loss values ​​calculated are:

[0122] Then the adjusted multi-task loss function The calculation is as follows:

[0123] Through the above steps, we have successfully added inter-task coordination terms to the multi-task loss function to improve the performance of the model in the multi-task learning process. This method can not only improve the coordination between different tasks, but also further optimize the overall performance of the model and improve the accuracy and robustness of defect detection.

[0124] Figure 2 A structural diagram of a multi-task defect segmentation system based on multi-modal images is provided for an embodiment of the present application, such as Figure 2 As shown, the system includes: A construction module 21 is used to construct a multimodal feature fusion network according to the multimodal image data; A processing module 22, used to process image data of different modalities using different branches of the multimodal feature fusion network, and map feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature; A training module 23 is used to construct a multi-task segmentation network based on the fusion features, and train the multi-task segmentation network through a training set constructed by multi-modal image data containing labeled defect locations, wherein the multi-task segmentation network is used to simultaneously perform multiple segmentation tasks, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; The output module 24 is used to segment the acquired target multimodal image using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level, wherein the confidence level refers to the degree of certainty of the multi-task segmentation network's prediction result on the defect category to which each pixel in the target multimodal image belongs.

[0125] Figure 2 The multi-task defect segmentation system based on multi-modal images can perform Figure 1 The implementation principle and technical effect of the multi-task defect segmentation method based on multi-modal images described in the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the multi-task defect segmentation system based on multi-modal images in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0126] In one possible design, Figure 2 A multi-task defect segmentation system based on multi-modal images of the illustrated embodiment can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32; The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .

[0127] The processing component 32 is used to: construct a multimodal feature fusion network based on multimodal image data; use different branches of the multimodal feature fusion network to process image data of different modalities, and map the feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature; based on the fusion feature, construct a multi-task segmentation network, and train the multi-task segmentation network through a training set constructed by multimodal image data with marked defect locations, wherein the multi-task segmentation network is used to simultaneously perform multiple segmentation tasks, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; use the trained multi-task segmentation network to segment the acquired target multimodal image to output the defect category and the corresponding confidence level to which each pixel in the target multimodal image belongs.

[0128] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0129] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0130] Of course, the computing device may also include other components, such as input / output interfaces, display components, communication components, etc.

[0131] The input / output interface provides an interface between the processing component and the peripheral interface module, and the above-mentioned peripheral interface module can be an output device, an input device, etc.

[0132] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0133] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0134] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 A multi-task defect segmentation method based on multi-modal images is shown in the embodiment.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0136] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A multi-task defect segmentation method based on multimodal images, characterized in that: include: Construct a multimodal feature fusion network based on multimodal image data; Using different branches of the multimodal feature fusion network to process image data of different modalities, and mapping feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form fusion features; Based on the fusion features, a multi-task segmentation network is constructed, and the multi-task segmentation network is trained by a training set constructed by multimodal image data containing labeled defect locations, wherein the multi-task segmentation network is used to simultaneously perform multiple segmentation tasks, and the multiple segmentation tasks include surface defect segmentation, internal defect segmentation, and edge detection; The acquired target multimodal image is segmented using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level, wherein the confidence level refers to the degree of certainty of the multi-task segmentation network's prediction result on the defect category to which each pixel in the target multimodal image belongs.

2. The method according to claim 1, characterized in that The multimodal feature fusion network is constructed according to the multimodal image data, comprising: Designing a multimodal feature extractor, wherein the multimodal feature extractor comprises a plurality of branches, each branch being used for processing image data of a different modality; Extracting feature vectors from the image data of the corresponding modality through the deep convolutional neural network of each branch, and introducing an adaptive attention mechanism in each branch to enhance the feature vectors extracted from the multimodal image data; The feature vectors extracted from image data of different modalities are used to construct a multimodal feature fusion network.

3. The method according to claim 2, characterized in that The step of constructing a multi-task segmentation network based on the fusion features includes: Design a multi-head segmentation architecture, wherein the multi-head segmentation architecture includes multiple segmentation heads, each segmentation head is used to process a corresponding segmentation task; Refining the fused features through at least one convolutional layer within each segmentation head to generate a segmentation mask; Based on the segmentation mask, a multi-task segmentation network is constructed.

4. The method according to claim 3, characterized in that The multi-task segmentation network is trained using a training set constructed by multi-modal image data containing labeled defect locations, including: Initializing initial parameter values ​​of the multi-task segmentation network using model parameters pre-trained on a large general dataset; For each multimodal image data containing annotated defect positions in the training set, respectively calculate the loss value corresponding to each segmentation task, and calculate the total loss value of the multi-task segmentation network based on the preset multi-task loss function and the loss value of each segmentation task; Based on the total loss value, dynamically adjust the weight of each segmentation task to optimize the performance of the multi-task segmentation network on each segmentation task; By using a back propagation algorithm, the initial parameter values ​​of the multi-task segmentation network are updated according to the adjusted task weights and the total loss value to complete the training of the multi-task segmentation network.

5. The method according to claim 1, characterized in that The feature transformer maps the feature vectors corresponding to the image data of different modalities to a unified feature domain to form a fusion feature, including: Through a preset feature fusion function, the feature vectors corresponding to the image data of different modalities are mapped to a unified feature domain to form a fusion feature; Wherein, the preset feature fusion function is defined as: ; in, represents the preset feature fusion function, Represents the weight coefficient, which is used to adjust the Modal Features The importance of Indicates The feature vector corresponding to the modality image data, Represents the cross-term coefficient, which is used to measure the interaction between different modal features. represents the logarithmic term coefficient, which is used to adjust the relative strength of the modal characteristics. It represents the number of image data of different modalities.

6. The method according to claim 4, characterized in that The total loss value of the multi-task segmentation network is calculated based on the preset multi-task loss function and the loss value of each segmentation task, including: The total loss value of the multi-task segmentation network is calculated by the following formula: ; in, Expressed as the total loss value, Indicates The loss value of the segmentation task is Indicates The weight coefficient of the segmentation task, represents the coefficient for adjusting the sum of squared losses between tasks, represents the coefficient for adjusting the inter-task loss index and, It represents the number of different segmentation tasks in the multi-task segmentation network.

7. The method according to claim 6, characterized in that Also includes: An inter-task coordination term is added to the multi-task loss function, wherein the inter-task coordination term is defined as: ; in, represents the inter-task coordination item, Represents the segmentation task The loss value and segmentation tasks The loss value The correlation between Represents the weight coefficient, which is used to adjust the impact of the mean difference between tasks. Represents the segmentation task The loss value The mean of Represents the segmentation task The loss value The mean of The correlation is expressed by the Pearson correlation coefficient Sure, , Represents the segmentation task In the sample The loss value on Represents the segmentation task In the sample The loss value on Represents the segmentation task The loss value The average value of Represents the segmentation task The loss value The average value of represents the number of samples; The adjusted multi-task loss function is expressed as: ; in, represents the adjusted multi-task loss function, is the weight coefficient of the inter-task coordination term.

8. A multi-task defect segmentation system based on multimodal images, characterized in that: include: A construction module, used for constructing a multimodal feature fusion network according to multimodal image data; A processing module, used to process image data of different modalities using different branches of the multimodal feature fusion network, and map feature vectors corresponding to the image data of different modalities to a unified feature domain through a feature transformer to form a fusion feature; A training module, configured to construct a multi-task segmentation network based on the fusion features, and train the multi-task segmentation network using a training set constructed from multi-modal image data containing labeled defect locations, wherein the multi-task segmentation network is configured to simultaneously perform multiple segmentation tasks, the multiple segmentation tasks including surface defect segmentation, internal defect segmentation, and edge detection; The output module is used to segment the acquired target multimodal image using the trained multi-task segmentation network to output the defect category to which each pixel in the target multimodal image belongs and the corresponding confidence level, wherein the confidence level refers to the degree of certainty of the multi-task segmentation network's prediction result on the defect category to which each pixel in the target multimodal image belongs.

9. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the multi-task defect segmentation method based on multimodal images as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, the multi-task defect segmentation method based on multimodal images as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Multi-modal image segmentation method based on image fusion technology

    CN114494322A

  • Multi-mode and adversarial learning-based multi-task target detection and identification method and device

    CN114821014A

  • Image analysis method and system based on multi-branch network

    CN116681934A

  • Medical image segmentation method and device, equipment and medium

    CN117974683A

  • Robot classification detection method and system based on multi-mode multi-task learning

    CN118506107A

Cited By

  • Display panel defect detection method and system based on multi-modal data fusion

    CN120563511A

  • Display panel defect detection method and system based on multi-modal data fusion

    CN120563511B