A medical image anomaly detection method and system

By combining the feature disentanglement encoder and the conditional denoising diffusion probability model with anatomical structure and disease-specific coding, healthy images are generated to detect abnormal areas, solving the problems of anatomical information damage and insufficient detection accuracy in existing technologies, and achieving efficient and accurate medical image abnormality detection.

CN119850556BActive Publication Date: 2025-10-24GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411927429.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-10-24
Estimated Expiration
2044-12-25

Smart Images

  • Figure CN119850556B_ABST
    Figure CN119850556B_ABST
Patent Text Reader

Abstract

The application discloses a kind of medical image anomaly detection method and system.The method includes the following steps, obtaining preprocessed normalized medical image;Medical image anomaly detection model is constructed and trained, and trained medical image anomaly detection model is obtained, including trained feature disentangling encoder and trained conditional denoising diffusion probability model;Using trained feature disentangling encoder to extract the disentangling structure code and disease-specific code of preprocessed normalized medical image not involving disease information;With disentangling structure code and disease-specific code as condition, generate healthy image using trained conditional denoising diffusion probability model;Compare the abnormal image in preprocessed normalized medical image with the healthy image generated by it, and obtain abnormal area.The detection method has high detection quality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of medical image anomaly detection, and more particularly, to a medical image anomaly detection method and system. BACKGROUND

[0002] Medical anomaly detection is applied to the aspect of medical images, aiming to find lesions of various organs.

[0003] Considering that medical imaging data is becoming more and more complex nowadays, traditional manual detection is time-consuming and prone to error, which brings a great burden to radiologists, and medical image anomaly detection methods based on deep learning are gradually applied, but the boundary of medical images is relatively fuzzy, and the position and shape of the lesion often change, so the accuracy of detection is not high. At the same time, in order to obtain accurate anomaly detection results, medical image anomaly detection methods based on traditional deep learning need to perform pixel-level annotation on the lesion, which is time-consuming and laborious.

[0004] The prior art discloses a brain tumor anomaly detection method based on an improved diffusion model. The method comprises the following steps: acquiring 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, dividing the preprocessed normal brain slice images into a training set and a test set; establishing an anomaly detection model, inputting the training set and the test set into the anomaly detection model to realize training and testing of the model; and reconstructing the normal brain slice images by the anomaly detection model to output, and detecting the abnormal part by subtracting the input abnormal brain slice images from the output normal brain slice images. In the anomaly detection of medical images, anatomical information plays a crucial role. In recent years, denoising diffusion probability models (DDPMs) have been applied in unsupervised anomaly detection due to their strong ability in distribution modeling and image generation. However, DDPMs are prone to damage anatomical information during image denoising, resulting in high false positive rate and limiting their detection performance. SUMMARY

[0005] The present application provides a medical image anomaly detection method and system to solve the defect of poor detection quality of the prior art detection method. The detection method has high detection quality.

[0006] The primary object of the present application is to solve the above technical problems, and the technical solution of the present application is as follows:

[0007] A medical image anomaly detection method comprises:

[0008] S1: obtaining preprocessed normalized medical images;

[0009] S2: build a medical image anomaly detection model and train to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model comprises a trained feature disentangled encoder and a trained conditional denoising diffusion probability model;

[0010] S3: using the trained feature disentangled encoder to extract the anatomical structure code and disease-specific code in the preprocessed normalized medical image which does not involve disease information;

[0011] S4: using the trained conditional denoising diffusion probability model to generate a healthy image under the condition of anatomical structure code and disease-specific code;

[0012] S5: comparing the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain an abnormal region.

[0013] Further, in step S1, the preprocessing comprises: scaling each medical image in the normalized medical image, and then performing standardization processing.

[0014] Further, the feature disentangled encoder comprises: an anatomical structure encoder E a (x), an anatomical structure discriminator D a (E a (x)), a disease-specific encoder E d (x), and a disease-specific discriminator D d (E d (x));

[0015] The anatomical structure encoder E a (x) is used to extract the anatomical structure code z a which does not involve disease information; based on an adversarial learning strategy, the anatomical structure discriminator D a (E a (x)) is used to judge whether z a involves disease information, and the encoder E a (x) is trained to mislead the anatomical structure discriminator D a (E a (x)) so that the disease information cannot be identified; a first loss function is constructed and the anatomical structure encoder E a (x), the anatomical structure discriminator D a (E a (x)) is trained, and the expression of the first loss function is:

[0016]

[0017] wherein y represents the label of the health image or the 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), the anatomical structure discriminator D a (E a (x));

[0018] The disease-specific encoder E d (x) is used to extract the disease-specific code z d ; based on the minimum binary cross-entropy loss, the disease-specific encoder E d (x) and the disease-specific discriminator D d (E d (x)) are trained to determine whether z d is related to abnormal region information, and the minimum binary cross-entropy loss function is:

[0019]

[0020] wherein y represents the label of the health image or the abnormal image corresponding to the input x, and x represents the input normalized medical image.

[0021] Further, the normalized medical image includes a health image and an abnormal image, wherein the anatomical structure code z a includes anatomical structure codes not related to disease information in the health image and anatomical structure codes not related to disease information in the abnormal image; the disease-specific code z d includes disease-specific codes not related to disease information in the health image and disease-specific codes not related to disease information in the abnormal image.

[0022] During training, a data set is obtained, the data set includes a health image set and an abnormal image set, the data set is divided into a training set and a test set, the training set and the test set both include the health image set and the abnormal image set, a feature disentangling encoder is trained using the training set, and the training is completed when the first loss function and the minimum binary cross-entropy loss function converge, thereby obtaining the trained feature disentangling encoder.

[0023] Further, the conditional denoising diffusion probability model includes a forward diffusion unit and a reverse denoising unit.

[0024] The health image set is divided into a training set and a test set, the training set is input into the forward diffusion unit, a forward diffusion process is implemented in the forward diffusion unit, a multivariate normal distribution is used to add Gaussian noise gradually through T iterations to destroy the training set health image x0, and at time step t∈{1, …, T}, the sample x t obeys a multivariate normal distribution, and is represented as:

[0025]

[0026] denotes a normal distribution, β t ∈ [0, 1] denotes a predefined scaling factor, given x0, x t can be directly sampled from x0 by the following formula: I denotes an identity matrix, t denotes a time step index; q denotes noise;

[0027]

[0028] denotes an intermediate quantity in derivation, α t : = 1 - β t ,

[0029] The reverse denoising process is implemented in the reverse denoising unit, and the healthy image x t denoised at the t-th step has added Gaussian noise, and the condition {E a (x), E d (x)} is introduced in the denoising process, and is expressed as:

[0030]

[0031] Only the mean value μ θ (x t , E a (x), E d (x), t) is predicted, and the variance σ t is a predefined quantity dependent on the time step t, and is modeled based on the parameterization technique μ θ (x t , E a (x), E d (x), t) as the following formula:

[0032]

[0033] In the reverse denoising process, the anatomical structure encoding z a and the disease-specific encoding z d are taken as conditions, the channel of the disease-specific encoding z d is increased, and it is spliced with z a , and a U-net network is used as a noise prediction network to generate a healthy image is expressed as:

[0034]

[0035] The forward diffusion unit and the reverse denoising unit are trained, and in the training process, based on minimizing the loss function, the expression of the loss function is:

[0036]

[0037] and introducing structure similarity loss further enhances healthy images consistency with x0 local pixel intensity

[0038]

[0039] wherein, |·| 1,2 is the sum of l1 and l2 norm loss functions; ssim represents an index for measuring the similarity between two images;

[0040] Similarly, the abnormal 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, and the abnormal image of the training set is gradually added with Gaussian noise through T iterations by a fixed Markov chain to destroy the abnormal image;

[0041] The reverse denoising process is implemented in the reverse denoising unit, and the abnormal image x t denoising, in the reverse denoising process, the anatomical structure code z a and the disease-specific code z d are taken as conditions, the channel of the disease-specific code z d is increased, and it is spliced with z a , a U-net network is used as a noise prediction network to generate an abnormal image

[0042] Further, the conditional denoising diffusion probability model further comprises a translation unit.

[0043] The conditional denoising diffusion probability model is further trained by using a recurrent translation mechanism, and the process is as follows:

[0044] The abnormal image x h,u generated by the healthy image and the healthy image x u,h generated by the abnormal image are both input into a feature disentangled encoder to extract anatomical structure codes {E a (x u,h ), E d (x u,h )} and disease-specific codes {E a (x h,u ), E d (x h,u )}, and a conditional recurrent inconsistency loss of exchanged disease-specific codes is constructed, and the expression is as follows:

[0045]

[0046] x u,h denotes the conditional denoising diffusion probability model on x u is the generated healthy image for the input, x h denotes the input healthy image, x h,u denotes the conditional denoising diffusion probability model on x h is the generated abnormal image for the input, x u denotes the input abnormal image, G denotes the conditional denoising diffusion probability model, E a denotes the anatomical structure encoder, E d denotes the disease-specific encoder, denotes the expectation, t denotes the time step index, denotes the conditional denoising diffusion probability model on x h is the generated abnormal image for the input, denotes the conditional denoising diffusion probability model on x u is the generated healthy image for the input.

[0047] Further, the abnormal image is input into the disease-specific encoder E d extracts the disease-specific code z d ; the healthy image is input into the anatomical structure encoder E a extracts the anatomical structure code z a ; z a and z d are input as conditions of the conditional denoising diffusion probability model to generate the healthy image.

[0048] Further, the step S5 compares the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal region.

[0049] Further, the method further comprises: after obtaining the abnormal region result in S6, performing precision-recall curve area, mean square error, peak signal-to-noise ratio, and / or structural similarity index measurement to verify the abnormal detection effect of the conditional denoising diffusion probability model.

[0050] A medical image abnormality detection system comprises:

[0051] a preprocessing module: obtaining a preprocessed normalized medical image;

[0052] a training module: constructing and training a medical image abnormality detection model to obtain a trained medical image abnormality detection model; the trained medical image abnormality detection model comprises a trained feature disentangling encoder and a trained conditional denoising diffusion probability model;

[0053] Encoding extraction module: using the trained feature disentangled encoder to extract the anatomical structure encoding and disease-specific encoding in the preprocessed normalized medical image which does not involve disease information;

[0054] Inference module: using the trained conditional denoising diffusion probability model to generate a healthy image under the condition of anatomical structure encoding and disease-specific encoding;

[0055] Post-processing module: comparing the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain the abnormal region.

[0056] Compared with the prior art, the beneficial effects of the present application are:

[0057] The present application learns the anatomical structure and disease-specific encoding of the image through the encoder of the disentangled 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-specific, and the generated healthy version image can keep the anatomical information unchanged, thereby realizing accurate detection of the abnormal region. Overall, the detection method has high detection quality. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 The flowchart of the medical image abnormality detection method provided for embodiment 1.

[0059] Figure 2 The data flow diagram of the one-stage of the cyclic translation mechanism provided for embodiment 2.

[0060] Figure 3 The data flow diagram of the two-stage of the cyclic translation mechanism provided for embodiment 2.

[0061] Figure 4 The structure diagram of the anatomical structure encoder provided for embodiment 2.

[0062] Figure 5 The principle schematic diagram of the anatomical structure encoder provided for embodiment 2.

[0063] Figure 6 The structure diagram of the disease-specific encoder provided for embodiment 2.

[0064] Figure 7 The principle schematic diagram of the disease-specific encoder provided for embodiment 2.

[0065] Figure 8 The structure diagram of the anatomical structure discriminator provided for embodiment 2.

[0066] Figure 9 The principle schematic diagram of the anatomical structure discriminator provided for embodiment 2.

[0067] Figure 10 A structural diagram of the disease-specific discriminator provided for Embodiment 2.

[0068] Figure 11 A principle diagram of the disease-specific discriminator provided for Embodiment 2.

[0069] Figure 12 A structural diagram of the image generation unit provided for Embodiment 2.

[0070] Figure 13 A principle diagram of the image generation unit provided for Embodiment 2.

[0071] Figure 14 A principle diagram of the training of the medical image anomaly detection model provided for Embodiment 2.

[0072] Figure 15 A principle diagram of the inference of the medical image anomaly detection model provided for Embodiment 2. DETAILED DESCRIPTION

[0073] The accompanying drawings are only for illustrative purposes and should not be construed as limiting the patent;

[0074] In order to better illustrate the embodiments, some components in the drawings may be omitted, enlarged or reduced, and do not represent the actual size of the product;

[0075] It is understandable for those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.

[0076] The technical solutions of the present application will be further described below in combination with the drawings and embodiments.

[0077] Embodiment 1

[0078] The present embodiment provides a medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model, the implementation process of the method is as shown in Figure 1 , including:

[0079] S1: obtaining a pre-processed normalized medical image;

[0080] S2: constructing a medical image anomaly detection model and training 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: using the trained feature disentanglement encoder to extract the anatomical structure code and disease-specific code in the pre-processed normalized medical image that does not involve disease information;

[0082] S4: generating a healthy image using the trained conditional denoising diffusion probability model as a condition of the anatomical structure code and the disease-specific code;

[0083] S5: comparing the abnormal image in the pre-processed normalized medical image with the corresponding generated healthy image to obtain an abnormal region.

[0084] The embodiment obtains a pre-processed normalized medical image, constructs a medical image anomaly detection model and trains the same to obtain a trained medical image anomaly detection model, including a trained feature disentangled encoder and a trained conditional denoising diffusion probability model, extracts anatomical structure code and disease-specific code in the pre-processed normalized medical image that does not involve disease information using the trained feature disentangled encoder, generates a healthy image using the trained conditional denoising diffusion probability model as a condition of the anatomical structure code and the disease-specific code, and compares the abnormal image in the pre-processed normalized medical image with the corresponding generated healthy image to obtain an abnormal region. The feature disentangled encoder separates the anatomical structure code and the disease-specific code from the image, so that the conditional denoising diffusion probability model can accurately convert the image as a condition of the disentangled code, the disease label and the anatomical information are controlled, and the image generation is efficiently and accurately realized, which has 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 have less noise limitation, and do not need to consider the case that the anatomical structure and the disease-specific code are damaged, so that good results can be obtained using a small amount of training data. Overall, the detection method has low training data requirement and high detection quality.

[0085] Embodiment 2

[0086] Based on the medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model described in embodiment 1, the same medical image anomaly detection method based on feature disentanglement and conditional denoising diffusion probability model as in embodiment 1 is adopted in this embodiment.

[0087] Further, in step S1, the pre-processing 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] Further, the formula of the standardization processing is as follows:

[0090]

[0091] wherein x 0.050.05 lower quantile of all pixel values of x, x 0.95 0.95 upper quantile of all pixel values of x, x 缩 denotes the scaled medical image.

[0092] Further, the feature disentangled encoder comprises an anatomical structure encoder E a (x), an anatomical structure discriminator D a (E a (x)), a disease-specific encoder E d (x), a disease-specific discriminator D d (E d (x));

[0093] The anatomical structure encoder E a (x) is used to extract anatomical structure encoding z a ; based on an adversarial learning strategy, the anatomical structure discriminator D a (E a (x)) is used to determine whether z a involved in disease information, and the encoder E a (x) is trained to mislead the anatomical structure discriminator D a (E a (x)), so that the disease information cannot be identified; a first loss function is constructed and the anatomical structure encoder E a (x), the anatomical structure discriminator D a (E a (x)) is trained, and the first loss function expression is:

[0094]

[0095] wherein y represents the label of the input x corresponding to the healthy image or the abnormal image, and x represents the input normalized medical image; based on the first loss function, the anatomical structure encoder E a (x), the anatomical structure discriminator D a (E a (x)) is trained, denotes the expectation;

[0096] The disease-specific encoder E d (x) is used to extract disease-specific encoding z d ; based on the minimum binary cross-entropy loss, the disease-specific encoder E d (x) and the disease-specific discriminator D d (E d (x)) are trained to determine whether z d involved in abnormal region information, and the minimum binary cross-entropy loss function is:

[0097]

[0098] where y represents the label of the health image or abnormal image corresponding to the input x, x represents the input normalized medical image, represents the expectation.

[0099] Further, the normalized medical image includes a health image and an abnormal image, wherein the anatomical structure code z a includes the anatomical structure code not involving disease information in the health image and the anatomical structure code not involving disease information in the abnormal image; the disease-specific code z d includes the disease-specific code not involving disease information in the health image and the disease-specific code not involving disease information in the abnormal image;

[0100] During training, a data set is obtained, the data set includes a health image set and an abnormal image set, the data set is divided into a training set and a test set, the training set and the test set both include the health image set and the abnormal image set, a feature disentangling encoder is trained using the training set, and the training is completed when the loss function converges on the first loss function and the minimum binary cross entropy, and a trained feature disentangling encoder is obtained.

[0101] Further, the conditional denoising diffusion probability model includes a forward diffusion unit and a reverse denoising unit.

[0102] The health image set is divided into a training set and a test set, the training set is input to the forward diffusion unit, a forward diffusion process is implemented in the forward diffusion unit, a high Gaussian noise is gradually added through T iterations by fixing the Markov chain to destroy the health image x0 of the training set, at time step t∈{1,…,T}, the sample x t obeys a multivariate normal distribution, and is expressed as:

[0103]

[0104] represents a normal distribution, and β t ∈[0,1] represents a predefined scale factor, and x0, x t can be directly sampled from x0 by the following formula: I represents a unit matrix, t represents a time step number; q represents noise.

[0105]

[0106] α represents an intermediate quantity derived in the derivation, and α t :=1-β t ,

[0107] In the reverse denoising unit, a reverse denoising process is implemented, and at the t-th step, the healthy image x t denoising, in the denoising process, a condition {E a (x), E d (x)} is introduced, which is expressed as:

[0108]

[0109] Only the mean value μ θ (x t , E a (x), E d (x), t) is predicted, and the variance σ t is a predefined quantity dependent on the time step t, which is modeled based on the parameterization technique μ θ (x t , E a (x), E d (x), t) is modeled as the following formula:

[0110]

[0111] In the reverse denoising process, the anatomical structure encoding z a and the disease-specific encoding z d are taken as conditions, the channel of the disease-specific encoding z d is increased, which is spliced with z a , and a U-net network is used as a noise prediction network to generate a healthy image which is expressed as:

[0112]

[0113] The forward diffusion unit and the reverse denoising unit are trained, and in the training process, based on minimizing the loss function, the expression of the loss function is:

[0114]

[0115] and a structural similarity loss is introduced to further enhance the consistency of the healthy image with the local pixel intensity of x0

[0116]

[0117] where |·| 1,2 is the sum of the l1 and l2 norm loss functions; ssim represents an index for measuring the similarity between two images;

[0118] In one 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, the training set is input into the forward diffusion unit, the forward diffusion process is implemented in the forward diffusion unit, and the training set abnormal image is gradually added with Gaussian noise through a fixed Markov chain through T iterations to destroy the training set abnormal image;

[0121] In the reverse denoising unit, the reverse denoising process is implemented, and the abnormal image x t Denoising, in the reverse denoising process, the anatomical structure encoding z a and disease-specific encoding z d is added as a condition, the channel of the disease-specific encoding z d is increased, which is spliced with z a , and a U-net network is used as a noise prediction network to generate an abnormal image x

[0122] Further, the conditional denoising diffusion probability model further comprises a translation unit.

[0123] The conditional denoising diffusion probability model is further trained by using a recurrent translation mechanism, and the process is as follows:

[0124] The abnormal image x h,u generated by the healthy image and the healthy image x u,h generated by the abnormal image are both input into a feature disentangling encoder to extract anatomical structure encoding {E a (x u,h ), E d (x u,h )} and disease-specific encoding {E a (x h,u ), E d (x h,u )}, and a conditional recurrent inconsistency loss of exchanged disease-specific encoding is constructed, and the expression is as follows:

[0125]

[0126] x u,h denotes the conditional denoising diffusion probability model for input generated healthy image x u , x h denotes the input healthy image, x h,u denotes the conditional denoising diffusion probability model for input generated abnormal image x h , x u denotes the input abnormal image, and G denotes the conditional denoising diffusion probability model, E a denotes an anatomical structure encoder, and E drepresents a disease-specific encoder, represents expectation, t represents time step number, represents the conditional denoising diffusion probability model at the t-th step to x h abnormal image generated for the input, represents the conditional denoising diffusion probability model at the t-th step to x u healthy image generated for the input.

[0127] It should be noted that, as shown in Figure 2 , Figure 3 the inference process of the cycle translation mechanism once is as follows:

[0128] S101: input the healthy image x h into the anatomical structure encoder and the disease information encoder respectively, to obtain the anatomical information E a (x h ) of the healthy image and the disease information E d (x h ) of the healthy image;

[0129] S102: input the abnormal image x u into the anatomical structure encoder and the disease information encoder respectively, to obtain the disease information E d (x u ) of the abnormal image and the anatomical information E a (x u ) of the abnormal image;

[0130] S103: input the anatomical information E a (x h ) of the healthy image and the disease information E d (x u ) of the abnormal image into the conditional denoising probability model, to obtain the abnormal image x h,u generated by the healthy image;

[0131] S104: input the anatomical information E a (x u ) of the abnormal image and the disease information E d (x h ) of the healthy image into the conditional denoising probability model, to obtain the healthy image x u,h generated by the abnormal image;

[0132] S105: input the abnormal image x h,u generated by the healthy image into the anatomical structure encoder and the disease information encoder respectively, to obtain the anatomical information E a (x h,u ) of the abnormal image generated by the healthy image and the disease information E d (xh,u );

[0133] S106: input the abnormality image generated health image x u,h into the anatomical structure encoder and the disease information encoder respectively to obtain the anatomical information E a (x u,h ) of the abnormality image generated health image and the disease information E d (x u,h ) of the abnormality image generated health image;

[0134] S107: input the anatomical information E a (x h,u ) of the health image generated abnormality image and the disease information E d (x u,h ) of the abnormality image generated health image into the conditional denoising probability model to obtain the restored health image

[0135] S108: input the disease information E d (x h,u ) of the health image generated abnormality image and the anatomical information E a (x u,h ) of the abnormality image generated health image into the conditional probability denoising model to obtain the restored abnormality image

[0136] Steps S101-S104 are a first stage of the cycle translation mechanism, and steps S105-S108 are a second stage of the cycle 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 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, and the inference process of the model does not require the participation of the disease-specific discriminator and the anatomical structure discriminator. In the inference process, 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.

[0141] It should be noted that the anatomical structure code and the disease-specific code are separated from the image by the feature disentangling encoder, so that the diffusion model can perform accurate image conversion conditioned on the disentangling code, so that the disease label and the anatomical information are controlled, thereby efficiently and accurately realizing image generation, and having significant clinical application value.

[0142] In step S2, the training of the medical image anomaly detection model includes:

[0143] S201: Select one of the normalized medical images as training data;

[0144] S202: Train the anatomical structure discriminator using the training data to obtain a first anatomical structure discriminator;

[0145] S203: Train the anatomical structure encoder, the disease-specific encoder, and the disease-specific discriminator using the training data and the first anatomical structure discriminator to obtain the first anatomical structure encoder, the first disease-specific encoder, and the first disease-specific discriminator;

[0146] S204: Train the anatomical structure encoder, the disease-specific encoder, and the image generation unit 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 to obtain the second anatomical structure encoder, the second disease-specific encoder, and the first image generation unit;

[0147] S205: Train the anatomical structure encoder, the disease-specific encoder, and the image generation unit using the training data and the second anatomical structure encoder, the second disease-specific encoder, and the first image generation unit to obtain the third anatomical structure encoder, the third disease-specific encoder, and the second image generation unit;

[0148] S206: Re-select one of the medical images as new training data; 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 are used as the anatomical structure discriminator, the specific discriminator, the anatomical structure encoder, the disease-specific encoder, and the image generation unit to be trained, respectively. Perform 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 participates in the entire training process, and the learning rate of the anatomical structure discriminator is 1x10 -5 , and the learning rate of other modules is 1x10 -4. The batch size for each training was 1. In the diffusion model, the noise amplitude range for diffusion was 1x10 -4 to 2x10 -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, resulting 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 the discriminator after step S205 and using the binary cross-entropy loss can improve the quality of the reconstructed and translated images and encourage the generated images to conform to the desired class.

[0152] Further, as shown in Figure 4 、 Figure 5 , the anatomical structure encoder comprises a first activation layer, a first convolutional layer, a second activation layer, a first down-sampling convolutional layer, a third activation layer, a second down-sampling convolutional 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] As shown in Figure 6 、 Figure 7 , the disease-specific encoder comprises 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 connected in sequence.

[0154] Further, as shown in Figure 8 、 Figure 9 , the anatomical structure discriminator comprises a first mirror padding layer, a third convolutional layer, a first normalization layer, a ninth activation layer, a second mirror padding layer, a fourth convolutional layer, a second normalization layer, a tenth activation layer, a third mirror padding layer, a fifth convolutional layer, a third normalization layer, an eleventh activation layer, a fourth mirror padding layer, a sixth convolutional layer, a fourth normalization layer, a twelfth activation layer, a fourth pooling layer, and a second linear layer connected in sequence.

[0155] As shown in Figure 10 、 Figure 11As shown, the disease-specific discriminator includes a fifth mirror padding layer, a seventh convolutional layer, a fifth normalization layer, a thirteenth activation layer, a sixth mirror padding layer, an eighth convolutional layer, a sixth normalization layer, a fourteenth activation layer, a seventh mirror padding layer, a ninth convolutional layer, a seventh normalization layer, a fifteenth activation layer, an eighth mirror padding layer, a tenth convolutional layer, an eighth normalization layer, a sixteenth activation layer, a ninth mirror padding layer, an eleventh convolutional layer, a ninth normalization layer, a seventeenth activation layer, a tenth mirror padding 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 connected in sequence.

[0156] An output end of the fifth pooling layer is connected to an input end of the first addition point.

[0157] Further, as shown in Figure 12 , Figure 13 , the image generation unit includes an eighth residual layer, a ninth residual layer, a tenth residual layer, an eleventh residual layer, a first up-sampling convolutional layer, a second up-sampling convolutional layer, a transposed convolutional 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 up-sampling convolutional layer, the second up-sampling convolutional layer, and the transposed convolutional layer are connected in sequence, an output end of the eighth residual layer is connected to an input end of the second addition point, an output end of the transposed convolutional layer is connected to an input end of the third addition point, and an output end of the second addition point is connected to an input end of the ninth residual layer.

[0159] An output end of the anatomical structure encoder is connected to an input end of the second addition point, an output end of the disease-specific encoder is connected to an input end of the eighth residual layer, an output end of the noise adding module is connected to an input end of the third addition point, and an output end of the third addition point is connected to an input end of the diffusion model.

[0160] The medical image input is added to the noise adding module, and the diffusion network outputs the generated image.

[0161] Further, the abnormal image is input to the disease-specific encoder E d to extract the disease-specific code z d , the healthy image is input to the anatomical structure encoder E a to extract the anatomical structure code z a , and z a and z d are taken as condition inputs to conditionally denoise the diffusion probability model to generate the healthy image.

[0162] Further, the step S5 comprises: obtaining the abnormal image in the pre-processed normalized medical image, calculating the mean square error between the abnormal image and the generated healthy image, and obtaining the abnormal region.

[0163] Further, the method further comprises: 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 abnormal detection effect of the conditional denoising diffusion probability model.

[0164] As shown in Figure 14 , in the training process of the medical image abnormality detection model corresponding to step S205, the abnormal image and the healthy image are respectively input into the disease-specific encoder and the anatomical structure encoder, and the anatomical structure code and the disease-specific code are input into the image generation unit, and finally the generated abnormal image and the generated healthy image are input into the translation unit for restoration. The use of the cyclic translation mechanism can ensure the consistency of the anatomical structure.

[0165] As shown in Figure 15 , in the inference process of the medical image abnormality detection model, the anatomical structure code and the disease-specific code are combined to generate the healthy version of the abnormal image. By differencing (calculating the mean square error) the abnormal image and the healthy version image, the abnormal region is obtained.

[0166] Embodiment 3

[0167] The embodiment proposes a medical image abnormality detection system, which is used to implement the medical image abnormality detection method proposed in embodiment 1, and comprises:

[0168] A preprocessing module is configured to obtain pre-processed normalized medical images.

[0169] A training module is configured to construct and train a medical image abnormality detection model to obtain a trained medical image abnormality detection model; the trained medical image abnormality detection model comprises a trained feature disentangled encoder and a trained conditional denoising diffusion probability model.

[0170] An encoding extraction module is configured to extract anatomical structure codes and disease-specific codes in the pre-processed normalized medical images by using the trained feature disentangled encoder, wherein the anatomical structure codes do not involve disease information.

[0171] An inference module is configured to generate healthy images by using the trained conditional denoising diffusion probability model with the anatomical structure codes and the disease-specific codes as conditions.

[0172] The post-processing module: comparing the abnormal image in the pre-processed normalized medical image with the corresponding generated healthy image, to obtain an abnormal region.

[0173] The same or similar reference signs correspond to the same or similar components;

[0174] The terms describing the positional relationship in the drawings are only used for illustrative description, and should not be understood as a limitation on the patent;

[0175] Obviously, the above embodiments of the present application are only examples for clearly illustrating the present application, and are not intended to limit the implementation manner of the present application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. Here, it is not necessary and also impossible to enumerate all the implementation manners. Any modification, equivalent replacement and improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the claims of the present application.

Claims

1. A medical image abnormality detection method characterized by comprising: The method comprises the following steps: S1: obtaining preprocessed normalized medical images; S2: constructing a medical image anomaly detection model and training to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model comprises a trained feature disentangled encoder and a trained conditional denoising diffusion probability model; S3: using the trained feature disentangled encoder to extract anatomical structure encoding and disease-specific encoding in the preprocessed normalized medical images which do not involve disease information; S4: using the trained conditional denoising diffusion probability model to generate healthy images under the condition of anatomical structure encoding and disease-specific encoding; S5: comparing the abnormal images in the preprocessed normalized medical images with the corresponding generated healthy images to obtain abnormal regions. the normalized medical images include healthy images and abnormal images, wherein the anatomy codes include anatomy codes in the healthy images that do not involve disease information and anatomy codes in the abnormal images that do not involve disease information; the disease-specific codes include disease-specific codes in the healthy images that do not involve disease information and disease-specific codes in the abnormal images that do not involve disease information; Abnormal image input to disease-specific encoder Extract disease-specific encoding ; healthy image input to anatomical structure encoder Extract anatomical structure encoding ; to and conditional input to the conditional denoising diffusion probability model, generating a healthy image.

2. The medical image abnormality detection method of claim 1, wherein, In step S1, the preprocessing comprises: scaling each medical image in the normalized medical images, and then performing standardization processing. 3.The medical image abnormality detection method of claim 1, wherein, The feature disentangling encoder comprises: an anatomical structure encoder , an anatomical structure discriminator , a disease-specific encoder , a disease-specific discriminator ; The anatomical structure encoder For extracting anatomical structure codes not involving disease information ; based on the adversarial learning strategy, using the anatomical structure discriminator Judgment Whether it involves disease information, and train the encoder To mislead the anatomical structure discriminator , so that the disease information cannot be identified; construct the first loss function and train the anatomical structure encoder , anatomical structure discriminator , the first loss function expression is: Wherein, y represents the label of the health image or the abnormal image corresponding to the input x, x represents the input normalized medical image; based on the first loss function, the anatomical structure encoder is trained , the anatomical structure discriminator ; The disease-specific encoder For extracting disease-specific codes ; train the disease-specific encoder based on the minimum binary cross-entropy loss And the disease-specific discriminator To determine Whether it involves abnormal area information, the minimum binary cross-entropy loss function is: Wherein, 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. The medical image abnormality detection method of claim 3, wherein, During training, a data set is obtained, the data set comprises a healthy image set and an abnormal image set, the data set is divided into a training set and a test set, the training set and the test set both comprise the healthy image set and the abnormal image set, the feature disentangled encoder is trained by using the training set, and the training is completed when the first loss function and the minimized binary cross entropy loss function converge, so that the trained feature disentangled encoder is obtained.

5. A medical image anomaly detection method according to claim 4, characterized in that: The conditional denoising diffusion probability model comprises 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 a forward diffusion unit, a forward diffusion process is implemented in the forward diffusion unit, a Markov chain is fixed, and Gaussian noise is gradually added through T iterations to destroy the training set healthy image At a time step The sample subject to a multivariate normal distribution, expressed as: denotes a normal distribution, denotes a predefined scaling factor, given , is directly sampled from , I denotes the identity matrix, t denotes the time step index; q denotes noise. represents a derived intermediate quantity, , ; The reverse denoising process is implemented in the reverse denoising unit, on the healthy image to which Gaussian noise has been added at the tth step Denoising, in the denoising process, conditions are introduced , is expressed as: only the mean value is predicted , the variance is a predefined quantity depending on the time step t, based on a parameterization trick is modeled as follows: In the reverse denoising process, encode with anatomical structure and disease-specific encoding As a condition, increase the channel of disease-specific encoding Splice it with Use U-net network as noise prediction network to generate healthy image , denoted as: The forward diffusion unit and the reverse denoising unit are trained, and in the training process, based on a minimized loss function, the expression of the minimized loss function is: and introduce structural similarity loss to further enhance healthy images with consistency of local pixel intensity wherein is with the sum of the norm loss functions; ssim denotes an index for measuring the similarity between two images. Similarly, the abnormal 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, and the training set abnormal images are gradually added with Gaussian noise through T iterations by using a fixed Markov chain to destroy the training set abnormal images. In the reverse denoising unit, the reverse denoising process is implemented, and the abnormal image with Gaussian noise added is processed at the t-th step Denoising, in the reverse denoising process, encoding the anatomical structure And disease-specific encoding As a condition, increase the channel of disease-specific encoding , splice it with Use the U-net network as a noise prediction network to generate an abnormal image .

6. The method of claim 4, wherein the step of detecting the abnormality in the medical image is performed by using a neural network. The conditional denoising diffusion probability model further comprises a translation unit. The conditional denoising diffusion probability model is further trained by using a cyclic translation mechanism, and the process is as follows: healthy image generated from abnormal image and abnormal image generated from healthy image are input into feature disentangled encoder, respectively extract anatomical structure code and disease-specific code , construct the conditional cycle inconsistency loss of exchange disease-specific code, the expression is: a pair of conditional denoising diffusion probability models a healthy image generated for the input, an input healthy image, a pair of conditional denoising diffusion probability models an abnormal image generated for the input, an input abnormal image, a conditional denoising diffusion probability model, an anatomical structure encoder, a disease-specific encoder, denotes expectation, t denotes time step index, a pair of conditional denoising diffusion probability models at step t an abnormal image generated for the input, a pair of conditional denoising diffusion probability models at step t a healthy image generated for the input.

7. The method of claim 5, wherein the step of detecting the abnormality in the medical image is performed by using a neural network. The process of comparing the abnormal images in the preprocessed normalized medical images with the corresponding generated healthy images to obtain abnormal regions in step S5 is as follows: obtaining the abnormal images in the preprocessed normalized medical images, calculating the mean square error between the abnormal images and the generated healthy images, and obtaining the abnormal regions. 8.The medical image abnormality detection method of any one of claims 1-7, wherein, The method further comprises: after obtaining the abnormal region result in S6, verifying the abnormal detection effect of the conditional denoising diffusion probability model by measuring the area under the precision-recall curve, the mean square error, the peak signal-to-noise ratio and / or the structural similarity index.

9. A medical image anomaly detection system applied to the medical image anomaly detection method of any one of claims 1-8, characterized in that, The method comprises the following steps: A preprocessing module: obtaining preprocessed normalized medical images; A training module: constructing a medical image anomaly detection model and training to obtain a trained medical image anomaly detection model; the trained medical image anomaly detection model comprises a trained feature disentangled encoder and a trained conditional denoising diffusion probability model; The coding extraction module extracts the anatomical structure coding and the disease-specific coding not involving disease information in the preprocessed normalized medical image by using the trained feature disentangled coding encoder; The reasoning module generates a healthy image by using the trained conditional denoising diffusion probability model with the anatomical structure coding and the disease-specific coding as conditions; The post-processing module compares the abnormal image in the preprocessed normalized medical image with the corresponding generated healthy image to obtain an abnormal region.

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