A cross-domain small sample CT image semantic segmentation system and method based on meta-learning

By applying meta-learning in the field of CT medical images, the cross-domain small-sample CT image semantic segmentation system uses the convolutional neural network and the maximum mean difference algorithm for domain alignment, solving the problem of insufficient data in small-sample scenarios and realizing the CT image classification system. Cross-domain alignment and precise diagnosis support in semantic segmentation.

CN117745736BActive Publication Date: 2024-10-08HUBEI PUBLIC INFORMATION IND CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311549285.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2024-10-08
Estimated Expiration
2043-11-17

AI Technical Summary

Technical Problem

In the field of semantic segmentation of CT medical images, traditional deep learning methods are prone to overfitting or insufficient generalization capabilities in small sample scenarios. Especially when it is difficult to obtain enough annotated data, it is difficult to effectively apply meta-learning methods.

Method used

A cross-domain small-sample CT image semantic segmentation system based on meta-learning is adopted. By sampling small-sample segmentation tasks from annotated source domain data, combined with unlabeled target domain data for domain alignment, a convolutional neural network is used to extract mid-level features and Prototype features, use cosine similarity and maximum mean difference algorithms to calculate losses, and optimize the model to achieve cross-domain alignment.

Benefits of technology

The small-sample segmentation model trained in the source domain can maintain good prediction performance when tested in the target domain, solves the problem of insufficient annotated data, and supports more accurate disease diagnosis and treatment decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745736B_ABST
    Figure CN117745736B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-domain small sample CT image semantic segmentation system and method based on meta-learning, the system comprising: a data processing module: used for sampling from annotated source domain image data, combining into a small sample segmentation task set, and sampling unannotated images from a target domain as training data; a feature extraction module: used for obtaining middle-level features and prototype features of source domain image data using a convolutional neural network, and obtaining middle-level features of images in a target domain using a convolutional neural network; a segmentation prediction module: used for calculating the segmentation results of a small sample segmentation task using cosine similarity; a loss calculation module: calculating weighted losses and optimizing a model. The present invention solves the problem that the number of annotated CT medical images in the source domain is insufficient to support meta-training, can provide CT image semantic segmentation data in the medical field, quickly locate the target area, to support more accurate disease diagnosis and treatment decisions, and has good application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a field, and in particular to a cross-domain small sample CT image semantic segmentation system and method based on meta-learning. Background Art

[0002] Medical image analysis plays an important role in modern medical diagnosis, among which the semantic segmentation of CT (Computed Tomography) medical images is crucial for the accurate location of anatomical structures and lesions. However, since medical image data is a clinical medical resource, it is scarce and difficult to obtain, and the distribution of CT medical image data in the same domain and across domains is different, traditional deep learning methods may suffer from overfitting or insufficient generalization in small sample scenarios.

[0003] In recent years, meta-learning has attracted widespread attention as an emerging machine learning paradigm. Meta-learning aims to enable models to adapt to new tasks more quickly by training on different tasks. Meta-learning methods are particularly good at solving small sample problems. Specifically, meta-learning includes two key steps: meta-training and meta-testing. In the meta-training stage, the model acquires the general ability to handle many small sample tasks by learning such tasks. Subsequently, in the meta-testing stage, the model can use this ability to cope with new small sample tasks.

[0004] However, the meta-training stage requires a large number of annotated samples from the same domain as the meta-testing stage data to construct a small sample training task. However, in the field of medical images, especially in the field of CT medical image semantic segmentation, it is quite difficult to obtain sufficient annotated data. This is because the acquisition of CT medical images not only requires the participation of medical experts, but also involves the protection of rare cases and patient privacy. Therefore, how to apply meta-learning methods in the field of small sample CT medical image semantic segmentation is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In order to overcome the shortcomings of related products in the prior art, the present invention proposes a cross-domain small sample CT image semantic segmentation system and method based on meta-learning.

[0006] The present invention provides a cross-domain small sample CT image semantic segmentation system based on meta-learning, comprising:

[0007] Data processing module: Sampling from labeled source domain image data, combining them into a small sample segmentation task set, and sampling unlabeled images from the target domain as training data;

[0008] Feature extraction module: Use convolutional neural networks to obtain the middle-level features and prototype features of the source domain image data, and use convolutional neural networks to obtain the middle-level features of the images in the target domain;

[0009] Segmentation prediction module: uses cosine similarity to calculate the segmentation results of small sample segmentation tasks;

[0010] Loss calculation module: Use the segmentation results and the real labeled data to calculate the segmentation loss, use the maximum mean difference algorithm to calculate the difference loss between the source domain features and the target domain features for domain alignment, calculate the weighted loss and optimize the model.

[0011] In certain embodiments of the present invention, the data processing module is specifically used for:

[0012] Sampling from the labeled source domain image data, combined into a small sample segmentation task set, as the model input for meta-training, complete the small sample segmentation task in the source domain; the small sample segmentation tasks used for meta-training are: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes the query image X q and the annotation M used to calculate the loss during training q ;

[0013] Sample some unlabeled image data from the target domain and add it to each corresponding small sample task. The unlabeled image data is used to align the data domain. That is, at this time: T i Represents the unlabeled image data added to the i-th small sample segmentation task.

[0014] In certain embodiments of the present invention, the feature extraction module is specifically used for:

[0015] The formulas for obtaining the middle-level features of the source domain image data are:

[0016] F s =E(X s ), F q =E(X q ), F t =E(X t ),

[0017] The target domain image data is X t , and then use the global average pooling of labels to extract the target category prototype and the background category prototype respectively. When extracting the target category prototype, i takes 1, and when extracting the background category prototype, i takes 0. The formula is:

[0018]

[0019] Where P represents the prototype feature, x and y represent the spatial coordinates, and the function δ is an indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

[0020] In some embodiments of the present invention, the segmentation prediction module is specifically used to:

[0021] The metric segmentation of the prototype feature P and the image feature F_q is completed by a metric tool with or without parameters. The cosine similarity is used to measure the similarity between the prototype feature and the image feature based on the metric tool without parameters, and then the segmentation is completed. The cosine similarity between the foreground prototype feature and the background prototype feature and the image feature is calculated as follows:

[0022]

[0023] In the formula, Pred represents the similarity value, and α is the adjustment multiplier;

[0024] The segmentation result is obtained by the argmax function, and its formula is:

[0025]

[0026] In certain embodiments of the present invention, the loss calculation module is specifically used to:

[0027] The loss calculation of the small sample segmentation task in the supervised source domain is based on the cross entropy loss function, which is:

[0028]

[0029] In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively;

[0030] The middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F t ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively:

[0031]

[0032]

[0033] Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss:

[0034] Among them, k represents the kernel matrix calculated by the Gaussian kernel function;

[0035] The final weighted total loss is calculated as:

[0036] L=L seg +βL mmd , where β is a multiplier.

[0037] The present invention also provides a cross-domain small sample CT image semantic segmentation method based on meta-learning, which is applied to any of the above cross-domain small sample CT image semantic segmentation systems based on meta-learning, and comprises the following steps:

[0038] Step S1: sampling from the labeled source domain image data to form a small sample segmentation task set, and sampling unlabeled images from the target domain as training data;

[0039] Step S2: Use a convolutional neural network to obtain the middle-level features and prototype features of the source domain image data, and use a convolutional neural network to obtain the middle-level features of the image in the target domain;

[0040] Step S3: Calculate the segmentation result of the small sample segmentation task using cosine similarity;

[0041] Step S4: Use the segmentation results and the real labeled data to calculate the segmentation loss, use the maximum mean difference algorithm to calculate the difference loss between the source domain features and the target domain features for domain alignment, calculate the weighted loss and optimize the model.

[0042] In some embodiments of the present invention, step S1 specifically includes:

[0043] Sampling from the labeled source domain image data, combined into a small sample segmentation task set, as the model input for meta-training, complete the small sample segmentation task in the source domain; the small sample segmentation tasks used for meta-training are: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes the query image X q and the annotation M used to calculate the loss during training q ;

[0044] Sample some unlabeled image data from the target domain and add it to each corresponding small sample task. The unlabeled image data is used to align the data domain. That is, at this time: Ti Represents the unlabeled image data added to the i-th small sample segmentation task.

[0045] In certain embodiments of the present invention, step S2 specifically includes:

[0046] The formulas for obtaining the middle-level features of the source domain image data are:

[0047] F s =E(X s ), F q =E(X q ), F t =E(X t ),

[0048] The target domain image data is X t , and then use the global average pooling of labels to extract the target category prototype and the background category prototype respectively. When extracting the target category prototype, i takes 1, and when extracting the background category prototype, i takes 0. The formula is:

[0049]

[0050] Where P represents the prototype feature, x and y represent the spatial coordinates, and the function δ is an indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

[0051] In some embodiments of the present invention, step S3 specifically includes:

[0052] The metric segmentation of the prototype feature P and the image feature F_q is completed by a metric tool with or without parameters. The cosine similarity is used to measure the similarity between the prototype feature and the image feature based on the metric tool without parameters, and then the segmentation is completed. The cosine similarity between the foreground prototype feature and the background prototype feature and the image feature is calculated as follows:

[0053]

[0054] In the formula, Pred represents the similarity value, and α is the adjustment multiplier;

[0055] The segmentation result is obtained by the argmax function, and its formula is:

[0056]

[0057] In some embodiments of the present invention, step S4 specifically includes:

[0058] The loss calculation of the small sample segmentation task in the supervised source domain is based on the cross entropy loss function, which is:

[0059]

[0060] In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively;

[0061] The middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F t ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively:

[0062]

[0063]

[0064] Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss:

[0065] Among them, k represents the kernel matrix calculated by the Gaussian kernel function;

[0066] The final weighted total loss is calculated as:

[0067] L=L seg +βL mmd , where β is a multiplier.

[0068] Compared with the prior art, the present invention has the following advantages:

[0069] Compared with the prior art, the cross-domain small sample CT image semantic segmentation system based on meta-learning described in the embodiment of the present invention uses a meta-learning algorithm to realize the small sample segmentation task in the source domain, and a maximum mean difference algorithm is used to align the source domain and the CT image domain across domains; when performing cross-domain alignment, based on the middle-level features output by the backbone network, the channel vectors of the middle-level features of the source domain and the target domain are randomly extracted, and the maximum mean difference algorithm is used to perform cross-domain alignment; when completing the small sample segmentation task in the source domain, a backbone network is designed, the middle-level features are used as the output of the backbone network, and the prototype is used to replace the three-dimensional features for measurement operations; the feature segmentation is performed using a parameter-free cosine similarity function, and when the small sample segmentation model trained in the source domain is migrated to the target domain for testing, the prediction performance of the model will not drop significantly, thereby solving the problem that the number of annotated CT medical images in the source domain is insufficient to support meta-training, and can provide CT image semantic segmentation data in the medical field, quickly locate the target area, so as to support more accurate disease diagnosis and treatment decisions, and has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 work.

[0071] Figure 1 This is a schematic diagram of the principle structure of the cross-domain small sample CT image semantic segmentation system based on meta-learning according to the present invention;

[0072] Figure 2 It is another schematic diagram of the principle structure of the cross-domain small sample CT image semantic segmentation system based on meta-learning according to the present invention;

[0073] Figure 3 A reference example diagram sampled from a CT medical image data set in an embodiment of the present invention;

[0074] Figure 4 This is a flow chart of the cross-domain small sample CT image semantic segmentation method based on meta-learning described in the present invention.

[0075] Description of reference numerals:

[0076] 100. Data processing module; 200. Feature extraction module; 300. Segmentation prediction module; 400. Loss calculation module; 500. Test process module. DETAILED DESCRIPTION

[0077] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the preferred embodiments of the present invention are shown in the accompanying drawings. The present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

[0078] See also Figure 1 As shown, the cross-domain small sample CT image semantic segmentation system based on meta-learning includes:

[0079] Data processing module 100: used to sample from labeled source domain image data, combine them into a small sample segmentation task set, and sample unlabeled images from the target domain as training data; the functions of the data processing module include source domain data processing and target domain data processing.

[0080] In the source domain data processing part, the data processing module 100 samples from the annotated source domain image data and combines them into a small sample segmentation task set as the input of the model during meta-training to obtain the general ability to complete the small sample segmentation task in the source domain; specifically, according to the N-way-K-shot setting, the small sample segmentation task used for meta-training is: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes a query image Xq and a label M used to calculate the loss during training. q ;

[0081] In the target domain data processing part, the data processing module 100 samples some unlabeled image data from the target domain and adds it to each corresponding small sample task. The unlabeled image data is used to align the data domain, that is, at this time: T i Represents the unlabeled image data added to the i-th small sample segmentation task.

[0082] Feature extraction module 200: used to obtain the middle-level features and prototype features of the source domain image data using a convolutional neural network, and to obtain the middle-level features of the image in the target domain using a convolutional neural network; the feature extraction module 200 is a deep neural network based on a convolutional structure, and is used to extract the middle-level features and prototype features of the image data (support image, query image, target domain image);

[0083] The process of extracting the middle-level features F, that is, obtaining the middle-level features of the source domain image data, is as follows:

[0084] F s =E(X s ), F q =X(X q ), F t =(X t )#(6-1),

[0085] The target domain image data is X t , and then extract the target category prototype (when i is 1) and the background category prototype (when i is 0) through label global average pooling, then the formula is:

[0086]

[0087] Where P represents the prototype feature, x and y in (x, y) represent the spatial coordinates respectively, and the function δ[.] is the indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

[0088] Since the semantic information of CT medical images is not complex, and the source domain data and the target domain data are in different domains and have disjoint categories, deep features can easily cause the model to be biased towards the source domain data category, which is an overfitting problem. The mid-level features are often related to the common parts of the object, and do not refer to specific categories. They are not prone to overfitting problems and are more likely to generalize to unseen categories. Since noise is often introduced in the imaging process of medical images, prototypes are used to reduce the interference of noise on segmentation prediction and improve robustness. In an embodiment of the present invention, after optimization of the multi-task loss function, the feature extraction module can achieve: extracting mid-level features and prototype features of the image data; mapping the image features of the support set and the query set to the same embedding space for feature measurement and segmentation; aligning the target domain distribution to the source domain distribution to complete domain alignment.

[0089] Segmentation prediction module 300: used to calculate the segmentation result of the small sample segmentation task using cosine similarity; use the feature measurement segmentation module to complete the small sample segmentation prediction in the source domain; the measurement operation is performed by the feature measurement module, and the measurement segmentation of the prototype feature P and the picture feature F_q is completed by a measurement tool with or without parameters, such as a convolution structure (with parameter structure) or cosine similarity (without parameter structure); in order to avoid the problem of overfitting and noise interference of the measurement tool with parameters, the embodiment of the present invention measures the similarity between the prototype and the feature based on the measurement tool without parameters-cosine similarity, and then completes the segmentation, first calculating the cosine similarity of the foreground prototype feature and the background prototype feature with the picture feature respectively:

[0090]

[0091] In the formula, Pred represents the similarity value, and α is the adjustment multiplier;

[0092] The segmentation result is obtained by the argmax function, and its formula is:

[0093]

[0094] Loss calculation module 400: used to calculate the segmentation loss using the segmentation results and the real labeled data, calculate the difference loss between the source domain features and the target domain features using the maximum mean difference algorithm for domain alignment, calculate the weighted loss and optimize the model.

[0095] The loss calculation module 400 performs segmentation loss calculation and alignment loss calculation respectively.

[0096] Specifically, the segmentation loss is used to supervise the small sample segmentation task in the source domain, and its loss calculation is based on the cross entropy loss function, which is:

[0097]

[0098] The segmentation task is a dense classification task. The three-dimensional features need to be maintained throughout the segmentation process. In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively; the middle layer feature F q , F t After multiple convolution operations, it is a relatively abstract local feature. The channel feature (vector) at each pixel can reflect the data distribution of different data domains. In addition, the alignment process does not focus on the image content. A small number of unlabeled target domain images can provide enough channel vector samples. Therefore, when calculating the alignment loss, the channel vector at each pixel of the middle-level feature is extracted as a data domain sample, which can not only reflect the cross-domain differences, but also effectively control the number of target domain samples.

[0099] The alignment loss calculation is based on the maximum mean difference algorithm, which is used to supervise the alignment task between the source domain and the target domain. First, the middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F t ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively:

[0100]

[0101] Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss:

[0102]

[0103] , where k represents the kernel matrix calculated by the Gaussian kernel function;

[0104] The final weighted total loss is calculated as:

[0105] L=L seg +βL mmd #(6-8), where β is the multiplier.

[0106] In some embodiments of the present invention, see Figure 2 As shown, a test process module 500 for applying the semantic segmentation system is also included. During the test process, there is no need to calculate the loss, so there is no need to input the image of the target domain for alignment. The test process module 500 is specifically used for:

[0107] After the training and deployment of the system M, the small sample test task {S i , Q i}, use formula 6-1 to extract the support set and query set image features F s and F q ;

[0108] Use formula 6-2 to calculate the foreground prototype and background prototype P;

[0109] Use formula 6-3 to calculate prototype P and feature F q The cosine similarity Pred between them;

[0110] Use formula 6-4 to get the segmentation result M′ of the query image q .

[0111] On the basis of the above embodiments, the present invention also provides the following specific embodiments. This embodiment is based on actual data sets, including two public data sets. The source (training) data set is PASCAL VOC 2012, and the target (test) data set is a 2D CT lung lobe data set from the Lung Nodule Analysis (LUNA) competition. The PASCAL VOC 2012 data set is a natural data set of color channels with visual distortion; while the CT data set is a black and white grayscale data set. Although it has no visual distortion, it is often noisy due to the imaging process of CT images. This is a combination of two cross-domain data sets with large inter-domain differences. The experiment was conducted under the setting of 1-way-1-shot, and the implementation details are introduced below.

[0112] First, determine the structure of the feature extraction module. This structure is improved from the deep convolutional neural network ResNet50, and its composition is shown in the table below. Based on the ResNet50 network, the feature extraction module of this system does not use deep-level features (the sixth layer of the ResNet50 network), and concatenates the middle-level features (the third and fourth layer features) and then reduces the dimension to 512 dimensions as the final feature output, so that the module can combine multi-level information. During training, the pre-trained parameters of the ResNet50 network are loaded to speed up the training progress.

[0113] As shown in the following table, the feature extraction module structure in the implementation example is as follows:

[0114]

[0115]

[0116] During the training and testing phases, the input image resolution is 321×321 pixels, and the size of the feature map output by the feature extraction module is 1 / 8 of the input image size. During training, the training images are randomly cropped and flipped. The SGD optimizer is used to train the entire system for 30,000 iterations, with a learning rate of 0.001, a batch size of 1, a momentum of 0.99, and a weight decay rate of 0.0005. The multiplier α in Equation 6-3 is fixed to 20, the kernel matrix k in Equation 6-7 is [2, 5, 10, 20, 40, 80], and the weight multiplier β in Equation 6-8 is fixed to 1. When extracting the channel vector of the middle layer, m and n are both set to 500 to save video memory.

[0117] After the training is completed, the system is tested on a randomly selected small sample segmentation task. The test results are as follows: Figure 3 As shown in the figure, for intuitive comparison, the lung lobes have been marked with different colors in the picture. The experimental results show that the system trained in this example can achieve accurate CT lung lobe image segmentation in cross-domain and small sample conditions.

[0118] Compared with the prior art, the cross-domain small sample CT image semantic segmentation system based on meta-learning described in the embodiment of the present invention uses a meta-learning algorithm to realize the small sample segmentation task in the source domain, and a maximum mean difference algorithm is used to align the source domain and the CT image (target) domain across domains; when performing cross-domain alignment, based on the middle-level features output by the backbone network, the channel vectors of the middle-level features of the source domain and the target domain are randomly extracted, and the maximum mean difference algorithm is used to perform cross-domain alignment; when completing the small sample segmentation task in the source domain, a backbone network is designed, the middle-level features are used as the output of the backbone network, and the prototype is used to replace the three-dimensional features for measurement operations; the feature segmentation is performed using a parameter-free cosine similarity function, and when the small sample segmentation model trained in the source domain is migrated to the target domain for testing, the prediction performance of the model will not drop significantly, thereby solving the problem that the number of annotated CT medical images in the source domain is insufficient to support meta-training, and can provide CT image semantic segmentation data in the medical field, quickly locate the target area, so as to support more accurate disease diagnosis and treatment decisions, and has good application prospects.

[0119] See also Figure 4 As shown, the present invention also provides a cross-domain small sample CT image semantic segmentation method based on meta-learning, which is applied to the cross-domain small sample CT image semantic segmentation system based on meta-learning in any of the above embodiments, and includes the following steps:

[0120] Step S1: sampling from the labeled source domain image data to form a small sample segmentation task set, and sampling unlabeled images from the target domain as training data;

[0121] Step S2: Use a convolutional neural network to obtain the middle-level features and prototype features of the source domain image data, and use a convolutional neural network to obtain the middle-level features of the image in the target domain;

[0122] Step S3: Calculate the segmentation result of the small sample segmentation task using cosine similarity;

[0123] Step S4: Use the segmentation results and the real labeled data to calculate the segmentation loss, use the maximum mean difference algorithm to calculate the difference loss between the source domain features and the target domain features for domain alignment, calculate the weighted loss and optimize the model.

[0124] In some embodiments of the present invention, step S1 specifically includes:

[0125] Sampling from the labeled source domain image data, combined into a small sample segmentation task set, as the model input for meta-training, complete the small sample segmentation task in the source domain; the small sample segmentation tasks used for meta-training are: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes the query image X q and the annotation M used to calculate the loss during training q ;

[0126] Sample some unlabeled image data from the target domain and add it to each corresponding small sample task. The unlabeled image data is used to align the data domain. That is, at this time: T i Represents the unlabeled image data added to the i-th small sample segmentation task.

[0127] In certain embodiments of the present invention, step S2 specifically includes:

[0128] The formulas for obtaining the middle-level features of the source domain image data are:

[0129] F s =E(X s ), F q =E(X q ), F t =E(X t ),

[0130] The target domain image data is X t , and then use the global average pooling of labels to extract the target category prototype and the background category prototype respectively. When extracting the target category prototype, i takes 1, and when extracting the background category prototype, i takes 0. The formula is:

[0131]

[0132] Where P represents the prototype feature, x and y represent the spatial coordinates, and the function δ is an indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

[0133] In some embodiments of the present invention, step S3 specifically includes:

[0134] The metric segmentation of the prototype feature P and the image feature F_q is completed by a metric tool with or without parameters. The cosine similarity is used to measure the similarity between the prototype feature and the image feature based on the metric tool without parameters, and then the segmentation is completed. The cosine similarity between the foreground prototype feature and the background prototype feature and the image feature is calculated as follows:

[0135]

[0136] In the formula, Pred represents the similarity value, and α is the adjustment multiplier;

[0137] The segmentation result is obtained by the argmax function, and its formula is:

[0138]

[0139] In some embodiments of the present invention, step S4 specifically includes:

[0140] The loss calculation of the small sample segmentation task in the supervised source domain is based on the cross entropy loss function, which is:

[0141]

[0142] In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively;

[0143] The middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F t ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively:

[0144]

[0145]

[0146] Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss:

[0147] Among them, k represents the kernel matrix calculated by the Gaussian kernel function;

[0148] The final weighted total loss is calculated as:

[0149] L=L seg +βL mmd , where β is a multiplier.

[0150] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field. The above are only embodiments of the present invention, but do not limit the patent scope of the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the aforementioned specific implementation methods, or replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the present specification and drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.

Claims

1. A cross-domain small sample CT image semantic segmentation system based on meta-learning, characterized in that: include: Data processing module: used to sample from the labeled source domain image data, combine them into a small sample segmentation task set, and sample unlabeled images from the target domain as training data; Feature extraction module: used to obtain the middle-level features and prototype features of the source domain image data using convolutional neural networks, and to obtain the middle-level features of the images in the target domain using convolutional neural networks; Segmentation prediction module: used to calculate the segmentation results of small sample segmentation tasks using cosine similarity; Loss calculation module: used to calculate the segmentation loss using the segmentation results and the real labeled data, calculate the difference loss between the source domain features and the target domain features using the maximum mean difference algorithm for domain alignment, calculate the weighted loss and optimize the model; The data processing module is specifically used for: Sampling from the labeled source domain image data, combined into a small sample segmentation task set, as the model input for meta-training, complete the small sample segmentation task in the source domain; the small sample segmentation tasks used for meta-training are: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes the query image X q and the annotation M used to calculate the loss during training q ; Sample some unlabeled image data from the target domain and add it to each corresponding small sample task. The unlabeled image data is used to align the data domain. That is, at this time: T i Represents the unlabeled image data added to the i-th small sample segmentation task; The feature extraction module is specifically used for: The formulas for obtaining the middle-level features of the source domain image data are: F s =E(X s ),E q =E(X q ),F t =E(X t ), The target domain image data is X t , and then use the global average pooling of labels to extract the target category prototype and the background category prototype respectively. When extracting the target category prototype, i takes 1, and when extracting the background category prototype, i takes 0. The formula is: Where P represents the prototype feature, x and y represent the spatial coordinates, and the function δ is an indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

2. The cross-domain small sample CT image semantic segmentation system based on meta-learning according to claim 1 is characterized in that: The segmentation prediction module is specifically used for: The metric segmentation of the prototype feature P and the image feature F_q is completed by a metric tool with or without parameters. The cosine similarity is used to measure the similarity between the prototype feature and the image feature based on the metric tool without parameters, and then the segmentation is completed. The cosine similarity between the foreground prototype feature and the background prototype feature and the image feature is calculated as follows: In the formula, Pred represents the similarity value, and α is the adjustment multiplier; The segmentation result is obtained by the argmax function, and its formula is:

3. The cross-domain small sample CT image semantic segmentation system based on meta-learning according to claim 2 is characterized in that: The loss calculation module is specifically used for: The loss calculation of the small sample segmentation task in the supervised source domain is based on the cross entropy loss function, which is: In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively; The middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F t ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively: Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss: Among them, k represents the kernel matrix calculated by the Gaussian kernel function; The final weighted total loss is calculated as: L=L seg +βL mmd , where β is a multiplier.

4. A cross-domain small sample CT image semantic segmentation method based on meta-learning, applied to the cross-domain small sample CT image semantic segmentation system based on meta-learning according to any one of claims 1 to 3, characterized in that: The steps include: Step S1: sampling from the labeled source domain image data to form a small sample segmentation task set, and sampling unlabeled images from the target domain as training data; Step S2: Use a convolutional neural network to obtain the middle-level features and prototype features of the source domain image data, and use a convolutional neural network to obtain the middle-level features of the image in the target domain; Step S3: Calculate the segmentation result of the small sample segmentation task using cosine similarity; Step S4: Use the segmentation results and the real labeled data to calculate the segmentation loss, use the maximum mean difference algorithm to calculate the difference loss between the source domain features and the target domain features for domain alignment, calculate the weighted loss and optimize the model.

5. The cross-domain small sample CT image semantic segmentation method based on meta-learning according to claim 4 is characterized in that: Step S1 specifically includes: Sampling from the labeled source domain image data, combined into a small sample segmentation task set, as the model input for meta-training, complete the small sample segmentation task in the source domain; the small sample segmentation tasks used for meta-training are: Among them, C represents the small sample segmentation task set, N represents the number of sampled small sample segmentation tasks, S represents the support set, Q represents the query set, and the support set S also includes K samples with annotation M, that is, The query set Q includes the query image X q and the annotation M used to calculate the loss during training q ; Sample some unlabeled image data from the target domain and add it to each corresponding small sample task. The unlabeled image data is used to align the data domain. That is, at this time: T i Represents the unlabeled image data added to the i-th small sample segmentation task.

6. The cross-domain small sample CT image semantic segmentation method based on meta-learning according to claim 5 is characterized in that: Step S2 specifically includes: The formulas for obtaining the middle-level features of the source domain image data are: F s =E(X s ),E q =E(X q ),F t =E(X t ), The target domain image data is X t , and then use the global average pooling of labels to extract the target category prototype and the background category prototype respectively. When extracting the target category prototype, i takes 1, and when extracting the background category prototype, i takes 0. The formula is: Where P represents the prototype feature, x and y represent the spatial coordinates, and the function δ is an indicator function, which takes 1 when the parameter is true and 0 otherwise. If there are multiple support set samples, the prototype is calculated multiple times and the average prototype is calculated.

7. The cross-domain small sample CT image semantic segmentation method based on meta-learning according to claim 6, characterized in that: Step S3 specifically includes: The metric segmentation of the prototype feature P and the image feature F_q is completed by a metric tool with or without parameters. The cosine similarity is used to measure the similarity between the prototype feature and the image feature based on the metric tool without parameters, and then the segmentation is completed. The cosine similarity between the foreground prototype feature and the background prototype feature and the image feature is calculated as follows: In the formula, Pred represents the similarity value, and α is the adjustment multiplier; The segmentation result is obtained by the argmax function, and its formula is:

8. The cross-domain small sample CT image semantic segmentation method based on meta-learning according to claim 7, characterized in that: Step S4 specifically includes: The loss calculation of the small sample segmentation task in the supervised source domain is based on the cross entropy loss function, which is: In the formula, the middle-level feature F q ∈R c×h×w , the middle-level feature F t ∈R c×h×w , c is the number of channels, h, w are the height and width of the feature map respectively; The middle-level feature F q , F t , respectively transform the dimensions into: F q ∈R hw×c , F q ∈R hw×c ; Then from the middle-level feature F q , F t In the above equation, m and n channel feature vectors are extracted as data domain samples, and the formulas are obtained respectively: Then use the extracted channel feature vector and the maximum mean difference algorithm to calculate the alignment loss: Among them, k represents the kernel matrix calculated by the Gaussian kernel function; The final weighted total loss is calculated as: L=L seg +βL mmd , where β is a multiplier.

Citation Information

Cited By

  • Domain-adaptive small sample CT medical picture semantic segmentation system based on variational auto-encoder

    CN121837637A