Small sample semantic segmentation method and system fusing category label semantics

By introducing a priori information generation module and a multi-scale fusion module into the semantic segmentation model, image and text data are effectively fused, which solves the shortcomings of existing models in multi-modal data fusion and improves the accuracy and accuracy of target recognition and positioning. Computing performance.

CN118587440AActive Publication Date: 2024-09-03JIANGXI NORMAL UNIV

Patent Information

Application Number
CN202410736310.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-03
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

Existing semantic segmentation models have deficiencies in the breadth and richness of data information, resulting in insufficient accuracy in target recognition and target positioning, and difficulty in effectively integrating multi-modal data information.

Method used

Design a semantic small-sample semantic segmentation method that fuses category labels, through the prior information generation module and the multi-scale fusion module, using the text image adaptation sub-module, prior generation sub-module, cross-attention sub-module and assembly sub-module. Multi-modal data fusion enhances the model's ability to understand image content and protects detailed information through TE blocks and CBAM blocks.

Benefits of technology

It significantly improves the accuracy of target recognition and target positioning of the semantic segmentation model, reduces the number of parameters of the decoder, while maintaining high speech segmentation accuracy, and enhances computing performance and channel fusion capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587440A
    Figure CN118587440A
Patent Text Reader

Abstract

The invention relates to the field of image processing, provides a small sample semantic segmentation method and system for fusing category label semantics, and realizes multi-modal data fusion of image data information and text data information serving as category labels by designing a prior information generation module. By designing a semantic segmentation model, the semantic segmentation model can more accurately understand the image content, and by designing a multi-scale fusion module, the original detail information of the image is further protected, the calculation performance and the channel fusion capability of the semantic segmentation model are greatly improved, and the parameter quantity of a decoder is greatly reduced while the voice segmentation precision is ensured. According to the method, the accuracy of target recognition and target positioning of semantic segmentation is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a small sample semantic segmentation method and system that integrates category label semantics. Background Art

[0002] With the rapid development of computer vision technology, semantic segmentation technology, as an extremely important part of computer vision technology, has gradually appeared in more application scenarios. How to accurately identify target areas and target objects through semantic segmentation models is the key point of semantic segmentation technology.

[0003] In the prior art, semantic segmentation models are usually trained based only on image data information. Different types of image data information are used as guidance images to enhance the semantic understanding ability of the semantic segmentation model, so that the semantic segmentation model can understand the image content more accurately. However, this is still a single-modal semantic segmentation model and is still insufficient in terms of the breadth and richness of data information.

[0004] Therefore, how to design a semantic segmentation model that can integrate multimodal data information so that the model can understand the image content more accurately and improve the accuracy of target recognition and target positioning in semantic segmentation has become an urgent problem to be solved. Summary of the invention

[0005] Based on this, the purpose of the present invention is to provide a small sample semantic segmentation method and system that integrates the semantics of category labels. By designing a prior information generation module, the module includes: a text image adaptation submodule, a prior generation submodule, a cross attention submodule and an assembly submodule. The text image adaptation submodule adds weights to each channel of image features through text features. The prior generation submodule uses image and text information to generate prior information for the query image. The cross attention submodule establishes intensive attention between image information and obtains the connection between target categories in the support image and the query image. The assembly submodule performs feature fusion on the generated information through TE blocks and CBAM blocks, thereby realizing multimodal data fusion of image data information and text data information as category labels, so that the semantic segmentation model can understand the image content more accurately. By designing a multi-scale fusion module, the original detail information of the image is further protected, the computing performance and channel fusion capability of the semantic segmentation model are greatly improved, and while ensuring the accuracy of speech segmentation, the parameter amount of the decoder is also greatly reduced. The present invention greatly improves the accuracy of target recognition and target positioning of semantic segmentation.

[0006] The present invention proposes a small sample semantic segmentation method integrating category label semantics, comprising: Obtaining a query image, a support image, a support mask, and a text category label and performing preprocessing to obtain multi-layer query features, multi-layer support features, and text features; The high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features are respectively input into the prior information generation module to perform high-level, middle-level and low-level query image prior information generation processing, the prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; The high-level, mid-level, and low-level prior information of the query image are fed into a multi-scale fusion module to obtain the final segmentation prediction.

[0007] In summary, according to the above-mentioned small sample semantic segmentation method integrating category label semantics, a prior information generation module is designed, which includes: a text image adaptation submodule, a prior generation submodule, a cross attention submodule and an assembly submodule. The text image adaptation submodule adds weights to each channel of the image feature through text features, the prior generation submodule generates prior information for the query image using image and text information, the cross attention submodule establishes intensive attention between the image information, obtains the connection between the target category in the support image and the query image, and the assembly submodule performs feature fusion on the generated information through TE blocks and CBAM blocks, thereby realizing multimodal data fusion of image data information and text data information as category labels, so that the semantic segmentation model can understand the image content more accurately. In addition, by designing a multi-scale fusion module, the original detail information of the image is further protected, the computational performance and channel fusion capability of the semantic segmentation model are greatly improved, and while ensuring the accuracy of speech segmentation, the parameter amount of the decoder is also greatly reduced. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation. Specifically, a query image, a support image, a support mask and a text category label are obtained and preprocessed to obtain multi-layer query features, multi-layer support features and text features, and the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features are respectively input into a prior information generation module to perform high-level, middle-level and low-level query image prior information generation processing. The prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule. The text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information. The prior generation submodule performs a basic prior information generation operation to obtain basic prior information. The cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information. The multimodal prior information, the basic prior information and the attention weighted prior information are input into an assembly submodule to obtain query image prior information. The high-level, middle-level and low-level query image prior information are input into a multi-scale fusion module to obtain final segmentation prediction. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation.

[0008] Furthermore, the step of obtaining the query image, the support image, the support mask and the text category label and performing preprocessing to obtain multi-layer query features, multi-layer support features and text features includes: Get the query image , Support images , support mask and text category labels Then, the text category label Input the text encoder of the CLIP model to obtain fixed-dimensional text features ; The query image and supporting images Input the backbone network for feature extraction and obtain query features respectively and supporting features , ,in Represents the height of the feature map, represents the width of the feature map, Indicates the number of channels of the feature vector, the query feature and the supporting features Includes low-level query features , low-level support features , middle-level query features , middle-level support features , High-level query features , High-level support features .

[0009] Furthermore, the text image adaptation submodule performs a multimodal prior information generation operation to obtain the multimodal prior information, including: The fully connected layer in the text image adaptation submodule is used to adapt text features A linear projection operation is performed, and the formula of the linear projection operation is as follows: in, represents the fully connected layer, Represents the text encoder of the CLIP model, text features , is the dimension of the embedding space; The convolutional blocks in the text image adaptation submodule are used to query features. and supporting features Perform channel transformation operation to transform the query feature and the supporting features The scale transformation is The dimension conversion block in the text image adaptation submodule then transforms the query features after channel transformation and the supporting features Perform a dimension conversion operation, the formula of which is as follows: in, Represents the query features after dimension conversion, represents the supporting features after dimension transformation, , represents the dimension conversion function, represents the convolution function; The text features , the query features and the supporting features A multimodal fusion operation is performed, and the formula of the multimodal fusion operation is as follows: in, represents the query features after multimodal fusion, represents the supporting features after multimodal fusion, Representing text features The transposed matrix of Support mask A bilinear interpolation downsampling operation is performed, and the formula of the bilinear interpolation downsampling operation is as follows: in, represents the support mask after downsampling, represents the downsampling function, the support mask The dimensions and support features same; The support mask , query features and supporting features In the multi-head attention block of the input text image adaptation submodule, the support mask , query features and supporting features As multi-head attention blocks matrix, Matrix and Matrix to obtain multimodal prior information , the acquisition of multimodal prior information The formula is as follows: in, represents a feed-forward neural network layer, Representation layer normalization layer, represents a multi-head attention layer, and the mechanism function of the multi-head attention layer is as follows: in, is the dimension of Q matrix and K matrix, express The transpose of a matrix.

[0010] Furthermore, the priori generation submodule performs a basic priori information generation operation to obtain the basic priori information, including the following steps: Based on query characteristics and text features Generate the first rough basis prior information , the first rough basis prior information is generated The formula is as follows: in, represents the cosine similarity function, ; The prior information on the first rough basis The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, for , Indicates obtaining the maximum value. Indicates getting the minimum value. ; According to the support mask after downsampling , query features and supporting features Generate the second rough basis prior information , the second rough basis prior information is generated The formula is as follows: in, , Represents query features The transposed matrix of express norm, Represents element-wise multiplication; The prior information on the second rough basis The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, ; According to the first rough basis prior information and the second rough basis prior information Obtaining basic prior information , the basic prior information is obtained The formula is as follows: in, is a hyperparameter and is set to 0.5.

[0011] Furthermore, the cross attention submodule performs an attention weighted prior information generation operation to obtain the attention weighted prior information, including: The query feature , Support Features , support mask Input the first multi-head attention block of the cross attention submodule, the query feature , the supporting features and the support mask As the first multi-head attention block matrix, Matrix and Matrix to obtain coarse attention weighted prior information , the rough attention weighted prior information is obtained The formula is as follows: in, , ; The query feature and the coarse attention weighted prior information Input the second multi-head attention block of the cross attention submodule, the query feature As the second multi-head attention block Matrix, the coarse attention weighted prior information As the second multi-head attention block Matrix and Matrix to obtain attention weighted prior information , the acquisition of attention weighted prior information The formula is as follows: in, Represents a weighted aggregation.

[0012] Furthermore, the step of inputting the multimodal prior information, the basic prior information and the attention weighted prior information into an assembly submodule to obtain the query image prior information includes: Multimodal prior information , basic prior information and attention-weighted prior information The input assembly submodule is a residual structure, and the main path of the residual structure converts the original multimodal prior information , the basic prior information and the attention weighted prior information In the input splicing block, the residual path of the residual structure includes a TE encoder block and a CBAM block, the CBAM block includes a channel attention mechanism block and a spatial attention mechanism block, and both the channel attention mechanism block and the spatial attention mechanism block are residual structures; The multimodal prior information , the basic prior information and the attention weighted prior information Fusion is performed to obtain fusion prior information , the acquisition of fusion prior information The formula is as follows: The fusion prior information Input into the splicing block; Then the fusion prior information Input the TE encoder block to obtain the first prior information , the first prior information is obtained The formula is as follows: in, Represents a stacked Transformer encoder, which transforms the first prior information Input into the splicing block; The fusion prior information Input into the CBAM block to obtain the second prior information , the second prior information is obtained The formula is as follows: in, Represents the CBAM block, the second prior information Input into the splicing block; The multimodal prior information , the basic prior information , the attention weighted prior information , the fusion prior information , the first prior information and the second prior information The splicing is performed in the channel dimension, and the splicing formula is as follows: in, represents the prior information of the query image, , Represents the concatenation function.

[0013] Furthermore, the step of inputting the high-level, middle-level, and low-level query image prior information into the multi-scale fusion module to obtain the final segmentation prediction includes: Inputting the high-level, middle-level, and low-level query image prior information into a multi-scale fusion module, the multi-scale fusion module comprising a dual-channel convolution block and a final decoder, the dual-channel convolution block comprising a first convolution path and a second convolution path, the first convolution path comprising a 3X3 convolution layer, a batch normalization layer, and an ELU activation layer, the second convolution path comprising a 1X1 convolution layer, a group normalization layer, and a ReLU activation layer, the final decoder comprising a convolution layer, a batch normalization layer, an ELU activation layer, and a CBAM block; The high-level, middle-level, and low-level query image prior information are subjected to channel discarding processing and are respectively input into the dual-channel convolution block for feature aggregation processing. The processed high-level query image prior information is upsampled and then fused with the processed middle-level query image prior information by element addition. The fused query image prior information is input into the dual-channel convolution block for feature aggregation processing. The processed fused query image prior information is upsampled and then fused with the processed low-level query image prior information by element addition and input into the dual-channel convolution block. Feature aggregation processing and upsampling are then input into the final decoder. The final decoder obtains the final segmentation prediction and performs loss calculation. The formula for the loss calculation is as follows: in, Represents the predicted mask of the query image and its corresponding true mask The Dice loss between represents CE loss, Represents the total loss.

[0014] The present invention proposes a small sample semantic segmentation system integrating category label semantics, comprising: A feature acquisition module is used to acquire and preprocess query images, support images, support masks, and text category labels to obtain multi-layer query features, multi-layer support features, and text features; A prior information generation module, used for inputting the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features into the prior information generation module respectively to perform high-level, middle-level and low-level query image prior information generation processing, wherein the prior information generation module comprises a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, wherein the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; The multi-scale fusion module is used to input the high-level, middle-level and low-level prior information of the query image into the multi-scale fusion module to obtain the final segmentation prediction.

[0015] The present invention also provides a storage medium, which stores one or more programs. When the programs are executed by a processor, the small sample semantic segmentation method for integrating category label semantics as described above is implemented.

[0016] The present invention also provides a computer device, the computer device comprising a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the small sample semantic segmentation method integrating category label semantics as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a small sample semantic segmentation method integrating category label semantics proposed in the first embodiment of the present invention; Figure 2 This is a flow chart of a small sample semantic segmentation method integrating category label semantics proposed in the second embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a small sample semantic segmentation system that integrates category label semantics proposed in the third embodiment of the present invention.

[0018] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0019] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0020] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0022] See also Figure 1 , which is a flowchart of a small sample semantic segmentation method integrating category label semantics according to a first embodiment of the present invention. The small sample semantic segmentation method integrating category label semantics comprises steps S01 to S03, wherein: Step S01: obtaining a query image, a support image, a support mask, and a text category label and performing preprocessing to obtain multi-layer query features, multi-layer support features, and text features; It should be noted that in this embodiment, the query image is obtained , Support images , support mask and text category labels Then, the text category label Input the text encoder of the CLIP model to obtain fixed-dimensional text features , the query image and supporting images Input the backbone network for feature extraction. The backbone network in this embodiment uses resnet50 and resnet101 pre-trained on ImageNet1K to obtain query features respectively. and supporting features , ,in Represents the height of the feature map, represents the width of the feature map, Indicates the number of channels of the feature vector, the query feature and the supporting features Includes low-level query features , low-level support features , middle-level query features , middle-level support features , High-level query features , High-level support features In this embodiment, the low layer, middle layer, and high layer correspond to the 3rd, 6th, and 9th layers of the multi-layer features, respectively, and the image sizes of the low layer, middle layer, and high layer are respectively , and .

[0023] Step S02: inputting the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features into the prior information generation module respectively to generate high-level, middle-level and low-level query image prior information, wherein the prior information generation module comprises a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, wherein the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; It should be noted that in this embodiment, the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information. The fully connected layer in the text image adaptation submodule first generates a multimodal prior information for the text features. A linear projection operation is performed, and the formula of the linear projection operation is as follows: in, represents the fully connected layer, Represents the text encoder of the CLIP model, text features , is the dimension of the embedding space, and then the convolutional blocks in the text image adaptation submodule are adapted to the query features. and supporting features Perform channel transformation operation to transform the query feature and the supporting features The scale transformation is The dimension conversion block in the text image adaptation submodule then transforms the query features after channel transformation and the supporting features Perform a dimension conversion operation, the formula of which is as follows: in, Represents the query features after dimension conversion, represents the supporting features after dimension transformation, , represents the dimension conversion function, Represents the convolution function, and then the text features , the query features and the supporting features A multimodal fusion operation is performed, and the formula of the multimodal fusion operation is as follows: in, represents the query features after multimodal fusion, represents the supporting features after multimodal fusion, Representing text features This operation adds weights to each channel of the image feature through the text feature, so that the model pays more attention to the channel features with large weights, and also supports the mask A bilinear interpolation downsampling operation is performed, and the formula of the bilinear interpolation downsampling operation is as follows: in, represents the support mask after downsampling, represents the downsampling function, the support mask The dimensions and support features Same, finally the support mask , query features and supporting features In the multi-head attention block of the input text image adaptation submodule, the support mask , query features and supporting features As multi-head attention blocks matrix, Matrix and Matrix to obtain multimodal prior information , the acquisition of multimodal prior information The formula is as follows: in, represents a feed-forward neural network layer, Representation layer normalization layer, represents a multi-head attention layer, and the mechanism function of the multi-head attention layer is as follows: in, is the dimension of Q matrix and K matrix, express The transpose of a matrix.

[0024] It should be noted that in this embodiment, the priori generation submodule performs a basic priori information generation operation to obtain basic priori information, which is to first generate the basic priori information according to the query feature. and text features Generate the first rough basis prior information , the first rough basis prior information is generated The formula is as follows: in, represents the cosine similarity function, , the prior information of the first rough basis The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, for , Indicates obtaining the maximum value. Indicates getting the minimum value. , according to the downsampled support mask , query features and supporting features Generate the second rough basis prior information , the second rough basis prior information is generated The formula is as follows: in, , Represents query features The transposed matrix of express norm, Represents element-wise multiplication. Through this operation, only the foreground information is retained in the image features, and the background interference is eliminated. The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, , according to the first rough basis prior information and the second rough basis prior information Obtaining basic prior information , the basic prior information is obtained The formula is as follows: in, is a hyperparameter and is set to 0.5.

[0025] It should be noted that in this embodiment, the cross attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information. , Support Features , support mask Input the first multi-head attention block of the cross attention submodule, the query feature , the supporting features and the support mask As the first multi-head attention block matrix, Matrix and Matrix to obtain coarse attention weighted prior information , the rough attention weighted prior information is obtained The formula is as follows: in, , , and then the query feature and the coarse attention weighted prior information Input the second multi-head attention block of the cross attention submodule, the query feature As the second multi-head attention block Matrix, the coarse attention weighted prior information As the second multi-head attention block Matrix and Matrix to obtain attention weighted prior information , the acquisition of attention weighted prior information The formula is as follows: in, Represents weighted aggregation. This module performs weighted aggregation on the features in the query image and the support image, identifies the areas with high attention scores as the prior information of the foreground, and identifies the areas with low attention scores as the prior information of the background.

[0026] It should be noted that the group submodule in this embodiment obtains the prior information of the query image by first converting the multimodal prior information , basic prior information and attention-weighted prior information The input assembly submodule is a residual structure, and the main path of the residual structure converts the original multimodal prior information , the basic prior information and the attention weighted prior information In the input concatenation block, the residual path of the residual structure includes a TE encoder block and a CBAM block, the CBAM block includes a channel attention mechanism block and a spatial attention mechanism block, the channel attention mechanism block and the spatial attention mechanism block are both residual structures, and the multimodal prior information is converted into , the basic prior information and the attention weighted prior information Fusion is performed to obtain fusion prior information , the acquisition of fusion prior information The formula is as follows: The fusion prior information Input the splicing block, and then integrate the prior information Input the TE encoder block to obtain the first prior information , the first prior information is obtained The formula is as follows: in, Represents a stacked Transformer encoder, which transforms the first prior information In the input splicing block, the first prior information Including the local and global dependencies of each element in the sequence, as well as the interactions between elements. Through the self-attention mechanism, the model can capture the long-distance dependencies in the sequence, which is very important for understanding complex sequence data. Input into the CBAM block to obtain the second prior information , the second prior information is obtained The formula is as follows: in, Represents the CBAM block, which infers attention maps in the channel dimension and spatial dimension of the feature map in turn, and then multiplies these attention maps with the input feature map to achieve adaptive feature optimization, and the second prior information In the input concatenation block, the multimodal prior information , the basic prior information , the attention weighted prior information , the fusion prior information , the first prior information and the second prior information The splicing is performed in the channel dimension, and the splicing formula is as follows: in, represents the prior information of the query image, , Represents the concatenation function.

[0027] Step S03: inputting the high-level, middle-level and low-level query image prior information into the multi-scale fusion module to obtain the final segmentation prediction; It should be noted that the multi-scale fusion module in this embodiment includes a dual-channel convolution block and a final decoder, the dual-channel convolution block includes a first convolution path and a second convolution path, the first convolution path includes a 3X3 convolution layer, a batch normalization layer and an ELU activation layer, the second convolution path includes a 1X1 convolution layer, a group normalization layer and a ReLU activation layer, the final decoder includes a convolution layer, a batch normalization layer, an ELU activation layer and a CBAM block, the high-level, middle-level and low-level query image prior information is input into the multi-scale fusion module, the high-level, middle-level and low-level query image prior information is subjected to channel discarding processing and then input into the dual-channel In the convolution block, feature aggregation processing is performed, the processed high-level query image prior information is upsampled, and then fused with the processed middle-level query image prior information by element addition, and the fused query image prior information is input into the dual-channel convolution block for feature aggregation processing, the processed fused query image prior information is upsampled, and then fused with the processed low-level query image prior information by element addition and input into the dual-channel convolution block, feature aggregation processing and upsampling are performed and then input into the final decoder, the final decoder obtains the final segmentation prediction, and performs loss calculation, and the formula for the loss calculation is as follows: in, Represents the predicted mask of the query image and its corresponding true mask The Dice loss between represents CE loss, Represents the total loss. In this embodiment, after the outputs of the three different levels of prior information generation modules are discarded, convolutional blocks and up-sampled, the multi-scale loss calculation is performed on the output features and the true mask of the down-sampled query image to further increase the generalization ability of the model.

[0028] In summary, according to the above-mentioned small sample semantic segmentation method integrating category label semantics, a prior information generation module is designed, which includes: a text image adaptation submodule, a prior generation submodule, a cross attention submodule and an assembly submodule. The text image adaptation submodule adds weights to each channel of the image feature through text features, the prior generation submodule generates prior information for the query image using image and text information, the cross attention submodule establishes intensive attention between the image information, obtains the connection between the target category in the support image and the query image, and the assembly submodule performs feature fusion on the generated information through TE blocks and CBAM blocks, thereby realizing multimodal data fusion of image data information and text data information as category labels, so that the semantic segmentation model can understand the image content more accurately. In addition, by designing a multi-scale fusion module, the original detail information of the image is further protected, the computational performance and channel fusion capability of the semantic segmentation model are greatly improved, and while ensuring the accuracy of speech segmentation, the parameter amount of the decoder is also greatly reduced. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation. Specifically, a query image, a support image, a support mask and a text category label are obtained and preprocessed to obtain multi-layer query features, multi-layer support features and text features, and the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features are respectively input into a prior information generation module to perform high-level, middle-level and low-level query image prior information generation processing. The prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule. The text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information. The prior generation submodule performs a basic prior information generation operation to obtain basic prior information. The cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information. The multimodal prior information, the basic prior information and the attention weighted prior information are input into an assembly submodule to obtain query image prior information. The high-level, middle-level and low-level query image prior information are input into a multi-scale fusion module to obtain final segmentation prediction. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation.

[0029] See also Figure 2 , which is a flow chart of a small sample semantic segmentation method integrating category label semantics proposed in the second embodiment of the present invention, wherein the small sample semantic segmentation method integrating category label semantics comprises steps S11 to S17, wherein: Step S11: After obtaining the query image, support image, support mask and text category label, the text category label is input into the text encoder of the CLIP model to obtain text features of fixed dimensions, and the query image and support image are input into the backbone network for feature extraction to obtain multi-layer query features and multi-layer support features respectively; Step S12: inputting the high-level, middle-level, and low-level features in the multi-layer query features and the multi-layer support features into the prior information generation module to generate high-level, middle-level, and low-level query image prior information respectively; Step S13: the fully connected layer in the text image adaptation submodule performs a linear projection operation on the text features, the convolution block in the text image adaptation submodule performs a channel transformation operation on the query features and the support features, the dimension conversion block in the text image adaptation submodule performs a dimension conversion operation on the query features and the support features after the channel transformation, performs a multimodal fusion operation on the text features, the query features and the support features, performs a bilinear interpolation downsampling operation on the support mask, and inputs the support mask, the query features and the support features into the multi-head attention block of the text image adaptation submodule to obtain multimodal prior information; Step S14: generating first rough basis prior information according to the query feature and the text feature, normalizing the deviation of the first rough basis prior information, generating second rough basis prior information according to the downsampled support mask, the query feature and the support feature, normalizing the deviation of the second rough basis prior information, and obtaining basic prior information according to the first rough basis prior information and the second rough basis prior information; Step S15: input the query feature, the support feature, and the support mask into the first multi-head attention block of the cross-attention submodule to obtain coarse attention weighted prior information, and input the query feature and the coarse attention weighted prior information into the second multi-head attention block of the cross-attention submodule to obtain attention weighted prior information; Step S16: input the multimodal prior information, the basic prior information and the attention weighted prior information into the assembly submodule, fuse the multimodal prior information, the basic prior information and the attention weighted prior information to obtain the fused prior information, input the fused prior information into the splicing block, input the fused prior information into the TE encoder block to obtain the first prior information, input the fused prior information into the CBAM block to obtain the second prior information, and splice the multimodal prior information, the basic prior information, the attention weighted prior information, the fused prior information, the first prior information and the second prior information in the channel dimension; Step S17: inputting the high-level, middle-level and low-level query image prior information into the multi-scale fusion module, performing channel discarding processing on the high-level, middle-level and low-level query image prior information and inputting them into the dual-channel convolution block respectively for feature aggregation processing, upsampling the processed high-level query image prior information, and then merging it with the processed middle-level query image prior information by element addition, inputting the fused query image prior information into the dual-channel convolution block for feature aggregation processing, upsampling the processed fused query image prior information, and then merging it with the processed low-level query image prior information by element addition and inputting it into the dual-channel convolution block, performing feature aggregation processing and upsampling and then inputting it into the final decoder, the final decoder obtains the final segmentation prediction and performs loss calculation; It should be noted that the present invention is compared with the existing semantic segmentation model in an experiment, using resnet101 as the backbone network and 1-shot setting. The comparison results in the data set are shown in Table 1. The comparison results in the data set are shown in Table 2: Table 1 Table 2 Dataset 1, Dataset 2, Dataset 3 and Dataset 4 in Table 1 above represent , , and , Dataset 1, Dataset 2, Dataset 3 and Dataset 4 in Table 2 above represent , , and It can be seen from Table 1 and Table 2 that the present invention has made significant progress in various evaluation indicators and experimental groups, especially in the average intersection-over-union ratio, which greatly improves the performance of the semantic segmentation model.

[0030] In summary, according to the above-mentioned small sample semantic segmentation method integrating category label semantics, a prior information generation module is designed, which includes: a text image adaptation submodule, a prior generation submodule, a cross attention submodule and an assembly submodule. The text image adaptation submodule adds weights to each channel of the image feature through text features, the prior generation submodule generates prior information for the query image using image and text information, the cross attention submodule establishes intensive attention between the image information, obtains the connection between the target category in the support image and the query image, and the assembly submodule performs feature fusion on the generated information through TE blocks and CBAM blocks, thereby realizing multimodal data fusion of image data information and text data information as category labels, so that the semantic segmentation model can understand the image content more accurately. In addition, by designing a multi-scale fusion module, the original detail information of the image is further protected, the computational performance and channel fusion capability of the semantic segmentation model are greatly improved, and while ensuring the accuracy of speech segmentation, the parameter amount of the decoder is also greatly reduced. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation. Specifically, a query image, a support image, a support mask and a text category label are obtained and preprocessed to obtain multi-layer query features, multi-layer support features and text features, and the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features are respectively input into a prior information generation module to perform high-level, middle-level and low-level query image prior information generation processing. The prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule. The text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information. The prior generation submodule performs a basic prior information generation operation to obtain basic prior information. The cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information. The multimodal prior information, the basic prior information and the attention weighted prior information are input into an assembly submodule to obtain query image prior information. The high-level, middle-level and low-level query image prior information are input into a multi-scale fusion module to obtain final segmentation prediction. The present invention greatly improves the accuracy of target recognition and target positioning in semantic segmentation.

[0031] See also Figure 3 , which is a schematic diagram of the structure of a small sample semantic segmentation system integrating category label semantics proposed in the third embodiment of the present invention, and the system includes: A feature acquisition module 10 is used to acquire a query image, a support image, a support mask and a text category label and perform preprocessing to obtain multi-layer query features, multi-layer support features and text features; The prior information generation module 20 is used to input the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features into the prior information generation module respectively to perform high-level, middle-level and low-level query image prior information generation processing, wherein the prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, wherein the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; The multi-scale fusion module 30 is used to input the high-level, middle-level and low-level prior information of the query image into the multi-scale fusion module to obtain the final segmentation prediction.

[0032] Furthermore, the feature acquisition module 10 includes: The feature acquisition unit 101 is used to acquire the query image, the support image, the support mask and the text category label and perform preprocessing to obtain multi-layer query features, multi-layer support features and text features. Furthermore, the prior information generation module 20 includes: A generating unit 201 is used to input the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features into a prior information generating module to generate high-level, middle-level and low-level query image prior information respectively, wherein the prior information generating module comprises a text image adapting submodule, a prior generating submodule, a cross attention submodule and an assembling submodule, wherein the text image adapting submodule performs a multimodal prior information generating operation to obtain multimodal prior information, the prior generating submodule performs a basic prior information generating operation to obtain basic prior information, and the cross attention submodule performs an attention weighted prior information generating operation to obtain attention weighted prior information; The splicing unit 202 is used to input the multimodal prior information, the basic prior information and the attention weighted prior information into an assembly submodule to obtain the query image prior information.

[0033] Furthermore, the multi-scale fusion module 30 includes: The fusion unit 301 is used to input the high-level, middle-level and low-level prior information of the query image into the multi-scale fusion module to obtain the final segmentation prediction.

[0034] The present invention also proposes a computer storage medium on which one or more programs are stored, and when the programs are executed by a processor, the small sample semantic segmentation method for integrating category label semantics is implemented.

[0035] The present invention also proposes a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned small sample semantic segmentation method that integrates category label semantics.

[0036] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain storage, communication, propagation or transmission of a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0037] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0038] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0039] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0040] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A small sample semantic segmentation method integrating category label semantics, characterized in that: include: Obtaining a query image, a support image, a support mask, and a text category label and performing preprocessing to obtain multi-layer query features, multi-layer support features, and text features; The high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features are respectively input into the prior information generation module to perform high-level, middle-level and low-level query image prior information generation processing, the prior information generation module includes a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; The high-level, mid-level, and low-level prior information of the query image are fed into a multi-scale fusion module to obtain the final segmentation prediction.

2. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The step of obtaining the query image, the support image, the support mask and the text category label and performing preprocessing to obtain multi-layer query features, multi-layer support features and text features comprises: Get the query image , Support images , support mask and text category labels Then, the text category label Input the text encoder of the CLIP model to obtain fixed-dimensional text features ; The query image and supporting images Input the backbone network for feature extraction and obtain query features respectively and supporting features , ,in Represents the height of the feature map, represents the width of the feature map, Indicates the number of channels of the feature vector, the query feature and the supporting features Includes low-level query features , low-level support features , middle-level query features , middle-level support features , High-level query features , High-level support features .

3. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The text image adaptation submodule performs a multimodal prior information generation operation to obtain the multimodal prior information, comprising: The fully connected layer in the text image adaptation submodule is used to adapt text features A linear projection operation is performed, and the formula of the linear projection operation is as follows: in, represents the fully connected layer, Represents the text encoder of the CLIP model, text features , is the dimension of the embedding space; The convolutional blocks in the text image adaptation submodule are used to query features. and supporting features Perform channel transformation operation to transform the query feature and the supporting features The scale transformation is The dimension conversion block in the text image adaptation submodule then transforms the query features after channel transformation and the supporting features Perform a dimension conversion operation, the formula of which is as follows: in, Represents the query features after dimension conversion, represents the supporting features after dimension transformation, , represents the dimension conversion function, represents the convolution function; The text features , the query features and the supporting features A multimodal fusion operation is performed, and the formula of the multimodal fusion operation is as follows: in, represents the query features after multimodal fusion, represents the supporting features after multimodal fusion, Representing text features The transposed matrix of Support mask A bilinear interpolation downsampling operation is performed, and the formula of the bilinear interpolation downsampling operation is as follows: in, represents the support mask after downsampling, represents the downsampling function, the support mask The dimensions and support features same; The support mask , query features and supporting features In the multi-head attention block of the input text image adaptation submodule, the support mask , query features and supporting features As multi-head attention blocks matrix, Matrix and Matrix to obtain multimodal prior information , the acquisition of multimodal prior information The formula is as follows: in, represents a feed-forward neural network layer, Representation layer normalization layer, represents a multi-head attention layer, and the mechanism function of the multi-head attention layer is as follows: in, is the dimension of Q matrix and K matrix, express The transpose of a matrix.

4. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The priori generation submodule performs a basic priori information generation operation to obtain the basic priori information, and the steps include: Based on query characteristics and text features Generate the first rough basis prior information , the first rough basis prior information is generated The formula is as follows: in, represents the cosine similarity function, ; The prior information on the first rough basis The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, for , Indicates obtaining the maximum value. Indicates getting the minimum value. ; According to the support mask after downsampling , query features and supporting features Generate the second rough basis prior information , the second rough basis prior information is generated The formula is as follows: in, , Represents query features The transposed matrix of express norm, Represents element-wise multiplication; The prior information on the second rough basis The deviation standardization is performed, and the formula of the deviation standardization is as follows: in, ; According to the first rough basis prior information and the second rough basis prior information Obtaining basic prior information , the basic prior information is obtained The formula is as follows: in, is a hyperparameter and is set to 0.

5.

5. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The cross attention submodule performs an attention weighted prior information generation operation to obtain the attention weighted prior information, including: The query feature , Support Features , support mask Input the first multi-head attention block of the cross attention submodule, the query feature , the supporting features and the support mask As the first multi-head attention block matrix, Matrix and Matrix to obtain coarse attention weighted prior information , the rough attention weighted prior information is obtained The formula is as follows: in, , ; The query feature and the coarse attention weighted prior information Input the second multi-head attention block of the cross attention submodule, the query feature As the second multi-head attention block Matrix, the rough attention weighted prior information As the second multi-head attention block Matrix and Matrix to obtain attention weighted prior information , the acquisition of attention weighted prior information The formula is as follows: in, Represents a weighted aggregation.

6. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The step of inputting the multimodal prior information, the basic prior information and the attention weighted prior information into an assembly submodule to obtain the query image prior information comprises: Multimodal prior information , basic prior information and attention-weighted prior information The input assembly submodule is a residual structure, and the main path of the residual structure converts the original multimodal prior information , the basic prior information and the attention weighted prior information In the input splicing block, the residual path of the residual structure includes a TE encoder block and a CBAM block, the CBAM block includes a channel attention mechanism block and a spatial attention mechanism block, and both the channel attention mechanism block and the spatial attention mechanism block are residual structures; The multimodal prior information , the basic prior information and the attention weighted prior information Fusion is performed to obtain fusion prior information , the acquisition of fusion prior information The formula is as follows: The fusion prior information Input into the splicing block; Then the fusion prior information Input the TE encoder block to obtain the first prior information , the first prior information is obtained The formula is as follows: in, Represents a stacked Transformer encoder, which transforms the first prior information Input into the splicing block; The fusion prior information Input into the CBAM block to obtain the second prior information , the second prior information is obtained The formula is as follows: in, Represents the CBAM block, the second prior information Input into the splicing block; The multimodal prior information , the basic prior information , the attention weighted prior information , the fusion prior information , the first prior information and the second prior information The splicing is performed in the channel dimension, and the splicing formula is as follows: in, represents the prior information of the query image, , Represents the concatenation function.

7. The small sample semantic segmentation method integrating category label semantics according to claim 1, characterized in that: The step of inputting the high-level, middle-level, and low-level query image prior information into the multi-scale fusion module to obtain the final segmentation prediction includes: Inputting the high-level, middle-level, and low-level query image prior information into a multi-scale fusion module, the multi-scale fusion module comprising a dual-channel convolution block and a final decoder, the dual-channel convolution block comprising a first convolution path and a second convolution path, the first convolution path comprising a 3X3 convolution layer, a batch normalization layer, and an ELU activation layer, the second convolution path comprising a 1X1 convolution layer, a group normalization layer, and a ReLU activation layer, the final decoder comprising a convolution layer, a batch normalization layer, an ELU activation layer, and a CBAM block; The high-level, middle-level, and low-level query image prior information are subjected to channel discarding processing and are respectively input into the dual-channel convolution block for feature aggregation processing. The processed high-level query image prior information is upsampled and then fused with the processed middle-level query image prior information by element addition. The fused query image prior information is input into the dual-channel convolution block for feature aggregation processing. The processed fused query image prior information is upsampled and then fused with the processed low-level query image prior information by element addition and input into the dual-channel convolution block. Feature aggregation processing and upsampling are then input into the final decoder. The final decoder obtains the final segmentation prediction and performs loss calculation. The formula for the loss calculation is as follows: in, Represents the predicted mask of the query image and its corresponding true mask The Dice loss between represents CE loss, Represents the total loss.

8. A small sample semantic segmentation system integrating category label semantics, characterized in that: include: A feature acquisition module is used to acquire and preprocess query images, support images, support masks, and text category labels to obtain multi-layer query features, multi-layer support features, and text features; A prior information generation module, used for inputting the high-level, middle-level and low-level features in the multi-layer query features and the multi-layer support features into the prior information generation module respectively to perform high-level, middle-level and low-level query image prior information generation processing, wherein the prior information generation module comprises a text image adaptation submodule, a prior generation submodule, a cross-attention submodule and an assembly submodule, wherein the text image adaptation submodule performs a multimodal prior information generation operation to obtain multimodal prior information, the prior generation submodule performs a basic prior information generation operation to obtain basic prior information, the cross-attention submodule performs an attention weighted prior information generation operation to obtain attention weighted prior information, and the multimodal prior information, the basic prior information and the attention weighted prior information are input into the assembly submodule to obtain the query image prior information; The multi-scale fusion module is used to input the high-level, middle-level and low-level prior information of the query image into the multi-scale fusion module to obtain the final segmentation prediction.

9. A storage medium, characterized in that: The storage medium stores one or more programs, which, when executed by the processor, implement the small sample semantic segmentation method integrating category label semantics as described in any one of claims 1 to 7.

10. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the small sample semantic segmentation method integrating category label semantics as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Multi-label image recognition model training method and device and multi-label image recognition method and device

    CN117036866A

  • Medical image semantic segmentation method and system based on small sample meta-learning

    CN117788812A

  • Training method and device of small sample semantic segmentation model, equipment and medium

    CN118096800A

  • Semantic segmentation model training methods and apparatuses, electronic devices, and storage media

    US20200134375A1

  • Few-shot semantic image segmentation using dynamic convolution

    US20230154007A1

Cited By

  • Polyp image segmentation method and system based on detail restoration network

    CN119048530A

  • Reference image segmentation method and system based on multi-level feature fusion

    CN119049058A

  • Target detection method and device, equipment and storage medium

    CN119579868A

  • Small sample image semantic segmentation method and device based on prior information optimization and storage medium

    CN121640179A