A cross-domain medical image segmentation method and related device based on discrete diffusion model
By employing a cross-domain medical image segmentation method based on a discrete diffusion model, this method utilizes a forward diffusion processing module and a robust feature extraction sub-network to generate accurate and diverse segmentation results. This solves the problem of inaccurate segmentation caused by differences between the training and testing domains, achieving accurate segmentation and uncertainty estimation in unknown target domains, and enhancing its clinical application value.
Patent Information
- Application Number
- CN202411619364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-13
AI Technical Summary
Existing medical image segmentation technologies struggle to generate accurate and diverse segmentation results when there are significant differences between the training and testing domains, and they cannot estimate the uncertainty of the segmentation results, thus limiting their application in clinical settings.
A cross-domain medical image segmentation method based on a discrete diffusion model is adopted. By using a pre-trained domain generalization diffusion segmentation model, a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network, accurate and diverse segmentation results are generated, and uncertainty estimation is achieved.
Models trained in a single source domain can generalize to unknown target domains, generating accurate and diverse segmentation results that support clinical diagnosis, treatment planning, and disease monitoring.
Smart Images

Figure CN119600035B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image analysis, specifically relating to a cross-domain medical image segmentation method and related apparatus based on a discrete diffusion model. It is used to train a medical image segmentation model in a single source domain and segment medical images in an unknown target domain. The cross-domain can be different modalities, different sequences, or different centers (hospitals). Background Technology
[0002] Medical image segmentation is a crucial component of clinical practice, aiding in accurate diagnosis, treatment planning, and disease monitoring. Most existing medical image segmentation techniques are designed for scenarios where training and testing data originate from the same domain (i.e., the same data distribution). When the testing data comes from a different distribution (i.e., a different domain), the performance of these methods can deteriorate sharply. This difference between the training and testing domains is very common in medical image segmentation and can be caused by different imaging methods, scanning protocols, or equipment manufacturers. Therefore, medical image segmentation techniques that can generalize across domains are of great clinical significance.
[0003] To address this issue, several domain-generalized medical image segmentation methods have been developed. Some multi-source domain generalization methods use labeled data from multiple source domains to train the segmentation model, generalizing to the unknown target domain based on meta-learning or domain-invariant feature learning. While these methods have achieved satisfactory results, obtaining the required training data is difficult in practice. Furthermore, some single-source domain generalization methods use training data from a single source domain, training the domain-generalized segmentation model through data augmentation or feature decoupling. However, these methods are all based on deterministic segmentation models, failing to generate accurate and diverse segmentation results, and unable to estimate the uncertainty of the segmentation results, thus limiting their application in clinical scenarios. Summary of the Invention
[0004] To overcome the technical problem of inaccurate medical image segmentation results in existing technologies, the purpose of this invention is to propose a cross-domain medical image segmentation method and related device based on a discrete diffusion model. This method can train a medical image segmentation model in a single source domain and segment medical images in an unknown target domain.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A cross-domain medical image segmentation method based on a discrete diffusion model includes the following steps:
[0007] Obtain the medical image to be segmented and its pseudo-label;
[0008] The medical image to be segmented is input into a pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result;
[0009] The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels.
[0010] Furthermore, a forward diffusion processing module is used to continuously damage the clean labels of medical images through a Markov chain, generating noisy labels.
[0011] Furthermore, the robust feature extraction subnetwork consists of four sequentially connected 2D convolutional layers, an adaptive weighting layer for adaptive feature fusion, and a normalization layer.
[0012] A 2D convolutional layer is used to extract features from medical images to obtain input features.
[0013] The adaptive weighted layer is used to perform element-wise squaring, weighted summation, and element-wise square root extraction on the input features using a learnable weight matrix to obtain adaptive fusion features.
[0014] The normalization layer is used to normalize the adaptive fusion features to obtain robust image features.
[0015] Furthermore, the segmentation label generation network includes three encoders, fourteen interaction improvement modules, and two decoders connected in sequence;
[0016] The three encoders have the same structure, and the two decoders have the same structure. The encoders consist of a convolutional layer, an element-wise summation layer with block location embedding, ten self-attention modules, and two convolutional layers connected in sequence. The decoders consist of four deconvolutional layers and one convolutional layer connected in sequence.
[0017] Furthermore, an interaction improvement module is used to iteratively interact between block-level embeddings of noisy labels, robust image features, and pseudo-labels using a multi-head attention mechanism, resulting in improved noisy label embeddings and pseudo-label embeddings.
[0018] Furthermore, to generate improved noise label embeddings and pseudo label embeddings by iteratively interacting between block-level embeddings of noisy labels, robust image features, and pseudo labels using a multi-head attention mechanism, the method includes the following steps:
[0019] Self-attention mechanism, embedding based on input noise labels Characterize the global dependencies within the noise labels to generate the first improved noise label embedding;
[0020] The first cross-attention mechanism characterizes the dependency relationship between robust image features and pseudo-labels based on pseudo-label embedding and robust image feature embedding, and generates an improved pseudo-label embedding.
[0021] The second cross-attention mechanism, based on the first improved noise label embedding, characterizes the dependency relationship between pseudo-labels and noise labels, and generates the second improved noise label embedding.
[0022] The third cross-attention mechanism, based on the second improved noise label embedding, characterizes the dependency relationship between robust image features and noise labels, and generates the third improved noise label embedding.
[0023] The residual module is used to generate the final improved noise label embedding based on the third improved noise label embedding, wherein the residual module includes a connected normalization layer and two linear projection layers.
[0024] Furthermore, the loss function of the pre-trained domain generalization diffusion segmentation model includes a denoising objective function, robust feature constraints, and pseudo-label improvement constraints.
[0025] A second aspect of the present invention provides a cross-domain medical image segmentation system based on a discrete diffusion model, comprising:
[0026] The medical image and pseudo-label acquisition module is used to acquire the medical images to be segmented and their pseudo-labels.
[0027] The medical image segmentation module is used to input the medical image to be segmented into a pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result;
[0028] The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels.
[0029] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cross-domain medical image segmentation method based on a discrete diffusion model.
[0030] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the cross-domain medical image segmentation method based on a discrete diffusion model.
[0031] Compared with the prior art, the present invention has at least the following beneficial technical effects:
[0032] This invention achieves accurate medical image segmentation through a pre-trained domain-generalized diffusion segmentation model. Compared to existing domain-generalized medical image segmentation methods, this invention is based on a discrete diffusion generation model. It trains a medical image segmentation model on a single-source domain that can generalize to unknown target domains, generating accurate and diverse segmentation results, and achieving uncertainty estimation and model ensemble. Compared to existing diffusion model-based medical image segmentation methods, this invention focuses on exploring and improving the cross-domain generalization ability of the diffusion segmentation model, employing a robust feature extraction sub-network and a segmentation label generation network to achieve cross-domain segmentation label generation. This invention is primarily applicable to accurate medical image segmentation; that is, it can train a segmentation model using only single-source domain data and accurately segment medical images in unknown target domains. The cross-domains can be different modalities, different sequences, or different centers (hospitals), and it has significant application value in assisting clinicians in accurate diagnosis, treatment planning, and disease monitoring. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating the specific implementation of the present invention;
[0034] Figure 2 This is a framework diagram of the domain generalization diffusion segmentation model;
[0035] Figure 3 This is a diagram of the robust feature extraction subnetwork structure of the domain generalization diffusion segmentation model.
[0036] Figure 4 This is a diagram of the segmentation label generation network structure of the domain generalization diffusion segmentation model;
[0037] Figure 5 This is a structural diagram of the interactive improvement module of the segmentation label generation network;
[0038] Figure 6 These are the segmentation results of the present invention on an unknown target domain; where (a) is the source domain image, (b) is the target domain image, and (c) is the result of the present invention.
[0039] Figure 7 This is a flowchart of the segmentation method of the present invention;
[0040] Figure 8 This is a schematic diagram of the segmentation system of the present invention. Detailed Implementation
[0041] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0042] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0043] like Figure 7 As shown, the present invention provides a cross-domain medical image segmentation method based on a discrete diffusion model, comprising the following steps:
[0044] S1, Obtain the medical image to be segmented and its pseudo-label;
[0045] S2, input the medical image to be segmented into the pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result;
[0046] The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels.
[0047] See Figure 1 This invention comprises constructing a domain-generalized segmentation model to achieve cross-domain medical image segmentation: A forward diffusion process damages the segmentation labels of medical images, generating a series of noisy labels. A dual-path backward diffusion process is constructed, and a network is designed to learn a domain-generalized conditional distribution based on robust image features and pseudo-labels for iterative denoising of the noisy labels. After training the model in a single-source domain, the learned backward diffusion process is applied to the medical image to be segmented in an unknown target domain, iteratively sampling from pure noise until clean labels are recovered, which is the segmentation result.
[0048] Network structure design for the backdiffusion process of the domain generalization segmentation model: A deep network is constructed to learn the conditional distribution of domain generalization during backdiffusion. A robust feature extraction sub-network is constructed, containing convolutional layers, adaptive weighting layers, and normalization layers, to extract robust image features from medical images. A segmentation label generation network is constructed, containing an encoder, an interactive improvement module, and a decoder, to improve noisy labels using robust image features and pseudo-labels, outputting noise-free labels.
[0049] Loss function and training algorithm for the backdiffusion process of the domain generalization segmentation model: The loss function for the dual-path backdiffusion process is constructed, including a denoising objective function that constrains the noiseless labels generated by both paths to approximate the real clean labels, a robust feature constraint that constrains the robust image features of both paths to be equal, and a pseudo-label improvement constraint that constrains the improved pseudo-labels of both paths to approximate the real clean labels. Specifically, the steps are as follows:
[0050] I. Construction of the forward diffusion process
[0051] This invention does not require any special design for the forward diffusion process; it only requires a discrete process to continuously add noise to the clean segmentation labels until pure noise is reached. A feasible method for constructing the forward diffusion process is described here.
[0052] Forward diffusion process via Markov chain Clean labels on medical images are constantly being damaged. This generates a series of increasing noise labels. ,in This is a pure noise label. (Noise labeling should be considered.) Label at any pixel , If the number of segmentation categories is represented, then the forward diffusion process at this pixel can be defined as:
[0053] (1)
[0054] in, It is a length of A one-hot column vector, where the index of the component with a value of 1 corresponds to the noise label. Category to which it belongs. It is the transition matrix, where Position element representation by Transfer to The probability. Specifically, an additional class, namely the [MASK] class, can be introduced, and a transition matrix can be defined. for
[0055] (2)
[0056] This means that when noise label Belongs to the conventional front When classifying, with The probability transition is to the [MASK] class, with... The probability remains unchanged, with The probability shifts to other regular categories; when the noise label When belonging to the [MASK] class, the probability remains unchanged at 1. With... The increase, It decreases linearly from 1 to 0, while The label increases linearly from 0 to 1, thus becoming a pure noise label. It will belong entirely to the [MASK] category.
[0057] II. Construction of the Backdiffusion Process for Domain Generalization
[0058] This invention utilizes a dual-path backdiffusion process in a single-source domain, employing a designed robust feature extraction sub-network and a segmentation label generation network to learn the conditional distribution of the generalization domain. It is used to continuously denoise the noise tags until they are removed from the noise tags. Restore clean label ,in, From the image Robust image features extracted from them These are pseudo-labels. Conditional distribution. We hope to approximate the posterior distribution of the forward diffusion process. The latter can be derived from equation (1);
[0059] (3)
[0060] in, , For the reason arrive The cumulative transition matrix, For clean labels Any pixel in the image, noise label Any pixel in the image, For the reason arrive The transition matrix, noise label Any pixel in the image, For the reason arrive The transition matrix, noise label Any pixel in the image, For the reason arrive The transition matrix, noise label Any pixel in the array.
[0061] like Figure 2 As shown, for the random sampling time points and noise labels (From the forward diffusion process from the clean label) (Generated), the present invention first processes the input image Enhancement is performed using the same geometric transformation but different brightness transformations, resulting in two enhanced images with the same structure but different contrasts; this is the first enhanced image. With the second enhanced image First enhanced image With the second enhanced image They are fed into a shared robust feature extraction subnetwork. Extracting the first robust image features and first robust image features Furthermore, the first robust image features With the second robust image features pseudo-tags With noise label They are fed into a shared segmentation label generation network. Predict the distribution of noiseless labels and ,Right now
[0062] (4)
[0063] (5)
[0064] Furthermore, the present invention utilizes the aforementioned noiseless label distribution to calculate arrive The conditional transition probability is:
[0065] (6)
[0066] (7)
[0067] Next, the robust feature extraction subnetwork and segmentation label generation network of the present invention will be described in detail.
[0068] 1) Robust Feature Extraction Subnetwork
[0069] Robust feature extraction subnetwork is used to extract features from the input image during backdiffusion. Extracting robust image features To reduce the impact of different image distributions on the cross-domain performance of the diffusion model. For example... Figure 3As shown, the robust feature extraction subnetwork contains four 2D convolutional layers to extract features, an adaptive weighting layer to adaptively fuse features, and a normalization layer to normalize the feature maps of each layer to 0 mean and 1 variance, and finally outputs robust image features.
[0070] 2D convolutional layers are used to process the input image. Extract features to obtain input features ;
[0071] Adaptive weighted layer: given input features , contains Layer feature map j is the feature layer index, where This represents the input image size. The adaptive weighted layer utilizes a learnable weight matrix. The input features are squared element-wise, summed weighted, and squared element-wise to generate robust output image features. , contains Layer feature map Specifically, feature map It can be defined as:
[0072]
[0073] in, Represents element-wise product. Describes learnable weights, and satisfies .
[0074] 2) Segmentation Label Generation Network
[0075] A segmentation label generation network is constructed to improve noisy labels by leveraging robust image features and pseudo-label interactions, outputting noise-free labels. The segmentation label generation network is used at each time point of the backdiffusion process. Noise label Estimated noise-free label Based on robust image features and pseudo-tags .like Figure 4 As shown, the segmentation label generation network contains three encoders that generate labels from noise. Robust image features and pseudo-tags Extracting block-level embeddings, fourteen interactive improvement modules continuously improve the embedding of noisy labels and pseudo-labels, and two decoders reconstruct noise-free labels respectively. And improved pseudo-labels .
[0076] Encoder / Decoder: The segmentation label generation network has three encoders with the same structure and two decoders with the same structure. For example... Figure 4 As shown, the encoder contains one convolutional layer, one element-wise summation layer with block location embedding, ten self-attention modules, and two convolutional layers, while the decoder contains four deconvolutional layers and one convolutional layer.
[0077] Interactive Improvement Module: This module utilizes a multi-head attention mechanism to iteratively interact among the block-level embeddings of noisy labels, robust image features, and pseudo-labels, producing improved noisy label embeddings and pseudo-label embeddings. Given the first... One interactive improvement module and input noise label embedding Pseudo-tag embedding Robust image feature embedding Let the multi-head attention mechanism be denoted as... ,in These represent the query, key, and value, respectively. For example... Figure 5 As shown, the interactive improvement module of the present invention Interaction is achieved using four multi-head attention mechanism modules:
[0078] Self-attention mechanism, embedding based on input noise labels Characterize the global dependencies within the noise labels to generate the first improved noise label embedding. ;
[0079] The first cross-attention mechanism, based on pseudo-label embedding. With robust image feature embedding This study characterizes the dependency relationship between robust image features and pseudo-labels, and generates an improved pseudo-label embedding. ;
[0080] The second cross-attention mechanism, based on the first improved noise label embedding... This characterizes the dependency relationship between pseudo-labels and noise labels, generating a second improved noise label embedding. ;
[0081] The third cross-attention mechanism, based on the second improved noise label embedding. This characterizes the dependency between robust image features and noise labels, generating a third improved noise label embedding. .
[0082] Finally, the interaction improvement module embeds the third improved noise label. The final improved noise label embedding is generated using a residual module. The residual module consists of one normalization layer and two linear projection layers. In summary, the interactive improvement module of this invention... It can be expressed as
[0083]
[0084] III. Training Objectives of the Domain Generalization Diffusion Segmentation Model
[0085] During the training phase, this invention employs an early stopping strategy to train a U-Net segmenter, which generates segmentation labels for the training set as pseudo-labels when training the domain-generalized diffusion segmentation model. To ensure the learned backdiffusion process is accurate and domain-generalized, this invention uses the following three training loss functions.
[0086] Denoising objective function This loss function is used to constrain the first noiseless label distribution learned through the two-way backdiffusion process. Second noiseless label distribution Approximating the distribution of clean noise labels ,Right now:
[0087]
[0088] in, This represents the cross-entropy loss.
[0089] Robust feature constraints This loss function is used to constrain the first robust image features extracted from the dual-path backdiffusion process distribution. Second robust image features Equal, that is
[0090]
[0091] in, It represents the 1-norm.
[0092] Pseudo-label Improvement Constraints This loss function is used to constrain the first improved pseudo-label distribution learned by the two-way backdiffusion process. Second improved pseudo-label distribution Approximating the distribution of clean noise labels ,Right now
[0093]
[0094] The ultimate training objective of the domain generalization diffusion segmentation model of this invention is the total loss function of the two-way back diffusion process. for
[0095]
[0096] in, and The first system and the second coefficient are used to determine the relative importance of the high control loss term, and are set to 0.0001 and 0.1 respectively in this invention.
[0097] The labeled data from the source domain is used as training data, and the AdamW optimization algorithm and the aforementioned loss function are used to train the domain generalization segmentation model for backdiffusion.
[0098] IV. Applying a trained domain generalization diffusion segmentation model to perform medical image segmentation in an unknown target domain.
[0099] After the single-source domain is trained in step three, the learned domain generalization diffusion segmentation model can be directly applied to the generation of medical image segmentation labels for unknown target domains. Specifically, for example... Figure 2 As shown, the target image in the unknown target domain. and corresponding pseudo tags This invention directly uses the target image The image is fed into a pre-trained robust feature extraction sub-network to extract robust image features. And sample random discrete noise labels In this invention, this refers to segmentation labels that are all of the [MASK] category. Furthermore, this invention utilizes robust image features... and pseudo-tags The data is fed into a pre-trained segmentation label generation network as a condition to generate noisy labels. Starting from, using equation (6) Through iterative improvements, a series of noise labels were obtained. .in, That is, the target image generated by this invention. The segmentation tag.
[0100] Rapid Inference Process: This invention can skip some time points when inferring the segmentation labels of the target image to improve inference speed. Specifically, let the time point interval be... This invention can utilize conditional distribution Iterative improvements yielded a series of noise labels. , where conditional distribution It can be calculated as follows:
[0101] (6)
[0102] In numerical experiments, under the cross-modal abdominal segmentation setting, this invention used abdominal CT data from 30 subjects and abdominal MR data from 20 subjects, with one modality used as training data and the other as test data each time; under the cross-sequence cardiac segmentation setting, this invention used cardiac bSSFP MR data from 45 subjects as training data and cardiac LGE MR data from 45 subjects as test data; under the cross-center prostate segmentation setting, this invention used data from 6 centers, including prostate MR data from 30, 30, 19, 13, 12, and 12 subjects respectively, with data from one center used as training data and data from the other five centers used as test data each time.
[0103] As shown in Table 1, the domain generalization diffusion segmentation model (DG-DDM-Seg) of this invention is compared with a baseline method for empirical risk minimization (ERM), a single-source domain generalization method based on feature decoupling (CCSDG), and four single-source domain generalization methods based on data augmentation (AdvBias, FreeSDG, SLAug, and CSDG) on three cross-domain generalization problems, including cross-modal abdominal segmentation, cross-sequence cardiac segmentation, and cross-center prostate segmentation. The domain generalization diffusion segmentation model designed in this invention achieves the best reconstruction accuracy under different cross-domain segmentation settings. Figure 6 Images (a), (b), and (c) are visualization results of cross-domain segmentation in this invention, showing that this invention can accurately segment medical images of unknown target domains.
[0104] Table 1. Comparison results of different domain-generalized medical image segmentation methods on the test set under different cross-domain settings.
[0105]
[0106] As can be seen from Table 1, the medical image segmentation accuracy of the present invention is high.
[0107] This invention trains a medical image segmentation model in a single source domain, enabling accurate segmentation of medical images in unknown target domains. Compared to existing domain-generalized medical image segmentation methods, this invention is based on a discrete diffusion generation model. It trains a medical image segmentation model in a single source domain that can generalize to unknown target domains, generating accurate and diverse segmentation results, and achieving uncertainty estimation and model ensemble. Compared to existing diffusion model-based medical image segmentation methods, this invention focuses on exploring and improving the cross-domain generalization ability of diffusion segmentation models. It employs a robust feature extraction sub-network and a dual-path backdiffusion process to learn the conditional distribution of domain generalization for cross-domain segmentation label generation.
[0108] See Figure 8In another embodiment of the present invention, a cross-domain medical image segmentation system based on a discrete diffusion model is provided, comprising:
[0109] The medical image and pseudo-label acquisition module is used to acquire the medical images to be segmented and their pseudo-labels.
[0110] The medical image segmentation module is used to input the medical image to be segmented into a pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result;
[0111] The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels.
[0112] All relevant content of each step involved in the aforementioned embodiments of the cross-domain medical image segmentation method based on the discrete diffusion model can be referenced to the functional description of the corresponding functional module of the cross-domain medical image segmentation system based on the discrete diffusion model in the embodiments of the present invention, and will not be repeated here.
[0113] In another embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the cross-domain medical image segmentation method based on a discrete diffusion model. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from a computer storage medium to achieve the corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a method for detecting epilepsy signals in electroencephalogram (EEG) signals.
[0114] In another embodiment of the present invention, a computer-readable storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the cross-domain medical image segmentation method based on the discrete diffusion model in the above embodiments.
[0115] The above description is only of the preferred embodiment of the present invention and should not be construed as limiting the scope of the claims. The present invention is not limited to the above embodiments, and variations in its specific structure are permitted. All variations made within the scope of the independent claims of the present invention are also within the scope of protection of the present invention.
[0116] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
Claims
1. A cross-domain medical image segmentation method based on a discrete diffusion model, characterized in that, Includes the following steps: Obtain the medical image to be segmented and its pseudo-label; The medical image to be segmented is input into a pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result; The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels. The segmentation label generation network consists of three encoders, fourteen interaction improvement modules, and two decoders connected in sequence; The three encoders have the same structure, and the two decoders have the same structure. The encoders consist of a convolutional layer, an element-wise summation layer with block position embeddings, ten self-attention modules, and two convolutional layers, which are connected in sequence. The decoders consist of four deconvolutional layers and one convolutional layer, which are connected in sequence. The three encoders extract block-level embeddings from noisy labels, robust image features, and pseudo-labels, respectively. Fourteen interactive improvement modules continuously improve the noisy label embeddings and pseudo-label embeddings. The two decoders reconstruct the noiseless labels and the improved pseudo-labels, respectively. The interaction improvement module, which utilizes a multi-head attention mechanism to iteratively interact among block-level embeddings of noise labels, robust image features, and pseudo-labels to generate improved noise label embeddings and pseudo-label embeddings, includes the following steps: The self-attention mechanism characterizes the global dependencies within the noise labels based on the input noise label embedding, and generates the first improved noise label embedding. The first cross-attention mechanism characterizes the dependency relationship between robust image features and pseudo-labels based on pseudo-label embedding and robust image feature embedding, and generates an improved pseudo-label embedding. The second cross-attention mechanism, based on the first improved noise label embedding, characterizes the dependency relationship between pseudo-labels and noise labels, and generates the second improved noise label embedding. The third cross-attention mechanism, based on the second improved noise label embedding, characterizes the dependency relationship between robust image features and noise labels, and generates the third improved noise label embedding. The residual module is used to generate the final improved noise label embedding based on the third improved noise label embedding, wherein the residual module includes a connected normalization layer and two linear projection layers.
2. The cross-domain medical image segmentation method based on the discrete diffusion model according to claim 1, characterized in that, The forward diffusion processing module is used to continuously damage the clean labels of medical images through a Markov chain, generating noisy labels.
3. The cross-domain medical image segmentation method based on the discrete diffusion model according to claim 1, characterized in that, The robust feature extraction subnetwork consists of four sequentially connected 2D convolutional layers, an adaptive weighting layer for adaptive feature fusion, and a normalization layer. A 2D convolutional layer is used to extract features from medical images to obtain input features. The adaptive weighted layer is used to perform element-wise squaring, weighted summation, and element-wise square root extraction on the input features using a learnable weight matrix to obtain adaptive fusion features. The normalization layer is used to normalize the adaptive fusion features to obtain robust image features.
4. The cross-domain medical image segmentation method based on the discrete diffusion model according to claim 1, characterized in that, The loss function of the pre-trained domain generalization diffusion segmentation model includes a denoising objective function, robust feature constraints, and pseudo-label improvement constraints.
5. A cross-domain medical image segmentation system based on a discrete diffusion model, characterized in that, include: The medical image and pseudo-label acquisition module is used to acquire the medical images to be segmented and their pseudo-labels. The medical image segmentation module is used to input the medical image to be segmented into a pre-trained domain generalization diffusion segmentation model to obtain the medical image segmentation result; The pre-trained domain generalization diffusion segmentation model includes a forward diffusion processing module, a robust feature extraction sub-network, and a segmentation label generation network connected in sequence. The forward diffusion processing module is used to add noise to the medical image to be segmented to obtain noise labels. The robust feature extraction sub-network is used to extract robust image features from the medical image to be segmented. The segmentation label generation network is used to obtain segmentation labels based on robust image features, pseudo-labels of the medical image to be segmented, and noise labels. The segmentation label generation network consists of three encoders, fourteen interaction improvement modules, and two decoders connected in sequence; The three encoders have the same structure, and the two decoders have the same structure. The encoders consist of a convolutional layer, an element-wise summation layer with block position embeddings, ten self-attention modules, and two convolutional layers, which are connected in sequence. The decoders consist of four deconvolutional layers and one convolutional layer, which are connected in sequence. The three encoders extract block-level embeddings from noisy labels, robust image features, and pseudo-labels, respectively. Fourteen interactive improvement modules continuously improve the noisy label embeddings and pseudo-label embeddings. The two decoders reconstruct the noiseless labels and the improved pseudo-labels, respectively. The interaction improvement module, which utilizes a multi-head attention mechanism to iteratively interact among block-level embeddings of noise labels, robust image features, and pseudo-labels to generate improved noise label embeddings and pseudo-label embeddings, includes the following steps: Self-attention mechanism, embedding based on input noise labels Characterize the global dependencies within the noise labels to generate the first improved noise label embedding; The first cross-attention mechanism characterizes the dependency relationship between robust image features and pseudo-labels based on pseudo-label embedding and robust image feature embedding, and generates an improved pseudo-label embedding. The second cross-attention mechanism, based on the first improved noise label embedding, characterizes the dependency relationship between pseudo-labels and noise labels, and generates the second improved noise label embedding. The third cross-attention mechanism, based on the second improved noise label embedding, characterizes the dependency relationship between robust image features and noise labels, and generates the third improved noise label embedding. The residual module is used to generate the final improved noise label embedding based on the third improved noise label embedding, wherein the residual module includes a connected normalization layer and two linear projection layers.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the cross-domain medical image segmentation method based on the discrete diffusion model as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the cross-domain medical image segmentation method based on the discrete diffusion model as described in any one of claims 1 to 4.