Lung PET&CT image segmentation method based on three-dimensional denoising diffusion model

By improving the two-dimensional denoising and diffusion model to a three-dimensional denoising and diffusion model, combined with a variety of technical means, the problems of insufficient information utilization and noise sensitivity of the two-dimensional model in three-dimensional medical image segmentation are solved, and high-quality lungs are achieved PET&CT image segmentation improves the stability and processing efficiency of the model.

CN118799342BActive Publication Date: 2024-12-03NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411272973.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-03
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

The existing two-dimensional denoising and diffusion model fails to fully utilize the information between different axial slices when processing three-dimensional medical images, limiting its application in the lung PET&CT image segmentation task and is sensitive to noise and data distribution changes. , resulting in insufficient reliability and stability in clinical environment.

Method used

Introduce a three-dimensional denoising and diffusion model (3D-DDPM), by improving the model structure, replacing 2D operations with 3D operations, optimizing the network layer and data flow mode, adopting GroupNorm and SiLU activation functions, combining full-size jump connections and deep supervision, using multiple uses The scale structure is similar to the exponential loss function, and the model's robustness and generalization ability are improved through data augmentation techniques such as random cropping and rotation.

Benefits of technology

The high-quality three-dimensional segmentation of lung PET&CT images is realized, which can capture the spatial information and morphological characteristics of the tumor more comprehensively and accurately, improve the reliability and stability of the model, avoid overfitting, and shorten the model training and Reasoning time improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799342B_ABST
    Figure CN118799342B_ABST
Patent Text Reader

Abstract

The present invention discloses a lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model, which combines the 3D-DDPM method of the optimized U-Net with the optimization of the Analytic-DPM method to improve the precision and accuracy of lung adenoma segmentation. The optimized U-Net utilizes full-size jump connections and deep supervision, and improves the residual module. At the same time, DDPM is optimized based on the Analytic-DPM method. Analytic-DPM uses the Monte Carlo method and a pre-trained score-based model to estimate the analytical form of variance and KL divergence, derives the bounds of the optimal variance to correct potential biases, and reveals the relationship between the score function and the data covariance matrix, improves the efficiency and performance of the likelihood results, and effectively generates high-quality samples. The present invention realizes high-quality three-dimensional medical image synthesis. In the inverse process of the 3D-DDPM diffusion model, the cascade of three-dimensional PET, CT and Gaussian noise volumes is used as network input to generate a tumor mask, thereby accurately realizing lung adenoma segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and in particular relates to a lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model. Background Art

[0002] Lung adenomas are a type of lung tumor that can cause breathing difficulties and coughing up blood in severe cases. Therefore, they need to be closely monitored to ensure that they do not cause more serious problems. PET and CT imaging are widely used modalities in initial staging and subsequent monitoring. PET images can effectively highlight metabolically active lung adenomas, but the image resolution and signal-to-noise ratio are low. Sometimes, it can be challenging to distinguish lung adenomas from other metabolically active normal tissues based on PET images. On the other hand, CT imaging provides valuable morphological insights into human structures. Therefore, integrating PET and CT images can synergistically provide complementary information and improve the accuracy of diagnosis and treatment planning. However, it is a laborious task for radiologists to delineate the tumor volume of each patient from PET and CT images, especially when dealing with large cohorts. Therefore, it is of great significance to develop high-precision automatic segmentation techniques for lung adenomas to facilitate faster and more reproducible tumor delineation.

[0003] The diffusion model is a generative model that was originally proposed for image synthesis. It decomposes the challenging image synthesis task into a series of image denoising subtasks. This method enhances the stability and performance of image synthesis and performs competitively with other state-of-the-art methods. In addition to image synthesis, they also show great potential in various fields such as image super-resolution, denoising, infilling, and segmentation. The methods based on the diffusion model mainly focus on processing two-dimensional slices on the transverse plane. This method mainly focuses on processing two-dimensional slices on the transverse plane and has not yet fully utilized the information between different axial slices, which limits its application in three-dimensional medical image segmentation tasks. Summary of the invention

[0004] To solve the above problems, the present invention discloses a lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model to meet the clinical needs in lung cancer treatment. The present invention introduces a three-dimensional denoising diffusion model (3D-DDPM), improves the DDPM model structure, uses three-dimensional operations instead of two-dimensional operations, optimizes the network layer, and improves noise processing and data flow. These structural improvements make the model more accurate in processing image data, while reducing the sensitivity to noise and data distribution changes, thereby improving the reliability and stability of the model in actual clinical environments.

[0005] To achieve the above object, the technical solution of the present invention is as follows:

[0006] The lung PET&CT image segmentation method based on the three-dimensional denoising diffusion model includes the following steps:

[0007] S1, subdivide the original data set into training set, validation set and test set, and resample and normalize the data set;

[0008] S2, the original DDPM structure is modified, all 2D operations are replaced by 3D, the residual block is optimized, GroupNorm replaces BatchNorm, SiLU replaces ReLU function, 2D convolution layer is replaced by 3D convolution layer, and the step size is set to 1; at the same time, the U-Net network structure is optimized, and the optimized U-Net uses full-size skip connections and deep supervision;

[0009] S3, uses the method based on Analytic-DPM to optimize 3D-DDPM, improves the log-likelihood of dpm, generates high-quality samples and improves the training speed, and optimizes the DDPM algorithm from the perspective of minimizing the KL divergence of the joint distribution;

[0010] S4, define target clean data For the 3D tumor mask, this clean data contains the accurate location and shape information of the tumor area, which is the target of model training and optimization;

[0011] S5, the batch size is set to 1, only a single volume of data is used for processing each time the model is trained, and a small volume of 32×96×96mm³ is generated through random cropping operations to train the model; the training data is enhanced through data enhancement techniques such as rotation and flipping.

[0012] Furthermore, in step S1, the original data set is divided into a training set, a validation set, and a test set according to a specified ratio. Ensure that the data set is divided reasonably and that the data sources for model training, validation, and testing are representative and independent. Use linear interpolation to resample the spatial resolution of the original data set to 1×1×1mm³, and uniformly adjust the volume size of the data set to 144×144×144mm³.

[0013] Further, in step S2, all 2D operations, layers and noise inputs are replaced with 3D operations, layers and noise inputs to meet the processing requirements of three-dimensional medical images. The two-dimensional convolution layer is replaced with a three-dimensional convolution layer, and the convolution kernel size and step size are set to values ​​suitable for three-dimensional data processing. The residual block is optimized, a new residual module is adopted, and GroupNorm is introduced to replace BatchNorm, and GroupNorm has better performance stability. SiLU is used to replace the traditional ReLU activation function, and the SiLU function can better maintain the continuity and nonlinearity of the data. At the same time, the optimized U-Net proposed in the present invention combines multi-scale features, redesigns skip connections, and utilizes full-scale deep supervision to provide fewer parameters, but produces more accurate location perception and boundary enhancement segmentation maps. The full-scale jump connection converts the interconnection between the encoder and the decoder and the inner connection between the decoder subnetworks. Each decoder layer in the present invention combines the small-scale and same-scale feature maps from the encoder and the large-scale feature maps from the decoder, thereby capturing fine-grained details and coarse-grained semantics at all scales. In order to learn hierarchical representations from full-scale aggregated feature maps, full-scale deep supervision is further adopted in this paper. The optimized UNet proposed in this paper produces a side output from each decoder stage, which is supervised by the ground truth. To achieve deep supervision, the last layer of each decoder stage is fed into a normal 3×3 convolutional layer, followed by bilinear upsampling and sigmoid function.

[0014] In order to further enhance the boundaries of organs, the present invention adopts a multi-scale structural similarity index loss function MS-SSIM to give higher weights to fuzzy boundaries. Benefiting from this, the present invention will focus on fuzzy boundaries. The greater the regional distribution difference, the higher the MS-SSIM value. P and the ground truth G Two corresponding batches of N×N size are cut out from and ;definition p and g The MS-SSIM loss function is:

[0015] ;

[0016] in, and Represent the mean of the predicted image and the real image respectively; represents the variance of the predicted image, represents the variance of the real image; Represents the covariance between the predicted image and the real image; and It is a small constant used to stabilize the denominator and should be positive to avoid division by zero errors; and is a weight parameter used to adjust the impact of SSIM at different scales; M Indicates the number of scales used.

[0017] Furthermore, in step S3, the DDPM parameters are optimized To learn, it is proved that minimizing the KL divergence of the joint distribution is equivalent to maximizing ;

[0018] Right now,

[0019] ;

[0020] in, There are two probability distributions p and q A measure of the difference between p In distribution q Relative entropy on ; is the joint distribution of the real data, is the joint distribution of the generative model;

[0021] Next, we will start from minimizing the KL divergence of the joint distribution and split it into multiple moment matching optimizations.

[0022] ;

[0023] in, Represents the distribution from the true Expected calculation of samples; This ratio measures the true distribution at each sample point. p and generate distribution q The difference between is at the time step N The marginal distribution of is the generative model at time step N The marginal distribution of

[0024] When the number of steps is sufficient, , the first term is approximately equal to 0; at this time, the KL divergence is split into the sum of the KL divergences at different times; due to the assumption that and It's all about , so minimizing the sum of the KL divergences at N moments is equivalent to minimizing the KL divergence at each moment; that is:

[0025] ;

[0026] Due to the assumption According to the conclusion of Moment Matching, the first and second moments of q are equal to the first and second moments of p, that is, the means and variances of the two distributions are equal. Using the idea of ​​maximum likelihood estimation and substituting it into the formula of KL divergence, we can get

[0027] ;

[0028] in, is with Irrelevant constants; Indicates that in a given conditions, The true distribution of Indicates that in a given Under the conditions, The generative model distribution of Represents the true distribution The sample drawn from Perform expectation calculations;

[0029] Respectively and Taking the derivative and setting the result equal to 0, we get:

[0030] ;

[0031] in, is the mean of the generative model at time step t, indicating that given Under the conditions Expected value; is the covariance matrix of the generative model at time step t, indicating that given Under the conditions The variance of

[0032] The total expectation formula and total variance formula can be further simplified:

[0033] ;

[0034] in , Indicates that in a given conditions, The probability distribution of Indicates that in a given conditions, The probability distribution of Express Under given conditions Expected value;

[0035] ;

[0036] in, Indicates that in a given and In the case of The expected value of the variance of Indicates that in a given In the case of The variance of the expected value of

[0037] Now, the only unknown term in the expression is and Because I don't know , these two quantities are difficult to calculate directly; and express and ; The entire derivation process is based on the solution of the mean and variance of the exponential family distribution.

[0038] First, we can get:

[0039]

[0040] in , Indicates that in a given conditions, The probability distribution of Derivative, assuming that the order of derivation and integration can be exchanged, we can get:

[0041]

[0042] Using Bayes' formula:

[0043]

[0044] Both sides at the same time Derivative:

[0045]

[0046] Bring in :

[0047]

[0048] After sorting, we can get:

[0049]

[0050] Then, both sides of the above equation are Derivative:

[0051] ;

[0052] Notice , we can get:

[0053] ;

[0054] and ;

[0055] So we have: ;

[0056] The final simplified result is as follows: ;

[0057] The final expression is obtained, where is the marginal distribution of the forward process at time step n:

[0058] ;

[0059] in, represents the optimal generative model at time step t The mean under ; Represents the state or observation value of the current time step t; Represents the decremental noise adjustment parameter, which is used in the diffusion model to control the intensity of the noise; Express The logarithmic probability density function of The gradient of represents the attenuation factor; I Represents the identity matrix.

[0060] Furthermore, in step S4, the target clean data refers to the real labeled data of lung adenoma used for training and evaluation, that is, the accurate boundary and morphological information of the tumor, which is used as the target of model training and the standard of evaluation. The clean data should be annotated by professionals or generated by automated algorithms to ensure the accuracy and reliability of the labeling.

[0061] Further, in step S5, a data enhancement technique suitable for three-dimensional medical images is selected, such as random cropping, rotation, flipping, etc., to increase the diversity and quantity of training samples and improve the generalization ability of the model. The data enhancement method and parameters are determined according to the specific situation to ensure that the enhanced data maintains the structural integrity and information consistency of the medical image. The batch size is set to 1, that is, the data input into the model each time is a single volume, so as to avoid the influence of the batch effect on the model training process and ensure the processing ability of the model for a single sample. The random cropping operation refers to randomly selecting a subvolume from the original three-dimensional medical image as a training sample to reduce memory consumption and speed up training. After data enhancement, the training data set is prepared, and the preparatory work before model training is performed, including setting the training parameters such as loss function, optimizer, and learning rate scheduler. The evaluation index and training stop condition of the model are determined so as to monitor the performance of the model during the training process and adjust the parameters in time to improve the training effect of the model.

[0062] The beneficial effects of the present invention are:

[0063] 1) This invention adopts the 3D-DDPM method based on the optimized Analytic-DPM, combined with the improved residual network structure and 3D U-Net model, to achieve high-quality three-dimensional segmentation of lung PET&CT images. Compared with the traditional two-dimensional method, it can capture the spatial information and morphological characteristics of the tumor more comprehensively and accurately.

[0064] 2) Through the inverse process of the diffusion model, the present invention can accurately extract tumor information from three-dimensional medical images and generate accurate tumor masks. Compared with traditional manual annotation or automatic segmentation technology based on two-dimensional methods, it can complete tumor identification and positioning more quickly and accurately.

[0065] 3) This paper adopts data enhancement techniques such as random cropping, rotation, and flipping, and optimizes the DDPM structure to increase the diversity of training samples and improve the generalization ability of the model. Compared with traditional training methods, it can better avoid overfitting of the model and improve the robustness and robustness of the model.

[0066] 4) By adopting 3D convolution and appropriate model design, as well as a training strategy with a batch size of 1, the present invention can achieve fast and efficient processing of large-scale 3D medical images. Compared with traditional 2D methods, it can greatly shorten the time of model training and reasoning and improve processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 It is a flowchart of the specific implementation steps of the present invention.

[0068] Figure 2Schematic diagram of the optimized 3D-DDPM method based on Analytic-DPM.

[0069] Figure 3 This is the structure diagram of the optimized residual network. DETAILED DESCRIPTION

[0070] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0071] This paper proposes a lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model. By improving the residual network structure of DDPM and optimizing 3D-DDPM based on Analytic-DPM, high-quality three-dimensional medical image synthesis can be achieved, thereby accurately performing lung adenoma segmentation from 3D PET and 3D CT volumes. In the reverse process, the 3DUNet structure is used, and the PET, CT and Gaussian noise volume splicing is used as the network input to generate the tumor mask.

[0072] The present invention discloses a lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model, and the implementation process is as follows: Figure 1 As shown, the specific implementation steps are as follows:

[0073] Step S1, divide the original data set into training set, validation set and test set according to the specified ratio. Ensure that the data set is divided reasonably and the data sources for model training, validation and testing are representative and independent. Use linear interpolation to resample the spatial resolution of the original data set to 1×1×1mm³, and uniformly adjust the volume size of the data set to 144×144×144mm³. The resampling operation helps to eliminate spatial heterogeneity in the data and improve the accuracy and stability of subsequent processing. Normalize the CT and PET data to limit their pixel value range to [-1, 1], thereby accelerating the convergence speed of the model and improving the model's adaptability to different data scales. Determine the parameters of the linear interpolation method and normalization processing to ensure the effectiveness and stability of data preprocessing. Convert the preprocessed data into a tensor format acceptable to the model. At the same time, ensure that the storage and management of the data meet the requirements of data security and privacy protection. Perform quality checks on the preprocessed data, including checking data integrity, accuracy and consistency. Make necessary corrections and adjustments to the data based on the inspection results to ensure that the data quality meets the requirements of model training and validation;

[0074] Step S2, the optimized residual network structure of the present invention is as follows Figure 3As shown, all 2D operations, layers, and noise inputs are replaced with 3D operations, layers, and noise inputs to meet the processing requirements of three-dimensional medical images. The residual block is optimized, a new residual module is adopted, and GroupNorm is introduced to replace BatchNorm. GroupNorm has better performance stability, is suitable for small batch training, and is not affected by batch size. SiLU is used to replace the traditional ReLU activation function. The SiLU function can better maintain the continuity and nonlinearity of the data, which helps to improve the fitting ability and convergence speed of the model. To improve the model's ability to extract and reconstruct image features. The two-dimensional convolutional layer is replaced with a three-dimensional convolutional layer, and the convolution kernel size and step size are set to values ​​suitable for three-dimensional data processing (for example: the step size of the convolution kernel is set to 1) to ensure that the model has a good effect on feature extraction and information transmission of three-dimensional medical images;

[0075] The improved U-Net architecture proposed in the present invention integrates multi-scale features, redesigns jump connections, and applies full-size deep supervision technology to achieve more accurate location perception and boundary enhancement segmentation maps with fewer parameters. The introduction of full-size jump connections transforms the connection mode between the encoder and the decoder and the connection mechanism within the decoder subnetwork. Each decoder layer combines the small-scale and same-scale feature maps from the encoder and the large-scale feature maps from the decoder to capture the subtle details and coarse-grained semantic information of the image in a full-size range. In order to effectively learn hierarchical representations from full-size aggregated feature maps, we further introduce a full-size deep supervision mechanism. In the present invention, our improved UNet architecture generates a side output at each decoder stage, which is supervised by ground truth. To achieve deep supervision, we feed the last layer of feature maps of each decoder stage to a common 3×3 convolution layer, followed by bilinear upsampling and Sigmoid function processing. This deep supervision mechanism can help the network learn and optimize lower-level features more effectively, thereby improving the accuracy and robustness of the segmentation results.

[0076] In order to further enhance the boundaries of organs, the present invention adopts a multi-scale structural similarity index loss function MS-SSIM to give higher weights to fuzzy boundaries. Benefiting from this, the present invention will focus on fuzzy boundaries. The greater the regional distribution difference, the higher the MS-SSIM value. P and the ground truth G Two corresponding batches of N×N size are cut out from and ;definition p and g The MS-SSIM loss function is:

[0077] ;

[0078] Step S3, the 3D-DDPM network structure of the present invention is as follows Figure 2 As shown, Analytic-DPM is a training-free reasoning framework that uses Monte Carlo methods and pre-trained score-based models to estimate analytical forms of variance and KL divergence. This method aims to improve the log-likelihood of various DPMs, thereby producing high-quality samples. This optimization process decomposes the problem of minimizing the KL divergence of the joint distribution into multiple moment matching optimization sub-problems. In this way, the training process can be accelerated, so that the training results of the model can be obtained faster. Through this optimization method, the accuracy and quality of the model's segmentation of lung F-FDG PET&CT images can be improved, thereby improving the reliability and credibility of the segmentation results;

[0079] Step S4, define clean data A 3D tumor mask used to guide the model to segment lung PET&CT images. This clean data contains the accurate location and shape information of the tumor area and is the target of model training and optimization. The 3D U-Net model is used as the inverse process of the diffusion model. The 3D U-Net model structure consists of an encoder and a decoder, which can effectively capture all information across three dimensions and has good image segmentation performance. Both the encoder and decoder parts use 3D convolution operations to capture the local features and spatial information of the image in three dimensions. Through appropriate downsampling and upsampling operations, as well as the design of jump connections, the feature information of the image at different resolutions is effectively retained, thereby improving the segmentation ability and robustness of the model for lung F-FDG PET&CT images.

[0080] During the training process, various loss functions and optimization algorithms are used to guide the learning process of the model so that it can better fit the target clean data and accurately segment the tumor area from the input PET and CT images. The performance and generalization ability of the model can be further improved by adjusting the parameters and hyperparameters of the model, as well as by reasonably selecting training data and data enhancement techniques.

[0081] Step S5, training and optimizing the optimized 3D-DDPM using the training set and the validation set;

[0082] In step S6, the batch size is set to 1, and only a single volume of data is used for processing each time the model is trained. This setting effectively reduces memory consumption, speeds up training, and can better control the training process of the model, thereby improving the stability and convergence speed of the model. By limiting the batch size to 1, the error accumulation problem caused by batch processing can also be avoided, ensuring that the model can fully utilize the information of the data in each training step, thereby improving training efficiency and performance. Through random cropping operations, a small volume of 32×96×96mm³ is generated to train the model. Such cropping operations help increase the diversity of data and improve the model's ability to learn image features at different positions and scales, thereby improving the generalization ability and adaptability of the model. By limiting the size of the cropped volume, the training complexity of the model can be effectively controlled and the training speed can be accelerated.

[0083] By performing operations such as random rotation and flipping, more training samples are generated to increase the richness of the data, thereby effectively alleviating the overfitting problem and improving the generalization and robustness of the model. Through these operations, a model with excellent performance and strong generalization ability can be effectively trained, providing a reliable solution for the segmentation task of lung F-FDG PET&CT images.

[0084] Step S7: Use the test set to evaluate and verify the model.

[0085] It should be noted that the above content only illustrates the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.

Claims

1. A lung PET&CT image segmentation method based on a three-dimensional denoising diffusion model, characterized by: The following steps are involved: S1, divide the original data set into training set, validation set and test set, and resample and normalize these data sets; S2, the original DDPM structure was modified, all 2D operations, layers and noise were replaced by 3D, and the residual block was optimized; this includes using GroupNorm instead of BatchNorm, SiLU function instead of ReLU function, replacing 2D convolution layer with 3D convolution layer, and setting the step size to 1; at the same time, the U-Net network structure was also optimized, and the optimized U-Net utilized full-size skip connections and deep supervision; Full-scale skip connections transform the interconnections between the encoder and decoder and the inner connections between the decoder subnetworks. Each decoder layer combines the small-scale and same-scale feature maps from the encoder and the large-scale feature maps from the decoder, thereby capturing fine-grained details and coarse-grained semantics at all scales. In order to learn hierarchical representations from full-scale aggregated feature maps, full-scale deep supervision is adopted: the optimized U-Net produces a side output from each decoder stage, which is supervised by the ground truth. To achieve deep supervision, the last layer of each decoder stage is fed into a normal 3×3 convolution layer, followed by bilinear upsampling and a sigmoid function. In order to further enhance the boundaries of organs, a multi-scale structural similarity index loss function MS-SSIM is used. The greater the regional distribution difference, the higher the MS-SSIM value. Two corresponding batch data of size N×N are cut out from the segmentation result P and the ground truth G, which are represented as p={p j :j=1,...N 2 } and g={g j :j=1,...N 2 }; Define the MS-SSIM loss function of p and g as: Among them, μ p and μ g Represent the mean of the predicted image and the real image respectively; represents the variance of the predicted image, represents the variance of the real image; σ pg represents the covariance between the predicted image and the real image; C1 and C2 are small constants used to stabilize the denominator and are positive numbers to avoid division by zero errors; β m and γ m is a weight parameter used to adjust the impact of SSIM at different scales; M represents the number of scales used; S3, uses the Analytic-DPM-based method to optimize 3D-DDPM to improve the log-likelihood and the ability to generate high-quality samples while increasing the training speed; the optimization process starts with minimizing the KL divergence of the joint distribution, and makes adjustments and improvements to the DDPM algorithm; The DDPM parameters are obtained by optimizing the ELBO(L vb ), proving that minimizing the KL divergence of the joint distribution is equivalent to maximizing L vb ; Right now, Among them, D KL (p||q) is a measure of the difference between two probability distributions p and q; it represents the relative entropy of distribution p on distribution q; p(x 0:N ) is the joint distribution of the real data, q(x 0:N ) is the joint distribution of the generative model; Next, we start from minimizing the KL divergence of the joint distribution and split it into multiple moment matching optimizations; in, represents the distribution from the true distribution p(x 0:N ) is calculated based on the expected value of the sample; This ratio measures the difference between the true distribution p and the generated distribution q at each sample point; p(x N ) is the marginal distribution at time step N, q(x N ) is the marginal distribution of the generative model at time step N; When the number of steps is large enough, p(x N )≈q(x N )=N(0,I), the first term is approximately equal to 0; at this time, the KL divergence is split into the sum of the KL divergences at different times; due to the assumption that μ(x t ) and ∑(x t ) are all about x t , so minimizing the sum of the KL divergences at N moments is equivalent to minimizing the KL divergence at each moment; that is: Since we assume that q(x t-1 |x t )=N(μ t (x t ),∑ t (x t )); According to the conclusion of moment matching, the first-order moment and second-order moment of q are equal to the first-order moment and second-order moment of p, that is, the mean and variance of the two distributions are equal; using the idea of ​​maximum likelihood estimation and substituting it into the formula of KL divergence, we get in, is related to μ t (x t ),∑ t (x t ) is an irrelevant constant; p(x t-1 |x t ) means that at a given x t Under the condition, x t-1 The true distribution of q(x t-1 |x t ) means that at a given x t Under the condition of t-1 The generative model distribution of Represents the distribution from the true distribution p(x t-1 |x t ) t-1 Perform expectation calculations; μ t (x t ) and ∑ t (x t ) and set the result equal to 0, and we get: in, is the mean of the generative model at time step t, indicating that given x t Under the condition x t-1 Expected value; is the covariance matrix of the generative model at time step t, indicating that given x t Under the condition x t-1 The variance of Further simplify using the total expectation formula and total variance formula: Among them, p(x t-1 |x t ) means that at a given x t Under the condition, x t-1 The probability distribution of p(x0|x t ) means that at a given x t The probability distribution of x0 under the condition; Indicates x t-1 Under the given conditions x t Expected value; in, Indicates that at a given x t and x0, x t-1 The expected value of the variance of Indicates that at a given x t The variance of the expected value of x0 in the case of use Hehe express Hehe The entire derivation process is based on the solution of the mean and variance of the exponential family distribution, and the final expression is as follows: in, represents the mean of the optimized generative model at time step t; x t represents the state or observation value at the current time step t; β t Represents the decremental noise adjustment parameter, which is used in the diffusion model to control the intensity of the noise; Indicates x t The logarithmic probability density function logp(x t )’s gradient; α t represents the attenuation factor; I represents the unit matrix; S4, defines the target clean data as 3D tumor mask, which contains the precise location and shape information of the tumor area and becomes the target of model training and optimization; Target clean data refers to the real labeled data of lung adenoma used for training and evaluation, that is, the accurate boundary and morphological information of the tumor, which is used as the target of model training and the standard of evaluation; S5, set the batch size to 1, that is, only a single volume of data is processed each time the model is trained; during the training process, random cropping operations are performed to generate a volume of 32×96×96mm 3 The model is trained with a small volume and data augmentation techniques are used to enhance the diversity and quality of training data. Select data augmentation technology suitable for 3D medical images to increase the diversity and quantity of training samples and improve the generalization ability of the model; determine the data augmentation method and parameters according to the specific situation to ensure that the enhanced data maintains the structural integrity and information consistency of the medical image; set the batch size to 1, that is, the data input into the model each time is a single volume, to avoid the impact of batch effects on the model training process and ensure the model's processing ability for a single sample; random cropping operation refers to randomly selecting a subvolume from the original 3D medical image as a training sample to reduce memory consumption and speed up training; after data augmentation, prepare the training data set and perform preparatory work before model training, including setting training parameters; determine the model's evaluation indicators and training stop conditions so that the performance of the model can be monitored during the training process, and the parameters can be adjusted in time to improve the model's training effect.

2. The lung PET & CT image segmentation method based on a three-dimensional denoising diffusion model according to claim 1, characterized in that: In step S1, the original data set is divided into a training set, a validation set and a test set according to a specified ratio; the division of the data set is ensured to be reasonable, and the data sources for model training, validation and testing are guaranteed to be representative and independent; the spatial resolution of the original data set is resampled to 1×1×1mm using linear interpolation 3 , and uniformly adjust the volume size of the data set to 144×144×144mm 3 .