Introduction

Diabetes is one of the major diseases being faced by the world today. World Health Organization(WHO) survey estimated that 2.8 % people suffered from diabetes in 2000, and this percentage would increase to 4.4 % in 2030 [1]. Diabetes is becoming common nowadays in people due to physical inactivity, obesity, and aging population. Diabetic retinopathy (DR) is a secondary microvascular complication of both type 1 and type 2 diabetes, the prevalence of which strongly correlates to both the duration of diabetes and the level of glycemic control as evidenced by diabetes control and complication trial (DCCT) and UK prospective diabetes study [2, 3].

DR is the most frequent cause of new cases of blindness among the adults aged 20–64 years in the developed countries [4]. It is classified into non-proliferative DR (NPDR) and proliferative DR (PDR) stages. The earliest clinical sign of NPDR includes microaneurysms which appear as small red dots in the superficial retinal layers and cause the retinal hemorrhaging. The dot and blot hemorrhages occur as microaneurysms rupture in the deeper layers of the retina such as the inner nuclear and the outer plexiform layer. This is followed by the flame-shaped hemorrhages which occur in more superficial layers of the retina. Later as the disease progresses, the cotton-wool spots, venous beading, and the intra retinal microvascular abnormalities develop, which are the hallmarks of the progressive capillary perfusion [5]. Neovascularization on the surface of the retina and the optic disc in conjunction with further retinal ischemia signifies the presence of the PDR [4, 6].

According to a study [7], after 20 years of diabetes, the chance of having DR in patients of type 1 diabetes increases by 99% and 60% in patients of type 2 diabetes. Owing to these alarming statistics, diabetic patients need to have regular screening of their eyes to prevent themselves from vision loss. Diabetic patients with limited access to ophthalmologists have low screening rates for DR [8]. As the prevalence of diabetes is projected to increase from 25 million to 125 million in the USA by 2050 [9], the number of patients with diabetes requiring the annual retinal evaluations will far exceed the capacity of the ophthalmologists. Recent studies have shown that the undiagnosed diabetes and the related retinopathy due to virtually non-existent primary eye care centers are common in the general population and are associated with the impaired visual status of the community. This is especially the case in the third world countries like Pakistan, where the resources are limited and the budgetary allocation to health is inadequate; hence, the prevalence of DR is increasing [3, 10]. The current detection process of DR is manual, costly, and time-consuming and requires specialized skills to operate the equipment. Therefore, a new paradigm for the care of these patients is needed. Periodic sequential retinal photos are rapidly becoming the standard of care for monitoring various ocular conditions such as glaucoma, diabetic and hypertensive retinopathy, and macular degeneration. The computer-aided diagnosis systems based on image processing are becoming common these days to facilitate the doctor and reduce the diagnostic time. Towards such ends, this work introduces the readers with yet another method to automatically detect one of the pathological signs of DR in diabetic patients earlier in the disease process, i.e., hemorrhages which appear after development of microaneurysms. The proposed method is based on the image processing techniques which involve three stages, i.e., preprocessing for image normalization and contrast adjustment, blood vessel segmentation, and lastly, the localization of hemorrhages by mainly exploiting gamma correction and global thresholding. Introducing this approach from the point of view of primary care physician would substantially reduce barriers and improve early screening of retinopathy in diabetic patients by detecting hemorrhages. Also, this approach in near future will prove to be cost-effective in DR screening of diabetic patients compared to conventional retinal examination.

Related work

The supervised learning methods require some prior labeling of information in order to classify pixel as a vessel pixel or non-vessel pixel. The rule for vessel segmentation is learned on the basis of training dataset by the algorithm. In the training set, vessels are precisely segmented and marked manually by expert ophthalmologist in order to provide ground truth for learning process of the algorithm. The supervised methods are based on preclassified data; hence, their performances are better than those of the unsupervised approach.

The blood vessels in retinal images appear darker than their surrounding. This characteristic of the blood vessel was exploited by Marin et al. [11]. They proposed five gray-level and seven moment invariant (known as Hu moment invariant based) feature descriptors in combination with multilayered feed forward neural networks as a classifier that has 7 neurons in the input layer and 15 neurons in three hidden layers while output layer consists of one neuron only. The proposed algorithm proved to be robust and effective on multiple-image database and with different image variations. The AUC, accuracy, specificity, and sensitivity of the proposed methods on STARE database are 0.9769, 0.9526, 98.19%, and 69.44%, respectively, and 0.9588, 0.9452, 98.01%, and 70.67%, respectively, on DRIVE.

Similarly, Shanmugam and Banu [12] proposed five gray-level-based and two moment invariant-based features in combination with extreme learning machine (ELM) classifier for vessel segmentation in the retinal image. The proposed technique has 0.9862 accuracy, 96.79% specificity, and 82.74% sensitivity on STARE database while the same algorithm has 0.9725 accuracy, 96.79% specificity, and 81.94% sensitivity on DRIVE database. Preethi and Vanithamani [13], proposed the use of moment invariant features with neural network and morphological processing in combination with support vector machine (SVM) as classifier and scored the accuracy of 0.9365 and 0.955, respectively. Akita and Kuga [14] and Nekovei and Sun [15] exploited the artificial neural network and back propagation neural network respectively for blood vessel segmentation. However, the results of both methods were produced by visual inspection.

Sinthanayothin et al. [16] proposed a segmentation technique in which principle component analysis (PCA) was used in combination with neural network for vessel segmentation and achieved the specificity of 83.3% and sensitivity of 91%. Niemeijer et al. [17] utilized gaussian matched filter, and first- and second-order gaussian derivatives on different scales with k-nearest neighbor (k-NN) classifier for vessel segmentation, and got the accuracy of 0.9416. Staal et al. [18] exploited the intrinsic property of retinal blood vessels, found that the vessels are elongated structure, proposed image ridge-based blood vessel segmentation, and used k-NN classifier for classification purposes. The proposed image processing algorithm achieved 0.9614 of area under the curve of ROC and 0.9516 accuracy on publicly available STARE database.

You et al. [19] employed a combination of radial projection and support vector machine (SVM) classifier for retinal blood vessel segmentation. The proposed method is effective in the detection of low contrast and narrow blood vessels. The accuracy, sensitivity, and specificity of proposed technique on STARE database are 0.9497, 72.6%, and 97.56%, and for DRIVE, they are 0.9434, 74.1%, and 97.51%, respectively. The line operator with SVM classifier for vessel segmentation was proposed by Ricci et al. [20]. The proposed method is robust to nonuniform illumination and computationally simple, and requires few features. The method has the area under ROC curve as 0.9558 and 0.9602 and average accuracy as 0.9563 and 0.9584 for DRIVE and STARE database, respectively. Soares et al. [21] used 2D Gabor wavelet at multiple scales with Gaussian mixer model (GMM) classifier for segmentation of blood vessels. The proposed method has limitation with images containing nonuniform illumination and did false detection in such cases. The accuracy and AUC of this method are 0.9466 and 0.9614 on DRIVE and 0.9480 and 0.9671 on STARE database, respectively. Similarly, Osareh and Shadgar [22] utilized Gabor filter at multiple scales for candidate identification and PCA as feature extractor in combination with SVM and GMM as classifiers. The accuracy, sensitivity, and specificity of the method are 0.9675, 96.5%, and 97.10% with SVM as classifier, respectively, and 0.9524, 96.14%, and 94.84% with GMM as classifier, respectively. Lupascu et al. [23] employed 41 D feature vector containing the output of various filters (Gaussian, derivative of Gaussian, 2D Gabor filter, and matched filter) in combination with AdaBoost classifier and scored the accuracy of 0.9597, 98.74% specificity, and 67.28% sensitivity. Tamilarasi et al. [24] proposed Genetic based Fuzzy Seeded Region Growing segmentation for detection of exudate in fundus images. The proposed method achieved accuracy, specificity, and sensitivity of 0.9938, 98%, and 81.55%, respectively.

The detection of hemorrhages in retinal images [25] was also investigated by using morphological methods followed by analog algorithms. The proposed methodology was tested on many of the images, and average sensitivity, specificity, and probability values came out to be 81.9, 99.9, and 92.0%, respectively.

Shivaram et al. [26] used mathematical morphological operations and image arithmetic methods for the detection of hemorrhages and to repress the blood vessels. The result was validated by ophthalmologist and it was also compared with the hand drawn ground-truth images. After comparison, their sensitivity, specificity, and predicted value are computed as 89.49, 99.89, and 98.34%, respectively.

Sinthanayothin et al. [27] detected some symptoms of non-proliferative diabetic retinopathy using the recursive region growing segmentation, and the proposed methodology has sensitivity of 77.5% and specificity of 88.7%. These results were produced after the direct comparison of the resultant images with the image on which symptom identifications and markings have been done by the ophthalmologist.

Adaptive thresholding technique was used by Devaraj [28] to detect red lesions. His proposed method adjusted the image contrast and morphological operation erosion was applied to achieve better results. The methodology was tested on images from DIARETDBI database.

Matei and Matei [29], morphological operations using the cellular neural network operators are proposed to detect the hemorrhages in the retinal image followed by the erosion to remove blood vessels. Barman et al. [30] combined neural network with the tracking algorithm to spot the hemorrhages in fundus image. This technique was used to handle the misclassification where small hemorrhages were classified as vessels. The tracking algorithm helps in differentiating between the vessels and hemorrhages.

Diagnosis of diabetes by the detection of hemorrhages, microaneurysms, and exudates was done by using morphological image processing techniques along with SVM. These techniques were proposed by Acharya et al. [31] having sensitivity of 82% and specificity to be 86%.

Jagatheesh and Jenila [32], DR lesions are detected using bag of visual words (BoVW) model approach. The required features were extracted using speeded up robust features (SURF). For building visual dictionary, k-means clustering was used. For generating bag of visual words (BOVW), Fisher vector encoding and max pooling technique are applied followed by SVM used for lesion classification.

Kleawsirikul et al. [33], an attempt has been made to develop an effective algorithm to detect hemorrhages. In the preprocessing step, the green channel was extracted from the fundus image as it distinctly displays the red color features of both hemorrhages and retinal blood vessels. The image is then inverted in order to emphasize the areas of interest, i.e., the hemorrhages, in white, and then, contrast-limited adaptive histogram equalization (CLAHE) is applied to maximize the contrast of the image. Following this, the morphological top hat operator was applied to detect the hemorrhages. Finally, rule-based classification is used to classify hemorrhages based on their features, for instance, compactness, area, and eccentricity. The proposed method achieved the sensitivity of 80.37%, specificity of 99.53%, and accuracy of 99.12%.

Seoud et al. [34], used dynamic shape feature to identify the red lesions in the fundus image. The proposed method does not require prior segmentation of the blood vessels, and the candidate regions are identified after image processing and features are then extracted to subsequently classify each potential region. For classification, supervised learning was used to differentiate the lesions from other structures and background noise. The method was tested on several databases; few of which are publicly accessible also. When tested on the Retinopathy Online Challenge’s database, this method obtained a free-response receiver operating characteristic (FROC) score of 0.420 which ranked it fourth. On the Messidor database, this method achieved an area under the ROC curve of 0.899.

The work presented in this paper is also inspired by the computerized detection of hemorrhages which is one of the early signs of the presence of the retinal diseases in the diabetic patients after the development of microaneurysms.

Implementation

The approach presented in this paper for detecting hemorrhages is based on three major steps. The first step is to preprocess and enhance the image quality in case of low illumination and contrast. The subsequent step is to remove blood vessels from the fundus image. This is a good starting point which will assist in not detecting blood vessels as hemorrhages. Both blood vessels and hemorrhages share the same color so it is important to detect the blood vessel first and then segment it from the fundus image. After the blood vessel segmentation, the later steps mostly employ the morphological operations and thresholding. All steps will be performed on the input image as shown in Fig. 1.

Fig. 1
figure 1

Input image

Preprocessing

There might be cases when the fundus image suffers from poor illumination and contrast. In such cases, before detecting the hemorrhages, the preprocessing of the fundus image becomes indispensable. The purpose of preprocessing is to enhance the image contrast and its brightness. To increase the contrast of the fundus image, we first extracted the green channel response of the image as it provides a better contrast as compared to the other two color channels, i.e., blue and red. Although we increased the contrast of the image, the contrast alone is not sufficient to detect the hemorrhages. The green channel response of the image was further normalized using Eq. 1:

$$ n(x,y) = (g(x,y) - G_{1} ) \div \sqrt {G_{2}}, $$
(1)

where n(x,y) is the normalized image, g(x,y) is the input image, and G 1 and G 2 are the Gaussian filters. Equation 1 can be comprehended more easily by Fig. 2.

  • G 1 is the Gaussian filter of g(x,y) with sigma σ 1, and size of the filter is the double of normal inverse cumulative distribution function of σ 1 with mean 0 and probability 1e − 1.

  • G 2 is the Gaussian filter of square of g(x,y) with sigma σ 2 and size the double of normal inverse cumulative distribution function of σ 2 with mean 0 and probability 1e − 1. Figure 3 shows the preprocessing result.

Fig. 2
figure 2

Image normalization

Fig. 3
figure 3

Preprocessing

Blood vessel segmentation

After preprocessing, the blood vessel segmentation is performed. It is a prerequisite in detection of hemorrhages and a complex problem. We used the method proposed by Vlachos and Dermatas [35]), in which multi-scale retinal vessel segmentation has been performed using line-tracking. The line-tracking process begins from a small cluster of pixels, acquired from a brightness selection rule, and aborts when a cross-sectional profile condition is eventually invalid. The multi-scale image projection is obtained after combining each image map along scales, encompassing the pixels confidence to exist in a vessel. The foremost network of vessels is obtained after performing map quantization of the multi-scale confidence matrix. Then, median filtering is adapted in the foremost vessel network, rebuilding disjointed vessel lines and removing the noisy lines. Eventually, postprocessing eliminates the erroneous areas by applying the directional attributes of the vessels and the morphological reconstruction (Fig. 4a).

Fig. 4
figure 4

Blood vessel segmentation

The image obtained after blood vessel segmentation is further processed using morphological opening operation with square structuring element. With morphological opening, the entire foreground morphology which is smaller than the structuring element is removed by applying erosion, and then, the residual structures are softened or smoothed by using dilation and then restored to their original size (Fig. 4b).

Localization of hemorrhages

The method of localization of hemorrhages is based upon the combination of mathematical morphological operations and image enhancement techniques. Hemorrhages, which are dark spots in fundus image, are brought to foreground by taking complement of the output (Fig. 5a) of the preprocessing stage defined in section “Preprocessing”. The intensity values are adjusted using gamma correction, and this adjustment is with the shape of curve in which mapped values are weighted towards brighter intensities (Fig. 5b). Gamma correction is described by using power-law expression given in Eq. 2.

$$ I_{\text{out}} = AI_{\text{in}}^{\gamma} $$
(2)

V out is the output image and V in is the input image, where A is constant and γ defines the nature of the gamma curve. In general case, A is 1, which is also true for our proposed method. We did not perform gamma correction on all intensity values present in the image. Intensity values of the input image to be used in gamma correction are clipped between low intensity values IN l o w and high intensity values IN h i g h . IN l o w and IN h i g h are selected by saturating the upper 1% and the lower %intensity values present in the input image. The shape of gamma curve was specified using γ = 10. To remove the blood vessels from the image, the complement of the detected blood vessels has been taken and is then masked onto the image (Fig. 5c). Mean filter is necessary to smoothen the image after the blood vessels have been segmented out of the image. For calculating the mean filter at the boundaries of the image, intensity values outside the bounds of the image matrix are considered to be equal to the nearest border value (Fig. 5d). The final binary image highlighting the detected hemorrhages is then calculated using global thresholding (Fig. 5e). Thresholding creates binary images from gray-level ones by making all pixels below some threshold to zero and all pixels about that threshold to one. If f(x,y) is the input image, the image obtained after thresholding g(x,y) is given by Eq. 3 [36].

$$ g(x,y)= \left\{\begin{array}{ll} 1,& \text{if } f(x,y) \geq t\\ 0, & \text{otherwise} \end{array}\right. $$
(3)

The localization of hemorrhages was performed by using Matlab “im2bw(I, level)” function, where I is the input image and level is the normalized intensity value in the range [0,1]. This function converts an image into a binary image based on some threshold or level. The output binary image substitutes all pixels in the input image with luminance greater than level with the value 1 (white) and changes all other pixels with the value 0 (black). The proposed model was tested with a number of threshold/level values ranging from 0 to 1 and the value that worked best and yielded the optimal results was found to be 0.47.

Fig. 5
figure 5

Localization of Hemorrhages

Results

The potential of our proposed method has been determined by the performance metrics like sensitivity (SN), specificity (SP), and accuracy as shown in Table 1. For any binary classifier, the output can be termed either as positive or negative. Both outputs again can be either true or false, which gives four different possibilities. If the output of the classifier is positive and the actual value is also positive, it is called as true positive (TP), and if the actual value is negative, this output is termed as false positive (FP). If the output of the classifier is negative and actual value is also negative, it is called as true negative (TN), and if the actual value is positive, this output is termed as false negative (FN).

Table 1 Performance comparison of proposed Method with other methods

SN is the ability of an algorithm to detect a pixel as a point of interest. It is the ratio of TP and conditional positive values.

SP is the ability of an algorithm to detect a pixel as a point of the background pixel. It is the ratio of TN and conditional negative values.

The accuracy of the proposed model is estimated by calculating the proportion of true positive and true negative in all evaluated images.

$$ \mathrm{Sensitivity (SN)~=~TP~/~(TP~+~FN)} $$
(4)
$$ \mathrm{Specificity (SP~)~=~TN~/~(TN~+~FP)} $$
(5)
$$ \mathrm{Accuracy~=~(TP~+~TN)~/~(TP~+~TN~+~FP~+~FN)} $$
(6)

Our proposed algorithm was tested on DIARETDB1 database and produced SN of 84%, SP of 87%, and an accuracy of 89%. So this demonstrates that our proposed method is capable of producing acceptable and competitive accuracies.

Conclusions

The computer-aided diagnostic systems based on image processing are becoming wide these days to assist the doctor and also play a potent role in decreasing the diagnostic time. The retinal microcirculation can be viewed non-invasively offering an easily accessible way to study the health and disease of microvasculature in vivo. Improved screening strategies are required for early detection and diagnosing debilitating illnesses such as diabetes. For this purpose, this work proposed an automated method to detect one of the pathological signs of DR. The proposed binary classifier is a model-based approach and does not require any training data sets to classify the input. In this respect, the proposed method is computationally inexpensive and fast. Although supervised methods produce more accurate and quality classification as compared to that of model-based approach; however, they are generally way more computationally expensive. This work can be further extended by fine tuning the results using adaptive thresholding techniques at the final stage and utilizing supervised learning methods.