Multimodal medical image segmentation method and system based on SAM model
By introducing the modality encoder and modality perception module into the SAM model, freezing the parameters of the image encoder solves the problem that the SAM model can only be used for PET image segmentation, achieving efficient segmentation of multi-modal medical images, and improving improve the accuracy and reliability of diagnosis.
Patent Information
- Application Number
- CN202411012059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-26
AI Technical Summary
The existing SAM model can only be used for segmentation of PET images and cannot effectively process multi-modal medical image data, which limits its application in medical diagnosis.
By introducing the modality encoder and modality perception module into the SAM model, freezing the parameters of the image encoder, and using cross-entropy loss and Dice loss to train the model, the segmentation of multi-modal medical images, including PET-CT and other images, is achieved. deal with.
It significantly improves the accuracy and robustness of multi-modal medical image segmentation, saves computing resources, improves model training efficiency and recognition efficiency, and can process multi-modal medical image data including CT images.
Smart Images

Figure CN118537567B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image recognition, and in particular to a multimodal medical image segmentation method and system based on a SAM model. Background Art
[0002] In the field of medical imaging, "modality" refers to different technologies for obtaining images of the human body. Multidimensional information can help doctors make accurate diagnoses and develop effective, personalized treatment plans. In image-based medical decision-making, medical images of different forms of patients' specific organs can be obtained. Each image represents a mode, presenting the examined organ in a different way, making it easier for doctors to observe specific phenomena such as stroke at different levels. Accurate analysis of each of these image modes helps to find more appropriate medical decisions.
[0003] Common imaging modalities in the medical field include X-ray imaging, CT scanning, MRI (magnetic resonance imaging), ultrasound imaging, PET scanning, DSA (digital subtraction angiography), and imaging during endoscopic examinations. Due to the complementarity of these images, the value of single-modality images for medical diagnosis and treatment is limited. Integrating the complementary information provided by different imaging methods to form multimodality images (Multimodality Imaging) has a strong clinical demand in applications. For example, CT images can provide rich anatomical details, and PET can display rich physiological and biochemical information.
[0004] Therefore, multimodal medical images are a research field that has attracted increasing attention from the scientific community in recent years, especially due to their important significance in medical diagnosis, computer vision, and the Internet of Things. One of the biggest challenges in this research field is how to fuse multimodal medical image sensors such as positron emission tomography (PET), single photon emission computed tomography (SPECT), and magnetic resonance imaging (MRI) in an effective and optimal way.
[0005] The existing medical image segmentation efficiency is low, and the existing large visual models such as SAM (SegmentAnything, a basic model proposed by Meta AI dedicated to image segmentation, which can predict object masks based on the hints of specified objects) use ultra-large-scale data for model training, showing powerful image segmentation capabilities. However, SAM only uses PET images during training, so it can only be used for PET image segmentation, which limits the practical application of SAM in multimodal medical image segmentation tasks. The existing SAM model cannot meet the growing processing needs of multimodal medical image data. Summary of the invention
[0006] The technical problem to be solved by the embodiments of the present invention is to provide a multimodal medical image segmentation method and system based on the SAM model to meet the processing requirements of multimodal medical image data.
[0007] In order to solve the above technical problems, an embodiment of the present invention proposes a multimodal medical image segmentation method based on the SAM model, comprising:
[0008] Construction step: constructing a SAM model for segmenting multimodal medical images, the model comprising an image encoder, a mask decoder, a prompt encoder, a modality encoder and a modality perception module, wherein the modality encoder encodes the input non-PET modality medical image to obtain the non-PET features of the non-PET modality medical image; the modality perception module interacts with the PET features according to the obtained non-PET features, completes the enhancement of the non-PET features and inputs them into the image encoder;
[0009] Training step: using cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model, wherein parameters of the image encoder are frozen during the training process to improve training efficiency and reduce computing resource requirements;
[0010] Segmentation step: identify and remove noise and artifacts in the medical images of multiple modalities to be segmented, obtain a processed multimodal medical image, input the processed multimodal medical image into the trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to the click prompt or object box prompt.
[0011] Accordingly, an embodiment of the present invention further provides a multimodal medical image segmentation system based on a SAM model, comprising:
[0012] Construction unit: construct a SAM model for segmenting multimodal medical images, the model comprising an image encoder, a mask decoder, a prompt encoder, a modality encoder and a modality perception module, wherein the modality encoder encodes the input non-PET modality medical image to obtain the non-PET features of the non-PET modality medical image; the modality perception module interacts with the PET features according to the obtained non-PET features, completes the enhancement of the non-PET features and inputs them to the image encoder;
[0013] Training unit: using cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model, wherein parameters of the image encoder are frozen during the training process to improve training efficiency and reduce computing resource requirements;
[0014] Segmentation unit: Identify and remove noise and artifacts in the medical images of multiple modalities to be segmented, obtain a processed multimodal medical image, input the processed multimodal medical image into the trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to the click prompt or object box prompt.
[0015] The beneficial effects of the present invention are:
[0016] (1) By integrating a lightweight modality perception module, the model can process multimodal medical image data including CT images without changing the original SAM structure. This means that SAM, which was originally only used for PET image segmentation, can now be extended to the segmentation of multimodal medical image data such as PET-CT images, greatly improving the recognition efficiency of medical images.
[0017] (2) The present invention achieves a significant improvement in the performance of the SAM model while ensuring computational efficiency and resource utilization. Compared with retraining the entire model or using a more complex network structure, the present invention not only saves computational resources, but also speeds up the training of the model, while ensuring the high efficiency of multimodal medical image data processing.
[0018] (3) The present invention has achieved excellent performance in multimodal medical image segmentation tasks. Experimental results show that the enhanced SAM significantly improves the segmentation accuracy and robustness of multimodal medical image data, and can more accurately process various modal information of medical images in medical decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a multimodal medical image segmentation method based on a SAM model according to an embodiment of the present invention.
[0020] Figure 2 It is a schematic diagram of the network structure of the SAM model of an embodiment of the present invention. DETAILED DESCRIPTION
[0021] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present invention is further described in detail below in conjunction with the drawings and specific embodiments.
[0022] In the embodiments of the present invention, if there are directional indications (such as up, down, left, right, front, back, etc.), they are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0023] In addition, in the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0024] Please refer to Figure 1 The multimodal medical image segmentation method based on the SAM model of an embodiment of the present invention includes a construction step, a training step and a segmentation step.
[0025] Construction steps: Construct a SAM model for segmenting multimodal medical images. The SAM model includes an image encoder, a mask decoder, a prompt encoder, a modality encoder, and a modality perception module. The medical image of the PET modality is directly input into the image encoder, and the medical image of the non-PET modality is input into the modality encoder. The modality encoder encodes the input non-PET modality medical image to obtain the non-PET features of the non-PET modality medical image. Non-PET includes X-ray, CT, MRI, ultrasound, DSA, SPECT, etc. Non-PET modalities include one or more of X-ray modality, CT modality, MRI modality, ultrasound modality, DSA modality, and SPECT modality. CT is taken as an example for explanation below. Please refer to Figure 2 .
[0026] The modality encoder encodes the input CT modality medical image to obtain the CT features of the CT modality medical image; the modality perception module interacts with the PET features according to the obtained CT features, completes the enhancement of the CT features and inputs them to the image encoder. The image encoder is used to map the image to be segmented to the image feature space. The prompt encoder is responsible for mapping the input prompt to the feature space of the prompt. The present invention adds a lightweight modality encoder and a modality perception module to the structure of the image encoder, mask decoder, and prompt encoder of the existing SAM model, endows the SAM model with CT feature perception capabilities, and efficiently expands the SAM model to the multimodal medical image segmentation task, and achieves good performance, thereby realizing the efficient application of SAM in the multimodal medical image segmentation task, thereby improving the accuracy and reliability of diagnosis.
[0027] The overall network structure diagram of the SAM model of the present invention is as follows: Figure 2 As shown on the left, the structure of the modality perception module (ModalityPerception Layer) is as follows Figure 2 As shown on the right, the parameters of SAM Image Encoder are frozen and do not participate in training, which can greatly reduce the number of parameters for model training.
[0028] The original SAM model includes an image encoder, a mask decoder, and a prompt encoder. The present invention is based on the original SAM model and adds two modules, the modality encoder and the modality perception module to achieve the multimodal expansion of SAM. The present invention reduces the amount of training parameters of the model, thereby maximizing the capacity of the SAM large model and avoiding the problem of overfitting when there is less training data. Therefore, in the modality encoder, the present invention uses a small number of convolutional layers for modality encoding, for example, using three convolutional layers. For the modality perception module, the present invention uses two cross-modal attention modules to realize the interaction of PET features and CT features.
[0029] Medical image coding in CT modality is performed by modality encoder Completed. Assume that the input CT modality medical image data is , its width and height are respectively Then the characteristics of medical images of CT modality are The acquisition method is as follows:
[0030] .
[0031] The present invention uses the modality perception module to realize the interaction between CT features and PET features. This process is realized through two cross-modality attention modules. CT characteristics of layers and PET characteristics Taking the fusion process of as an example, the formula of the cross-modal attention process is:
[0032]
[0033] Here represents cross-modal attention computation, Indicates the CT feature (i.e. non-PET feature) information that the PET modality pays attention to, and the enhanced PET feature It can be expressed as . Through the After the network layer .
[0034] So far, the enhancement from CT to PET has been completed. Next, we will introduce the enhancement of PET to CT feature information. The process is as follows:
[0035] .
[0036] Training step: Use cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model. Freeze the parameters of the image encoder during the training process to improve training efficiency and reduce computing resource requirements.
[0037] In this work, the inventors use the cross entropy loss and Dice loss To train the segmentation network:
[0038] ;
[0039] ;
[0040] in, and Represents the height and width of the image respectively, represents the segmentation label, Represents the segmentation result of the model. The total training loss is and The linear addition of .
[0041] Segmentation step: Identify and remove noise and artifacts in the medical images of multiple modalities to be segmented, obtain the processed multimodal medical images, input the processed multimodal medical images into the trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to the click prompt or object frame prompt. For example, the medical images of multiple modalities to be segmented are PET, or images obtained by different imaging methods, such as CT-PET, PET-MR composed of multimodal medical image data. The segmentation results are input to the recognition model of the relevant medical image for subsequent recognition.
[0042] The present invention avoids the huge computational overhead of retraining a large model for each multimodal task. The present invention realizes feature encoding of CT modal information or other modal information by introducing a lightweight modal encoder and a modal perception module. The modal perception module injects the encoded CT modal information into the backbone network of the SAM model to realize alternating enhancement of CT features and PET features, thereby realizing multimodal expansion of the SAM model.
[0043] The multimodal medical image segmentation system based on the SAM model of the embodiment of the present invention includes a construction unit, a training unit and a segmentation unit.
[0044] Construction unit: construct a SAM model for segmenting multimodal medical images, the model includes an image encoder, a mask decoder, a prompt encoder, a modality encoder and a modality perception module, wherein the modality encoder encodes the input CT modality medical image to obtain the CT features of the CT modality medical image; the modality perception module interacts with the PET features according to the obtained CT features, completes the enhancement of the CT features and inputs them to the image encoder.
[0045] Training unit: Use cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model, wherein the parameters of the image encoder are frozen during the training process to improve training efficiency and reduce computing resource requirements.
[0046] Segmentation unit: Identify and remove noise and artifacts in the medical images of multiple modalities to be segmented, obtain a processed multimodal medical image, input the processed multimodal medical image into the trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to the click prompt or object box prompt.
[0047] As an implementation method, the modality perception module includes two cross-modality attention modules, and the two cross-modality attention modules respectively enhance the CT feature to the PET feature and enhance the PET feature to the CT feature.
[0048] The enhancement process formula of PET features is:
[0049] ;
[0050] The enhancement process formula of CT features is:
[0051] ;
[0052] in, ; is the first CT characteristics of the layer, is the first PET characteristics of the layer, Represents the CT feature information of medical images of PET modality, For the enhanced PET features, Represents cross-modal attention computation.
[0053] As an implementation mode, the training unit trains the SAM model using the following formula:
[0054] ;
[0055] ;
[0056] in, and Represents the height and width of the image respectively, represents the segmentation label, represents the segmentation result of the SAM model, is the cross entropy loss, Dice loss.
[0057] The segmentation methods of medical images of other non-PET modalities such as X-ray modality, MRI modality, ultrasound modality, DSA modality, SPECT modality, etc. are the same as those of CT modality and will not be repeated here.
[0058] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A multimodal medical image segmentation method based on the SAM model, characterized in that: include: Construction step: constructing a SAM model for segmenting multimodal medical images, the model comprising an image encoder, a mask decoder, a prompt encoder, a modality encoder and a modality perception module, wherein the modality encoder encodes the input non-PET modality medical image to obtain the non-PET features of the non-PET modality medical image; the modality perception module interacts with the PET features according to the obtained non-PET features, completes the enhancement of the non-PET features and inputs them into the image encoder; Training step: using cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model, wherein parameters of the image encoder are frozen during the training process to improve training efficiency and reduce computing resource requirements; Segmentation step: identifying and removing noise and artifacts in the medical images of multiple modalities to be segmented, obtaining a processed multimodal medical image, inputting the processed multimodal medical image into a trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to a click prompt or an object frame prompt; The modality perception module includes two cross-modal attention modules, which respectively enhance the non-PET features to the PET features and enhance the non-PET features from the PET features. The enhancement process formula of PET features is: ; The enhancement process formula for non-PET features is: ; in, ; is the first Non-PET characteristics of the layer, is the first PET characteristics of the layer, Represents non-PET feature information of interest in medical images of PET modality, For the enhanced PET features, Represents cross-modal attention computation.
2. The multimodal medical image segmentation method based on the SAM model as claimed in claim 1, characterized in that: In the training step, the SAM model is trained using the following formula: ; ; in, and Represents the height and width of the image respectively, represents the segmentation label, represents the segmentation result of the SAM model, is the cross entropy loss, Dice loss.
3. A multimodal medical image segmentation system based on the SAM model, characterized in that: include: Construction unit: construct a SAM model for segmenting multimodal medical images, the model comprising an image encoder, a mask decoder, a prompt encoder, a modality encoder and a modality perception module, wherein the modality encoder encodes the input non-PET modality medical image to obtain the non-PET features of the non-PET modality medical image; the modality perception module interacts with the PET features according to the obtained non-PET features, completes the enhancement of the non-PET features and inputs them to the image encoder; Training unit: using cross entropy loss and Dice loss to train the SAM model to obtain a trained SAM model, wherein parameters of the image encoder are frozen during the training process to improve training efficiency and reduce computing resource requirements; Segmentation unit: Identify and remove noise and artifacts in the medical images of multiple modalities to be segmented, obtain a processed multimodal medical image, input the processed multimodal medical image into the trained SAM model, and the SAM model outputs the segmentation results of each object in the multimodal medical image according to the click prompt or object frame prompt; The modality perception module includes two cross-modal attention modules, which respectively enhance the non-PET features to the PET features and enhance the non-PET features from the PET features. The enhancement process formula of PET features is: ; The enhancement process formula for non-PET features is: ; in, ; is the first Non-PET characteristics of the layer, is the first PET characteristics of the layer, Represents non-PET feature information of interest in medical images of PET modality, For the enhanced PET features, Represents cross-modal attention computation.
4. The multimodal medical image segmentation system based on the SAM model as claimed in claim 3, characterized in that: The training unit trains the SAM model using the following formula: ; ; in, and Represents the height and width of the image respectively, represents the segmentation label, represents the segmentation result of the SAM model, is the cross entropy loss, For Dice loss.
Citation Information
Patent Citations
Three-dimensional object segmentation of medical images localized by object detection
CN114503159A
SAM-based cross-modal domain generalization medical image segmentation method
CN117808834A
Cross-modal tumor automatic segmentation method based on PET-CT medical image and storage medium
CN118172372A
Medical image segmentation method and device, computer equipment and storage medium
CN118351304A
