Blood vessel stenosis detection method and system based on coronary angiography image
By using the diffusion model to extract potential features in the coronary angiography image, and combined with multi -scale transformer's attention module and narrow characteristics enhancement module, the accuracy and noise interference of coronary arterial image vascular stenosis detection in the existing technology are solved. A more efficient and accurate detection effect is achieved.
Patent Information
- Application Number
- CN202411413979.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-24
Smart Images

Figure CN119359665A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and system for detecting coronary artery stenosis based on angiography images, and belongs to the field of medical image processing. Background Art
[0002] Coronary artery disease is one of the major heart diseases in the world. According to statistics from the World Health Organization, it has become one of the leading causes of death worldwide. Therefore, accurate diagnosis of coronary artery disease is crucial to protecting human life. With the continuous advancement of computer technology and medical technology, medical imaging methods, especially X-ray coronary angiography, have become the gold standard for diagnosing coronary artery stenosis, providing key information for disease treatment. However, traditional manual detection methods of coronary angiography are not only time-consuming, but also require deep medical expertise and are prone to errors.
[0003] Although a lot of research has been done on coronary angiography stenosis detection at home and abroad and some results have been achieved, the existing technology still has limitations. Deep learning object detection models, such as Faster R-CNN, YOLO, RetinaNet and EfficientDet, can automatically detect coronary angiography images, but in the face of the low contrast of angiography images and the blur caused by lesions, the accuracy of these models is still insufficient, making it difficult to accurately identify vascular stenosis.
[0004] For example, the Chinese patent application "A method and device for detecting vascular stenosis in coronary artery X-ray sequence angiography" with publication number CN111667456B includes steps S1: acquiring sequence image information of XRA images; S2: coronary artery stenosis detection: combining the previous and next frame information in the sequence image to realize the detection of the coronary artery stenosis segment on a single frame image, and then performing deep sequence feature fusion on the image detection results of multiple consecutive frames to obtain a more accurate stenosis detection result on each of the multiple consecutive frames, and the detection result is used as the initial sequence stenosis detection result; S3: processing the initial sequence stenosis detection result, and obtaining an accurate detection result by eliminating repeated detection frames in the frame and retaining detection frames with high similarity in the sequence.
[0005] The main defects of this method are: 1) When the X-ray coronary angiography (XRA) image quality is poor, there is a lot of noise or insufficient contrast, the detection accuracy of this method may be affected, thereby reducing the detection effect of the stenosis segment. 2) Although the detection accuracy of a single frame image can be improved by fusing the previous and next frame information, during the inter-frame information fusion process, if there is image movement caused by the patient's breathing, heartbeat or contrast agent loss, motion artifacts or information loss may occur, thereby affecting the accuracy of the detection results.
[0006] For example, the Chinese patent application with the publication number CN113408603B, “A method for identifying the degree of coronary artery stenosis based on multi-classifier fusion”, includes the steps S1: constructing an image sample library; S2: performing denoising, segmentation and binarization processing on the original CT sequence images extracted from the cardiac CTA to obtain the coronary artery extraction image; S3: extracting features from the segmented image to extract the three major categories of features of interest, namely, texture features, grayscale features and geometric features; S4: according to the 7:3 principle, the random index method is used to divide the 500 samples into a training group and a test group, and the ReliefF feature weighting algorithm capable of multi-classification is used to extract the texture features extracted in step S3. The three major imaging features of texture, grayscale and geometry are screened, and a ten-fold cross validation is used for random features to calculate the correlation between each feature and the prediction result, and the features with small correlation are eliminated; S5 constitutes a feature set with the three features of texture, grayscale and geometry selected after screening in step S4, establishes a multi-classifier fusion prediction model, and selects three classifiers, support vector machine SVM, random forest RF, and extreme learning machine ELM, which have better medical image classification effects, to fuse and predict the degree of coronary artery lesions: the weighted method is used to determine the weights of the three classifiers in the fusion classifier, and when the degree of stenosis is less than 50%, it is judged as a normal sample, and when the degree of stenosis is greater than 50%, it is judged as a lesion sample.
[0007] The main defects of this method are: although the recognition ability of coronary artery stenosis is improved by extracting texture, grayscale and geometric features, the extracted features may not be able to fully capture the complex morphology of the coronary arteries and the diversity of vascular stenosis lesions. It is difficult to accurately identify all tiny lesions and stenosis in different branch vessels by relying solely on these features, resulting in limited prediction accuracy and generalization ability of the model.
[0008] For example, the Chinese patent application "Coronary Artery Stenosis Detection Method, Device, Computer Equipment and Storage Medium" with publication number CN110310256B includes steps S1: acquiring an image to be detected; S2: inputting the image to be detected into a coronary artery stenosis detection model to obtain a detection result; the coronary artery stenosis detection model includes a backbone network, a segmentation network and a stenosis analysis network; the output of the backbone network is respectively connected to the input of the segmentation network and the stenosis analysis network, and the detection result includes a coronary artery segmentation result and a coronary artery stenosis result.
[0009] The main defects of this method are: it adopts a multi-task neural network architecture, which is responsible for the two key tasks of vessel segmentation and stenosis analysis respectively. However, 1) the stenosis analysis part is highly dependent on the accuracy of vessel segmentation. If errors occur in the vessel segmentation part, these errors may be amplified in the stenosis analysis stage, resulting in a decrease in the overall detection performance; 2) this method lacks sufficient learning of the characterization features of the learning blood vessels. When processing angiography images of patients with coronary artery stenosis, the blurred vessel edges and stenosis areas cannot be accurately distinguished, thus affecting the accuracy of stenosis detection. Summary of the invention
[0010] In view of the limitations of the existing technology, the present invention proposes a method and system for detecting vascular stenosis in coronary angiography images, aiming to make full use of the powerful image feature representation capability of the diffusion model, and through operations such as multi-scale adaptive feature fusion and regional stenosis feature enhancement, more accurately understand the semantic meaning between blood vessels and stenosis, capture vascular stenosis features and contextual information, thereby improving the classification performance and generalization ability of the model.
[0011] The present invention provides a method and system for detecting coronary artery stenosis based on angiography images, the method comprising:
[0012] Step S1, collect the original coronary angiography video, select the video frames close to the end of diastole for sampling, form a sample set, and mark the coronary vascular stenosis area on the video frames in the sample set to construct a coronary angiography stenosis data set, randomly divide the data set into a training set, a validation set and a test set, and collect the first frame of the coronary angiography video to form a coronary background data set;
[0013] Step S2, data preprocessing and data enhancement of coronary angiography images and labels:
[0014] First, all angiograms in the coronary angiography dataset were subjected to contrast-constrained adaptive histogram (CLAHE) equalization and gamma correction with a probability of 0.8. Then, the images and corresponding labels of the training set were randomly cropped, randomly rotated, and randomly flipped with a probability of 0.6, and all images were resized to 512x512 pixels.
[0015] Step S3, using the coronary angiography background data set to fine-tune the denoising diffusion probabilistic models (DDPM) to learn the data distribution and vascular characterization capabilities of the coronary angiography images, and obtain a vascular potential feature map;
[0016] Step S4, use the training set data to train the real-time end-to-end target detection model (Real-Time End-to-End Transformer Detector, RT-DETR):
[0017] The latent feature maps output by DDPM and the preprocessed feature maps are reshaped and input into the backbone network of the RT-DETR model for feature extraction to generate a feature map list [P3, P4, P5];
[0018] A multi-scale Transformer attention module is used on the P3 layer feature map to enhance the features of blood vessels by taking advantage of the sparsity of the vascular image and generate a new feature map P3.
[0019] In step S5, the feature map of the P5 layer is input into the narrow feature enhancement module, and the information of the surrounding eight neighborhoods and the central pixel difference are convolved to reduce background interference and suppress noise.
[0020] In the convolution operation, the original pixel values in the patch of the local feature map are overlaid on the convolution kernel, and the difference operation is performed between these pixel values and the weights of the convolution kernel to replace the original weights in the convolution kernel to obtain the output feature map; these output feature maps are then re-encoded into the form of patches and further input into the feature enhancement module, i.e., the intra-scale feature interaction module based on attention, to finally generate a new feature map P5 that has been further enhanced;
[0021] Step S6, input the feature map list [P3, P4, P5] into the feature fusion network (Cross-Scale Feature Fusion Module, CCFM) for cross-scale feature fusion; then input the fused feature map into the detection head module for prediction, and output the target detection result.
[0022] The RT-DETR model is trained using the training set, the model parameters are optimized, and the model is gradually adjusted to an initial optimal image detection model;
[0023] Step S7, verify the performance of the improved RT-DETR algorithm model during the training process through the average precision AP, precision P, and recall R, select the model with the best performance, and save the optimal model parameters as the best.pth file.
[0024] Furthermore, the data preprocessing and data enhancement methods of step S2 include:
[0025] The scope of data preprocessing is the entire data set, while the scope of data augmentation operations is limited to the training set. First, the contrast-limited adaptive histogram equalization (CLAHE) operation is used on the coronary angiography images in the entire data set with a probability of 80% to enhance the contrast of the coronary images, and gamma correction is used to increase the brightness of the image to enhance the fuzzy features in the coronary angiography images. Secondly, the images and corresponding labels in the training set are randomly flipped, randomly rotated, and randomly cropped with a probability of 60%;
[0026] Furthermore, the calculation method of DDPM in step S3 includes:
[0027]
[0028]
[0029]
[0030] In the forward diffusion of the diffusion model, noise is gradually added through the Markov chain, and the original data x0 is transformed into a Gaussian noise distribution until the characteristics of the original data are masked by the noise at time t. 2 ) represents the mean a∈R and the variance b 2 The normal distribution of I is the identity matrix, β t is the standard deviation in the range [0,1]. The diffusion model is covered by the Gaussian noise distribution described by formula (1) and formula (2). For the original data x0, as described in formula (2), the noisy image x is calculated. t ,in For a noisy image x t , DDPM model reverse diffusion denoising, the calculation formula is as described in formula (3), where σ t is the standard deviation, and μ θ The model G ε That is, the mean value learned by the DDPM model. The calculation formula for model prediction is as follows:
[0031]
[0032] Therefore, using DDPM, the original data can be gradually restored from Gaussian noise through the following reverse diffusion process. The calculation process is as follows:
[0033] x t-1 =μ θ (x t ,t)+σ t z(5)
[0034] Where z follows the normal distribution N(0,I). Therefore, DDPM can learn the distribution of the target data during the reverse denoising process. Using the pre-trained DDPM model, fine-tuning is performed on the constructed coronary angiography background image dataset to enhance the extraction of vascular structure features. The original coronary angiography image is input into the fine-tuned DDPM model to output the latent feature image of the blood vessel. The output latent feature image is combined with the original image to perform channel reshaping to generate a feature map for input into the vascular stenosis detection model.
[0035] Furthermore, the calculation method of the multi-scale Transformer attention in step S4 includes:
[0036] Input the feature map X of the shallow feature map P3 extracted by the backbone network, and obtain the query q, key k and value v corresponding to X through linear projection. Then, the channels of the feature map are assigned to n different Transformer heads, and the corresponding expansion rate is [1, 2, 3, 5] applied to each feature map component x in each head. ij Perform multi-scale sliding window attention operation, as shown in formulas (6) and (7):
[0037]
[0038] X=Linear(Concat[x 11 ,...,x nn ]) (7)
[0039] Where H and W are the height and width of the feature map. ij Represents x ij The query in K r and V r Represents the x ij The attention function is used to calculate the weighted sum of the input data, where the weight is determined by the query q ij and K r Specifically, query q ij and K r Perform a dot product and then divide by the dimension d of the key k The square root of , which helps stabilize the gradient and prevent overfitting. Next, the result is normalized using the softmax function to ensure that the sum of all weights is 1, resulting in a probability distribution that represents the importance of each key to the current query. Then, as described in formula (7), all x ij The values of are connected through Concat, and the feature aggregation is performed through the linear layer Linear to obtain the feature map X of the new P3 feature map. By setting different expansion rates for different attention heads, the attention module effectively aggregates semantic information of different scales within the receptive field of attention, and reduces the redundant calculation of self-attention without increasing complex operations and additional computational costs.
[0040] Furthermore, the calculation method of the stenosis feature enhancement module in step S5 includes:
[0041]
[0042] y=Conv2d(X,W conv ,b,s,p,d,g) (9)
[0043] y c =Conv2d(X,W c ,b,s,0,d,g) (10)
[0044] y cpdc =yy c (11)
[0045] y output =y cpdc +X(12)
[0046] Where X is the input feature map, W conv is the convolution weight, W c is the center weight, b is the bias term, stride is s, padding is p, dilation rate is d, number of groups is g, and Conv2d is the convolution operation. First, sum the convolution kernel weights in the spatial dimension to get a shape of [C out ,C in / / g,1,1]'s center weight W c , and then the center weight W c Perform convolution operation on the input feature map X to obtain the central convolution result y c , then for y c Calculate the difference between the result y of the ordinary convolution operation and the difference result y cpdc Add the residual to the input feature map X to get the final output y output Here, the self-similarity of the background is taken into account. c When y is y, the center pixel difference convolution operation can be used to suppress background interference and enhance the saliency of anisotropic narrow targets. c The operation method is shown in formula (13) and formula (14).
[0047] Ordinary convolution operation method
[0048] Central difference convolution operation method
[0049] where x i and x′ i is the input pixel of feature map X, w i is the weight in the k×k convolution kernel. β=(x1,x′1)…,(x m ,x′ m ) is the set of pixel pairs selected from the current coronary local patch image block m≤k×k, and k is the size of the convolution kernel.
[0050] Furthermore, a coronary artery stenosis detection system based on angiography images comprises:
[0051] An image processing module is used to obtain a coronary angiography video, perform key frame sampling and annotation on the angiography video to obtain a coronary angiography image, perform preprocessing and data enhancement on the coronary angiography image to obtain a processed coronary vascular image;
[0052] The latent feature extraction module is used to extract latent features from the coronary angiography image, process the coronary angiography image using the pre-trained DDPM denoising diffusion model, generate a latent feature map of the blood vessels, and perform channel reshaping on the latent feature map and the original coronary angiography image to synthesize a new coronary feature map;
[0053] A feature extraction module is used to extract the dimensional features of the coronary feature map, extract the features corresponding to the sampling positions of the central difference convolution kernel through the backbone network, and then perform stenosis feature enhancement processing on these feature blocks to obtain a first output feature map. Subsequently, the feature maps of the P3, P4, and P5 layers in the backbone network are input into the neck network to generate a second output feature map, wherein a multi-scale Transformer module is pre-established in the neck network;
[0054] The target detection module further processes the second output feature map obtained after feature extraction and neck network processing to complete the target detection task. Specifically, the module first inputs the second output feature map into the decoder part, which is responsible for upsampling and refining these feature maps to generate a more accurate final output feature map, and then inputs this final output feature map into the detection head module for prediction to generate target detection results, including the target category and location information in the image.
[0055] Beneficial effects of the present invention:
[0056] (1) The present invention uses the constructed frontal coronary angiography background dataset to fine-tune the pre-trained DDPM model, extracts the latent features of the coronary angiography image, and reorganizes the latent feature map with the original coronary angiography image, so that the subsequent target detection model can better capture the vascular stenosis features in the coronary image;
[0057] (2) The present invention proposes a stenosis feature enhancement module, utilizes target neighborhood information, reduces the intensity of background interference vascular stenosis, effectively suppresses noise in angiography images, and improves the accuracy of stenosis detection;
[0058] (3) The present invention can accurately and efficiently detect coronary angiography images and improve the accuracy of stenosis detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0060] Figure 1 It is a flowchart of a method for detecting coronary artery stenosis based on angiography images in an embodiment of the present invention.
[0061] Figure 2 It is a structural schematic diagram of a coronary artery stenosis detection model based on angiography images in an embodiment of the present invention.
[0062] Figure 3 Schematic diagram of potential feature map extraction in an embodiment of the present invention.
[0063] Figure 4 is a flow chart of the multi-scale Tranformer attention module in an embodiment of the present invention.
[0064] Figure 5 4 is a flow chart of a stenosis feature enhancement module in an embodiment of the present invention.
[0065] Figure 6 It is a schematic diagram of the system structure of the present invention.
[0066] Figure 7 is a visualization diagram of coronary artery stenosis according to an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The invention discloses a method and system for detecting coronary artery stenosis based on angiography images.
[0068] The implementation steps of the method of the present invention include:
[0069] Collect coronary artery sequence videos, sample and annotate the vascular frames in the coronary artery videos under the guidance of professional doctors, and obtain the coronary angiography image set and coronary angiography background data set;
[0070] The fine-tuned diffusion model DDPM is used to extract the potential feature map of the blood vessels and perform channel reshaping with the original coronary artery image;
[0071] Extract dimensional features from the coronary angiography images and extract features of the corresponding layers in the backbone network;
[0072] Then, the extracted feature maps are subjected to narrow feature enhancement and multi-scale Transformer operations;
[0073] Finally, the feature maps of different layers are fused and handed over to the detection head module for prediction.
[0074] The present invention can improve the detection effect of coronary artery stenosis, lays a foundation for subsequent quantitative detection of vascular stenosis, and has great application prospects.
[0075] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0076] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0077] refer to Figure 1 and Figure 2 The present invention provides a method for detecting vascular stenosis in coronary angiography images, the method comprising the following steps:
[0078] Step S1, collecting the original coronary angiography video, sampling the video frames close to the end of diastole to form a sample set, marking the coronary vascular stenosis area on the video frames in the sample set to construct a coronary angiography stenosis data set, and randomly dividing the training set, validation set and test set, and collecting the first frame of the coronary angiography video to form a coronary background data set;
[0079] Step S2, performing data preprocessing and data enhancement on the coronary angiography images and labels described in step S2, firstly performing contrast-constrained adaptive histogram (CLAHE) equalization and gamma correction on all angiography images in the coronary angiography dataset with a probability of 0.8, and then performing random cropping, random rotation, and random flipping on the images and corresponding labels in the training set with a probability of 0.6, and adjusting the size of all images to 512x512 pixels;
[0080] Step S3, fine-tuning the denoising diffusion model DDPM using the coronary angiography background dataset to learn the data distribution and vascular characterization capabilities of the coronary angiography images;
[0081] Step S4, use the training set data to train the RT-DETR model, reshape the channels of the latent feature maps output by DDPM and the preprocessed feature maps, input them into the backbone network of the RT-DETR model for feature extraction, generate a feature map list [P3, P4, P5], use a multi-scale Transformer attention module on the P3 layer feature map, use the sparsity of the vascular image to enhance the features of the blood vessels, and generate a new feature map P3;
[0082] Step S5, input the P5 layer feature map into the narrow feature enhancement module, and use the information of the surrounding eight neighborhoods and the central pixel difference convolution to reduce background interference and suppress noise. In the convolution operation, the original pixel values in the patch of the local feature map are overlaid on the convolution kernel, and the difference operation is performed between these pixel values and the weights of the convolution kernel to replace the original weights in the convolution kernel to obtain the output feature map, and then these output feature maps are re-encoded into the form of patches, and further input into the feature enhancement module, i.e., the attention-based intra-scale feature interaction module, to finally generate a new feature map P5 that has been further enhanced;
[0083] Step S6, input the above feature map list [P3, P4, P5] into the feature fusion network for cross-scale feature fusion, and then input the fused feature map into the detection head module for prediction, and output the target detection result. Use the training set to train the RT-DETR model, optimize the model parameters, and gradually adjust it to the initial optimal image detection model;
[0084] Step S7, verify the performance of the improved RT-DETR algorithm model during the training process through the average precision AP, precision P, and recall R, select the model with the best performance, and save the optimal model parameters as the best.pth file.
[0085] In this embodiment, the data preprocessing and data enhancement methods of step S2 include:
[0086] The scope of data preprocessing is the entire data set, while the scope of data augmentation operations is limited to the training set. First, the coronary angiography images in the entire data set are subjected to the limited contrast adaptive histogram (CLAHE) equalization operation with a probability of 80% to enhance the contrast of the coronary images, and the gamma correction is used to increase the brightness of the images to enhance the fuzzy features in the coronary angiography images. Secondly, the images and corresponding labels in the training set are randomly flipped, randomly rotated, and randomly cropped with a probability of 60%.
[0087] refer to Figure 3 In this embodiment, the calculation method of DDPM in step S3 includes:
[0088]
[0089]
[0090]
[0091] In the forward diffusion of the diffusion model, noise is gradually added through the Markov chain, and the original data x0 is transformed into a Gaussian noise distribution until at time t, the characteristics of the original data are masked by the noise. Formula (1)(2)(3), N(a, b2 ) represents the mean aεR and the variance b 2 The normal distribution of I is the identity matrix, β t is the standard deviation in the range [0,1]. The diffusion model covers the original data x0 with the Gaussian noise distribution described by formula (1) and formula (2), and calculates a noisy image x as described in formula (2): t ,in For a noisy image x t , the calculation formula of DDPM reverse diffusion denoising is as described in formula (3), where σ t is the standard deviation, and μ θ The model G ε That is, the mean value learned by the DDPM model. The calculation formula for model prediction is as follows:
[0092]
[0093] Therefore, using DDPM, the original data can be gradually restored from Gaussian noise through the following reverse diffusion process. The calculation process is as follows:
[0094] x t-1 =μ θ (x t ,t)+σ t z(5)
[0095] Where z follows the normal distribution N(0,I). Therefore, DDPM can learn the distribution of the target data during the reverse denoising process. Using the pre-trained DDPM model, fine-tuning is performed on the constructed coronary angiography background image dataset to enhance the extraction of vascular structure features. The original coronary angiography image is input into the fine-tuned DDPM model to output the latent feature image of the blood vessel. The output latent feature image is combined with the original image to perform channel reshaping to generate a feature map for input into the vascular stenosis detection model.
[0096] refer to Figure 4 In this embodiment, the calculation method of the multi-scale Transformer attention module in step S4 includes:
[0097] Input the feature map X of the shallow feature map P3 extracted by the backbone network, and obtain the query q, key k and value v corresponding to X through linear projection. Then, the channels of the feature map are assigned to n different Transformer heads, and the corresponding expansion rates 1, 2, 3 and 5 are applied to each feature map component x in each head. ij Perform multi-scale sliding window attention operation, as shown in formula (6) and formula (7):
[0098]
[0099] X=Linear(Concat[x 11 ,...,x nn ]) (7)
[0100] Where H and W are the height and width of the feature map. ij Represents x ij The query in K r and V r Represents the x ij The attention function is used to calculate the weighted sum of the input data, where the weight is determined by the query q ij and K r Specifically, query q ij and K r Perform a dot product and then divide by the dimension d of the key k The square root of , which helps stabilize the gradient and prevent overfitting. Next, the result is normalized using the softmax function to ensure that the sum of all weights is 1, resulting in a probability distribution that represents the importance of each key to the current query. Then, as described in formula (7), all x ij The values of are connected through Concat, and the feature aggregation is performed through the linear layer Linear to obtain the feature map X of the new P3 feature map. By setting different expansion rates for different attention heads, the attention module effectively aggregates semantic information of different scales within the receptive field of attention, and reduces the redundancy of self-attention calculation without increasing complex operations and additional computational costs.
[0101] refer to Figure 5 In this embodiment, the calculation method of the stenosis feature enhancement module in step S5 includes:
[0102]
[0103] y=Conv2d(X,W conv ,b,s,p,d,g) (9)
[0104] y c =Conv2d(X,Wc c ,b,s,0,d,g) (10)
[0105] y cpdc =yy c (11)
[0106] y output =y cpdc +X (12)
[0107] Where X is the input feature map, W conv is the convolution weight, Wc is the center weight, b is the bias term, stride is s, padding is p, dilation rate is d, number of groups is g, and Conv2d is the convolution operation. First, sum the convolution kernel weights in the spatial dimension to get a shape of [C out ,C in / / g,1,1]'s center weight W c , and then the center weight W c Perform convolution operation on the input feature map X to obtain the central convolution result y c , and then the result y c Calculate the difference between the result y of the ordinary convolution operation and the difference result y cpdc Add the residual to the input feature map X to get the final output y output Specific y and y c The operation method is shown in formula (13) and formula (14). Considering the self-similarity of the background, the weighted environment around the target is subtracted by convolution of the center pixel difference to suppress background interference and enhance the recognition of anisotropic narrow targets.
[0108]
[0109]
[0110] where x i and x′ i is the input pixel of feature map X, w i is the weight in the k×k convolution kernel. β=(x1,x′1)…,(x m ,x′ m ) is a set of pixel pairs selected from the current coronary local patch image block, m≤k×k, k is the convolution kernel size.
[0111] In this example, a coronary artery stenosis detection system based on angiography images includes:
[0112] An image processing module is used to obtain a coronary angiography video, perform key frame sampling and annotation on the angiography video to obtain a coronary angiography image, perform preprocessing and data enhancement on the coronary angiography image to obtain a processed coronary vascular image;
[0113] The latent feature extraction module is used to extract latent features from the coronary angiography image, process the coronary angiography image using the pre-trained DDPM denoising diffusion model, generate a latent feature map of the blood vessels, and perform channel reshaping on the latent feature map and the original coronary angiography image to synthesize a new coronary feature map;
[0114] A feature extraction module is used to extract the dimensional features of the coronary feature map, extract the features corresponding to the sampling positions of the central difference convolution kernel through the backbone network, and then perform stenosis feature enhancement processing on these feature blocks to obtain a first output feature map. Subsequently, the feature maps of the P3, P4, and P5 layers in the backbone network are input into the neck network to generate a second output feature map, wherein a multi-scale Transformer module is pre-established in the neck network;
[0115] The target detection module further processes the second output feature map obtained after feature extraction and neck network processing to complete the target detection task. Specifically, the module first inputs the second output feature map into the decoder part, which is responsible for upsampling and refining these feature maps to generate a more accurate final output feature map, and then inputs this final output feature map into the detection head module for prediction to generate target detection results, including the target category and location information in the image.
[0116] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, the above is only a partial embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting coronary artery stenosis based on angiography images, characterized in that: A coronary artery stenosis detection model based on angiography images is constructed to detect the collected coronary angiography video frames; the detection method includes the following steps: Step S1, collecting the original coronary angiography video, selecting the video frame close to the end of cardiac diastole, i.e. the coronary angiography image, for sampling to form a sample set; The coronary artery stenosis area is marked on the video frames in the sample set, and the coronary angiography stenosis data set is constructed, and the training set, validation set and test set are randomly divided; and the first frame of the original coronary angiography video is used to form the coronary background data set; Step S2, performing data preprocessing and data enhancement on the coronary angiography images and labels, wherein the scope of data preprocessing is the entire data set of the coronary angiography stenosis data set, and the scope of data enhancement operation is limited to the training set; Step S3, fine-tuning the denoising diffusion model DDPM using the coronary background dataset; The original coronary angiography image is input into the fine-tuned DDPM model to output a latent feature map of the blood vessel; the latent feature map and the preprocessed feature map are channel reshaped to generate a feature map for input into the vascular stenosis detection model; Step S4, training the RT-DETR model using the training set data; The reshaped feature map is input into the backbone network of the RT-DETR model for feature extraction, generating a feature map list [P3, P4, P5]; Then, a multi-scale Transformer attention module is used on the P3 layer feature map to enhance the characteristics of blood vessels by taking advantage of the sparsity of the image and generate a new feature map P3. Step S5, inputting the P5 layer feature map into the narrow feature enhancement module, using the information of the neighborhood around the central pixel and the central pixel difference convolution to reduce background interference and suppress noise; In the convolution operation, the original pixel values in the patch of the local feature map are overlaid on the convolution kernel, and the difference operation is performed between these pixel values and the weights of the convolution kernel to replace the original weights in the convolution kernel to obtain the output feature map; These output feature maps are then re-encoded into the form of patches and further input into the narrow feature enhancement module, i.e., the attention-based intra-scale feature interaction module, to finally generate a new feature map P5 that has been further enhanced. Step S6, input the feature map list [P3, P4, P5] into the feature fusion network CCFM for cross-scale feature fusion, and then input the fused feature map into the detection head module of the RT-DETR model for prediction, and output the target detection result; Use the training set to train the RT-DETR model, optimize the model parameters, and gradually adjust it to the initial optimal image detection model; Step S7, verifying the performance of the RT-DETR model during the training process through the average precision AP, precision P, and recall R, selecting the model with the best performance, and saving the optimal model parameters; The calculation method of DDPM in step S3 includes: In the forward diffusion of DDPM, noise is gradually added through the Markov chain, and the original data x0 is transformed into a Gaussian noise distribution until at time t, the characteristics of the original data are masked by the noise; In formula (1), (2), and (3), N(a, b 2 ) represents the mean a∈R and the variance is B 2 The normal distribution of I is the identity matrix, β t is the standard deviation in the range [0,1]; DDPM covers the original data X0 with the Gaussian noise distribution described by formula (1) and formula (2), and calculates the noisy image X as described in formula (2): t ,in For a noisy image x t , the calculation formula of DDPM reverse diffusion denoising is as described in formula (3), where σ t is the standard deviation, and μ θ The model G ε The learned mean, G ε Refers to the DDPM model. The calculation formula for DDPM model prediction is as follows: Therefore, DDPM is used to gradually restore the original data from Gaussian noise through the reverse diffusion process of formula (5). The calculation process is as follows: x t-1 =μ θ (x t ,t)+σ t z(5) Among them, z follows the normal distribution N(0,I); The pre-trained DDPM is used to perform fine-tuning on the coronary angiography background dataset to enhance the DDPM's extraction of vascular structure features.
2. The method for detecting coronary artery stenosis based on angiography images according to claim 1, characterized in that: The data preprocessing and data enhancement in step S2 include: Firstly, the contrast-limited adaptive histogram (CLAHE) equalization operation was used on the coronary angiography images in the entire data set with a probability of 80% to enhance the contrast of the coronary images; and gamma correction was used to increase the brightness of the image to enhance the fuzzy features in the coronary angiography images. Then, the images and corresponding labels in the training set are randomly flipped, randomly rotated, and randomly cropped with a probability of 60%, and the images are adjusted to fixed pixels.
3. The method for detecting coronary artery stenosis based on angiography images according to claim 1, characterized in that: The calculation method of the multi-scale Transformer attention module in step S4 includes: Input the feature map X of the shallow feature map P3 extracted by the backbone network, and obtain the query q, key k and value v corresponding to X through linear projection; Then, the channels of the feature map are distributed to n different Transformer heads, and the corresponding expansion rates 1, 2, 3 and 5 are applied to each feature map component X in each head. ij Perform multi-scale sliding window attention operation, as shown in formula (6) and formula (7): X=Linear(Concat[x 11 ,...,x nn ]) (7) Among them, H and W are the height and width of the feature map X, respectively, and q ij Represents x ij The query in K r and V r Respectively represent the x ij The keys and values in ; The Attention function is used to calculate the weighted sum of the input data, where the weight is determined by the query q ij and K r Determine, specifically, the query q ij and K r Perform a dot product and then divide by the dimension d of the key k The square root of ; Next, the softmax function is used to normalize the result to ensure that the sum of all weights is 1, and a probability distribution is obtained to indicate the importance of each key to the current query; Then, as described in formula (7), all x ij The values are connected through Concat, and the feature aggregation is performed through the linear layer Linear to obtain the feature map X of the new P3 feature map.
4. The method for detecting coronary artery stenosis based on angiography according to claim 1, characterized in that: The calculation method of the stenosis feature enhancement module in step S5 includes: y=Conv2d(X,W conv ,b,s,p,d,g) (9) y c =Conv2d(X,W c ,b,s,0,d,g) (10) and cpdc =yy c (11) and output =and cpdc +X (12) Among them, X is the input feature map, W conv is the convolution weight, W c is the center weight, b is the bias term, the stride is s, the padding is p, the expansion rate is d, the number of groups is g, and Conv2d is the convolution operation; First, the convolution kernel weights are summed over the spatial dimension to obtain a shape of [C out ,C in / / g,1,1]'s center weight W c ; Then the center weight W c Perform convolution operation on the input feature map X to obtain the central convolution result y c , and then the result y c Calculate the difference between the result y of the ordinary convolution operation and the difference result y cpdc Add the residual to the input feature map X to get the final output y out .
5. The method for detecting coronary artery stenosis based on angiography images according to claim 4, characterized in that: In step S5, y and y are actually calculated. c When the center pixel difference convolution operation is used, y and y c The calculation method is shown in formula (13) and formula (14). where x i and x ′ i is the input pixel of feature map X, w i is the weight in the k×k convolution kernel, k is the size of the convolution kernel β = (x1, x ′ 1 )…,(x m ,x ′ m ) is a set of pixel pairs selected from the current coronary local patch image block, m≤k×k.
6. A coronary artery stenosis detection system using the coronary artery stenosis detection method based on angiography images, characterized in that: include: Image processing module: used to obtain coronary angiography video; Perform key frame sampling and annotation on the angiography video to obtain the coronary angiography image; Preprocessing and data enhancement are performed on the coronary angiography image to obtain a processed coronary vascular image; Potential feature extraction module: used to extract potential features from coronary angiography images; Use the pre-trained DDPM denoising diffusion model to process the coronary angiography image to generate a potential feature map of the blood vessels, and then reshape the channels of the potential feature map and the original coronary angiography image to synthesize a new coronary feature map; Feature extraction module: used to extract the dimensional features of the coronary feature map; extract the feature blocks corresponding to the sampling positions of the central difference convolution kernel through the backbone network, and then perform stenosis feature enhancement processing on these feature blocks to obtain the first output feature map; then, input the feature maps of the P3, P4, and P5 layers in the backbone network into the neck network of the RT-DETR model to generate the second output feature map, wherein a multi-scale Transformer module is pre-established in the neck network; Object detection module: further processes the second output feature map obtained after feature extraction and neck network processing to complete the object detection task; The target detection module first inputs the second output feature map into the decoder part; the decoder upsamples and refines these feature maps to generate a more accurate final output feature map; this final output feature map is input into the detection head module of the RT-DETR model for prediction to generate the target detection result, which includes the target category and location information in the image.
Citation Information
Patent Citations
Coronary artery stenosis detection methods, devices, computer equipment, and storage media
CN110310256B
A method and device for detecting vascular stenosis in coronary angiography.
CN111667456B
A method for identifying the degree of coronary artery stenosis based on multi-classifier fusion
CN113408603B
Cited By
Coronary artery stenosis intelligent diagnosis system and method based on deep learning
CN120164609A
Coronary artery analysis processing method and system based on magnetic resonance CNR value
CN120182244A
Photovoltaic panel detection method and system based on lightweight RT-DETR model
CN120765527A
Photovoltaic panel detection method and system based on lightweight RT-DETR model
CN120765527B
Scale perception progressive learning method for narrow segmentation of X-ray coronary angiography
CN121353679A