Method for improving small sample medical image segmentation through multi-task learning
Through the multi-task learning method, the FS-C module and the masked average pooling module are used to solve the problem of poor generalization ability in small sample medical image segmentation, achieve accurate identification and prediction of new categories, and improve the performance of the segmentation method. efficiency and accuracy.
Patent Information
- Application Number
- CN202410625435.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Existing medical image segmentation methods have poor generalization ability in the case of small sample data, and it is difficult to distinguish the category differences between the support set and the query set, resulting in prediction errors.
Using a multi-task learning method, the FS-C module is used to classify image targets, introducing classification loss to reduce the weight of easily classified samples, and using the masked average pooling module to assign segmentation labels to pixels in the image, improving the model's ability to detect new categories. Discrimination ability.
It improves the model's ability to identify new categories, maintains the practicality and efficiency of training, can correctly distinguish categories in the support set and query set, and reduces prediction errors.
Smart Images

Figure CN118537553A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to a method for improving small sample medical image segmentation through multi-task learning. Background Art
[0002] The development and popularization of medical imaging equipment has led to the widespread application of medical images in clinical practice. Imaging technology plays a vital role in disease diagnosis, surgical planning, prognosis assessment, and follow-up. Medical images are one of the most important sources of evidence for clinical analysis and medical intervention. Medical image segmentation can extract key information from specific tissue images and is a key step in achieving medical image visualization. The segmented images are provided to doctors for different tasks such as quantitative analysis of tissue volume, diagnosis, localization of pathologically altered tissues, depiction of anatomical structures, and treatment planning. Medical images contain a huge amount of information, and manually outlining the target area of medical images is a time-consuming and laborious task, which adds a great burden to the daily work of clinicians.
[0003] Medical image segmentation is one of the most important tasks in medical image processing. Medical image data is complex, high-dimensional, and often has problems such as noise and artifacts. Therefore, automated medical image segmentation methods have become an urgently needed tool. Traditional medical image segmentation methods require experts to manually annotate training data, which consumes a lot of time and manpower. In recent years, with the continuous development of deep learning technology, deep learning methods have gradually become the mainstream method in the field of medical image segmentation.
[0004] However, deep learning methods also have challenges. Medical images usually have problems such as small data volume, class imbalance, and poor model interpretability. In addition, the generalization ability of the model on unknown datasets is also an important issue.
[0005] In general, medical image segmentation is one of the most important tasks in medical image processing. The application of deep learning methods in medical image segmentation has greatly promoted the development of medical diagnosis and treatment. In the future, we can expect the emergence of more stable, efficient and accurate medical image segmentation algorithms to further improve the level of medical image processing and make greater contributions to human health. Summary of the invention
[0006] In order to solve the problems existing in the above-mentioned prior art, the present invention provides a multi-task learning method for improving small sample medical image segmentation, aiming to improve the performance of deep neural networks in the case of scarce training data.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] Multi-task learning improves small sample medical image segmentation methods, including:
[0009] Acquire a medical image to be segmented, input the segmented medical image into a neural network model, and acquire a segmented medical image;
[0010] The neural network model is trained using a training set, which includes a support set and a query set. The neural network model adds a 1-class 1-sample strategy as an additional classification task during the training process. The neural network model performs target classification of images based on the FS-C module, introduces classification loss, and reduces the weight of easy-to-classify samples. The neural network model assigns segmentation labels to pixels in the image through a masked average pooling module and obtains segmentation loss.
[0011] Optionally, training the neural network model includes:
[0012] Input the support set and the support images in the query set into the BackBone module to obtain multi-scale features, and input the multi-scale features into the FS-C module to perform object classification of the image to obtain an output vector;
[0013] The output vector is used as a prefix feature for auxiliary segmentation, and the multi-scale feature is input into a masked average pooling module to assign segmentation labels to pixels in the image, thereby obtaining a segmented medical image.
[0014] Optionally, the BackBone module includes:
[0015] A first BackBone submodule, configured to extract features from the support image in the support set to obtain a first multi-scale feature;
[0016] The second BackBone submodule is used to extract features from the query image in the query set to obtain second multi-scale features.
[0017] Optionally, the FS-C module comprises:
[0018] A decoder is used to use the multi-scale features as a key and a value, preset the number of targets to be queried, interact the number of targets to be queried with the key and the value, obtain features at corresponding positions in the image, and identify and segment corresponding targets;
[0019] The FFN submodule is used to generate the category probability corresponding to each target.
[0020] Optionally, embed prefix hints in the decoder:
[0021] [Z1,E1]=L1(p,E0)
[0022] [Z i ,E i ]=Li (Z i-1 ,E i-1 )
[0023] output=E end
[0024] Among them, Z1 is the first transformer encoder layer L i The output embedding, Z i is the i-th transformer encoder layer L i The output embedding of , E1 is the prefix information of the first layer output, L1 is the first Transformer encoder layer, p is the input data, E0 is the initial prefix feature input to the first Transformer encoder layer, E i is the prefix information of the output of the i-th layer, L i is the first Transformer encoder layer, Z i-1 is the i-1th transformer encoder layer L i The output embedding, E i-1 is the prefix information of the output of the i-1th layer, output is the final output, E end is the output state of the last encoder layer.
[0025] Optionally, the method to introduce classification loss is:
[0026]
[0027] Among them, L cls is the classification loss, p n The predicted probability for each category, y n is multi-hot encoding, N is the number of categories, γ + and γ - is an adjustable hyperparameter used to adjust the weights of positive and negative categories to handle imbalanced data.
[0028] 7. The multi-task learning method for improving small sample size medical image segmentation according to claim 3, wherein the masked average pooling module comprises:
[0029] The masked average pooling submodule is used to average pool the pixel features of the same category in the multi-scale features to obtain the prototype features, calculate the cosine similarity of the first multi-scale features and the first multi-scale features based on the prototype features as a benchmark, measure the similarity of the two vectors in the direction, obtain the cosine similarity value, assign segmentation labels to the pixels in the image based on the cosine similarity value, and obtain the segmentation loss.
[0030] Optionally, the method for obtaining the segmentation loss is:
[0031]
[0032] Among them, L seg is the segmentation loss, H is the height of the image, W is the width of the image, and is the true label at each pixel position of the query image, and are the predicted background and foreground probabilities.
[0033] Optionally, after acquiring the medical image to be segmented, the method further includes: standardizing and cropping the medical image to be segmented to acquire a preprocessed segmented medical image.
[0034] The beneficial effects of the present invention are:
[0035] Traditional small sample segmentation methods mainly adopt a single-category, single-example training strategy, assuming that the categories in the query set and the support set are consistent. However, the single-category segmentation task can only be specifically manifested in the distinction between the foreground and the background, which will lead to prediction errors; for example, when the support set of the task provides a mask of the spleen category, the conventional model prediction result often obtains segmentation masks of other categories, such as stomach or liver, etc., which is inconsistent with the expected result. The completely correct result should be to predict only the target class that appears in the provided support set; therefore, in practical applications, the model is required to be able to distinguish the category differences between the support set and the query set. When the support set and the query set contain inconsistent category samples, they can make correct judgments. In order to solve this problem, the present invention proposes a multi-task learning to enhance the small sample medical image segmentation method, by constructing multi-label classification into small sample learning to learn categories that have not been seen in the query set and the support set. This integrated method not only improves the model's ability to identify new categories, but also maintains the practicality and efficiency of training. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A schematic diagram of a method for improving small sample medical image segmentation through multi-task learning according to an embodiment of the present invention;
[0038] Figure 2 It is a visualization diagram of the classification and prototype extraction operations of an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] This paper focuses on small sample learning in the field of medical image analysis, which has been widely used in various tasks, such as classification and segmentation. Existing small sample segmentation methods usually adopt a one-class-one-prompt-image strategy for training, which assumes that the categories are consistent with the query set and the support set.
[0042] Taking into account the actual situation in reality, the trained model can segment any target that appears in the training stage, but in the inference stage, when the image class in the support set is inconsistent with the query set, the model can also distinguish the class that appears in the query set. What this embodiment expects is that the model should be able to and can only distinguish the consistent categories that appear in the query set and the support set.
[0043] The classification task is integrated into the original small sample segmentation, where the classification task can extract the desired categories of this embodiment from the support set. Then, the segmented small sample segmentation training paradigm can determine whether the categories in the support set exist.
[0044] In addition, the model can not only distinguish which categories are in the support set, but also maintain a feasible small sample segmentation training paradigm. In this case, the present embodiment uses multi-label classification instead of multi-class classification. To achieve this goal, the present embodiment proposes a new learning scheme to learn unseen categories in the query and support by applying multi-label classification to small sample learning. Multi-label classification can distinguish all categories originally contained in a support image.
[0045] like Figure 1As shown, the present invention discloses a multi-task learning method for improving small sample medical image segmentation, including: obtaining a medical image to be segmented, inputting the segmented medical image into a neural network model, and obtaining a segmented medical image; wherein the neural network model is trained using a training set, and the training set includes a support set and a query set; the neural network model adds a 1-class 1-sample strategy as an additional classification task during the training process, the neural network model performs target classification and segmentation of the image based on the FS-C module, and introduces classification loss to reduce the weight of easy-to-classify samples, the neural network model assigns segmentation labels to pixels in the image through a masked average pooling module, and obtains the segmentation loss, specifically:
[0046] This example starts with the setting of small sample learning. Given a dataset D containing a small amount of available supervision information specific to a task T, T , and an auxiliary dataset D that is independent of T A , the goal of small sample learning is to construct a function f for task T. The process of completing this task utilizes D T The small amount of supervision information and D A The T-independent terms in the above definition represent D T and D A The categories in are orthogonal, that is In the context of few-shot learning, function f represents the mathematical expression of a model (usually a deep learning network), whose main purpose is to solve a specific task T by learning the mapping from input to output. The input parameters of function f usually include the input parameters from the dataset D T The input parameters are preprocessed (such as normalization, cropping, etc.) data to make it suitable for model processing. The output target is usually the segmentation mask of the image in the medical image segmentation task, which defines the category of each pixel in the image (such as background, specific organs, etc.). Therefore, the purpose of the function f is to map the input image to its corresponding segmentation mask.
[0047] The process needs to add an additional classification task to the original small sample learning task. Specifically, one-category-one-column means that the support set of each training iteration only provides data of one category and one sample. The classification task is the function of the FS-C module. This embodiment assumes that there is a support set and a query set Q = (X Q ,m Q ,q Q ), where X∈R 1xHxW Represents the original image, m∈0,1 HxWrepresents the binary mask of the specific category it corresponds to, and q is a multi-hot vector containing the categories in the original image. The existing model only trains the query image X in each iteration. Q The optimization is performed under the constraints of the N-way K-shot scenario, and this embodiment adopts the 1-class 1-sample strategy for all benchmarks. N-way K-shot learning is a typical small sample learning setting, where: N classes represent the total number of categories that the model needs to learn to distinguish during training. K examples means that there are K training samples available for each category. In the specific case of 1 class 1 sample, this means that only one category is considered in each training iteration, and each category has only one example. This extreme small sample learning scenario particularly challenges the model's rapid adaptability and generalization. Specifically: a set of categories is selected from a large data set, and N classes are randomly selected for each training iteration. For each class, K samples are randomly selected as the support set. For the actual 1 class 1 sample strategy, this means randomly selecting 1 class and 1 sample of that class from the data set.
[0048] Training the neural network model includes: inputting the support images in the support set and the query set into the BackBone module to obtain multi-scale features, inputting the multi-scale features into the FS-C module to classify the target of the image, and obtaining the output vector; using the output vector as a prefix feature for auxiliary segmentation, and inputting the multi-scale features into the masked average pooling module to assign segmentation labels to the pixels in the image, and obtaining the segmented medical image.
[0049] The BackBone module includes: a first BackBone submodule, used for extracting features from support images in a support set to obtain first multi-scale features; and a second BackBone submodule, used for extracting features from query images in a query set to obtain second multi-scale features.
[0050] like Figure 2 As shown in the figure, the FS-C module includes: a decoder, which is used to use multi-scale features as keys and values, preset the number of queried targets, interact the number of queried targets with the keys and values, obtain the features of the corresponding positions in the image, and identify and segment the corresponding targets; an FFN submodule, which is used to generate the category probability corresponding to each target, specifically:
[0051] The entire FS-C module consists of two parts, namely a multi-layer transformer decoder and a shared feedforward network (FFN). This multi-layer transformer decoder takes the flattened features F as keys and values with learnable parameters, Q as the number of categories. In addition, the feedforward network (FFN) is used to calculate the predicted logical value of each category, which can be expressed as follows:
[0052] P cls =FFN(attention(Q,F,F)
[0053] Where P cls =[p1,p2,…,p n ] is the confidence of each category. In this study, the implementation of the attention mechanism is consistent with the standard transformer decoder, and the FFN only contains a simple linear layer. The process can be roughly divided into the following steps:
[0054] 1. Input image processing: The input image is first processed by a convolutional neural network (backbone), which is a pre-trained ResNet. This backbone network converts the image into a spatial feature map. 2. Spatial feature extraction: Spatial features are extracted through the backbone and feature representations are obtained at multiple scales, which will serve as input to the Transformer decoder. 3. Transformer decoder: The input to the decoder includes flattened features F as key and value inputs. In addition, there are a predefined number of queries, which correspond to the number of targets to be detected and classified (in this case, the liver, right kidney, left kidney, and spleen). The role of the decoder is to find the features of the corresponding positions in the image through the interaction of the query with the key and value, so as to identify and segment the corresponding organs.
[0055] Transformer Encoder is the basic network structure used to extract features. 4. FFN (Feed Forward Network) Output: The output of the decoder is fed into a feed forward network (FFN), which generates the class probability (Prob) corresponding to each query. The confidence of the FFN reflects the possibility that the object corresponding to each query exists in the image.
[0056] The prefix prompt is embedded into the encoder of the Transformer, and each prompt token is a d-dimensional vector learned from multi-task classification. The prefix prompt is represented as prompt=p k ∈R d |k∈N,1≤k≤N. Therefore, the output of the encoder is as follows:
[0057] [Z1,E1]=L1(p,E0)
[0058] [Z i ,E i ]=L i (Z i-1 ,E i-1 )
[0059] output=E end
[0060] Among them, Z1 is the first transformer encoder layer L i The output embedding, Z i is the i-th transformer encoder layer L i The output embedding of , E1 is the prefix information of the first layer output, L1 is the first Transformer encoder layer, p is the input data, E0 is the initial prefix feature input to the first Transformer encoder layer, E i is the prefix information of the output of the i-th layer, L i is the first Transformer encoder layer, Z i-1 is the i-1th transformer encoder layer L i The output embedding, E i-1 is the prefix information of the output of the i-1th layer, output is the final output, E end is the output state of the last encoder layer, [Z i ,L i ]∈R N+m Indicates that the length of the input is the number of categories plus the number of patches of fixed size. In the implementation of this embodiment, the transformer encoder is also consistent with the standard transformer encoder. Prefix Prompting is an effective optimization method for improving the performance of deep learning models in specific tasks, especially in transfer learning and small sample learning environments. This technique is implemented by adding additional information to the input part of the model, usually by embedding it into the encoder of the model. In this specific scenario, prefix prompts are used to enhance the capabilities of transformer (such as Transformer) models, especially when dealing with multi-task classification tasks. The role of prefix prompts includes: adding pre-learned contextual information to help the model quickly understand and adapt to new tasks. Changing the information flow and feature extraction process within the model helps the model to more accurately locate key information related to the current task in the input data. Reduce the amount of data and number of iterations required to train the model for a specific task. Helps improve the generalization ability of the model on unseen data or slightly different task settings.
[0061] The multi-label classification of this embodiment does not require the introduction of a new loss function due to the built-in cross-attention mechanism of the transformer decoder. This embodiment uses an asymmetric focal loss, which is intended to adjust the loss function and reduce the weight of easy-to-classify samples, so that the model pays more attention to difficult-to-classify or misclassified samples. It introduces different weights or different adjustment factors for positive and negative samples. There are different γ values for positive and negative samples. The loss can be defined by the following formula:
[0062]
[0063] Among them, L cls is the classification loss, p n The predicted probability for each category, y n is multi-hot encoding, N is the number of categories, γ + and γ - is an adjustable hyperparameter used to adjust the weights of positive and negative categories to handle unbalanced data, p = [p1, p2, ..., p n ] is the predicted probability of each category, y = [y1, y2, …, y n ] is multi-hot encoding. The final loss is the average of all sample losses in the support set. In the experiment of this embodiment, γ+=0 and γ-=-1 are the default values, and the segmentation loss of this embodiment does not require an additional new loss function.
[0064] The masked average pooling module includes: a masked average pooling submodule, which is used to average pool the pixel features of the same category in the multi-scale features, obtain the prototype features, calculate the cosine similarity between the first multi-scale features and the second multi-scale features based on the prototype features as a benchmark, measure the similarity of the two vectors in the direction, obtain the cosine similarity value, assign segmentation labels to the pixels in the image based on the cosine similarity value, and obtain the segmentation loss, specifically:
[0065] In the framework of few-shot segmentation learning, the computation of pixel similarity is a key step to guide the model to segment the query image given the support image (or called the annotated image). The segmentation process is guided by effectively incorporating the pixel similarities between the support objects and the query image features. Specifically, the model uses masked average pooling (MAP) to transform the features of the support image into prototypes, and then calculates the cosine similarity to predict the mask to find the segmentation loss L seg ; Among them, the predicted mask is the result of segmentation, that is, the segmented image. The predicted mask is the predicted segmentation result. The loss can be calculated by comparing it with the real mask.
[0066] First, the model uses a series of convolutional layers to extract features from the support image and the query image. These features contain key visual information of the image, such as edges, textures, etc. For the support image, MAP averages all pixel features in the image that belong to the same category (such as organs or lesions) to obtain a prototype. This prototype represents the average feature of the category, that is, the prototype feature, and will be used as a benchmark for subsequent steps. The cosine similarity of each pixel feature of the query image is calculated with the prototype feature of the support image. Cosine similarity is a measure of the similarity of two vectors in direction, and its value ranges from -1 to 1, where 1 represents exactly the same direction and -1 represents the exact opposite. For similarity mapping, the model assigns a segmentation label to each pixel in the query image based on the calculated cosine similarity. Specifically, if a pixel's feature has a high cosine similarity with the prototype of a category, the pixel will be labeled as that category. For loss calculation, during training, the segmentation result is compared with the actual annotation (Ground Truth) to calculate the segmentation loss L seg , Commonly used loss functions include cross entropy loss or Dice loss. This loss is used to guide model training and optimize its segmentation performance.
[0067]
[0068] Where H and W are the height and width of the image, and the loss function is calculated by summing all the pixels and then dividing by the total number of pixels (H*W) to get the average loss. and These are the true labels at each pixel location (x,y) for the query image q. and are the predicted background and foreground probabilities.
[0069] Therefore, this embodiment only needs to calculate the binary cross entropy loss between the ground truth and the predicted mask. In general, the final loss function of this embodiment is: L seg represents the segmentation loss, L cls represents the classification loss, L reg Represents the matching regularization loss of the prototype:
[0070] Loss = L seg +L cls +L reg
[0071] The prototype matching regularization loss uses the query image as the support set and the support image as the segmentation loss of the label.
[0072] Matching regularization PAR or reg, regularization is intuitively explained as if the model can predict a good segmentation mask for the query image using the prototype extracted from the support set, then the prototype learned from the query set based on the predicted mask should be able to segment the support image well. Therefore, PAR / reg encourages the resulting segmentation model to learn with a few samples in the opposite direction, that is, to learn to segment the support image using the query image and the predicted mask as a new support set.
[0073] This embodiment discloses a multi-task learning method for improving small sample medical image segmentation, which includes the following steps:
[0074] Determine the dataset and evaluation metrics: This embodiment evaluates the architecture of this embodiment on the CHAOST dataset published at the ISBI 2019 Joint Health Abdominal Organ Segmentation Challenge. The dataset consists of 20 three-dimensional T2-SPIR MRI scans, each containing an average of 36 slices, and uses a public dataset to test and compare different segmentation methods under the same benchmark conditions. The dataset contains four categories: liver, left kidney, right kidney, and spleen. The evaluation metrics not only quantify the performance of the model to ensure that the results of this embodiment are reliable and comparable, but also help the experiment understand the effectiveness and weaknesses of the model on specific tasks, thereby guiding future optimization and improvement.
[0075] This embodiment adopts the widely used Dice similarity coefficient (DSC) as the segmentation evaluation index, which is defined as Among them, y label Indicates the true mark. Represents the predicted mask. This indicator evaluates the predicted mask and the true annotation y label The overlap ratio between .
[0076] Experimental parameter settings and details: In the experiment of this embodiment, this embodiment adopts a pseudo-label generation method of superpixels and supervoxels.
[0077] The models were trained using a self-supervised approach and evaluated using a five-fold cross-validation approach, where the support image set for each subset was from one patient, while the remaining patients were considered as objects in the query object set.
[0078] This example implements the proposed method on each subset using PyTorch on an NVIDIA V100 GPU.
[0079] Specifically, for data preprocessing, this embodiment cuts off the brightness endpoint (the first 0.5%) of the histogram to improve the misalignment problem, resamples the image slices to produce the same resolution as before, and crops each slice to a size of 256x256.
[0080] In addition, each slice is replicated three times in the channel dimension to fit the backbone network. When the image passes through the backbone network, the main process is feature extraction. The backbone network is usually a pre-trained convolutional neural network such as ResNet, VGG or DenseNet.
[0081] This example uses stochastic gradient descent (SGD) with a momentum of 0.9 to optimize the loss function, the learning rate is set to 1e-3, and a MultiStepLR scheduler is used with a decay rate of 0.98 every 1k epochs.
[0082] The model is trained for a maximum of 70k iterations. Since the self-supervised method is used for training, the present embodiment will not discard image slices containing the target category.
[0083] Overview of the architecture and process of this embodiment: The method of this embodiment first uses the ResNet-100 network as the backbone network to extract features of the original image pair, then flattens it and passes the features to the FS-C model and the Transformer encoder respectively.
[0084] Each output feature of the FS-C model is used to predict the category and calculate the classification loss, and each output feature of the Transformer encoder is used to predict the segmentation mask and calculate the segmentation loss.
[0085] The model uses a supervoxel image preprocessing method and is trained using self-supervision and a five-fold cross-validation method, where support images are obtained from one patient in each fold, and the remaining patients are used as query objects. The proposed method is implemented on an NVIDIA V100 GPU using PyTorch. Specifically, for data preprocessing, this embodiment cuts off the histogram highlights (the highest 0.5%) to improve the demodulation problem, resamples the image slices to maintain the same resolution as before, and crops each slice to 256x256.
[0086] Furthermore, in order to adapt to the backbone network, each slice is replicated three times in the channel dimension. This embodiment uses stochastic gradient descent (SGD) for optimization, with momentum set to 0.9, learning rate set to 1e-3, MultiStepLR as the scheduler, and a decay rate of 0.98 every 1k epochs. The model is trained for a maximum of 70k iterations. Due to the use of self-supervised training, this embodiment does not discard image slices containing the target category.
[0087] This example attempts two widely used inference protocols in this study. Protocol 1 is the standard test paradigm. It filters out slices that do not match the corresponding true label and does not require segmentation before extracting the query image, which means that weak query labels are not needed during inference. Protocol 2 relaxes the assumption of requiring filtering slices of the query image volume to avoid the need for weak query labels. It extracts a slice from the supporting foreground volume and segments the entire query volume with the help of the slice. This protocol is more general and applicable to real-world situations.
[0088] About ablation experiment: This example further conducts ablation study to verify the effectiveness of different components of the model in this example. The result of replacing the tokens in the classification with random learnable variables is called "learnable tokens". In addition, the loss of classification is 0, which is marked as "w / o prompts".
[0089] The above embodiments are only descriptions of the preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should fall within the protection scope determined by the claims of the present invention.
Claims
1. Multi-task learning improves small sample medical image segmentation method, characterized by: include: Acquire a medical image to be segmented, input the segmented medical image into a neural network model, and acquire a segmented medical image; The neural network model is trained using a training set, which includes a support set and a query set. The neural network model adds a 1-class 1-sample strategy as an additional classification task during the training process. The neural network model performs target classification of images based on the FS-C module, introduces classification loss, and reduces the weight of easy-to-classify samples. The neural network model assigns segmentation labels to pixels in the image through a masked average pooling module and obtains segmentation loss.
2. The multi-task learning method for improving small sample medical image segmentation according to claim 1, characterized in that: Training the neural network model includes: Input the support set and the support images in the query set into the BackBone module to obtain multi-scale features, and input the multi-scale features into the FS-C module to perform object classification of the image to obtain an output vector; The output vector is used as a prefix feature for auxiliary segmentation, and the multi-scale feature is input into a masked average pooling module to assign segmentation labels to pixels in the image, thereby obtaining a segmented medical image.
3. The multi-task learning method for improving small sample medical image segmentation according to claim 2, characterized in that: The BackBone module includes: A first BackBone submodule, configured to extract features from the support image in the support set to obtain a first multi-scale feature; The second BackBone submodule is used to extract features from the query image in the query set to obtain second multi-scale features.
4. The multi-task learning method for improving small sample medical image segmentation according to claim 2, characterized in that: The FS-C module includes: A decoder is used to use the multi-scale features as a key and a value, preset the number of targets to be queried, interact the number of targets to be queried with the key and the value, obtain features at corresponding positions in the image, and identify and segment corresponding targets; The FFN submodule is used to generate the category probability corresponding to each target.
5. The multi-task learning method for improving small sample size medical image segmentation according to claim 4, characterized in that: In the decoder embed prefix hints: [Z1,E1]=L1(p,E0) [With i ,E i ]=L i (With i-1 ,E i-1 ) output=E end Among them, Z1 is the first transformer encoder layer L i The output embedding, Z i is the i-th transformer encoder layer L i The output embedding of , E1 is the prefix information of the first layer output, L1 is the first Transformer encoder layer, p is the input data, E0 is the initial prefix feature input to the first Transformer encoder layer, E i is the prefix information of the output of the i-th layer, L i is the first Transformer encoder layer, Z i-1 is the i-1th transformer encoder layer L i The output embedding, E i-1 is the prefix information of the output of the i-1th layer, output is the final output, E end is the output state of the last encoder layer.
6. The multi-task learning method for improving small sample medical image segmentation according to claim 1, characterized in that: The method of introducing classification loss is: Among them, L cls is the classification loss, p n The predicted probability for each category, y n is multi-hot encoding, N is the number of categories, γ + and γ - is an adjustable hyperparameter used to adjust the weights of positive and negative categories to handle imbalanced data.
7. The multi-task learning method for improving small sample size medical image segmentation according to claim 3, characterized in that: The masked average pooling module includes: The masked average pooling submodule is used to average pool the pixel features of the same category in the multi-scale features to obtain the prototype features, calculate the cosine similarity of the first multi-scale features and the first multi-scale features based on the prototype features as a benchmark, measure the similarity of the two vectors in the direction, obtain the cosine similarity value, assign segmentation labels to the pixels in the image based on the cosine similarity value, and obtain the segmentation loss.
8. The multi-task learning method for improving small sample size medical image segmentation according to claim 1, characterized in that: The method for obtaining the segmentation loss is: Among them, L seg is the segmentation loss, H is the height of the image, W is the width of the image, and is the true label at each pixel position of the query image, and are the predicted background and foreground probabilities.
9. The multi-task learning method for improving small sample size medical image segmentation according to claim 1, characterized in that: After obtaining the medical image to be segmented, the following steps include: standardizing and cropping the medical image to be segmented to obtain a preprocessed segmented medical image.
Citation Information
Patent Citations
Medical image segmentation method and device and computer readable storage medium
CN113902752A
Small sample traffic anomaly image acquisition method and system based on multi-scale attention coupling mechanism
CN114898158A
Small sample semantic segmentation method based on cross attention self-guidance
CN117611808A
Medical image analysis using neural networks
WO2022208060A2
