Text-guided image segmentation method

Fusion of image and text information in medical image segmentation through asymmetric bilateral cue blocks solves the problems of adaptive adjustment of text markers and insufficient utilization of text prior information, significantly improves segmentation performance, and achieves more accurate segmentation of infected areas.

CN118628746APending Publication Date: 2024-09-10SICHUAN UNIV

Patent Information

Application Number
CN202410853324.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing medical image segmentation methods lack adaptive adjustment and full utilization of text prior information when utilizing text markers and image information, resulting in limited segmentation performance.

Method used

The Asymmetric Bilateral Prompt Block (ABP) method is used to fuse and interact image and text information. Multi-modal fusion is performed through self-attention layer and bilateral cross-attention. Image-guided pruning and text prior information are used to enhance features. representation and object prediction, and utilizes text-guided decoder for upsampling in the decoding stage.

Benefits of technology

The performance of image segmentation is improved. By adaptively adjusting text labels and utilizing text prior information, the accuracy and representativeness of segmentation results are significantly improved. The experimental results outperform other methods on the QaTa-COV19 data set.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628746A
    Figure CN118628746A
Patent Text Reader

Abstract

The invention discloses a text-guided image segmentation method, which comprises the following steps of: in an image branch, processing an acquired image through a visual backbone encoder consisting of N encoder blocks to generate N image marks with different scales; in the text branch, the text description is marked through a text backbone encoder to obtain a text mark; jointly inputting the image mark and the text mark into an asymmetric bilateral prompt block; in the asymmetric bilateral prompt block, fusing and interacting the image and text information; in the decoding stage, an image decoder composed of a decoding block guided by N texts and a final decoding block is used for carrying out up-sampling on image marks with the help of text information; and the output is transmitted through a segmentation head, so that an image segmentation result of the infected region is obtained. According to the method, the main limitation of the current method can be overcome, that is, self-adaptive adjustment of text marks and full utilization of text priori information are lacked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, and in particular relates to a text-guided image segmentation method. Background Art

[0002] Traditional deep learning-based medical image segmentation methods mainly use convolutional or transformer-based neural networks to directly generate predicted masks of tumor or lesion regions. However, these single-modality methods often require a considerable amount of annotated image data to achieve satisfactory performance. In addition, many medical datasets are accompanied by diagnostic text descriptions or reports containing key information (e.g., descriptions of lesion severity and location) that can guide the segmentation process; however, this complementary textual information is often overlooked in these studies.

[0003] In recent years, multimodal learning, especially in vision-language models, has attracted extensive attention from researchers due to its robust generalization ability. Among these studies, the main approaches involve using criss-cross attention or its variants to model the multimodal interactions between feature representations and text descriptions of radiology images. This is usually achieved through a two-branch architecture that relies on a text backbone encoder as the text branch to generate static text embeddings, with the expectation that these embeddings will effectively interact with image tags through the criss-cross attention module on the image branch. Despite producing superior results, these approaches still suffer from two limitations. First, static text embeddings cannot promote the adaptive and progressive adjustment of the included text tags to accommodate different semantic contexts in image tags at different scales. For example, when visual features are gradually upsampled in the decoder to the final output, it is crucial to retain text tags that contain more valuable information about the segmentation targets while removing tags that contain irrelevant content. Second, the simple architectural design of the text branch also prevents the text embeddings from generating additional text prior information beyond being sent to the image branch for criss-cross attention calculations. This neglected text prior information actually contains valuable insights that can enhance image representation and target prediction.

[0004] Deep learning-based segmentation models have made significant progress in assisting the diagnosis of lung diseases by segmenting lung lesion regions in a large number of annotated X-ray images. Recently, in order to alleviate the demand for image data and further improve the segmentation performance, various studies have extended unimodal models to incorporate additional modalities such as diagnostic text annotations. Despite the widespread use of cross-attention mechanisms or their variants to model the interaction between visual and textual features, current text-guided medical image segmentation methods still face limitations. This includes the lack of adaptive adjustment of text tags to accommodate changes in image context, as well as deficiencies in exploring and utilizing text prior information. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a text-guided image segmentation method, which can overcome the main limitations of current methods, namely the lack of adaptive adjustment of text tags and full utilization of text prior information.

[0006] To achieve the above object, the technical solution adopted by the present invention is: a text-guided image segmentation method, comprising the steps of:

[0007] S10, in the image branch, the collected image is processed by a visual backbone encoder composed of N encoder blocks to generate N image tags of different scales; at the same time, in the text branch, the text description is tokenized by the text backbone encoder to obtain text tags; the image tags and the text tags are input into the asymmetric bilateral prompt block together;

[0008] S20, in the asymmetric bilateral cue block, image and text information are fused and interacted; with the assistance of the asymmetric bilateral cue block, text labels are pruned with image guidance to retain optimized information to guide segmentation, while image labels use text prior information to enhance feature representation and object prediction;

[0009] S30, in the decoding stage, an image decoder consisting of N text-guided decoding blocks and a final decoding block is used to upsample the image tags with the help of text information; the output is passed through the segmentation head to obtain the image segmentation result of the infected area.

[0010] Furthermore, in the asymmetric bilateral cue block:

[0011] After the image tags and text tags pass through the self-attention layer respectively, they go through their own bilateral cross attention to achieve multimodal fusion and interaction of image tags and text tags respectively; and two asymmetric operations, namely image-guided pruning and text prior information, are applied to the text branch and image branch respectively to enhance the learning of specific modality information and coordinate the differences between image and text tags.

[0012] Furthermore, multi-head cross attention is performed on the image branch and text branch respectively, where the query Q is derived from its own branch, while the key K and value V are from the opposite branch.

[0013] Furthermore, image-guided pruning is set after the bilateral cross-attention of the text branch; after pruning, it is processed by a cascaded text projector and projected into the text token for next use.

[0014] Furthermore, the cross-attention score map in the text branch is used as text prior information and interactively connected with the image tag in the channel dimension to obtain the image tag enhanced by the text prior information, which is then reshaped into the image tag through the decoder for next use.

[0015] Furthermore, in addition to using text prior information for feature-level enhancement, it is proposed to construct text prior prediction by introducing auxiliary constraints at the target level;

[0016] The first row of elements of the attention score map is extracted from the text branch for CLS processing; the information after CLS processing is reshaped; and the matching true value is obtained through a projector, a loss function, and a bilinear interpolation.

[0017] Furthermore, the context-guided decoder block jointly upsamples the encoder’s skip connection features by doubling the spatial scale and halving the channel dimension.

[0018] The beneficial effects of adopting this technical solution are:

[0019] In this paper, a new text-guided medical image segmentation method, Asymmetric Bilateral Prompt (ABP), is proposed to overcome the main limitations of current methods (i.e., lack of adaptive adjustment to textual tags and full utilization of textual prior information). ABP integrates symmetric bilateral cross attention for preliminary interaction and two asymmetric operations for modality-specific refinement. By leveraging attention scores from both image and text, we achieve adaptive adjustment to textual tags and enhance image representation, thereby improving segmentation performance. Experimental results on the QaTa-COV19 dataset demonstrate the superiority of the proposed method. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of the framework of the medical image segmentation method based on asymmetric bilateral prompt text guidance in an embodiment of the present invention;

[0021] Figure 2 is a schematic diagram of an ABP block in an embodiment of the present invention;

[0022] Figure 3 It is the qualitative segmentation result of the test sample in the embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described below with reference to the accompanying drawings.

[0024] In this embodiment, see Figure 1 As shown, the present invention proposes a text-guided image segmentation method, comprising the steps of:

[0025] S10, in the image branch, the captured image is processed by a visual backbone encoder composed of N encoder blocks to generate N image tags of different scales; at the same time, in the text branch, the text description is tokenized by the text backbone encoder to obtain text tags; the image tags and text tags are input into the asymmetric bilateral prompt block together.

[0026] Specifically, Figure 1 As shown, in the encoding stage of the image branch, the X-ray image is denoted as I and is processed by a visual backbone encoder consisting of three encoder blocks (i.e., Enc1, Enc2, and Enc3) to generate image labels of three different scales;

[0027] At the same time, in the text branch, the relevant text description is tokenized through the text backbone encoder to obtain the initial text tag T1; the image tag and text tag are jointly input into the asymmetric bilateral prompt block.

[0028] S20, in the asymmetric bilateral hint (ABP) block, the image and text information are fused and interacted; with the assistance of the asymmetric bilateral hint block, the text labels are pruned with image guidance to retain the optimized information to guide the segmentation, while the image labels use the text prior information to enhance the feature representation and object prediction, such as Figure 2 shown.

[0029] Before building the text-guided decoder block (i=1.2.3), an ABP block is incorporated to process the image tag I i and text mark T i , the purpose is to make full use of their complementary information and perform mutual refinement on the image and text branches. In the ABP block, bilateral cross attention is first introduced for preliminary multimodal fusion and interaction of visual and textual tags. In addition, two asymmetric operations, image-guided pruning and text-first merging, are applied in the text and image branches, respectively, to enhance the learning of specific modality information.

[0030] In the asymmetric bilateral prompt block: after the image tags and text tags pass through the self-attention layer respectively, they pass through their respective bilateral cross attention to achieve multimodal fusion and interaction of image tags and text tags respectively; and two asymmetric operations, namely image-guided pruning and text prior information, are applied to the text branch and image branch respectively to enhance the learning of specific modality information and coordinate the differences between image and text tags.

[0031] Specifically: through the corresponding projector and I i Project to and T iProject to

[0032] Multi-head cross attention is performed on the image branch and text branch respectively, where the query Q is derived from its own branch, while the key K and value V are from the opposite branch.

[0033]

[0034] Ci represents the channel size.

[0035] and represents the result of the criss-cross attention, which are then further fed into the feed-forward network to derive the final output of the bilateral criss-cross attention.

[0036] Note that the generated cross-attention score map and It is retained to guide and facilitate subsequent asymmetric manipulations, leading to modality-specific refinement in the opposite branch.

[0037] Text Branch-Image Guided Pruning:

[0038] While bilateral criss-cross attention can effectively model preliminary interactions between multimodal tokens, this symmetric form of interaction may not fully capture the essential modality-specific information that is tailored to each modality’s features. For example, as visual features are progressively decoded and upsampled to the final output, it becomes crucial to retain text tokens that contain relevant information about the segmentation target (e.g., words indicating lesion locations) while discarding tokens that contain irrelevant content (e.g., filler tokens and punctuation marks used as placeholders)

[27] . In the text branch of the ABP block, we utilize complementary information (e.g., attention score maps from the image branch) to help with text token selection and pruning. Image-guided pruning is set after the bilateral criss-cross attention in the text branch; after pruning, it is processed by a cascaded text projector and projected into the text token for next use.

[0039] Specifically, we first apply the average operation to the cross-attention score map The image branch along the third dimension generates attention values, and text tags with higher attention values ​​are considered to be more relevant to the visual representation, and thus are expected to play a more significant role in the subsequent decoding and segmentation process. The text tokens in are sorted in descending order of attention value and the top token is kept as [CLS], which is always retained as the token that directly represents the segmentation target and is therefore not affected during pruning.

[0040] Therefore, we organize the text tokens by their attention values ​​in descending order. The text mark in the text mark and replace the preceding (M i+1 -2) tokens are retained as attention tokens, denoted as [ATTN]. The first token is always retained as a token that directly indicates the segmentation target, denoted as [CLS], and is therefore not affected during pruning. Regarding the remaining tokens, we choose to utilize their attention values ​​as weights in the weighted average operation and fuse them into one token, denoted as [FUSE], rather than omitting them directly.

[0041] This approach ensures that a more comprehensive set of information is preserved during the pruning process. Finally, the pruned tokens can be represented as:

[0042]

[0043] In this way, markers that are highly relevant to the segmentation target are retained, while relatively irrelevant markers are merged into fused markers, making the pruned marker sequence more representative and enhancing the segmentation guidance.

[0044] After pruning, It is then processed by the cascaded text projector (Text Proji) and projected to T i+1 to be used as input to the next ABP block.

[0045] Image Branch-Text Prior:

[0046] The cross-attention score map in the text branch is used as the text prior information and interactively connected with the image tag in the channel dimension to obtain the image tag enhanced by the text prior information, which is then reshaped into the image tag through the decoder for next use.

[0047] This paper proposes a method to integrate textual prior information into the image branch more directly, aiming to maximize the utilization of textual cues in image decoding and segmentation. Recognizing that directly connecting textual tags to image tags may introduce potential problems of domain differences, this paper chooses to use the cross-attention score map from the text branch as supplementary textual prior information, which is incorporated into visual representation and object prediction through two different methods.

[0048] Specifically, in addition to using text prior information for feature-level enhancement, it is proposed to construct text prior prediction by introducing auxiliary constraints at the target level; specifically, extracting attention maps from the text branch The first element (index: 0) of It corresponds to the sequence The attention scores of the class labels [CLS] in .

[0049] The first row of elements of the attention score map is extracted from the text branch for CLS processing; the information after CLS processing is reshaped; and the matching true value is obtained through a projector, a loss function, and a bilinear interpolation.

[0050] Since [CLS] is preserved throughout the text token pruning and image decoding process, contains the information that best represents the segmentation target. Then, we Resize and pass through an MLP-based projector, sigmoid function and bilinear interpolation (BI) to obtain a text prior prediction m with dimensions matching the ground truth Y i .

[0051] S30, in the decoding stage, such as Figure 1 As shown, an image decoder consisting of N text-guided decoding blocks (i.e., Dec1, Dec2, and Dec3) and a final decoding block (Final Dec) is used to upsample the image tags with the help of text information; the output is passed through the segmentation head to obtain the image segmentation result of the infected area.

[0052] Specifically, Figure 1 As shown in the figure, in the decoding stage, an image decoder consisting of three text-guided decoding blocks and a final decoding block is used to upsample the image tags with the help of text information.

[0053] It is worth noting that before each decoder block, the present invention represents the image features in the form of tags, and inputs the image tags and text tags into the asymmetric bilateral hint block to promote the fusion and interaction of image and text information. With the assistance of the ABP block, the tags are specially image-guided pruned to retain the most relevant and representative information to guide segmentation, while the image tags benefit from the text prior information to enhance feature representation and target prediction. After processing in the ABP block, the text tags are further projected by the cascade projector (i.e., TextProj1-TextProj2) to match the channel dimension of the image features in the next scale. At the same time, the output image tags are reshaped back to the original spatial scale. The text-guided decoder block uses the jump connection features of the encoder to jointly upsample by doubling the spatial scale while halving the channel dimension. For the final decoder block, its output is passed through the segmentation head to obtain the final prediction mask of the infected area.

[0054] Specifically, the context-guided decoder block jointly upsamples the encoder’s skip connection features by doubling the spatial scale and halving the channel dimension.

[0055] Comparative Experiments. To evaluate the effectiveness of the proposed ABP, a comparative analysis is performed on four unimodal segmentation methods: UNet, UNet++, TransUNet, AttnUnet, and three multimodal text-guided segmentation methods: LViT, CPAM, and AT. It is worth noting that CPAM is reproduced with enhanced annotations, and AT is currently the state-of-the-art method for text-guided segmentation on QaTa-COV19. For all included methods, the optimal hyperparameter settings specified in their original papers are followed. Table 1 gives the Dice score (dice), Mean Intersection over Union (MIoU), and prediction accuracy (Acc) of the segmentation results of different methods on the test samples. By observation, the proposed ABP method consistently outperforms other methods on average in all three evaluation metrics. Compared with AT, the proposed method significantly improves the Dice score by 1.25%, MioU by 2.08%, and Acc by 0.31%. These enhancements can be attributed to the proposed efficient architecture, which includes symmetric bilateral cross attention for preliminary interactions and asymmetric modality-specific operations for further refinement.

[0056] Table 1 Quantitative comparison based on Dice, MIoU, Acc

[0057]

[0058]

[0059] Figure 3 Qualitative segmentation results derived from the test samples are shown. In the second row, the text annotation shows that the infection is only present in the left lung. However, without such textual guidance, distinguishing whether the right lung is infected based on image content alone is challenging, resulting in poor performance of single-modal methods. Notably, among the multi-modal methods that include text, only our ABP accurately segments the left lung region without misleading attention to the right lung, highlighting its special ability to leverage textual guidance.

[0060] To evaluate the contribution of each proposed module, we gradually created the following ablation models. Initially, the ABP block was removed and only the x-ray image was used for segmentation, establishing a unimodal baseline called Model A. Then, the text description and image-branch cross-attention were introduced into Model A to create a multimodal baseline Model B. Based on Model B, the text-branch cross-attention was integrated into Model C to form a complete symmetric bilateral cross-attention. Next, tag pruning without fusion of unattended tags was introduced to form Model D. Starting from Model D, we gradually merged fusion tags, text prior features, and text prior predictions to produce Model E, Model F, and Model G. As shown in Table 2, Model A performed poorly due to the lack of text assistance, while Model B showed significant improvement after introducing a simple image-branch cross-attention. After integrating the full bilateral cross-attention, the performance exceeded the AT method using unilateral cross-attention, demonstrating the effectiveness of the bilateral design of our invention. Subsequently, the asymmetric operations in Model D were introduced into Model G, which further improved the performance and highlighted the contribution of modality-specific processing to text-guided medical image segmentation.

[0061] Table 2 Quantitative comparison of Dice, Miou, ACC and other ablation models

[0062]

[0063] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A text-guided image segmentation method, It is characterized in that Includes steps: S10, in the image branch, the collected image is processed by a visual backbone encoder composed of N encoder blocks to generate N image tags of different scales; at the same time, in the text branch, the text description is tokenized by the text backbone encoder to obtain text tags; the image tags and text tags are input into the asymmetric bilateral prompt block together; S20, in the asymmetric bilateral cue block, image and text information are fused and interacted; with the assistance of the asymmetric bilateral cue block, the text labels are pruned with image guidance to retain the optimized information to guide the segmentation, while the image labels use the text prior information to enhance the feature representation and object prediction; S30, in the decoding stage, upsampling the image tags with the help of the text information using an image decoder consisting of N text-guided decoding blocks and a final decoding block; The output is passed through the segmentation head to obtain the image segmentation result of the infected area.

2. A text-guided image segmentation method according to claim 1, It is characterized in that In the asymmetric bilateral cue block: After the image tags and text tags pass through the self-attention layer respectively, they go through their own bilateral cross attention to achieve multimodal fusion and interaction of image tags and text tags respectively; and two asymmetric operations, namely image-guided pruning and text prior information, are applied to the text branch and image branch respectively to enhance the learning of specific modality information and coordinate the differences between image and text tags.

3. A text-guided image segmentation method according to claim 2, It is characterized in that Multi-head cross attention is performed on the image branch and text branch respectively, where the query Q is derived from its own branch, while the key K and value V are from the opposite branch.

4. A text-guided image segmentation method according to claim 2, It is characterized in that Image-guided pruning is set after the bilateral cross-attention of the text branch; after pruning, it is processed by a cascaded text projector and projected into the text token for next use.

5. A text-guided image segmentation method according to claim 2, It is characterized in that The cross-attention score map in the text branch is used as the text prior information and interactively connected with the image tag in the channel dimension to obtain the image tag enhanced by the text prior information, which is then reshaped into the image tag through the decoder for next use.

6. A text-guided image segmentation method according to claim 5, It is characterized in that In addition to using text prior information for feature-level enhancement, it is also proposed to construct text prior predictions by introducing auxiliary constraints at the target level; The first row of elements of the attention score map is extracted from the text branch for CLS processing; the information after CLS processing is reshaped; and the matching true value is obtained through a projector, a loss function, and a bilinear interpolation.

7. A text-guided image segmentation method according to claim 1, It is characterized in that The context-guided decoder block jointly upsamples the encoder’s skip connection features by doubling the spatial scale and halving the channel dimension.

Citation Information

Patent Citations

  • Multi-modal representation learning method based on text guide image block screening

    CN117421591A

  • Adaptive marking and attention pruning method for visual language model

    CN117787342A

Cited By

  • Handwriting extraction system, method and equipment based on multiple prior information fusion and medium

    CN121884368A