Abstract
Vessel segmentation of retinal image is of great significance for medical disease diagnosis. Because of noise, non-uniform illumination etc., it is hard to precisely segment all the vessels especially small thin vessels. This paper proposed a new retinal image segmentation method called TMVD based on pixel specificity and self-adaptive classification strategy, which is implemented in three phases, in the first phase, by setting a higher pixel specificity threshold, the vessels are roughly segmented, then during the second phase, each undetermined pixels acts as an Agent, within a multi scale threshold range, the Agent revises its own status according to the status of its neighbor Agent, and then the segmentation task is completed, finally in the third phase, the noise regions in the segmentation results are cleared by double-layer window method so as to increase the segmentation accuracy. By testing TMVD on DRIVE database, the experiment shows that it is more accurate and efficient than state-of-the-art methods.
Keywords
Introduction
The variation of retinal vessel structure may be caused by many diseases, e.g. the variation of vessel width, vessel branch angle and vessel tortuosity can be affected by high blood pressure [1, 2], diabetic retinopathy will cause the retinal neovascularization [3–5]. The early detection of the variation of retinal vessel structure is important for the prevention and treatment of related disease. In order to quantitatively analyze the variation of vessel structure, accurate vessel segmentation is prerequisite. Currently there are lots of retinal image vessel segmentation methods, but some limitations exist: ➀the presence of vessel central light reflex may cause one vessel be segmented as two vessels; ➁poor segmentation of vessel crossover or branch will affect the trace of vessels; ➂two close vessels may be merged into one vessel; ➃some small thin vessels will be missed; ➄the optic disc edge may be misclassified as vessels.
The limitations mentioned above will cause inaccuracy in vascular network analysis such as the identification of individual vessel segments, vessel calibre measurements, or vascular abnormality detection. The segmentation results of some existing methods on a cropped retinal image with the presence of central reflex, close vessels and crossover points are shown in Fig. 1 to illustrate the limitations of current approaches. Result of Staal et al. [6] (Fig. 1b) has gaps between vessel segments, and part of the optic disc is misclassified as vessel. Close vessels merging is present in result of Soares et al. [7] (Fig. 1c). Both results of [6, 7] have missed the central part of vessels due to vessel central reflex, and also some of the thin vessels are missed. Ricci [8] (Fig. 1d, e) proposed two segmentation methods based on line operator and SVM, while line operator will cause the disconnection of vessels, and some of the vessels in the crossover regions will be merged into one vessel. The segmentation results based on SVM are more connected than line operator, but will still lose some thin vessels.

Segmentation results of some methods: (a) cropped retinal image, where the white ellipse marks the vessel central reflex, the black rectangle marks the close vessel, the black ellipse marks the crossover region, the white rectangle marks the thin vessel, and the black arrow marks the optic disc region. (b) Staal et al. [6] segmentation result. (c) Soares et al. [7] segmentation results. (d) Ricci-line [8] segmentation results. (e) Ricci-svm [8]. (f) TMVD segmentation results.
Liu et al. [9] proposed MRI image segmentation method based on reactive Agent system, which used four different types of Agents, and they don’t interact with each other directly, while their behaviors only depend on the local perception, and the pixels are marked according to their belonging degree to different regions. For the same MRI brain images, Richard et al. [10] proposed hierarchical structure based on situation and cooperative agents, and different Agents interact with each other to handle the low level segmentation task. Because different brain images have regular local structural features, so [9, 10] have good segmentation performance on MRI brain images, however, the retinal images have more complex structures, it is not known whether they can be used on the vessel segmentation of retinal image or not. Based on the cognitive structure, Bovenkamp et al. [11] proposed Multi-Agent system for the IVUS image segmentation, which is used to realize the high level control of low level image segmentation algorithm based on knowledge control. However, they don’t have the corresponding Agent processing method for the uncertain and noise region. Dou et al. [12] applied Agent to the self-assembly model in 3D grid space, and Agents with simple structures cooperate with each other to complete complex tasks. Cheng et al. [13] issued the vessel crossover problem, and focused on retinal vessel tracing to segment the retinal vessels. Jaydeep De et al. [14] proposed a two step method to address the filament crossovers, whose key idea is to formulate the vessel segmentation problem as label propagation over directed graphs and demonstrate superior performance. Li et al. [15] proposed a supervised method for vessel segmentation, it remolded the task of segmentation as a problem of cross-modality data transformation from retinal image to vessel map, and a deep neural network was introduced to model the transformation, and the results outperforms state-of-the-art methods in terms of sensitivity, specificity and accuracy. But limitations still exist as illustrated by Fig. 1, so this paper improves the vessel segmentation results by the following innovations: Because a small piece of vessel edge is nearly linear, so the whole vessels can be modeled as a set of short lines, based on this feature, pixel specificity is proposed in this paper, lines with different angles are used, and the line with the largest average intensity response is chosen to detect the vessel pixels, by appropriate setting of line length and angles, more vessel pixels can be found. For the optic disc(OD), its internal pixels have much larger intensity than other pixels in the retinal image, and for this reason, its edges are easy to be misclassified as vessels, so this paper proposed OD factor as described in 2.1.1, which can effectively remove the OD interference, and improve the segmentation accuracy. The retinal image may contains noise which will cause the misclassification of pixels, so this paper make use of multi-agents, if an agent marks a pixel as vessel or background, then it will affect the judgment of its neighbor pixels, which can take advantage of the cooperation superiority of Agents to reduce the effect of noise.
Base on the above theoretical innovation, this paper proposed a vessel segmentation method based on pixel specificity and self-adaptive classification strategy called TMVD, which is implemented in three phases, in the first phase, by setting a higher pixel specificity threshold, the vessels are roughly segmented, then during the second phase, each undetermined pixel acts as an Agent, within a multi scale threshold range, the Agent revises its own status according to the status of its neighbor Agent, and then the segmentation task is completed, finally in the third phase, the noise regions in the segmentation results are cleared by double window method so as to increase the segmentation accuracy. By testing the algorithm on DRIVE database, the experiment showed that TMVD algorithm has better segmentation accuracy and is more efficient than state-of-the-art methods in the literatures.
Segmentation based on pixel specificity
Pixel specificity
A 2D n × m image can be represented by matrix In×m, where n is the image width, and m is the image height. For each pixel p in the image, centered at p, several lines L
θ
with different angles θ and a
In Equation (1), the length and angle of L θ is important for the computation of pixel specificity, as mentioned above, a small piece of vessel edge is nearly linear, since the line is used to detect the vessel pixels, so the length of L θ is set as the length of line segment, which means if L θ is in the vessel edge, its average intensity will be minimum, for the DRIVE database, because all the images are of the same size, so we set the line segments the same length, and in this paper the length of L θ is set as 5, and the angle determines direction of the line, and more angles can match more vessel edges, in this paper we set 6 equal angles.
The introduction of D called optic disc (OD) factor is to avoid the possible high pixel specificity values of pixels around the optic disc. In the retinal image, pixels in the optic disc area have much larger intensity values than other area. As illustrated by Fig. 2, a part of OD edge which may be misclassified as vessel is marked with a red rectangle, the pixels within the rectangle have large pixel specificity value, e.g. select one pixel in the red rectangle, and choose the line with the largest average intensity (green line) centered at the pixel, most of whose pixels are within the optic disc, so the line has large average intensity I, while the other pixels within the window W have lower average intensity M, so if s = I - M, then s will be large, and for the initial segmentation based on pixel specificity threshold mentioned in section 2.1.2, those pixels within the red rectangle may be misclassified as vessels. With the introduction of D, for the red line in Fig. 2, f and g are all in the background, so they have similar intensity, and D ≈ 0, which has little effect on the pixel specificity value of vessel pixel; however for the green line, f and g are respectively in and out of the optic disc, so the difference D is large, which will greatly reduce the s value; for the background pixels, if f and g are all in the background, then D ≈ 0, so it also has little effect on s, if they are respectively in vessel and background, then D is large either, which will also reduce the s value, and is helpful for the classification of background. So the introduction of D will only reduce the s value of pixels in optic disc and background, while has no effect on the computation of vessel pixel specificity, and the misclassification because of optic disc can be avoided effectively.

The clip of OD region. Red rectangle marks the OD region that may be misclassified as vessels, green line represents the line used to compute the pixel specificity value within the OD region, while red line represents the line used to compute a vessel pixel specificity.
For the retinal image, if the pixel specificity value of pixel p is high, then it has higher probability to be a vessel pixel, and if the pixel specificity value of pixel p is low, then it has higher probability to be background pixel [16]. So the initial segmentation will select those pixels with large pixel specificity as vessel, and select those pixels with low pixel specificity as background.
In order to determine whether a s is large or small, a specificity threshold T s is set adaptively for each retinal image. For an n × m image, pixel specificity s is computed for each pixel, and the amount count i of each s i is analyzed and sorted ascendingly, which is stored in array sCount []. Based on prior knowledge, in a retinal image, the approximate percentage of vessel pixel is between 6% and 10%, so here set q = n × m/15, z = n × m/10, if the amount of vessel pixel is count v , then q ≤ count v ≤ z. Traverse the array sCount [] in descending order according to s i , until get to s k which satisfies ∑s i ≥s k count i = count v , then the corresponding s k is the threshold T s for the pixel specificity. The detail is described in procedure 1.
In step 1), sCount is used to save the corresponding pixel number of all the pixel specificity values, because the minimum pixel specificity min (S) is normally negative, so s + |min| is used as the array index, and the corresponding element is the amount of pixels whose pixel specificities are s; in step 2), the array is traversed in reverse order, when the sum of the elements satisfies q ≤ count v ≤ z, then the corresponding array index i - |min| is the pixel specificity threshold T s . Adaptively compute T s for each image, and it is helpful for improving the segmentation accuracy.
For the pixel set C of the retinal image, if T s is used as the threshold to segment vessel and background, some pixels will be misclassified. So in order to improve the segmentation accuracy, the threshold space is divided into three parts, as illustrated by Fig. 3. Set the higher threshold T v = T s + κ (κ = 0, 1, 2 …), if there are pixels whose pixel specificity values s ≥ T s , then they are classified into determined vessel pixel set V determined ; set the lower threshold T b = T s - κ (κ = 0, 1, 2 …), if there are pixels whose pixel specificity values s < T b , then they are classified into determined background pixel set B determined . The remained undetermined pixel set is represented as C undetermined = C - V determined - B determined . The detail is described in procedure 2.

Threshold space division. Pixels with pixel specificity values higher than T v are classified as vessel, lower than T b are classified as background.
VesselDetectionByThreshold divided the pixel set C into three parts including V determined , B determined and C undetermined , where the value of κ is key to the division of C, the larger κ is, the more accurate the element of V determined and B determined will be, however at the same time more real vessel and background pixels will be missed; the smaller κ is, the more determined vessel and background pixels will be included in V determined and B determined set, but the classification accuracy will be affected. Reasonable κ can balance between the accuracy of V determined & B determined and the amount of uncertain elements in C undetermined .
For the element in C undetermined , the simple pixel specificity threshold method cannot handle the classification. In order to solve this problem, we proposed multi-agent self-adaptive pixel classification method VesselDetectionByMultiAgent, which takes each pixel in C undetermined as an Agent, according to the status of its neighbor, the intensity and pixel specificity distribution status of each Agent is computed, and based on the features of vessel and background pixels, the classification is implemented gradually.
Given an n × m image denoted as In×m = (i jk ), where i jk is the pixel intensity at position (j, k), Sn×m = (s jk ) represents pixel specificity matrix, where s jk is the pixel specificity value at position (j, k), Hn×m = (h jk ) represents probability matrix, where h jk is the probability of a pixel to be vessel at position (j, k), Gn×m = (g jk ) represents the segmentation result matrix, where g jk is the classification result of pixel at position (j, k), and 1 represents vessel, 0 represents background. Each Agent at position (j, k) has a status which can be represented by A jk = (i jk , s jk , h jk , g jk ), where i jk and s jk are fixed, and h jk and g jk will change according to the status variation of its neighbor Agents.
For ∀C
jk
∈ C
undetermined
, centered at C
jk
, a circle region with radius R is generated (see Fig. 4), and the pixel set within it is represented as C
R
= {C
xy
| ∥ (x, y) - (j, k) ∥ ≤ R}. Because vessel pixels have larger pixel specificity value s and smaller intensity value i compared to background pixels, and the vessel has small width ω, so when R >> ω, the vessel pixels are normally surrounded by large background area. According to this mode feature, if C
jk
is a vessel pixel, then most of the pixels within C
R
have lower pixel specificity s < s
jk
and larger intensity value i > i
jk
. So the two standard parameters based on which A
jk
determines the classification of pixel at (j, k) are respectively the percentage PS
jk
of pixels with lower pixel specificity s < s
jk
and the percentage PI
jk
of pixels with larger intensity value i > i
jk
within C
R
. The definition is shown in Equations (2 and 3):

The neighbor region of Agent at position (j, k).
Where R is the radius of neighbor region, N is the total amount of pixels within the region, s jk represents the pixel specificity value of pixel at position (j, k), i jk represents the intensity value of pixel at position (j, k).
Because the threshold T
v
is assigned to a higher value in Section 2.1.2, it will miss some vessel pixels in C
undetermined
. In order to search these missed vessel pixels, the pixel specificity threshold T′ will gradually decrease according to Equation (4). Based on the principle that pixels with higher specificity value have larger probability to be vessel, so for ∀C
jk
∈ C
undetermined
, check the status of A
jk
, if its s
jk
≥ T′, then compute the standard parameters PS
jk
and PI
jk
, if they are larger than the threshold T
PS
and T
PI
, then revise the status h
jk
according to Equation (5), when all the elements of C
undetermined
are checked, then a revision iteration is done.
Because the pixel specificity value is integer, so here step = 1.
For ∀C jk ∈ C undetermined , let the initial probability h jk = h(jk)old, from (5) we know that the larger s jk is, the larger h jk will be, and for the pixels in V determined , h = 1, for the pixels in B determined , h = 0; Δh is related with PS jk and PI jk , the larger PS jk and PI jk are, the larger Δh will be.
During the gradually decreasing of pixel specificity threshold T′, the probability of the pixel whose pixel specificity is higher than T′ to be vessel also gradually decreases. In order to amend the decrease of vessel standard because of the variation of T′, gradually increase the standard threshold T PS and T PI according to Equation (6), so as to reduce the misclassification probability. When T′ gets to T b , one time judgment of pixels in C undetermined is completed. Set a probability threshold T h , for ∀C jk ∈ C undetermined , check the status of A jk , if h jk ≥ T h , then count the amount C v of vessel pixels within the neighbor C R of C jk , if it is higher than the predefined threshold T Cv , then we think that C jk is in the vessel neighbor, and it has higher probability to be vessel, so it is marked as vessel, and the status of A jk is revised by setting g jk = 1, while at the same time revise C undetermined by removing it out and adding it into V determined .
Where
During the classification procedure of VesselDetectionbyMultiAgent, all the Agents process the undetermined elements in C undetermined in parallel which can improve the efficiency of pixel classification; once a pixel in C undetermined is determined as vessel, then its status will not change anymore, so the iteration will end within finite steps; the final determination of vessel pixel needs to count the amount of vessel pixels in its neighbor region, so if one Agent marks its pixel as vessel, then it will affect the pixel classification of other Agents, and Agents cooperate with each other which is helpful for the searching of missed vessel pixels because of the center highlight or noise.
VesselDetectionbyMultiAgent procedure completed the pixel classification of C undetermined , however in the classification result, there are some pixels misclassified as vessels (noise). As illustrated by Fig. 5, some of the white discrete regions marked by red ellipses are noise which should be removed, and some regions marked by red rectangle belong to the vessel which should be remained. How to discriminate noise and vessel segments is a challenge.

The segmentation result with noise and small vessel segments, the red ellipse marks the real noise region, while the red rectangle marks the real vessel segments.
From Fig. 5 we know that noise regions are normally a little far from other white regions, while small vessel segments are close to the main vessel which are also marked as white. Based on this feature, for ∀C
kl
∈ V
determined
, centered at Agent A
kl
, two neighbor windows are generated, i.e.

Illustration of double window used to remove real noise region. Red rectangle is used to search noise, and green rectangle is used to search vessel segment.
NoiseFilteringByDoubleWindow procedure re-moved noise while also remained the thin vessel segments, by this way, the segmentation accuracy can be improved; instead of recursive collection of neighbor pixels and counting the number of pixels to compute the region area, we use complete inclusion by small window to do the task, so as to determine whether to be a discrete region, and the efficiency can be further improved.
The whole vessel segmentation algorithm TMVD is composed of three procedures including initial segmentation based on pixel specificity, multi-Agent self-adaptive pixel classification and multi-window noise remove, the detail is described in the following.
TMVD algorithm is completed in three phases to segment the vessel of retinal image. Initial segmentation based on pixel specificity can get most of the real vessel and background pixels, and the remaining undetermined pixel set C undetermined is processed by multi-Agent self-adaptive pixel classification procedure, after the initial segmentation, the number of pixels in C undetermined is far below the total number of pixels in the image, because of the high efficiency of initial segmentation whose time complexity is O (n × m), and the efficiency of multi-Agent self-adaptive pixel classification is relatively low whose time complexity is O (k × n × m) (k is the average times for Agent to process each pixel), so pixel classification implemented in two phases can improve the accuracy as well as the efficiency of the algorithm; multi-window efficiently removed noise regions by double-layer window while remaining small vessel segments, which can also improve the accuracy of the algorithm.
Experiment
In order to evaluate TMVD algorithm, we use DRIVE database as our test data which includes 40 565×584 retinal images, and DRIVE provides the Ground Truth image segmented by two experts to test the accuracy of the segmentation results.
Vessel segmentation algorithm TMVD
Vessel segmentation test
In the first phase, initial segmentation based on pixel specificity VesselDetectionByThreshold is implemented, set κ = 2, and the higher pixel specificity threshold T v = T s + 2, and the lower pixel specificity threshold T b = T s - 2, and mark those pixels with pixel specificity higher than T v as white and get the segmentation result as illustrated by Fig. 7.

The vessel segmentation result by setting higher pixel specificity threshold T v .
From Fig. 7 we know that V determined got by setting higher threshold T v are almost all true vessel pixels, however there are some vessel pixels missed in C undetermined , so multi-Agent self-adaptive pixel classification procedure VesselDetectionbyMultiAgent is needed, and set neighbor radius R = 8(the largest width of vessel), T PS = T PI = 0.75, T h = 0.6, α = 0.4, ɛ = 0.35, ξ = σ = 0.6. The segmentation result is illustrated by Fig. 8.

Multi-Agent self-adaptive pixel classification result.
VesselDetectionbyMultiAgent completed the classification of pixels in C undetermined , but because of the effect of noise and pathological regions in the image, some of the background pixels will be misclassified as vessel, as the white discrete regions (noise) illustrated by Fig. 8, so NoiseFilteringByDoubleWindow is implemented to remove the noise, set μ = 4 ∼12, ξ = 6 ∼14. The result after noise filtering is illustrated by Fig. 9.

Noise filtering result by double-window.
NoiseFilteringByDoubleWindow discriminates between noise and small vessel segment, while efficiently removing noise regions, it can also remain the small vessel segments, which improves the segmentation accuracy of the algorithm.
The above parameters are important for the segmentation accuracy, Table 1 lists some parameter settings we tried in the experiment, according to the Acc, we select the parameter values that produce the maximum Acc. The most important parameters are κ, T PS and T PI , their variations will obviously change the Acc.
Different parameter values and the corresponding accuracy(Acc)
In order to evaluate the segmentation performance of TMVD algorithm, Accuracy (Acc) and ROC curve are used. Accuracy is used to evaluate the percentage of vessel and background pixels which are correctly identified in the image, and is defined by Equation (7):
Where TP is the amount of vessel pixels identified correctly, TN is the amount of background pixels identified correctly, FP is the amount of vessel pixels identified incorrectly, and FN is the amount of vessel pixels missed by the algorithm. Here Acc is the average segmentation accuracy of vessels of all the retinal images in DRIVE.
ROC curve is used to evaluate the correct vessel pixel identification rate of the algorithm, where vertical axis represents the true positive rate (tpr), and the horizontal axis represents the false positive rate (fpr). The definition is shown by Equation (8):
Where N v is the amount of vessel pixels marked in the Ground Truth image, and N nv is the amount of background pixels marked in the Ground Truth image. In the ROC curve, the closer the curve to the left-top corner of the coordinate region, the better the segmentation performance of the algorithm is. Figure 10 is the ROC curve of TMVD algorithm on vessel segmentation results of images in DRIVE. From Fig. 10 we can see that the curve is close to the left-top corner, which means that even when the false positive rate (fpr) is low, our algorithm can still get high accuracy.

ROC curve of the proposed method.
Table 2 lists Acc and AUC data of some vessel segmentation algorithms since 2000, which can be classified into supervised and unsupervised. The data show that the average accuracy (Acc) and ROC area (AUC) of TMVD algorithm are better than the others listed in the table.
Accuracy (Acc) and ROC area (AUC) data of vessel segmentation algorithm
Figure 11 shows the vessel segmentation results of our algorithm in three phases, and the segmentation accuracy keeps improving as the phases implement consecutively, and the algorithm has obvious improvement on the segmentation for the vessel central highlight, crossover, branch and optic disc regions etc.

Segmentation results and accuracy comparisons in three phases of TMVD algorithm. Where a1,b1,c1 are segmentation results based on pixel specificity, a2,b2,c2 are the multi-agent self-adaptive pixel classification results, a3,b3,c3 are the results after multi-window filtering, the right line charts are the accuracy comparisons in three phases of the algorithm.
The automatic analysis of retinal vessels is of great importance for the medical application and scientific research. In order to analyze the vessel parameters, the vessels need to be segmented first. This paper proposed a vessel segmentation method based on pixel specificity and self-adaptive classification strategy, which improved the limitations of state-of-the-art methods in the following aspects: ➀no image preprocess is implemented so as to ensure the extraction of small vessels; ➁introduce OD factor into the computation of pixel specificity, and reduce or even remove the effect of OD on vessel segmentation; ➂within a multi-threshold range of pixel specificity, Agent can use the status information of its neighbor Agents to revise its own status, which can solve poor segmentation problem due to the vessel central light to a certain extent, and because no model is needed for the vessel branch and crossover region, so the segmentation of these regions is also better; ➃use double-layer window to remove noise while remaining the thin vessel segments, by this way, the segmentation accuracy can be improved. Test the algorithm on DRIVE database, the experiment shows that TMVD has better segmentation accuracy and efficiency than state-of- the-art methods.
From the segmentation results we can see that some vessels are still missed or unconnected, and our future work will focus on improving these problems.
Footnotes
Acknowledgments
This work was partially supported by National Natural Science Foundation of China, under grant Nos. 61373079, 61272244, 61175023, 61175053, 61272430, Natural Science Foundation of Shandong Province, under grant No. ZR2013FL022.
