Medical image segmentation method based on wavelet condition potential diffusion
By optimizing mask generation using a multi-scale wavelet encoder and frequency-domain sensing gating block, the instability of traditional models in medical image segmentation under low contrast and complex backgrounds is solved, achieving more accurate medical image segmentation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU IND PARK MONASH RESEARCH INSTITUTE OF SCIENCE & TECHNOLOGY
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional deep segmentation models struggle to effectively model the latent distribution of data under low-contrast or cross-domain conditions, leading to unstable performance in medical image segmentation. Furthermore, existing diffusion probability models are ill-suited to preserving subtle anatomical details and suppressing background noise under complex medical imaging conditions.
A multi-scale wavelet encoder is used to extract conditional embeddings, and a latent mask is generated by combining a frequency domain sensing gate block and an autoencoder. The mask is then optimized by a regularized iterative algorithm to output accurate medical image segmentation results.
It improves the accuracy and robustness of medical image segmentation, especially in preserving structural details in low-contrast or complex backgrounds, and enhances the clarity of boundary information and noise suppression capabilities.
Smart Images

Figure CN121904078A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image segmentation technology, and in particular relates to a medical image segmentation method based on wavelet conditional latent diffusion. Background Technology
[0002] Accurate segmentation of medical images is crucial for the quantification of anatomical structures and the identification of lesion regions, directly supporting clinical workflows such as disease diagnosis and treatment planning. However, traditional deep segmentation models mostly operate in a purely discriminative manner, making it difficult to effectively model the underlying distribution of data, resulting in unstable performance under low contrast or cross-domain conditions. Although deep neural networks have significantly improved performance in segmentation tasks across various medical imaging modalities, most existing architectures remain inherently discriminative.
[0003] To overcome these limitations, the diffusion probability model, originally used for high-fidelity image generation, has been introduced into the segmentation task, demonstrating strong generation capabilities and good robustness in modeling complex data distributions. Among them, SDSeg stands out, as it utilizes latent diffusion to reduce the computational overhead of traditional multi-step sampling and achieves fast inference through single-step backward reasoning and latent fusion mechanisms. However, even so, SDSeg may still struggle to preserve subtle anatomical details and effectively suppress background noise under complex medical imaging conditions. Therefore, we propose a medical image segmentation method based on wavelet conditional latent diffusion. Summary of the Invention
[0004] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: This invention relates to a medical image segmentation method based on wavelet conditional latent diffusion, comprising the following steps: Step S1: Input image preprocessing: Acquire medical input images, uniformly adjust image size, and perform structure-preserving color enhancement during the training phase. The original input images are used during the inference phase. Step S2: Multi-scale wavelet conditional coding: The preprocessed image is processed by a multi-scale wavelet encoder to extract conditional embeddings and obtain semantic prior conditions. The encoder is implemented through multi-layer discrete wavelet transform, high-frequency residual enhancement, inverse discrete wavelet transform and downsampling concatenation. Step S3: Generation of latent mask for segmentation target: The latent mask is obtained by encoding the segmentation target corresponding to the input image using a pre-trained autoencoder with frozen parameters; Step S4: Frequency domain optimized diffusion denoising: Input the semantic prior conditions and the latent mask into the diffusion UNet, embed frequency domain-aware gated blocks (FAGB) in the skip connections of the diffusion UNet, and perform latent space denoising through a regularized iterative algorithm to obtain the optimized latent mask; Step S5: Segmentation Result Reconstruction and Output: The optimized latent mask is decoded using the decoding function of the autoencoder to output the final medical image segmentation result.
[0005] Furthermore, step S1 includes the following steps: Step S11, Image Size Standardization: Acquire medical input images: ; in, Image height, Image width, To ensure consistent space for subsequent processing, the number of channels was uniformly adjusted to a preset size of 256×256. Step S12, Structure Preservation and Color Enhancement: Performed only during the training phase, specifically as follows: In the LAB color space, another reference image is randomly selected from the dataset, and the channel-wise mean values of the L, A, and B channels of the reference image are extracted. with standard deviation ; Transfer the color statistics of the reference image to the input image. To obtain a color-enhanced image Furthermore, the transfer process does not alter the spatial structure and anatomical semantics of the input image, as shown in the following formula:
[0006] in, Given the pixel values of a specific L, A, or B channel of the input image, These represent the mean and standard deviation of that channel in the input image, respectively. This represents the pixel value of the channel after migration; Step S13, Inference Stage Processing: Color enhancement is not performed during inference; the original input image with unified dimensions is used directly. .
[0007] Furthermore, step S2 includes the following steps: Step S21, Multi-level Discrete Wavelet Transform Decomposition: This involves processing the preprocessed image... (During training) During reasoning Perform a 2-level recursive discrete wavelet transform decomposition, the first... layer The decomposition satisfies the following formula:
[0008] In the formula, For the first Low-frequency approximation coefficients of the layer The first High-frequency detail coefficients in horizontal, vertical, and diagonal directions of the layer; Step S22, High-frequency residual enhancement: Perform high-frequency residual enhancement on the high-frequency detail coefficients of each decomposed layer, satisfying the following formula:
[0009] The high-frequency residual enhancement includes: first applying depthwise separable convolution to each high-frequency subband, and then aggregating them through a cross-attention module. and complementary information to Finally, the expansion rate sequence is used for... The progressive void residual block optimization feature; Step S23, Inverse Discrete Wavelet Transform and Downsampling: Perform inverse discrete wavelet transform on the decomposition results of each layer to convert them back to the spatial domain, and then perform downsampling on each layer, satisfying the following formula:
[0010]
[0011] In the formula, For inverse discrete wavelet transform, The downsampling was 8 times and 4 times respectively. Step S24, Channel splicing: For and Perform channel concatenation to obtain semantic prior conditions. It satisfies the following formula:
[0012] In the formula, This is for channel splicing operations.
[0013] Furthermore, step S3 includes the following steps: Step S31, Autoencoder pre-training: Autoencoder The potential space distribution was obtained through bone intervention training using a diffusion model, and the training process satisfied KL regularization constraints to ensure the rationality of the potential space distribution. Step S32, Segmentation target encoding: Obtain the input image Corresponding segmentation target Through the encoding function of the autoencoder right Perform encoding to obtain the latent mask. It satisfies the following formula:
[0014] Step S33, Parameter Freezing: Encoding Function of the Autoencoder With decoding function During subsequent training, the parameters are kept frozen, and only the parameters of the multi-scale wavelet encoder and the diffusion UNet are updated; Step S34, Latent Mask Dimension: Latent Mask The spatial dimension is 32×32 and the number of channels is 4, which matches the input dimension of the diffusion UNet.
[0015] Furthermore, step S4 includes the following steps: Step S41, FAGB module processing: Embed frequency domain-aware gated blocks (FAGB) in the skip connections of the diffused UNet to process the input feature maps. Execution optimization, among which The number of channels is given, and the specific process satisfies the following formula: Layer normalization: In the formula, This is a channel-by-channel normalization function; Channel adjustment: The channel dimension is expanded by 1×1 convolution; FFT transform: After grouping, the result is converted to the complex field using a two-dimensional FFT; Complex filtering: Noise is suppressed by a learnable complex filter (initially an identity mapping); Inverse FFT and Fusion: Transform back into the spatial domain and fuse grouped features; Gating operation: Gated responses are generated through depthwise separable convolution and GELU activation; Residual output: After compressing the channel, perform a residual connection; Step S42, Diffusion UNet Initialization: The backbone network of Diffusion UNet is initialized from the Stable Diffusion model, and the newly added conditional fusion layer is initialized with zero to stabilize convergence in the early stage of training; Step S43, Regularized Iterative Solution: Construct an optimization objective function containing first-order and second-order derivative terms, and use the regularized Levenberg-Marquardt algorithm to iteratively solve for the parameter corrections, satisfying the following formula: Optimize the objective function: ; In the formula, For Jacobian matrices, It is a Hessian matrix. The regularization coefficient is used. Iteration formula: ; In the formula, For Jacobian matrices, It is a Hessian matrix. For the residual vector, It is the identity matrix; Step S44, Iteration Termination Condition: Set the convergence threshold ,when or number of iterations When the iteration terminates, the optimized latent mask is output. .
[0016] Furthermore, step S5 includes the following steps: Step S51, Latent Mask Decoding: Decoding via the autoencoder's decoding function For the optimized latent mask Decoding is performed, satisfying the following formula:
[0017] In the formula, The final medical image segmentation result has a spatial dimension that is the same as the input image. Consistent; Step S52, Output the result: Output The pixel-level segmentation mask has a foreground of the target anatomical structure (such as polyps, organs, lesions) and a background of non-target areas, supporting subsequent clinical quantitative analysis and diagnostic applications.
[0018] The present invention has the following beneficial effects: 1. This paper proposes WaDiS, a wavelet-enhanced latent diffusion framework for medical image segmentation. This model combines a multi-scale wavelet encoder for structure-aware conditionalization, a frequency-aware gating block to optimize boundary information, and a structure-preserving color enhancement strategy. WaDiS achieves robust and accurate segmentation performance on four different medical imaging datasets: CVCClinicDB, Synapse, ISIC2018, and TN3K. This framework effectively preserves structural details while improving segmentation accuracy, particularly excelling in challenging examples with low contrast or complex backgrounds. Future work will focus on extending WaDiS to multi-class and 3D segmentation tasks and exploring more efficient frequency-domain modules to enhance its scalability in clinical settings.
[0019] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 An overview of the WaDiS framework: (a) the overall architecture of the latent diffusion-based segmentation model; (b) the multi-scale wavelet encoder for conditional embedding; Figure 2 Design of a high-frequency residual enhancement module (HREB); Figure 3 A schematic diagram of the structure of a frequency domain sensing gate (FAGB); Figure 4 This is a schematic diagram of the color transfer operation during training; Figure 5 A visual comparison of segmentation results on the CVC-ClinicDB dataset; the red boxes mark the areas of inconsistency between the baseline model predictions and the ground truth (GT). Figure 6 A visual comparison of segmentation results on the Synapse dataset; Figure 7 A visual comparison of segmentation results on the ISIC2018 dataset; Figure 8 A visual comparison of segmentation results on the TN3K dataset; Figure 9 This is a schematic flowchart of a medical image segmentation method based on wavelet conditional latent diffusion according to the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Please see Figure 1 As shown, this invention is a medical image segmentation method based on wavelet conditional latent diffusion, comprising the following steps: Step S1: Input image preprocessing: Acquire medical input images, uniformly adjust image size, and perform structure-preserving color enhancement during the training phase. The original input images are used during the inference phase. Step S2: Multi-scale wavelet conditional coding: The preprocessed image is processed by a multi-scale wavelet encoder to extract conditional embeddings and obtain semantic prior conditions. The encoder is implemented through multi-layer discrete wavelet transform, high-frequency residual enhancement, inverse discrete wavelet transform and downsampling concatenation. Step S3: Generation of latent mask for segmentation target: The latent mask is obtained by encoding the segmentation target corresponding to the input image using a pre-trained autoencoder with frozen parameters; Step S4: Frequency domain optimized diffusion denoising: Input the semantic prior conditions and the latent mask into the diffusion UNet, embed frequency domain-aware gated blocks (FAGB) in the skip connections of the diffusion UNet, and perform latent space denoising through a regularized iterative algorithm to obtain the optimized latent mask; Step S5: Segmentation Result Reconstruction and Output: The optimized latent mask is decoded using the decoding function of the autoencoder to output the final medical image segmentation result.
[0024] Step S1 includes the following steps: Step S11, Image Size Standardization: Acquire medical input images: ; in, Image height, Image width, To ensure consistent space for subsequent processing, the number of channels was uniformly adjusted to a preset size of 256×256. Step S12, Structure Preservation and Color Enhancement: Performed only during the training phase, specifically as follows: In the LAB color space, another reference image is randomly selected from the dataset, and the channel-wise mean values of the L, A, and B channels of the reference image are extracted. with standard deviation ; Transfer the color statistics of the reference image to the input image. To obtain a color-enhanced image Furthermore, the transfer process does not alter the spatial structure and anatomical semantics of the input image, as shown in the following formula:
[0025] in, Given the pixel values of a specific L, A, or B channel of the input image, These represent the mean and standard deviation of that channel in the input image, respectively. This represents the pixel value of the channel after migration; Step S13, Inference Stage Processing: Color enhancement is not performed during inference; the original input image with unified dimensions is used directly. .
[0026] Step S2 includes the following steps: Step S21, Multi-level Discrete Wavelet Transform Decomposition: This involves processing the preprocessed image... (During training) During reasoning Perform a 2-level recursive discrete wavelet transform decomposition, the first... layer The decomposition satisfies the following formula:
[0027] In the formula, For the first Low-frequency approximation coefficients of the layer The first High-frequency detail coefficients in horizontal, vertical, and diagonal directions of the layer; Step S22, High-frequency residual enhancement: Perform high-frequency residual enhancement on the high-frequency detail coefficients of each decomposed layer, satisfying the following formula:
[0028] High-frequency residual enhancement includes: first applying depthwise separable convolutions to each high-frequency subband, and then aggregating them through a cross-attention module. and complementary information to Finally, the expansion rate sequence is used for... The progressive void residual block optimization feature; Step S23, Inverse Discrete Wavelet Transform and Downsampling: Perform inverse discrete wavelet transform on the decomposition results of each layer to convert them back to the spatial domain, and then perform downsampling on each layer, satisfying the following formula:
[0029]
[0030] In the formula, For inverse discrete wavelet transform, The downsampling was 8 times and 4 times respectively. Step S24, Channel splicing: For and Perform channel concatenation to obtain semantic prior conditions. It satisfies the following formula:
[0031] In the formula, This is for channel splicing operations.
[0032] Step S3 includes the following steps: Step S31, Autoencoder pre-training: Autoencoder The potential space distribution was obtained through bone intervention training using a diffusion model, and the training process satisfied KL regularization constraints to ensure the rationality of the potential space distribution. Step S32, Segmentation target encoding: Obtain the input image Corresponding segmentation target Through the encoding function of the autoencoder right Perform encoding to obtain the latent mask. It satisfies the following formula:
[0033] Step S33, Parameter Freezing: Encoding Function of the Autoencoder With decoding function During subsequent training, the parameters are kept frozen, and only the parameters of the multi-scale wavelet encoder and the diffusion UNet are updated; Step S34, Latent Mask Dimension: Latent Mask The spatial dimension is 32×32 and the number of channels is 4, which matches the input dimension of the diffusion UNet.
[0034] Step S4 includes the following steps: Step S41, FAGB module processing: Embed frequency domain-aware gated blocks (FAGB) in the skip connections of the diffused UNet to process the input feature maps. Execution optimization, among which The number of channels is given, and the specific process satisfies the following formula: Layer normalization: In the formula, This is a channel-by-channel normalization function; Channel adjustment: The channel dimension is expanded by 1×1 convolution; FFT transform: After grouping, the result is converted to the complex field using a two-dimensional FFT; Complex filtering: Noise is suppressed by a learnable complex filter (initially an identity mapping); Inverse FFT and Fusion: Transform back into the spatial domain and fuse grouped features; Gating operation: Gated responses are generated through depthwise separable convolution and GELU activation; Residual output: After compressing the channel, perform a residual connection; Step S42, Diffusion UNet Initialization: The backbone network of Diffusion UNet is initialized from the Stable Diffusion model, and the newly added conditional fusion layer is initialized with zero to stabilize convergence in the early stage of training; Step S43, Regularized Iterative Solution: Construct an optimization objective function containing first-order and second-order derivative terms, and use the regularized Levenberg-Marquardt algorithm to iteratively solve for the parameter corrections, satisfying the following formula: Optimize the objective function: ; In the formula, For Jacobian matrices, It is a Hessian matrix. The regularization coefficient is used. Iteration formula: ; In the formula, For Jacobian matrices, It is a Hessian matrix. For the residual vector, It is the identity matrix; Step S44, Iteration Termination Condition: Set the convergence threshold ,when or number of iterations When the iteration terminates, the optimized latent mask is output. .
[0035] Step S5 includes the following steps: Step S51, Latent Mask Decoding: Decoding via the autoencoder's decoding function For the optimized latent mask Decoding is performed, satisfying the following formula:
[0036] In the formula, The final medical image segmentation result has a spatial dimension that is the same as the input image. Consistent; Step S52, Output the result: Output The pixel-level segmentation mask has a foreground of the target anatomical structure (such as polyps, organs, lesions) and a background of non-target areas, supporting subsequent clinical quantitative analysis and diagnostic applications.
[0037] One specific application of this embodiment is: 1. This embodiment validates the effectiveness of the proposed method on four representative medical image segmentation benchmark datasets, covering different imaging modalities. The CVC-ClinicDB dataset contains 612 colonoscopy images from 29 sequences, with the task of polyp segmentation. The data is divided into training, validation, and test sets in an 8:1:1 ratio. The Synapse multi-organ segmentation dataset contains 30 abdominal CT scans with pixel-level annotations for 8 organs. The training set contains 2211 slices, the validation set contains 1568 slices, and the test set consists of 12 volume files (NIfTI format, .nii.gz). The ISIC2018 dataset is a classic dataset for skin lesion segmentation, using the original training, validation, and test split. The TN3K dataset contains over 3493 high-resolution ultrasound images of thyroid nodules, of which 2879 were used for training and 614 for testing. The selected datasets cover colonoscopy, CT, dermoscopy, and ultrasound, enabling comprehensive evaluation of segmentation performance under various anatomical structures and imaging conditions. To quantitatively evaluate the segmentation effect, this embodiment mainly uses the Dice similarity coefficient (DSC) and intersection-over-union ratio (IoU) as indicators, which are widely used to measure the degree of overlap between the predicted results and the actual labeled regions.
[0038] 2. All experiments were performed on an NVIDIA RTX 3090 GPU with 24GB of VRAM. The training process consisted of 100,000 steps, using the AdamW optimizer with an initial learning rate of 1×10⁻⁵ and a batch size of 4. The latent diffusion model was run in compressed space with a downsampling ratio of [missing value]. This study employs a KL-regularized autoencoder and a U-Net denoiser. Input images are uniformly resized to 256×256, with a latent representation spatial dimension of 32×32 and 4 channels. The WaDiS backbone network is initialized with Stable Diffusion to fully utilize its powerful generative prior. The proposed custom modules—wavelet conditional encoder and frequency-aware gated block (FAGB)—are both initialized with Xavier. Referring to SDSeg, the newly added conditional fusion layer in the denoising U-Net uses zero initialization to stabilize the convergence process in the early training stages. In each training step, an image is randomly selected, and its LAB space color distribution is transferred to the input image, thus maintaining spatial structure and semantic consistency while altering the appearance. This color enhancement strategy is only used during the training phase and disabled during the inference phase. 3.1 Performance comparison on the CVC-ClinicDB dataset: This embodiment evaluates the proposed WaDiS model on the CVC-ClinicDB dataset and compares it with recent segmentation methods, including Unet++, Swin-Unet, Diff-Trans, and SDSeg. All models were trained and tested under the same settings to ensure a fair comparison. As shown in Table 1, WaDiS achieved the highest scores on both DSC and IoU metrics, showing improvement, especially compared to SDSeg, validating the effectiveness of the wavelet conditional encoder and frequency-aware gated block (FAGB). Furthermore, the color transfer enhancement introduced during training improves the model's robustness to variations in color distribution in clinical images. Figure 5 The qualitative results presented further demonstrate that WaDiS can effectively suppress irrelevant background interference while accurately characterizing anatomical boundaries. In contrast, other methods often produce blurry or incomplete segmentation masks, while WaDiS generates more accurate prediction results;
[0039] Table 1: Quantitative comparison results on the CVC-ClinicDB dataset; 3.2 Performance comparison on the Synapse dataset: To evaluate the robustness of WaDiS under conditions of anatomical structural changes and low contrast, this embodiment was tested on the Synapse multi-organ CT dataset, which contains abdominal structures with varying morphologies and boundaries. This embodiment used the same set of baseline models as the CVC-ClinicDB experiment for comparison on Synapse. As shown in Table 2, WaDiS achieved the best performance in both the Dice coefficient and IoU index. The improvement is mainly reflected in areas of structural blurring or low contrast, thanks to the support of multi-scale conditional coding and frequency domain optimization mechanisms. Figure 6 The qualitative results presented further demonstrate that WaDiS is able to generate clearer boundaries and more complete organ morphology.
[0040] Table 2: Quantitative comparison results on the Synapse dataset; 3.3 This embodiment further evaluates WaDiS on the ISIC2018 dataset, which contains dermoscopic images with diverse appearances and often presents challenges due to low contrast at lesion boundaries. Table 3 reports the quantitative comparison results with the same benchmark model as the CVC-ClinicDB experiment. WaDiS achieves the best performance on both DSC and IoU metrics, indicating its advantages in handling complex lesion morphologies and suppressing background noise. Figure 7 The representative results shown demonstrate that WaDiS can generate clearer boundaries and reduce false detections.
[0041] Table 3. Quantitative comparison results on the ISIC2018 dataset; 3.4 To evaluate the performance of WaDiS in the binary classification and segmentation task of complex anatomical structures, this embodiment conducted experiments on the TN3K ultrasound dataset. This dataset is characterized by high-resolution images and challenging boundary details. Under the same training and evaluation criteria, this embodiment compared WaDiS with several competing benchmark models. As shown in Table 4, WaDiS achieved consistently leading performance improvements in both DSC and IoU metrics. The performance advantage is particularly significant in the target boundary region, where benchmark models often exhibit blurred boundaries or incomplete masking. Figure 8 The qualitative results further demonstrate that the segmentation mask generated by WaDiS outperforms other methods in terms of boundary clarity and spatial consistency, showing its robustness in complex cases.
[0042]
[0043] Table 4. Quantitative comparison results on the TN3K dataset; 4. To evaluate the effectiveness of each module of WaDiS, this embodiment conducted a series of ablation experiments on the ISIC2018 skin lesion segmentation dataset. This embodiment uses SDSeg as the baseline model and progressively introduces the modules proposed in this paper, including a wavelet-based conditional encoder, a frequency-aware gated block (FAGB), and LAB-based color enhancement. Table 5 summarizes the impact of each component on performance. Replacing the CNN conditional encoder with a multi-scale wavelet design significantly improves performance because hierarchical frequency decomposition provides richer structural cues, thus enabling more effective semantic conditionalization. By emphasizing structure-related features in the frequency domain, FAGB enhances boundary sharpness while mitigating noise and irrelevant activations. Finally, the introduction of a structure-preserving color enhancement strategy improves the model's robustness to image color changes during training. Experimental results show that each module makes a positive contribution, while the complete WaDiS configuration achieves the best performance across all metrics.
[0044]
[0045] Table 5. Ablation experimental results on the ISIC2018 dataset (unit: %); 5. Results on multiple datasets demonstrate that wavelet-based conditional coding with frequency domain optimization (FAGB) enables WaDiS to capture fine-grained structural information, improve boundary accuracy, and maintain robustness under low contrast and appearance variations. The wavelet conditional encoder enhances multi-scale feature representation capabilities, while the frequency domain-aware gating mechanism strengthens boundary localization while suppressing irrelevant details. However, frequency domain operations incur additional computational overhead, and current 2D designs have limitations in 3D continuity modeling, which may impact performance in 3D imaging applications such as MRI or CT. Therefore, these factors need to be considered in practical deployments.
[0046] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0047] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A medical image segmentation method based on wavelet conditional latent diffusion, characterized in that: Includes the following steps: Step S1: Input image preprocessing: Acquire medical input images, uniformly adjust image size, and perform structure-preserving color enhancement during the training phase. The original input images are used during the inference phase. Step S2: Multi-scale wavelet conditional coding: The preprocessed image is processed by a multi-scale wavelet encoder to extract conditional embeddings and obtain semantic prior conditions. The encoder is implemented through multi-layer discrete wavelet transform, high-frequency residual enhancement, inverse discrete wavelet transform and downsampling concatenation. Step S3: Generation of latent mask for segmentation target: The latent mask is obtained by encoding the segmentation target corresponding to the input image using a pre-trained autoencoder with frozen parameters; Step S4: Frequency domain optimized diffusion denoising: Input the semantic prior conditions and the latent mask into the diffusion UNet, embed frequency domain-aware gated blocks in the skip connections of the diffusion UNet, and perform latent space denoising through a regularized iterative algorithm to obtain the optimized latent mask; Step S5: Segmentation Result Reconstruction and Output: The optimized latent mask is decoded using the decoding function of the autoencoder to output the final medical image segmentation result.
2. The medical image segmentation method based on wavelet conditional latent diffusion according to claim 1, characterized in that, Step S1 includes the following steps: Step S11, Image Size Standardization: Acquire medical input images: ; in, Image height, Image width, To ensure consistent space for subsequent processing, the number of channels was uniformly adjusted to a preset size of 256×256. Step S12, Structure Preservation and Color Enhancement: Performed only during the training phase, specifically as follows: In the LAB color space, another reference image is randomly selected from the dataset, and the channel-wise mean values of the L, A, and B channels of the reference image are extracted. with standard deviation ; Transfer the color statistics of the reference image to the input image. To obtain a color-enhanced image Furthermore, the transfer process does not alter the spatial structure and anatomical semantics of the input image, as shown in the following formula: ; in, Given the pixel values of a specific L, A, or B channel of the input image, These represent the mean and standard deviation of that channel in the input image, respectively. This represents the pixel value of the channel after migration; Step S13, Inference Stage Processing: Color enhancement is not performed during inference; the original input image with unified dimensions is used directly. .
3. The medical image segmentation method based on wavelet conditional latent diffusion according to claim 1, characterized in that, Step S2 includes the following steps: Step S21, Multi-level Discrete Wavelet Transform Decomposition: This involves processing the preprocessed image... Perform a 2-level recursive discrete wavelet transform decomposition, the first... Layer decomposition satisfies the following formula: ; In the formula, For the first Low-frequency approximation coefficients of the layer The first High-frequency detail coefficients in horizontal, vertical, and diagonal directions of the layer; Step S22, High-frequency residual enhancement: Perform high-frequency residual enhancement on the high-frequency detail coefficients of each decomposed layer, satisfying the following formula: ; The high-frequency residual enhancement includes: first applying depthwise separable convolution to each high-frequency subband, and then aggregating them through a cross-attention module. and complementary information to Finally, the expansion rate sequence is used for... The progressive void residual block optimization feature; Step S23, Inverse Discrete Wavelet Transform and Downsampling: Perform inverse discrete wavelet transform on the decomposition results of each layer to convert them back to the spatial domain, and then perform downsampling on each layer, satisfying the following formula: In the formula, For inverse discrete wavelet transform, The downsampling was 8 times and 4 times respectively. Step S24, Channel splicing: For and Perform channel concatenation to obtain semantic prior conditions. It satisfies the following formula: ; In the formula, This is for channel splicing operations.
4. The medical image segmentation method based on wavelet conditional latent diffusion according to claim 1, characterized in that, Step S3 includes the following steps: Step S31, Autoencoder pre-training: Autoencoder The potential space distribution was obtained through bone intervention training using a diffusion model, and the training process satisfied KL regularization constraints to ensure the rationality of the potential space distribution. Step S32, Segmentation target encoding: Obtain the input image Corresponding segmentation target Through the encoding function of the autoencoder right Perform encoding to obtain the latent mask. It satisfies the following formula: ; Step S33, Parameter Freezing: Encoding Function of the Autoencoder With decoding function During subsequent training, the parameters are kept frozen, and only the parameters of the multi-scale wavelet encoder and the diffusion UNet are updated; Step S34, Latent Mask Dimension: Latent Mask The spatial dimension is 32×32 and the number of channels is 4, which matches the input dimension of the diffusion UNet.
5. The medical image segmentation method based on wavelet conditional latent diffusion according to claim 1, characterized in that, Step S4 includes the following steps: Step S41, FAGB module processing: Embed frequency domain-aware gated blocks (FAGB) in the skip connections of the diffused UNet to process the input feature maps. Execution optimization, among which The number of channels is given, and the specific process follows the formula: Layer normalization: In the formula, For channel-by-channel normalization function; Channel adjustment: The channel dimension is expanded by 1×1 convolution; FFT transform: After grouping, the result is converted to the complex field using a two-dimensional FFT; Complex filtering: Noise is suppressed by a learnable complex filter; Inverse FFT and Fusion: Transform back into the spatial domain and fuse grouped features; Gating operation: Gated responses are generated through depthwise separable convolution and GELU activation; Residual output: After compressing the channel, perform a residual connection; Step S42, Diffusion UNet Initialization: The backbone network of Diffusion UNet is initialized from the Stable Diffusion model, and the newly added conditional fusion layer is initialized with zero to stabilize convergence in the early stage of training; Step S43, Regularized Iterative Solution: Construct an optimization objective function containing first-order and second-order derivative terms, and use the regularized Levenberg-Marquardt algorithm to iteratively solve for the parameter corrections, satisfying the following formula: Optimize the objective function: In the formula, For Jacobian matrices, It is a Hessian matrix. The regularization coefficient is used. Iteration formula: ; In the formula, For Jacobian matrices, It is a Hessian matrix. For the residual vector, It is the identity matrix; Step S44, Iteration Termination Condition: Set the convergence threshold ,when or number of iterations When the iteration terminates, the optimized latent mask is output. .
6. The medical image segmentation method based on wavelet conditional latent diffusion according to claim 1, characterized in that, Step S5 includes the following steps: Step S51, Latent Mask Decoding: Decoding via the autoencoder's decoding function For the optimized latent mask Decoding is performed, satisfying the following formula: In the formula, The final medical image segmentation result has a spatial dimension that is the same as the input image. Consistent; Step S52, Result Output: Output The pixel-level segmentation mask, in which the foreground is the target anatomical structure and the background is the non-target area, supports subsequent clinical quantitative analysis and diagnostic applications.