A small-sample medical image segmentation method and system based on pixel-level contrastive learning

By employing a few-sample medical image segmentation method based on pixel-level contrastive learning, and utilizing a dual-branch network and pixel-level contrastive learning to optimize the model, the problem of scarce labeled data in medical image segmentation is solved, achieving efficient and accurate medical image segmentation.

CN118212249BActive Publication Date: 2025-10-31NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410299170.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-10-31
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

Existing technologies for medical image segmentation suffer from poor segmentation results due to the scarcity of labeled data, making it difficult to apply few-shot learning algorithms in real-world scenarios.

Method used

A few-sample medical image segmentation method based on pixel-level contrastive learning is adopted. Through a dual-branch network model, the support set feature vector is extracted using conditional branching. The model is optimized by combining pixel-level contrastive learning, and the contrastive learning loss function and cross-entropy loss function are calculated to obtain the final mixed loss function, thereby improving the segmentation accuracy.

Benefits of technology

It reduces annotation costs, improves the model's generalization ability and segmentation accuracy, enhances the semantic correlation between pixels, and improves computational efficiency and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118212249B_ABST
    Figure CN118212249B_ABST
Patent Text Reader

Abstract

This invention discloses a few-sample medical image segmentation method and system based on pixel-level contrastive learning. The method includes: acquiring and processing MRI image data of different organs; using MRI image data of non-cardiac organs as the training and validation set, and cardiac MRI image data as the test set; inputting the MRI image data of non-cardiac organs into a two-branch network few-sample learning segmentation model for training and validation; optimizing the two-branch network few-sample learning segmentation model using a pixel-level contrastive learning method; and using the trained two-branch network few-sample learning segmentation model to predict the test set data and obtain the segmentation prediction results. The pixel-level contrastive learning method based on coordinate-based positive and negative sample partitioning proposed in this invention not only reduces the cost of medical image annotation and improves the generalization ability of the two-branch network few-sample learning segmentation model, but also improves segmentation accuracy and enhances semantic relevance between pixels by optimizing the positive and negative sample partitioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing technology, and in particular to a small-sample medical image segmentation method and system based on pixel-level contrastive learning. Background Technology

[0002] With the continuous advancement of medical technology and the rapid development of medical imaging, medical images are playing an increasingly important role in clinical diagnosis, disease assessment, and surgical navigation. Medical image segmentation, as a crucial step in medical image analysis, aims to accurately extract regions or structures of interest from complex medical images, thereby providing doctors with objective and quantitative diagnostic evidence. However, acquiring annotated medical image data often faces numerous challenges, such as the complexity and high level of expertise required for the annotation process, high costs, and issues related to patient privacy protection. These factors significantly limit the development and application of medical image segmentation technology.

[0003] To address the scarcity of labeled medical image data, Few-Shot Learning (FSL), as an emerging machine learning framework, has gradually attracted researchers' attention. However, despite its potential applications in medical image segmentation, current techniques still face numerous challenges. First, the complexity and diversity of medical images make it difficult to directly apply FSL techniques to real-world scenarios. Medical images often contain rich anatomical and textural information, and the appearance of images from different locations and diseases varies significantly. This necessitates that FSL algorithms fully mine and utilize limited labeled information to achieve accurate segmentation. Summary of the Invention

[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0005] In view of the aforementioned existing problems, this invention is proposed. Therefore, this invention provides a few-sample medical image segmentation method based on pixel-level contrastive learning to solve the problem of poor segmentation results caused by scarce datasets.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a small-sample medical image segmentation method based on pixel-level contrastive learning, comprising:

[0008] MRI image data of different organs are acquired and processed. MRI image data of non-cardiac organs are used as training and validation sets, and cardiac MRI image data is used as test set. The training set, validation set, and test set include support set and query set, respectively.

[0009] The MRI image data of the non-cardiac organs are input into a two-branch network few-shot learning segmentation model. The support set feature vector is extracted using conditional branches. The support set feature vector is then passed to the segmentation branch after activation and compression to segment the query set images.

[0010] The pixel-level contrastive learning method is used to optimize the small sample learning segmentation model of the dual-branch network. The contrastive learning loss function is calculated, and the result of the contrastive learning loss function is combined with the cross-entropy loss function to obtain the final mixed loss function.

[0011] The trained dual-branch network is used to learn the segmentation model using few samples to predict the segmentation results on the test set data.

[0012] As a preferred embodiment of the small-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, the method involves processing MRI image data of different organs, including...

[0013] The MRI image data of the different organs are filtered to remove slice data that do not contain the segmentation target, and geometric transformation and brightness transformation are performed on the MRI image data of the different organs.

[0014] As a preferred embodiment of the small-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, the method includes: extracting support set feature vectors using conditional branching; these support set feature vectors, after activation and compression, are then passed to the segmentation branch to segment the query set image, including...

[0015] Both the conditional branch and the split branch contain four encoders, one bottleneck block, and four decoders;

[0016] The support set feature vectors are excited and compressed as follows:

[0017]

[0018] Among them, u con u is the feature vector output by the conditional branch convolution block. seg To segment the feature vector output of the convolutional block, P(·) represents a 1*1*1 convolution operation, and σ(·) represents the sigmoid function. This is the output after excitation and compression.

[0019] As a preferred embodiment of the few-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, the method includes: optimizing the dual-branch network few-sample learning segmentation model using pixel-level contrastive learning, including...

[0020] In the bottleneck blocks of conditional branches and split branches, a multilayer perceptron is used to obtain pixel-level features of the support set and the query set.

[0021] The Euclidean distance between each pixel sample in the pixel-level features of the query set and each pixel sample in the pixel-level features of the support set is calculated and expressed as:

[0022]

[0023] Where, q (i,j) To query the pixel-level feature pixel sample coordinates, k (m,n) To support the pixel-level feature pixel coordinates of the support set, m is the x-coordinate of the support set pixel-level feature pixel sample, i is the x-coordinate of the query set pixel-level feature pixel sample, n is the y-coordinate of the support set pixel-level feature pixel sample, and j is the y-coordinate of the query set pixel-level feature pixel sample.

[0024] As a preferred embodiment of the small-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, it further includes:

[0025] The obtained Euclidean distance is normalized, and a threshold T is set to initially determine the set of positive and negative samples of pixel point samples in the support set pixel-level features.

[0026] After the support set features and query set features of the two bottleneck blocks are processed by 1*1 convolution, two sets of feature vectors are obtained. The cosine similarity of the two sets of feature vectors is calculated, the similarity matrix is ​​obtained to filter false negative samples, and the positive and negative sample sets are updated.

[0027] As a preferred embodiment of the small-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, the method includes: calculating the contrastive learning loss function, including...

[0028] The contrastive learning loss function is calculated based on the predefined positive and negative samples, and is expressed as follows:

[0029]

[0030] Where q represents the pixel-level feature data of the query set, k represents the pixel-level feature data of the support set, P represents the set of positive samples, and N represents the set of negative samples. As a positive sample, For negative samples, τ is the temperature hyperparameter, M is the number of positive samples, and L is the number of positive samples. cpc To compare the loss function values.

[0031] As a preferred embodiment of the small-sample medical image segmentation method based on pixel-level contrastive learning described in this invention, the final hybrid loss function is obtained by combining the contrastive learning loss function result and the cross-entropy loss function, including:

[0032] The cross-entropy loss function is expressed as:

[0033]

[0034] Among them, y i For cardiac MRI labeled images, p(y) i () represents the predicted cardiac MRI map, where N is the number of labels and L is the cross-entropy loss function value;

[0035] By combining the contrastive learning function and the cross-entropy loss function, the hybrid loss function is expressed as follows:

[0036] L M =L+L cpc

[0037] Where L is the value of the cross-entropy loss function, L cpc To compare the loss function values, L M This is a mixed loss function.

[0038] Secondly, this invention provides a system for small-sample medical image segmentation based on pixel-level contrastive learning, comprising,

[0039] The data preprocessing module is used to acquire and process MRI image data of different organs. MRI image data of non-cardiac organs are used as training and validation sets, and cardiac MRI image data are used as test sets. The training set, validation set, and test set include support set and query set, respectively.

[0040] The dual-branch network model module is used to input the MRI image data of the non-cardiac organs into the dual-branch network few-shot learning segmentation model, extract the support set feature vector using the conditional branch, and then pass the support set feature vector to the segmentation branch to segment the query set image after activation and compression.

[0041] A pixel-level contrastive learning module is used to optimize the few-shot learning segmentation model of the dual-branch network using a pixel-level contrastive learning method.

[0042] The loss function calculation module is used to calculate the contrastive learning loss function, and combine the result of the contrastive learning loss function with the cross-entropy loss function to obtain the final mixed loss function.

[0043] The prediction module is used to predict the segmentation results on the test set data using a pre-trained dual-branch network small sample learning segmentation model.

[0044] Thirdly, the present invention provides a computing device, comprising:

[0045] Memory and processor;

[0046] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the small sample medical image segmentation method based on pixel-level contrastive learning.

[0047] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the small-sample medical image segmentation method based on pixel-level contrastive learning.

[0048] Compared with existing technologies, the beneficial effects of this invention are as follows: The pixel-level contrastive learning method based on coordinate-based positive and negative sample division proposed in this invention not only reduces the cost of medical image annotation and improves the generalization ability of the dual-branch network small sample learning segmentation model, but also improves the segmentation accuracy by optimizing the positive and negative sample division and enhances the semantic correlation between pixels, thereby improving the model performance; at the same time, it reduces the computational cost and improves the computational efficiency while ensuring performance, demonstrating high flexibility and applicability. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0050] Figure 1 This is a schematic diagram illustrating the general process of a small-sample medical image segmentation method based on pixel-level contrastive learning according to an embodiment of the present invention;

[0051] Figure 2 This is a schematic diagram of the overall process of a small-sample medical image segmentation method based on pixel-level contrastive learning according to an embodiment of the present invention;

[0052] Figure 3 This is a schematic diagram of a dual-branch network small-sample learning network model for a small-sample medical image segmentation method based on pixel-level contrastive learning according to an embodiment of the present invention;

[0053] Figure 4 This is a schematic diagram illustrating the division of positive and negative samples in a small-sample medical image segmentation method based on pixel-level contrastive learning according to an embodiment of the present invention.

[0054] Figure 5 This is a schematic diagram of a portion of the cardiac MRI prediction results of a small-sample medical image segmentation method based on pixel-level contrastive learning according to an embodiment of the present invention. Detailed Implementation

[0055] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0058] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.

[0059] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0060] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0061] Example 1

[0062] Reference Figures 1-4 As an embodiment of the present invention, a few-sample medical image segmentation method based on pixel-level contrastive learning is provided, comprising:

[0063] S100: Acquire and process MRI image data of different organs, use MRI image data of non-cardiac organs as training set and validation set, and use cardiac MRI image data as test set. The training set, validation set and test set include support set and query set, respectively.

[0064] Furthermore, the MRI image data of different organs are filtered to remove slice data that do not contain the segmentation target, and geometric transformation and brightness transformation are performed on the MRI image data of different organs.

[0065] It should be noted that the input consists of two medical image datasets, CHAOST2 and CMR, both MRI images but with different segmentation target locations. The CHAOST2 dataset is used as the training and validation set, and the CMR dataset is used as the test set. Five data points (5-shot) are sampled from the test set as the support set, and the rest are used as the query set.

[0066] Specifically, 80% of the MRI images in the CHAOST2 dataset are used as the training set and 20% as the validation set. After the training set and validation set are divided into support set and query set, a segmentation target (label) is randomly selected each time. Each time, a query image and a support image are input in pairs. This pair of images first has a segmentation target, and secondly, they come from two consecutive slice samples of the same volume in the data.

[0067] The CMR dataset is used as the test set. After selecting a segmentation target, 5 sample slices and their labels are taken as the support set data. These 5 samples come from the same volume. The selection method is to divide the volume (3D) containing the segmentation target into 5 smaller volumes, and then take the center slice of each of the 5 volumes as the 5 support samples.

[0068] Conversely, the test set query set comes from other volumes, which contain segmentation targets and are also divided into 5 parts, each part corresponding to 5 supporting samples. Each time, one supporting sample is input and the query sample is a query sample of the corresponding part.

[0069] It should also be noted that the data input method during testing is similar to that during training. Each time, a segmentation target is selected, and a query image and a support image are input in pairs.

[0070] S102: MRI image data of non-cardiac organs are input into a two-branch network few-shot learning segmentation model. Support set feature vectors are extracted using conditional branches. These feature vectors are then activated and compressed before being passed to the segmentation branch to segment the query set images. The two-branch network few-shot learning segmentation model is as follows: Figure 3 As shown;

[0071] Furthermore, both the conditional branch and the split branch contain four encoders, one bottleneck block, and four decoders;

[0072] The support set feature vectors are excited and compressed as follows:

[0073]

[0074] Among them, u con u is the feature vector output by the conditional branch convolution block. seg To segment the feature vector output of the convolutional block, P(·) represents a 1*1*1 convolution operation, and σ(·) represents the sigmoid function. The output after excitation and compression;

[0075] It should be noted that each decoder, bottleneck block, and encoder is composed of convolutional blocks. Each convolutional block consists of two repeated 3x3 convolutional blocks, followed by the ReLU activation function. Skip connections are used between the encoder and decoder blocks. Four downsampling operations use 2x2 max pooling with a stride of 2, and four upsampling operations use 4x4 deconvolution to restore the image resolution. Finally, the network's segmentation map is output after a 1x1 convolution operation and the Sigmoid activation function.

[0076] It should also be noted that this scheme achieves efficient segmentation of MRI image data of non-cardiac organs by introducing a dual-branch network few-sample learning segmentation model; the support set feature vectors extracted by the conditional branch, after activation and compression, can enhance useful information and suppress irrelevant information, thereby improving the segmentation accuracy of the segmentation branch on the query set image; at the same time, the design of the dual-branch network ensures that the model still has good generalization ability when labeled data is scarce, reduces labeling costs, and improves the practicality and popularity of medical image segmentation technology.

[0077] S104: Optimize the small sample learning segmentation model of the dual-branch network using pixel-level contrastive learning method, calculate the contrastive learning loss function, and combine the result of the contrastive learning loss function with the cross-entropy loss function to obtain the final mixed loss function.

[0078] Furthermore, a multilayer perceptron is used in the bottleneck blocks of conditional branches and splitting branches to obtain pixel-level features of the support set and the query set.

[0079] Preferably, the pixel-level features of the support set and the pixel-level features of the query set are represented as follows:

[0080] y = g(f(x))

[0081] Where f(·) represents obtaining the feature map by encoding and mapping the original image x through the backbone network, and g(·) represents mapping the feature map to the feature vector y through the projection head;

[0082] It should be noted that two projection heads were added after the output feature maps of the two bottleneck blocks in the dual-branch architecture. The projection heads used a multilayer perceptron network, which mainly consisted of two 1*1 convolutions with a ReLU nonlinear activation layer in the middle.

[0083] The Euclidean distance between each pixel sample in the pixel-level features of the query set and each pixel sample in the pixel-level features of the support set is calculated and expressed as:

[0084]

[0085] Where, q (i,j) To query the pixel-level feature pixel sample coordinates, k (m,n) To support the pixel-level feature pixel point sample coordinates, m is the x-coordinate of the support set pixel-level feature pixel point sample, i is the x-coordinate of the query set pixel-level feature pixel point sample, n is the y-coordinate of the support set pixel-level feature pixel point sample, and j is the y-coordinate of the query set pixel-level feature pixel point sample.

[0086] It should be noted that the resolution of the bottleneck block output feature in this invention is 16*16, so the coordinates of each pixel are:

[0087] Coord (16,16) ={(0,0),…,(i,j),…,(m,n)…},(0≤i,j,m,n≤15)

[0088] Where m is the x-coordinate of the pixel-level feature pixel sample in the support set, i is the x-coordinate of the pixel-level feature pixel sample in the query set, n is the y-coordinate of the pixel-level feature pixel sample in the support set, j is the y-coordinate of the pixel-level feature pixel sample in the query set, and i, j, m, n are integers in the range [0, 15], representing the coordinate value of the pixel.

[0089] Furthermore, the obtained Euclidean distance is normalized, and a threshold T is set to initially determine the set of positive and negative samples of pixel point samples in the support set pixel-level features.

[0090] Preferably, the distance between pixel coordinates is normalized to the unit diagonal length, which means the distance is multiplied by... Expressed as a formula:

[0091]

[0092] Where T is the set threshold, q (i,j) To query the pixel-level feature pixel sample coordinates, k (m,n) To support the pixel-level feature pixel point sample coordinates, m is the x-coordinate of the support set pixel-level feature pixel point sample, i is the x-coordinate of the query set pixel-level feature pixel point sample, n is the y-coordinate of the support set pixel-level feature pixel point sample, and j is the y-coordinate of the query set pixel-level feature pixel point sample.

[0093] It should be noted that pixels with support set features that are close to each other are classified as positive samples, and pixels that are far away are classified as negative samples.

[0094] After the support set features and query set features of the two bottleneck blocks are processed by 1*1 convolution, two sets of feature vectors are obtained. The cosine similarity between the two sets of feature vectors is calculated, the similarity matrix is ​​obtained to filter out false negative samples, and the positive and negative sample sets are updated.

[0095] Preferably, the maximum value in each row of the similarity matrix is ​​the false negative sample to be filtered; selecting positive and negative samples is as follows: Figure 4 As shown;

[0096] Furthermore, the contrastive learning loss function is calculated based on the predefined positive and negative samples, and is expressed as:

[0097]

[0098] Where q represents the pixel-level feature data of the query set, k represents the pixel-level feature data of the support set, P represents the set of positive samples, and N represents the set of negative samples. As a positive sample, For negative samples, τ is the temperature hyperparameter, M is the number of positive samples, and L is the number of positive samples. cpc To compare the loss function values;

[0099] Furthermore, the cross-entropy loss function is expressed as:

[0100]

[0101] Among them, y i For cardiac MRI labeled images, p(y) i () represents the predicted cardiac MRI map, where N is the number of labels and L is the cross-entropy loss function value;

[0102] By combining the contrastive learning function and the cross-entropy loss function, the hybrid loss function is expressed as follows:

[0103] L M =L+L cpc

[0104] Where L is the value of the cross-entropy loss function, L cpc To compare the loss function values, L M It is a mixed loss function;

[0105] It should be noted that by calculating the contrastive learning loss function and combining it with the cross-entropy loss function, a final hybrid loss function is obtained, which more effectively guides the model training process. This not only fully utilizes the semantic information between pixels but also incorporates labeled data, enabling the model to consider both pixel similarity and label accuracy during training, thereby improving the model's segmentation accuracy. This technical solution, by introducing a pixel-level contrastive learning method, significantly improves the performance of the dual-branch network few-shot learning segmentation model, providing strong support for the development and application of medical image segmentation technology.

[0106] S106: Use the trained dual-branch network to learn the segmentation model with few samples to predict the segmentation prediction results on the test set data;

[0107] Furthermore, the preprocessed CMR dataset is input into a trained dual-branch network few-shot learning segmentation model to obtain cardiac MRI image segmentation maps.

[0108] The above is an illustrative scheme of a few-sample medical image segmentation method based on pixel-level contrastive learning according to this embodiment. It should be noted that the technical solution of this few-sample medical image segmentation system based on pixel-level contrastive learning belongs to the same concept as the technical solution of the aforementioned few-sample medical image segmentation method based on pixel-level contrastive learning. Details not described in detail in the technical solution of the few-sample medical image segmentation system based on pixel-level contrastive learning in this embodiment can be found in the description of the technical solution of the aforementioned few-sample medical image segmentation method based on pixel-level contrastive learning.

[0109] This embodiment of the small-sample medical image segmentation system based on pixel-level contrastive learning includes:

[0110] The data preprocessing module is used to acquire and process MRI image data of different organs. MRI image data of non-cardiac organs are used as training and validation sets, and cardiac MRI image data are used as test sets. The training set, validation set, and test set include support set and query set, respectively.

[0111] The dual-branch network model module is used to input MRI image data of non-cardiac organs into the dual-branch network few-sample learning segmentation model, extract support set feature vectors using conditional branches, and then pass the support set feature vectors through activation and compression to the segmentation branch to segment the query set images.

[0112] The pixel-level contrastive learning module is used to optimize the few-shot learning segmentation model of the dual-branch network using the pixel-level contrastive learning method.

[0113] The loss function calculation module is used to calculate the contrastive learning loss function, and combine the result of the contrastive learning loss function with the cross-entropy loss function to obtain the final mixed loss function.

[0114] The prediction module is used to predict the segmentation results on the test set data using a pre-trained dual-branch network small sample learning segmentation model.

[0115] This embodiment also provides a computing device suitable for small-sample medical image segmentation based on pixel-level contrastive learning, including:

[0116] The system includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes these instructions to implement the small-sample medical image segmentation method based on pixel-level contrastive learning as proposed in the above embodiments.

[0117] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the small sample medical image segmentation method based on pixel-level contrastive learning as proposed in the above embodiments.

[0118] The storage medium proposed in this embodiment and the small sample medical image segmentation method based on pixel-level contrastive learning proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0119] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0120] Example 2

[0121] Reference Figure 5 As an embodiment of the present invention, a small-sample medical image segmentation method based on pixel-level contrastive learning is provided, and experimental test results are provided to verify its beneficial effects.

[0122] First, input two preprocessed medical image datasets: abdominal MRI data CHAOST2 and cardiac MRI data CMR. Both datasets have a resolution of 256*256. CHAOST2 has 20 volumes with a total of about 3000 slices, and CMR has 35 volumes with a total of about 380 slices.

[0123] CHAOST2 has four parts that need to be divided: liver, right kidney, left kidney, and spleen; CMR has two parts that need to be divided: left ventricle (LV-BP) and right ventricle (RV);

[0124] CHAOST2 was divided into training and validation sets in a 4:1 ratio. The training and validation sets were further divided into support and query sets. First, a segmentation target (label) was randomly selected. During training, a query image and a support image were input in pairs (1-way 1-shot). The pair of images first had a segmentation target, which came from two consecutive slice samples with the same number in the same volume (medical image 3D voxel) in the data.

[0125] Secondly, the CMR dataset is used as the test set. After selecting a segmentation target, 5 sample slices and their labels are taken as the support set data. These 5 samples come from the same volume. The slice selection method is to divide the volume containing the segmentation target into 5 smaller volumes and select the center slice of these 5 volumes as 5 support samples. The corresponding query set comes from other volumes, which are also divided into 5 parts. The 5 support samples correspond one-to-one with each part. Each time, one support sample is input and the query sample is a query sample of the corresponding part.

[0126] Then, the abdominal MRI data CHAOST2 is input into the dual-branch network small sample learning segmentation model for training and validation. A threshold T is set, which is 0.7 in this embodiment, to initially determine positive and negative samples. Pixels that are close to each other are classified as positive samples, and false negative samples are filtered out on this basis. The relevant loss function is calculated.

[0127] Finally, after obtaining the trained dual-branch network few-shot segmentation model, the test set data (cardiac MRI) was input into the saved model for prediction, and the results were as follows. Figure 5 The image shown is a segmentation result of a portion of a cardiac MRI image;

[0128] from Figure 5 It can be seen that, according to the method of the present invention, the final Dice coefficient (Dice similarity coefficient) and IoU (Intersection over Union) of LV-BP reach 68.64% / 80.22%, and the Dice / IoU of RV reach 62.77% / 67.10%;

[0129] Therefore, by introducing a dual-branch network few-sample learning segmentation model and a pixel-level contrastive learning method, this invention effectively improves the accuracy and performance of medical image segmentation. Satisfactory results have been achieved in both the Dice coefficient and the IoU index, fully demonstrating its effectiveness in practical applications. These results not only provide strong support for the development of medical image segmentation technology but also offer more accurate and reliable auxiliary means for clinical diagnosis and treatment.

[0130] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A few-sample medical image segmentation method based on pixel-level contrastive learning, characterized in that, include: MRI image data of different organs are acquired and processed. MRI image data of non-cardiac organs are used as training and validation sets, and cardiac MRI image data is used as test set. The training set, validation set, and test set include support set and query set, respectively. The MRI image data of the non-cardiac organs are input into a two-branch network few-shot learning segmentation model. The support set feature vector is extracted using conditional branches. The support set feature vector is then passed to the segmentation branch after activation and compression to segment the query set images. The pixel-level contrastive learning method is used to optimize the few-shot learning segmentation model of the dual-branch network, including using a multilayer perceptron network to obtain pixel-level features of the support set and the query set in the bottleneck block of the conditional branch and the segmentation branch. The Euclidean distance between each pixel sample in the pixel-level features of the query set and each pixel sample in the pixel-level features of the support set is calculated and expressed as: Where, q (i,j) To query the pixel-level feature pixel sample coordinates, k (m,n) To support the pixel-level feature pixel point sample coordinates, m is the x-coordinate of the support set pixel-level feature pixel point sample, i is the x-coordinate of the query set pixel-level feature pixel point sample, n is the y-coordinate of the support set pixel-level feature pixel point sample, and j is the y-coordinate of the query set pixel-level feature pixel point sample. Calculate the contrastive learning loss function, and combine the result of the contrastive learning loss function with the cross-entropy loss function to obtain the final mixed loss function; The calculation of the contrastive learning loss function includes calculating the contrastive learning loss function based on the predefined positive and negative samples, expressed as: Where q represents the pixel-level feature data of the query set, k represents the pixel-level feature data of the support set, P represents the set of positive samples, and N represents the set of negative samples. As a positive sample, For negative samples, τ is the temperature hyperparameter, M is the number of positive samples, and L is the number of positive samples. cpc To compare the loss function values; The trained dual-branch network is used to learn the segmentation model using few samples to predict the segmentation results on the test set data.

2. The small-sample medical image segmentation method based on pixel-level contrastive learning as described in claim 1, characterized in that, Processing MRI image data from different organs, including, The MRI image data of the different organs are filtered to remove slice data that do not contain the segmentation target, and geometric transformation and brightness transformation are performed on the MRI image data of the different organs.

3. The small-sample medical image segmentation method based on pixel-level contrastive learning as described in claim 2, characterized in that, The support set feature vector is extracted using conditional branching. This support set feature vector is then activated and compressed before being passed to the segmentation branch to segment the query set image. Both the conditional branch and the split branch contain four encoders, one bottleneck block, and four decoders; The support set feature vectors are excited and compressed as follows: Among them, u con u is the feature vector output by the conditional branch convolution block. seg To segment the feature vector output of the convolutional block, P(·) represents a 1*1*1 convolution operation, and σ(·) represents the sigmoid function. This is the output after excitation and compression.

4. The few-sample medical image segmentation method based on pixel-level contrastive learning as described in claim 3, characterized in that, It also includes, The obtained Euclidean distance is normalized, and a threshold T is set to initially determine the set of positive and negative samples of pixel point samples in the support set pixel-level features. After the support set features and query set features of the two bottleneck blocks are processed by 1*1 convolution, two sets of feature vectors are obtained. The cosine similarity of the two sets of feature vectors is calculated, the similarity matrix is ​​obtained to filter false negative samples, and the positive and negative sample sets are updated.

5. The small-sample medical image segmentation method based on pixel-level contrastive learning as described in claim 4, characterized in that, The results of the contrastive learning loss function and the cross-entropy loss function are combined to obtain the final hybrid loss function, including: The cross-entropy loss function is expressed as: Among them, y i For cardiac MRI labeled images, p(y) i () represents the predicted cardiac MRI map, where N is the number of labels and L is the cross-entropy loss function value; By combining the contrastive learning function and the cross-entropy loss function, the hybrid loss function is expressed as follows: L M L+L cpc Where L is the value of the cross-entropy loss function, L cpc To compare the loss function values, L M This is a mixed loss function.

6. A system for small-sample medical image segmentation based on pixel-level contrastive learning, applied to the method described in any one of claims 1-5, characterized in that, include, The data preprocessing module is used to acquire and process MRI image data of different organs. MRI image data of non-cardiac organs are used as training and validation sets, and cardiac MRI image data are used as test sets. The training set, validation set, and test set include support set and query set, respectively. The dual-branch network model module is used to input the MRI image data of the non-cardiac organs into the dual-branch network few-shot learning segmentation model, extract the support set feature vector using the conditional branch, and then pass the support set feature vector to the segmentation branch to segment the query set image after activation and compression. A pixel-level contrastive learning module is used to optimize the few-shot learning segmentation model of the dual-branch network using a pixel-level contrastive learning method. The loss function calculation module is used to calculate the contrastive learning loss function, and combine the result of the contrastive learning loss function with the cross-entropy loss function to obtain the final mixed loss function. The prediction module is used to predict the segmentation results on the test set data using a pre-trained dual-branch network small sample learning segmentation model.

7. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the small sample medical image segmentation method based on pixel-level contrastive learning as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the small-sample medical image segmentation method based on pixel-level contrastive learning as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Fundus blood vessel segmentation method based on branch attention and multi-model fusion

    CN111047613A

  • Brain tumor MRI image segmentation method based on double-branch network small sample learning

    CN116664595A