Keywords

1 Introduction

Diabetes is a disease that occurs when the pancreas does not secret enough insulin. According to the World Health Organisation (WHO), 135 million people have diabetes worldwide and the number of people with diabetes increases to 300 million by the year 2025 [1].

Diabetes is the major cause of blindness. DR being one of the complications caused by diabetes, affects different parts of the retina such as blood vessels, optic disk, macula and fovea as shown in Fig. 1. DR is a medical condition where the retina is damaged because fluid leaks from blood vessels into the retina [2]. Due to this, new features such as micro aneurysms, exudates, and hemorrhages appear in back of the retina as shown in Fig. 2.

Fig. 1
figure 1

Normal retinal fundus image

Fig. 2
figure 2

Retinal image with DR lesions

  • Micro aneurysms (MA)—MA are the small enlargement of minute blood vessels of eye. They are the first clinical signs of DR.

  • Exudates is a fluid rich in protein that leaks out of blood vessels into the back of the retina and is deposited in nearby tissues.

Until the DR has affected a large area on the retina, the patients do not notice any visual problems. So there is a need for mass-screening of diabetic patients’ eyes to detect the DR as early as possible. Although the process of manual diagnosis is possible, it is very cumbersome and limits the mass-screening process [2]. Therefore the automatic method is very much needed.

2 Literature Survey

Agrawal et al. [1] have done a survey on automated MA detection in DR retinal images. Here the authors review and analyse techniques and methodologies used for the detection of MA from DR present retinal fundus images.

Mahendran and Dhanasekaran [3] have proposed a method on Morphological Process and SVM Classifier for diagnosis of DR. It focuses on automatic detection of DR through detecting exudates.

Mahendran et al. [4] have proposed Morphological Operations based Segmentation for the Detection of Exudates from the retinal. First it detects the DR through identifying exudates by Morphological process and then segregates the severity of the lesions by Cascade Neural Network (CNN) classifier.

Mahendran et al. [5] have proposed a method based on Morphological Process and PNN Classifier for the identification of Exudates for DR. It uses morphological process to detect exudates. Canny edge detector is used to remove the OD. Probabilistic Neural Network (PNN) classifier is used to classify the DR.

Sri et al. [6] have proposed a method where in mathematical and statistical approach is used to identify different stages of DR. After segmenting the blood vessels from the fundus images, it calculates the area and perimeter of the blood vessels which helps in identifying the severity of the DR.

3 Methodology

To understand the detection of DR process, some of the concepts are very much required. A brief discussion is carried out here.

  1. (a)

    Morphological Operations

Image Morphology offers a unified and powerful method to many image processing problems. Usually it involves special mechanisms of merging two sets of pixels. Out of the two sets, one set consists of image to be processed and the other set consists of Structuring Element (SE) or also called as the kernel. In all the operations of morphology, SE is very important. It is matrix of 0 s and 1 s that have any arbitrary shape and size. This SE controls the operation on the image.

Morphological operations mainly involve Dilation, Erosion, Opening and Closing.

Morphological Dilation is the process of thickening the image which is controlled by SE. It is denoted by

$$ A\, \oplus \,B = \left\{ {z \in E\,|\,(B^{s} )_{ \approx } \cap \,A \ne \emptyset } \right\} $$
(1)

Here B is the SE.

Morphological Erosion is the process of thinning the image which is controlled by SE. it is denoted by

$$ A\, \ominus \,B = \left\{ {z \in E \, | \, B_{ \approx } \subseteq \,A} \right\} $$
(2)

Generally Morphological Opening smoothes the contour of an object, breaks narrow strips and eliminates thin projections. It is denoted by

$$ A\, \circ \,B = (A\, \ominus \,B)\, \oplus \,B $$
(3)

Morphological Closing tend to smooth the section of contour, but it generally fuses narrow breaks and long thin gulfs, eliminates small holes and fills gaps in the contour. It is denoted by

$$ A\, \bullet \,B = (A \oplus B)\, \ominus \,B $$
(4)
  1. (b)

    TopHat Transformation

It extracts the small elements and details from the given image. It also eliminates the uneven illumination in an image. There are two kinds of TopHat Transformation. One is White TopHat transformation and the other is Black TopHat transformation. White transformation returns the image which contains those objects of input image that are smaller than the SE and brighter than their surroundings. It is denoted by

$$ T_{w} (f) = f - f\, \circ \,b $$
(5)

Here b is the SE.

Black TopHat transformation returns the image which contains those objects of input image that are smaller than the SE and darker than their surroundings.

It is denoted by

$$ T_{b} (f) = f\, \bullet\, b - f $$
(6)

4 Extraction of Retinal Features and the Proposed Method

  1. (a)

    Extraction of Blood Vessels (BV)

The extraction of BV is very much needed in identification of both exudates and MA using image processing. The contrast between the BV and the background is very high in green component of the original fundus image. So this green component is preprocessed to get the high quality image. Now the Black TopHat transformation which follows Eq. (6) is applied on the preprocessed image. Then the image is adjusted to improve the contrast and to remove the uneven illumination in the image. The BV are extracted by converting image into binary image and inverting the intensity of the output image.

  1. (b)

    Detection of Exudates

Exudates are the fluids rich in protein that are leaked from the BV. They are deposited in nearby tissues. They appear as a bright white-yellow spots. In order to detect the exudates, the retinal/fundus images are pre-processed. To do so, first, the images are converted into green component as the contrast between the objects and the background is very high in green component. Then to remove the speckle and other noise present in the image the median filter is applied. Finally to maintain a standard, the images are resized to 1500 × 1152.

Now to detect exudates, the TopHat transformation is used in two phases. In the first phase the White TopHat transformation concentrates on the actual size of exudates and the second phase of TopHat transformation concentrates on removing the Optic Disk (OD). For this, two SE (say SE1 and SE2) are used. SE1 is ball shaped with radius 5 and height 6. Using this SE1 the TopHat transformation is applied on the preprocessed image. Then contrast stretching is done. This results in good contrast between exudates and the background. As the intensity values of OD and exudates are almost similar, the part of OD is also present with exudates in the output image. However the TopHat transformation applied on preprocessed image adds some noise nearby the strong BV. Then the output image is converted into binary image. To get the actual size of exudates, morphological opening is done with disk as the SE with radius 3 and height 6.

In the second phase of TopHat transformation the ball shaped SE2 with radius 50 is used to remove the OD. Here the TopHat is applied on the preprocessed image with SE2. The output of this is contrast stretched and thresholding is done to convert it into binary image. The binary image contains the major portion of OD along with the exudates and other unwanted objects. To find the rough location of OD the morphological opening is done with disk of size 19 as SE is applied on this binary image. Then to get the coordinates of OD, the centroid is calculated. After that the OD mask of radius 85 (because the size of OD ranges from 80–83 pixels in the fundus image) is created. This mask is applied on the output of first phase TopHat transform to remove the OD. To remove the noise added during the first phase of TopHat transformation, the already extracted BV image is subtracted from the mask applied first phase TopHat transformation output. So the final image contains only the exudates with their actual size.

The process of detection of Exudates can be represented as shown in Fig. 3.

Fig. 3
figure 3

Process of detection of exudates

  1. (c)

    Detection of Microaneurysm (MA)

MA are the small enlargement of blood vessels of retina. They are the first clinical signs of DR. MA appear as a small dark spot. They are very difficult to detect because the size of MA ranges from 15 to 60 μ.

To detect MA, first the intensity of fundus image is adjusted and they are resized to 1500 × 1152 to pre-process them. The contrast of preprocessed image is stretched by applying Adaptive Histogram Equalization before applying canny edge detection method to detect the minute edges of the retina. The boundary is detected by filling the holes by using disk shaped SE of size 6 for morphological opening. To get the image without boundary, the edge detected image is subtracted from boundary detected image.

Then the holes are filled to get the MA and other unwanted objects. The extracted BV image is subtracted from this image to remove the unwanted objects. The process of extraction of MA is as shown in Fig. 4.

Fig. 4
figure 4

Process of extraction of MA

  1. (d)

    Classification of DR

After detecting the exudates, the area of exudates is calculated. At the same time when the MA is detected, the number of MA present in the image is calculated. To classify the DR, SVM classifier is used. For the SVM to classify, some of the inputs are needed. Those inputs are the features extracted from the exudates detected image. These features are entropy, homogeneity, contrast and energy. They are extracted using Gray Level Co-occurrence Matrix (GLCM). It contains information about the position of the pixels having most similar gray levels. The GLCM which can represented as P[i, j] is used to calculate all pairs of pixels separated by distance vector having gray levels i and j.

The formulae for these features are:

$$ Entropy = - \sum\limits_{i,j} {p\,(i,j)\,{ \log }\, (p\,\text{(}i,\,j\text{)} )} $$
(7)
$$ Homogeneity = \sum\limits_{i,j} {\frac{1}{{1 - (i - j)^{2} }}p\,(i,\,j)} $$
(8)
$$ Contrast = \sum\limits_{i,j} {\left| {i - j} \right|^{2} \,p\,(i,\,j)} $$
(9)
$$ Energy = \sum\limits_{i,j} {p\,(i,\,j)^{2} } $$
(10)

After extracting all these required features, they are given as input to SVM classifier to train and classify the DR as normal or abnormal (Fig. 5).

Fig. 5
figure 5

Overall process of the proposed method

5 Experimental Results

After testing the proposed method on 136 retinal images, the following results are obtained.

  • True Positive (TP)—59 Images

  • True Negative (TN)—55 Images

  • False Positive (FP)—00 Images

  • False Negative (FN)—22 Images

The Table 1 shows the performance of the proposed system as according to the formulae given below.

Table 1 Performance of the proposed method
$$ {\text{Sensitivity}} = {\text{TP}}* 100\,/\,({\text{TP}} + {\text{FN}}) $$
(11)
$$ {\text{Specificity}} = {\text{TN}}* 100\,/\,({\text{TN}} + {\text{FP}}) $$
(12)
$$ {\text{Accuracy}} = ({\text{TP}} + {\text{TN}})* 100\,/\,({\text{TP}} + {\text{FN}} + {\text{TN}} + {\text{FP}}) $$
(13)

6 Conclusion

Automatic Detection of DR presents many of the challenges. The size and the color of micro aneurysms are very similar to that of the blood vessels. Its size is variable and small. So it can be easily confused with the noise present in the image. In this paper a novel approach is presented to detect and classify the disease DR based on TopHat transformations. However the TopHat transformation adds some unwanted objects nearby strong blood vessels. These are removed in this proposed method. Based on the study the researchers are able to get a precise perception of automatic detection of DR which can go a long way to enable them to develop more effective and better methods for diagnosis of DR.