Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Automatic grading of diabetic retinopathy through machine learning
1. Visvesvaraya Technological University, Belagavi – 590018
SDM COLLEGE OF ENGINEERING & TECHNOLOGY,
DHARWAD-02
Department of Electronics and Communication Engineering
MASTER OF TECHNOLOGY
in
DIGITAL ELECTRONICS
Project phase-II
Automatic Grading of Diabetic Retinopathy through Machine
Learning
Submitted By:
Supriya Sangappa Kamatgi
IV semester MTech
2SD18LDE09
Under the guidance of:
Prof. Dr.K. N. Hosur
Department of ECE
SDM CET,Dharwad
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
1
2. Content
• Introduction
• Literature survey
• Methodology
• Operational Definition
• Platform used for the project
• Results and analysis
• Conclusion and future scope
• References
27-01-2021
2 of 44
Automatic Grading of Diabetic Retinopathy through Machine Learning
3. INTRODUCTION
• The complication of diabetics causes an illness known as Diabetic
Retinopathy (DR).
• Diabetic Retinopathy is one of the common complications of diabetes.
• Diabetes is a group of metabolic diseases in which a person has high
blood sugar, either because the body does not produce enough insulin,
or because the cells do not respond to the insulin that is produced.
• It damages the small blood vessels in the retina resulting in loss of
vision. The risk of the disease increases with age and therefore, middle
aged and older diabetics are prone to Diabetic Retinopathy.
27-01-2021 Automatic Grading of Diabetic Retinopathy through Machine Learning 3
5. Role of Machine Learning In DR
• Lack of Doctors.
• So we train an algorithm that can read the images right then and there.
• The algorithms can help the doctors get more people screened for the
disease.
• So, the fundamental idea of machine learning is to take some part of a
software system that we used to program explicitly with a set of rules
and instead, have the machine learn to do that task.
• Machine learning is good, both at automating processes, and also at
making processes more efficient.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
5
7. Title 1 : “Texture-less macula swelling detection with multiple retinal
fundus images”
Author: L. Giancardo, F. Meriaudeau, T. Karnowski, K. Tobin, E.
Grisan, P. Favaro, A. Ruggeri, and E. Chaum,
Publication: IEEE Trans. On Biomed. Eng., Vol. 58, No. 3, pp. 795–799,
Mar. 2011.
Objective: Texture-less macula swelling detection with multiple retinal
fundus images, in this paper a novel algorithm is proposed which is able
to identify macular swelling through the reconstruction of a naive height
map of the macula area from multiple fundus images with an unknown
translation (roughly parallel to the eye), captured by an un-calibrated
fundus camera.
Conclusion: experiments shows how retina “blisters” can be identified,
even in areas where there is no apparent texture visible using four
fundus images.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
7
9. • Title 3: “Fast and Robust optic disk detection using Pyramidal
decomposition and Hausdorff based template matching”,
• Authors : Lalondc M., Beaulicu M., Gagnon L.
• Publication: IEEE Transaction on Medical imaging, 20, No.11, pp
11931200, 2001.
• Objective : focus of the paper is on optic disc detection, other applications
that require the localization of a rigid shape may be solved efficiently by the
proposed combination of techniques, namely a rough positioning of the
object and a more refined Hausdorff based search in a “probabilistically”
thresholded edge map, with hypothesis management within the framework
provided by the evidence theory.
• Conclusion: The two approaches are tested against a database of 40 images
of various visual quality and retinal pigmentation, as well as of normal and
small pupils. An average error of 7% on OD centre positioning is reached
with no false detection. In addition, a confidence level is associated to the
final detection that indicates the “level of difficulty” the detector has to
identify the OD position and shape.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
9
11. Proposed Method
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
11
Fig 2: Block diagram of the methodology
The initial most important task is to collect the appropriate data and
selection of the software for the processing. After the required initial
task the next task is to eliminate the optic disk from the fundus image
and then the blood vessels are removed in order to detect the exudates.
12. Fig.3. Front end architecture of Proposed method
Image input
Preprocessing
• Gray image
• Invariance imaging (intensity adjustment)
• Restoration (adaptive median filter)
• Enhancement (histogram equalization)
Feature extraction
• Edge detection
• Optic disk detection and elimination
• Blood vessel removal
Dilation operation
Erosion operation
Classification Algorithm
• Support Vector Machine
• Naïve Bayes
• Bagged Decision Tree
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
12
Retinal Image
Pre processing
Feature Extraction
Classification Algorithm
Diabetic retinopathy
yes no
Enhancement
Restoration
Invariance Imaging
Gray Image
13. Fig.3: Algorithm of the developed code
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
13
Green Channel
Extraction
Input color
Fundus Image
Conversion to
HSV plane
Blood Vessel Extraction
using Canny edge
detection Operator
Optic Disk mask
using Hough
Transform
Application of
imtophat() to
reduce uneven
illumination
Extraction
of hue
channel
Masked
imtophat()image
Masked hue
channel image
Manual segmentation
with threshold of 15
Manual segmentation
with threshold of 0.07
Hard Exudates are seen
Classification using classifiers
15. Support Vector Machines
• SVM is a robust technique for data classification and regression. In pattern
recognition we are given training data in the form,
(x1, y1),…..,(xe, ye) ϵ Rn × {+1, -1
Fig.4 A separating hyperplane (w, b) for a two dimensional (2D) training set
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
15
16. SVM performs classification by finding the hyperplane that maximizes
the margin between the two classes. The best possible way to split the
data is achieved by the widest margin that separate the two groups.
• Hyperplanes are decision
boundaries that helps classify the
data points.
• Data points on the either side of
hyperplanes can be attributed to
different classes.
• In simple term, it is ability of
machine learning model to
correctly classify between
different groups of data.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
16
Fig.5. A maximal margin hyperplane with its
support vectors encircled
17. SVM Continued…
• The dual representation of the decision function is
f(x) = sign 𝒊=𝟏
𝒍
𝒚𝒊𝜶𝒊 𝒙 . 𝒙𝒊 + 𝒃
• 𝜶𝒊 belongs to R is a real-valued variable that can be viewed as a
measure of how much informational value xi has. Thus for vectors that
do not lie on the margin (i.e. non support vectors) this value will be
zero.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
17
18. Gray Level Co-occurrence Matrix (GLCM)
• As the name suggests co-occurrence so, this means that the two objects need to occur
simultaneously together and we are going to measure how simultaneous is present
between their occurrences. It contains information about the positions of pixels having
similar gray level values and used for measuring texture in image. It can make use of
distance vector.
Fig.10. (a) Intensity values of image (b) GLCM operator matrix
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
18
19. GLCM conti….
• Features required for the SVM classifier were extracted using GLCM.
• Based on the analyzed matrix and the texture information, the features
like entropy, contrast, energy and homogeneity will be calculated.
Contrast = 𝑖 𝑗 𝑖 − 𝑗 2
𝑐𝑖𝑗
Entropy = − 𝑖 𝑗 𝑐𝑖𝑗 log 𝑐𝑖𝑗
Homogeneity = 𝑖 𝑗
𝑐𝑖𝑗
1+ 𝑖−𝑗
Energy = 𝑖 𝑗 𝑐𝑖𝑗
2
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
19
20. Naïve Bayes classifier
• The Naïve Bayes classifier belonging to the group of probabilistic
classifiers based on applying Bayes theorem with strong independence
assumptions between the features. It is the simple technique for constructing
classifiers.
• The data set is divided into two parts namely, feature matrix and the
response vector.
Feature matrix contains all the vectors of dataset in which each vector
consists of the value of dependent features.
Response vector contains the value of class variable for each row of feature
matrix.
• Naive Bayes model is easy to build and particularly useful for very large
data sets. Along with simplicity, Naive Bayes is known to outperform even
highly sophisticated classification methods.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
20
21. Naïve Bayes conti…
• Bayes theorem provides a way of calculating posterior probability P(c|x)
from P(c), P(x) and P(x|c). Look at the equation below:
P(c/x) =
𝑃
𝑥
𝑐
𝑃(𝑐)
𝑃(𝑥)
• Above,
• P(c/x) is the posterior probability of class (c, target)
given predictor (x, attributes).
• P(c) is the prior probability of class.
• P(x/c) is the likelihood which is the probability of predictor given class.
• P(x) is the prior probability of predictor.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
21
22. Bagged Decision Tree
• Bagging is a simple and powerful ensemble method. An ensemble
method is a technique that combines the predictions from multiple
machine learning algorithms together to make more accurate
predictions than any individual model. Decision trees are sensitive to
the specific data on which they are trained. If the training data is
changed the resulting decision tree can be quite different and in turn
predictions can be quite different.
• Let’s assume we have a sample dataset of 1000 instances (x) and we
are using the CART algorithm. A Classification And Regression Tree
(CART), is a predictive model, which explains how an outcome
variable's values can be predicted based on other values.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
22
23. Bagged Decision Tree conti…
Fig.11. Bagged Decision Tree
A CART output is a decision tree where each fork is a
split in a predictor variable and each end node contains
a prediction for the outcome variable. Bagging of the
CART algorithm would work as follows.
Create many (e.g.100) random sub-samples of our
dataset with replacement.
Train a CART model on each sample.
Give a new data set, calculate the average prediction
from each model.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
23
24. Platform used for the project
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
24
25. • The Proposed method was implemented in Matlab and Microsoft
Visual Basic 6.0. The results of the classification Procedure shows the
result of Sensitivity, Specificity and Percentage of accuracy.
• The ROC graphs are a useful technique for organizing classifiers and
visualizing their performance.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
25
27. (a) Preprocessing
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
27
(a)
(b)
Fig.12.(a) Preprocessing Output of Diabetic Retinopathy Eye and (b) Preprocessing of the Normal Eye
31. Classifier Outputs
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
31
0 5 10 15 20 25 30
Function evaluations
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
Min
objective
Min objective vs. Number of function evaluations
Min observed objective
Estimated min objective
Percentage of Confusion matrix off diagonal
Ratio Estimated
Feature
0
0.5
1
1.5
2
2.5
out-of-bag
feature
importance
0 0.5 1 1.5 2 2.5 3 3.5
Normal
-5
-4
-3
-2
-1
0
1
Diabetic
Eye
10
6 Diabetic Retinopathy -- ECOC Support Vectors
Ratio
Estimated
SupportVectors
Fig. 19. Bayes Predicted Model
Fig. 20. Percentage of confusion
matrix off the diagonal
Fig. 21. Diabetic Retinopathy
ECOC Support vectors
32. Confusion Matrix
• The confusion matrix for the true
class and predicted class is as
shown in figure. The confusion
matrix displays the total number
of observations in each call. The
rows of the confusion matrix
corresponds to the predicted
class. Diagonal and off diagonal
cells corresponds to correctly
and incorrectly classified
observations, respectively.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
32
Fig. 22. Confusion Matrix
34. Conclusion
• Diabetic retinopathy is curable, if detected earlier. Exudates are easily
detectable in the earliest of stages, i.e. in proliferative diabetic retinopathy.
Major steps in detection of exudates are:-
Optic Disk elimination,
Blood Vessel, and
Detection of exudates.
• Optic disk is detected using Hough transform, hypot() is used to create a
circle of radius 30 units around the centre co-ordinates obtained using
Hough transform.
• Blood Vessels are extracted using Canny edge detector, dilation helps to fill
up the edges, erosion helps to fill the circles and then manual segmentation
is applied to obtain the blood vessels.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
34
35. Conclusion Conti…
• Hue channel of HSV plane is extracted, imtophat() is applied to green
channel, optic disk and blood vessels are masked, and manual
segmentation is applied to both the images to obtain the resultant
image with hard exudates.
• The classifiers like Bayes classifier, Bagged Decision Tree classifier
and the Support Vector Machine are implemented and the factors like
error and accuracy with confusion matrix are generated. The results
shows that the Support Vector machine is a best classifier compared
with Naïve Bayes classifier and the Bagged Decision Tree with a
accuracy of 98%.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
35
36. Future Scope
• The work can be extended to detect the soft exudates and micro-
aneurysms, and to differentiate among the hard and soft exudates.
• In order to achieve portability and accessibility for user by creating a
app based on the user input data.
• Also to carry-out the development of classifier to classify the eye as
mild, moderate and severe diabetic retinopathy.
• And to implement it on the FPGA kits is to prove the role of System
Generator in designing a hardware system for the recognition of
Retinal exudates and thus identify the abnormalities present in retina.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
36
38. [1] J.Ramya ,S.Soundarya, A.Nagoormeeral, Rahmathnisha, E.Revathi,
"Detection Of Exudates In Color Fundus Image", International Journal
of Innovative Research in Science, Engineering and Technology (An
ISO 3297: 2007 Certified Organization) Vol. 3, Issue 3, March 2014
[2] Ramasubramanian and G. Prabhakar, January 2013 “An Early
Screening System for the Detection of Diabetic Retinopathy using
Image Processing”, International Journal of Computer Applications
(0975 – 8887) Volume 61– No.15
[3] Mohammed Shafeeq Ahmed, Indira, “Detection of Exudates from
RGB Fundus Images Using 3σ Control Method”,IEEE WiSPNET
2017 conference.
[4] Harini R and Sheela N, “Feature Extraction and Classification of
Retinal Images for Automated Detection of Diabetic Retinopathy”,
2016 Second International Conference on Cognitive Computing and
Information Processing (CCIP).
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
38
40. [9] Istvan Lazar and Andras Hajdu, “Retinal Microaneurysm
Detection Through Local Rotating Cross-Section Profile
Analysis,” IEEE Transactions On Medical Imaging, Vol. 32, No.
2, Feb. 2013
[10] K. Sai Deepak, J. Sivaswamy, “Automatic Assessment of
Macular Edema from Colour Retinal Images,” Medical Imaging,
IEEE Transactions, Vol. 31, No. 3, pp. 766-776, March 2012.
[11] L. Giancardo, F. Meriaudeau, T. Karnowski, K. Tobin, E. Grisan,
P. Favaro, A. Ruggeri, and E. Chaum, “Texture-less macula
swelling detection with multiple retinal fundus images,” IEEE
Trans. Biomed. Eng., Vol. 58, No. 3, pp. 795–799, Mar. 2011.
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
40
41. [12] R. Priya and P. Aruna “Diagnosis Of Diabetic Retinopathy Using
Machine Learning Techniques” Ictact Journal On Soft Computing,
July 2013, VOLUME: 03, ISSUE: 04, ISSN: 2229-6956.
[13] Alireza Osare et al., “A Computational – Intelligence-Based Approach
for Detection of Exudates in Diabetic Retinopathy Images,” IEEE
Transactions on Information Technology in Biomedicine, Vol. 13, No.
4, pp 535-545, July 2009.
[14] Lalondc M., Beaulicu M., Gagnon L., “Fast and Robust optic disk
detection using Pyramidal decomposition and Hausdorff based
template matching”, IEEE Transaction on Medical imaging, 20,
No.11, pp 11931200, 2001.
[15] https://en.wikipedia.org/wiki/Diabetic_retinopathy
[16] https://www.narayananethralaya.org/diabeticretinopathy
27-01-2021
Automatic Grading of Diabetic Retinopathy through Machine
Learning
41