Detection of Early Signs of Diabetic Retinopathy Based on Textural and Morphological Information in Fundus Images

Estimated blind people in the world will exceed 40 million by 2025. To develop novel algorithms based on fundus image descriptors that allow the automatic classification of retinal tissue into healthy and pathological in early stages is necessary. In this paper, we focus on one of the most common pathologies in the current society: diabetic retinopathy. The proposed method avoids the necessity of lesion segmentation or candidate map generation before the classification stage. Local binary patterns and granulometric profiles are locally computed to extract texture and morphological information from retinal images. Different combinations of this information feed classification algorithms to optimally discriminate bright and dark lesions from healthy tissues. Through several experiments, the ability of the proposed system to identify diabetic retinopathy signs is validated using different public databases with a large degree of variability and without image exclusion.


Introduction
At least 2.2 billion people around the world have a vision impairment, of whom at least 1 billion have a vision impairment that could have been prevented or is yet to be addressed [1]. Eye conditions such as cataracts, trachoma and refractive error are the main focus of eye care strategies. The combination of a growing and ageing population will significantly increase the total number of people with eye conditions and vision impairment (estimated blind people in the world will exceed 40 million by 2025). Other common eye conditions reported by the World Health Organization include: myopia (near-sightedness), late detection in poorly integrated eye care services, and diabetic retinopathy (increasing numbers of people are living with diabetes, particularly Type 2; nearly all people with diabetes will have some form of retinopathy in their lifetimes) [1]. For this reason, the early detection of diabetic retinopathy is essential to guarantee the maintenance of the vision. The first signs of diabetic retinopathy can be noticed using fundus photographs acquired by means of a retinal camera.
Diabetes occurs when the pancreas does not secrete enough insulin, or the body is unable to process it properly. Diabetes affects the circulatory system, and therefore to the retina. When fluid leaks from blood vessels into the retina, this is damaged and this medical condition is called diabetic retinopathy (DR) [2,3].
For automatic screening of diabetic retinopathy through fundus imaging, systems are based on the detection of specific anomalous patterns or lesions [4], e.g., microaneurysms (small saccular dilations of capillaries that appears as round spots of dark red color with sharp edges in the retina background), exudates (deposits of lipids and proteins in the retina that produce bright lesions of yellowish-white color with prominent and irregular edges), cotton wool spot (a result of accumulations of axoplasmic material within the nerve fiber layer that appear as fluffy white patches on the retina) and hemorrhages (wide accumulation of blood in the retina). In this paper, we focus on the detection of all these lesions because they are the earliest visible signs of the disease. The goal is to distinguish healthy from pathological areas of the image considering both cases bright and dark retinal damage and proposing a unique feature vector able to encode the relevant information in the two cases. We show an example of the most common DR signs in Figure 1. Depending on the evolution with time, diabetic retinopathy is classified as Non-Proliferative and Proliferative [5]. Non-Proliferative is the earliest stage of the pathology and it is characterized by deposits of extra fluid and small amounts of blood, from the vessels into the retina, exudates and microaneurysms. It usually progresses to develop the Proliferative one because many blood vessels in the retina are closed hindering the proper blood flow. The retina responses to this fact by growing new abnormal blood vessels (this process is called neovascularization).

Exudates
Routine eye checks and good diabetes control can protect people's vision from this condition. The action plan presented by the WHO [6] reflects the eye care services need to become an integral and established the screening campaigns, as key method for detecting retinal pathologies in their early stage [6]. However, these proposals require a large workload of trained experts in the identification of anomalous retinal patterns. This fact along with the increasing of the population at risk, make these proposals economically unfeasible. Moreover, it must be pointed out that this type of retinal disease diagnosis is highly influenced by the inherent subjectivity of each expert. These arguments suggest the need for developing automatic screening systems that can be used in primary health care reducing the working time to the specialists and providing the location and quantification of the pathological retinal tissue propitiated by retinal diseases.
Automatic screening systems based on digital imaging should be supported by acquisition devices of high resolution to guarantee the successful of the diagnosis in difficult cases. Algorithms able to extract the relevant information from fundus images have become increasingly important for the automatic screening and to provide clinicians support in the diagnosis phase.
There are two machine learning paradigms to try to solve the problem: the traditional classification approach where the input is a feature vector obtained from the fundus images [7][8][9], and the deep learning approach (in particular, using convolutional neural networks) [10][11][12]. While the second approach usually gets better classification results, most of these methods do not provide understandable interpretations about the relevant features of the different pathological signs in the retina, so its clinical usefulness is questionable until more research efforts in the interpretation of the high-level features extracted by the convolutional blocks of a CNN will be done. It is unlikely that a black box classification system is going to be accepted by any ophthalmologist in the real world, no matter the good the results are in previous experiments. Another important issue is the limited amount of labeled fundus images required by deep learning strategies. Some recent works are trying to overcome these limitations by creating synthetic data [13][14][15].
The approach presented in this paper belongs to the traditional classification approach. In that case, the most common procedure is to segment these lesions using different methods [16][17][18]. These approaches present a high false-positive rate at pixel level. This fact is the main motivation of the new perspective proposed in this work, in which the characterization of healthy and damaged retinal areas is studied by applying image descriptors in a local way, avoiding the segmentation step. Our approach is different to previous works based on feature extraction and classification. In [19] a previous segmentation of exudates is required to perform the feature extraction. The most habitual procedure is to extract features from a lesion candidate map generated by different techniques such as mathematical morphology [16,20,21], background subtraction [22], clustering [23] or using banks of filters and applying a low adaptive threshold [24,25] among others. To the best of the authors' knowledge, the work proposed by Quellec et al. [26] is the unique previous attempt which has some resemblance with the strategy proposed in this paper. The main difference is that they use a local analysis without overlapping based on wavelet features; area under the receiver operating curve 0.761 was reported in e-ophtha public database. In our paper, robust descriptors extract texture, shape and roughness features from the visual information of retinal images. This methodology does not require the previous segmentation of retinal lesions or the generation of candidate maps, avoiding error sources due to the segmentation process and computational cost.

Materials
Two public fundus databases were used to validate the methods proposed throughout this paper.
• E-OPHTHA [27] is a database of fundus images especially designed for diabetic retinopathy screening. This public database is divided in two subsets depending on the lesion type: exudates and microaneurysms. These lesions are manually annotated by experts and the ground truth is provided. In this paper, we will use the exudates subset (E-OPHTHA_EX) that is composed by 47 pathological images (Pathological_EX) and 35 images with no lesion (Healthy_EX). All the retinal images were acquired with the same field of view angle 40 o , and they present different spatial resolutions: 13 images with 1440 × 960 pixels, 2 with 1504 × 1000, 9 with 2048 × 1360 and 23 with the highest resolution 2544 × 1696). • DIARETDB1 public database [28] consists of 89 color fundus images, of which 84 contain at least mild non-proliferative signs of diabetic retinopathy and five are considered to be normal by medical experts. In particular, 41 fundus images show bright lesions (exudates) and 45 contain dark lesions (microaneurysms or hemorrhages). The angle of vision is 50 o and resolution 1500 × 1152 pixels. The ground truth used in this paper is the one proposed by the authors of the database (when 3 out of 4 experts label the pixel as pathological, it is considered to be an exudate pixel).

Data Conditioning
The original fundus images must be preprocessed to take into account three issues that can influence the performance of the classifiers: image resolution, color and the presence of blood vessels.

• Resolution normalization
The E-OPHTHA_EX database is composed by images with four different resolutions. The images are resized to the dimensions of the smallest image (1440 × 960) after a local maximum filter is applied in order to preserve the small bright lesions [29] (complementary a minimum filter is used to keep microaneurysms).

• Color normalization
In fundus images, the green component of the RGB representation shows the maximum contrast between lesions and background. The red channel is often saturated and has low contrast, and the blue channel is very noisy and suffers poor dynamic range. For these reasons, the green component is commonly used to segment the lesions [16,20,30] and it is used in this work. However, the green mean value differs significantly for different images even in the same database due to incorrect white balance. To normalize images, we apply a color transformation with the aim of increasing their color homogeneity [31].
• Impainting blood vessels Blood vessels cover a high percentage of the fundus image hindering the automatic detection of important structures as optic disc, optic cup and macula, among others. Vessels are also considered to be noise or artefacts that hamper the segmentation of different lesions such as exudates, microaneurysms and drusen among others and also the classification of pathologies based on background textures. Retinal vessels segmentation techniques aim to separate the different retinal vasculature structure tissues from the fundus image background and aforementioned retinal anatomical structures such as optic disc, macula, and abnormal lesions. See [32] for a review of retinal vessels segmentation algorithms, and [33] for a review of optic disc segmentation for glaucoma detection.
A possible procedure to avoid blood vessels is to consider these structures as missing pixels and trying to restore them using the background. Image inpainting is a technique for restoring missing or damaged areas in a digital image [34]. Inpainting methods assume that pixels in the known and unknown areas of the image have the same statistical properties or geometrical structures. Different algorithms exist in the literature [35]; we will use a sparse-based inpainting method with spread neighborhoods specifically designed to inpaint blood vessels in fundus images [36].

Image Patches: Input Features and Class Labels
The lesions induced by diabetic retinopathy present different sizes according to the stage of the disease. In the feature extraction stage of the proposed methodology, descriptors are locally calculated: the image is divided in patches using a sliding window of size N w × N w and overlap of (∆x, ∆y), and image descriptors are computed for each patch. For example, we show the case N w = 64 and 50% overlapping (∆x = ∆y = N w /2) in Figure 2a. This procedure can be related to the way in which the human inspects and analyzes an image. From an image-processing point of view, the sliding window strategy is the same as a 2D grid or a dense sampling of the image, in which the samples correspond to the central pixel of the window. Figure 2 represents the whole procedure and equivalent dense image sampling. It is important to note that patches should contain at least one pixel belonging to retinal texture to be processed; in other words, patches contained entirely outside the lens are discarded. In addition, patches containing optic disk pixels, obtained by the method proposed in [37], are not considered in the process (Figure 3).

Methods
In this section, we present the proposed image descriptors (features) and classifiers used to distinguish between the healthy and pathological retinal tissue. The features are obtained from the patches obtained in the previous section. We explore different descriptors: local binary patterns to encode the texture of pathological patches and hierarchical morphological operators to encode granularity. We will use these features as the input to the classifier.

Local Binary Pattern Variance
Local Binary Patterns (LBP) is a powerful feature for texture classification [38]. LBP establishes a label for each pixel taking into account its neighborhood which is defined by a radius R and number of points P: where P represents the number of samples on the symmetric circular neighborhood of radious R, g c is the gray value of pixel (i, j) and g p the gray value of each neighbor. The final LBP P,R label is obtained by converting the binary string into a decimal value. LBP P,R texture operator describes the occurrence of specific patterns in the neighborhood of each pixel in a P-dimensional histogram. LBP technique has been previously used in fundus images mostly for the segmentation of retinal vessel [39,40] and the automatic identification of ophthalmic diseases [9,19,41]. We will use the rotation-invariant uniform LBP implementation LBP ruin P,R [42]. Using this LBP variant, with a level of uniformity of U = 2 and P = 8, ten different texture labels could be generated depending on the binary string computed in the comparison between a pixel and its neighborhood.
To boost the performance of LBP and to obtain a texture descriptor invariant against shifts in gray scale, the complementary measure VAR P,R is also computed and combined with the LBP riu2 P,R obtaining the final feature vector LBPV P,R as follows: where: where K is the maximal LBP label. In Figure 4 we show a graphical example of how this feature vector is obtained for a given patch.

Ganulometric Profile
One of the most interesting techniques based on mathematical morphology is granulometry [43,44]. In [45] this technique is used with the aim of detecting neovascularization, i.e., the abnormal formation of blood vessels in the retina due to the lack of oxygen.
Given a gray-level image f ∈ F(E, T), its dilation (erosion) by a flat structuring element B is introduced as the dilation (erosion) of each level set X t ( f ) by B: The two elementary operations of gray-level erosion and dilation can be composed together to yield a new set of gray-level operators with desirable feature extractor properties which are given by, the gray-level opening: (6) and the gray-level closing: Making use of the previously explained operators, a shape descriptor can be defined. Let us first consider an opening γ i ( f ), applied to an image f with a structuring element (SE) of size i. The opening can be computed as a sequence of an erosion followed by a dilation. When opening is computed on the image with a SE of increasing size (λ), we obtain a morphological opening pyramid (or granulometry profile) which can be formalized as: where n max represents the maximum size of the structuring element. By duality, a closing, ϕ i ( f ) is defined as the dilation of an original image f with a SE of size i. In the same way, a morphological closing pyramid is an anti-granulometry profile and can be computed on the image performing repeated closings with a SE of increasing size (λ) defined as: In Figure 5 and Figure 6 we show the different levels of the pyramids Π γ and Π ϕ for n = 0, 2, 4, . . . , 22 for a particular fundus image, respectively.  Let m( f ) be the Lebesge measure of a discrete image f : m( f ) is the area of f in the binary case (number of pixels) and the volume in the grey-scale case (sum of pixel values). Making use of the morphological pyramids established above, a shape descriptor can be defined. The granulometry curve, or pattern spectrum of f with respect to Γ is defined as the following (normalized) mapping: The pattern spectrum PS Γ ( f , n) (also called size density of f ) maps each size n to some measure of the bright image structures with this size: loss of bright image structures between two successive openings. It is a probability density function (a histogram) in which a large impulse in the pattern spectrum at a given scale indicates the presence of many image structures at that scale.
By duality, the concept of pattern spectrum extends to anti-granulometry curve PS Φ ( f ), by closings ϕ n ( f ), stacked in the morphological pyramid Π ϕ : This spectrum characterizes the size of dark image structures. Both granulometry curve and anti-granulometry curve can be appended into a unique curve, with closings versus size on the left side (negative side) and openings versus size on the right side (positive side) of the diagram; i.e.: From the morphological pyramids, a local description of the shape and size of the retinal texture is performed by computing the pattern spectrum of squared patches. In particular, PS Γ ( f , n) and PS Φ ( f , n) are locally computed for each patch of the green channel of fundus images (extracted according to the explanation in Section 2.2), following Equations (10) and (11) respectively. In addition, the combination of both descriptors takes place to the curve PS ( f , n) according to Equation (12). Please note that the symbol denotes the locality of the descriptor. In Figure 7a,c, the local extraction of the granulometry and anti-granulometry curves from the morphological pyramids Π γ and Π ϕ is represented. PS Γ ( f , n) and PS Φ ( f , n) descriptors extracted from the patch marked in red in a fundus image are reported in Figure 7b,d. In addition, the whole pattern spectrum PS ( f , n) is shown in Figure 8.

Classifiers
We tested three different classifiers: random forests (RF), support vector machines (SVM) and Gaussian processes for classification (GPCs). RF was chosen as the most used tree-structured predictor in the literature to address classification problems. One of its major strengths is the low computational time required in the training stage while its principal disadvantage is that RF usually suffer from overfitting when using high-dimensional feature vectors. To make face this problem, a kernel-based method was additionally selected as robust method against overfitting, i.e., SVM with Radial Basis Function (RBF) kernel. Finally, to solve the problem under study from other point of view, a probabilistic classification algorithm was also involved in the experimental stage, i.e., GPCs.
• Random Forests are a combination of tree-structured predictors {h(x, Θ k ), k = 1, ..., K} so that each tree depends on the training set and values of a random vector, {Θ k }, independently sampled of the past random vectors {Θ 1 , ..., Θ k−1 } and with the same distribution for all trees in the forest [46]. To predict a new instance, it is pushed down the tree. Then, the label assigned to the instance will be the label corresponding to the terminal node of the tree. This process is iterated by the K predictors or trees and the final classification label will be obtained by majority voting of the trees. • Support Vector Machine (SVM) builds a hyperplane of separation in the input space maximizing the distance or margin with respect to the supported vectors of the different classes [47,48]. The input data is usually kernelized in order to take into account classes non-linearly separable. We will use the radial basis function (RBF) kernel K(x i , x j ) = e −γ x i −x j 2 , γ > 0. Classification experiments using a linear kernel are also performed to establish a baseline method for comparison purposes.
• Gaussian processes for classification. Random forests and SVM are examples of discriminative classifiers (they look for the decision boundary between the classes). A generative classifier obtains a probabilistic model of the classes that is used for future classification purposes maximizing the posterior probability. As an example of a probabilistic classification method, we use Gaussian processes for classification purposes (GPCs) [49].

Hand-Driven Learning Procedure
The 47 images of E-OPHTHA exudates database were divided in K = 5 partitions. External cross-validation, using the "leave-one-out" technique, allowed us to carry out a fair validation of the proposed method. During preprocessing, the images are resized so all of them have the same angle of view and color transformation and image inpainting procedures are carried out. After the preprocessing, the green component is extracted, the patches are obtained and the descriptors for each patch are calculated. The size of the patches is 64 × 64 pixels and the displacement between patches is (∆x,∆y) = (32, 32) pixels.
Since pathological areas represent only small regions of the whole retinal image (less than one percent of the total number of pixels that compose the retinal image in most cases), the patch extraction process and corresponding feature vector extraction will result in an imbalanced dataset. Training a classifier with an imbalanced dataset can produce overfitting to the majority class ("healthy" in our case) [50]. To avoid this problem, we proceed as follows. Let us assume that the number of healthy and pathological samples are M and N respectively where M >> N. Thus, the set of all healthy samples is randomly permuted and partitioned into T = round (M/N) subsets with the same cardinality as the number of pathological samples. A committee of T classifiers is then learned with training sets formed by joining all pathological training samples and each partition of healthy training samples. In the test stage, testing samples are evaluated for each of the T models and soft majority voting is applied to the output probabilities as final criterion. If the obtained probability is higher than a given threshold δ (typically δ = 0.5), the patch is assigned to the class "pathological". An overview of the whole process can be observed in Figure 9. In our case, T = 9 classifiers compose the decision committee to classify each testing instance.

Performance Measures
Common metrics in the field of machine learning are used to evaluate the classification performance in each experiment.
Accuracy is determined by the sum of correct predictions divided by the total number of cases. It shows how correct a diagnostic test identifies and excludes a given condition.
where True Positives (TP) and True Negatives (TN) are the correctly predicted values while False Positives (FP) and False Negatives (FN) are the mistakes. Sensitivity or Recall and Specificity measure the proportion of positive and negative cases which are correctly identified as such, respectively.
The receiver operating curve or ROC curve is a graphical plot that illustrates the diagnostic ability of a binary classifier system as its discrimination threshold is varied. The ROC curve is created by plotting the Sensitivity against the 1-Specificity at various threshold settings. The enclosing area of this curve is known as area under ROC curve (AUC) and it is an extended way to measure the predictive modelling accuracy [51]. This measure allows the establishment of fair comparisons where there is a strong imbalance between classes [52]. Based on [53], a diagnostic test in the medical field with an AUC value of 0.5 suggest no discrimination. If the AUC value ranges from 0.7 to 0.8 the test is considered acceptable, if the test presents an AUC value included in the interval 0.8-0.9 it is considered excellent, and more than 0.9 is considered outstanding.

Analysis of Descriptors
In a first set of tests, the behavior of the morphological descriptors to discriminate bright lesions is assessed. For this purpose, E-OPHTHA exudates database was used and four morphological pyramids were computed from the green component of each preprocessed image: two pyramids of openings using both an isotropic (Π γ B ) and an angular (Π γ L ) structuring element and analogously two pyramids of closings (Π ϕ B , Π ϕ L ). These morphological pyramids were calculated using an increasing SE size defined by a step (s = 2) and a maximum value (n max = 22). These parameters were optimized making use of the ground truth of the training image dataset. Please note that angular granulometry was computed in directions 0 • , 45 • , 90 • and 135 • . From the morphological pyramids, a local description of the shape and size of the retinal texture was performed by computing the pattern spectrum of squared patches (PS ) as explained previously (see Figure 7). The classification results obtained for the linear-SVM classifier with different configurations of the feature vector are reported in Table 1. For simplicity in the notation, the PS symbol has been omitted. Please note that feature vectors composed by more than one operator are generated by concatenation of their pattern spectra. As can be interpreted from the results, when the feature vector is composed by a single pattern spectrum, isotropic granulometries detect better the bright lesion than the directional ones. When a combination of two granulometric patterns is used to feed the SVM classifier, an improvement in the performance classification can be observed, especially when the granulometry and anti-granulometry curves using an isotropic SE are collated in a unique feature vector. The best description of the bright lesions taking into account only size and shape local information is given when all morphological descriptors are used (γ B γ L ϕ B ϕ L ). Accuracy and specificity values higher than 76%, a sensitivity of 66% and an AUC value around 0.8 are reported as best classification results in Table 1. These results suggest the need for extracting another kind of information able to support and strengthen the performance of the morphological descriptors.
We test the ability of feature based on local binary patterns LBPV to capture the texture information of healthy and pathological tissues. The parameters are: radius R = 1 and number of points in the LBP feature vector P = 8, i.e., the dimension of the LBP feature vector is 10 (P + 2). Several tests combining shape and texture descriptors were carried out and the obtained results can be read in Table 2. Table 2. AUC, accuracy, sensitivity and specificity related to the exudate detection for E-OPHTHA exudates database taking into account different input vectors to the SVM classifier. In particular, they are composed by texture and shape descriptors.

Performance of Different Classifiers
The third experiment aims to analyze if results differ when using different classifiers for the most discriminative feature vector (texture and morphological information).
The K-fold procedure and the random permutation for balancing the data (see the procedure represented in Figure 9) were performed using a fix seed to allow fair comparisons among the different classification methods. Table 3 shows the results related to the classification performance of each classifier evaluated on the five external folds of the E-OPHTHA_EX database. Table 3. AUC, accuracy, sensitivity and specificity related to the bright-lesion detection on E-OPHTHA exudates database for each classification method using a decision threshold δ = 0.5.

Accuracy
Sensitivity Specificity AUC As it can be observed in that table, different machine learning algorithms maximize specific evaluation metrics, making difficult an overall analysis of their behavior. AUC values provide information about the global performance of each classifier because the ROC curve is calculated by evaluating a sweep of decision thresholds ranging from zero to one (see Figure 10). However, in the medical field, sensitivity and specificity are key parameters for measuring the goodness of proposed methods. For this reason, from the ROC curve of each fold, an optimal decision threshold δ for each ML method was obtained according to the best trade-off between sensitivity and specificity. The same procedure used to optimize the meta-parameters involved in the feature extraction and classification stages was used to optimize the threshold δ. In particular, it was optimized by using the validation dataset for each partition of the external K-fold cross-validation. The obtained results can be observed in Table 4.  To evaluate the robustness of the proposed approach, our bright-lesion detection model trained on E-OPHTHA_EX database was used to predict the 47 images containing exudates of DIARETDB1 database. This test allowed us to perform a deep validation of the presented approach and to establish an exhaustive comparison with the state-of-the-art works related to the automatic exudate detection. Table 5 shows the obtained results using a decision threshold δ = 0.5 while Table 6 shows the results maximizing the trade-off between sensitivity and specificity by searching the optimal decision threshold δ for each classification method. Table 5. AUC, accuracy, sensitivity and specificity related to the bright-lesion detection on DIARETDB1 database for each classification method using a decision threshold δ = 0.5.

Sensitivity Specificity PPV
Sopharak et al. [21] 0.8482 0.9931 0.2548 Walter et al. [16] 0.6600 0.9864 0.1945 Welfer et al. [17] 0.7048 0.9884 0.2132 Ghafourian and Pourreza [18] 0.7828 --Proposed method 0.8184 ± 0.0324 0.8183 ± 0.0324 0.4373 ± 0.1374 Table 7 compares the exudate detection results obtained in this paper with other works in the same problem, where PPV (positive predicted values) measure the proportion of positive correct predictions with respect to the total number of positive predictions determined by the classification system. Results must be analyzed with care, especially when only some metrics results are included in some papers. The importance of the trade-off between sensitivity and specificity is well-known in the computer-aid diagnostic systems development. In fact, is more convenient to register a higher sensitivity than specificity because the consequences of diagnosing a pathological patient as healthy can be very damaging. As Table 7 shows, the proposed methodology registers the best trade-off between the aforementioned figures of merit. The sensitivity of Walter et al. [16],Welfer et al. [17] and Ghafourian and Pourreza [18] are outperformed by the sensitivity value reported from our system. The only work which makes face our results of exudate detection is Sopharak et al. [21]. However, it is important to highlight that the authors of Sopharak et al. [21] proposed a set of optimally adjusted morphological operators to be used exclusively for exudate detection. In contrast, our method can identify exudates, microaneurysms and hemorrhages using the same feature vector (i.e., encoding textural and morphological information).
We show a visual example of the result of the classification process in Figure 11. Two images correspond to the E-OPHTHA exudates database and two to the DIARETDB1 database (note that the patches for the DIARETDB1 images are smaller since they have higher resolution). Red patches are detected pathological patches; green ones are healthy patches misclassified as pathological, and blue the pathological patches that were not detected. The rest of the patches not shown in the figure correspond to healthy patches labeled correctly as healthy ones. In the same way, the proposed feature vector and the classification methods studied in the previous section were used to discriminate between healthy and dark-damaged areas (i.e., patches containing hemorrhages and/or microaneurysms). The material employed to train and validate these models were the 45 images of DIARETDB1 due to the lack of enough dark lesions in the E-OPHTHA database. Table 8 reports the obtained results using a decision threshold δ = 0.5 while Table 9 shows the results maximizing the trade-off between sensitivity and specificity by searching the optimal decision threshold δ for each classification method. Table 8. AUC, accuracy, sensitivity and specificity related to the dark-lesion detection (microaneurysms and hemorrhages) on DIARETDB1 database for each classification method studied in this work using a decision threshold δ = 0.5.  Table 9. AUC, accuracy, sensitivity and specificity related to the dark-lesion detection (microaneurysms and hemorrhages) on DIARETDB1 database. Results were optimized to the best sensitivity-specificity trade-off. The optimal configuration of the system for dark-lesion detection (i.e., the same feature vector and classification algorithm as for bright-lesion detection) is also compared with some state-of-the-art works, in which the detection/segmentation of these lesions is performed by using classical techniques such as filtering and mathematical morphology. Table 10 summarizes the dark-lesion detection results achieved by the proposed method and by other works of the literature. Table 10. Comparison of dark-lesion detection methods for the 45 retinal images with microaneurysms or hemorrhages of DIARETDB1 database.

Sensitivity Specificity AUC
Rocha et al. [54] 0.9000 0.6000 0.7640 Roychowdhury et al. [55] 0.7550 0.9373 0.8263 Ashraf et al. [56] 0.6763 0.6278 0.6500 Junior and Welfer [57] 0.8769 0.9244 -Proposed method 0.7561 ± 0.0301 0.7562 ± 0.0290 0.8344 ± 0.0330 The proposed method presents comparable results with respect the representative methods involved in the comparison. In Table 10, we can see as our method achieved better results (in terms of sensitivity-specificity trade-off) than Rocha et al. [54] and Ashraf et al. [56] while the works presented in Roychowdhury et al. [55] and Junior and Welfer [57] register outperforming respect our system. In the case of Junior and Welfer [57], the presented method is only able to detect dark signs of diabetic retinopathy, i.e., an ad-hoc algorithm to identify microaneurysms and hemorrhages is developed. On contrary, in this work, a generic feature vector and classification algorithm have been proposed for describing both kind of retinal lesions: bright and dark. The work proposed in Roychowdhury et al. [55] needs a previous candidate map generation before the classification step. This kind of approach presents a high false-positive rate at pixel level and it is the main motivation of our patch-based analysis.

Conclusions
We have presented a classification procedure to identify pathological patches containing exudates, microaneurysms and hemorrhages in retinal fundus images. The discriminative texture between the healthy and pathological areas of the image is encoded in the proposed feature vector. We have seen that the combination of morphological (granulometry) and texture descriptors improve the results with respect to using only one of them. To assure the results, we used cross-validation and tested different families of classifiers.
We have seen that the classifier obtained with a particular database can be extended to be used with other databases. This fact provides to our detection system a high level of robustness and simplicity. In addition, the local analysis in which the image description and classification stages are based not only makes unnecessary the stage of segmentation or candidate generation, but it also provides an accurate location of the damaged retinal area as we have seen in Figure 11.
The proposed methodology will be the basis of high-level computer aided diagnostic algorithms under development. In particular, the output of the resulting models presented here with along additional information will be employed in the identification of the different DR stages (i.e., early, mild, moderate and severe) as well the classification between non-proliferative and proliferative DR.