Medical image generation method and system based on diffusion model

By combining discrete autoencoder and diffusion model, a neural network encoder is constructed, the characteristics of cancer MRI image are extracted and the probability model of noise removal is improved, and the scale and time problems of the traditional model are solved, achieving efficient generation of high-fidelity synthetic images.

CN120235846APending Publication Date: 2025-07-01HAINAN NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510370613.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The lack of large data sets in the prior art makes it difficult to build models in cancer image analysis, and the traditional autoregression model is too large and the diffusion model is generated too long, making it difficult to generate high-quality synthetic cancer images.

Method used

Combining discrete autoencoder and diffusion model, by constructing a neural network encoder, the characteristics of cancer MRI image are extracted, compressed into discrete variables, and the noise addition mechanism of the denoising diffusion probability model is improved, and the decoder is trained to reconstruct the image and generate high-fidelity synthetic images.

Benefits of technology

It improves the speed and quality of cancer image generation, solves the scale and time problems of traditional models, and generates high-fidelity and diverse synthetic images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235846A_ABST
    Figure CN120235846A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a medical image generation method and system based on a diffusion model, and the method comprises the steps: carrying out the preprocessing of a cancer MRI image, and obtaining experimental data; introducing a continuous domain denoising diffusion probability model on the basis of a U-shaped substrate network based on a discrete variational auto-encoder, constructing a neural network encoder, and extracting features of a cancer MRI image; generating a quantitatively encoded cancer MRI image from the cancer MRI image; mapping the quantized and coded cancer MRI image into a discrete potential variable sequence, improving a noise adding mechanism of a de-noising diffusion probability model, and training a decoder to reconstruct the quantized and coded cancer MRI image to obtain a synthesized cancer image; determining a trained medical image generation model based on the evaluation indexes; generating a synthetic cancer image from the acquired cancer MRI image through a medical image generation model; according to the invention, the speed and quality of cancer image generation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to a method and system for generating medical images based on a diffusion model. Background Art

[0002] Deep learning mines a large amount of information in medical images, and then extracts, mines, analyzes, and predicts image features at a deeper level to assist physicians in making more accurate diagnosis and treatment decisions, which has become increasingly important in the research of cancer assisted diagnosis. However, a limitation of current medical image processing projects is the lack of large datasets. The collection of medical data is costly and laborious, and privacy issues limit publicly available medical datasets to thousands of instances, which poses challenges to data sharing. Deep learning-based cancer image analysis also faces the same problem. Therefore, how to build a model to generate high-fidelity synthetic cancer images from 3D cancer images for large-scale training and learning is the technical problem to be solved currently. Summary of the Invention

[0003] The purpose of the present invention is to provide a method and system for generating medical images based on a diffusion model, which can improve the speed and quality of cancer image generation.

[0004] To achieve the above purpose, the present invention provides the following technical solutions:

[0005] In the first aspect, an embodiment of the present invention provides a method for generating medical images based on a diffusion model, the method comprising the following steps:

[0006] S100, obtaining different types of cancer MRI images, preprocessing the cancer MRI images to obtain experimental data;

[0007] S200, introducing a continuous-domain denoising diffusion probability model on the basis of a U-shaped base network based on a discrete variational autoencoder to construct a neural network encoder, and inputting the experimental data into the constructed neural network encoder to iteratively learn and extract the features of the cancer MRI images;

[0008] S300, compressing the cancer MRI images into discrete variables through the neural network encoder, and fitting the joint distribution of the discrete variables through a diffusion model to obtain quantized-encoded cancer MRI images;

[0009] S400, mapping the quantized-encoded cancer MRI images into a sequence of discrete latent variables through an encoder, improving the noise addition mechanism of the denoising diffusion probability model, and training a decoder to reconstruct the quantized-encoded cancer MRI images to obtain synthetic cancer images;

[0010] S500. Calculate the evaluation metrics for the cancer MRI images and the corresponding synthetic cancer images. When the evaluation metrics meet the requirements, obtain the trained medical image generation model; generate synthetic cancer images from the collected cancer MRI images through the medical image generation model.

[0011] Preferably, step S200 includes:

[0012] S210. Construct a U-shaped base network based on a discrete variational autoencoder, and set the hyperparameters of the U-shaped base network; the hyperparameters include the learning rate, optimizer, weight decay, and batch size.

[0013] S220. Introduce a denoising diffusion probabilistic model in the continuous domain into the U-shaped base network, and add the discrete time steps used to adjust the denoising diffusion probabilistic model to the ResNet blocks in the architecture to obtain a neural network encoder.

[0014] S230. Input the experimental data into the neural network encoder for iterative learning to obtain a trained model; use the trained model to sample the scanned cancer MRI images and extract the features of the cancer MRI images.

[0015] Preferably, step S300 includes:

[0016] S310. Compress the cancer MRI images into discrete variables through a U-shaped base network based on a discrete variational autoencoder.

[0017] S320. Obtain the codebook of the neural network encoder, compress the discrete variables into latent vectors through the neural network encoder, and replace the latent vectors with the nearest neighbor codebook.

[0018] S330. Perform category-based discrete processing on the neighbor codebook to obtain diffusion models for each category, and use the diffusion models of the categories where each neighbor codebook is located as the joint distribution of the corresponding discrete variables to form a quantized-encoded cancer MRI image.

[0019] Preferably, in S400, improving the noise addition mechanism of the denoising diffusion probabilistic model and training the decoder to reconstruct the quantized-encoded cancer MRI image to obtain a synthetic cancer image includes:

[0020] S410. Perform noise addition processing on the denoising diffusion probabilistic model to generate an improved denoising diffusion probabilistic model.

[0021] S420. Use the improved denoising diffusion probabilistic model to perform noise addition processing on the discretized diffusion model to generate an improved diffusion model.

[0022] S430. Train a decoder to reconstruct the quantized and encoded cancer MRI images based on the improved diffusion model to obtain synthetic cancer images.

[0023] Preferably, step S410 includes:

[0024] S411. Establish a denoising diffusion probability model for the forward noise process, and add Gaussian noise with variance β t at time t to generate data x1 to x T ; where β t ∈(0, 1);

[0025] S412. Equate the data x T to an isotropic Gaussian distribution, sample the Gaussian distribution of x T based on the reverse distribution of the denoising diffusion probability model and run the discrete diffusion process in reverse to generate the improved denoising diffusion probability model q(x t-1 |x t ), so as to obtain the data x T as a sample from the denoising diffusion probability model of the forward noise process.

[0026] Preferably, the method further includes:

[0027] Sample any step of the noise conditional on the input x0 in the forward noise process to obtain the noise variance β t at any step size, and equivalently define the noise variance β t as the noise where, represents the noise variance at any time step.

[0028] Preferably, the method further includes:

[0029] Construct a noise model for the parameter in the noise variance, calculate the variance β t according to the noise model, and equivalently define the noise variance β t as the noise

[0030] The noise model for the parameter in the noise variance is:

[0031] where T represents the total number of time steps, t represents the index of the time step, and s represents the offset.

[0032] Preferably, the improved diffusion model is expressed as follows:

[0033]

[0034] Among them, Cat(x|p) is a categorical distribution parameterized by p, K represents the discretized categories, and z t ∈{1,2,...K}, represents the relevant probability distribution.

[0035] Preferably, in S500, calculating the evaluation metrics of the cancer MRI images and the corresponding synthetic cancer images includes:

[0036] S510, classifying the synthetic cancer images according to the categories of the input images to obtain synthetic images of different categories;

[0037] S520, comparing and evaluating the synthetic images of different categories with the real images of the corresponding categories, and calculating the evaluation metrics of the neural network encoder; the evaluation metrics include the correlation coefficient, the maximum mean difference, and the similarity metric.

[0038] In a second aspect, an embodiment of the present invention provides a medical image generation system based on a diffusion model, and the system includes:

[0039] At least one processor;

[0040] At least one memory for storing at least one program;

[0041] When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of the above.

[0042] The beneficial effects of the present invention are as follows: The present invention combines a discrete autoencoder and a diffusion model for the generation method of cancer images, that is, utilizes the advantages of the autoencoder and the diffusion model and solves the problems that the traditional autoregressive model is too large and the sampling time of the diffusion model is too long when generating images, and improves the quality of cancer image generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0044] Figure 1 is a schematic flowchart of a medical image generation method based on a diffusion model in an embodiment of the present invention;

[0045] Figure 2 is a flowchart framework diagram of a medical image generation method based on a diffusion model in an embodiment of the present invention;

[0046] Figure 3It is a schematic structural diagram of a medical image generation system based on a diffusion model in an embodiment of the present invention. Detailed implementation manners

[0047] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with embodiments and drawings to fully understand the purpose, solution and effects of the present invention. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0048] In related technologies, synthetic cancer images can play a key role in protecting privacy in medical images and can also be used for enhancing small medical data sets. At the same time, several breakthroughs in generative modeling have created new applications for synthetic medical images. For example, generative adversarial networks (GANs) are widely used in medical image synthesis, and the main trade-offs of generative models include fast sampling, diverse and realistic sample generation. However, this technology has serious limitations: First, training these models is complex, and mode collapse is a common problem, which means that the neural network cannot generate different samples. Second, even if mode collapse does not occur, the diversity of the images generated by these models is limited. To overcome these problems, Diffusion models have recently successfully generated different high-resolution photo-realistic images in unconditional and conditional settings. Such models can be used for various tasks, including data anonymization and enhancement, and discovering new morphological associations. Therefore, the concept of image generation based on the Diffusion model can be applied to the field of medical imaging.

[0049] A model combining a discrete autoencoder and Diffusion is used to generate cancer images, that is, the advantages of the autoencoder and the Diffusion model are utilized to solve the problems that traditional autoregressive models are too large and the sampling time of the Diffusion model is too long when generating images, and the quality of cancer image generation is improved.

[0050] Refer to Figure 1 and Figure 2 , the present invention provides a medical image generation method based on a diffusion model, and the method includes the following steps:

[0051] S100, obtain different types of cancer MRI images, preprocess the cancer MRI images to obtain experimental data; the cancer MRI images include prostate cancer MRI images, brain tumor MRI images and abdominal tumor MRI images;

[0052] Specifically, different types of cancer MRI images are collected, including prostate cancer MRI images, brain tumor MRI images, and abdominal tumor MRI images; the preprocessing includes non-parametric intensity normalization (N4 bias field correction), linear registration of a template with m degrees of freedom, and isotropic voxel resampling to an n-mm resolution.

[0053] It should be noted that the data of the present invention was collected from the Haikou People's Hospital of Central South University and the Affiliated Hospital of Xiangya School of Medicine. Doctors performed MRI scans on all patients and identified suspected cancers (prostate cancer, brain tumor, liver cancer). All examinations were carried out on a 3T scanner (Achieva 3T; Philips Healthcare, Eindhoven, Netherlands) using a 32-channel phased array coil. The dataset used has passed the ethical review of the relevant hospital and obtained the consent of the informed patients.

[0054] S200, on the basis of the U-shaped base network based on the discrete variational autoencoder, introduce a continuous-domain denoising diffusion probability model to construct a neural network encoder E, and input the experimental data into the constructed neural network encoder E for iterative learning to extract the features of cancer MRI images;

[0055] S300, compress the cancer MRI images into discrete variables through the neural network encoder E, fit the joint distribution of the discrete variables through the diffusion model, and obtain the quantized encoded cancer MRI images;

[0056] S400, map the quantized encoded cancer MRI images into a sequence of discrete latent variables through the encoder, improve the noise addition mechanism of the denoising diffusion probability model, and train the decoder to reconstruct the quantized encoded cancer MRI images to obtain synthetic cancer images;

[0057] S500, calculate the evaluation indexes of the cancer MRI images and the corresponding synthetic cancer images. When the evaluation indexes meet the index requirements, obtain the trained medical image generation model; generate synthetic cancer images from the collected cancer MRI images through the medical image generation model.

[0058] Specifically, evaluate the model for synthesizing high-fidelity images of cancer MRI images, calculate the similarity between the real cancer MRI images and the synthetic cancer images, and evaluate the authenticity and diversity of the cancer images generated by the model.

[0059] The present invention combines a discrete autoencoder and a diffusion model for a method of generating cancer images, that is, utilizes the advantages of the autoencoder and the diffusion model and solves the problems that the traditional autoregressive model is too large and the sampling time of the diffusion model is too long when generating images, and improves the quality of cancer image generation.

[0060] In some improved embodiments, in S200, based on the U-shaped base network of the discrete variational autoencoder, a continuous-domain denoising diffusion probabilistic model is introduced to construct a neural network encoder E, and the experimental data is input into the constructed neural network encoder E for iterative learning to extract the features of cancer MRI images, including:

[0061] S210, construct a U-shaped base network based on the discrete variational autoencoder, and set the hyperparameters of the U-shaped base network; the hyperparameters include the learning rate, optimizer, weight decay, and batch size;

[0062] In this step, the learning rate is denoted as {l1 to l n}, the optimizer is denoted as {ADAM, ADAM with weight decay}, the weight decay is denoted as (between A1 and A2), and the batch size is denoted as {b1...b n}; specifically, the learning rate is set to {1e-3 to 1e-6}, the optimizer is set to {ADAM, ADAM with weight decay}, the weight decay is set to be between 0.1 and 0.0004, and the batch size is set to {2, 3, 4, 8, 16};

[0063] The ADAM (Adaptive Moment Estimation optimizer) is an optimization algorithm widely used in deep learning. The Discrete Variational Autoencoder (DVAE) is an extension of the Variational Autoencoder (VAE) specifically for processing discrete data, and the U-shaped base network (Convolutional Networks for Biomedical Image Segmentation, U-Net) is a convolutional neural network designed specifically for image segmentation tasks.

[0064] S220, introduce a continuous-domain denoising diffusion probabilistic model into the U-shaped base network, and add the discrete time steps used to adjust the denoising diffusion probabilistic model to the ResNet blocks of the architecture to obtain the neural network encoder E;

[0065] Specifically, the Denoising Diffusion Probabilistic Model (DDPM) is a generative model, and its core idea is to simulate the diffusion process of data and then learn the reverse denoising process to generate data; by introducing a continuous-domain denoising diffusion probabilistic model (DDPM) into the U-shaped base network, the discrete time steps are used to adjust the model and added to the ResNet blocks of the architecture to obtain the neural network encoder E;

[0066] ResNet (Residual Network) is a deep CNN that solves the problems of gradient vanishing and representation bottleneck in deep neural networks by introducing residual blocks. U-Net is a convolutional neural network for image segmentation, whose structure is similar to an encoder-decoder, capable of capturing the context information of images and restoring detailed spatial information. Combining ResNet and U-Net, an image segmentation model with both deep feature extraction capabilities and the ability to maintain high-resolution spatial information can be constructed.

[0067] S230, input the experimental data into the neural network encoder E for iterative learning to obtain a trained model; use the trained model to sample the scanned cancer MRI images and extract the features of the cancer MRI images.

[0068] Specifically, sample the cancer MRI images obtained from the scanned images through different schedulers.

[0069] In some improved embodiments, in S300, the cancer MRI images are compressed into discrete variables by the neural network encoder E, and the joint distribution of the discrete variables is fitted by a diffusion model to obtain the quantized and encoded cancer MRI images, including:

[0070] S310, compress the cancer MRI images into discrete variables by a U-shaped base network based on a discrete variational autoencoder;

[0071] S320, obtain the codebook of the neural network encoder E, compress the discrete variables into latent vectors by the neural network encoder E, and replace the latent vectors with the nearest neighbor codebook;

[0072] Specifically, given a codebook Z, compress the high-dimensional input data x (not a discrete variable) into a latent vector h by the neural network encoder E, and replace the vector h k with the vector h i,j ∈h; where, z k ∈Z, Z∈R K×d and x∈R c ×H×W and h∈R h×w×d Here, z represents the quantized latent vector h, K represents the capacity of the latent variance in the codebook, and d represents the dimension of the latent variance.

[0073] S330, perform category-wise discrete processing on the neighbor codebook to obtain diffusion models for each category, and use the diffusion models of the categories where each neighbor codebook is located as the joint distribution of the corresponding discrete variables to form the quantized and encoded cancer MRI images.

[0074] Specifically, assume that the C categories in the codebook are discretized, that is, z t∈{1,...,C}, and use z t ∈{0,1} C to represent the one - hot vector, and the probability distribution corresponding to z t is represented by . The diffusion model q(z t |z t-1 ) after discrete processing is as follows:

[0075]

[0076] where Cat(x|p) is the categorical distribution function parameterized by p, Q t represents the process transition matrix, q(z t |z t-1 ) represents the diffusion model after discrete processing, z t represents the one - hot vector of the t - th category, and z t-1 represents the one - hot vector of the (t - 1) - th category. The process transition matrix Q t is set as: Q t =(1 - β t )I+β t / C, where β t represents the variance calculated by the noise model, and I represents the input image matrix.

[0077] In some improved embodiments, in S400, the noise - adding mechanism of the improved denoising diffusion probability model is improved, and the decoder is trained to reconstruct the quantized - encoded cancer MRI image to obtain a synthetic cancer image, including:

[0078] S410, perform noise - adding processing on the denoising diffusion probability model to generate an improved denoising diffusion probability model;

[0079] S420, use the improved denoising diffusion probability model to perform noise - adding processing on the diffusion model after discrete processing to generate an improved diffusion model:

[0080] S430, based on the improved diffusion model, train the decoder to reconstruct the quantized - encoded cancer MRI image to obtain a synthetic cancer image.

[0081] In some improved embodiments, S410 specifically includes the following steps:

[0082] S411, establish a denoising diffusion probability model for the forward noise process, add Gaussian noise with variance β t at time t in the denoising diffusion probability model to generate data x1 to x T ; β t ∈(0,1);

[0083] Specifically, given a set of data distributions \(x_0\sim q(x_0)\), where \(q\) is the forward noise process, the denoising diffusion probability model of the forward noise process is defined as follows:

[0084]

[0085] where \(q(x t |x t-1 ) represents the posterior probability, \(x T \) represents the generated data, \(q(x_1,...,x T |x_0)\) represents the denoising diffusion probability, \(T\) represents the total number of time steps, and \(T\) is a number that can be defined by oneself. In this embodiment, it is set to 1000.

[0086] In the forward noise process \(q\), by adding Gaussian noise with variance \(\beta t \in(0,1)\) at time \(t\), data \(x_1\) to \(x T \) are generated.

[0087] S412. Equate the data \(x T \) to an isotropic Gaussian distribution, sample the Gaussian distribution of \(x T \) based on the reverse distribution of the denoising diffusion probability model and run the discrete diffusion process in reverse to generate an improved denoising diffusion probability model \(q(x t-1 |x t )\) to obtain the data \(x T \) as a sample from the denoising diffusion probability model of the forward noise process.

[0088] Specifically, given a sufficiently large \(T\) with variance \(\beta t \), then \(x T \) is almost equivalent to an isotropic Gaussian distribution. Given the exact reverse distribution \(q(x t-1 |x t )\), sample \(x T \sim N(0, I)\) and run the process in reverse to obtain the data \(x T \) from \(q(x_0)\) and use it as a sample.

[0089] Running the discrete diffusion process in reverse is the process of solving \(q(x t-1 |x t )\). However, since \(q(x t-1 |x t )\) depends on the entire data distribution, the expression of the neural network encoder \(E\) is approximated as follows:

[0090] p θ (x t-1 |x t ):=N(x t-1 ;\(\mu θ (xt , t), Σ θ (x t , t)) (4);

[0091] The combination of q and p is a variational autoencoder, and the variational lower bound (VLB) can be written as follows:

[0092] L vlb :=L0 + L1 +... + L T-1 + L T (5);

[0093] L0:=-logp θ (x0|x1) (6);

[0094] L t-1 :=D KL (q(x t-1 |x t , x0)||p θ (x t-1 |x t )) (7);

[0095] L T :=D KL (q(x T |x0)||p(x T )) (8);

[0096] Among them, except for L0, each term in equation (4) is the KL divergence between two Gaussian distributions, so it can be evaluated in a closed form. To evaluate L0 of the image, assuming that each color component is divided into 256 intervals, calculate the probability that p θ (x0|x1) falls into the correct interval (which can be handled using the CDF of the Gaussian distribution). Also note that although L T does not depend on θ, if the forward noise process sufficiently destroys the data distribution such that q(x T |x0)≈N(0, I), then L T will be close to 0.

[0097] In some improved embodiments, the method further includes:

[0098] Sampling any step of the noise conditioned on the input x0 in the forward noise process to obtain the noise variance of any step length, and equivalently defining the noise variance as noise.

[0099] Specifically, the noise process defined in formula (3) allows sampling of any step of the noise directly conditioned on the input x0. When α t :=1 - β t and When q(x t |x0) can be defined as follows:

[0100]

[0101] Wherein, represents the noise variance at any time step, can be equivalently used to define the noise variance β t .

[0102] In some improved embodiments, the method further includes:

[0103] is a parameter in the noise variance Construct a noise model, and calculate the variance β according to the noise model t , and the noise variance β t is equivalently defined as noise

[0104] Specifically, for the denoising diffusion probability model that cannot generate high-quality synthetic cancer images on images with small resolutions, to Construct a different noise model, defined as follows:

[0105]

[0106] Thus, the variance β is defined and calculated t , then

[0107] Design a cosine schedule with a linear decrease in the middle of the noise addition process by , and change very little near the extreme values of t = 0 and t = T to prevent sudden changes in the noise level. Use a small offset s to prevent β t from being too small near t = 0.

[0108] It should be noted that z t has a probability of 1-β t to maintain the state of the previous time step, and has a chance of β t to resample from a uniform categorical distribution.

[0109] Therefore, in some improved embodiments, the improved diffusion model is represented as follows:

[0110]

[0111] Wherein, Cat(x|p) is a categorical distribution parameterized by p, K represents the discretized categories, z t ∈{1,2,...K}, represents the relevant probability distribution.

[0112] According to the noise addition mechanism in the improved diffusion model, the process from z0 to z t is represented as follows:

[0113]

[0114] The posterior distribution is calculated by formula (4) and Bayes' rule as follows:

[0115]

[0116] where Q t represents the process transfer matrix, Q t =(1 - β t )I + β t / K, Ι represents the input image matrix, α t =1 - β t .

[0117] In some improved embodiments, in S500, calculating the evaluation metrics of the cancer MRI image and the corresponding synthetic cancer image includes:

[0118] S510, classifying the synthetic cancer image according to the category of the input image to obtain synthetic images of different categories;

[0119] S520, comparing and evaluating the synthetic images of different categories with the real images of the corresponding categories, and calculating the evaluation metrics of the neural network encoder E; the evaluation metrics include the correlation coefficient, the maximum mean difference, and the similarity metric.

[0120] The evaluation metrics include the correlation coefficient (CC), the maximum mean difference (MMD), and the similarity metric (SSIM).

[0121] They are defined as follows:

[0122]

[0123] where A i and B i represent the real image and the synthetic image produced by the model of the i-th scanned slice, respectively.

[0124]

[0125] where f represents the reproducing kernel Hilbert space, ||f|| H ≤1 means that the norm of the function f is constrained within 1.

[0126]

[0127] where x and y represent the real image and the generated image, μ x and μy represent the means of images x and y, respectively, and σ x and σ y represent the standard deviations of images x and y, respectively.

[0128] To verify the accuracy of the method, the method in the embodiment is used to analyze cancer medical record images. The evaluation results of the cancer image generation results are shown in Table 1. The method proposed by the present invention has been greatly improved in terms of the correlation coefficient (CC), maximum mean difference (MMD), and similarity metric (SSIM).

[0129] Table 1:

[0130]

[0131]

[0132] Compared with Figure 1 the method of Figure 3 and referring to

[0133] at least one processor;

[0134] at least one memory for storing at least one program;

[0135] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0136] It can be seen that the content in the above method embodiments is applicable to the system embodiments of the present invention. The functions specifically implemented by the system embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0137] In addition, the embodiments of the present invention also disclose a computer program product or a computer program. The computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the content in the above method embodiments is applicable to the storage medium embodiments of the present invention. The functions specifically implemented by the storage medium embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0138] Those of ordinary skill in the art will appreciate that all or some of the methods and systems disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media.

[0139] The above is a specific description of the preferred embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present disclosure, and these equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for generating medical images based on a diffusion model, characterized in that: The method comprises the following steps: S100, acquiring different types of cancer MRI images, and preprocessing the cancer MRI images to obtain experimental data; S200, based on the U-shaped basis network based on discrete variational autoencoder, introduces the continuous domain denoising diffusion probability model, constructs a neural network encoder, and inputs the experimental data into the constructed neural network encoder to iteratively learn and extract the features of cancer MRI images; S300, compressing the cancer MRI image into discrete variables through a neural network encoder, fitting the joint distribution of the discrete variables through a diffusion model, and obtaining a quantized encoded cancer MRI image; S400, mapping the quantized encoded cancer MRI image into a discrete latent variable sequence through an encoder, improving the denoising mechanism of the denoising diffusion probability model, and training a decoder to reconstruct the quantized encoded cancer MRI image to obtain a synthetic cancer image; S500, calculating evaluation indicators of cancer MRI images and corresponding synthetic cancer images, and obtaining a trained medical image generation model when the evaluation indicators meet the indicator requirements; and generating synthetic cancer images from the collected cancer MRI images through the medical image generation model.

2. The method according to claim 1, characterized in that Step S200 includes: S210, constructing a U-shaped basis network based on a discrete variational autoencoder, and setting hyperparameters of the U-shaped basis network; the hyperparameters include a learning rate, an optimizer, weight decay, and a batch size; S220, introducing a denoising diffusion probability model of a continuous domain into the U-shaped basis network, adding a discrete time step for adjusting the denoising diffusion probability model to a ResNet block of the architecture, and obtaining a neural network encoder; S230, inputting the experimental data into the neural network encoder for iterative learning to obtain a trained model; using the trained model to sample the scanned cancer MRI image to extract features of the cancer MRI image.

3. The method according to claim 2, characterized in that Step S300 includes: S310, compressing cancer MRI images into discrete variables via a U-shaped basis network based on discrete variational autoencoders; S320, obtaining a codebook of a neural network encoder, compressing discrete variables into latent vectors through the neural network encoder, and replacing the latent vectors with a nearest neighbor codebook; S330 , performing discretization processing on the neighbor codebooks by category to obtain diffusion models of each category, and using the diffusion models of the categories of each neighbor codebook as joint distributions of corresponding discrete variables to form quantized coded cancer MRI images.

4. The method according to claim 3, characterized in that In S400, the denoising mechanism of the improved denoising diffusion probability model and the training of the decoder to reconstruct the quantized encoded cancer MRI image to obtain a synthetic cancer image include: S410, performing noise processing on the denoised diffusion probability model to generate an improved denoised diffusion probability model; S420, using an improved denoising diffusion probability model to perform noise processing on the diffusion model after the discrete processing, to generate an improved diffusion model: S430, reconstructing the quantized encoded cancer MRI image based on the improved diffusion model training decoder to obtain a synthetic cancer image.

5. The method according to claim 4, characterized in that Step S410 includes: S411, establish a denoising diffusion probability model for the forward noise process, and add a variance of β to the denoising diffusion probability model t The time t Gaussian noise is generated to generate data x1 to x T ; where β t ∈(0,1); S412, data x T is equivalent to an isotropic Gaussian distribution, and the inverse distribution of x based on the denoising diffusion probability model T The Gaussian distribution of is sampled and the discrete diffusion process is run in reverse to generate an improved denoising diffusion probability model q(x t-1 |x t ), to obtain the sample data x from the denoised diffusion probability model of the forward noise process T .

6. The method according to claim 5, characterized in that The method further comprises: In the forward noise process, sample any step of the noise conditioned on the input x0 to obtain the noise variance β of any step length t , the noise variance β t Equivalent definition is noise in, represents the noise variance at any time step.

7. The method according to claim 6, characterized in that The method further comprises: is the parameter in the noise variance Construct a noise model and calculate the variance β according to the noise model t , the noise variance β t Equivalent definition is noise The noise variance parameter The noise model is: Where T represents the total number of time steps, t represents the index of the time step, and s represents the offset.

8. The method according to claim 7, characterized in that The improved diffusion model is expressed as follows: Among them, Cat(x|p) is the categorical distribution parameterized by p, K represents the discretized category, and z t ∈{1,2,...K}, represents the associated probability distribution.

9. The method according to claim 1, characterized in that: In S500, the step of calculating the evaluation index of the cancer MRI image and the corresponding synthetic cancer image includes: S510, classifying the synthesized cancer image according to the category of the input image to obtain synthesized images of different categories; S520, comparing and evaluating the synthetic images of different categories with the real images of the corresponding categories, and calculating the evaluation index of the neural network encoder; the evaluation index includes the correlation coefficient, the maximum average difference and the similarity measure.

10. A medical image generation system based on a diffusion model, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 9.