Disclosure of Invention
The invention provides a heart coronary artery segmentation and identification method based on deep learning, which solves the problems of segmentation and identification of a heart coronary artery angiography image. According to the technical scheme, the heart coronary artery in the contrast image can be segmented and identified with high accuracy, so that an auxiliary material is provided for a doctor to analyze pathological changes and can be used as the basis of three-dimensional reconstruction of a blood vessel.
In order to achieve the above object, the present invention provides a method for segmenting and identifying cardiac coronary artery based on deep learning, comprising:
selecting any one frame of picture in a segmented cardioangiography Dicom video as a training sample, and inputting the training sample into a neural network; the neural network consists of a convolutional neural network module, a pyramid model and an deconvolution layer;
a convolutional neural network module in the neural network receives the training sample, performs segmentation and identification on blood vessels of the picture in the training sample by a deep learning method, and outputs a heart blood vessel characteristic diagram for segmentation and identification to a pyramid module;
the pyramid module receives the heart blood vessel characteristic graphs for segmentation and identification, and outputs the heart blood vessel characteristic graphs of different scales to a deconvolution layer by applying a pyramid fusion method;
the deconvolution layer receives the cardiovascular feature maps of different scales, and the heart coronary artery segmentation and blood vessel recognition maps are obtained by a bilinear interpolation method.
Further, the method for acquiring the segmented cardioangiography Dicom video comprises the following steps:
receiving a whole segment of cardio radiography Dicom video corresponding to the lesion type information and stored in a medical comprehensive database;
based on the lesion category information, key feature information appearing in the entire segment of the cardioangiography Dicom video is cooperatively analyzed using SSN.
And based on the key characteristic information and by combining with the body position information, segmenting the whole Dicom video, and iterating the step until the segmented video meeting the setting is finally found.
Furthermore, the convolutional neural network module is formed by multiple layers of same units which are stacked for multiple times, and the units sequentially comprise a convolutional layer, a batch normalization layer, a quick connection layer and an activation function layer from top to bottom.
Further, the convolutional layer receives the training sample, performs 2D convolution operation on each pixel block of a fixed size in the training sample data, extracts a feature map for segmentation and recognition contained in the training sample data, and outputs the feature map to the batch normalization layer.
Further, the batch normalization layer receives the feature map output by the convolution layer, performs an operation of subtracting a mean value and dividing by a square difference on the feature map data, so that the feature map data are uniformly distributed, and outputs the batch normalization feature map to the shortcut connection layer.
Further, the shortcut connection layer receives the output of the batch normalization layer, adds the input of the convolution layer and the output of the batch normalization layer according to the weight to obtain a feature map, and outputs the feature map to the activation function layer.
Further, the activation function receives the output of the shortcut connection layer, and performs nonlinear processing on the received data, that is, performs relu operation on the feature maps; inputting the processed data into the convolution layer of the next unit; until all the units in the neural network structure calculate all the feature extraction layers of the convolutional network, obtaining a cardiovascular feature map for segmentation and identification, and inputting the cardiovascular feature map for segmentation and identification into the pyramid module.
Further, the pyramid module receives the cardiovascular feature map for segmentation and identification, and performs convolution operation on the feature map by using a pyramid fusion method, and outputs the cardiovascular feature map with different scales; inputting the cardiovascular feature maps of different scales into the deconvolution layer;
the deconvolution layer receives the cardiovascular feature maps of different scales, the cardiovascular feature maps of different scales are amplified to the same size by a bilinear interpolation method, and finally the images are combined together along one dimension to obtain the heart coronary artery segmentation and identification vessel map.
Further, the method also comprises a step of updating the parameters, wherein the step comprises the following steps:
comparing the output heart coronary artery segmentation and blood vessel image identification with the difference of the doctor precisely-labeled heart coronary artery segmentation and blood vessel image identification to obtain loss values, and updating parameters of each layer of the neural network by a gradient descent method; and (4) iteratively running all the steps until the loss value between the blood vessel graph segmented and identified by the neural network and the precise marking of the doctor is lower than a preset threshold value.
Further, the method also comprises a testing step, wherein the testing step comprises the following steps:
the method comprises the following steps: reading a shot Dicom video file of the patient for the cardioangiography, extracting key frames and inputting the key frames into a neural network; and reading the model parameters corresponding to the body position.
Step two: initializing the neural network, establishing a multi-layer neural network structure, and reading the trained model parameters of the corresponding body position.
Step three: the neural network receives a Dicom video image of a patient during cardioangiography, performs segmentation and detection on blood vessels of an input picture through a deep learning method, and outputs blood vessel segmentation and identification pictures of key frames of different body positions;
step four: and repeating the first step to the third step for different body positions until the key frames of all body positions are processed.
The invention provides a heart coronary artery segmentation and identification method based on deep learning, which comprises the steps of selecting any one frame of picture in a segmented cardioangiography Dicom video as a training sample, and inputting the training sample into a neural network; the neural network consists of a convolutional neural network module, a pyramid model and an deconvolution layer; a convolutional neural network module in the neural network receives the training sample, performs segmentation and identification on blood vessels of the picture in the training sample by a deep learning method, and outputs a heart blood vessel characteristic diagram for segmentation and identification to a pyramid module; the pyramid module receives the heart blood vessel characteristic graphs for segmentation and identification, and outputs the heart blood vessel characteristic graphs of different scales to a deconvolution layer by applying a pyramid fusion method; the deconvolution layer receives the heart blood vessel characteristic images with different scales, the technical scheme of heart coronary artery segmentation and blood vessel image identification is obtained through a bilinear interpolation method, and the image segmentation technology based on deep learning is applied to coronary artery segmentation. The segmentation and identification tasks of the cardioangiographic images can be automatically completed end-to-end. Coronary arteries in a cardiac angiogram are located by segmentation with high accuracy. Each pixel in the picture may be labeled to identify the type of different blood vessels in the picture. By applying the deep learning method, the problem of classification imbalance caused by large proportion difference of background pixels and blood vessel pixels is solved, interference caused by blood vessel-like textures in an image background is effectively avoided, and segmentation accuracy is improved.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, fig. 1 shows that the method for cardiac coronary artery segmentation and identification based on deep learning provided by the invention comprises steps S110 to S140:
in step S110, selecting any one frame of picture in the segmented cardioangiography Dicom video as a training sample, and inputting the training sample into a neural network;
the neural network is composed of a convolution neural network module, a pyramid model and a deconvolution layer.
In step S120, the convolutional neural network module in the neural network receives the training sample, performs segmentation and identification on the blood vessel of the picture in the training sample by a deep learning method, and outputs a feature map of the cardiac blood vessel for segmentation and identification to the pyramid module.
In step S130, the pyramid module in the neural network receives the cardiovascular feature maps for segmentation and identification, and outputs the cardiovascular feature maps of different scales to the deconvolution layer by applying the pyramid fusion method.
In step S140, the deconvolution layer in the neural network receives the feature maps of the cardiac vessels with different scales, and obtains the cardiac coronary artery segmentation and the identified vessel map by a bilinear interpolation method.
The acquisition method of the segmented cardioangiography Dicom video comprises the following steps:
receiving a whole segment of cardio radiography Dicom video corresponding to the lesion type information and stored in a medical comprehensive database; based on the lesion type information, using SSN to cooperatively analyze key characteristic information appearing in the whole segment of the Dicom video; and based on the key characteristic information and by combining with the body position information, segmenting the whole Dicom video, and iterating the step until the segmented video meeting the setting is finally found. Namely, a digital subtraction cardioangiography image with clear blood vessel outline is intercepted from a dicom file, and the image is processed into a single-channel gray image and input into a convolution neural network.
The cardiac angiography Dicom video data set is composed of Dicom coronary artery digital subtraction angiography (medical digital imaging communication) files of about 100 coronary heart disease patients. Each patient has multiple Dicom files with different body positions, each Dicom file contains several frames of coronary angiography, and each frame has different types of blood vessels including a left main trunk, a left circumflex, a left anterior descending branch, a side branch, a left interventricular branch, a right crown and the like. The blood vessels that need to be segmented and identified in the present invention are these blood vessels. For each frame of image in the video, the physician makes a fine pixel-level labeling of the blood vessels in the image. These data are used to train a network model, which is then used to perform segmentation and identification of the vessels.
The convolutional neural network module is formed by multiple layers of same units which are stacked for multiple times, and the units sequentially comprise a convolutional layer, a batch normalization layer, a quick connection layer and an activation function layer from top to bottom.
Further, the convolutional layer receives the training sample, performs 2D convolution operation on each pixel block of a fixed size in the training sample data, extracts a feature map for segmentation and recognition contained in the training sample data, and outputs the feature map to the batch normalization layer.
The high-dimensional features in the picture are extracted by performing convolution operation on the input image again and again, and the features contain all information used in the segmentation and identification processes.
Further, the batch normalization layer receives the feature map output by the convolution layer, performs an operation of subtracting a mean value and dividing by a square difference on the feature map data, so that the feature map data are uniformly distributed, and outputs the batch normalization feature map to the shortcut connection layer.
As shown in fig. 2, in general, training of the neural network usually requires three days to one week, and in addition to the experimental verification result, the time cost is often an important factor to be considered. The batch normalization layer is a method capable of accelerating the model training speed and greatly reducing the time cost. The batch normalization programs the features to the same proper distribution to accelerate the convergence speed of the network, the first step of the specific operation is to normalize the input features, and divide the input features by the variance after subtracting the mean value of the input features, and the specific process can be expressed as:
wherein
Representing normalized features, x representing features of the input, E [ x ]
(k)]A mean value representing the input features is determined,
representing the variance of the input features.
The time cost is also reduced in the process of extracting the cardiovascular features. So after the convolutional layer, a batch normalization process is performed on the images of the cardiac corography output by the convolutional layer. The mean value subtraction and the variance subtraction are carried out on the features output by the convolutional layers, and meanwhile, the mean value and the variance of each layer need to be stored so as to be directly used in the test process, so that the convolved cardiac imaging image has uniform data distribution, and the task of extracting the blood vessel features can be accelerated.
The second step is to translate and scale the normalized features in order for the network to learn the output suitable for the network itself, and the specific process can be expressed as:
wherein gamma is(k)For a learnable scaling parameter, beta(k)Are learnable translation parameters.
Further, the shortcut connection layer receives the output of the batch normalization layer, adds the input of the convolution layer and the output of the batch normalization layer according to the weight to obtain a feature map, and outputs the feature map to the activation function layer. The whole neural network is formed by connecting a plurality of quick connection layers.
The deeper the number of layers of the neural network, the higher the dimension of the feature that can be learned, and therefore the number of layers has a great influence on the neural network. However, when the number of layers of the neural network becomes deeper and deeper, the deeper model hardly expresses the low-dimensional features, so that the problems of gradient explosion, gradient disappearance and the like occur. The shortcut connection unit is a method for solving the problem. Note that in the extreme case, f (X) does not learn anything, that is, f (X) is 0, and in this case, h (X) is X. Therefore, the shallow feature can be transmitted backwards, the learned feature of the whole network is not poor, and the quick connection unit is used for extracting the feature of the cardiac coronary angiography image. The model determines the height of the feature dimension which the model wants to extract, and the useful low-dimension cardiovascular features are reserved as far as possible. Thereby solving the problems of gradient explosion and gradient disappearance.
The entire quick connect process can be expressed as:
y=F(x,{wi})+x
where y represents the output characteristics, X represents the input characteristics, F (X, { Wi }) represents the residual mapping function that needs to be trained, and Wi represents the weights of the layer.
Further, the activation function receives the output of the shortcut connection layer, and performs nonlinear processing on the received data, that is, performs relu operation on the feature maps; inputting the processed data into the convolution layer of the next unit; until all the units in the neural network structure calculate all the feature extraction layers of the convolutional network, obtaining a cardiovascular feature map for segmentation and identification, and inputting the cardiovascular feature map for segmentation and identification into the pyramid module.
If these linear convolution networks are simply connected, the final effect is just as a single convolution unit. Therefore, in the actual use process, an activation function layer needs to be introduced, for example, the image is an image of an activation function, and the specific process can be expressed as follows:
Y=G(X)
where y is the output characteristic, x is the input characteristic, and G is the activation function.
In the testing process, the operation of subtracting the mean value and dividing the variance is also carried out on the heart coronary artery blood vessel images after convolution processing, and the consistent distribution of the heart coronary artery blood vessel image characteristics in the testing and training process is ensured.
Further, the pyramid module receives the cardiovascular feature map for segmentation and identification, and performs convolution operation on the feature map by using a pyramid fusion method, and outputs the cardiovascular feature map with different scales; and inputting the cardiovascular feature maps with different scales into the deconvolution layer.
The pyramid module fuses the features of 4 different scales of the extracted cardiac coronary artery image. Namely, four different sizes of heart features are fused, for example, the red color in the first row of the graph is the coarsest heart coronary artery image feature, and the left three rows are different scales of heart coronary artery image pooling features. To guarantee the weight of the global features, if the pyramid has a total of N levels, then using convolution with 1x1 after each level will reduce the level channel to 1/N of the original. And obtaining the size before pooling through bilinear interpolation, and finally combining the sizes together along one dimension.
The deconvolution layer receives the cardiovascular feature maps of different scales, the cardiovascular feature maps of different scales are amplified to the same size by a bilinear interpolation method, and finally the images are combined together along one dimension to obtain the heart coronary artery segmentation and identification vessel map.
Further, the method also comprises a step of updating the parameters, wherein the step comprises the following steps:
comparing the output heart coronary artery segmentation and blood vessel image identification with the difference of the doctor precisely-labeled heart coronary artery segmentation and blood vessel image identification to obtain loss values, and updating parameters of each layer of the neural network by a gradient descent method; and (4) iteratively running all the steps until the loss value between the blood vessel graph segmented and identified by the neural network and the precise marking of the doctor is lower than a preset threshold value.
Further, the method also comprises a testing step, wherein the testing step comprises the following steps:
the method comprises the following steps: reading a shot Dicom video file of the patient for the cardioangiography, extracting key frames and inputting the key frames into a neural network; and reading the model parameters corresponding to the body position.
Step two: initializing the neural network, establishing a multi-layer neural network structure, and reading the trained model parameters of the corresponding body position.
Step three: the neural network receives a Dicom video image of a patient during cardioangiography, performs segmentation and detection on blood vessels of an input picture through a deep learning method, and outputs blood vessel segmentation and identification pictures of key frames of different body positions;
step four: and repeating the first step to the third step for different body positions until the key frames of all body positions are processed.
A preferred embodiment, laboratory hardware: the Intel Xeon CPU E5-2630 v4 CPU and NVIDIA GTX 1080 Ti GPU carry out cooperative control.
First, data reading
The method comprises the following steps: and receiving the whole segment of the Dicom video corresponding to the lesion category information stored in the medical comprehensive database.
Step two: based on the disease species information, key feature information appearing in the whole segment of the Dicom video is analyzed cooperatively by using SSN.
Step three: and based on the key characteristic information and by combining with the body position information, segmenting the whole Dicom video, and iterating the step until the segmented video meeting the setting is finally found.
Step four: and selecting any frame in the video segmentation as a training sample, and inputting the training sample into the neural network module.
Secondly, training the network to segment and detect the blood vessel
The method comprises the following steps: the neural network is initialized, a multilayer neural network structure is established, similar units are stacked for multiple times, and a convolution layer, a batch normalization layer, a quick connection layer and an activation function layer are sequentially arranged in one unit from top to bottom. And reading the parameters of the pre-training model at the same time.
Step two: the neural network receives the digital subtraction angiography image, and performs segmentation and detection on the blood vessel of the input image by a deep learning method.
Step three: the convolution layer receives a digital subtraction angiography image, performs a 2D convolution operation on each fixed-size pixel block in the data, extracts main information contained in the data that can be used for segmentation and recognition, and outputs the information to the batch normalization layer.
Step four: the batch normalization layer receives the characteristic diagram output by the convolution layer, and performs the operation of subtracting the mean value and dividing the square difference on the data, so that the data has a uniform distribution, and the processed characteristic diagram is output to the quick connection layer.
Step five: and the shortcut connection layer receives the output of the batch normalization layer, adds the input of the convolution layer and the output of the batch normalization layer according to the weight to obtain a characteristic diagram, and outputs the characteristic diagram to the activation function layer.
Step six: and the activation function receives the output of the shortcut connection layer and performs nonlinear processing on the received data, namely relu operation is performed on the characteristic graphs. The processed data is input to the convolutional layer of the next unit.
Step seven: and repeating the three steps to the six steps until all the feature extraction layers of the convolutional network are calculated, and obtaining a final feature map. This is all the main information we need for vessel segmentation and identification. This information is input into the pyramid module.
Step eight: the pyramid module receives the heart blood vessel characteristic graphs for segmentation and identification, applies a pyramid fusion method, firstly performs convolution operation on the characteristic graphs, and outputs four heart blood vessel characteristic graphs with different scales. The four different scale cardiovascular feature maps were imported into the deconvolution layer.
Step nine: the deconvolution layer receives the four cardiovascular feature maps with different scales, amplifies the four cardiovascular feature maps with different scales to the same size by a bilinear interpolation method, and finally merges the images together along one dimension. This results in a final segmented identified vessel map.
Step ten: and comparing the finally output segmentation identification blood vessel graph with the doctor precise labeling picture to obtain a loss value, and then updating the parameters of each layer of the neural network by a gradient descent method.
Step eleven: and (5) iteratively operating the steps two to ten until the loss value between the blood vessel graph segmented and identified by the neural network and the precise marking of the doctor is lower than a preset threshold value.
Step twelve: the trained model parameters and neural network model structures are stored for later use in the testing process.
Step thirteen: and training and storing model parameters of different body position data.
The test network segments and detects blood vessels
The method comprises the following steps: and reading the Dicom file of the shot patient, extracting the key frame and inputting the key frame into the neural network. And reading the model parameters corresponding to the body position.
Step two: initializing the neural network, establishing a multilayer neural network structure, and reading the model parameters of the corresponding body positions trained before.
Step three: the neural network receives the digital subtraction angiography image, performs segmentation and detection on the blood vessel of the input image through a deep learning method, and outputs the blood vessel segmentation and identification images of key frames in different body positions.
Step four: repeating the steps one to three for different positions until all key frames of the positions are processed.
The invention provides a heart coronary artery segmentation and identification method based on deep learning, which comprises the steps of selecting any one frame of picture in a segmented cardioangiography Dicom video as a training sample, and inputting the training sample into a neural network; the neural network consists of a convolutional neural network module, a pyramid model and an deconvolution layer; a convolutional neural network module in the neural network receives the training sample, performs segmentation and identification on blood vessels of the picture in the training sample by a deep learning method, and outputs a heart blood vessel characteristic diagram for segmentation and identification to a pyramid module; the pyramid module receives the heart blood vessel characteristic graphs for segmentation and identification, and outputs the heart blood vessel characteristic graphs of different scales to a deconvolution layer by applying a pyramid fusion method; the deconvolution layer receives the heart blood vessel characteristic images with different scales, the technical scheme of heart coronary artery segmentation and blood vessel image identification is obtained through a bilinear interpolation method, and the image segmentation technology based on deep learning is applied to coronary artery segmentation. The segmentation and identification tasks of the cardioangiographic images can be automatically completed end-to-end. Coronary arteries in a cardiac angiogram are located by segmentation with high accuracy. Each pixel in the picture may be labeled to identify the type of different blood vessels in the picture. By applying the deep learning method, the problem of classification imbalance caused by large proportion difference of background pixels and blood vessel pixels is solved, interference caused by blood vessel-like textures in an image background is effectively avoided, and segmentation accuracy is improved.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.