Zero sample cross-domain diffusion segmentation method based on anatomical structure probability transmission guidance
By constructing a dual-stream collaborative learning framework and an anatomical structure probability transfer-guided method, the performance degradation problem of cross-domain medical image segmentation models across different devices and modalities was solved, achieving zero-shot cross-domain segmentation, improving segmentation accuracy and robustness, and adapting to the needs of different clinical scenarios.
Patent Information
- Application Number
- CN202511207035.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-08-27
AI Technical Summary
Traditional medical image segmentation models suffer from a sharp decline in performance in cross-domain scenarios, and existing methods cannot achieve true zero-shot generalization, especially in applications across different devices and modalities.
We employ a zero-shot cross-domain diffusion segmentation method guided by anatomical structure probabilistic transfer. By constructing a two-stream collaborative learning framework, we utilize a shared structure encoder, anatomical decoder, and image appearance decoder, combined with anatomical loss and structural loss for training, to achieve zero-shot inference and hierarchical probabilistic structure transfer, avoiding reliance on target domain data.
It achieves zero-sample cross-domain segmentation, reduces data acquisition and model iteration costs, improves segmentation accuracy and structural fidelity, enhances robustness and interpretability, and adapts to the needs of different clinical scenarios.
Smart Images

Figure CN121121104A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing, and more particularly to a zero-shot cross-domain diffusion segmentation method based on anatomical structure probability transmission guidance. BACKGROUND
[0002] Medical images have significant appearance differences between different devices, protocols and modalities (such as CT, MRI, PET, etc.), which leads to a sharp decline in the performance of traditional supervised learning-based segmentation models in cross-domain scenarios. Existing methods such as unsupervised domain adaptation (UDA) and image style transfer rely on target domain data or introduce structural distortion, and cannot achieve true zero-shot generalization.
[0003] Based on this, the present application proposes a zero-shot cross-domain diffusion segmentation method based on anatomical structure probability transmission guidance to solve the above problems. SUMMARY
[0004] In order to overcome the above defects of the prior art, the present application provides a zero-shot cross-domain diffusion segmentation method based on anatomical structure probability transmission guidance to solve the problems existing in the above background art.
[0005] The present application provides the following technical scheme: a zero-shot cross-domain diffusion segmentation method based on anatomical structure probability transmission guidance, comprising the following steps:
[0006] S1. Construct a dual-flow collaborative learning framework: design a noise prediction network containing a shared structure encoder, an anatomical decoder and an image appearance decoder, control the flow of noisy data to the corresponding decoder through a flow selector, wherein the shared structure encoder is used to map the input noisy data to multi-scale latent features, the anatomical decoder is used to reconstruct the anatomical structure and predict the mask noise from the latent features, and the image appearance decoder is used to reconstruct the image texture intensity and predict the image noise from the latent features;
[0007] S2. Train the anatomical prior and structure perception model: use the source domain dataset for dual-flow collaborative training, including generating noisy data by adding noise to the source domain image and segmentation mask, calculating the anatomical loss to learn the unconditioned segmentation mask generation prior through the anatomical prior learning flow, calculating the structure loss to force the shared structure encoder to learn the modality-independent structure information through the structure perception learning flow, and optimizing the network parameters based on the weighted sum of the anatomical loss and the structure loss;
[0008] S3. Zero-shot inference and hierarchical probability structure transmission: For unknown target domain images, a dynamic guided back-diffusion process is performed, including initializing a pure noise mask and setting a diffusion time step, adding noise to the target image to match the current time step noise level, extracting multi-scale structural features of the target image and anatomical structure features of the noisy mask in a double-channel parallel manner, measuring the multi-level feature difference using a probability distribution distance metric and constructing a guiding loss, generating a structure transmission force based on the guiding loss gradient, updating the noisy mask to the previous time step by combining the unguided noise prediction and the structure transmission force, and after completing all time steps, the generated result is post-processed to obtain a segmentation mask.
[0009] As a further scheme of the present application: in step S1, the noise prediction network is a network architecture based on U-Net, the shared structure encoder corresponds to the down-sampling path of U-Net, the anatomical decoder and the image appearance decoder correspond to the up-sampling path of U-Net, and the output layer parameters of the anatomical decoder and the image appearance decoder are independently set.
[0010] As a further scheme of the present application: in step S2, the process of adding noise to the source domain image and the segmentation mask follows the DDPM forward diffusion process, specifically:
[0011]
[0012] Wherein, m t and x t are the noisy mask and the noisy image respectively, m0 and x0 are the original segmentation mask and the source domain image respectively, is a noise scheduling coefficient, ε m and ε x are Gaussian noise.
[0013] As a further scheme of the present application: in step S2, the calculation formula of the anatomical loss is:
[0014] L anatomy (ψ, θ) = E[w(t) · ||ε m - ∈ Θ (m t , t, c = 0) || 2 ]
[0015] Wherein, ψ is the shared structure encoder parameter, θ is the anatomical decoder parameter, w(t) is the loss weight function, E is the expectation operator, ε m is the original Gaussian noise, ∈ Θ is the output of the noise prediction network, m t is the noisy mask, t is the time step, c = 0 represents the anatomical prior learning flow, and ||·|| represents the calculation of mean square error. 2
[0016] As a further scheme of the present application: in step S2, the calculation formula of the structure loss is:
[0017] L structure (ψ, φ) = E[w(t) · ||ε x -∈ Θ (xt, t, c = 1)| 2 ]
[0018] Wherein, φ is an image appearance decoder parameter, ε x is an original Gaussian noise, x t is a noisy image, and c = 1 represents a structure perception learning flow.
[0019] As a further scheme of the present application: in step S3, the double-path parallel feature extraction specifically includes: extracting a multi-scale structure feature set from a noisy target image through an image appearance decoder intermediate layer extracting a multi-scale anatomical structure feature set from a current noisy mask through an anatomical decoder intermediate layer
[0020] As a further scheme of the present application: in step S3, the probability distribution distance is a slice Wasserstein distance (SWD), which is used to measure the distribution difference of the corresponding hierarchical feature maps, and the calculation formula is:
[0021]
[0022] Wherein, and are the feature maps of the corresponding levels, ω is a random projection direction, S C-1 is a C-1-dimensional unit hypersphere, g j and f k are flattened feature vectors, and W2 is a Wasserstein-2 distance.
[0023] As a further scheme of the present application: in step S3, the guidance loss is a weighted sum of the multi-level probability distribution distances, and the calculation formula is:
[0024]
[0025] Wherein, w i is a level weight, k is the number of feature levels, and y0 is a target domain image.
[0026] As a further scheme of the present application: in step S3, the structure transmission force is the gradient of the guidance loss with respect to the current noisy mask, that is:
[0027] The technical effects and advantages of the present application are:
[0028] (1) Achieve zero-shot cross-domain segmentation, through the "prior learning and inference guided separation" paradigm, without target domain data, it can be directly applied to unknown modalities or devices, greatly reducing the data collection, labeling and model iteration cost, and improving the clinical deployment scalability.
[0029] (2) Improve the accuracy and structure fidelity of unknown domain segmentation, dual-flow collaborative learning decouples appearance and structure, H-PST mechanism guides through multi-scale feature distribution to avoid artifact accumulation and alignment failure, and ensures high accuracy and anatomical topology and boundary fidelity.
[0030] (3) Enhance robustness and interpretability, H-PST is based on a differentiable optimal transport metric, which is not sensitive to modal noise; the segmentation process is decomposed into "prior generation-structure guidance", and the decision is interpretable, which facilitates model debugging.
[0031] (4) Provide a flexible and controllable inference process, H-PST contains adjustable parameters such as guidance strength and hierarchical weight, which can balance anatomical rationality and target adhesion, and adapt to clinical scene needs such as lesions. BRIEF DESCRIPTION OF DRAWINGS
[0032] The present application will be further described below in conjunction with the accompanying drawings.
[0033] Figure 1 is the overall architecture flowchart of the present application;
[0034] Figure 2 is the dual-flow collaborative learning framework flowchart;
[0035] Figure 3 is the hierarchical probabilistic structure transmission guidance flowchart;
[0036] Figure 4 is the zero-shot inference flowchart;
[0037] Figure 5 is the zero-shot brain tumor cross-modality segmentation result schematic diagram in Example 2;
[0038] Figure 6 is the zero-shot DSA segmentation result schematic diagram in Example 3. DETAILED DESCRIPTION
[0039] The technical solutions of the present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The present embodiment is only used to explain the present application, and is not limited to the protection scope of the present application.
[0040] Example 1
[0041] This embodiment is used to explain the technical solutions of the present application in detail:
[0042] Model architecture
[0043] We design a unified, U-Net-based noise prediction network. Θ Its parameter set is Θ. The network contains three core components: a shared structural encoder E... ψ The parameter is ψ. This encoder is responsible for mapping the noisy input data (whether it's an image or a mask) to a series of multi-scale latent features. A dissecting decoder D θ The parameter is θ. This decoder is specifically responsible for reconstructing the anatomical structure from latent features, i.e., predicting the noise added to the clean mask. An image appearance decoder D φ The parameter is φ. This decoder is specifically responsible for reconstructing image texture and intensity from latent features, i.e., predicting the noise added to the clean image. Therefore, the total parameter set is Θ = {ψ, θ, φ}. The network input is a tuple (z... t , t, c), where z t The data is noisy data at time step t, and c∈{0,1} is a binary stream selector used to indicate whether the current stream being processed is an anatomical stream (c=0) or an image stream (c=1). Based on the value of c, the encoder E... ψ The output will be routed to the corresponding decoder D. θ Or D φ .
[0044] Dual-stream collaborative training process
[0045] We utilize the source domain dataset Training is performed, where x i It is a source domain image, m i This corresponds to a multi-class or single-class segmentation mask. The training objective is to simultaneously optimize two parallel denoising tasks. For each training sample (x0, m0):
[0046] We first sample a uniform time step t ~ U({1, ..., T}) and two independent Gaussian noise ε. m , ε x ~N(0,I).
[0047] According to the standard DDPM forward process We generate noisy masks and images:
[0048]
[0049] in These are predefined noise scheduling coefficients. Where m0 and x0 represent the original, noise-free segmentation mask and image, respectively. ε m , ε x It is Gaussian noise sampled from a standard normal distribution, with the same size as the original data. is a pre-defined noise schedule coefficient whose value gradually decreases from close to 1 (t small) to close to 0 (t large) over time steps t
[0050] Next, we compute two parallel losses:
[0051] Anatomy Prior Learning Stream (c = 0): We feed the noisy mask m t into the model, with the goal of predicting the noise ε m This activates only path E ψ → D θ .
[0052]
[0053] The corresponding loss function is the anatomy loss L anatomy , which forces the model to learn a powerful, unconditioned segmentation mask generator p ψ,θ (m):
[0054]
[0055] where w(t) is an optional loss weight function. denotes the expectation over all possible original masks m0, noise ε m and time steps t, i.e., the average loss over the entire training dataset and all noise steps. ||·|| 2 denotes the computation of the mean squared error.
[0056] Structure Perception Learning Stream (c = 1): We feed the noisy image x t into the model, with the goal of predicting the noise ε x This activates both paths E ψ → D φ .
[0057]
[0058] The corresponding loss function is the structure loss L structure , whose core purpose is not to generate high-quality images, but rather to serve as a powerful self-supervised task that forces the shared encoder E ψ and the image decoder D φ to learn modality-agnostic low-level structure information (e.g., edges, contours, region homogeneity, etc.) in the images.
[0059]
[0060] The overall training objective is the weighted sum of these two losses:
[0061] L total (ψ, θ, φ) = L anatomy + λ struct L structure
[0062] We jointly update the entire model parameters Θ by optimizing this total loss. The hyper-parameter λ struct balances the importance of the two tasks. The beauty of this co-training is that, in order to minimize both losses simultaneously, the shared encoder E ψ is forced to learn a more general and decoupled feature representation that can both capture the abstract geometry of anatomical shapes and understand the intrinsic structure of images. Instead of learning that “the liver in this MRI T1 looks like this”, it learns more essential structural descriptions such as “an ellipsoid-shaped object with smooth boundary and uniform texture inside”. This lays a solid foundation for zero-shot generalization.
[0063] Second Part: Zero-shot Inference and Hierarchical Probabilistic Structure Transfer
[0064] When the training is done, we have a powerful anatomical prior generator p ψ,θ (m) and a sharp image structure perceiver p ψ,φ (x). In the inference stage, given an image y0from a completely unknown target domain, our goal is to generate its segmentation mask using p ψ,θ (m). The core challenge here is: how to effectively transfer the information of y0to a generative model that has never seen it before? Our answer is Hierarchical Probabilistic Structure Transfer (H-PST).
[0065] H-PST is a dynamic, step-by-step guidance mechanism during the reverse diffusion process. It does not rely on any fixed conditional input, but rather computes the distance between the “structure distribution” of the intermediate state of the generative process and that of the target image, and uses the gradient of this distance to “sculpt” the generative process in real time.
[0066] 2.1. The Core Mechanism of Dynamic Guidance: H-PST
[0067] The entire inference process is a reverse Markov chain that starts from pure noise m T ~ N(0, I) and gradually denoises to generate m0. In the transition from m t to m t-1 at each time step t, we perform the following delicate guidance steps:
[0068] Step A: Dual-path Parallel Feature Extraction
[0069] At time step t, we have the current mask to be denoised m tAnd the given target image y0.
[0070] Target image structural feature extraction: We first simulate diffusion of the target image y0 to the same time step t to match m t The noise level is crucial for comparing the structures of the two:
[0071]
[0072] Then we will y t The image stream is input into our trained model (i.e., c=1), but we don't care about the final noisy prediction. Instead, we intercept and collect the image decoder D. φ The intermediate series of layers L = {l1, l2, ..., l k The output feature maps of}. These feature maps represent image structural information at different scales and levels of abstraction. We denote this feature set as}
[0073]
[0074] in ExtractFeatures(D) represents the set of multi-scale feature maps extracted from the target image stream at time step t. φ (E ψ (y t ),L) is an abstract representation, meaning from the decoder D of the model φ Extract the activations (i.e., feature maps) of intermediate layers from a specified set of layers L. E ψ (y t This is the result of the encoder's processing of the noisy target image. Importantly, this process takes place within the `torch.no_grad()` context because it only provides the guiding target and does not participate in gradient calculation.
[0075] Nascent anatomical feature extraction: Simultaneously, we extract the current denoising mask m... t The input is fed into the model's anatomical stream (i.e., c = 0). Similarly, we get the input from the anatomical decoder D. θ Intermediate feature maps are extracted from the same level L. These feature maps represent m. t The anatomical structure of nascent that is currently "emerging" at this stage. We denote this feature set as...
[0076]
[0077] in This represents the set of multi-scale feature maps extracted from the generated mask stream at time step t. The structure of this formula is similar to that for extracting image features, but the input is a noisy mask m. t And the features are from the anatomical decoder D θ Extracted from.
[0078] This process requires tracking information about m. t The gradient is because this is the variable we are applying guidance to.
[0079] Step B: Measurement and Transmission of Structural Distribution
[0080] We now have two sets of feature maps at the same semantic level but from different data sources (nascentmask vs. targetimage). Our goal is to make m t The structural distribution is as close as possible to y t The structural distribution of features. We do not use simple L1 or L2 distances because they only compare the mean of features, ignoring their rich intrinsic geometry. We employ the Sliced Wasserstein Distance (SWD), a computationally efficient and differentiable approximation of the optimal transmission distance. For each pair of feature maps corresponding to different levels... and We treat them as two point clouds (each pixel is a C-dimensional feature vector). SWD works by projecting these two high-dimensional distributions onto a large number of random one-dimensional lines and then calculating the mean of the Wasserstein-2 distances between these one-dimensional projected distributions.
[0081]
[0082] in This represents calculating the slice Wasserstein distance between two sets of feature maps $G_{l_i}$ and $F_{l_i}$. j and f k ω is the flattened eigenvector, and ω is the random projection direction. In practice, we sample P projection directions to approximate the expectation. This represents randomly sampling a projection direction ω from a C-1 dimensional unit hypersphere (i.e., the set of all C-dimensional unit vectors). T g j and ω T f k This represents each C-dimensional feature vector g in the feature map. j or f k Projecting onto the one-dimensional direction ω yields a scalar value. W2 represents the calculation of the Wasserstein-2 distance between two one-dimensional distributions (composed of all projected points).
[0083] Step C: Construction of H-PST guided loss and gradient calculation
[0084] We sum the SWD distances of all levels using weighted averages to form the total H-PST guiding loss. The weights are w. i It can be used to control the importance of structures at different scales (for example, focusing more on coarse structures at low resolution in the early stages of denoising, and more on fine boundaries at high resolution in the later stages).
[0085]
[0086] Where L H-PST (m t y0,t) is the guiding loss function of Hierarchical Probabilistic Structure Transport (H-PST), w i Represents the weight of the i-th layer, used to adjust the importance of structural information at different scales (levels) in the guidance process.
[0087] This loss function is completely differentiable. Now, the most crucial step is to calculate this guiding loss with respect to the variable we want to manipulate—the noisy mask m. t The gradient of the gradient vector. Intuitively, it points to the method that can reduce m the fastest. t The direction of the difference between the structure and the y0 structure.
[0088]
[0089] Formula explanation: where g t (m t y0) represents the structural transmission force. This indicates the calculation of the H-PST guiding loss function L. H-PST Regarding the current noisy mask m t The gradient of m. This gradient vector indicates the gradient of m. t How should we fine-tune it to make its internal structural features approximate the structural features of the target image y0 as quickly as possible?
[0090] This gradient is our structure transport force, which will transfer m t The evolutionary trajectory of y0 is "pulled" from purely anatomical priors to a path consistent with the y0 structure.
[0091] Step D: Guided Backsampling
[0092] We now have two forces to determine m t-1 The form: one is the "internal driving force" from the anatomical prior model itself, driven by unguided noise prediction. The other force is the "external traction force" from the target image, transmitted by the structure g. t This is reflected in our approach. We draw inspiration from the concept of classifier-free guidance and combine the two.
[0093] Modified guided noise prediction The calculation is as follows:
[0094]
[0095] The s here t It is a guidance strength scalar that varies with time step t. It controls the degree to which we follow the structure of the target image. It is a theoretically reasonable scaling factor used to balance the magnitude of noise prediction and gradient guidance.
[0096] Finally, we use this guided noise prediction. To perform standard DDPM or DDIM sampling procedures and calculate m t-1 Using the DDIM sampling formula:
[0097]
[0098] Where σ t To control the randomness of sampling, m t-1 This is the core update step of the DDIM sampler, used to calculate the mask m of the previous time step. t-1 .
[0099] Through the iterative process from t=T to 1, the m0 we finally obtain is one that conforms to general anatomical laws (by p). ψ,θ (m) guarantees a segmentation result that is structurally precisely aligned with the target domain image y0. Finally, thresholding or argmax operations on m0 yield the final discrete mask.
[0100] The present invention will be described below with reference to specific embodiments.
[0101] Example 2
[0102] Zero-shot cross-modal segmentation of brain tumors based on APPT-Seg
[0103] This embodiment aims to illustrate how to apply the present invention to train on a dataset containing only T1-weighted contrast-enhanced (T1-Gd) MRI scans and their segmentation labels, and then perform accurate brain tumor segmentation on FLAIR MRI scans from completely different modalities without any additional training or data.
[0104] Step 1: System Environment and Model Construction
[0105] Hardware environment: This embodiment is executed on a server equipped with an NVIDIA A100 80GB GPU.
[0106] Software environment: Operating system is Ubuntu 20.04, deep learning framework is PyTorch 1.12, CUDA version is 11.6.
[0107] Model architecture instantiation:
[0108] Noise prediction network ∈ Θ The architecture is based on U-Net, with a backbone network depth of 4 layers and the number of channels starting from 64, doubling with each layer, i.e. [64, 128, 256, 512].
[0109] Shared Encoder E ψ This corresponds to the downsampling path in U-Net. Each downsampling block contains two convolutional layers (3x3 convolution, GroupNorm, SiLU activation) and one max pooling layer.
[0110] Anatomy Decoder D θ and image appearance decoder D φ This corresponds to the upsampling path of U-Net. They share the same upsampling structure, with each upsampling block containing a transposed convolution, a skip-connection to the features of the corresponding layer in the encoder, and two convolutional blocks. To achieve expert decoding, the last convolutional layer (output layer) of both decoders uses independent parameters.
[0111] During forward propagation, the stream selector c is embedded as an additional condition into the time-step (t) embedding vector of each convolutional block to guide the computation flow to the correct decoder output layer. The input image and mask size are preprocessed to a uniform 256x256 pixels.
[0112] Step 2: Model Training
[0113] Training data: The publicly available BraTS2029 dataset was used. Source domain data D S It consists of a T1-Gd weighted image (x0) and its corresponding multi-class tumor segmentation mask (m0). The mask is converted into a multi-channel format, with each channel representing a tumor sub-region (such as necrotic core, enhancing tumor, etc.).
[0114] Training parameter settings:
[0115] Total diffusion steps T = 1000.
[0116] Noise scheduling uses a linear beta-schedule, starting from β1 = 10.-4 To β T =0.02.
[0117] The optimizer uses AdamW with a learning rate of 1×10⁻⁶. -4 The weight decays to 0.01.
[0118] Set the batch size to 8.
[0119] Structural loss weight λ struct Set it to 0.1 to ensure that the model focuses its main efforts on learning anatomical priors while gaining sufficient structural awareness.
[0120] Training process:
[0121] From D S A random sample of (x0, m0) is taken from a batch.
[0122] For each sample in the batch, a time step t∈{1,...,1000} is randomly sampled.
[0123] Based on the forward process formula, generate a noisy image x. t and noisy mask m t .
[0124] Anatomical prior learning: will (m t Input model ∈ ,t,c=0) Θ Noise prediction is obtained. calculate
[0125] Structure-aware learning: (x t ,t,c=1) Input model∈ Θ Noise prediction is obtained. calculate
[0126] Calculate the total loss L total =L anatomy +0.1·L structure .
[0127] Perform backpropagation and update the model parameters Θ = {ψ, θ, φ}.
[0128] Repeat this process until the model converges, for example, by training for 200 epochs.
[0129] Step 3: Zero-Shot Reasoning and Guidance
[0130] Inference input: Given a FLAIR MRI brain scan image y0 from an unknown domain that has not been trained in any way, and its size is also 256x256.
[0131] Inference initialization: Sample a pure noise tensor m from the standard normal distribution. T ~N(0,I).
[0132] Iterative denoising and guidance (from t=T to 1):
[0133] A. Parallel feature extraction:
[0134] Target features: Add noise to the target image y0 to y t The image stream (c=1) is input into the model. From the image decoder D... φ Intermediate feature maps are extracted from the outputs of the three upsampling blocks, denoted as...
[0135] nascent feature: The current mask to be denoised, m t Input into the model's anatomical flow (c=0). From the anatomical decoder D θ Extract intermediate feature maps from the same three locations, denoted as
[0136] B. Structural distribution measure:
[0137] For each pair of feature maps corresponding to the level The slice Wasserstein distance (SWD) is approximated using 512 random projection directions.
[0138] CH-PST Loss and Gradient:
[0139] Sum the SWD distances of all three levels to obtain the total guidance loss L. H-PST In this embodiment, all hierarchical weights w i Set it to 1.
[0140] Automatic differentiation calculates the loss with respect to m t gradient
[0141] D. Guided backsampling:
[0142] First, calculate the unguided noise prediction.
[0143] Then, calculate the noise after guidance. Guiding strength s t Set to a constant of 2.0.
[0144] Using the DDIM sampler, according to Calculate m t-1 To accelerate inference, the total number of sampling steps is set to 100.
[0145] Post-processing of results:
[0146] After the iteration is complete, the generated continuous value mask m0 is obtained.
[0147] The Sigmoid function is applied to each channel of m0, and binarization is performed with a threshold of 0.5 to obtain the final segmentation result.
[0148] Example 3
[0149] Zero-sample MRA to DSA cerebral vessel segmentation based on APPT-Seg
[0150] This embodiment aims to illustrate how to apply the present invention to train on a dataset containing only brain magnetic resonance angiography (MRA) and its vessel segmentation labels, and then perform accurate brain vessel segmentation on two-dimensional digital subtraction angiography (DSA) images from completely different imaging principles without any additional training or data.
[0151] Step 1: System Environment and Model Construction
[0152] Hardware and software environment: Same as in Example 1, using a server equipped with an NVIDIA A100 GPU and the PyTorch framework.
[0153] Model architecture instantiation:
[0154] Noise prediction network ∈ Θ The U-Net architecture is adopted. Considering that blood vessel structures are usually delicate and complex, the input image and mask size are uniformly preprocessed to 512x512 pixels to preserve high-frequency details.
[0155] The U-Net backbone network is set to a depth of 5 layers to provide richer multi-scale feature representations, and the number of channels is set to [64, 128, 256, 512, 1024].
[0156] Shared Encoder E ψ Anatomy Decoder D θ and image appearance decoder D φ The structure and basic principle are consistent with the aforementioned embodiments, with the activation path controlled by a stream selector c. Since vessel segmentation is a single-class task, the model's input / output mask channel count is 1.
[0157] Step 2: Model Training
[0158] Training data: A public or internal 3D Time-of-Flight (TOF) MRA dataset is used. Source domain data D S It consists of a 2D axial slice (x0) extracted from the 3DMRA volume and its corresponding binarized vessel segmentation mask (m0). In the mask, a pixel value of 1 represents a vessel and 0 represents the background.
[0159] Training parameter settings:
[0160] The total number of diffusion steps T = 1000, using a linear betaschedule.
[0161] The optimizer uses AdamW with a learning rate of 1×10⁻⁶. -4 .
[0162] The batch size is set to 4 to accommodate high-resolution inputs of 512x512.
[0163] Structural loss weight λ struct Setting it to 0.2 appropriately increases the emphasis on image structure perception, which helps the model learn more general linear and tubular structural features.
[0164] Training process:
[0165] From D S A batch of MRA slices (x0) and blood vessel masks (m0) were randomly sampled.
[0166] For each sample in the batch, a noisy x is generated at a random sampling time step t. t and m t .
[0167] Anatomical prior learning (c=0): m t Input model, predict noise Calculate L anatomy This process forces the model to learn a strong generative prior about "vascular morphology" (such as bifurcation, tortuosity, and tubular continuity).
[0168] Structure-aware learning (c=1): x t Input model, predict noise Calculate L structure This process enables the shared encoder to learn to identify underlying patterns related to vascular structures in MRA images.
[0169] Calculate the total loss L total =L anatomy +0.2·L structure And update the model parameter Θ.
[0170] Repeat this process until the model's performance converges on the validation set.
[0171] Step 3: Zero-Shot Reasoning and Guidance
[0172] Inference Input: Given a clinical, untrained 2D cerebral vascular DSA image y0, with dimensions 512x512. The DSA image is typically background subtraction, primarily highlighting the vessels filled with contrast agent.
[0173] Inference initialization: Sample a pure noise tensor m from the standard normal distribution. T ~N(0,I).
[0174] Iterative denoising and guidance (from t=T to 1):
[0175] A. Parallel feature extraction:
[0176] Target features: Add noise to the target DSA image y0 to y t The image stream (c=1) is input into the model. From the image decoder D... φ Intermediate feature maps are extracted from the outputs of all four upsampling blocks to form a feature set.
[0177] nascent feature: The current mask to be denoised, m t The input is fed into the model's anatomical stream (c=0) and from the anatomical decoder D. θ Extracting feature sets from the same location
[0178] B. Structural distribution measure:
[0179] For each pair of feature maps at corresponding levels, 1024 random projection directions are used to approximate its slice Wasserstein distance (SWD) to more accurately capture the distribution of fine vascular structures.
[0180] CH-PST Loss and Gradient:
[0181] Innovative Application (Targeted Weighting): Considering the extreme dependence of vessel segmentation tasks on high-frequency details, this embodiment assigns fixed but differentiated weights to the guiding loss at different levels. Feature layers closer to the output and with higher resolution in the decoder are given higher weights for their SWD distance. For example, the weights from the deepest to the shallowest layer can be set to w = [0.0, 1.0, 1.0, 2.0], thereby forcing the model to prioritize aligning fine vessel boundaries and tips during generation.
[0182] Calculate the weighted total guiding loss L H-PST and its relation to m t gradient g t .
[0183] D. Guided backsampling:
[0184] Calculate unguided noise and post-guided noise Guiding strength s t Set it to a high constant, such as 4.0, to strongly ensure that the generated vascular structures strictly follow the visible paths in the DSA images.
[0185] Using the DDIM sampler and setting 150 sampling steps, a balance is struck between inference speed and segmentation accuracy.
[0186] Post-processing of results:
[0187] After the iteration is complete, the generated continuous value blood vessel probability map m0 is obtained.
[0188] Applying the Sigmoid function to m0 and binarizing it with a threshold of 0.5 generates the final binary blood vessel segmentation mask. Optionally, morphological post-processing (such as removing small connected components) can be applied to further improve the smoothness and accuracy of the results.
[0189] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guidance, characterized in that, Includes the following steps: S1. Construct a dual-stream collaborative learning framework: Design a noise prediction network that includes a shared structure encoder, an anatomical decoder, and an image appearance decoder. A stream selector controls the input of noisy data to the corresponding decoder. The shared structure encoder is used to map the input noisy data to multi-scale latent features. The anatomical decoder is used to reconstruct the anatomical structure from the latent features and predict mask noise. The image appearance decoder is used to reconstruct the image texture intensity from the latent features and predict image noise. S2. Training the anatomical prior and structure-aware model: Two-stream collaborative training is performed using the source domain dataset, including adding noise to the source domain image and segmentation mask to generate noisy data, calculating the anatomical loss through the anatomical prior learning stream to learn the unconditional segmentation mask generation prior, calculating the structural loss through the structure-aware learning stream to train the shared structure encoder to learn modality-independent structural information, and optimizing the network parameters based on the weighted sum of the anatomical loss and the structural loss. S3. Zero-shot inference and hierarchical probabilistic structure transfer: For an unknown target domain image, a dynamically guided backdiffusion process is performed, including initializing a pure noise mask and setting the diffusion time step, adding noise to the target image to match the noise level of the current time step, extracting multi-scale structural features of the target image and intermediate anatomical structural features of the current noisy mask in parallel, using probability distribution distance to measure the differences of multi-level features and constructing a guided loss, generating structure transfer force based on the gradient of the guided loss, updating the noisy mask to the previous time step by combining unguided noise prediction and structure transfer force, and post-processing the generated results after iterating through all time steps to obtain the segmentation mask.
2. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S1, the noise prediction network is a U-Net-based network architecture, the shared structure encoder corresponds to the downsampling path of U-Net, the dissection decoder and the image appearance decoder correspond to the upsampling path of U-Net, and the output layer parameters of the dissection decoder and the image appearance decoder are set independently.
3. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S2, the process of adding noise to the source domain image and segmentation mask follows the DDPM forward diffusion process, specifically as follows: Where, m t and x t Here, m0 and x0 represent the noisy mask and the noisy image, respectively, while m0 and x0 represent the original segmentation mask and the source domain image, respectively. ε is the noise dispatch coefficient. m and ε x It is Gaussian noise.
4. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S2, the formula for calculating the anatomical loss is: L anatomy (ψ,θ)=E[w(t)·||ε m -∈ Θ (m t ,t,c=0)|| 2 ] Where ψ represents the shared structure encoder parameters, θ represents the dissecting decoder parameters, w(t) represents the loss weight function, E represents the expectation operator, and ε represents the expected value. m For the original Gaussian noise, ∈ Θ For the output of the noise prediction network, m t For the noisy mask, t is the time step, c=0 represents the dissection prior learning flow, ||·|| 2 This indicates the mean square error.
5. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S2, the formula for calculating the structural loss is: L structure (ψ,φ)=E[w(t)·||ε x -∈ Θ (x t ,t,c=1)|| 2 ] Where φ is the image appearance decoder parameter, ε x For the original Gaussian noise, x t For a noisy image, c=1 indicates a structure-aware learning flow.
6. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S3, the dual-path parallel feature extraction specifically includes: extracting a multi-scale structural feature set from the noisy target image through the intermediate layer of the image appearance decoder. Extract a multi-scale anatomical feature set from the intermediate layer of the current noisy mask via the dissection decoder.
7. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S3, the probability distribution distance is the slice Wasserstein distance (SWD), which is used to measure the distribution difference of the corresponding level feature maps. The calculation formula is as follows: in, and For the feature map of the corresponding level, ω is the random projection direction, and S C-1 For a C-1 dimensional unit hypersphere, g j and f k is the flattened feature vector, and W2 is the Wasserstein-2 distance.
8. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S3, the guiding loss is a weighted sum of the distances of the multi-level probability distributions, calculated using the following formula: Among them, w i y0 represents the hierarchical weight, k represents the number of feature levels, and y0 represents the target domain image.
9. The zero-sample cross-domain diffusion segmentation method based on anatomical structure probability transfer guided by claim 1, characterized in that: In step S3, the structural transmission force is the gradient of the guiding loss with respect to the current noisy mask, that is:
Citation Information
Patent Citations
Image processing method based on few-sample learning and related equipment
CN116310008A
Semi-supervised segmentation method based on potential diffusion model and multi-level context cross consistency
CN116958554A
Second-order few-sample medical image classification method and system based on multi-mode prompt learning, storage medium and equipment
CN119091197A
Hyperspectral image super-division method and system based on hidden space diffusion model
CN119648525A
Zero-sample rapid object migration method based on diffusion model
CN120032005A
Cited By
Instrument analysis migration method and system based on feature decoupling and physical residual calibration
CN122065017A
Instrument analysis migration method and system based on feature decoupling and physical residual calibration
CN122065017B