Medical image anomaly detection method and system
The anatomical structure and disease-specific encoding in medical images were extracted through feature de-entanglement encoder, and a conditional denoising diffusion probability model was used to generate healthy images, which solved the problems of low detection accuracy and high false alarm rate in the prior art, and achieved efficient and accurate medical image abnormality detection.
Patent Information
- Application Number
- CN202411927429.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The existing medical imaging abnormality detection methods are not very accurate when dealing with fuzzy boundaries and changing lesions, and require time-consuming and labor-intensive pixel-level annotation. The denoising and diffusion probability model is prone to damage anatomical information during the image denoising process, resulting in high false alarm rates.
Anatomical structure encoding and disease-specific encoding are extracted using a feature de-entanglement encoder, and a conditional denoising diffusion probability model is used to generate healthy images. By comparing abnormal images with generated healthy images, the abnormal areas are obtained.
It improves the accuracy and efficiency of medical imaging abnormality detection, reduces the need for pixel-level annotations, and reduces the false alarm rate while keeping the anatomical information unchanged, achieving high-quality detection results.
Smart Images

Figure CN119850556A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical image anomaly detection, and more specifically, to a medical image anomaly detection method and system. Background Art
[0002] Medical anomaly detection is applied in medical imaging to locate lesions in various organs.
[0003] Considering that medical imaging data is becoming increasingly complex, traditional manual detection is time-consuming and error-prone, which places a great burden on radiologists. Medical imaging anomaly detection methods based on deep learning are gradually being used. However, the boundaries of medical images are relatively fuzzy, and the location and shape of lesions often change, so the detection accuracy is not high. At the same time, in order to obtain accurate anomaly detection results, medical imaging anomaly detection methods based on traditional deep learning require pixel-level annotation of lesions, which is time-consuming and labor-intensive.
[0004] The prior art discloses a method for detecting abnormalities in brain tumors based on an improved diffusion model. The method comprises: obtaining brain slice image data, the brain slice image data comprising normal brain slice images and abnormal brain slice images, preprocessing the normal brain slice images, and dividing the preprocessed normal brain slice images into a training set and a test set; establishing an abnormality detection model, inputting the training set and the test set into the abnormality detection model to realize the training and testing of the model; reconstructing the normal brain slice image through the abnormality detection model for output, and performing a difference between the input abnormal brain slice image and the output normal brain slice image to realize the detection of abnormal parts. In the abnormality detection of medical images, anatomical information plays a vital role. In recent years, denoising diffusion probability models (DDPMs) have been applied in unsupervised anomaly detection due to their powerful capabilities in distribution modeling and image generation. However, DDPMs are prone to damage anatomical information during image denoising, resulting in a high false alarm rate, which limits their detection performance. Summary of the invention
[0005] The present invention aims at the defect of poor detection quality of the detection method in the prior art, and provides a medical image abnormality detection method and system. The detection method has high detection quality.
[0006] The primary purpose of the present invention is to solve the above technical problems. The technical solution of the present invention is as follows:
[0007] A medical image abnormality detection method, comprising:
[0008] S1: Obtain preprocessed standardized medical images;
[0009] S2: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model;
[0010] S3: Use the trained feature disentanglement encoder to extract anatomical structure codes and disease-specific codes that do not involve disease information in the preprocessed normalized medical images;
[0011] S4: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes;
[0012] S5: Compare the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area.
[0013] Furthermore, in step S1, the preprocessing includes: scaling each medical image in the normalized medical image, and then performing standardization processing.
[0014] Furthermore, the feature disentanglement encoder comprises: an anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), disease-specific encoder E d (x), disease-specific discriminator D d (E d (x));
[0015] The anatomical structure encoder E a (x) Used to extract anatomical structure codes that do not involve disease information a ; Based on the adversarial learning strategy, using the anatomical structure discriminator D a (E a (x)) Determine z a Whether it involves disease information and trains the encoder E a (x) to mislead the anatomical structure discriminator D a (E a (x)), making the disease information unrecognizable; construct the first loss function and train the anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), the first loss function expression is constructed as:
[0016]
[0017] Where y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image; Based on the first loss function, the anatomical structure encoder E is trained a (x), anatomical structure discriminator D a (E a (x));
[0018] The disease-specific encoder E d (x) is used to extract disease-specific codes z d ; Training disease-specific encoder E based on minimum binary cross entropy loss d (x) and disease-specific discriminator D d (E d (x)) to determine z d Whether it involves abnormal area information, the minimum binary cross entropy loss function is:
[0019]
[0020] Among them, y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image.
[0021] Furthermore, the standardized medical images include healthy images and abnormal images, wherein the anatomical structure code z a It includes anatomical structure coding that does not involve disease information in healthy images and anatomical structure coding that does not involve disease information in abnormal images; the disease-specific coding: d Includes disease-specific codes in healthy images that do not involve disease information and disease-specific codes in abnormal images that do not involve disease information;
[0022] During training, a data set is obtained, wherein the data set includes a healthy image set and an abnormal image set, and the data set is divided into a training set and a test set, wherein both the training set and the test set include a healthy image set and an abnormal image set, and the training set is used to train a feature disentanglement encoder. When the first loss function and the minimized binary cross loss function converge, the training is completed, and a trained feature disentanglement encoder is obtained.
[0023] Furthermore, the conditional denoising diffusion probability model includes a forward diffusion unit and a reverse denoising unit;
[0024] The healthy image set is divided into a training set and a test set. The training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. By fixing the Markov chain, Gaussian noise is gradually added after T iterations to destroy the healthy image x0 of the training set. At the time step t∈{1,…,T}, the sample x0 destroyed by the noise t It obeys the multivariate normal distribution, expressed as:
[0025]
[0026] represents normal distribution, β t ∈[0,1] represents a predefined scaling factor. Given x0, x t It can be directly sampled from x0 as shown in the following formula: I represents the identity matrix, t represents the time step number; q represents noise;
[0027]
[0028] α represents the derived intermediate quantity, α t : =1-β t ,
[0029] The reverse denoising process is implemented in the reverse denoising unit. At the t step, the healthy image x to which Gaussian noise has been added is t Denoising, the condition {E a (x), E d (x)}, expressed as:
[0030]
[0031] Only predict the mean μ θ (x t , E a (x), E d (x), t), variance σ t is a predefined quantity that depends on the time step t, based on the parameterization technique μ θ (x t , E a (x), E d (x), t) is modeled as follows:
[0032]
[0033] In the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate healthy images It is expressed as:
[0034]
[0035] The forward diffusion unit and the reverse denoising unit are trained. During the training process, the expression of minimizing the loss function is as follows:
[0036]
[0037] And the introduction of structural similarity loss further enhances the health image The consistency with the local pixel intensity of x0
[0038]
[0039] Among them, |·| 1,2 It is the sum of the l1 and l2 norm loss functions; ssim represents an indicator used to measure the similarity between two images;
[0040] Similarly, the abnormal image set is divided into a training set and a test set, and the training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. Through a fixed Markov chain, Gaussian noise is gradually added after T iterations to destroy the abnormal images of the training set.
[0041] The reverse denoising process is implemented in the reverse denoising unit. At step t, the abnormal image x to which Gaussian noise has been added is t Denoising, in the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate abnormal images
[0042] Furthermore, the conditional denoising diffusion probability model further includes: a translation unit;
[0043] The conditional denoising diffusion probability model uses a cyclic translation mechanism to further train the conditional denoising diffusion probability model, and the process is:
[0044] The abnormal image x generated by the healthy image h,u Healthy image x generated from abnormal image u,h are input into the feature disentanglement encoder to extract the anatomical structure code {E a (x u,h ), E d (x u,h )} and disease-specific codes {E a (x h,u ), E d (x h,u )}, construct the conditional cycle inconsistency loss for exchanging disease-specific encodings, expressed as:
[0045]
[0046] x u,h represents the conditional denoising diffusion probability model for x u is the generated healthy image for input, x h represents the input healthy image, x h,u represents the conditional denoising diffusion probability model for x h is the abnormal image generated by the input, x u represents the input abnormal image, G represents the conditional denoising diffusion probability model, E a represents the anatomical structure encoder, E d represents a disease-specific encoder, represents the expectation, t represents the time step number, represents the conditional denoising diffusion probability model for step t x h The abnormal image generated for the input, represents the conditional denoising diffusion probability model for step t x u Healthy images generated for input.
[0047] Furthermore, the abnormal image is input into the disease-specific encoder E d Extract disease-specific codes d ; Input the healthy image into the anatomical structure encoder E a Extract anatomical structure code z a ; z a and z d Healthy images are generated as conditional input to the conditional denoising diffusion probability model.
[0048] Furthermore, the process of comparing the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area in step S5 is: obtaining the abnormal image in the preprocessed normalized medical image, calculating the mean square error between the abnormal image and the generated healthy image, and obtaining the abnormal area.
[0049] Furthermore, the method further includes: after obtaining the abnormal area result in S6, performing area under the precision-recall curve, mean square error, peak signal-to-noise ratio and / or structural similarity index measurement to verify the abnormality detection effect of the conditional denoising diffusion probability model.
[0050] A medical image anomaly detection system, comprising:
[0051] Preprocessing module: obtain preprocessed standardized medical images;
[0052] Training module: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model;
[0053] Code extraction module: Use the trained feature disentanglement encoder to extract the anatomical structure code and disease-specific code that do not involve disease information in the preprocessed normalized medical images;
[0054] Reasoning module: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes;
[0055] Post-processing module: compare the abnormal image in the pre-processed normalized medical image with its corresponding generated healthy image to obtain the abnormal area.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] The present invention learns the anatomical structure and disease-specific coding of the image through the encoder of the disentanglement module, and performs high-quality image conversion on the abnormal image based on the denoising diffusion probability model combined with the anatomical structure and disease specificity. The generated healthy version of the image can keep the anatomical information unchanged, thereby achieving accurate detection of abnormal areas. In general, the detection method has high detection quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flowchart of the medical image anomaly detection method provided in Example 1.
[0059] Figure 2 The data flow diagram of the first stage of the loop translation mechanism provided in Example 2.
[0060] Figure 3 The data flow diagram for the second stage of the loop translation mechanism provided in Example 2.
[0061] Figure 4 Structural diagram of the anatomical structure encoder provided for Example 2.
[0062] Figure 5 Schematic diagram of the principle of the anatomical structure encoder provided in Example 2.
[0063] Figure 6 A structural diagram of the disease-specific encoder provided for Example 2.
[0064] Figure 7 Schematic diagram of the principle of the disease-specific encoder provided in Example 2.
[0065] Figure 8 A structural diagram of the anatomical structure discriminator provided in Example 2.
[0066] Fig. 9 Schematic diagram of the principle of the anatomical structure discriminator provided in Example 2.
[0067] Fig.10 This is a structural diagram of the disease-specific discriminator provided in Example 2.
[0068] Fig.11 This is a schematic diagram of the principle of the disease-specific discriminator provided in Example 2.
[0069] Fig.12 This is a structural diagram of the image generation unit provided in Example 2.
[0070] Fig.13 This is a schematic diagram of the principle of the image generation unit provided in Example 2.
[0071] Fig.14 A schematic diagram of the principles of training the medical image anomaly detection model provided in Example 2.
[0072] Fig.15 A schematic diagram of the reasoning principle of the medical image anomaly detection model provided in Example 2. DETAILED DESCRIPTION
[0073] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;
[0074] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;
[0075] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0076] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0077] Example 1
[0078] This embodiment proposes a medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model. The implementation process of the method is as follows: Figure 1 As shown, including:
[0079] S1: Obtain preprocessed standardized medical images;
[0080] S2: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model;
[0081] S3: Use the trained feature disentanglement encoder to extract anatomical structure codes and disease-specific codes that do not involve disease information in the preprocessed normalized medical images;
[0082] S4: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes;
[0083] S5: Compare the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area.
[0084] This embodiment obtains a preprocessed normalized medical image; constructs and trains a medical image anomaly detection model to obtain a trained medical image anomaly detection model, including a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model; uses the trained feature disentanglement encoder to extract anatomical structure codes and disease-specific codes that do not involve disease information in the preprocessed normalized medical image; uses the trained conditional denoising diffusion probability model to generate a healthy image with the anatomical structure code and the disease-specific code as conditions; compares the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area. The feature disentanglement encoder separates the anatomical structure code and the disease-specific code from the image, so that the conditional denoising diffusion probability model can perform accurate image conversion with the disentanglement code as a condition, so that the disease label and anatomical information are controlled, thereby realizing image generation efficiently and accurately, and having significant clinical application value. At the same time, the anatomical structure code and the disease-specific code extracted in advance make the conditional denoising diffusion probability model less restricted in adding noise, and there is no need to consider the situation where the anatomical structure and disease-specific code are damaged, so that a good effect can be obtained using a small amount of training data. Overall, this detection method has low training data requirements and high detection quality.
[0085] Example 2
[0086] Based on the medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model described in Example 1, that is, this embodiment adopts the same medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model as Example 1.
[0087] Furthermore, in step S1, the preprocessing includes: scaling each medical image in the normalized medical image, and then performing standardization processing.
[0088] In a specific embodiment, the medical image is scaled to obtain an image of 256x256 pixels.
[0089] Furthermore, the formula for the standardization process is as follows:
[0090]
[0091] Among them, x 0.05is the 0.05 lower quantile of all pixel values of x, 0.95 is the 0.95 upper quantile of all pixel values of x, x 缩 Represents a scaled medical image.
[0092] Furthermore, the feature disentanglement encoder comprises: an anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), disease-specific encoder E d (x), disease-specific discriminator D d (E d (x));
[0093] The anatomical structure encoder E a (x) Used to extract anatomical structure codes that do not involve disease information a ; Based on the adversarial learning strategy, using the anatomical structure discriminator D a (E a (x)) Determine z a Whether it involves disease information and trains the encoder E a (x) to mislead the anatomical structure discriminator D a (E a (x)), making the disease information unrecognizable; construct the first loss function and train the anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), the first loss function expression is constructed as:
[0094]
[0095] Where y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image; Based on the first loss function, the anatomical structure encoder E is trained a (x), anatomical structure discriminator D a (E a (x)), express expectations;
[0096] The disease-specific encoder E d (x) is used to extract disease-specific codes z d ; Training disease-specific encoder E based on minimum binary cross entropy loss d (x) and disease-specific discriminator D d (E d (x)) to determine z d Whether it involves abnormal area information, the minimum binary cross entropy loss function is:
[0097]
[0098] Where y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image. Express expectations.
[0099] Furthermore, the standardized medical images include healthy images and abnormal images, wherein the anatomical structure code z a It includes anatomical structure coding that does not involve disease information in healthy images and anatomical structure coding that does not involve disease information in abnormal images; the disease-specific coding: d Includes disease-specific codes in healthy images that do not involve disease information and disease-specific codes in abnormal images that do not involve disease information;
[0100] During training, a data set is obtained, wherein the data set includes a healthy image set and an abnormal image set, and the data set is divided into a training set and a test set, wherein both the training set and the test set include a healthy image set and an abnormal image set, and the training set is used to train a feature disentanglement encoder. When the first loss function and the minimized binary cross loss function converge, the training is completed, and a trained feature disentanglement encoder is obtained.
[0101] Furthermore, the conditional denoising diffusion probability model includes a forward diffusion unit and a reverse denoising unit;
[0102] The healthy image set is divided into a training set and a test set. The training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. By fixing the Markov chain, Gaussian noise is gradually added after T iterations to destroy the healthy image x0 of the training set. At the time step t∈{1,…,T}, the sample x0 destroyed by the noise t It obeys the multivariate normal distribution, expressed as:
[0103]
[0104] represents normal distribution, β t ∈[0, 1] represents a predefined scaling factor. Given x0, x t It can be directly sampled from x0 as shown in the following formula: I represents the identity matrix, t represents the time step number; q represents noise;
[0105]
[0106] α represents the derived intermediate quantity, α t : =1-β t ,
[0107] The reverse denoising process is implemented in the reverse denoising unit. At the t step, the healthy image x to which Gaussian noise has been added is t Denoising, the condition {E a (x), E d (x)}, expressed as:
[0108]
[0109] Only predict the mean μ θ (x t , E a (x),E d (x), t), variance σ t is a predefined quantity that depends on the time step t, based on the parameterization technique μ θ (x t , E a (x), E d (x), t) is modeled as follows:
[0110]
[0111] In the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate healthy images It is expressed as:
[0112]
[0113] The forward diffusion unit and the reverse denoising unit are trained. During the training process, the expression of minimizing the loss function is as follows:
[0114]
[0115] And the introduction of structural similarity loss further enhances the health image The consistency with the local pixel intensity of x0
[0116]
[0117] Among them, |·| 1,2 It is the sum of the l1 and l2 norm loss functions; ssim represents an indicator used to measure the similarity between two images;
[0118] In a specific embodiment, the two loss functions are combined as follows
[0119]
[0120] Similarly, the abnormal image set is divided into a training set and a test set, and the training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. Through a fixed Markov chain, Gaussian noise is gradually added after T iterations to destroy the abnormal images of the training set.
[0121] The reverse denoising process is implemented in the reverse denoising unit. At step t, the abnormal image x to which Gaussian noise has been added is t Denoising, in the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate abnormal images
[0122] Furthermore, the conditional denoising diffusion probability model further includes: a translation unit;
[0123] The conditional denoising diffusion probability model uses a cyclic translation mechanism to further train the conditional denoising diffusion probability model, and the process is:
[0124] The abnormal image x generated by the healthy image h,u Healthy image x generated from abnormal image u,h are input into the feature disentanglement encoder to extract the anatomical structure code {E a (x u,h ), E d (x u,h )} and disease-specific codes {E a (x h,u ), E d (x h,u )}, construct the conditional cycle inconsistency loss for exchanging disease-specific encodings, expressed as:
[0125]
[0126] x u,h represents the conditional denoising diffusion probability model for x u is the generated healthy image for input, x h represents the input healthy image, x h,u represents the conditional denoising diffusion probability model for x h The abnormal image generated by the input, x u represents the input abnormal image, G represents the conditional denoising diffusion probability model, E a represents the anatomical structure encoder, E drepresents a disease-specific encoder, represents the expectation, t represents the time step number, represents the conditional denoising diffusion probability model for step t x h The abnormal image generated for the input, represents the conditional denoising diffusion probability model for step t x u Healthy images generated for input.
[0127] It should be noted that if Figure 2 , Figure 3 As shown, the reasoning process of the loop translation mechanism is as follows:
[0128] S101: Transforming health images into h Input the anatomical structure encoder and disease information encoder respectively to obtain the anatomical information E of the healthy image a (x h ), disease information of health images E d (x h );
[0129] S102: x the abnormal image u Input the anatomical structure encoder and disease information encoder respectively to obtain the disease information E of the abnormal image d (x u ), anatomical information of abnormal images E a (x u );
[0130] S103: Anatomical information E of healthy images a (x h ), disease information of abnormal images E d (x u ) Input the conditional denoising probability model to obtain the abnormal image x generated by the healthy image h,u ;
[0131] S104: The anatomical information E of the abnormal image a (x u ), disease information of health images E d (x h ) Input the conditional denoising probability model and obtain the healthy image x generated by the abnormal image u,h ;
[0132] S105: The abnormal image x generated by the healthy image h,u Input the anatomical structure encoder and disease information encoder respectively to obtain the anatomical information E of the abnormal image generated by the healthy image a (x h,u ), disease information E of abnormal images generated by healthy images d (xh,u );
[0133] S106: Generate a healthy image x from the abnormal image u,h Input the anatomical structure encoder and disease information encoder respectively to obtain the anatomical information E of the healthy image generated by the abnormal image a (x u,h ), disease information E of healthy images generated by abnormal images d (x u,h );
[0134] S107: Anatomical information E of abnormal images generated from healthy images a (x h,u ) and the disease information E of the healthy image generated by the abnormal image d (x u,h ) Input the conditional denoising probability model to obtain the restored healthy image
[0135] S108: Disease information E of abnormal images generated from healthy images d (x h,u ) and abnormal images generated by abnormal images generated by healthy images anatomical information E a (x u,h ) Input the conditional probability denoising model to obtain the restored abnormal image
[0136] Steps S101 to S104 are the first stage of the circular translation mechanism; steps S105 to S108 are the second stage of the circular translation mechanism.
[0137] The conditional denoising diffusion probability model is equivalent to: an image generation unit and a translation unit;
[0138] The output end of the anatomical structure encoder is connected to the input end of the anatomical structure discriminator, the output end of the disease-specific encoder is connected to the input end of the disease-specific discriminator, the output end of the anatomical structure encoder and the output end of the disease-specific encoder are connected to the input end of the image generation unit, and the output end of the image generation unit is connected to the input end of the translation unit.
[0139] The image generation unit comprises a forward diffusion unit and a reverse denoising unit which are connected in sequence.
[0140] It should be noted that the training process of the model requires the participation of the disease-specific discriminator and the anatomical structure discriminator, but the inference process of the model does not require the participation of the disease-specific discriminator and the anatomical structure discriminator. During the inference process, the output of the anatomical structure encoder and the output of the disease-specific encoder are connected to the input of the image generation unit.
[0141] It should be noted that by separating the anatomical structure coding and disease-specific coding from the image through the feature disentanglement encoder, the diffusion model can perform accurate image conversion based on the disentanglement coding, so that the disease label and anatomical information can be controlled, thereby achieving efficient and accurate image generation, which has significant clinical application value.
[0142] In step S2, the training of the medical image anomaly detection model includes:
[0143] S201: Select one healthy image and one abnormal image from the standardized medical images as training data;
[0144] S202: training an anatomical structure discriminator using the training data to obtain a first anatomical structure discriminator;
[0145] S203: using the training data and the first anatomical structure discriminator, training the anatomical structure encoder, the disease-specific encoder, and the disease-specific discriminator to obtain the first anatomical structure encoder, the first disease-specific encoder, and the first disease-specific discriminator;
[0146] S204: using the training data and the first anatomical structure discriminator, the first anatomical structure encoder, the first disease-specific encoder, and the first disease-specific discriminator, training the anatomical structure encoder, the disease-specific encoder, and the image generation unit to obtain the second anatomical structure encoder, the second disease-specific encoder, and the first image generation unit;
[0147] S205: using the training data and the second anatomical structure encoder, the second disease-specific encoder, and the first image generation unit, training the anatomical structure encoder, the disease-specific encoder, and the image generation unit to obtain a third anatomical structure encoder, a third disease-specific encoder, and a second image generation unit;
[0148] S206: Reselect one healthy image and one abnormal image from the medical images as new training data; use the first anatomical structure discriminator, the first disease-specific discriminator, the third anatomical structure encoder, the third disease-specific encoder, and the second image generation unit as the anatomical structure discriminator, specific discriminator, anatomical structure encoder, disease-specific encoder, and image generation unit to be trained, respectively, and execute step S202 until the preset number of rounds is reached.
[0149] It should be noted that the training target of step S205 is image restoration.
[0150] It should be noted that the Adam optimizer is involved in the entire training process, and the learning rate of the anatomical structure discriminator is 1×10 -5 , other modules are 1×10 -4The batch size of each training is 1. In the diffusion model, the noise amplitude range of diffusion is 1×10 -4 to 2×10 -2 During the training and testing steps, the noise addition and denoising steps were performed for a full 1000 steps. The DDIM method was used during the inference phase, which resulted in a ten-fold increase in sampling speed. The training of the entire model was stopped after 300 iterations.
[0151] It should be noted that adding a discriminator after step S205 and using a binary cross entropy loss can improve the quality of the reconstructed and translated images and encourage the generated images to conform to the desired category.
[0152] Furthermore, if Figure 4 , Figure 5 As shown, the anatomical structure encoder includes a first activation layer, a first convolution layer, a second activation layer, a first downsampling convolution layer, a third activation layer, a second downsampling convolution layer, a first residual layer, a second residual layer, a third residual layer, a fourth residual layer, and a first noise layer connected in sequence;
[0153] like Figure 6 , Figure 7 As shown, the disease-specific encoder includes a second convolutional layer, a third activation layer, a fifth residual layer, a first pooling layer, a fourth activation layer, a sixth residual layer, a second pooling layer, a fifth activation layer, a seventh residual layer, a third pooling layer, a first linear layer, a sixth activation layer, a second linear layer, a seventh activation layer, a third linear layer, and an eighth activation layer, which are connected in sequence.
[0154] Furthermore, if Figure 8 , Fig. 9 As shown, the anatomical structure discriminator includes a first mirror filling layer, a third convolution layer, a first normalization layer, a ninth activation layer, a second mirror filling layer, a fourth convolution layer, a second normalization layer, a tenth activation layer, a third mirror filling layer, a fifth convolution layer, a third normalization layer, an eleventh activation layer, a fourth mirror filling layer, a sixth convolution layer, a fourth normalization layer, a twelfth activation layer, a fourth pooling layer, and a second linear layer, which are connected in sequence;
[0155] like Fig.10 , Fig.11As shown, the disease-specific discriminator includes a fifth mirror filling layer, a seventh convolutional layer, a fifth normalization layer, a thirteenth activation layer, a sixth mirror filling layer, an eighth convolutional layer, a sixth normalization layer, a fourteenth activation layer, a seventh mirror filling layer, a ninth convolutional layer, a seventh normalization layer, a fifteenth activation layer, an eighth mirror filling layer, a tenth convolutional layer, an eighth normalization layer, a sixteenth activation layer, a ninth mirror filling layer, an eleventh convolutional layer, a ninth normalization layer, a seventeenth activation layer, a tenth mirror filling layer, a twelfth convolutional layer, a tenth normalization layer, a seventeenth activation layer, a thirteenth convolutional layer, a fifth pooling layer, a fourteenth convolutional layer, a sixth pooling layer, and a first addition point, which are connected in sequence;
[0156] The output end of the fifth pooling layer is connected to the input end of the first addition point.
[0157] Furthermore, if Fig.12 , Fig.13 As shown, the image generation unit includes: an eighth residual layer, a ninth residual layer, a tenth residual layer, an eleventh residual layer, a first upsampling convolution layer, a second upsampling convolution layer, a transposed convolution layer, a second addition point, a third addition point, a diffusion network, and a noise adding module;
[0158] The ninth residual layer, the tenth residual layer, the eleventh residual layer, the first upsampling convolution layer, the second upsampling convolution layer, and the transposed convolution layer are connected in sequence, the output end of the eighth residual layer is connected to the input end of the second addition point, the output end of the transposed convolution layer is connected to the input end of the third addition point, and the output end of the second addition point is connected to the input end of the ninth residual layer;
[0159] The output of the anatomical structure encoder is connected to the input of the second addition point, the output of the disease-specific encoder is connected to the input of the eighth residual layer, the output of the noise addition module is connected to the input of the third addition point, and the output of the third addition point is connected to the input of the diffusion model;
[0160] Medical image input is the denoising module, and the diffusion network outputs the generated image.
[0161] Furthermore, the abnormal image is input into the disease-specific encoder E d Extract disease-specific codes d ; Input the healthy image into the anatomical structure encoder E a Extract anatomical structure code z a ; z a and z d Healthy images are generated as conditional input to the conditional denoising diffusion probability model.
[0162] Furthermore, the process of comparing the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area in step S5 is: obtaining the abnormal image in the preprocessed normalized medical image, calculating the mean square error between the abnormal image and the generated healthy image, and obtaining the abnormal area.
[0163] Furthermore, the method further includes: after obtaining the abnormal area result in S6, performing area under the precision-recall curve, mean square error, peak signal-to-noise ratio and / or structural similarity index measurement to verify the abnormality detection effect of the conditional denoising diffusion probability model.
[0164] like Fig.14 As shown, in the training process corresponding to step S205, the medical image anomaly detection model inputs the abnormal image and the healthy image into the disease-specific encoder and the anatomical structure encoder respectively, obtains the anatomical structure code and the disease-specific code, and then inputs them into the image generation unit, and finally inputs the generated abnormal image and the generated healthy image into the translation unit for restoration. The use of a circular translation mechanism can ensure the consistency of the anatomical structure.
[0165] like Fig.15 As shown in the figure, the medical image anomaly detection model combines anatomical structure coding and disease-specific coding during the inference process to generate a healthy version of the image corresponding to the abnormal image. The abnormal region is obtained by subtracting the abnormal image from the healthy version (calculating the mean square error).
[0166] Example 3
[0167] This embodiment provides a medical image anomaly detection system, which is used to implement the medical image anomaly detection method provided in Embodiment 1, and includes:
[0168] Preprocessing module: obtain preprocessed standardized medical images;
[0169] Training module: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model;
[0170] Code extraction module: Use the trained feature disentanglement encoder to extract the anatomical structure code and disease-specific code that do not involve disease information in the preprocessed normalized medical images;
[0171] Reasoning module: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes;
[0172] Post-processing module: compare the abnormal image in the pre-processed normalized medical image with its corresponding generated healthy image to obtain the abnormal area.
[0173] The same or similar reference numerals correspond to the same or similar components;
[0174] The terms used in the drawings to describe positional relationships are only used for illustrative purposes and should not be construed as limiting this patent;
[0175] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for detecting abnormalities in medical images, characterized in that: include: S1: Obtain preprocessed standardized medical images; S2: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model; S3: Use the trained feature disentanglement encoder to extract anatomical structure codes and disease-specific codes that do not involve disease information in the preprocessed normalized medical images; S4: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes; S5: Compare the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal area.
2. A medical image anomaly detection method according to claim 1, characterized in that: In step S1, the preprocessing includes: scaling each medical image in the standardized medical image, and then performing standardization processing.
3. A medical image abnormality detection method according to claim 1, characterized in that: The feature disentanglement encoder comprises: an anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), disease-specific encoder E d (x), disease-specific discriminator D d (E d (x)); The anatomical structure encoder E a (x) Used to extract anatomical structure codes that do not involve disease information a ; Based on the adversarial learning strategy, using the anatomical structure discriminator D a (E a (x)) Determine z a Whether it involves disease information and trains the encoder E a (x) to mislead the anatomical structure discriminator D a (E a (x)), making the disease information unrecognizable; construct the first loss function and train the anatomical structure encoder E a (x), anatomical structure discriminator D a (E a (x)), the first loss function expression is constructed as: Where y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image; Based on the first loss function, the anatomical structure encoder E is trained a (x), anatomical structure discriminator D a (E a (x)); The disease-specific encoder E d (x) is used to extract disease-specific codes z d ; Training disease-specific encoder E based on minimum binary cross entropy loss d (x) and disease-specific discriminator D d (E d (x)) to determine z d Whether it involves abnormal area information, the minimum binary cross entropy loss function is: Among them, y represents the label of the healthy image or abnormal image corresponding to the input x, and x represents the input normalized medical image.
4. A medical image abnormality detection method according to claim 3, characterized in that: The standardized medical images include healthy images and abnormal images, wherein the anatomical structure code z a It includes anatomical structure coding that does not involve disease information in healthy images and anatomical structure coding that does not involve disease information in abnormal images; the disease-specific coding: d Includes disease-specific codes in healthy images that do not involve disease information and disease-specific codes in abnormal images that do not involve disease information; During training, a data set is obtained, wherein the data set includes a healthy image set and an abnormal image set, and the data set is divided into a training set and a test set, wherein both the training set and the test set include a healthy image set and an abnormal image set, and the training set is used to train a feature disentanglement encoder. When the first loss function and the minimized binary cross loss function converge, the training is completed, and a trained feature disentanglement encoder is obtained.
5. A medical image anomaly detection method according to claim 4, characterized in that: The conditional denoising diffusion probability model includes a forward diffusion unit and a reverse denoising unit; The healthy image set is divided into a training set and a test set. The training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. By fixing the Markov chain, Gaussian noise is gradually added after T iterations to destroy the healthy image x0 of the training set. At the time step t∈{1,…,T}, the sample x0 destroyed by the noise t It obeys the multivariate normal distribution, expressed as: represents normal distribution, β t ∈[0, 1] represents a predefined scaling factor. Given x0, x t It can be directly sampled from x0 as shown in the following formula: I represents the identity matrix, t represents the time step number; q represents noise; α represents the derived intermediate quantity, α t : =1-β t , The reverse denoising process is implemented in the reverse denoising unit. At the t step, the healthy image x to which Gaussian noise has been added is t Denoising, the condition {E a (x), E d (x)}, expressed as: Only predict the mean μ θ (x t , E a (x), E d (x), t), variance σ t is a predefined quantity that depends on the time step t, based on the parameterization technique μ θ (x t , E a (x), E d (x), t) is modeled as follows: In the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate healthy images It is expressed as: The forward diffusion unit and the reverse denoising unit are trained. During the training process, the expression of minimizing the loss function is as follows: And the introduction of structural similarity loss further enhances the health image The consistency with the local pixel intensity of x0 Among them, |·| 1,2 It is the sum of the e1 and e2 norm loss functions; ssim represents an index used to measure the similarity between two images; Similarly, the abnormal image set is divided into a training set and a test set, and the training set is input into the forward diffusion unit. The forward diffusion process is implemented in the forward diffusion unit. Through a fixed Markov chain, Gaussian noise is gradually added after T iterations to destroy the abnormal images of the training set. The reverse denoising process is implemented in the reverse denoising unit. At step t, the abnormal image x to which Gaussian noise has been added is t Denoising, in the reverse denoising process, the anatomical structure encoding z a and disease-specific codes d As a condition, the disease-specific code z d The channel is increased and combined with z a Splicing, using U-net network as noise prediction network to generate abnormal images 6. A medical image abnormality detection method according to claim 4, characterized in that: The conditional denoising diffusion probability model also includes: a translation unit; The conditional denoising diffusion probability model uses a cyclic translation mechanism to further train the conditional denoising diffusion probability model, and the process is: The abnormal image x generated by the healthy image h,u Healthy image x generated from abnormal image u,h are input into the feature disentanglement encoder to extract the anatomical structure code {E a (x u,h ), E d (x u,h )} and disease-specific codes {E a (x h,u ), E d (x h ,u )}, construct the conditional cycle inconsistency loss for exchanging disease-specific encodings, expressed as: x u,h represents the conditional denoising diffusion probability model for x u is the generated healthy image for input, x h represents the input healthy image, x h,u represents the conditional denoising diffusion probability model for x h is the abnormal image generated by the input, x u represents the input abnormal image, G represents the conditional denoising diffusion probability model, E a represents the anatomical structure encoder, E d represents a disease-specific encoder, represents the expectation, t represents the time step number, represents the conditional denoising diffusion probability model for step t x h The abnormal image generated for the input, represents the conditional denoising diffusion probability model for step t x u Healthy images generated for input.
7. A medical image abnormality detection method according to claim 5, characterized in that: The abnormal image is input into the disease-specific encoder E d Extract disease-specific codes d ; Input the healthy image into the anatomical structure encoder E a Extract anatomical structure code z a ; z a and z d Healthy images are generated as conditional input to the conditional denoising diffusion probability model.
8. A medical image abnormality detection method according to claim 7, characterized in that: The process of comparing the abnormal image in the preprocessed normalized medical image with the corresponding healthy image generated to obtain the abnormal area in step S5 is as follows: obtaining the abnormal image in the preprocessed normalized medical image, calculating the mean square error between the abnormal image and the generated healthy image, and obtaining the abnormal area.
9. A medical image abnormality detection method according to any one of claims 1 to 8, characterized in that: The method further includes: after obtaining the abnormal region result in S6, performing area under the precision-recall curve, mean square error, peak signal-to-noise ratio and / or structural similarity index measurement to verify the abnormality detection effect of the conditional denoising diffusion probability model.
10. A medical image anomaly detection system, applied to a medical image anomaly detection method according to any one of claims 1 to 9, characterized in that: include: Preprocessing module: obtain preprocessed standardized medical images; Training module: constructing and training a medical image anomaly detection model to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model includes a trained feature disentanglement encoder and a trained conditional denoising diffusion probability model; Code extraction module: Use the trained feature disentanglement encoder to extract the anatomical structure code and disease-specific code that do not involve disease information in the preprocessed normalized medical images; Reasoning module: Generate healthy images using the trained conditional denoising diffusion probability model, conditioned on anatomical structure codes and disease-specific codes; Post-processing module: compare the abnormal image in the pre-processed normalized medical image with its corresponding generated healthy image to obtain the abnormal area.
Citation Information
Patent Citations
Clinical spine image segmentation method and device for assisting spine screw setting operation
CN118570467A
Systems and methods for verification of discriminative models
US20200372339A1
Cited By
Focus identification method based on standard template and image report generation method and system
CN121121236A