Brain tumor image automatic segmentation method and system based on diffusion adversarial contrast learning
By employing a diffusion adversarial contrastive learning approach, utilizing a subspace-driven convolutional Mamba network and pseudo-label-driven diffusion segmentation learning, and combining adversarial and contrastive learning, the problem of insufficient supervision signals in brain tumor image segmentation is solved, achieving high-precision and stable automatic segmentation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-04
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies for brain tumor image segmentation suffer from insufficient supervision signals, instability of noise labels, and poor generalization, making it difficult to achieve high-precision segmentation, especially under unsupervised or weakly supervised conditions.
We employ a diffusion-adversarial contrastive learning approach, using a subspace-driven convolutional Mamba network for feature extraction. This is combined with pseudo-label-driven diffusion segmentation learning, adversarial learning, and contrastive learning to construct synthetic data for initial training. Finally, we optimize the segmentation model through adversarial and contrastive learning to achieve stable automatic segmentation of brain tumor images.
Without manual annotation, the reliability and practicality of brain tumor image segmentation are significantly improved, and stable performance across devices and centers is maintained, achieving high-precision automatic segmentation of brain tumor images.
Smart Images

Figure CN121767368A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology and relates to an automatic brain tumor image segmentation method and system, particularly an automatic brain tumor image segmentation method and system based on diffusion adversarial contrastive learning. Background Technology
[0002] Brain tumors are among the most common and deadliest diseases of the central nervous system. They are caused by abnormal cell division within the brain, exhibiting strong heterogeneity, diverse morphology and signal characteristics, and often accompanied by infiltration and indistinct growth boundaries. This necessitates high-precision segmentation for preoperative assessment, target delineation, and follow-up of treatment efficacy. However, high-quality measurements of brain tumors are typically obtained through manual segmentation of brain MRI images, a laborious and time-consuming process. Due to the diverse morphologies, blurred boundaries, and complex distribution of brain tumor lesions, manual segmentation struggles to meet the demands of large-scale data processing, thus limiting its application in disease mechanism research and clinical translation.
[0003] While existing deep learning-based supervised segmentation has alleviated the annotation burden to some extent, it still faces two major challenges: first, it is difficult to obtain large-scale, high-quality annotations, resulting in insufficient supervision signals; second, it suffers from insufficient stability and generalization in scenarios with noisy labels or unlabeled data, with significant performance fluctuations across devices and centers. Especially in unsupervised or weakly supervised environments, how to continuously optimize segmentation accuracy in the absence of a "standard answer" remains the core challenge of automated brain tumor segmentation.
[0004] Given the technical limitations of existing technologies, there is an urgent need to research a novel automatic segmentation method for brain tumor images. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this invention proposes an automatic brain tumor image segmentation method and system based on diffusion adversarial contrastive learning. It first classifies healthy brain images and tumor brain images, reducing the difficulty of manual screening. It can effectively identify the location and extent of brain tumor lesions without manual annotation, and maintain stable performance under different acquisition machines and different disease types. It significantly improves the reliability and practicality of automatic brain tumor image segmentation, providing a reliable and easy-to-use analysis tool for clinical diagnosis and scientific research.
[0006] To achieve the above objectives, the present invention provides the following technical solution: An automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning, characterized by the following steps: S1: The 3D magnetic resonance brain structure images are decomposed into subspaces and then the convolutional Mamba module is used to extract features to classify healthy brain images and tumor brain images. S2: For the healthy brain image, a tumor morphology with brain tumor characteristics is created by three-dimensional geometric modeling, and synthetic data that conforms to the structural characteristics of real brain tumors is synthesized by combining intensity simulation imaging algorithm. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels. S3: Using the synthetic data as training data, the synthetic brain tumor magnetic resonance image as input, and the synthetic brain tumor mask pseudo-label as supervision signal, the diffusion segmentation model is initially trained. S4: Input the real patient's brain tumor image into the pre-trained diffusion segmentation model, and the pre-trained diffusion segmentation model outputs the real brain tumor segmentation mask label. ; S5: Based on real patient brain tumor images, newly generated brain tumor mask labels are obtained through a generator that uses random noise and performs adversarial learning. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. ; S6: Generate the final new brain tumor mask label output by the generator. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Used as negative samples for comparative learning; S7: The diffusion segmentation model is trained by using the weighted sum of the adversarial learning and contrastive learning losses as the final training target. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model. The final model is then used to automatically segment the tumor region of the brain tumor image.
[0007] Preferably, step S1 specifically includes: S11: Register the three-dimensional magnetic resonance brain structure image to the T1-weighted magnetic resonance imaging image and remove the skull and scalp to obtain the preprocessed three-dimensional brain image. S12: Perform single-layer three-dimensional convolution feature extraction on the three-dimensional brain image to obtain three-dimensional brain structure features, and perform gated weighted learnable subspace decomposition on the feature space of the three-dimensional brain structure features to map the three-dimensional brain structure features to multiple subspaces. S13: For any sequence in any direction within any subspace, perform comprehensive processing using the convolutional Mamba module to obtain the output sequence in that direction within that subspace; S14: For each subspace, perform global pooling on its output sequence in each direction to obtain the directional features of that subspace. Concatenate the directional features of all subspaces and input the concatenated fused feature vector into a linear classifier to obtain the classification results of healthy brain images and tumor brain images.
[0008] Preferably, step S13 specifically includes: S131: For any sequence in any direction within any subspace, the residual branch of the convolutional Mamba module, after layer normalization, constructs the residual... ; S132: For any sequence of directions in any subspace, the convolutional Mamba module... Branches are generated through convolution and By capturing global structural relationships, applying Depth-Wise Convolution after layer normalization, and then applying the SiLU activation function, a locally enhanced intermediate representation is obtained. ; S133: Utilizing the intermediate representation with the aforementioned local enhancement In discrete time, the output at each time step is obtained by recursively determining the state space blocks based on the convolutional Mamba module, and the outputs at each time step are stacked in chronological order to obtain the output sequence in that direction. ; S134: In the output sequence Add the aforementioned residual This yields the final output sequence in that direction of the subspace.
[0009] Preferably, step S2 specifically includes: S21: Use a 3D geodesic polyhedron to generate a synthetic tumor shape, and obtain the initial shape of the 3D geodesic polyhedron. The initial shape of the three-dimensional geodesic polyhedron is obtained by using Simplex noise. Perturbation is performed to obtain perturbed polyhedra with non-smooth surfaces and diverse shapes. ; S22: For the disturbed polyhedron Applying a three-dimensional Gaussian filter yields a soft tumor mask. Using the healthy brain image as a reference, the signal distribution of the brain tumor structural region is constructed through a three-dimensional Gaussian blur operator and an intensity scaling factor, and then the soft tumor is masked. The image is then fused with the healthy brain image using a buffer layer to generate the synthetic brain tumor magnetic resonance image. S23: Mask the soft tumor The corresponding synthetic tumor mask pseudo-labels are obtained by threshold binarization.
[0010] Preferably, the diffusion segmentation model in step S3 includes: A forward noise-adding module is used to gradually add Gaussian noise to the synthesized tumor mask pseudo-labels over time steps to obtain noisy pseudo-labels; A boundary encoder is used to perform convolution and downsampling processing on the synthetic brain tumor magnetic resonance image, thereby extracting the boundary features of the brain tumor region; A denoising encoder is used to receive the synthetic brain tumor magnetic resonance image, boundary features, noisy pseudo-labels and time steps, and extract denoising features; The cross-attention feature fusion module is used to fuse the boundary features and the denoised features to obtain a fused feature map; A boundary decoder is used to upsample the boundary features to restore spatial resolution and output a boundary prediction map; A denoising decoder is used to upsample and reconstruct the fused feature map step by step, and output the corresponding segmentation mask under the constraints of each time step. At that time, the final brain tumor segmentation results were obtained.
[0011] Preferably, in the cross-attention feature fusion module, the denoised features are used as queries, and the boundary features are used as keys and values to construct cross-attention.
[0012] Preferably, in step S7, the loss of the diffusion segmentation model... for: , Always To counteract the loss of the learned generator, To compare the learning loss, and This is the balance coefficient.
[0013] Furthermore, this invention also provides an automatic brain tumor image segmentation system based on diffusion adversarial contrastive learning, characterized in that it includes: The brain imaging classification module is used to extract features from three-dimensional magnetic resonance brain structural images after subspace decomposition, in order to classify healthy brain images and tumor brain images. The initial training data construction module is used to create tumor morphology with brain tumor characteristics from the healthy brain images through three-dimensional geometric modeling, and to synthesize synthetic data that conforms to the structural characteristics of real brain tumors by combining intensity simulation imaging algorithms. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels. The diffusion segmentation model preliminary training module is used to perform preliminary training on the diffusion segmentation model by using the synthetic data as training data, taking the synthetic brain tumor magnetic resonance image as input, and the synthetic brain tumor mask pseudo-label as supervision signal. A real brain tumor segmentation mask label generation module is used to input real patient brain tumor images into a pre-trained diffusion segmentation model, and the pre-trained diffusion segmentation model outputs real brain tumor segmentation mask labels. ; The module for generating new brain tumor mask labels based on adversarial learning is used to generate new brain tumor mask labels from real patient brain tumor images by passing random noise through an adversarial learning generator. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. ; The contrastive learning module is used to convert the final newly generated brain tumor mask labels output by the generator. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Used as negative samples for comparative learning; The brain tumor image segmentation module is used to train the diffusion segmentation model by using the weighted sum of two losses, adversarial learning and contrastive learning, as the final training target. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model, which is then used to automatically segment the tumor region of the brain tumor image.
[0014] Furthermore, the present invention also provides an automatic brain tumor image segmentation device based on diffusion adversarial contrastive learning, characterized in that it includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the brain tumor image automatic segmentation method based on diffusion adversarial contrastive learning as described above.
[0015] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the steps of the brain tumor image automatic segmentation method based on diffusion adversarial contrastive learning as described above.
[0016] Compared with existing technologies, the automatic brain tumor image segmentation method and system based on diffusion adversarial contrastive learning proposed in this invention has one or more of the following beneficial technical effects: (1) This invention employs a subspace-driven Mamba classification network to construct subspaces within the three-dimensional magnetic resonance feature space, enabling stable expression of structural differences in brain tissue and brain tumor spread characteristics. Subsequently, a multi-channel Mamba model is used for feature extraction, fusing anatomical structure and lesion change information from different subspaces and directions to obtain more complete features. This method maintains higher robustness and generalization ability under varying scanning conditions or complex lesion morphology, providing a more reliable foundation for subsequent segmentation.
[0017] (2) This invention employs a pseudo-label-driven diffusion segmentation learning strategy. First, it constructs multi-morphological and multi-contrast synthetic brain tumor images and pseudo-labels using shape and intensity modeling. Then, it learns lesion boundaries and fine-grained textures through progressive denoising and structural restoration of the diffusion network. This strategy achieves initial training under conditions of scarce or even no labels, significantly expanding the coverage of lesion appearance and boundary changes, improving the initial segmentation quality and convergence speed on real images, and laying a higher baseline for subsequent refinement and generalization.
[0018] (3) This invention adopts an optimization strategy based on adversarial learning and contrastive learning, combining diffusion segmentation with adversarial training to purify coarse labels and stabilize multi-scale boundaries. Adversarial learning effectively reduces the difference between synthetic and real distributions, while contrastive learning strengthens structural discriminativeness and consistency, and improves robust generalization across devices and centers, ultimately achieving high-precision, robust, and clinically transferable automated segmentation of brain tumor images. Attached Figure Description
[0019] Figure 1 This is a flowchart of the automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning of the present invention.
[0020] Figure 2 This is a structural diagram of the subspace-driven convolutional Mamba brain tumor classification network in this invention.
[0021] Figure 3 This is a structural diagram of the training and inference process of the diffusion segmentation model in this invention.
[0022] Figure 4 This is a structural diagram of adversarial contrastive learning in this invention.
[0023] Figure 5 This is a schematic diagram of the automatic brain tumor image segmentation system based on diffusion adversarial contrastive learning of the present invention.
[0024] Figure 6 This is a structural block diagram of the brain tumor image automatic segmentation device based on diffusion adversarial contrastive learning according to the present invention. Detailed Implementation
[0025] Before detailing any embodiment of the invention, it should be understood that the invention, in its application, is not limited to the details of the construction and arrangement of the components set forth in the following description or illustrated in the following figures. The invention can have other embodiments and can be practiced or carried out in various ways. Furthermore, it should be understood that the wording and terminology used herein are for descriptive purposes and should not be considered limiting. The use of “comprising” or “having” and variations thereof in this invention is intended to cover the items set forth below and their equivalents, as well as any additional items. Unless otherwise specified or limited, the terms “installation,” “connection,” “support,” and “linkage,” and variations thereof are used broadly and cover both direct and indirect installation, connection, support, and linking. Moreover, “connection” and “linkage” are not limited to physical or mechanical connections or links.
[0026] Furthermore, firstly, in the disclosure of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting this invention. Secondly, the term "a" should be understood as "at least one" or "one or more," that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple. The term "a" should not be construed as a limitation on the quantity.
[0027] To address the problems existing in current brain tumor image segmentation technologies, this invention proposes an automatic brain tumor image segmentation method and system based on diffusion adversarial contrastive learning. This invention uses a subspace-driven convolutional Mamba brain tumor classification network to distinguish between healthy and tumor brain images, providing prior knowledge. Then, diverse pseudo-tumors are injected into healthy brain images through shape and intensity simulation, generating pseudo-labels. Next, a diffusion segmentation model is used to generate a prediction mask, providing initial predictions on the real image. Finally, adversarial and contrastive learning are combined to strengthen structural consistency and optimize segmentation. This invention not only overcomes the shortcomings of traditional brain tumor image segmentation methods that rely on manual annotation, but also achieves high accuracy and robustness in brain tumor image segmentation under unsupervised conditions, possessing significant theoretical and clinical application value.
[0028] Figure 1 A flowchart of the automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning of the present invention is shown. Figure 1 As shown, the automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning of the present invention includes the following steps: S1: Brain imaging classification.
[0029] The 3D magnetic resonance brain structural images are decomposed into subspaces and then feature extracted using a convolutional Mamba module to classify healthy brain images from tumor brain images.
[0030] In this invention, a construction is performed as follows: Figure 2 The subspace-driven convolutional Mamba brain tumor classification network shown is used to classify 3D magnetic resonance imaging (MRI) brain structures to obtain classification results for healthy brains and tumor-bearing brains. Specifically, for 3D MRI brain structures, features are extracted through convolutional layers, and a gated weighted learnable subspace decomposition is performed in the feature space. After subspace serialization, the global structural relationships are captured by a convolutional Mamba module. Finally, the features are fused and classified using a classification head to identify healthy brain images and tumor-bearing brain images. Specifically, this includes: S11: Brain structure images of subjects are acquired based on MRI technology to obtain three-dimensional magnetic resonance brain structure images (3D MRI). Then, the acquired three-dimensional magnetic resonance brain structure images (3D MRI) are registered to T1 images (T1-weighted magnetic resonance imaging images) using preprocessing tools, and the skull skin is removed to obtain preprocessed three-dimensional brain images.
[0031] The preprocessed 3D brain images are , This indicates a 3D brain imaging dataset. Represents the first in the dataset One sample data, These represent depth, height, and width, respectively.
[0032] S12: Perform single-layer three-dimensional convolution feature extraction on the three-dimensional brain image to obtain three-dimensional brain structure features, and perform gated weighted learnable subspace decomposition on the feature space of the three-dimensional brain structure features to map the three-dimensional brain structure features to multiple subspaces.
[0033] Specifically, for each three-dimensional brain imaging data Perform single-layer 3D convolutional feature extraction. The convolutional layer consists of... Composed of 3D convolution, BatchNorm (Batch Normalization), and SiLU activation, it can be represented as:
[0034] In the formula, For the extracted features, This represents the number of channels after the convolutional layer. , , These represent the depth, height, and width after the convolutional layer, respectively.
[0035] To further enhance the ability to represent three-dimensional brain structural features, the features... Perform a gated weighted learnable subspace decomposition in the feature space, and decompose the features... Mapped to Subspace.
[0036] That is, through One, depth is , 3D convolution pairs of features Perform a linear mapping and construct K gated matrices using the Sigmoid function. .
[0037]
[0038] Indicates the first The activation level of each subspace at each voxel location. A feature map B is set for the subspace, and a 3D convolution is used to map the features to the subspace feature dimension: , The number of feature channels in the subspace. The gating matrix... In the channel dimension Automatic broadcast multiplication , obtained the Subspace:
[0039] To avoid different subspaces learning gating patterns with the same height, this invention introduces a subspace diversity constraint to suppress the similarity of gating graphs in different subspaces. The subspace loss is as follows:
[0040] in, These are the weighting coefficients. This indicates that only the similarity between different subspaces is compared. express and The spatial inner product, Representing the Euclidean norm, through optimization This allows for the creation of subspaces with different expressive capabilities.
[0041] S13: For any sequence in any direction of any subspace, perform synthesis processing through the convolution Mamba module to obtain the output sequence in that direction of the subspace.
[0042] For any subspace Sequence unfolding and modeling were performed along the depth, height, and width directions respectively to obtain , , respectively representing the first A sequence representation of each subspace in the depth, height, and width directions; , which represents the sequence length.
[0043] like Figure 2 As shown, the convolutional Mamba module Mainly composed of residual branches and Branch structure. For the first... A sequence of arbitrary directions in a subspace One way to construct residual branches: After performing layer normalization, construct residual branches. :
[0044] will be used with The output is multiplied element-wise, preserving the original representation of the subspace and avoiding information loss caused by excessive feature transformation.
[0045] Another route Branches are generated through convolution and Capture global structural relationships. Apply Depth-Wise Convolution to the layer-normalized data and apply the SiLU activation function to obtain a locally enhanced intermediate representation:
[0046] Then, state-space feature extraction is performed. In discrete time, for each time step... The recursive relation of Mamba state space blocks can be expressed as:
[0047]
[0048] Among them, the hidden state is The output is , For sequence step size parameter, It is the identity matrix. This is the learnable state-space parameter matrix. The outputs at each time step are stacked in chronological order to obtain the output sequence for that direction. ; Adding residuals, the final number The output of this direction in each subspace is:
[0049] in, This indicates element-wise multiplication.
[0050] S14: For each subspace, perform global pooling on its output sequence in each direction to obtain the directional features of that subspace. Concatenate the directional features of all subspaces and input the concatenated fused feature vector into a linear classifier to obtain the classification results of healthy brain images and tumor brain images.
[0051] To obtain an overall feature representation, for each subspace The output sequences in the depth, height and width directions are respectively. (Right now and Global pooling is then performed. Subsequently, the directional features from all subspaces are concatenated, and the resulting fused feature vector is input into a linear classifier (classification head) to obtain the predicted probabilities. : , , ), Among them, the probability of the prediction result Brain images close to 0 are considered healthy. Brain imaging at approximately 1 hour is for tumors. The classification result is used for subsequent pseudo-label construction. The linear classifier loss can be written as:
[0052] in, Indicates sample size. Indicates the first The true category of each sample (0: healthy brain image, 1: tumor brain image). Indicates the first The probability of tumor brain prediction output by the linear classifier for each sample.
[0053] The total loss of the subspace-driven convolutional Mamba brain tumor classification network is: = + , That is, the total loss of the subspace-driven convolutional Mamba brain tumor classification network. Loss optimization by subspace With classifier loss Together they constitute a single entity, and the two are jointly optimized through weighted summation. The adjustment coefficients are used. Finally, when training converges, the optimal parameters of the subspace-driven convolutional Mamba brain tumor classification network are preserved as the final model, which can be used to classify tumor brain images and healthy brain images.
[0054] S2: Initial training data construction.
[0055] For the healthy brain images, a tumor morphology with brain tumor characteristics is created through three-dimensional geometric modeling, and combined with intensity simulation imaging algorithms, synthetic data that conforms to the structural characteristics of real brain tumors is synthesized. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels.
[0056] Specifically, the healthy brain images identified in step S1 Based on this, for each healthy brain image Synthetic magnetic resonance images of brain tumors were obtained by using three-dimensional geometric modeling and intensity simulation imaging algorithms. and its corresponding synthetic brain tumor mask pseudo-label Specifically, it includes: S21: Use a 3D geodesic polyhedron to generate a synthetic tumor shape, and obtain the initial shape of the 3D geodesic polyhedron. The initial shape of the three-dimensional geodesic polyhedron is obtained by using Simplex noise. Perturbation is performed to obtain perturbed polyhedra with non-smooth surfaces and diverse shapes. .
[0057] Specifically, the healthy brain imaging dataset is Represents the first in the dataset Sample data. Brain tissue mask obtained through skull dissection The goal is to constrain brain tumors to grow only within the brain parenchyma. First, a synthetic tumor shape is generated using a three-dimensional geodesic polyhedron, with an icosahedron as the initial geometry, subdivided along each edge. The subdivision vertices are then projected onto a parametric sphere of unit radius centered at the origin to obtain the initial shape of the three-dimensional geodesic polyhedron. Subsequently, simplex noise was used to model the initial three-dimensional geodesic polyhedron. By perturbing, perturbed polyhedra with non-smooth surfaces and diverse shapes are obtained. This method is used to enhance the irregularity and shape diversity of tumor boundaries. The target volume is randomly sampled in a uniform distribution across the overall scale of the tumor voxel shape, and the perturbation polyhedron is then analyzed accordingly. Perform global scaling to match its volume to 2×2×2. ~4×4×4 Interval.
[0058] S22: For the disturbed polyhedron Applying a three-dimensional Gaussian filter yields a soft tumor mask. Using the healthy brain image as a reference, the signal distribution of the brain tumor structural region is constructed through a three-dimensional Gaussian blur operator and an intensity scaling factor, and then the soft tumor is masked. The image is then fused with a buffer layer to generate the synthetic brain tumor magnetic resonance image.
[0059] Because tumor boundaries in real MRI typically exhibit partial volume effects and blurred transitions, rather than being hard-cut edges, directly applying a mask to the tumor onto a healthy brain would produce unnatural, sharp boundaries and strong artifacts, learning synthetic traces rather than brain tumor characteristics. Therefore, it is necessary to construct a soft mask with a buffer zone to allow the tumor to blend smoothly with the background at the edges.
[0060] For perturbation polyhedrons Applying a three-dimensional Gaussian filter with a kernel size of approximately 1 mm yields values ranging from... soft tumor mask This is used to achieve a smooth blend between tumor and normal tissue. Because brain tumors typically appear as abnormal enhancement or attenuation of localized brain tissue signals on MRI, rather than as a superposition of exogenous structures, a soft tumor mask is used in intensity modeling. Under spatial constraints, the signal of the brain tumor region is generated from the original tumor-free brain image through intensity transformation. That is, using the original tumor-free brain image... As a benchmark, using the three-dimensional Gaussian blur operator With intensity scaling factor Construct the signal distribution in the structural regions of a brain tumor. Then... and Buffer layer fusion is performed to generate synthetic magnetic resonance images of brain tumors with continuous boundaries and true signal characteristics. .
[0061] S13: Masking soft tumors By threshold Binarization yields synthetic brain tumor mask pseudo-labels. , To mask soft tumors The threshold for binarization into hard segmentation can be set to [value]. .
[0062] Therefore, the synthetic data includes synthetic magnetic resonance images of brain tumors. and its corresponding synthetic brain tumor mask pseudo-label .
[0063] S3: Initial training of the diffusion segmentation model.
[0064] Using the synthesized data as training data, the synthesized brain tumor magnetic resonance images are... As input, the synthetic brain tumor mask pseudo-label As a supervisory signal, the diffusion segmentation model is initially trained.
[0065] like Figure 3 As shown, in this invention, brain tumor features can be extracted through training and inference of a diffusion segmentation model. The diffusion segmentation model includes: a forward noise-adding module, used to gradually add Gaussian noise to the synthetic tumor mask pseudo-label at each time step to obtain noisy pseudo-labels; a boundary encoder, used to perform convolution and downsampling processing on the synthetic brain tumor MRI image to extract the boundary features of the brain tumor region; a denoising encoder, used to receive the synthetic brain tumor MRI image, boundary features, noisy pseudo-labels, and time steps, and extract denoised features; a cross-attention feature fusion module, used to fuse the boundary features and denoised features to obtain a fused feature map; a boundary decoder, used to upsample the boundary features to restore spatial resolution and output a boundary prediction map; and a denoising decoder, used to upsample and reconstruct the fused feature map step by step, outputting the corresponding segmentation mask under the constraints of each time step. At that time, the final brain tumor segmentation results were obtained.
[0066] Specifically, the synthetic brain tumor magnetic resonance image dataset is as follows: Represents the first in the dataset One sample data point; the synthetic brain tumor mask pseudo-label dataset is... Represents the first in the dataset Sample data.
[0067] In the forward noise-adding module, the synthetic brain tumor mask pseudo-label synthesized by the algorithm in step S2 is... As a monitoring signal, in Gaussian noise is gradually added to the synthetic brain tumor mask pseudo-labels at each time step. In the process, noisy labels are obtained. .
[0068] The forward noise addition process can be formalized as a diffusion stochastic differential equation:
[0069] In the formula, For noise dispatch coefficient, To balance the drift term, This is standard Brownian motion. It can be written in discretized form as:
[0070] In the formula, These are the corresponding noisy tags, with continuous... Gaussian noise.
[0071] Denoising module in diffusion segmentation model This module, Denoise, is used to fuse original image conditions, boundary features, time-step information, and noisy pseudo-labels during the diffusion reverse process. It predicts the noise component at the current time step or the segmentation mask from the previous moment, thereby gradually restoring the true segmentation structure of the brain tumor. Boundary encoder Noise reduction encoder Feature fusion module and noise reduction decoder composition.
[0072] Among them, boundary encoder Composed of 4 layers of 3D CNN, used for... Convolution and downsampling are performed to extract the boundary features of the brain tumor region. , The number of feature channels output by the boundary encoder. The boundary decoder and... The structure is symmetrical and consists of four layers of 3D CNN, used for edge feature processing. Upsampling is used to restore spatial resolution and output a boundary prediction map. .
[0073] Synthetic brain tumor mask pseudo-labels Perform 3D morphological operations and distance transformations to calculate boundary labels. This is used as a monitoring signal for the boundary branch. The boundary branch loss function is: , ; In the formula This represents the Frobenius inner product.
[0074] Denoising encoder It consists of 4 layers of 3D CNN and is used for receiving... Boundary features Noisy tags With time step Extracting denoising features , This represents the number of feature channels output by the denoising encoder.
[0075] Based on the extracted boundary features , and denoising features Constructing a cross-attention feature fusion module This method is used to fuse boundary features with denoised features, enabling the diffusion segmentation model to be guided by the spatial boundary region of the brain tumor during the reverse denoising process, thereby improving the structural consistency and boundary accuracy of the segmentation results. The fused features are then processed by a denoising decoder consisting of four layers of 3D CNN. Upsample and reconstruct step by step, and output the corresponding segmentation mask under the conditional constraints of each time step.
[0076] Denoising features in three-dimensional space Depend on Individual character traits. Indicates the voxel positions constructed from linear layers. Location encoding is used to introduce spatial location information during voxel-level feature fusion and attention computation, enabling the model to distinguish voxel features at different spatial locations.
[0077] Subsequently, using the denoised features output by the denoising encoder as the query and the boundary features output by the boundary encoder as the key and value, a cross-attention mechanism is constructed, along with voxel locations. The fusion feature at the location is defined as: , In the formula, for ; Represents the position of any voxel , and its corresponding channel vector; Represents the position of any voxel , and its corresponding channel vector; Indicates a fixed voxel position All corresponding boundary voxels; It is a learnable linear mapping matrix; This represents the projection dimension of the key / query vector in the attention process. After calculation over all voxel locations, the output feature will be used. The original three-dimensional spatial positions are backfilled to form a three-dimensional fusion feature map that retains the original spatial structure. The fusion process emphasizes boundary information in the spatial dimension and enhances the feature response of the tumor region in the channel dimension.
[0078] The output of the cross-attention feature fusion module is a 3D fused feature map. Input Denoising Decoder , At the current time step Above, based on the 3D fusion feature map For the noisy mask of the previous moment Prediction:
[0079] By performing a denoising prediction process at multiple time steps, a brain tumor segmentation mask that is structurally consistent can be gradually recovered from random noise. At each time step... At that time, the final brain tumor segmentation results were obtained. .
[0080] The denoising process is modeled in the form of conditional probabilities as follows:
[0081] The network learns the score function This approximates the gradient of the true data distribution, thus guiding the direction of denoising. The inverse stochastic differential equation based on the score can be written as:
[0082] In the formula, This represents inverse Brownian noise.
[0083] In the diffusion segmentation model inference, the pseudo-labels from the previous time step... Obtained from the following formula:
[0084] Therefore, in the reasoning process, with Guide the backsampling process. When At that time, the final prediction result is obtained:
[0085] For diffusion segmentation model, This is a segmentation mask for brain tumors.
[0086] After initial training, such as Figure 4As shown, adversarial contrastive learning is used to optimize the performance of the diffusion segmentation model. Furthermore, as... Figure 4 As shown, it includes: S4: Generation of mask labels for real brain tumor segmentation.
[0087] Real patient brain tumor images are input into a pre-trained diffusion segmentation model, which then outputs a real brain tumor segmentation mask label. .
[0088] S5: Generates the final new brain tumor mask label based on adversarial learning.
[0089] Based on real patient brain tumor images, newly generated brain tumor mask labels are obtained through a generator that uses random noise and performs adversarial learning. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. .
[0090] S6: Comparative learning.
[0091] The generator output will be used to generate new brain tumor mask labels. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Use them as negative samples for comparative learning.
[0092] S7: Brain tumor image segmentation.
[0093] The diffusion segmentation model is trained by using the weighted sum of the adversarial learning and contrastive learning losses as the final training objective. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model. The final model is then used to automatically segment the tumor region of a brain tumor image.
[0094] Specifically, such as Figure 4 As shown, the generator for adversarial learning is updated iteratively. With discriminator Parameters that enable the generator Gradually improve the accuracy of the generated brain tumor labels, while the discriminator This will continuously enhance the segmentation mask and generator for real brain tumors. The discriminative power of the newly generated mask. When training progresses to the point where the discriminator struggles to effectively distinguish between the real brain tumor segmentation mask and the generated one. When generating a new mask, the generator outputs a brain tumor mask label, which is considered a pseudo-label with high confidence. This generated mask label is then combined with a healthy brain MRI image to construct a new synthetic sample, which is input into a diffusion segmentation model for segmentation prediction. Based on this, a contrastive learning process is triggered only for generated samples that pass the discriminator's authenticity check. This process calculates contrastive loss by constructing anchor samples, positive samples, and negative samples to further constrain the consistency and discriminativity of segmentation features in the semantic space.
[0095] First, we introduce adversarial learning, through the generator... With discriminator Adversarial training was used to obtain labels that better reflect the distribution of real brain tumors; both the generator and discriminator were constructed using CNNs. Real patient brain tumor image dataset. For the first in the dataset Individual sample data; real patient brain tumor images processed by diffusion segmentation model This yields the actual brain tumor segmentation result, i.e., the actual image segmentation mask. .
[0096] With random sampling noise Through generator Newly generated brain tumor mask tags were obtained. It is used to simulate the distribution of real tumor structures.
[0097] For each sample and Discriminator Segmentation mask using real image New brain tumor mask labels generated by the generator output Adversarial training to drive the generator The output is a mask that more closely resembles the actual distribution of brain tumors. The discriminator loss is defined as:
[0098] In the formula, This represents the feature representation of the input mask label. These are gradient regularization weights. , , Gradient penalty weights directly constrain the discriminator. log odds The gradient norm of the input is used to obtain a smoother and more stable discrimination boundary.
[0099] The generator loss is defined as: , The first discriminator The characteristics of the layer are , For feature matching weights, To smooth out the weights, the loss design can improve the detail fidelity and boundary smoothness of the generated labels, making the generated tumor interior more natural and reducing noise.
[0100] In the discriminator Unable to distinguish and When true or false, the generator outputs And it introduces comparative learning.
[0101] Generator Output mask labels With healthy MRI images After splicing, input into the diffusion segmentation model A new synthetic brain tumor magnetic resonance image segmentation mask was obtained after segmentation using a diffusion segmentation model. . As an anchor point, As a positive sample Similarity calculations are performed using negative samples for comparative learning.
[0102] Specifically, assuming a diffusion segmentation model The arbitrary brain tumor mask obtained by segmentation is First, 3D convolution and ReLU are used to obtain voxel-level features. To obtain the global embedding for contrastive learning, for Perform feature mapping:
[0103] in, The weight matrix is for a fully connected network. and It is a bias vector. This is the final embedding dimension. Euclidean normalization is then performed to obtain the unit vector embedding. To obtain high-dimensional similarity between masks, joint generalized cosine similarity can be used, which describes the geometric collinearity of multiple embedding vectors through the determinant of the Gram matrix:
[0104] In the formula, Used to characterize embedding vectors Angle relationships in higher-dimensional space; These are placeholders for the current pair of vectors (i.e., anchor point and positive sample; anchor point and negative sample). Therefore, the first The positive similarity of each sample pair is Negative similarity is . , Indicates the first Features of each anchor point Indicates the relationship with the first Features of the positive samples corresponding to each anchor point. Indicates the relationship with the first Each anchor point selects a negative sample feature. Different temperatures are used for positive and negative samples. Constructing an InfoNCE-type contrast loss:
[0105] and , Indicates batch, Indicates the first An index of anchor points within a batch.
[0106] The ultimate training objective of the diffusion segmentation model is a weighted sum of the adversarial and contrastive losses:
[0107] in, The balance coefficient is used. The optimization objective of the discriminator is to minimize the individual coefficients. Finally, when training converges, the optimal parameters of the diffusion segmentation model are saved as the final model. This model can be directly used to automate the segmentation of tumor regions in brain tumor patients.
[0108] This invention uses a subspace-driven Mamba classification network to distinguish between healthy and tumor-bearing brain images, providing prior knowledge. Then, diverse pseudo-tumors are injected into healthy brains through shape and intensity simulation, generating pseudo-labels. Next, a diffusion segmentation model is used to generate a prediction mask, providing initial predictions on the real image. Finally, adversarial and contrastive learning are combined to strengthen structural consistency and optimize segmentation. This invention not only overcomes the shortcomings of traditional brain tumor image segmentation methods that rely on manual annotation, but also achieves high accuracy and robustness in brain tumor image segmentation under unsupervised conditions, possessing significant theoretical and clinical application value.
[0109] Figure 5 A schematic diagram of the automatic brain tumor image segmentation system based on diffusion adversarial contrastive learning of the present invention is shown. Figure 5As shown, the automatic brain tumor image segmentation system based on diffusion adversarial contrastive learning of the present invention includes: 1. Brain imaging classification module.
[0110] The brain image classification module is used to extract features from three-dimensional magnetic resonance brain structural images after subspace decomposition, in order to classify healthy brain images and tumor brain images.
[0111] 2. Preliminary training data construction module.
[0112] The preliminary training data construction module is used to create tumor morphology with brain tumor characteristics from the healthy brain images through three-dimensional geometric modeling, and to synthesize synthetic data that conforms to the structural characteristics of real brain tumors by combining intensity simulation imaging algorithms. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels.
[0113] 3. Preliminary training module for the diffusion segmentation model.
[0114] The preliminary training module of the diffusion segmentation model is used to perform preliminary training on the diffusion segmentation model by using the synthetic data as training data, the synthetic brain tumor magnetic resonance image as input, and the synthetic brain tumor mask pseudo-label as supervision signal.
[0115] 4. Real brain tumor segmentation mask label generation module.
[0116] The real brain tumor segmentation mask label generation module is used to input real patient brain tumor images into the pre-trained diffusion segmentation model, and the pre-trained diffusion segmentation model outputs real brain tumor segmentation mask labels. .
[0117] 5. A module for generating new brain tumor mask labels based on adversarial learning.
[0118] The adversarial learning-based module for generating new brain tumor mask labels is used to generate new brain tumor mask labels based on real patient brain tumor images, through a generator that processes random noise using adversarial learning. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. .
[0119] 6. Comparative learning module.
[0120] The contrastive learning module is used to generate the final new brain tumor mask labels output by the generator. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Use them as negative samples for comparative learning.
[0121] 7. Brain tumor image segmentation module.
[0122] The brain tumor image segmentation module is used to train the diffusion segmentation model by using the weighted sum of two losses, adversarial learning and contrastive learning, as the final training target. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model, which is then used to automatically segment the tumor region of the brain tumor image.
[0123] Furthermore, this invention also provides an automatic brain tumor image segmentation device based on diffusion adversarial contrastive learning. For example... Figure 6 As shown, the brain tumor image automatic segmentation device based on diffusion adversarial contrastive learning of the present invention includes: a memory 11 for storing one or more programs; one or more processors 12; when the one or more programs are executed by the one or more processors 12, the one or more processors 12 implement the brain tumor image automatic segmentation method based on diffusion adversarial contrastive learning of the present invention.
[0124] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the brain tumor image automatic segmentation method based on diffusion adversarial contrastive learning in the present invention.
[0125] The computer-readable storage medium includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this invention, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0126] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0127] The steps of the methods or algorithms described in conjunction with the embodiments disclosed in this invention can be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Those skilled in the art can modify or make equivalent substitutions to the technical solutions of the present invention based on the concept of the present invention, without departing from the essence and scope of the technical solutions of the present invention.
Claims
1. An automatic segmentation method for brain tumor images based on diffusion adversarial contrastive learning, characterized in that, Includes the following steps: S1: The 3D magnetic resonance brain structure images are decomposed into subspaces and then the convolutional Mamba module is used to extract features to classify healthy brain images and tumor brain images. S2: For the healthy brain image, a tumor morphology with brain tumor characteristics is created by three-dimensional geometric modeling, and synthetic data that conforms to the structural characteristics of real brain tumors is synthesized by combining intensity simulation imaging algorithm. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels. S3: Using the synthetic data as training data, the synthetic brain tumor magnetic resonance image as input, and the synthetic brain tumor mask pseudo-label as supervision signal, the diffusion segmentation model is initially trained. S4: Input the real patient's brain tumor image into the pre-trained diffusion segmentation model, and the pre-trained diffusion segmentation model outputs the real brain tumor segmentation mask label. ; S5: Based on real patient brain tumor images, newly generated brain tumor mask labels are obtained through a generator that uses random noise and performs adversarial learning. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. ; S6: Generate the final new brain tumor mask label output by the generator. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Used as negative samples for comparative learning; S7: The diffusion segmentation model is trained by using the weighted sum of the adversarial learning and contrastive learning losses as the final training target. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model. The final model is then used to automatically segment the tumor region of the brain tumor image.
2. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 1, characterized in that, Step S1 specifically includes: S11: Register the three-dimensional magnetic resonance brain structure image to the T1-weighted magnetic resonance imaging image and remove the skull and scalp to obtain the preprocessed three-dimensional brain image. S12: Perform single-layer three-dimensional convolution feature extraction on the three-dimensional brain image to obtain three-dimensional brain structure features, and perform gated weighted learnable subspace decomposition on the feature space of the three-dimensional brain structure features to map the three-dimensional brain structure features to multiple subspaces. S13: For any sequence in any direction within any subspace, perform comprehensive processing using the convolutional Mamba module to obtain the output sequence in that direction within that subspace; S14: For each subspace, perform global pooling on its output sequence in each direction to obtain the directional features of that subspace. Concatenate the directional features of all subspaces and input the concatenated fused feature vector into a linear classifier to obtain the classification results of healthy brain images and tumor brain images.
3. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 2, characterized in that, Step S13 specifically includes: S131: For any sequence in any direction within any subspace, the residual branch of the convolutional Mamba module, after layer normalization, constructs the residual... ; S132: For any sequence of directions in any subspace, the convolutional Mamba module... Branches are generated through convolution and By capturing global structural relationships, applying Depth-Wise Convolution after layer normalization, and then applying the SiLU activation function, a locally enhanced intermediate representation is obtained. ; S133: Utilizing the intermediate representation with the aforementioned local enhancement In discrete time, the output at each time step is obtained by recursively determining the state space blocks based on the convolutional Mamba module, and the outputs at each time step are stacked in chronological order to obtain the output sequence in that direction. ; S134: In the output sequence Add the aforementioned residual This yields the final output sequence in that direction of the subspace.
4. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 1, characterized in that, Step S2 specifically includes: S21: Use a 3D geodesic polyhedron to generate a synthetic tumor shape, and obtain the initial shape of the 3D geodesic polyhedron. The initial shape of the three-dimensional geodesic polyhedron is obtained by using Simplex noise. Perturbation is performed to obtain perturbed polyhedra with non-smooth surfaces and diverse shapes. ; S22: For the disturbed polyhedron Applying a three-dimensional Gaussian filter yields a soft tumor mask. Using the healthy brain image as a reference, the signal distribution of the brain tumor structural region is constructed through a three-dimensional Gaussian blur operator and an intensity scaling factor, and then the soft tumor is masked. The image is then fused with the healthy brain image using a buffer layer to generate the synthetic brain tumor magnetic resonance image. S23: Mask the soft tumor The corresponding synthetic tumor mask pseudo-labels are obtained by threshold binarization.
5. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 1, characterized in that, The diffusion segmentation model in step S3 includes: A forward noise-adding module is used to gradually add Gaussian noise to the synthesized tumor mask pseudo-labels over time steps to obtain noisy pseudo-labels; A boundary encoder is used to perform convolution and downsampling processing on the synthetic brain tumor magnetic resonance image, thereby extracting the boundary features of the brain tumor region; A denoising encoder is used to receive the synthetic brain tumor magnetic resonance image, boundary features, noisy pseudo-labels and time steps, and extract denoising features; The cross-attention feature fusion module is used to fuse the boundary features and the denoised features to obtain a fused feature map; A boundary decoder is used to upsample the boundary features to restore spatial resolution and output a boundary prediction map; A denoising decoder is used to upsample and reconstruct the fused feature map step by step, and output the corresponding segmentation mask under the constraints of each time step. At that time, the final brain tumor segmentation results were obtained.
6. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 5, characterized in that, In the cross-attention feature fusion module, the denoised features are used as queries, and the boundary features are used as keys and values to construct cross-attention.
7. The automatic brain tumor image segmentation method based on diffusion adversarial contrastive learning according to claim 1, characterized in that, In step S7, the loss of the diffusion segmentation model for: , Always To counteract the loss of the learned generator, To compare the learning loss, and This is the balance coefficient.
8. An automatic brain tumor image segmentation system based on diffusion adversarial contrastive learning, characterized in that, include: The brain imaging classification module is used to extract features from three-dimensional magnetic resonance brain structural images after subspace decomposition, in order to classify healthy brain images and tumor brain images. The initial training data construction module is used to create tumor morphology with brain tumor characteristics from the healthy brain images through three-dimensional geometric modeling, and to synthesize synthetic data that conforms to the structural characteristics of real brain tumors by combining intensity simulation imaging algorithms. The synthetic data includes synthetic brain tumor magnetic resonance images and their corresponding synthetic brain tumor mask pseudo-labels. The diffusion segmentation model preliminary training module is used to perform preliminary training on the diffusion segmentation model by using the synthetic data as training data, taking the synthetic brain tumor magnetic resonance image as input, and the synthetic brain tumor mask pseudo-label as supervision signal. A real brain tumor segmentation mask label generation module is used to input real patient brain tumor images into a pre-trained diffusion segmentation model, and the pre-trained diffusion segmentation model outputs real brain tumor segmentation mask labels. ; The module for generating new brain tumor mask labels based on adversarial learning is used to generate new brain tumor mask labels from real patient brain tumor images by passing random noise through an adversarial learning generator. The adversarial learning discriminator segments real brain tumors using mask labels. With newly generated brain tumor mask tags Adversarial training drives the generator to output mask labels that more closely resemble the actual distribution of brain tumors, which the discriminator cannot distinguish as real brain tumor segmentation mask labels. With newly generated brain tumor mask tags When determining whether the result is true or false, the generator outputs the final newly generated brain tumor mask label. ; The contrastive learning module is used to convert the final newly generated brain tumor mask labels output by the generator. After being stitched together with a healthy 3D magnetic resonance imaging (MRI) image of the brain structure, the image is input into a pre-trained diffusion segmentation model to obtain a newly synthesized MRI image segmentation mask for brain tumors. ,Will As an anchor point, As a positive sample Used as negative samples for comparative learning; The brain tumor image segmentation module is used to train the diffusion segmentation model by using the weighted sum of two losses, adversarial learning and contrastive learning, as the final training target. When the training converges, the optimal parameters of the diffusion segmentation model are saved to obtain the final model, which is then used to automatically segment the tumor region of the brain tumor image.
9. An automatic brain tumor image segmentation device based on diffusion adversarial contrastive learning, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the brain tumor image automatic segmentation method based on diffusion adversarial contrastive learning as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the automatic segmentation method for brain tumor images based on diffusion adversarial contrastive learning as described in any one of claims 1-7.