Report
Report
             BACHELOR OF ENGINEERING
                        IN
         COMPUTER SCIENCE AND ENGINEERING
                                  BY
                  CHAITHANYA S           [4VV20CS021]
                  CHINMAYI H             [4VV20CS024]
                  ELAINE M PAILY         [4VV20CS037]
                  HAMSINI D              [4VV20CS046]
CERTIFICATE
This is to certify that the final year project report entitled “GLAUCOGUARD – GAINING
CLARITY IN GLAUCOMA DIAGNOSIS USING DEEP LEARNING” is a bonafide
work carriedout by Chaithanya S (4VV20CS021), Chinmayi H (4VV20CS024), Elaine
M Paily (4VV20CS037) and Hamsini D (4VV20CS046) students of 8th-semester
Computer Science and Engineering, Vidyavardhaka College of Engineering, Mysuru in
partial fulfillment for the award of thedegree of Bachelor of Engineering in Computer
Science & Engineering of the Visvesvaraya Technological University, Belagavi, during
the academic year 2023-2024. Itis certified that all the suggestions and corrections indicated
for the internal assessment have been incorporated in the report deposited in the department
library. The report has been approved as it satisfies the requirements in respect of project
work prescribed for the said degree.
1)
   2)
                                   ABSTRACT
Glaucoma can progress undetected and cause irreparable vision impairment, thus early
detection is essential. The use of convolutional neural networks (CNNs) to diagnose
glaucoma from retinal pictures has proven to be beneficial. In order to accurately identify
glaucoma, the proposed model provides a unique CNN-based design that integrates the
optic cup to disc ratio, a crucial diagnostic feature. Moreover, an inventive picture data
generator is used to supplement the training dataset, which consists of a thorough blend of
three datasets, for the benefit of the model. The exposure to a variety of datasets improves
the model's capacity to generalize across various image kinds. The experimental findings
show an accuracy rate of 96.94%, indicating good performance. This project highlights
how deep learning can revolutionize the diagnosis of glaucoma by focusing on feature
extraction, CNN architecture, data augmentation, and dataset variety to improve accuracy.
Hosting the model on Streamlit Share enables public access, allowing users to upload
images for diagnosis and download comprehensive CSV reports. This initiative not only
advances medical diagnostics but also promotes accessibility and transparency in
healthcare technology.
Keywords: Glaucoma, Convolutional Neural Networks (CNNs), Optic Cup to Disc Ratio,
Early Detection, Retinal Images, Diagnostic Feature, Deep Learning, Data Augmentation
Dataset Diversity, Vision Impairment, Irreversible Diagnosis, Model Design,
Generalization, Performance Evaluation, Streamlit Share.
                        ACKNOWLEDGEMENT
If words are considered as the tokens of acknowledgment, then the words play the
heraldingrole of expressing our gratitude.
With proud gratitude we thank God Almighty for all the blessings showered on us and
forcompleting our project successfully.
We owe our gratitude to The Principal, Dr. B Sadashive Gowda for his whole hearted
supportand for his kind permission to undergo the project.
We wish to express our deepest gratitude to Dr. Pooja M R, Professor and Head, of the
Department of Computer Science and Engineering, VVCE, for her valuable suggestions
and guidance throughout this report.
We wish to enunciate our special thanks to our paradigmatic and relevant Project
coordinators Dr. Ayesha Taranum Associate Professor, Gayana J Kumar Assistant
Professor, Kavitha D N Assistant Professor Harshitha Suresh Assistant Professor and
internal guides, Dr K Paramesha, Professor, Department of Computer Science and
Engineering, VVCE, Mysuru for his encouragement and advice throughout the course of
the project work. My numerous discussions with her/him were extremely helpful. I hold
them in esteem for the guidance, encouragement, and inspiration received from them.
In the end, we are eager to offer our sincere thanks to our family members and friends for
theirvaluable suggestions and encouragement.
                                                   CHAITHANYA S         [4VV20CS021]
                                                   CHINMAYI H           [4VV20CS024]
                                                   ELAINE M PAILY [4VV20CS037]
                                                   HAMSINI D            [4VV20CS046]
                   TABLE OF CONTENTS
4.3 Methodology 35
4.3.1 Objectives 35
5. IMPLEMENTATION                                  40-57
   5.1 About System Implementation                  40
       5.2.3 Classification                         42
   5.3 Source Code                                  45
6. TESTING                                         58-62
  6.1 About Testing                             58
8. CONCLUSION 82-83
 REFERENCES                                    84-88
 APPENDIX                                      89-95
 ABBREVIATIONS                                  96
                         LIST OF FIGURES
CHAPTER 1
INTRODUCTION
Glaucoma, a group of eye diseases causing optic nerve damage, leads to vision loss, with
open-angle glaucoma developing gradually and closed-angle glaucoma presenting
suddenly. Open-angle glaucoma is the most common type, characterized by a slow exit of
fluid through the trabecular meshwork, while closed-angle glaucoma involves the iris
blocking the trabecular meshwork. Risk factors include age, high eye pressure, family
history, and steroid use. Diagnosis involves a dilated eye examination, revealing abnormal
cupping of the optic nerve. Permanent vision loss can occur, but early treatment with
medication, laser therapy, or surgery aims to slow or stop disease progression by reducing
eye pressure. Figure 2 depicts the population of age above 40 is more susceptible to
glaucoma.
Glaucoma affects about 70 million people globally, with a higher prevalence among older
individuals and women. A significant proportion of glaucoma cases—more than 75%—go
undetected, which could be interpreted as the tip of the iceberg in terms of conventional
illness theories. Category VI, or severe degree of disability, is assigned to glaucoma
blindness in the World Health Organization's (WHO) classification of the seven global
burden of diseases, despite the fact that glaucoma in and of itself does not cause death. We
                                                                                          1
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
calculate that 11.2 million Indians aged 40 and above have glaucoma based on the data that
is currently available. An estimated 6.48 million people worldwide suffer from primary
open angle glaucoma. There are an estimated 2.54 million people who suffer from primary
angle-closure glaucoma. There may be 27.6 million people worldwide who suffer from
primary angle-closure illness in some capacity. Figure 1 depicts the prevalence of glaucoma
from 2010 to 2020 in different countries along with India. The majority of people who are
afflicted go unnoticed, and both identifying and treating sick people present significant
obstacles. It is a leading cause of blindness, particularly in African     Americans. Referred
to as the "silent thief of sight," glaucoma's gradual vision loss occurs over an extended
period. The term "glaucoma" originates from the Ancient Greek word "glaucous," meaning
"shimmering." Although the word was used in English as early as 1587, its common usage
emerged after 1850, coinciding with advancements like the ophthalmoscope, enabling
doctors to observe optic nerve damage. Glaucoma encompasses various types, categorized
by severity levels, posing a significant global health challenge that necessitates advanced
diagnostic techniques for early intervention and vision preservation.
    Figure 1.2 Prevalence of glaucoma from 2010 to    Figure 1.3 Population of age above 40 is more
    2020 in different countries along with India                 susceptible to glaucoma
There are many advantages to using deep learning for glaucoma detection such as:
➢ Early Detection: The rapid analysis of big datasets by deep learning algorithms makes
   it possible to identify glaucoma early on. Early detection enables prompt management
   and action to stop further vision loss.
➢ Accuracy: In certain situations, deep learning algorithms can outperform humans in
   detecting minute patterns that may indicate glaucoma in medical imaging.
➢ Efficiency: By eliminating the need for human analysis, automated glaucoma detection
   via deep learning frees up healthcare practitioners to concentrate on patient care and
                                                                                                 2
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   treatment.
➢ Scalability: It's simpler to expand the screening procedure to a larger population when
   deep learning models are able to process a high volume of medical pictures. This is
   especially important in places where access to eye doctors is limited.
➢ Consistency: Artificial intelligence models offer impartial and consistent evaluations,
   removing the possibility of human interpretation variances and guaranteeing
   dependable outcomes.
➢ Better Results: By protecting eyesight and averting permanent damage from untreated
   glaucoma, early identification and intervention made possible by deep learning can help
   patients achieve better results.
➢ In general, the incorporation of deep learning into the detection of glaucoma improves
   the effectiveness, precision, and ease of use of diagnostic procedures, which eventually
   helps patients and healthcare professionals.
➢ Angle-Closure Glaucoma: Caused by the iris obstructing the drainage angle, this
   condition can appear gradually or suddenly. This kind is regarded as a medical
   emergency since it could cause an abrupt rise in ocular pressure.
➢ Normal Tension Glaucoma: Normal eye pressure levels do not prevent optic nerve
   damage.
➢ Congenital Glaucoma: Occurs at birth, usually as a result of anomalies in the drainage
   system of the eye.
➢ Primary glaucoma: Has no apparent underlying cause and develops on its own.
➢ Secondary Glaucoma: Occurs as a result of another illness or injury to the eyes, such as
   an injury, inflammation, or tumour.
➢ Neo-vascular Glaucoma: Linked to the iris's aberrant blood vessel growth, which
   raises intraocular pressure.
➢ Traumatic glaucoma: Occurs as a result of eye trauma, altering the architecture of the
   eye and impairing fluid outflow.
As shown in Figure 4, when evaluating the optic nerve head located in the back of the eye,
eye care specialists employ the cup-to-disc ratio (CDR), which is a crucial parameter. It
                                                                                         3
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
makes a comparison between the dimensions of the optic nerve head as a whole (disc) and
the hollowed-out core, or cup. Higher CDR values are associated with larger cups compared
to discs, which may indicate glaucoma.
➢ Standard CDR: The normal range of the cup-to-disc ratio in those without glaucoma
   is from 0.2 to 0.5.
➢ Glaucomatous CDR: The cup-to-disc ratio is frequently larger in glaucomatous eyes,
   usually surpassing 0.5 or even 0.6. But it's important to keep in mind that there are other
   criteria to take into account, such age, ethnicity, and individual anatomical variances,
   so a higher CDR alone may not always imply glaucoma.
                                                                                            4
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
treatment of glaucoma. Any sudden or severe eye symptoms should be taken very seriously
and should be treated right once to rule out acute glaucoma, which is an emergency that
could cause blindness.
       Figure 1.7 Photo showing conjunctival     Figure 1.8 Depicting optic nerve in
       vessels dilated at the cornea edge and    advanced glaucoma disease
       hazy cornea characteristics of acute
       closure glaucoma.
1.1.4 Causes
A class of eye disorders known as glaucoma harms the optic nerve, resulting in blindness
or visual loss. Primary open-angle glaucoma is the most prevalent kind of glaucoma, while
there are other varieties as well, each with their own unique set of reasons. The following
are a few probable causes and risk factors for glaucoma:
➢ Increased intraocular pressure (IOP): One of the main risk factors for glaucoma is
   increased intraocular pressure, or the pressure inside the eye. But not everyone with a
   high IOP gets glaucoma; some people with normal IOPs might also have the disease.
➢ Age: Glaucoma risk rises with age, particularly over 60.
➢ Family history: You are more likely to acquire glaucoma if you have a family history
   of the ailment.
➢ Ethnicity: Individuals from specific ethnic groups, including Asians, African
   Americans, and Hispanics, are more likely to experience specific forms of glaucoma.
➢ Medical problems: Glaucoma risk can be raised by a number of medical diseases,
   including diabetes, heart disease, high blood pressure, and hypothyroidism.
➢ Eye anatomy: Glaucoma risk may be elevated by specific eye diseases or anatomical
   characteristics. These include narrow-angle architecture, thin corneas, and certain
   properties of the optic nerve.
                                                                                         6
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
➢ Eye trauma: A history of eye surgery or other eye trauma can raise the chance of
   getting glaucoma.
➢ Corticosteroid use: Corticosteroid use, particularly eye drops, can raise the chance of
   developing some forms of glaucoma over the long term.
➢ Additional elements: High myopia (near-sightedness), headaches, and a history of
   serious eye infections are additional variables that may raise the risk of glaucoma.
1.1.5 Diagnosis
A combination of procedures and examinations performed by an eye care specialist are
usually required to diagnose glaucoma.
                                                                                            7
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
A glaucoma diagnosis and suitable treatment plan can be developed by an eye care
specialist based on the results of these tests and examinations. Effective glaucoma
management and vision preservation depend on early detection and routine monitoring. See
an eye care expert as soon as possible if you detect changes in your vision or if you have
any concerns about your risk of developing glaucoma.
1.2. Scope
Using Convolutional Neural Networks will achieve good results, as CNN is used for
learning complex features efficiently as the model has many layers and CNN performs
intensive computational tasks simultaneously. We are using individual datasets to make a
large dataset. So, we included CNN doesn't need any manual power i.e. human supervision.
We can determine the stage of glaucoma of an individual using the amount of ocular
pressure, optic disc, and optic cup. Data augmentation can be applied for small datasets.
Another advantage of Data Augmentation is it multiples the images so that detection is
performed more productively.
1.3    Purpose
From the literature surveyed in section 2, it is found that most of the researchers have
worked with a relatively small number of images, fundus images from private datasets and
datasets that lack real time variations in image quality. This hampers the robustness of the
system. There is a need to develop a model which works for images acquired under different
environmental conditions. Also, there is scope in enhancing the classification accuracy as
much as possible.
Although there have been a significant number of techniques proposed in the literature, it
is required to develop an efficient algorithm using a maximum number of subjects.
1.4    Motivation
Being the second largest cause of blindness worldwide, it can lead the person towards
complete blindness if an early diagnosis does not take place. Concerning this underlying
issue, there is an immense need of developing a system that can effectively work in the
                                                                                            8
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
absence of excessive equipment, skilled medical practitioners and also is less time
consuming. As a result, clinicians in rural areas can also be able to efficiently use this
application for their diagnosis. As glaucoma diagnosis is a time-consuming procedure and
requires skilled professionals, no special skills are required to work with developed
applications.
•   Developing a robust system by training the model with different kinds of datasets
    containing varied characteristics of fundus images and increasing the number of
    training and testing images.
•   The proposed approach is applied on large dataset.
•   The proposed image augmentation techniques are the usage of image datagenerator.
•   Instead of using images as it is, we convert them into binary as it results in higher
    classification with less memory consumption.
•   Using CNN for feature extraction and classification to achieve higher accurate results.
                                                                                          9
Dept. of CSE VVCE, Mysore
                       GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 2
                           LITERATURE REVIEW
  Table 2.1 A review of the most commonly used datasets for glaucoma diagnosis. GT: Ground Truth, G:
                                       Glaucoma, H: Healthy.
                                                                                                   10
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
                                                                      LINK
 RIM-   172             313         485     Various       Subject-    Combination of
 ONE DL                                                   level       RIMONE-r1, r2
 [6]                                                      label       and    r3   [26],
                                                                      Images        are
                                                                      cropped at ON
                                                                      LINK
                                                                                        11
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Convolutional, pooling, and fully connected layers make up the CNN architecture. While
pooling layers reduce dimensionality, convolutional layers employ learnt filters to build
activation feature maps. High-level features are mapped to output classes by fully
connected layers. Notably, research on glaucoma classification either builds custom CNNs
or uses pre-trained models. Wang et al., for example, suggested an end-to-end semi-
supervised multi-task CNN for glaucoma classification and structural-functional alterations
investigation utilizing ResNet-18. A Weakly-Supervised Multi-Task Learning approach
was presented by Zhao for the identification of evidence, OD segmentation, and glaucoma
diagnosis. By combining information at different scales, Liao introduced EAMNet, an
interpretable CNN that improves diagnosis accuracy. Xue et al. developed a three-phased
framework for glaucoma screening, detection, and severity classification using ResNet
topologies. Jun introduced a Transferable Ranking CNN for multi-class classification using
DenseNet in order to improve inter-class information integration.
ODGNet, a two-phase system for optic disk localization and glaucoma diagnosis, was
introduced by Jahanzaib Latif et al. [12] .They sought to help ophthalmologists with mass
screening by achieving 95.75% accuracy on five datasets through the use of visual saliency
maps and transfer learning models. A deep learning-based optic disc and cup segmentation
system utilizing a modified Ground Truth was proposed by Partha Sarathi Mangipudi et al
[13] . While efficient on three datasets, challenges arise in cases of small optic cups or low
contrast images, suggesting the incorporation of salient point detection algorithms with
CNNs for improved accuracy. An explainable deep learning methodology for glaucoma
detection and the vertical cup-disc ratio (VCDR) is proposed by Ruben Hemelings et al.
[14] . With pre-processing procedures applied, the model processes color fundus pictures
and shows a high degree of reliability in identifying damage caused by glaucoma outside
the optic nerve head (ONH). An AI glaucoma expert system utilizing a deep learning
architecture with CNN is presented by Mamta Juneja et al. [15] . The method uses a
modified U-net to segment the optic disc and cup. Preprocessing, segmentation, and
classification stages are used, and color channels are assessed for maximum accuracy.
Using retinal fundus pictures, Rutuja Shinde [16] presents an offline CAD system for the
diagnosis of glaucoma. Le-Net is used by the system to validate images, U-Net is used to
segment optic discs and cups, and SVM, Neural Network, and Adaboost classifiers are used
to classify images based on features like CDR and blood vessels.TWEEC, a two-branched
deep convolutional network, is suggested by Lamiaa Abdel-Hamid [17] for computer-aided
glaucoma diagnosis. TWEEC recovers blood vessel and optic disc information with high
                                                                                           12
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
accuracies of 96.34% and 98.78% for wavelet and spatial inputs, respectively. To improve
performance, regularization techniques like batch normalization and dropout are used. A
noise-resistant technique for automated glaucoma diagnosis utilizing blood vessel tracking
and bend point identification is put forth by Surya M et al. [18] . By tackling border
segmentation issues and yielding dependable Cup to Disc Ratio (CDR) values, the method
attains excellent accuracy. With data augmentation, M. Tabassum et al. [19] demonstrate a
deep convolutional neural network for early glaucoma identification that achieves 99.6%
accuracy. The model performs marginally worse on the DRISHTI dataset, but it displays
higher dice values for optical cup segmentation. Using test concept activation vectors
(TCAVs), Kaveri A. et al. [20] introduce a convolutional neural network architecture for
glaucoma detection in optical coherence tomography images, achieving higher accuracy
(90%) than models trained only on retinal nerve fiber layer probability map input images.
With 96.7% accuracy using the KNN classifier, Hamid A [21] presents a glaucoma
detection system based on statistical and textural wavelet data. The approach shows
effectiveness in terms of processing speed and feature selection. A sparse auto-encoder-
based computer-aided design (CAD) tool is proposed by Raghavendra et al. [22] for the
diagnosis of glaucoma, pixel resizing for cost savings, and effective classification without
requiring a lot of preprocessing. The model can be utilized independently and has fewer
tuning parameters. A CADx framework for treating glaucoma through deep learning and
manually designed feature-based segmentation is put out by Patil N et al. [23] . With
optimized deep features, the model attains 98% accuracy; nonetheless, the technique is
dependent on an imbalanced dataset consisting of 80% normal photos and 20% glaucoma
images. Serner A et al. [24] presented a deep learning and transfer learning based early and
sophisticated glaucoma diagnosis system. GoogleNet achieved an average accuracy of
83%, outperforming ResNet. The method is time-consuming and expensive, and it works
best for early detection. A diagnostic tool for glaucoma diagnosis was developed by Deepak
Parashar et al [25], who reported 93.40% accuracy utilizing fractal dimension
characteristics and a supervised machine learning technique (LS-SVM). Combining U-Net
and MobileNet v2, Javier Civit-Masot et al. [26] proposed an image segmentation and
transfer learning-based diagnostic tool for glaucoma. For mixed datasets, the lightweight
approach functioned admirably. A clinically interpretable ConvNet architecture with 88%
accuracy on the ORIGA dataset was published by W Liao et al. [27] , who concentrated on
enhancing optic disc segmentation, feature extraction, and image refinement. Using 2D-T-
EWT, Deepak Parashar et al. [25] developed a glaucoma detection technique that achieved
                                                                                         13
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
93.65% accuracy using LS-SVM. Nevertheless, when the model is evaluated on other
datasets, its performance differs. A fuzzy wide learning system for glaucoma detection was
presented by R Ali et al. [28] and uses data augmentation and region of interest extraction.
Preprocessing and post-processing are necessary for accurate findings even though training
is faster. A non-handcrafted feature extraction method utilizing sigmoid activation was
proposed by D R Nayak et al. [29] , who achieved good performance with SVM under ten-
fold cross-validation. Less learning parameters are needed for the model, which is trained
on a costly system featuring a 2.4GHz Xenon processor and 48GB of RAM. In order to
achieve auto-cropping photos with categorized labels, A. D. Pinto et al. [30] developed a
semi-supervised learning strategy for glaucoma detection using DCGAN. The technique
works well but is costly and time-consuming; it is best used for early detection. A method
for glaucoma identification was presented by J Afolabi et al. [31] utilizing XGBoost for
classification and a U-Net light network for picture segmentation. Although the accuracy
of the model is 96%, it does not perform well on low-quality photos. Using manually
created visual characteristics, Cheng et al. [32] introduced a super pixel classification
approach for optic disc and cup segmentation. There are biases in favor of medium-sized
cups in the method. A Glowworm Swarm Optimization and EfficientDet-D0 explainable
deep learning approach for glaucoma detection was proposed by Marriam Nawaz et al. [33].
Changes in scale and rotation are difficult for the method to handle. A context-aware
segmentation and classification system for glaucoma diagnosis was created by S. Sankar
Ganesh et al. [34] ; using eleven CNNs, they achieved 99.53% accuracy on the REFUGE
dataset. With an accuracy rate of 95.24%, Anindita Septiarini et al. [35] presented an
automatic glaucoma detection approach based on statistical pictures and texture extraction
techniques. Using quasi bivariate mode decomposition, Dheeraj Kumar Agrawal et al. [36]
presented an explainable glaucoma diagnosis method that achieved 80% accuracy using
SVM. In their investigation of the impact of study population labeling on glaucoma
diagnosis, Mark Christopher et al. [37] achieved excellent accuracy across a range of
datasets. An attention-guided 3D-CNN framework for glaucoma diagnosis was created by
Yasmeen George et al. [38] , achieving good accuracy and structural-functional connection.
Using self-organizing neural networks, Ozer Can Devecioglu et al. [39] presented a real-
time glaucoma diagnosis method that achieved 94.7% accuracy on the ESOGU dataset.
WangMin Liao et al.'s [40] EAMNet model, which aggregates features from many scales,
is intended for use in the diagnosis of glaucoma. With an AUC of 0.88, the model proved
to be effective in handling difficult optic disc segmentation tasks. A micro statistical
                                                                                         14
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
descriptors-based method for glaucoma diagnosis using neural networks was presented by
Mukil Alagirisamy et al. [41]. The system's automated extraction of region of interest (ROI)
and micro statistical features for glaucoma detection yielded 95.05% accuracy. Bhupendra
Singh Kirar et al. [36] created a discrete wavelet transform and image channels glaucoma
detection technique. By achieving a detection accuracy of 84.95%, the suggested
methodology surpassed previous techniques on the RIM-1 picture database. The 10-2 and
24-2 visual field tests were qualitatively evaluated by ADI ORBACH et al. [42] in order to
identify anomalies in the central visual field associated with glaucoma. The study brought
to light the difficulties in applying visual field data for qualitative analysis in glaucoma
damage detection, particularly at the sample density of the 10-2 test. A wavelet-based
denoising and machine learning approach for automated glaucoma detection from fundus
pictures was proposed by Sibghatullah I. Khan et al. [43]. 10% outlier elimination enhanced
classification performance when the LS-SVM classifier was used. With an emphasis on
retinal fundus images, Xiong Luo et al. [44] presented a deep learning-based CAD model
for the classification of ophthalmic images. With the addition of a suggested loss function,
the FCL-EfficientNet-B3 model demonstrated better specificity, Kappa, and AUC,
outperforming previous baseline techniques for the detection of glaucoma, AMD, and
cataracts. A web-applicable deep learning-based computer-aided diagnosis system for
glaucoma that makes use of CNNs and Grad-Class Activation Mapping was presented by
Mijung Kim et al. [45] . A small collection of fundus eye images was used to illustrate the
efficiency of the predictive model, which was then integrated into a prototype web
application. A deep learning method for diagnosing glaucoma using optical coherence
tomography (OCT) thickness and deviation maps was created and verified by Ko Kim et
al. [46]. The study demonstrated the importance of RNFL thickness maps by comparing the
diagnostic performance of many deep learning models.An automatic framework for
diagnosing glaucoma based on CNN models was described by Manal Abdel-Mottaleb et al.
[47], who compared the model's performance with that of experienced ophthalmologists.
The study addressed issues with short labeled datasets and transfer learning by emphasizing
the automatic extraction of important features from raw photos.In order to identify
glaucoma with high accuracy, Yidong et al. [48] presented a method for classifying
microcalcification clusters in mammograms. Using multimodalities such as K-Means
clustering, Gabor wavelet modification, and SLIC algorithm, the method improved border
delineation in color fundus camera images. In fundus images, Huazhu Fu et al. [49] reported
on the use of a deep learning network for glaucoma identification. The study emphasized
                                                                                         15
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
the significance of resolving issues with optic cup segmentation by comparing the
performance of M-Net and Disc-aware Ensemble Network.Using fundus photos, JinAhn et
al. [50] presented a deep learning model for the diagnosis of both advanced and early
glaucoma. Using a transfer-learned GoogleNet Inception v3 model, the study showed high
accuracy and the usefulness of deep learning approaches in differentiating between healthy
controls and glaucoma patients.A machine learning-based technique for diagnosing
glaucoma using optical coherence tomography and color fundus images was proposed by
Guangzhou An et al. [51] . The study emphasized the development of machine learning
technologies and the significance of automated algorithms for the detection of eye diseases.
A machine-learning approach for accurately identifying glaucoma nodules (GON) was
created by Zhixi Li et al. [52] . The study demonstrated the deep learning algorithm's strong
performance for referable GON identification using a sizable dataset.An automated
classification method for identifying the stage of age-related macular degeneration in color
fundus images was provided by Felix Grassmann et al. [53] . Using the AREDS dataset, the
study attained good classification accuracy while emphasizing the usage of deep learning
models.A deep learning-based automated method for detecting glaucomatous optic
neuropathy on color fundus photos was first presented by Feng Li et al. [54] . In multi-class
comparisons for glaucomatous optic neuropathy, the model showed potential and
demonstrated high accuracy when compared to human experts. A deep learning model for
segmenting the optic nerve head's cup surface area in OCT B-scan images was presented
by Nahida Akter et al. [55] . The study demonstrated how to diagnose glaucoma using novel
clinical imaging parameters, and it outperformed earlier models in terms of diagnostic
performance. A CNN-based transfer learning model for automatic glaucoma classification
using color fundus pictures was presented by Juan Gomez-Valverde et al. [56] . The study
highlighted CNNs' usefulness as a superior substitute for CAD systems in the categorization
of glaucoma.
                                                                                          16
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
2. Neglect of Poor-Quality Image - Some studies did not account for poor-quality images,
including issues with contrast and cropping. Ignoring these poor-quality images and
treating them as noise might result in a biased model that is not robust to variations
commonly encountered in real-world medical imaging.
3. Limited Stage Identification - Existing models were often capable of detecting the
presence of glaucoma but struggled to identify the specific stage of the disease.
Understanding the stage of glaucoma is crucial for appropriate treatment and management
decisions.
4. Overemphasis on RGB Images - The use of RGB images, particularly focusing on the
red channel, was noted in some papers. This approach might introduce biases and affect the
robustness of the model, as alterations in the red channel can significantly impact retinal
images.
5. Unbalanced Datasets - Many reviewed papers reported the use of unbalanced datasets.
An imbalance in the distribution of classes can lead to improper training and adversely
affect the reliability and accuracy of the system. Addressing class imbalances is essential
for developing trustworthy models. Addressing these challenges would contribute to the
improvement and reliability of deep learning models for glaucoma detection. Researchers
should consider using larger and more diverse datasets, account for image quality issues,
focus on identifying glaucoma stages, explore alternative colour representations, and ensure
dataset balance for more accurate and robust model development.
                                                                                         17
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 3
REQUIREMENTS SPECIFICATION
                                                                                              18
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
➢ To protect the photos from being impacted by different colors, do image augmentation
   to expand the image set, and apply binarization to the images to identify the correct
   affected area from the image.
➢ Use CNN for feature extraction and classification.
➢ Producing metrics for assessment and evaluating outcomes.
➢ Security: User access and session restrictions must be possible for the system to
   implement. Additionally, data needs to be kept in a safe location and manner. It requires
   a secure channel for the transfer of data.
➢ Concurrency and Capacity: The system should be able to handle several calculations
   at once. simultaneously and maybe in relation to one another.
➢ Performance: Most people think about performance in terms of a schedule. These are
   some of the most important variables, especially in the early stages of the project's
   architecture.
➢ Reliability: Even something as basic as maintaining a system log will require more
   time and effort to complete from the start. It is vital to guarantee and alert about system
   transactions and processing. Transferring data should happen consistently and through
   reputable channels.
➢ Maintainability: A well-thought-out system should be able to function for a
   considerable amount of time. As such, it will It is frequently necessary to do preventive
   and corrective maintenance. Upgrading and expanding the features and functionalities
   of the system could be interpreted as maintenance.
➢ Usability: The satisfaction of end users with a project's accomplishment is one of the
   key pillars supporting a product. From the beginning of the project, consideration
   should be given to the needs of the user experience. Time will be greatly saved when
   the project is published thanks to this. The user won't ask for clarifications or, in the
   worst case, requests for changes.
➢ Documentation: Every project necessitates a minimum of documentation at various
   levels. Maintaining excellent documentation standards and practices can help spread
   this task across the project development, as in many cases the users may even need
   training on it. However, this must also be set as the project planning will include this
   activity in the list.
                                                                                           19
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
➢ Processor: Intel I5
➢ RAM: 8 GB
➢ Hard Disk: 64 GB
                                                                                          20
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
An essential step in the software development process is the feasibility study. It makes it
possible for the developer to evaluate the product they are working on. It alludes to the
product's feasibility research concerning its intended uses, potential results, and the
technical assistance needed to put it into practice. It is important to do the feasibility
research using a variety of standards and guidelines. Operational, technological, economic,
and behavioural feasibility are the four methods in which this feasibility study can be
executed.
                                                                                           21
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
When it was first published in 2001, the Agile Manifesto of Software Development
proposed a revolutionary approach to providing value and working with clients. The four
key principles of agile are:
Agile project management is predicated on the idea that modifications can be made
promptly and in response to the needs of the project, allowing for the continuous
improvement throughout the project’s life cycle. They can review their work and make
modest adjustments thanks to the agile technique. Depending on the step the model is going
through the amount of photos that it has been trained with will change. The agile
methodology facilitate the iterative process of implementing the necessary design phase
modifications. We can add a new dataset for the glaucoma detection process, but this will
only impact the design phase and not the requirement phase.
                                                                                        22
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 4
•   Architecture: A system's views, behavior, and structure are defined by this conceptual
    model. Flowcharts are a useful tool for illustrating architectural concepts.
•   Modules: These are parts of a system that are responsible for a single, designated task.
    The system is composed of a combination of the modules.
•   Components: These offer a specific function or a collection of related functions. They
    consist of separate modules.
•   Interfaces: These are the common boundaries that allow system components to
    communicate and relate to one another.
•   Data: This information and data flow management.
•   Make plans and determine which technologies will be used to build and implement the
    various components of the system as well as the physical interconnections between
    them.
•   Assess which technologies and system components run the danger of becoming
    outdated or changing while the system is in operation.
•   Make a plan for when they might be replaced.
                                                                                         23
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
•   Keep a record of the design definition approach, along with the specifications for any
    enabling systems, goods, or services needed to carry out the design.
•   Establish how the design features relate to the architectural features and make sure they
    can be put into practice.
•   Specify which interfaces, which require definition when the design details change, were
    not specified by the System Architecture processor.
•   Describe and record each system element's design features.
•   Capture and preserve the reasoning behind all alternative selections and design
    decisions, as well as architectural features.
•   Evaluate the design qualities and maintain control over their evolution.
For Example:
                                                                                            24
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
•   Safety integrity: Design features that lessen the possibility that the system will injure
    people or property, or permit the possibility of doing so.
•   System availability: A system's design components that allow it to run continuously are
    one example.
•   Fault tolerance: Design features (such as the absence of a single point of failure) that
    enable the system to function even in the event that some components malfunction.
A data flow diagram (DFD) shows how information moves through a system or process. It
displays data inputs, outputs, storage locations, and the paths between each location using
well-defined symbols like rectangles, circles, and arrows together with brief text labels.
Data flow diagrams (DFDs) can be as basic as hand-drawn process overviews or as complex
as multi-level DFDs that gradually delve deeper into the data handling process.
External     entity: An external system that communicates with the system being
diagrammed by sending and receiving data. They serve as the information's entry and exit
points into and out of the system. They could be a business system, a computer system, or
an outside entity. They go by the names terminators, sources, sinks, and actors as well.
Usually, they are depicted on the diagram's edges.
Process: Any method that modifies the data and generates an output. It could do out
calculations, organize data according to logic, or control data flow according to business
standards. The process is described by a brief label.
Data store: Files or repositories, such membership forms or database tables, that save data
for later use. Every data store is given a plain label.
                                                                                          25
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Data flow: The path data takes as it moves between data stores, processes, and external
entities. It is depicted with arrows, usually identified with a brief data name, and shows the
interaction with the other components.
Context diagrams are another name for DFD Level 0. An elementary synopsis of the entire
system or process under analysis or modeling is provided. The overview perspective is
intended to present the system as a unified, high-level process along with its connections
to other entities. A large audience should be able to understand it with ease, including
developers, business analysts, data analysts, and stakeholders.
The primary process is divided into smaller processes by Level 1 DFD, allowing for a closer
look at each one. The primary process uses the data stores found in level 1 DFD. Every
major subprocess that makes up the entire system is noted in a level 1 DFD. A level 1 DFD
can be compared to a context diagram's "exploded view."
                                                                                           26
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
A flow chart and a DFD may have comparable visuals. With the data flow diagram, there
is a notable distinction. In DFDs, the arrows indicate the data flow between the two
components rather than the component sending the data that needs to be executed in the
component after it. When delivering data or when the component receiving the data is
executing, a DFD component may stop working. Several sets of data can be sent over
several connections via the data-sending component. A DFD node may, in fact, be an
infinite component.
Rules
                                                                                         27
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Strengths
1. Data may be easily changed, verified, and understood in DFD diagrams.
2. DFDs are a great tool for displaying data regarding an organization's operations.
Weaknesses
In DFDs, altering one data layout has the potential to modify the layout as a whole.
In a large application, a DFD has a significant number of units. As a result, maintenance is
more difficult, expensive, and error-prone.
Goals:
                                                                                         28
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
• Graphical Notation.
Use Case: As was previously said, an actor is a stick figure that represents a system user.
The role of the user is displayed beneath the emblem. Playwrights are not mere mortals. If
an application communicates with another system and sends or receives input, it can also
be thought of as an actor.
Links: Actors are linked by these Associations. association with use cases, and show that
an actor takes part in the use case in one way or another. Each Use Case has a set of steps
to follow in order to accomplish the required functionality. It also includes backup plans in
case validation fails or mistakes are made. An explanation of the use case can provide more
details about these actions. There are no standards for Use Case descriptions because this
is not covered in UML. Nonetheless, there are several standard templates that you may use
and entire books about producing use case descriptions.
                                                                                          30
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Sequence diagrams show how different classes interact to produce a particular outcome,
like a use case. These exchanges between classes are referred to as messages as the UML
was created with object-oriented programming in mind. The Sequence Diagram illustrates
these communications throughout time by listing items horizontally and time vertically.
Graphical Notation: Classes and actors are listed as columns in a sequence diagram, and
vertical lifelines show how long an object will last.
Object: Objects are grouped horizontally and are instances of classes. An object is
represented graphically as a class (a rectangle) with a semicolon and the object name
(optional) prefixed to the name.
                                                                                          31
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Lifeline: The object's existence is tracked over time by the Lifeline. A vertical dotted line
extending from an item is the symbol 2 for a lifeline.
Activation: On the lifeline, activations are represented as rectangular boxes that show
when an action is being carried out by the object.
Message: Messages represent the communications between objects and are modeled as
horizontal arrows between activations.
Sequence Diagram:
                                                                                          32
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
This illustrates how events go through the system. The actions that take place in a use case
or during an object's activity usually happen in a certain order. An activity diagram is
intended to provide a simplified view of an operation or process. Every activity is
represented by a rounded rectangle. After processing through compilation, an activity
automatically moves on to the next one. The transition from one action to the next is shown
by an arrow. The state that reflects carrying out a series of operations is called an activity.
These resemble dataflow and flow chart diagrams.
Transition: A directed relationship between a vertex in the source state and a vertex in the
target state is called a transition. It might be a component of a compound transition, which
represents the static machine's whole reaction to a certain event instance by moving it from
one static configuration to another.
Final state: A final state is an enclosing composite state that is the last or "final" state.
Multiple final states are possible at each level, indicating that the composite state may
terminate under many circumstances. The entire state machine has finished its transitions
and no more can happen when a final state is achieved and there are no more enclosing
states.
                                                                                             33
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Decision: An activity diagram, which is derived from a state diagram, represents a choice
when guard conditions are applied to show many possible transitions that rely on the
Activity Diagram:
                                                                                       34
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
4.3 Methodology
4.3.1. Objectives
➢ Various pretrained models such as AlexNet, ResNet, and VGGNet have been widely
   utilized in glaucoma detection research. Saliency maps generated from these models
   serve as crucial inputs for subsequent steps in the process. Many proposed models have
   utilized ground truths and modified ground truths to enhance glaucoma detection
   accuracy.
                                                                                        35
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
➢ UNet, a popular choice for image segmentation, has been employed by some
   researchers despite its known slowdown in the middle layers. Addressing the issue of
   imbalanced data, which can disrupt detection outcomes, has been tackled by certain
   methods through data balancing techniques. Additionally, while some researchers have
   utilized a large number of parameters in their models, this can significantly impact
   model performance.
➢ In our proposed model, we amalgamate datasets from ACRIMA, DRISTI, and
   RIMONE. We leverage an image data generator for augmentation, expanding the
   original images to create a comprehensive dataset.
➢ The dataset is then split into training, testing, and validation sets. Augmented images
   undergo feature selection via CNN to extract relevant information. Employing binary
   classification, the model accurately predicts glaucomatous eyes.
➢ Many existing systems use models like Inception V3, U-Net, and MobileNet, among
   others. However, a common issue arises when these systems perform well on specific
   datasets but have considerably decreased accuracy when applied to new, previously
   unknown datasets. To solve these problems, we offer a technique that involves
   combining and reconfiguring three to four publicly available datasets.
                                                                                      36
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Kaggle is a free-source to download datasets. We have taken our datasets from that only.
Wecan have access to Use over 50,000 public datasets.
a) ACRIMAA
The 705 fundus images in the ACRIMA collection are made up of 396 glaucomatous and
309 normal images. With the prior agreement of the glaucomatous and normal patients,
they were collected at the FISABIO Oftalmología Médica in Valencia, Spain, adhering to
the ethical guidelines outlined in the 1964 Declaration of Helsinki. ACRIMA database
images were all annotated by glaucoma specialists with years of expertise. They were given
new names and cut to fit the optic disc.
Source:
https://www.kaggle.com/datasets/sshikamaru/glaucoma-detection?select=ACRIMA
                                                                                       37
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
b) DRISHTI-GS
51 test images and 50 train images make up this dataset. Two folders are present in each
directory: one is called images and the other is called GT. The masks for the optic disk and
cup that correspond to the images in the images folder are found in the later folder.
Source:
https://www.kaggle.com/datasets/lokeshsaipureddi/drishtigs-retina-dataset-for-onh-
segmentation
                                                                                         38
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
c) RIMONE
There are 169 optic nerve head images in the RIM-ONE database. Five manual
segmentations by ophthalmology professionals are included in each image. Every image's
gold standard was established using the matching segmentations.
Source:
https://www.kaggle.com/datasets/lucascunhadecarvalho/rimone-glaucoma
                                                                                      39
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 5
IMPLEMENTATION
The process of turning the theoretical design into a functional system is called
implementation. Implementing the system is the most important step in creating a new,
successful system and in instilling confidence. It entails meticulous planning, research into
the existing system and its implementation limitations, the creation of techniques to
accomplish the switch, and an assessment of the switch's procedures outside of planning.
Preparing the users for implementation involves two main tasks: system testing and user
education and training. The amount of system analysis and design work needed simply for
implementation will increase with the complexity of the system being implemented. There
are various tasks involved in the implementation phase. Acquisition of the necessary
software and hardware is completed. It could be necessary to design some software for the
system. Programs are created and tested for this purpose. After that, the user discontinues
the old system and switches to his newly developed and thoroughly tested system.
Data pre-processing, which entails cleaning and manipulating raw data, is an essential first
stage in the data analysis process in machine learning and data mining applications. This is
an essential step in handling problems such as noisy data and absent attributes. Pre-handling
with reference to an eye disease data collection involves examining fundus photos for
anomalies. It is important to assess the quality of the information before implementing AI
techniques in order to ensure consistent results.
Types of preprocessing:
1. Data Cleaning: Managing Missing Values, Identifying and handling outliers, and noise
   reduction.
                                                                                          40
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
2. Data Integration: Integrating data from several sources into a single dataset is known as
   data integration, which resolves disputes and discrepancies across various datasets
3. Data Transformation: Scaling numerical properties to a conventional range, such as 0
   to 1, is known as normalization. Standardization involves adjusting each attribute's
   distribution so that its mean is equal to 0 and its standard deviation is equal to 1.
4. Log transformation: Applying logarithmic functions to handle skewed data. Binning is
   the process of classifying or binning continuous data. Putting categorical data into
   numerical representations is known as encoding categorical variables.
5. Data Reduction: Dimensionality reduction: Principal Component Analysis (PCA) and
   t-Distributed Stochastic Neighbor Embedding (t-SNE) are two methods for reducing
   the amount of features in data. Aggregation is the process of combining several data
   points (such the mean and median) into a single representation.
6. Data Discretization: Transforming continuous data into discrete form is known as data
   discretization which is beneficial for some algorithms that perform better when dealing
   with categorical input.
7. Image preprocessing also include the following: Resizing, Normalization, Grayscale
   Conversion ,Contrast Adjustment ,Histogram Equalization ,Cropping ,Rotation and
   Flipping ,Noise Reduction ,Image Augmentation ,Edge Detection , Color Space
   Conversion ,Image Normalization ,Image Denoising , Data Augmentation (for object
   detection),Image Segmentation
8. Feature Engineering: It is the process of improving model performance by developing
   new features based on preexisting ones. Ensuring that the scales of various features are
   similar is known as feature scaling.
9. Data augmentation (for picture data) is the process of creating new training examples
   from preexisting data by transforming it in different ways, such as rotating, flipping, or
   zooming.It is highlighted that applying data augmentation techniques, including
   rotation and zooming, helps to increase the size of the training dataset and improves the
   generalizability of machine learning models, especially when dealing with image data.
10. Image Data Generator: The Keras ImageDataGenerator generates an output that solely
   contains the newly converted data after randomly modifying the original data inputs.
   Using the Keras ImageDataGenerator module, more data is provided to increase the
   model's applicability. Data augmentation use an image data generator to perform
   random operations on data, including translations, rotations, scale adjustments, and
   vertical flips. In the realm of real-time data augmentation, batches of data are produced
                                                                                           41
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
5.2.3. Classification
A set of input data is grouped into distinct groups according to one or more criteria as part
of the supervised machine learning process known as classification. The algorithm uses
training information, usually in the form of preexisting data or observations, to classify
incoming observations into established groups or classes through classification prediction
modeling. Through the use of patterns and relationships found in the training data, the
algorithm is able to generate precise predictions or assignments for previously unseen data.
CONVOLUTIONAL NEURAL NETWORKS
The convolution neural network is referred to as a machine learning subnet. It is one of
many models of artificial neural networks that are used for various tasks and sets of data.
For tasks like image identification and pixel data processing, deep learning algorithms use
a specific kind of network design called a CNN. In deep learning, CNN is preferred over
                                                                                          42
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
all other forms of neural networks for detecting and classifying objects. As a result, they
are ideal for computer vision (CV) activities and for applications like face recognition and
self-driving auto systems where accurate object detection is crucial. A particular type of
neural network called a CNN can be used to find important information that may be present
in both time-series data and image data. For image-based applications like object
classification, pattern recognition, and image identification, this makes it very helpful. A
CNN uses linear algebraic concepts like matrix multiplication to find patterns in an image.
CNN may also categorize audio and signal data. CNNs have architecture resembling those
of the interconnections in the human brain. The neurons in CNNs are organized differently,
yet they are similar to the billions of neurons seen in the human brain. The frontal lobe of
the brain, which processes visual stimuli, is actually modelled by the way CNN's neurons
are organized. By overcoming the problem with standard neural networks' partial image
processing that requires us to give them low-resolution images by using this design, the full
visual field is protected. CNN performs better than earlier networks when given inputs that
contain both speech and/or visual signals.
Input layer: This is the first layer into which the network receives input data, often images
in the case of computer vision applications. A grid of pixels, each containing color
information, is used to represent each input image.
Convolutional Layer: A CNN's core structural component is the convolutional layer. In
order to extract characteristics like edges, textures, and forms from the input image,
convolutional filters, often referred to as kernels, are applied. Feature maps are created by
sliding each filter over the input image and applying element-wise multiplication and
summing.
Activation Layer (ReLU): To incorporate non-linearity into the network, a Rectified
Linear Unit (ReLU) activation function is normally applied element-wise following each
convolutional operation. ReLU adds non-linearities to the network, enabling it to learn
more intricate patterns.
Pooling Layer: The convolutional layers' feature maps' spatial dimensions are decreased
by the pooling layer. In order to down sample the feature maps, common pooling methods
like max pooling and average pooling take the maximum or average value inside each
pooling window, respectively. Pooling facilitates the management of overfitting and the
reduction of computational complexity.
Fully Connected (Dense) Layer: This layer functions similarly to a conventional neural
network in that it links every neuron in one layer to every other layer's neuron. It converts
                                                                                          43
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
the output from the preceding levels, which has been flattened, into a format appropriate
for the output layer. In the last phases of the network, dense layers are frequently employed
for regression or classification tasks.
Dropout Layer: To avoid overfitting, dropout is a regularization technique frequently
employed in CNNs. In order to force the network to acquire more robust properties and
lessen dependence on particular neurons, it randomly removes a portion of the neurons
during training.
Batch Normalization Layer: In deep neural networks, batch normalization contributes to
faster convergence and better training stability. Through scaling and adjustments based on
the mini-batch's mean and variance, this layer normalizes the activations of the preceding
layer.
Flatten Layer: The convolutional and pooling layers' multidimensional feature maps are
transformed into a one-dimensional vector by the flatten layer, which is then used to feed
the vector into a fully connected layer for additional processing.
Normalization Layer: This layer serves to improve the network's performance and training
convergence by standardizing the input data to have a zero mean and unit variance.
Dense layer: The typical layer of a neural network is its thick layer, which has numerous
connections. It is the most common and often utilized layer. The dense layer performs the
following action on the input before returning the result.
output = activation (dot (input, kernel) + bias)
Output Layer: This layer generates the network's final forecasts or outputs. The job at
hand determines the architecture and activation function of the output layer. For multi-class
classification problems, for instance, linear activation may be utilized, but SoftMax
activation is frequently used for regression tasks.
                                                                                          44
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Advantages of CNN
   ➢ The main advantage of CNNs over other deep learning algorithms is their capacity
       to automatically extract features from data.
   ➢ When it comes to unstructured data with complex spatial patterns, like image data,
       convolutional neural networks excel.
   ➢ Performance for image data is state of the art.
   ➢ The ability to perform with insufficient information.
   ➢ Pre-processing or data feature creation are not required.
The suggested CNN'S convolutional layer makes use of a 3x3 kernel and a filter with a size
of 32. This kernel helps to speed up the processing of 256x256 images. The current model
makes use of two convolutional layers. It executes a dot product using the supplied picture
and the matrix of learning parameters, or kernel. A max pooling layer comes after the
convolutional layer. In dense and convolutional layers, the ReLU activation function is
employed. It is done in batches.
A 25% ignore rate is applied to the dropout layer in use. The softmax activation function is
used in the final output layer. Since it displays the greater value to the target class and
provides the likelihood of obtaining each class, the softmax function is a suitable choice.
import pathlib
base_dir = '/content/drive/MyDrive/datasets/combine'
base_dir = pathlib.Path(base_dir)
count = 0
data_count = []
for x in dataset_classes:
  print(f'Total {x} images: {len(data[count])}')
  data_count.append(len(data[count]))
  count += 1
sns.set_style('darkgrid')
                                                                                          46
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Figure 5.2 The total number of glaucoma image and normal image present after combining the datasets
                                                                                                    47
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
zoom_range = 0.15,
horizontal_flip = True)
train_ds = datagen.flow_from_directory(
  'images/train',
  target_size = (img_height, img_width),
  batch_size = batch_size,
  class_mode='categorical',
  shuffle=False)
val_ds = datagen.flow_from_directory(
  'images/val',
  target_size = (img_height, img_width),
  batch_size = batch_size,
  class_mode='categorical',
  shuffle=False)
test_ds = datagen.flow_from_directory(
  'images/test',
  target_size = (img_height, img_width),
  batch_size = batch_size,
  class_mode='categorical',
  shuffle=False)
classifier = Sequential()
# Step 1 - Convolution
classifier.add(Conv2D(32, (3, 3), input_shape=(256, 256, 3), activation='relu'))
# Step 2 - Pooling
classifier.add(MaxPooling2D(pool_size=(2, 2)))
# Adding a second convolutional layer
classifier.add(Conv2D(64, (3, 3), activation='relu'))
classifier.add(MaxPooling2D(pool_size=(2, 2)))
# Adding a third convolutional layer
classifier.add(Conv2D(128, (3, 3), activation='relu'))
classifier.add(MaxPooling2D(pool_size=(2, 2)))
# Adding a fourth convolutional layer
classifier.add(Conv2D(128, (3, 3), activation='relu'))
classifier.add(MaxPooling2D(pool_size=(2, 2)))
# Step 3 - Flattening
classifier.add(Flatten())
# Step 4 - Full connection
classifier.add(Dense(units=512, activation='relu'))
classifier.add(Dropout(0.5)) # Adding dropout
classifier.add(Dense(units=256, activation='relu'))
classifier.add(BatchNormalization()) # Adding batch normalization
classifier.add(Dense(units=2, activation='softmax'))
classifier.summary()
Model summary :
 Model: "sequential"
____________________________________________________________
_____
 Layer (type)                Output Shape              Param
#
============================================================
=====
 conv2d (Conv2D)             (None, 254, 254, 32)      896
                                                                                        49
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
============================================================
=====
Total params: 13219266 (50.43 MB)
Trainable params: 13218754 (50.43 MB)
Non-trainable params: 512 (2.00 KB)
______________________________
                                                                                          50
Dept. of CSE VVCE, Mysore
                       GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
  }}
  .red-bg {{
       background-color: red;
       padding: 10px; /* Adjust the padding as needed */
       margin: 10px; /* Adjust the margin as needed */
       color: white; /* Text color */
  }}
  .green-bg {{
       background-color: green;
       padding: 10px; /* Adjust the padding as needed */
       margin: 10px; /* Adjust the margin as needed */
       color: white; /* Text color */
  }}
  .yellow-bg {{
       background-color: yellow;
       padding: 10px; /* Adjust the padding as needed */
       margin: 10px; /* Adjust the margin as needed */
       color: black; /* Text color */
  }}
  </style>
"""
st.markdown("---")
if st.button("Clear Results"):
  all_results = pd.DataFrame(columns=["Image", "Prediction"])
  all_results.to_csv("results.csv", index=False)
  st.success("Results cleared successfully!")
                                                                                           54
Dept. of CSE VVCE, Mysore
                       GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
  st.stop()
# Main content area
if uploaded_file is not None:
  st.markdown(
  f"""
  <style>
     .dataframe {{
          background-color: white;
          width: 100%; /* Set width to 100% */
          table-layout: fixed;
          padding: 10px; /* Add padding */
     }}
  </style>
                                                                                          55
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
    """,
    unsafe_allow_html=True
)
    # Pie chart
    st.markdown("<h3 style='color: white; background-color: blue'>Pie Chart</h3>",
unsafe_allow_html=True)
    pie_data = all_results['Prediction'].value_counts()
    fig, ax = plt.subplots()
    colors = ['green' if label == 'Normal' else 'red' for label in pie_data.index]
    ax.pie(pie_data, labels=pie_data.index, autopct='%1.1f%%', startangle=90,
colors=colors)
    ax.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
    st.pyplot(fig)
    # Bar chart
    st.markdown("<h3 style='color: white; background-color: blue'>Bar Chart</h3>",
                                                                                          56
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
unsafe_allow_html=True)
  bar_data = all_results['Prediction'].value_counts()
  fig, ax = plt.subplots()
  colors = ['green' if label == 'Normal' else 'red' for label in bar_data.index]
  ax.bar(bar_data.index, bar_data, color=colors)
  ax.set_xlabel('Prediction')
  ax.set_ylabel('Count')
  st.pyplot(fig)
                                                                                         57
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 6
                                          TESTING
6.1 About Testing
Software testing is a critical element of software quality assurance and represents the
ultimate reviews of specification, design and coding. Testing represents interesting anomaly
for the software. During earlier definition and development phases, it was attempted to
build software from an abstract concept to tangible implementation. The testing phase
involves the testing of the developed system using various test data. Preparation of the test
data plays a vital role in the system testing. After preparing the test data the system under
study was tested using those test data. While testing the system, errors were found and
corrected by using the following testing steps and corrections are also noted for future use.
Thus, a series of testing is performed for the proposed system, before the system was ready
for the implementation. Testing is the process of detecting errors. Testing performs a very
critical role for quality assurance and for ensuring the reliability of software. The results of
testing are used later on during maintenancealso The aim of testing is often to demonstrate
that a program works by showing that it has no errors. The basic purpose of testing phase
is to detect the errors that may be present in the program. Hence one should not start testing
with the intent of showing that a program works, but the intent should be to show that a
program doesn’t work.
Testing Objectives
• A good test case is one that has a high probability of finding error, if it exists.
                                                                                             58
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   1. Unit Testing
   2. Integration Testing
   3. System Testing
   4. Acceptance Testing
Validation is the process of checking whether the software product is up to the mark or in
other words product has high level requirements. It is the process of checking the validation
of product that is it checks what we are developing is the right product. it is validation of
actual and expected product. Validation is the dynamic testing. Validation testing is done in
                                                                                           59
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
the testingphase of SDLC. Validation is also done at the maintenance stage. Validation
testing is done tofind the correct way of a process. And also ensuring that the process chosen
is the best. Validation is a costlier affair. If process A is used, after that, process B is found
to be better. The validation testing took the duration of finding the better approach. The
product team does validation testing.
Integration testing:
After the unit testing, we have to perform integration testing. The goal here is to see if
modules can be integrated properly, the emphasis being on testing interfaces between
modules. This testing activity can be considered as testing the design and testing module
interactions. In this project integrating all the modules forms the main system. When
integrating all the modules we have checked whether the integration effects working of any
of the services by giving differentcombinations of inputs with which the two services run
perfectly before Integration. Integration testing is a systematic technique for constructing
the program structure, while at the same timeconducting tests to uncover errors associated
with the interface. All modules are combined in the testing step. Then the entire program
                                                                                               60
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
is tested as a whole.
                                   Table 6.2 Integration Testing
Acceptance testing:
Acceptance Test is performed with realistic data of the client to demonstrate that the
software is working satisfactorily. Testing here is focused on external behavior of the
system; the internal logic of program is not emphasized. Test cases should be selected so
that the largest number of attributes of an equivalence class is exercised at once. The testing
phase is an important part of software development. It is the process of finding errors and
missing operations and also a complete verification to determine whether the objectives are
                                                                                            61
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
                                                                                       62
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 7
Metrics including accuracy, F1score, recall, and precision are used to evaluate the model.
A machine will always generate a result, and unless someone in our model indicates
otherwise, we have no means of knowing if that result is the right one or not. The confusion
matrix, which is composed of four properties, can be used to calculate these metrics.
Accuracy
The model's performance in all classes is gauged by its accuracy. It is beneficial when every
course has equal importance. Divide the total number of forecasts by the total number of
guesses to compute it. Recognize that the accuracy could be deceptive. One example is
when the data are not balanced. When it comes to multiclass classification, accuracy is only
the percentage of correctly categorized items.
                                                                                             63
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Recall
The fraction of correctly identified Positive observations relative to all Positive samples is
used to compute the recall. Positive samples are found in greater quantities when recall is
higher. The number of inaccurate sample classifications has little effect on recall. Recall
also equals 1 if the model accurately classifies all positive data as positive.
                                          𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒
                       𝑅𝑒𝑐𝑎𝑙𝑙 =
                                       𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 + 𝐹𝑎𝑙𝑠𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒
…(7.2)
Precision
                                              𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒
                        𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 =
                                       𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 + 𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒
…(7.3)
Sensitivity
Sensitivity is used to evaluate model performance because it allows us to see how many
positive instances the model was able to correctly identify. A model with high sensitivity
will have fewfalse negatives, which means that it is missing a few of the positive instances.
                                           𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣e
                       Sensitivity =
                                        𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 + 𝐹𝑎𝑙𝑠𝑒 Negative
…(7.4)
                                                                                           64
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Specificity
                                             𝑇𝑟𝑢𝑒 Negative
                       Specificity =
                                       𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 + 𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒
…(7.5)
F1 Score
The F1 score is the harmonic mean of recall and precision. It serves as a statistical tool for
assessing performance. The range of an F-score is zero to zero when neither precision nor
recall are present, and zero to 1.0 when recall and accuracy are perfect. When data is
unbalanced, such as when samples from one class are detected in much more samples than
samples from the other class, the F1 score—a popular performance metric for
classification—is usually selected over alternative metrics.
…(7.6)
                                                                                            65
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Numerous dips and depths in the plotted graph are seen in the illustration of accuracy graph.
Since there are 150 epochs, the accuracy at each epoch is represented on the graph. As we
can see, the accuracy of the model drops suddenly after 100 epochs, but then steadily
increases as the epochs are increased. This will help us understand the performance of the
model better.
The loss graph shows the various loss values at each period. As we have already covered,
when the value of the loss function is changed, the accuracy suddenly decreases. This loss
function graph aids in our ability to forecast learning problems. These issues can lead to
underfitting or an overfitted model.
Figure 7.1 shows us that the accuracy grows with increasing epochs, but declines sharply
after 100 epochs. After epoch 100, we likewise see a steady increase in the model's
accuracy. This will enable us to comprehend the model's performance on a deeper level.
The different loss values at each epoch and changing the value of the loss function causes
an abrupt drop in accuracy. Learning problem prediction is made easier with the help of
this loss function graph. These issues could lead to an overfitted or underfitted model.
                                                                                           66
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   ➢ Macro average: The unweighted average is obtained by first computing metrics for
         every class separately. The macro average precision, recall, and F1-score in this
         instance are all close to 0.969.
   ➢     Weighted average: This method determines the weighted average based on support
         after computing metrics for each class separately. Because all classes have similar
         support, in this instance, weighted average precision, recall, and F1-score are all
         roughly 0.969, which is the same as accuracy.
                        Model                                    Accuracy
                        Proposed model                           96.94
                        ResNet-50 [24]                           94.5
                        Efficient-net CNNs model [9]             88
                        CNN model [3]                            94
                        Inception V3 [14]                        90.4
                        ODG-Net [1]                              95.75
                        KNN [10]                                 95.91
                        googleNet [18]                           83
                        DENet [35]                               91.83
                                            COMPARISION
                  100
                        96.96                                 95.75     95.91
                   95             94.5
       ACCURACY
                                                                                        91.93
                   90                                90.4
                                            88
                   85
                                                                                   83
                   80
                   75
METHODS
                                                                                                68
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Key Concepts:
    1. Color Mapping: The magnitude of data values is represented by color intensity in
        heatmaps. Usually, a gradient color scheme is used, in which darker hues indicate
        greater values and lighter colors indicate lower values.
    2. Matrix Representation: When data is arranged in a matrix format, several variables
        or categories are represented by the rows and columns. A value or data point is
        represented by each cell in the matrix.
    3. Annotations: To offer more context or details about the data that each cell
        represents, heatmaps frequently contain annotations inside each cell. The actual data
        value or any other pertinent information may be included in these annotations.
The element at position (1,1), which is the diagonal from top-left to bottom-right, indicates
the 63 true positives (TP). These are the situations where both the anticipated class and the
actual class are 0.
The element at location (1,2) indicates that there have been two false positives (FP).
                                                                                          69
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
The element at location (2,1) indicates that there have been two false negatives (FN).
The 64 true positives (TP) are represented by the element at location (2,2). These are the
situations where both the anticipated class and the actual class equal 1.
    •   63 instances were correctly classified as class 0.
    •   64 instances were correctly classified as class 1.
    •   2 instances were incorrectly classified as class 1 when they were actually class 0.
    •   2 instances were incorrectly classified as class 0 when they were actually class 1.
Interpretation:
1. Perfect Calibration: The dots on the calibration plot should closely resemble the ideal
line (y = x) in an optimally calibrated model, suggesting that the expected probability match
the observed results.
2. Under-Confidence: The model is under-confident if the points fall below the ideal line,
which means it is underestimating the chance of the occurrences it is forecasting.
3. Over-Confidence: The model is over-confident if the points are above the ideal line,
                                                                                          70
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
4. S-shaped Curves: Calibration plots may occasionally show an S-shaped curve, which
implies systematic biases in the model's predictions over various probability intervals. This
may be a sign of misspecification of the model or problems with the calibration procedures.
Interpretation:
    1. Ideal ROC Curve: An ideal ROC curve would hug the top-left corner of the plot,
        indicating high true positive rates and low false positive rates across all threshold
        settings.
    2. AUC Interpretation: AUC values provide a single metric for assessing the
        discriminatory power of a classification model. Generally, an AUC above 0.5
        indicates better-than-random classification, with higher values indicating better
        model performance.
                                                                                          71
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
A popular library for Python called Streamlit makes it simple to develop web applications.
1. Prepare Your Model: Train and fine-tune your CNN model to identify glaucoma using
a dataset.
Store the trained model's architecture and weights in an HDF5 (.h5) file.
   •   Test Locally: Make sure everything functions as it should by testing your Streamlit
       application locally before deploying.
   •   Using the streamlit run command on your terminal, you may launch the Streamlit
       application and accomplish this.
If you're utilizing Streamlit Sharing, deploy your application by signing up and following
the instructions.
• You'll get a URL once it's deployed, which you can distribute to others.
   •   Distribute Your Application: Once your Streamlit application is up and running, tell
       people about it via its URL.
   •   Through their web browser, they can access and use the glaucoma detection tool.
       Now once the streamlit is launched we can use it in any platform be it PC or android
       smart phones by just using the shared link.
https://glaucoguard-hpwjrvvjsqcdzkybfks2aa.streamlit.app/
                                                                                        73
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Figure 7.7 Launched streamlit app in android phone Figure 7.8 Uploading of selected Fundus image
                                                                                                 74
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
    Figure 7.9 Results shown for a healthy eye     Figure 7.10 Results shown for a glaucomatous
                                                                        eye
                                                                                              75
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   Figure 7.11 Detection Results table displayed in   Figure 7.12 Prediction Chart displayed in android
                   android device.                                         device
                                                                                                   76
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
                                                                                      77
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
App launched on PC
                                                                                      78
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
                                                                                       79
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Figure 7.18 A Pie chart that displays percentage of glaucomatous and healthy eye predictions
Figure 7.19 A Bar chart that displays percentage of glaucomatous and healthy eye predictions.
                                                                                                       80
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Figure 7.20 Button to download the prediction results in a CSV file format.
                                                                                               81
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
CHAPTER 8
CONCLUSION
In summary, our all-encompassing strategy for improving the glaucoma illness prediction
accuracy has produced encouraging outcomes, with the proposed approach obtaining a
remarkable accuracy of 96.94%. Through the application of sophisticated data
augmentation techniques and the integration of various datasets from ACRIMA, DRISTI,
and RIMONE, we have developed a robust system that can reliably detect eyes with
glaucoma.We have successfully tackled issues like imbalanced data and variability in
fundus images by employing convolutional neural networks (CNNs) for feature extraction,
image augmentation, and thorough preprocessing. Moreover, we find that using binary
format images increases both classification accuracy and memory efficiency. Due to its
flexibility in handling various datasets and its strong capacity to generalize to new, untested
data, our model performs better than many other systems now in use. Our methodology's
main steps—from data retrieval to model deployment—showcase a methodical and
exacting approach to glaucoma identification. Going ahead, the great accuracy that our
model has attained highlights its practical application in clinical contexts. Our ultimate goal
is to improve patient outcomes and quality of life by making a substantial contribution to
the early detection and management of glaucoma as we continue to improve and optimize
our methodology.
In addition, we have made our produced model widely accessible and usable by putting it
on Streamlit Share, where anyone may access it without delay. With this deployment,
glaucoma sufferers, researchers, and medical professionals can easily use our product
without having to go through complicated setup processes.We continue our mission to
democratize access to cutting-edge healthcare solutions by making our application
available on Streamlit Share. Now that the glaucoma prediction system is easily accessible
to users via a straightforward web interface, they can facilitate early intervention techniques
and make well-informed judgments. By improving glaucoma early diagnosis and care, this
deployment will eventually help communities globally by bridging the gap between state-
of-the-art research and real-world application.
                                                                                            82
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
                                                                                          83
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
REFERENCES
[5]   “L. Li, M. Xu, H. Liu, Y. Li, X. Wang, L. Jiang, Z. Wang, X. Fan,,” IEEE
      Transactions on Medical Imaging, vol. 39, no. 2, pp. 413–424, 2020.. [Online].
      https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9664528
                                                                                               84
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
[12] J. (. Latif, S. (. Tu and C. Xiao, “ODGNet: a deep learning model for automated optic
     disc localization and glaucoma classification using fundus images,” SN Applied
     Sciences, vol. 4, no. 4. https://link.springer.com/article/10.1007/s42452-022-04984-
     3
[13] P. Mangipudi, H. M. Pandey and A. Choudhary, “Improved optic disc and cup
     segmentation in Glaucomatic images using deep learning architecture,” Multimedia
     Tools and Applications, vol. 80, no. 20, pp. 30,143, 2 Febrauary 2021.
     https://link.springer.com/article/10.1007/s11042-020-10430-6
[16] R. Shinde, “Glaucoma detection in retinal fundus images using U-Net and
     supervised machine learning algorithms,” 17 6 2021. [Online]. Available:
     https://doi.org/10.1016/j.ibmed.2021.100038.
[18] S. I. A. &. D. M. K. Surya M., “Using novel blood vessel tracking and bend point
     detection, an automated and robust image processing algorithm for glaucoma
     diagnosis from fundus images,” 27 2 2018. [Online]. Available:
     https://doi.org/10.1016/j.ijmedinf.2017.11.015.
[19] M. Tabassum, “CDED-Net: Joint Segmentation of Optic Disc and Optic Cup for
     Glaucoma         Screening,”  19     10    2020.      [Online].  Available:
     https://doi.org/10.1109/ACCESS.2020.2998635. [Accessed 2020].
[21] L. Abdel-Hamid, “Glaucoma Detection from Retinal Images Using Statistical and
     Textural      Wavelet     Features,”    2    2    2019.   [Online]. Available:
     https://link.springer.com/article/10.1007/s10278-019-00189-0.
                                                                                        85
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
[23] N. P. P. N. &. R. P. V. Patil, “Convolution neural network and deep belief network
     (DBN) based automatic detection and diagnosis of Glaucoma,” 28 6 2021. [Online].
     Available: https://doi.org/10.1007/s11042-021-11087-5.
[24] A. S. a. S. Serte, “Transfer Learning for Early and Advanced Glaucoma Detection
     with Convolutional Neural Networks,” 19 11 2019. [Online]. Available:
     https://doi.org/10.1109/TIPTEKNO.2019.8894965.
[28] R. A. e. al., “Optic Disk and Cup Segmentation Through Fuzzy Broad Learning
     System for Glaucoma Screening,” 28 4 2021. [Online]. Available:
     https://doi.org/10.1109/TII.2020.3000204.
[32] J. C. e. al., “Superpixel Classification Based Optic Disc and Optic Cup Segmentation
     for      Glaucoma       Screening,”      29    6     2013.     [Online].   Available:
     https://doi.org/10.1109/TMI.2013.2247770.
[33] M. Nawaz, “An efficient deep learning approach to automatic glaucoma detection
     using optic disc and optic cup localization,” 7 1 2022. [Online]. Available:
     https://doi.org/10.3390/s22020434. [Accessed 9 1 2022].
                                                                                        86
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
[39] O. C. Devecioglu, “Real-time glaucoma detection from digital fundus images using
     selfonns,”          4       10        2021.         [Online].         Available:
     https://doi.org/10.1109/ACCESS.2021.3118102.
[40] W. Liao, “Clinical interpretable deep learning model for glaucoma diagnosis.,” 2019.
     [Online]. Available: https://doi.org/10.1109/JBHI.2019.2949075.
[42] A. Orbach, “Qualitative evaluation of the 10-2 and 24-2 visual field tests for
     detecting central visual field abnormalities in glaucoma.,” 21 2 2021. [Online].
     Available: https://doi.org/10.1016/j.ajo.2021.02.015.
[46] K. E. Kim, “Development and validation of a deep learning system for diagnosing
     glaucoma using optical coherence tomography,” 9 7 2020. [Online]. Available:
     https://doi.org/10.3390/jcm9072167.
                                                                                         87
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
      =RqoYSQC3JNYAAAAA:J6cxug2O1JDTu0U5Pma1zS8FiB_ccauAfr_m3awEP0
      Di_bLatol7Dbp1mc4tcjBNMFMoHSVhcbWh.
[49] H. Fu, “Glaucoma detection based on deep learning network in fundus image,” 20 9
     2019. [Online]. Available: https://doi.org/10.1007/978-3-030-13969-8_6.
[50] J. M. Ahn, “A deep learning model for the detection of both advanced and early
     glaucoma using fundus photography,” 27 11 2018. [Online]. Available:
     https://doi.org/10.1371/journal.pone.0207982.
[51] G. An, “Glaucoma diagnosis with machine learning based on optical coherence
     tomography and color fundus images.,” 18 2 2019. [Online]. Available:
     https://www.hindawi.com/journals/jhe/2019/4061313/.
[52] Z. Li, “Efficacy of a deep learning system for detecting glaucomatous optic
     neuropathy based on colour fundus photographs.,” 2 3 2018. [Online]. Available:
     https://doi.org/10.1016/j.ophtha.2018.01.023.
[53] F. Grassmann, “A deep learning algorithm for prediction of age-related eye disease
     study severity scale for age-related macular degeneration from color fundus
     photography,”          10         4       2018.       [Online].         Available:
     https://doi.org/10.1016/j.ophtha.2018.02.037.
[55] N. Akter, “Glaucoma diagnosis using multi-feature analysis and a deep learning
     technique.,” 16 5 2022. [Online]. Available: https://doi.org/10.1038/s41598-022-
     12147-y
                                                                                      88
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
APPENDIX
Introduction to Python
History of Python
At the Netherlands' National Research Institute for Mathematics and Computer Science in
the late eighties and early nineties, Guido van Rossum created the programming language
Python. Numerous additional languages, such as ABC, Modula-3, C, C++, Algol-68,
SmallTalk, Unix shell, and other scripting languages, are derived from Python.
Copyright protects Python. The GNU General Public License (GPL) is now used to license
Python source code, just like it does Perl. Although a core development team at the institute
currently manages Python, Guido van Rossum continues to play a crucial role in steering
its direction.
                                                                                           89
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Python Features
   1. Simple Structure, Few Keywords, and Clearly Defined Syntax Make Python an
       Easy Learner. This facilitates the student's rapid language acquisition.
       Readability – Python code is easier to understand and more observable.
   2. Easy to maintain – The source code of Python is not too difficult to maintain.
       A large standard library: The majority of Python's library is cross-platform
       compatible and highly portable on Windows, Macintosh, and UNIX systems.
       Interactive Mode – Python comes with an interactive mode that lets you test and
       debug small portions of code interactively.
   3. Portable: Python has the same interface across all hardware platforms and can
       operate on a wide range of them.
   4. Extendable: The Python interpreter can have low-level modules added to it.
       Programmers can enhance or modify these modules to make their tools more
       effective.
       Interfaces to all major commercial databases are available for Python.
       GUI Programming: Python facilitates the creation and porting of GUI programs to
       a variety of system calls, libraries, and Windows systems, including Macintosh,
       Windows MFC, and Unix's X Window system.
   5. Scalable – Python offers larger projects more organization and assistance than shell
       programming.
   6. It may be used to create big programs by compiling it to byte-code or as a scripting
       language; it supports OOP as well as functional and structured programming
       methodologies.
       It allows dynamic type checking and offers very high-level dynamic data types.
       Automatic garbage collection is supported, and integration with C, C++, COM,
       ActiveX, CORBA, and Java is simple.
   7. Python is a well-liked platform for production system development and research. It
       is a large language with many modules, packages, and libraries that offer several
       approaches to accomplish a task.
   8. Data science and analysis use Python and its libraries, such as NumPy, SimpleITK,
       Tensorflow, Keras, and Pandas. They are also often utilized in the development of
       machine learning algorithms that are scalable. Popular machine learning methods
       like clustering, regression, classification, and recommendation are implemented in
       Python.
       Python provides a pre-built framework for efficiently completing data mining
                                                                                       90
Dept. of CSE VVCE, Mysore
                      GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
Machine learning:
Artificial intelligence, machine learning, and data science are three of the most popular
subjects in the computer industry right now. Machine learning is becoming more and more
in demand as data mining and Bayesian analysis gain popularity.
The field of machine learning studies how to program systems so they can automatically
pick up new skills and get better with time. In this context, learning entails identifying and
comprehending the input data and making defensible decisions in light of it. It is quite
challenging to weigh every option based on every potential input. Algorithms that apply
the concepts of statistical science, probability, logic, mathematical optimization,
reinforcement learning, and control theory are created to tackle this challenge by
constructing knowledge from a given set of data and prior experience.
Deep Learning:
A family of machine learning algorithms known as "deep learning" gradually extracts
higher-level information from the raw input by using many layers. In image processing, for
instance, lower layers might recognize boundaries, while higher layers might identify
concepts that are important to humans, like faces, characters, or numbers.
                                                                                           91
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   •   weather,
   •   stock market patterns.
The following procedures are involved in a machine learning project:
   •   Problem definition,
   •   data preparation,
   •   algorithm evaluation,
   •   result improvement
   •   result presentation
Working through a project from beginning to end and covering the essential tasks, such as
loading data, summarizing data, assessing algorithms, and generating some predictions, is
the best method to get started with Python for machine learning. This provides you with a
repeatable technique that you may apply to dataset after dataset. To enhance the outcomes,
you can also input more data. Packages, Libraries, and Datasets. A foundational
understanding of Python programming is required to comprehend machine learning.
Furthermore, the following libraries and packages are frequently used to carry out different
machine learning tasks:
1. NumPy: This module handles arrays in a general-purpose manner. It offers tools for
manipulating these arrays as well as a high-performance multidimensional array object.
This is the core Python module for scientific computing. It has a number of characteristics,
some of which are significant:
   •   An effective N-dimensional array object;
   •   Complex (broadcasting) functions;Instruments for combining C/C++ and Fortran
       code;
   •   Practical functions for linear algebra, Fourier transform, and random number
       generation.
2. Pandas: Wes McKinney created the sophisticated data manipulation program known as
Pandas. The Data Frame is its primary data structure, and it is based on the Numpy package.
Using rows of observations and columns of variables, data frames let you organize and
work with tabular data.
                                                                                         92
Dept. of CSE VVCE, Mysore
                     GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
academics to push the boundaries of machine learning while making it simple for
developers to create and implement ML-powered apps.
5. Simple ITK: It gives ITK an abstraction layer that makes it possible for consumers and
developers to easily access the robust capabilities of the Insight Toolkit for biomedical
image analysis.
                                                                                        93
Dept. of CSE VVCE, Mysore
                       GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
   •   Sharing and Collaboration: Like Google Docs, Colab enables users to share their
       notes with others and work together in real time. Users can also leave feedback and
       comments on particular cells.
   •   GitHub Integration: Version control and teamwork processes are streamlined by the
       ease with which Colab notebooks can be saved to and loaded from GitHub
       repositories.
All things considered, Google Colab is well-liked among data scientists, researchers, and
students since it offers a practical and strong environment for data analysis, machine
learning experiments, and collaborative research.
Streamlit
An open-source Python toolkit called Streamlit makes it possible to create interactive web
apps for data science and machine learning projects quickly. With the use of Python scripts,
users can now easily design web-based interfaces without requiring complicated front-end
frameworks or web programming experience.
Streamlit offers a free deployment tool called Streamlit Share, which makes it simple for
users to share, distribute, and work together on Streamlit apps. It makes it easier to launch
Streamlit web apps to the cloud, allowing them to be accessed by more people without
requiring   complicated       infrastructure   administration     or   server   configuration.
Among Streamlit Share's primary attributes are:
   •   Free Hosting: Users can launch their apps to the cloud at no cost thanks to Streamlit
       Share's free hosting service for Streamlit applications.
   •   Easy Deployment: Streamlit Share offers an easy-to-understand deployment
       procedure. With just a few commands and the Streamlit CLI (Command Line
       Interface), users may launch their Streamlit apps to the cloud.
   •   Automatic Updates: To guarantee that users always have access to the most recent
       version of the program, Streamlit Share automatically updates deployed apps
       whenever modifications are made to the underlying code or data.
   •   Cooperation and Sharing: Users can share deployed applications with colleagues or
       the general public with ease thanks to Streamlit Share. Applications installed on
       Streamlit Share can be accessed by users using a special URL, which enables them
       to share their work with others without needing to download and install extra
       software.
   •   Secure Access Control: Users can limit access to their deployed applications by
       utilizing the access control tools provided by Streamlit Share. Users have the option
                                                                                           94
Dept. of CSE VVCE, Mysore
                    GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
       to grant access to particular people or groups or to the whole public for their
       applications.
   •   Scalability: Deployed apps may manage a high volume of users and requests
       without experiencing performance degradation because Streamlit Share is built on
       top of scalable cloud infrastructure.
   •   GitHub Integration: Users can launch apps straight from their GitHub repositories
       thanks to Streamlit Share's smooth integration with GitHub. The deployment
       procedure is streamlined by this integration, which also makes it simple to maintain
       deployed apps in sync with their associated GitHub projects.
                                                                                        95
Dept. of CSE VVCE, Mysore
                   GlaucoGuard: Gaining Clarity in Glaucoma Diagnosis Using Deep Learning
ABBREVIATIONS
                                                                                      96
Dept. of CSE VVCE, Mysore