Cerebrovascular Segmentation Based on Hidden Markov Model in Phase-Contrast Angiography Images

： Background: Phase-Contrast Angiography (PCA) is an acceptable magnetic resonance imaging method for cerebrovascular diseases diagnosis. However, it is an important and great challenge to accurately extract cerebrovascular structures from PCA images because of the complex vascular structures and large amount of noise. To accomplish this task, this work proposes a cerebrovascular segmentation algorithm based on Local Binary Fitting (LBF) and Hidden Markov Model (HMM), which can accurately extraction features from PCA data. Results: Dice Similarity Coefficient (DSC), False Positive Score (FPN), and False Negative Score (FTN) are defined as metrics to assess this algorithm. Results show this method obtain higher accuracy (74.58%, 4.93%, 24.48%) than compared methods. Conclusion: Based on quantitative results, it appears that the proposed method has a higher accuracy rate compared to other methods. Due to no human correction and has no training process, it performs well on small datasets. Thus, this algorithm can accord with clinical requirements.

proposed an algorithm, which analyzes binary connected components on surface of a sphere moving along a vessel, and recursively tracks branches and detects branches, to obtain surface of vessels. Friman et al. [9] proposed a parameterized vascular segment tracking and extraction method, which achieves vascular segmentation by establishing a gray-scale model of vascular section and a parameterized model of vascular segment, and then detects and fits candidate vascular region in tracking direction.
With widespread application of deep learning in medical image processing, vessel segmentation can also be achieved by deep learning methods, especially Convolutional Neural Networks (CNN). For example, two models based on improved U-Net [10] and DeepVesselNet [11] networks respectively gave great performances in cerebrovascular segmentation. However, algorithms based on deep learning requires a large amount of data with consistent imaging parameters for training and testing. If dataset is too small, overfitting is likely to occur. Therefore, this work proposes a cerebrovascular segmentation algorithm combining Local Binary Fitting (LBF) [12] and Hidden Markov Model (HMM) [13], which combines advantages of algorithms based on gray features and shape of vessels. The specific steps are as follows. First, images were denoised by anisotropic smooth preprocessing while preserving edges of vessels. Then, coarse segmentation results are obtained by LBF level set segmentation method. Finally, fine segmentation results are obtained by HMM based on the coarse-level results. In HMM, Gaussian distribution parameters are initialized first by K-means. Then, probabilities are calculated by EM algorithm and transformed into the optimization of the energy function. Finally, fine segmentation results are obtained by determining whether voxels belong to vessels or background using MAP algorithm.

Results
Ten clinical cases from open head magnetic resonance data set were randomly selected and tested in this study to evaluate the feasibility of the proposed method. Data were scanned by Siemens Biograph mMR equipment. The scanning parameters are 120KV voltage and 150mA current. The actual size interval is 0.5mm×0.5mm×0.8mm, and the corresponding pixel size is 400×400×330. Each clinical expert manually marks the cerebrovascular as ground truth for evaluation. 4 Maximum Intensity Projection (MIP) [14] is used to visually evaluate segmentation results. The basic idea of MIP is to select a projection direction, then take the maximum gray scale as the projection value, and finally achieve the maximum brightness on the plane.
The projection shows the three-dimensional information of vessels because the vessels are bright contrasted to the background.     LBF algorithm is mainly based on the information of local images, which is the weighted average of gray scale in the Gaussian window outside the contour when the local energy function converges. When LBF algorithm processes an image with uneven gray scale, the curve terminates early in convergence, which leads to over-segmentation of the result (Figure 1(c)). In addition, LBF algorithm lack the ability to judge whether a pixel of the edge vessel belongs to vascular or non-vascular area, which leads to misjudgment and vascular rupture (Figure 1(c)).
HMM algorithm obtains the initial parameters by clustering, and establishes the state set from the feature field to the label field. In this way, the energy function can get more vessel information. Figure 1(d) shows that the contour and the continuity of the vessels is similar to the ground truth. It can be seen that under this random field, the energy curve established based on the vessel information can finally converge to the expected value, which means that the HMM random field can fit correctly when processing cerebral vessel image.
As shown in Figure 2, 3D rendering is introduced to analysis those results. In Figure   2, (a), (b) and (c) represent the results of ground truth, LBF and the proposed method, respectively. It can be seen that the ground truth is very smooth, while the result of LBF has a lot of fractures. On the contrary, the result of the proposed method is similar to the ground truth. Therefore, the three-dimensional rendering shows the same result as twodimensional MIP projection. Figure 3 shows an enlarged view of 3D segmentation details.
It can be clearly seen that LBF will ignore many boundaries in segmentation, especially the part of small vessels. The proposed method can fill these segmentation deficiencies, and it also has better performance in local small vessels. It is worth mentioning that segmentation of the proposed method may cause some over-segmentation. Negative Score (FTN) [15]. DSC, FPN and FTN respectively quantify the accuracy, oversegmentation rate and under-segmentation rate. The evaluation method is as follows: in curve approximation, and eventually leads to thicker vessels in segmentation results than the actual situation. For a more intuitive display, Figure 4 plots DSC results of the two segmentation methods. In this statistical histogram, D3 and D5 of this method show significantly higher performance than LBF. D5 with the largest difference is nearly 24.01% higher. But D4, D6 and D7 are close in the DSC. This is because their FTN of ours is higher than others, showing some redundant segmentation boundaries, leading to incorrect segmentation. Although the FTN of our approach is larger than LBF, it is in the clinically acceptable range. Therefore, reasonable parameter adjustments are needed in actual application. In addition, in order to verify the method in this work, this work designed a 3D-U-Net [16] model as a comparative experiment. A cross-validation method is applied: D1-D5 is selected as the training, and D6-D10 is used as the testing for comparison. Then training and testing set are exchanged, and the comparison is performed again. Table 2 shows the quantitative results. In terms of performance, the proposed method has achieved better performance in both sets of tests. From the data distribution, although the results of 3D-U-Net obtain 0.05% PFN, the FTN is over 48%. This is because the insufficient amount of data leads to the insufficient extraction of vascular features by the neural network, which will lead to serious clinical misdiagnosis results, and there is no way to avoid the risk of 8 surgery. Therefore, this work has the advantages of not relying on large amounts of data, fully automatic, and high performance. It has certain clinical potential.

Conclusions
This work proposes a cerebrovascular segmentation algorithm based on HMM. It extracts the vessels' contour features from the energy function established in LBF combining with the weighted average of local gray scale. Then, the state sets of the characteristic field and the labeled field is obtained by establishing a hidden Markov random field, and the energy function equation is generalized. The hidden Markov random field is initialized by K-means, and updated by the EM algorithm until the a priori energy function converges. The segmentation results are then obtained.
Ten sets of data tested this method. The results show that the vascular structure segmented by proposed method is close to the manual segmentation. In terms of visualization, the results of the LBF mismatched certain brain tissue into vessels, and the segmented vessel results were thinner than the real results. After processing by the proposed method, the edge of the segmented vessel was getting closer to the real vessel, and some mismatch points were eliminated. In terms of quantitative results, the proposed method achieves higher accuracy than LBF. Therefore, proposed method does not require any manual intervention and can meet actual needs. It is worth noting that there is currently no published paper that applies the proposed method in medical image processing to build models. This paper makes the first exploration, puts forward corresponding methods and test them by experiments, which provides a new direction for the analysis of cerebrovascular images.

Methods
This section is organized to introduce the methods proposed in this work. Diagram of proposed cerebrovascular segmentation algorithm is shown in Figure 5. In this work, Anisotropic filter is based on partial differential equations [18]. Diffusion at pixel p can be expressed as: is the gray scale at pixel p after t times of iteration.  is a constant controlling the overall intensity of diffusion, and p  is the size of the neighborhood space. It can be seen from Eq. (3) that anisotropic filter is a kind of iteration. Figure 6 shows the denoising results of a PCA image when  is 0.2, 0.4, 0.6, 0.8, 1, 1.5, 2 respectively. As shown in Figure 6, the larger  is, the stronger the denoising ability is. However, when  increases to 1.5 and 2, the vessel is destroyed. Therefore, the diffusion coefficient  of this work is 1.

Coarse Segmentation Based on Local Binary Fitting
Active contour models have been widely used in image segmentation. The current active contour segmentation models can be divided into two categories: edge-based models [19] and region-based models. Region-based segmentation models [20] determines each target region through a certain region descriptor, thereby directing the active contour to move until it converges to the segmentation boundary. It can receive great results when the input images have strong pixel consistency in the target area.
LBF algorithm in this work is a region-based active contour model algorithm [21], which constructs a region-based active contour model using a variational level set equation. The functional form of the local fitting energy represented by the LBF level set is: In Eq. (4), 12  To extend x from current position to the whole image and guarantee the stability of the evolution of level set  , a distance regularization term is added to the function.
Therefore, the total energy function is:  shows that the coarse cerebrovascular segmentation can be obtained by LBF, which is the initial conditions for accurate segmentation in this paper.

Fine Segmentation Based on Hidden Markov Model
The work is based on such assumption that the grayscale distribution of the vessel and the background obeys the Gaussian distribution. Based on Bayesian theory, the Maximum A Posterior (MAP) algorithm is introduced to separate the segmentation results into a feature field and a labeling field to achieve cerebrovascular segmentation. By calculating a posterior probability, the objective function is determined. Therefore, the task of accurate cerebrovascular segmentation can be accomplished by finding the MAP. According to [22], the Markov and Gibbs distributions are equivalent. Therefore, the Markov random field can be replaced by the Gibbs random field. In this way, the calculation of MAP can be converted to the optimization of the minimum energy, which can cut down the amount of calculation. The traditional Markov random field is sensitive to pixel outliers, which causes inaccurate segmentation or uneven edges. Therefore, hidden Markov random field is used instead of the traditional one.
Although the vessels are small, there must be hidden parameters. The observed parameter sequence and the hidden parameter sequence are probability-related. Therefore, a hidden Markov process and an observable set of states associated with this hidden Markov process are modeled.
In Eq. (7), xL  . Images only consist of vessels and background, so this is a binary classification problem, which means For MAP: By adding the parameter of the Gaussian distribution, which is previously assumed, Eq. (8) is modified as: In Eq. In Markov random field, this parameter needs to be obtained through training. However, there is neither training nor a priori estimation in the hidden Markov random field. The EM algorithm is introduced to solve this. K-means, MAP, and EM algorithms are introduced to build a hidden Markov model [22] for fine segmentation of cerebrovascular.
K-means fuzzy clustering algorithm [23] is introduced to initialize the parameter  , so an initial probability can be obtained at the beginning of the cerebrovascular segmentation algorithm. The data processed in this step is the coarse segmentation results after LBF, and the goal is to cluster the vessels to distinguish them from the background.
K-means clustering algorithm is a classic distance-based clustering algorithm using distance as a criterion for similarity evaluation.
First, k pixels (vascular or non-vascular pixels) in the brain slice image are randomly selected as the clustering center. Then, each remaining pixel is normalized to the clustering set (cluster) closest to it based on the distance to the clustering center, and the average of each cluster is calculated to update the clustering center.
In Eq. (11), k is the number of clusters, and is the i-th cluster. The output of the criterion function converges to a fixed value through iterations and it is parameter  .
Each pixel has a position and gray scale in PCA images. K-means algorithm is not based on position, but on gray scale, which means pixels with similar gray scale are in a same cluster. Therefore, the parameter  in the EM algorithm can be initialized based on the previous LBF coarse segmentation results.
Then the images are processed by the EM algorithm. Traditional EM algorithm includes two major steps: E step (expectation) and M step (maximization). When E step works, set this iteration as the t-th iteration. The vascular Gaussian distribution parameter set t  is calculated in the previous step. This step is to calculate the likelihood function ( | ) t Q  of the vascular segmentation.
( | , ) ( | , ) After initializing parameter  with K-means and calculating the probability distribution ( | , ) P y x  by the EM algorithm, the label is predicted by MAP algorithm. The label is whether the pixel belongs to the cerebrovascular or background.
Bayes function is introduced: Take the logarithm of Eq. (17): Bring Eq. (18) into the EM algorithm: The radicals of a second-order domain system is introduced to define () UX with potential energy:  (21) In Eq. (21), a fixed output can be obtained through iterations.
As is assumed in the previous section, the cerebrovascular distribution is based on a Gaussian distribution, and the parameter is based on a single Gaussian distribution parameter ( , ) . It means that the intensity distribution of the cerabrovascular obeys a single Gaussian distribution. However, the intensity distribution of actual cerebrovascular is complicated, so it is imprecise to assume that the cerebrovascular distribution is based on a Gaussian distribution. In medical image processing, many methods have been proposed to improve the segmentation of cerebrovascular images. The Gaussian mixture model is a typical one, which is simple and effective. This method applies a statistical model to medical images according to the pixel features. Therefore, a Gaussian Mixture Model (GMM) [24] is proposed to fit the intensity distribution of cerebrovascular. Comparing with the previous model, GMM is more complex and powerful. It can match to the actual situation better.
The parameters of a GMM with i members are:

Ethics approval and consent to participate
Not applicable.

Consent for publication
Not applicable.