Fully Automated Robust System to Detect Retinal Edema, Central Serous Chorioretinopathy, and Age Related Macular Degeneration from Optical Coherence Tomography Images

Maculopathy is the excessive damage to macula that leads to blindness. It mostly occurs due to retinal edema (RE), central serous chorioretinopathy (CSCR), or age related macular degeneration (ARMD). Optical coherence tomography (OCT) imaging is the latest eye testing technique that can detect these syndromes in early stages. Many researchers have used OCT images to detect retinal abnormalities. However, to the best of our knowledge, no research that presents a fully automated system to detect all of these macular syndromes is reported. This paper presents the world's first ever decision support system to automatically detect RE, CSCR, and ARMD retinal pathologies and healthy retina from OCT images. The automated disease diagnosis in our proposed system is based on multilayered support vector machines (SVM) classifier trained on 40 labeled OCT scans (10 healthy, 10 RE, 10 CSCR, and 10 ARMD). After training, SVM forms an accurate decision about the type of retinal pathology using 9 extracted features. We have tested our proposed system on 2819 OCT scans (1437 healthy, 640 RE, and 742 CSCR) of 502 patients from two different datasets and our proposed system correctly diagnosed 2817/2819 subjects with the accuracy, sensitivity, and specificity ratings of 99.92%, 100%, and 99.86%, respectively.


Introduction
The retina is the innermost layer of an eye that is composed of macular and ocular regions. The macular region is the one where inverted vision is formed. Retinal abnormalities within the macular region (maculopathy) tend to damage the macula resulting in distorted vision. These macular diseases are the collective group of abnormalities which affect the central vision of a person if they are left untreated. In extreme cases, these diseases can lead to severe visual impairments or even blindness. The major cause of these retinal abnormalities is diabetes due to which blood vessels within choroidal pathology become thinned and start leaking fluid within the intraretinal region [1]. Due to poor health infrastructure in third-world countries like Pakistan, the rate of blindness is growing yearly [2]. Also, macular disorders are the second most leading cause of blindness worldwide following cataract [3]. The most common types of these macular diseases are retinal or macular edema (ME), CSCR, and ARMD. These diseases can be easily cured if they are detected in early stages; however, due to the ignorance and unawareness in Pakistan especially in rural areas, more than 2 million people are suffering from blindness. In order to compensate this loss, a fully automated diagnostic system is required which can efficiently detect and diagnose retinal abnormalities. The diagnostic system can also act as an aid to ophthalmologists to mass-screen retinal diseases across different areas of Pakistan. ME or RE mostly occurs due to leakage of fluid within retinal layers and leads to the formation of cyst spaces. CSCR or central serous retinopathy (CSR) occurs due to storage of serous fluid beneath neurosensory retina after intercepting retinal pigment epithelium (RPE) layer. CSCR is characterized into two stages. In type 1 CSCR, neurosensory retina remains intact while serous fluid gets accumulated in between RPE and neurosensory retina [4]. In type 2 CSCR, serous fluid breaches the RPE layer and gets accumulated within retinal pathology. ARMD highly correlates with aging and is primarily caused due to the formation of cellular debris, also known as drusen, within retinal and choroidal pathology. ARMD is mainly characterized into two types. The first form of ARMD, also known as dry ARMD, is related to the formation of drusen within the retinal and choroidal boundary that leads to the atrophy and degeneration of RPE. The second form of ARMD, also known as wet ARMD, is more severe and it is caused due to the formation of irregular blood vessels within choroid which intercepts retinal boundary causing severe visual impairments. This condition is also known as choroidal neovascularization (CNV). The symptoms of these diseases usually do not appear in early stages on fundus images. However, OCT imaging can easily detect the presence of these retinal abnormalities in early stages. These diseases can cause blurred and distorted central vision [5,6] as shown in Figure 1.
OCT imaging is the primary eye testing technique that is being used nowadays to detect early symptoms of retinal pathology. The major benefit of OCT over other eye testing techniques is that it can give an objective and accurate visualization of early retinal syndromes [7]. OCT imaging works on the principle of Michelson interferometer where a beam splitter decomposes low coherence light source into two parts. One part is reflected by the reference mirror and the other part goes to the candidate eye. Both parts are then merged together and form an axial scan (A-scan) [8]. The combination of multiple A-scans along the horizontal axis produces a brightness scan (B-scan). Figure 2 shows an OCT B-scan which depicts each of the retinal syndromes along with its distinctive features.
Different scholars have clinically diagnosed RE, CSCR, and ARMD using OCT scans. Helmy and Atta Allah [9] proposed OCT based classification of cystoid macular edema (CME). Their dataset included 104 eyes of 86 test subjects and they concluded that quantitatively OCT provides better characterization of CME. Mitarai et al. [10] found alterations at leakage points in OCT scan of CSCR patients. The dataset included 23 male and 3 female subjects. It was hence concluded that, in case of CSCR, OCT detects the retinal morphological variations effortlessly. Ahlers et al. [11] discussed the variations in the retinal layers within OCT scans of CSCR affected patient. Their dataset consisted of 18 CSCR patients and it was concluded that the OCT is the noninvasive technique that can provide an objective evaluation of retinal pathology. Zhang et al. [12] presented the usage of OCT in the early detection of diabetic macular edema (DME). Teke et al. [13] presented a comparison of fluorescein angiography (FA) and OCT for the evaluation of abnormalities in 100 CSCR patients and they proved that both techniques can assist clinicians in CSCR diagnosis. Shrestha et al. [14] highlighted the importance of OCT imaging in aligning macula after ME surgery. 60 patients were involved as test subjects in their study. Ferrara et al. [15] characterized the distinguishing features of choroid and RPE that appears in OCT scans of CSCR patients. Their dataset consisted of 15 eyes of 13 patients. Mokwa et al. [16] diagnosed ARMD and CNV using FA, fundus photography (FP), and OCT imaging technique. According to their results, it was determined that fundus photography best specifies the drusen and RPE variations in case of ARMD. However, in case of CNV, OCT tends to detect minute changes better than other techniques. Wani et al. [17] presented a detailed analysis for the diagnosis of CSCR on 48 eyes and they proved that OCT is an effective technique that can replace FA for the diagnosis of CSCR. Hannouche  [19] presented an autonomous system to diagnose ARMD and DME pathology by extracted RPE and cyst profile. To extract RPE, they removed retinal nerve fiber layer (RNFL) from the candidate B-scan where their proposed system achieved an overall accuracy of 100% for ARMD cases and 86.6% for DME cases. Srinivasan et al. [20] presented a fully automated system for the diagnosis of ARMD, DME, and healthy subjects from OCT B-scans. They utilized histogram oriented gradients (HOG) feature descriptor to extract meaningful features and then they used SVM for the automated diagnosis of retinal pathology. The accuracy of their proposed system was 100% for both ARMD and DME subjects and 86.67% for healthy subjects. Zhang et al. [23] utilized adaptive boosting (AdaBoost) based classification system for the automated diagnosis of cystoid macular edema (CME) through segmentation of intraretinal layers. The accuracy of their proposed system was 98.6%. Wilkins et al. [22] used manual annotations of RPE and ILM to identify the fluid within retinal layers. They evaluated their proposed system on 16 test subjects with overall 91% sensitivity and 96% specificity. To the best of our knowledge, there is no technical paper available that gives automated detection of ME, CSCR, and ARMD from OCT scans.
Previously, we have proposed a fully automated robust system in [24] to diagnose ME, CSR, and normal cases from 2D OCT scans and here we propose an extension of our system to incorporate automated detection and diagnoses of macular disorders. As there are different macular diseases, that is, RE, CSCR, and ARMD, which show a little bit similar variations in OCT scans near the fovea, while designing an automated system for detection of any macular disease, it is important to differentiate between these macular disorders. This is the main contribution we have made in this article that presents a fully automated decision support system to detect RE, CSCR, and ARMD from OCT B-scans. The automated classification in our proposed system is based on extracting 9 distinct features from the coherent tensor of candidate OCT scan, and then these features are fed to multilayered SVM classifiers to automatically diagnose CSCR, ME, or ARMD retinal subjects.
The rest of the paper is arranged in a way that Section 2 demonstrates the proposed methodology and Section 3 depicts the results while Section 4 outlines the conclusion of the paper.

The Proposed Methodology
An autonomous decision support system is proposed here for the automated self-diagnosis of RE, CSCR, and ARMD pathology from OCT images. At first, the input OCT scan ( , ) is loaded into our proposed system which is denoised using adaptive Wiener filter. The objective of denoising the candidate scan is to increase the sparsity within intraretinal pathology. After denoising the candidate scan, we extracted intraretinal layers to discriminate between normal and abnormal retinal pathology. These retinal and choroidal layers are segmented by computing a highly coherent tensor representation of macular pathology [25]. Extracted inner limiting membrane (ILM) and choroidal layer are used to compute cyst pathology within the candidate scan. Drusen within the retinal and choroidal boundary are detected by extracting RPE and measuring atrophy and retinal degeneration. After that, a 9D feature vector is obtained based on retinal thickness and cyst profile, RPE atrophic profile, and drusen. The feature vector is then passed to the trained multilayered SVM classifier to diagnose the retinal syndrome. Figure 3 shows the block diagram of our proposed system.  (used in [20,26]) has been annotated by multiple expert ophthalmologists and it is publicly available online at the following links: Preprocessing. An input OCT scan ( , ) is initially loaded into our proposed system and if it is a color image then only the highest intensity contributing channel Gray ( , ) is kept for further processing. Afterwards, Gray ( , ) is normalized to the common spatial resolution of 480 × 1280. Then, it is denoised using 2D adaptive low pass Wiener filter. The reason for denoising the candidate image is to increase the sparsity of intraretinal pathology within Gray ( , ). Wiener filter adaptively suppresses noisy outliers by measuring an average intensity of the surrounding pixels within the filtering kernel as expressed in

OCT
where ( , ) represents the sparsely strained pixel, represents the row of a smoothing window, represents the column of the smoothing window, ℶ represents the localized mean within the kernel, ℵ 2 represents the localized variance within the kernel, and 2 is the mean of all ℵ 2 kernels [27].

Retinal Layers Segmentation.
In order to segment retinal pathology from the candidate scan, a second-order structure tensor grid is computed in our proposed system that takes a candidate denoised scan ( , ) and generates its partial derivatives at the orientation of 0 and /2 radians. Since the gradients are computed along two predominant orientations, these gradients are fused together to generate four possible tensors as expressed mathematically in where I( , ) represents a second-order structure tensor matrix containing all possible tensors among two predominant orientations and Γ ( , ), Γ ( , ), Γ ( , ), and Γ ( , ) represent the convolution sum of gradient products at the respective orientation [28]. The gradient products (Δ , Δ , Δ , and Δ ) are mathematically expressed in In order to smoothen each tensor within the tensor grid, a localized Gaussian window ( , ) is computed which is convolved with the gradient products. Out of these tensors, a highly coherent tensor is obtained which has the maximum coherency (H). H is computed using where ℷ 1 and ℷ 2 represent the eigenvalues of partial derivatives computed along 0 and /2 radians. The computed tensors are shown in Figure 4. After extracting the highly coherent tensor ( , ), the binary map ( , ) of ( , ) is computed using Otsu algorithm [29]. Afterwards, retinal layers are extracted from the digitalized map ( , ) by computing retinal edges using canny edge detection [30], as shown in Figure 5.
Retinal layers segmented out from the candidate scan are shown in Figure 6. It can be observed from Figure 6 that, in the case of healthy subjects, all retinal layers are closely intact without any deformity. Table 2 shows the axial scans (Ascans) mean separation between retinal layers of all 4 types of retinal disorders. It can be observed from the tabulated data that in case of healthy subjects the mean value for all retinal layers is less as compared to CSCR and RE cases. For ARMD cases, all retinal layers are quite close to each other except for RPE which is because of the deformity in RPE layer due to ARMD pathology.

Features Extraction.
After extracting retinal layer pathology from candidate scan, a 9D feature vector is extracted for automated disease self-diagnosis. A feature vector is a collection of 9 distinct features obtained from candidate OCT B-scan. The first 5 features are gathered by extracting retinal thickness and cyst profile from the candidate scan. The remaining 4 features are computed by extracting and analyzing RPE atrophic profile.

Thickness Profile Extraction.
After extracting intraretinal pathology, ILM and choroidal layers are used to generate a B-scan retinal thickness profile ( ) as illustrated by (5) and (6). Hence, where where " " represents the number of A-scans present within a B-scan also shown in Figure 7. Figure 8 depicts the retinal thickness profile of the candidate scan suffering from RE.

Cyst Fluid Detection.
After segmenting retinal layers, the proposed system detects cyst segments within retinal pathology. A retinal mask ( , ) is created in between ILM and choroid layer and it is logically fused with ( , ) to   extract the cyst pathology. Figure 9 shows the exact cyst segments that are obtained using Cyst ( , ) = ( , ) ⊕ ( , ) .

Drusen Detection.
In conjunction with extracting cyst pathology, our proposed system also analyzes atrophy and degeneration within the extracted RPE layer for possible detection of drusen within the retinal and choroidal boundary. If there is a deformity within the RPE layer, then this is due to the presence of drusen and neovascularization which leads to ARMD. Therefore, in our proposed system, we have extracted 4 distinct features based on RPE pathology which automatically detect the presence of ARMD syndrome as shown in Figure 10. Apart from this, both RE and CSCR pathology have fluid accumulation within the retinal layer, so in order to discriminate between both diseases, our proposed system computes cyst energy obtained after decomposing the cyst profile into a low resolution band through multilevel wavelet decomposition technique. The value of this cyst energy is much less in case of CSCR subjects as compared to RE subjects as shown in Table 3.

Feature Set Fusion.
After computing the individual characteristic profile for each disease, our proposed system extracts 9 distinct features from these profiles and fuses a 9D feature vector which is passed to the multilayered SVM classifier. The first 4 features are extracted from retinal Bscan thickness and cyst profile to distinguish between healthy and diseased scans. The 5th feature is used to discriminate between RE and CSCR syndromes and the last 4 features are extracted after analyzing RPE profile to distinguish ARMD cases. The detailed description of each feature is as follows.  Max Thickness ( 1 ). It is actually the maxima in the retinal thickness vector ( ), which is due to maximum difference between the ILM and choroid as expressed by

(8)
Min Thickness ( 2 ). It is actually the minima in the retinal thickness vector ( ) which is due to minimum difference between ILM and choroid layer as expressed by  Thickness Variation ( 3 ). It depicts the retinal thickness variation within macular pathology and it is computed using Maximum Cyst Area ( 4 ). It depicts the maximum area occupied by the cyst or serous fluid within intraretinal pathology and it is computed by taking area of Cyst( , ) as expressed by Cyst Energy ( 5 ). It is the total energy of a cyst segment calculated by RPE Maxima ( 6 ). It is the peak value in RPE profile as expressed by RPE Minima ( 7 ). It is the shallowest value in RPE profile as expressed by RPE Variation ( 8 ). It is the absolute difference between 7 and 6 as expressed by RPE Energy ( 9 ). It depicts the RPE energy as expressed by  Table 3, we can see that the first 5 features are quite distinctive for healthy, RE, and CSCR cases while the last 4 features are quite distinctive for ARMD cases. For ARMD cases, the first 3 features are quite close to healthy cases; however, discrimination between healthy and ARMD cases can be best seen in 4 , 6 , 7 , 8 , and 9 .

Classification
2.5.1. Classifier Training. The classification system in our proposed system uses multilayered SVM classifier to distinguish between retinal abnormalities. After processing the input candidate OCT scan, 9 distinct features are extracted which are fused together to form a 9D feature vector = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 }. The feature vector is then passed to the multilayered supervised SVM classifier for automated disease diagnosis. The classification system in our proposed system is trained on our custom prepared training dataset that includes 40 labeled images (10 healthy, 10 RE, 10 CSCR, and 10 ARMD). The dataset has been annotated by multiple expert ophthalmologists. The first 5 features in the feature set are extracted from retinal thickness and cyst profile. The remaining 4 features are acquired by analyzing atrophy within the RPE profile. SVM is being incorporated in our proposed classification system because it is one of the fastest and accurate classifiers [31]. In our proposed system, SVM has a nonlinear decision boundary because of Gaussian radial basis function (RBF) and multilayer perceptron (MLP) kernel. Figure 11 demonstrates the training phase of our proposed classification system.
The performance of our classification system is measured through -fold cross-validation. We cross-validated our classification system for different values of and computed the accuracy. The best accuracy was achieved for = 10 as shown in Table 4.

Classification of Retinal Pathologies.
After training the proposed classification system, it was used to classify unlabeled input OCT scan for possible diagnosis of retinal abnormalities. The classification system in our proposed system is based on multilayered SVM classifier in which the test sample is first classified as healthy or abnormal through 1 , 2 , 3 , and 4 features. If it is classified as abnormal, then it is further classified as RE, CSCR, or ARMD positive candidate based upon the remaining features within the feature vector. SVM in our proposed system has been implemented in 3 layers to classify all 4 types of macular syndromes. The flowchart of our proposed decision support system is shown in Figure 12.

Results
Our proposed system was tested on our local dataset which we acquired from AFIO. The dataset contained 90 OCT scans of 73 patients in which 30 images are of RE patients, 30 images are of CSCR patients, and 30 images are of healthy subjects. Apart from this, we have tested and validated our proposed system on the publicly available Duke dataset containing 2729 OCT images of 429 patients in which 712 OCT images are of ARMD patients, 610 OCT images are of RE patients, and 1407 OCT images are of healthy subjects. Our proposed system correctly identified all the retinal pathologies on Duke dataset, while on our local dataset our proposed system correctly identified 88/90 cases. The results from our automated decision support system have been cross-verified by expert ophthalmologists as well. The detailed statistical analysis of our proposed system is shown in Table 5. Figure 13 shows 7 randomly selected B-scans for each pathology from AFIO dataset that has been correctly classified. In each scan, ILM is shown in red color, choroid is shown in green color, and cyst or serous pathology is shown in yellow color. Apart from this, Figure 14 shows 6 randomly selected B-scans from Duke dataset that have been correctly classified. The color scheme remains the same as in Figure 13 except for yellow color which is used to show the extracted RPE layer in Figure 14.
In addition to this, we have also compared our multilayered classification system with other state-of-the-art solutions where our proposed system has outperformed other competitors as shown in Table 6. Also, we proposed the world's first ever automated decision support system that can automatically detect 4 different types of retinal pathologies from OCT images.

Discussion
A fully automated decision support system is proposed here which can automatically detect and self-diagnose retinal abnormalities from OCT images by extracting 9 distinct features. After that, all the extracted features are fused together to form a feature vector which is then passed to the multilayered support vector machine classification system to automatically diagnose the retinal pathology. The proposed system is quite robust in detecting small disease patterns that appear on OCT images. Apart from this, our proposed system is also rotationally invariant and can easily detect the above mentioned retinal diseases from skewed OCT B-scans. Our   proposed system extracts 7 to 8 intraretinal layers from all 4 types of retinal pathologies and uses ILM, RPE, and choroidal layers for the formation of cyst or serous pathology and ARMD atrophic profile. The proposed multilayered classification system is based on 9D feature vector, extracted from candidate OCT B-scan.
At the first layer of our classification system, an automated decision between normal and abnormal retinal pathology is made by analyzing 1 , 2 , 3 , and 4 as these features contain the objective evaluation of retinal thickness profile. If the candidate is classified as abnormal, then it is further classified as RE, CSCR, and ARMD. The discrimination between RE cysts and CSCR is provided by 5 features as RE cysts contain more energy as compared to CSCR. Also, the presence of drusen within the retinal and choroidal boundary is detected by atrophic analysis of RPE profile through 6 , 7 , 8 , and 9 features. All of these features for 5 randomly selected subjects from each case are shown in Table 3. Apart from this, we have applied our proposed system on our local dataset acquired from AFIO and also publicly available Duke dataset. AFIO dataset contains samples of RE, CSCR, and healthy subjects while Duke dataset contains samples of RE, ARMD, and healthy subjects. Our proposed system correctly classifies a total of 2817/2819 retinal pathologies from both datasets. Detailed analysis of results is shown in Table 5. The misclassification of two healthy samples as diseased from AFIO dataset is because we have tuned our system in such a way to give more weightage to the correct classification of diseased samples as it is more critical to classify diseased samples accurately as compared to healthy subjects. Our proposed system is also computationally quite fast and it takes around a minute on average to give a complete disease diagnosis on a machine with 5th-generation core i5 CPU (2.2 GHz) and 4 GB DDR3 RAM. Our proposed system is quite robust and sensitive to retinal abnormalities as it can also detect small and early retinal abnormalities from OCT B-scan. Two of such cases are shown in Figure 15.
Our automated self-diagnosis decision support system can act as an aid to ophthalmologists to mass-screen the severe cases of retinal abnormalities. Also, our proposed system can give an objective disease diagnosis with complete statistical analysis of retinal pathology which ophthalmologists can use to back up their diagnosis. Based on the statistical results obtained from our proposed system, ophthalmologists can improve their standardized grading system for the severity analysis of different retinal pathologies.

Conclusion
This paper proposes fully automated self-diagnosis system to identify healthy, RE, CSCR, and ARMD cases from OCT images. The automated classification of candidate retinal pathology is based on multilayered SVM classifier that is trained to distinguish between all 4 types of macular Apart from this, our proposed system was quite robust in detecting small abnormalities within macular pathology from noisy and skewed OCT B-scans. In the future, this work can be extended to automatically diagnose the severity of these macular syndromes; also, our proposed system can be extended to incorporate other retinal abnormalities like tractional retinal detachment (TRD), macular hole (MH), and glaucoma.

Conflicts of Interest
All the authors have no relevant financial interests in this article.