Indonesian
J
our
nal
of
Electrical
Engineering
and
Computer
Science
V
ol.
37,
No.
3,
March
2025,
pp.
1830
∼
1844
ISSN:
2502-4752,
DOI:
10.11591/ijeecs.v37.i3.pp1830-1844
❒
1830
RNN
Diabetic
framew
ork
f
or
identifying
diabetic
ey
e
diseases
Arwa
Albelaihi
1,2
,
Dina
M.
Ibrahim
1,3
1
Department
of
Information
T
echnology
,
Colle
ge
of
Computer
,
Qassim
Uni
v
ersity
,
Buraydah,
Saudi
Arabia
2
School
of
Computing,
Uni
v
ersity
of
Leeds,
Leeds,
United
Kingdom
3
Department
of
Computers
and
Control
Engineering,
F
aculty
of
Engineering,
T
anta
Uni
v
ersity
,
T
anta,
Egypt
Article
Inf
o
Article
history:
Recei
v
ed
Jan
9,
2024
Re
vised
Oct
3,
2024
Accepted
Oct
7,
2024
K
eyw
ords:
Bi-GR
U
Deep
learning
Diabetic
e
ye
disease
GR
U
Multi-class
classication
Recurrent
neural
netw
orks
Retinal
fundus
images
ABSTRA
CT
Man
y
areas
of
image
identication
and
classication
for
medical
imaging
di-
agnostics
ha
v
e
greatly
beneted
from
deep
learning
(DL).
Diabetic
retinopa-
th
y
(DR)
will
become
the
most
common
cause
of
blindness
w
orldwide,
mak-
ing
diabetes
a
major
threat
to
public
healt
h.
This
research
proposes
an
auto-
mated
identication
system
using
deep
recurrent
neural
netw
orks
(RNNs)
to
identify
and
classify
four
cate
gories
of
diabetic
e
ye
diseases:
DR,
cataract,
glaucoma,
and
diabetic
macular
edema
(DME).
W
e
use
three
dif
ferent
model
architectures
based
on
RNN
and
their
types,
we
called
our
proposed
system
RNN
Diabetic
frame
w
ork.
These
models
are
combined
with
one
of
the
com-
monly
used
architectures
that
support
suf
cient
accurac
y
and
speed
for
the
model
which
is
residual
netw
ork
(ResNet)152V2.
The
three
model
architectures
are
RNN+ResNet152V2,
g
ated
recurrent
unit
(GR
U)+ResNet152V2,
and
bidi-
rectional
GR
U
(Bi-GR
U)+ResNet152V2.
The
proposed
models
were
assessed
as
collected
datasets:
DIARETDB0,
DIARETDB1,
messidor
,
HEI-MED,
ocu-
lar
,
and
retina.
A
full
analysis
and
e
v
aluation
of
these
three
deep
RNN
architec-
tures
are
presented.
The
e
xperiments
sho
wed
that
the
Bi-GR
U+ResNet152V2
model
w
ork
ed
better
than
the
other
tw
o
proposed
models.
In
addition,
we
com-
pare
these
three
proposed
models
with
the
pre
vious
studies
and
nd
that
the
pro-
posed
Bi-GR
U+ResNet152V2
m
odel
achie
v
es
the
highest
result
s
with
accurac
y
equal
to
99.8%,
98.1%
sensiti
vity
,
98.6%
specicity
,
99.8%
precision,
99.8%
F1
score,
and
99.8%
areas
under
the
curv
e
(A
UC).
This
is
an
open
access
article
under
the
CC
BY
-SA
license
.
Corresponding
A
uthor:
Dina
M.
Ibrahim
Department
of
Information
T
echnology
,
Colle
ge
of
Computer
,
Qassim
Uni
v
ersity
Buraydah,
Saudi
Arabia
Email:
d.hussein@qu.edu.sa
1.
INTR
ODUCTION
Deep
learning
(DL)
is
utilized
in
man
y
areas
to
nd
ne
w
w
ays
to
solv
e
important
problems,
and
it
does
well
on
tests
that
sort
things
into
groups.
Applications
of
articial
intelligence
(AI)
tools
and
techniques
are
appropriate
in
the
medical
eld.
One
of
the
21
st
century’
s
most
potently
re
v
olutionary
technologies
is
AI.
Strong
machine
learning
(ML)
tools
and
methods
lik
e
deep
con
v
olutional
netw
orks,
generati
v
e
adv
ersarial
netw
orks
(GANs),
con
v
olutional
neural
netw
orks
(CNNs),
recurrent
neural
netw
orks
(RNNs),
and
articial
neural
netw
orks
(ANNs)
were
used
to
bring
about
this
change.
DL
has
outperformed
AI
in
speech
recognition,
picture
characterisation,
and
natural
language
creation.
J
ournal
homepage:
http://ijeecs.iaescor
e
.com
Evaluation Warning : The document was created with Spire.PDF for Python.
Indonesian
J
Elec
Eng
&
Comp
Sci
ISSN:
2502-4752
❒
1831
In
se
v
eral
areas
of
medical
imaging
diagnostics,
including
image
recognition
and
classication,
DL
has
pro
v
en
to
be
an
e
f
fecti
v
e
and
signicant
te
chnique.
By
using
fundus
images
to
assess
and
diagnose
e
ye
disorders,
DL
can
be
used
to
detect
and
classify
e
ye
diseases,
including
diabetic
e
ye
disease.
Under
the
general
cate
gory
of
diabetic
e
ye
illness
are
diabetic
retinopath
y
(DR),
cataract,
glaucoma,
and
diabetic
macular
edema
(DME)
[1],
[2].
Diabetic
e
ye
disease
can
cause
serious
vision
loss
or
e
v
en
cause
blindness
in
patients
between
the
ages
of
20
and
74.
W
ithout
early
detection
of
diabetic
e
ye
disease,
vision
loss
cannot
be
pre
v
ented.
If
identied
early
,
90%
of
diabetics
can
pre
v
ent
diabetic
e
ye
injury
.
The
goal
of
this
research
is
to
impro
v
e
diabetic
e
ye
disease
(DL)
detection
models.
T
o
be
emplo
yed,
fundus
images
of
diabetic
e
ye
diseases
must
be
g
athered
in
DL
models.
After
that,
se
v
eral
image
preparation
methods
are
applied
to
the
images.
Utilizing
pre-processed
images,
features
are
automa
tically
e
xtracted,
and
analysis
rules
are
learned
and
e
v
aluated
in
the
literature
with
a
focus
on
using
ML
for
respiratory
disease
de-
tection
and
classication.
Incl
uding
the
most
important
articles
released
from
2018
till
the
end
of
2021.
These
ndings
help
researchers
plan
their
w
ork
and
pro
vi
d
e
a
useful
contrib
ution.
Therefore,
we
disco
v
ered
that
Ibrahim
et
al.
[3]
used
transfer
learning
(TL)
with
the
V
GG19-CNN,
ResNet152V2,
ResNet152V2+g
ated
re-
current
uni
t
(GR
U),
and
ResNet152
V2+bidirectional
GR
U
(Bi-GR
U)
architectures
for
multiclass
classication
on
a
combination
of
chest
X-ray
and
computed
tomograph
y
(CT)
scan
images.
Their
research
yielded
a
wealth
of
adv
ancements
that
encouraged
us
to
use
GR
U
and
Bi-GR
U
for
the
multiclassication
of
diabetic
ocular
disorders,
particularly
since
these
models
are
no
v
el
to
this
eld.
Additionally
,
Minarno
et
al.
[4]
found
that
using
some
augmentation
procedures
along
with
Ef
cientNetB7
models
increases
the
cl
assication
accurac
y
for
diabetic
e
ye
disorders.
P
atients
with
diabetes
are
among
the
most
common
illness
groups
in
the
w
orld
today
.
V
isual
loss
can
result
from
diabetic
fundus
disorders,
which
are
the
primary
cause
of
blindness.
V
isual
function
is
currently
af
fected
by
fundus
illnesses
such
as
DR,
glaucoma,
cataracts,
and
others
[5]–[10].
CNN’
s
outstanding
feature
learning
capabilities
ha
v
e
allo
wed
it
to
e
xcel
in
the
re
alm
of
fundus
imaging.
Numerous
deep-learning
architec-
tures
that
ha
v
e
dem
o
ns
trated
e
xceptional
performance
in
identifying
certain
diabetic
e
ye
conditions
ha
v
e
been
documented
in
the
literature.
T
o
the
best
of
our
kno
wledge,
the
cate
gorization
paradigm
of
the
four
diabetes-
related
disorders
(DR,
DME,
glaucoma,
and
cataract)
had
not
been
signicantly
altered
before
the
start
of
our
study
.
Ho
we
v
er
,
by
the
end
of
2021,
Sarki
et
al.
[11]
had
pro
vided
a
frame
w
ork
for
those
four
disorders’
classication.
The
y
only
used
one
CNN
model
in
their
research,
though,
and
the
dataset
the
y
used
re
v
ealed
class
disparities.
Their
accurac
y
of
81.33%
is
still
re
g
arded
as
lo
w
when
compared
to
the
latest
studies
on
DL
classications.
Pre
vious
studies
on
cataract
disease
did
not
suf
ciently
e
xamine
cataract
prediction
and
classica
tion
[12].
T
o
cate
gorize
the
cataract
disease
indi
vidually
,
there
w
as
also
independent
research.
DME
disease
iden-
tication
w
as
suggested
as
a
research
g
ap
in
[13]
because
it
is
e
xtremely
li
k
ely
to
indicate
that
the
retina
is
de
v
eloping
DR.
This
information
helps
researchers
better
understand
the
causes
of
retina-based
disorders.
The
second
DL
model
focuses
on
training
datasets
with
unequal
distrib
utions
of
cl
asses
across
v
arious
diseases
and
limited
data.
The
ndings
of
the
training
set
may
not
be
accurate
enough
to
be
deemed
satisf
actory
if
it
is
small.
It
is
tak
en
into
c
on
s
ideration
as
a
potential
remedy
to
apply
traditional
data
augmentation
techniques
as
enhancing
methods.
This
study
in
v
estig
ated
the
ef
fects
of
combining
RNNs
with
residual
netw
orks
(ResNet)
in
identifying
diabetic
e
ye
diseases.
While
earlier
studies
ha
v
e
e
xplored
the
impact
of
only
ResNet,
the
y
ha
v
e
not
e
xplicitly
addressed
its
inuence
on
increasing
the
perf
o
r
mance
of
identifying
diabetic
e
ye
diseases.
The
main
contrib
utions
of
this
study
are:
−
Presenting
the
RNN
diabetic
frame
w
ork,
a
multi-classication
DL
model
designed
to
detect
and
classify
the
four
main
e
ye
disorders
associated
with
diabetes:
glaucoma,
cataract,
DME,
and
DR.
−
Illustrating
the
inuence
of
combining
RNNs
with
ResNet
in
identifying
diabetic
e
ye
diseas
es
by
using
ResNet152V2,
GR
U,
and
Bi-GR
U.
−
Analyzing
these
DL
architectures
are
pro
vided
using
four
classes
of
public
fundus
datasets
(DR,
DME,
glaucoma,
and
cataract).
−
Ev
aluating
the
suggested
w
ork
by
comparing
it
s
performance
metrics
to
those
of
v
arious
models
gi
v
en
in
prior
studies
for
detecting
and
classifying
diabetic
e
ye
diseases.
The
paper’
s
remaining
outline:
section
2
summarizes
the
literature
re
vie
w
,
whereas
section
3
details
the
study’
s
materials
and
techniques.
Section
4
presents
the
comparati
v
e
analysis
and
discussion.
In
section
5,
the
paper
concludes.
RNN
Diabetic
fr
ame
work
for
identifying
diabetic
e
ye
diseases
(Arwa
Albelaihi)
Evaluation Warning : The document was created with Spire.PDF for Python.
1832
❒
ISSN:
2502-4752
2.
LITERA
TURE
REVIEW
In
this
section,
we
present
a
fe
w
related
deep
neural
netw
ork
studies
on
diabetic
e
ye
problems.
W
e
found
that
careful
e
v
aluation
of
the
architecture
and
the
data
input
is
necessary
for
creating
an
ef
fecti
v
e
neural
netw
ork
classier
.
Man
y
studies
ha
v
e
been
conducted
in
the
literature,
as
sho
wn
in
[14]–[17],
re
g
arding
using
DL
for
classifying
diabetic
e
ye
illness
utilizing
fundus
images.
More
people
with
diabetic
e
ye
disease
are
presented
in
[18]–[22]
adopt
the
TL
approach.
Rather
than
using
random
generation,
the
TL
initializes
the
parameters
based
on
prior
learning.
The
rst
layers
pick
up
on
e
xtracting
essential
elements
lik
e
edges,
te
xtures,
and
intuiti
v
ely
.
The
top
layers,
analogous
to
blood
v
essels
and
e
xudates,
are
more
particular
to
the
task.
The
TL
is
useful
in
cases
where
there
is
not
enough
data
to
train
a
neural
netw
ork
from
the
be
ginning
[23]–[29].
Three
CNN
models
DenseNet,
ResNet50,
and
V
GG16
were
compared
by
P
an
et
al.
[30]
on
four
dif
ferent
cate
gories
of
DR
lesions:
microaneurysms,
laser
scars,
leakages,
and
non-per
fusion
re
gions
(NP).
4,067
fundus
uorescein
angiograph
y
images
from
435
e
yes,
218
left
e
yes
and
217
right
e
yes
were
collected
into
databases
by
them.
In
terms
of
computation,
DR
lesion
identication
and
the
procedure
were
determi
ned
to
be
ef
cient.
According
to
e
xperimental
results,
DenseNet
is
a
useful
model
for
automatically
recognizing
and
classifying
retinal
lesions
in
multi-label-classied
fundus
uorescein
angi
og
r
aph
y
(FF
A)
images.
Ne
v
ertheless,
because
microaneurysms
are
often
misclassied
due
to
the
widespread
presence
of
uorescein,
the
procedure
is
not
v
ery
accurate
in
identifying
them.
Samanta
et
al.
[31]
introduced
a
TL-based
CNN
architecture
for
color
fundus
photograph
y
,
which
performs
relati
v
ely
well
in
identifying
DR
from
hard
e
xudates,
blood
v
essels,
and
te
xture
on
a
much
smaller
dataset.
The
dataset
w
as
trained
using
their
model
on
four
classes
(no
DR,
mild
DR,
moderate
DR,
and
proliferati
v
e
DR)
and
reached
a
Cohen’
s
Kappa
score
of
0.8836
on
the
v
alidation
set
and
0.9809
on
the
training
set.
Their
model
uses
se
v
eral
architectures
,
such
as
Inception
v1,
Inception
v2,
Inception
v3,
Xception,
V
GG16,
ResNet-50,
DenseNet,
and
Ale
xNet.
Zhang
et
al.
[32]
presented
a
DeepDR
frame
w
ork
for
DR
detection.
DeepDR
acti
v
ely
detects
the
e
xistence
and
se
v
erity
of
DR
from
fundus
images
by
ensemble
learning
and
TL,
using
se
v
eral
transfer
and
ensemble
learning
methods.
Additionally
,
the
authors
introduced
a
ne
w
dataset
for
DR
images
called
macula-
centered
retinal
fundus
images
(13,767
images
of
1,872
patients).
The
proposed
netw
ork
achie
v
ed
97.5%
sensiti
vity
with
a
specicity
of
97.7%.
Ho
we
v
er
,
their
model
needs
to
be
assessed
with
a
more
comple
x
and
lar
ger
dataset.
Using
a
small
dataset,
Badah
et
al.
[23]
de
v
eloped
a
model
to
detect
hard
e
xudates
using
support
v
ector
machine
(SVM),
a
multilayer
perceptron
netw
ork.
The
y
found
that
CNN
is
not
the
best
classier
for
hard
e
xudate,
b
ut
it
does
perform
well.
Moreo
v
er
,
good
outcome
s
in
challenging
e
xtraction
can
be
obtained
by
combining
ef
cient
classiers
with
image-processing
methods.
A
recent
study
demonstrated
the
application
of
CNN
based
on
the
ResNet152
model
in
conjunction
with
other
ML
classiers
such
as
SVM,
K-nearest
neighbors
(KNNs),
Nai
v
e
Bayes,
multi-l
ayer
perceptron,
decision
tree,
and
random
forest
to
identify
infections
causing
glaucoma
in
patients.
Furthermore,
Dipu
et
al.
[10],
The
ODIR
dataset
w
as
classied
using
four
TL-based
models.
The
ac-
curac
y
of
the
models
w
as
97.23%
for
V
GG-16,
90.85%
for
ResNet-34,
94.32%
for
MobileNetV2,
and
93.82%
for
Ef
cientNet.
CNN
can
train
discriminati
v
e
features
with
an
attention
module
for
free,
thanks
to
the
design
proposed
in
[20].
The
y
found
multiple
common
labels
for
a
patient’
s
left
and
right
fundus
image
pairings,
which
allo
wed
them
to
address
the
class
balancing
problem
in
the
highly
unbalanced
ODIR
dataset.
Bhima
v
arapu
and
Battineni
[25],
an
e
n
ha
n
c
ed
acti
v
ation
function
w
as
suggested
for
using
fundus
images
to
diagnose
DR.
This
function
automatically
lo
wers
loss
and
processing
time
in
the
dif
ferent
CNN
models.
T
o
cate
gorize
DR
images,
four
datasets
DRIVE,
CHASE,
DIARETDB0,
and
Kaggle
were
tak
en
into
consideration.
The
cur
rent
acti
v
ation
functions
used
were
scaled
e
xponential
linear
unit
(SELU),
rectied
linear
unit
(ReLU),
Sigmoid,
and
e
xponential
linear
unit
(ELU).
On
the
Kaggle
dataset,
ResNet-152
has
the
greatest
accurac
y
(99.41%).
Butt
et
al.
[18]
suggests
utilizing
TL
to
e
xtract
fund
picture
features
using
ResNet-18
and
GoogleNet
models
to
correct
class
imbalance
in
a
public
dataset.
Similarly
,
[19],
[26]
enhances
picture
quality
with
a
h
ybrid
DL
classier
,
utilizing
ResNet50-based
architecture.
T
able
1
sho
ws
a
summary
of
studies
that
used
dDL
methods,
including
ho
w
the
y
w
ork
ed
and
ho
w
well
the
y
classied
images
of
the
fundus
that
sho
w
diabetic
diseases
using
v
arious
models
of
ResNet.
3.
MA
TERIALS
AND
METHODS
Our
mission
is
to
e
v
aluate
multiple
DL
models
for
detecting
these
four
diabetes-related
ocular
prob-
lems.
Our
dataset
will
be
compiled
using
data
sourced
from
six
separate
open-source
databases.
Once
images
Indonesian
J
Elec
Eng
&
Comp
Sci,
V
ol.
37,
No.
3,
March
2025:
1830–1844
Evaluation Warning : The document was created with Spire.PDF for Python.
Indonesian
J
Elec
Eng
&
Comp
Sci
ISSN:
2502-4752
❒
1833
ha
v
e
been
collected,
the
y
under
go
se
v
eral
preprocessing
steps.
Once
the
dataset
has
been
completed,
the
pre-
trained
ResNet152V2
model
is
used
to
classify
each
disease
using
three
dif
ferent
models.
There
are
also
RNN
models
of
the
GR
U
and
the
Bi-GR
U
that
are
link
ed
to
ResNet152V2.
Hence,
we
named
the
system
we
sug-
gested
RNN
Diabetic
frame
w
ork.
Figure
1
illustrates
a
summary
of
our
proposed
RNN
Diabetic
frame
w
ork
methodology
.
T
able
1.
Summary
of
classication-based
methods
using
dif
ferent
models
of
ResNet
and
their
corresponding
measures
in
pre
vious
studies
Study
Datas
et
DL
model
Performance
[30]
Kaggle
ResNet50-I
Acc=81.40%
Spc=87.9%
Sen=59.0%
A
UC=85.2%
ResNet50-II
Acc=90.97%
Spc=92.7%
Sen=97.6%
A
UC=92.31%
ResNet50-III
Acc=95.85%
Spc=98.8%
Sen=70.4%
A
UC=96.04%
ResNet50-IV
Acc=91.15%
Spc=95.4%
Sen=69.7%
A
UC=93.51%
[25]
DIRA
TEDB0
ResNet-50
Acc=93.54%
Pre=99.43%
Sen=95.27%
F1=98.42%
Spe=98.32%
A
UC=89%
ResNet-152
Acc=96.64%
Pre=99.53%
Sen=97.96%
F1=99.15%
Spe=98.79%
A
UC=97%
Kaggle
ResNet-50
Acc=94.64%
Pre=95.74%
Sen=94.24%
F1=97.72%
Spe=96.86%
A
UC=93%
ResNet-152
Acc=99.41%
Pre=99.89%
Sen=98.28%
F1=99.93%
Spe=99.94%
A
UC=98%
DRIVE
ResNet-50
Acc=92.44%
Pre=94.83%
Sen=93.72%
F1=95.88%
Spe=95.27%
A
UC=93%
ResNet-152
Acc=97.84%
Pre=99.68%
Sen=98.45%
F1=99.57%
Spe=99.26%
A
UC=94%
CHASE
ResNet-50
Acc=93.83%
Pre=95.73%
Sen=93.22%
F1=94.68%
Spe=96.95%
A
UC=96%
ResNet-152
Acc=99.05%
Pre=99.94%
Sen=98.45%
F1=99.89%
Spe=99.59%
A
UC=97%
[10]
ODIR
ResNet34
Acc=90.85%
Pre=93.7%
Sen=93.17%
F1=92.65%
[20]
ODIR
InceptionResNet
Acc=97.38%
F1=94.58%
Sen=96.08%
A
UC=96.08%
Pre=94.28%
3.1.
Stage
1:
datasets
f
or
the
study
3.1.1.
Data
collection
Numerous
sources
of
fundus
images
were
accessed
and
compiled
for
our
e
xperiments.
Included
in
t
his
group
are
DME,
DR,
cataract,
and
glaucoma.
Initially
,
we
chose
219
i
mage
datasets
from
DIARETDB0
and
DIARETDB1
[33]
for
DR.
Second,
for
DME
with
151
images
and
169
images,
respecti
v
ely
,
we
used
Messidor
[34]
and
HEI-MED
[35].
The
ODIR
dataset
[36]
is
the
third
source
of
the
data
set
and
includes
information
on
se
v
eral
classications
of
e
ye
diseases.
F
or
cataracts,
we
used
312
images,
and
for
glaucoma,
we
used
178
images.
The
nal
dataset
used
for
both
glaucoma
and
cataracts
is
a
retina
dataset
consisting
of
99
and
100
pictures,
respecti
v
ely
,
according
to
[37]–[49].
412,
320,
277,
and
219
im
ages
for
cataract,
DME,
glaucoma,
and
DR,
respecti
v
ely
,
are
the
results
of
the
datasets
that
were
g
athered.
The
datasets
that
were
g
athered
yielded
a
total
of
1,228
images,
which
were
then
randomly
split
into
training
and
v
ali
d
a
tion
sets.
The
collected
datasets
yielded
412,
320,
277,
and
219
pictures
for
cataract,
DME,
glaucoma,
and
DR,
respecti
v
ely
as
sho
wn
in
T
able
2.
From
the
datasets,
1,228
photos
were
randomly
separated
into
training
and
v
alidation
sets.
RNN
Diabetic
fr
ame
work
for
identifying
diabetic
e
ye
diseases
(Arwa
Albelaihi)
Evaluation Warning : The document was created with Spire.PDF for Python.
1834
❒
ISSN:
2502-4752
Figure
1.
The
methodology
of
our
proposed
RNN
Diabetic
frame
w
ork
T
able
2.
Dataset
details
for
DR,
cataract,
glaucoma,
and
DME
classes
Disease
Dataset
images
T
otal
DIARETDB0
100
DR
DIARETDB1
119
219
Messidor
151
DME
HEI-MED
169
320
ODIR
312
Cataract
Retina
100
412
ODIR
178
Glaucoma
Retina
99
277
3.1.2.
Dataset
pr
e-pr
ocessing
Preparing
a
dataset
to
satisfy
the
demands
of
a
DL
model
is
commonly
achie
v
ed
through
pre-processing.
Distinct
pre-processing
stages
in
the
input
images
of
our
model.
The
dataset
is
di
vided
into
four
classications:
DR,
cataract,
glaucoma,
and
DME,
as
the
initial
step
in
the
process.
JPEG,
PNG,
GIF
,
BMP
,
and
TIFF
are
found
among
the
image
formats
that
T
ensorFlo
w
does
not
support.
The
les’
e
xtensions
are
merely
for
indication;
the
contents
of
the
images
are
not
altered
in
an
y
w
ay
.
All
image
e
xtensions
are
replaced
with
the
JPG
format
in
this
research.
These
images
will
then
be
used
as
input
in
the
step
of
pre-processing
data.
After
reading,
the
y
were
do
wnsizing
the
images
to
224
×
224
,
with
a
batch
size
of
32.
This
needs
to
be
supplied
because
the
pipeline
handles
batches
of
images
that
are
all
the
same
size.
The
y
were
of
fering
genuine
v
alue
when
it
came
to
data
shuf
e
decisions.
T
o
get
transformations
equal
to
100
and
shuf
ing,
the
y
added
optional
random
seeds.
After
that,
the
images
should
be
normal
ized
and
turned
into
arrays
so
that,
the
y
may
be
used
as
input
for
the
model’
s
ne
xt
step.
W
ith
the
label
mode
cate
gorial,
a
oat
32
tensor
of
shape
(batch
size,
num
classes)
encodes
the
class
inde
x
one-hot.
T
o
ensure
our
dataset
for
DL
model
training
include
dif
ferent
photos.
Finally
,
we
randomly
di
vided
it
into
70%
and
30%
sections
for
training
and
v
alidation.
Sample
fundus
pictures
for
DR,
cataract,
glaucoma,
and
DME
are
sho
wn
in
Figure
2.
3.2.
Stage
2:
deep
r
ecurr
ent
neural
netw
orks
Se
v
eral
supervised
DL
algorithms
are
used
to
create
classication
models
in
this
research.
T
o
detect
and
eliminate
the
four
diabetic
e
ye
illnesses,
the
y
will
test
their
abilities.
Three
models
are
used:
RNN+
ResNet152V2,
GR
U+ResNet152V2,
and
Bi-GR
U+ResNet152V2.
W
e
e
xplain
each
of
the
three
models
in
the
follo
wing
subsections.
3.2.1.
Stage
2
model
1:
RNN+ResNet152V2
deep
model
The
R
esNet152V2
model
w
as
selected
for
this
research
as
the
model
supports
suf
cient
accurac
y
and
speed.
The
model
has
a
RNN
using
the
ResNet152V2
model,
a
reshape
layer
,
2D
global
a
v
erage
pooling,
a
dropout
layer
,
and
a
dense
layer
with
a
Softmax
acti
v
ation
function
to
classi
fy
the
image.
Figure
3
pro
vides
more
details
on
the
model’
s
architecture.
3.2.2.
Stage
2
model
2:
ResNet152V2
and
GR
U
deep
model
As
sho
wn
in
Figure
4,
this
model
consists
of
GR
U
follo
wed
by
ResNet152V2.
The
primary
benet
of
using
GR
U
is
that
it
allo
ws
for
the
maintenance
of
details
that
are
irrele
v
ant
to
the
prediction
for
an
e
xtended
Indonesian
J
Elec
Eng
&
Comp
Sci,
V
ol.
37,
No.
3,
March
2025:
1830–1844
Evaluation Warning : The document was created with Spire.PDF for Python.
Indonesian
J
Elec
Eng
&
Comp
Sci
ISSN:
2502-4752
❒
1835
period
without
eliminating
them.
ResNet152V2,
a
reshape
layer
,
a
GR
U
layer
after
layer
with
256
units,
a
collapsed
layer
,
a
layer
that
is
dense
with
128
neurons,
a
layer
with
dropouts,
and
a
dense
layer
use
the
function
of
Softmax
acti
v
ation
to
classify
the
image
into
one
of
our
four
disease
classications.
Figure
2.
Fundus
image
samples
from
the
original
dataset
Figure
3.
Stage
2
model
1:
RNN+ResNet152V2
model
architecture
3.2.3.
Stage
2
model
3:
ResNet152V2
and
Bi-GR
U
deep
model
The
sequential
model
of
bi-GR
U,
follo
wed
by
ResNet152V2,
is
the
last
proposed
DL
model
in
our
proposed
RNN
Diabetic
frame
w
ork.
The
model
architecture
is
described
in
detail
in
Figure
5.
The
model
consists
of
a
ResNet152V2,
follo
wed
by
a
reshape
layer
,
a
bi-GR
U
layer
with
512
units,
a
dense
layer
,
a
dropout
layer
,
and
another
dense
layer
,
and
it
utilizes
a
Softmax
acti
v
ation
function
to
cat
e
gori
ze
the
image
as
belonging
to
one
of
our
four
cate
gories
of
disorders.
RNN
Diabetic
fr
ame
work
for
identifying
diabetic
e
ye
diseases
(Arwa
Albelaihi)
Evaluation Warning : The document was created with Spire.PDF for Python.
1836
❒
ISSN:
2502-4752
Figure
4.
Stage
2
model
2:
GR
U+ResNet152V2
model
architecture
Figure
5.
Stage
2
model
3:
Bi-GR
U+ResNet152V2
model
architecture
4.
RESUL
TS
AND
DISCUSSIONS
4.1.
T
raining
parameters
The
models
in
this
study
were
trained
and
assessed
independently
b
ut
with
identical
parameters
and
metrics.
W
e
needed
to
increase
the
o
v
erall
amount
of
data
and
epochs
to
adequately
train
DL
models.
T
o
achie
v
e
the
best
results,
we
trained
the
m
odels
on
v
arious
epochs
and
batch
size
settings.
Using
an
optimizer
and
suitable
t
functions,
our
models
were
trained
and
v
eried.
Ev
ery
model
ran
through
about
300
epochs
of
training,
with
a
batch
size
of
32.
The
presented
ndings
are
the
highest
v
alidation
v
alues
that
could
be
ob-
tained.
The
results
were
obtained
by
including
the
performance
metric
equations
in
the
outputs
of
the
resulting
v
alidation
data.
F
or
our
suggested
models,
the
(Adam)
[7]
optimizer
w
as
used
to
obtain
the
optimal
outcomes.
T
able
3
displays
the
learning
rate
(LR)
v
alues
and
optimizers
used
for
all
models.
Indonesian
J
Elec
Eng
&
Comp
Sci,
V
ol.
37,
No.
3,
March
2025:
1830–1844
Evaluation Warning : The document was created with Spire.PDF for Python.
Indonesian
J
Elec
Eng
&
Comp
Sci
ISSN:
2502-4752
❒
1837
T
able
3.
The
training
parameters
of
the
models:
learning
rate
v
alue
and
optimizer
Model
Optimizer
Learning
rate
RNN+ResNet152V2
Adam
0.00001
GR
U+ResNet152V2
0.00001
Bi-GR
U+ResNet152V2
0.00001
4.2.
Early
stopping
(callback)
Neural
netw
ork
training
requires
epoch
selection.
T
oo
man
y
or
too
fe
w
epochs
might
o
v
ert
or
undert
the
training
dataset.
Set
epochs
with
early
stopping,
model
checkpoint,
and
other
approaches.
Our
early
stopping
method
in
v
olv
es
setting
man
y
epochs
and
halting
training
when
the
impro
v
ement
is
not
enough
and
matches
our
e
xpectations.
Early
stopping
sets
an
arbitrarily
high
number
of
training
epochs
and
stops
training
when
model
performance
on
a
hold-out
v
alidation
dataset
st
ops
impro
ving.
The
early
stopping
callback
from
K
eras
lets
you
terminate
training
early
.
Automatic
callbacks
run
code
and
interact
with
the
training
model.
The
v
alidation
dataset
loss
function
for
model
optimization
is
calculated
after
each
epoch.
First
e
vidence
of
no
impro
v
ement
is
not
al
w
ays
ideal
to
stop
training.
This
is
because
the
model
may
stall
or
w
orsen
before
impro
ving
rapidly
.
T
o
postpone
epochs
without
impro
v
ement,
we
set
”patience”
to
60
in
this
e
xperiment.
4.3.
P
erf
ormance
metrics
The
RNN
Diabetic
frame
w
ork
w
as
assessed
for
diabetic
e
ye
disease
cate
gorization
utilizing
measures
such
as
accurac
y
,
sensiti
vity
,
precision,
specicity
,
F1-score,
and
areas
under
the
curv
e
(A
UC).
A
confusion
matrix
is
then
added
to
each
model.
In
(1),
accurac
y
is
the
number
of
occurrences
that
can
be
predicted
accurately
gi
v
en
the
total
number
.
Accur
acy
(
Acc
)
=
T
p
+
T
n
T
p
+
T
n
+
F
p
+
F
n
(1)
where
TP
and
TN
are
true
positi
v
e
and
ne
g
ati
v
e
parameters,
whereas
FP
and
FN
are
f
alse
positi
v
e
and
ne
g
ati
v
e
v
alues.
In
(2)
gi
v
es
recall
as
the
number
of
samples
that
were
both
actually
positi
v
e
and
projected
to
be
positi
v
e.
In
(3)
sho
ws
the
precision,
or
positi
v
e
predicti
v
e
v
alue,
of
all
e
xpected
positi
v
e
samples.
In
(4)
gi
v
es
the
real
ne
g
ati
v
e
rate
or
specicity
,
which
is
the
number
of
truly
ne
g
ati
v
e
samples
anticipated
to
be
ne
g
ati
v
e.
Last,
(6)
sho
ws
the
F1-score,
or
harmonic
mean
of
precision
and
sensiti
vity
.
S
ensitiv
ity
(
S
en
)
=
T
p
T
p
+
F
n
(2)
P
r
ecision
(
P
r
e
)
=
T
p
T
p
+
F
p
(3)
S
pecif
icity
(
S
pc
)
=
T
n
T
n
+
F
p
(4)
F
1
−
scor
e
(
F
1)
=
2
∗
P
r
e
∗
S
en
P
r
e
+
S
en
(5)
Recent
research
suggests
confusion
matrix
analysis
is
ef
fecti
v
e
for
model
v
alidation
[8]
due
to
its
ability
to
characterize
data
linkages
and
distrib
utions.
Information
on
illustrating
cate
gorization
models
is
included.
4.4.
Multi-classication
RNN
Diabetic
framew
ork
r
esults
W
e
or
g
anized
an
e
xtensi
v
e
e
xperiment,
and
we
obtained
dif
ferent
outputs
corresponding
to
the
perfor
-
mance
metrics
to
disco
v
er
the
signicant
ndings.
Therefore,
we
illustrated
the
results
in
T
able
4
for
the
three
models.
The
table
sho
ws
classier
model
performance
in
accurac
y
(Acc),
sens
iti
vity
(Sen),
specicity
(Spe),
precision
(Pre),
F1-score
(F1),
and
A
UC.
Most
people
use
the
confusion
matrix
to
e
v
aluate
cate
gorization
er
-
rors.
W
e
report
loss,
A
UC,
precision,
r
ecall,
and
accurac
y
between
training
and
v
alidation
with
300
epochs
in
all
proposal
models.
T
able
4.
The
performance
metrics
for
the
three
proposed
models
for
our
RNN
Diabetic
frame
w
ork
Model
Acc
Sen
Spe
P
re
F1
A
UC
RNN+ResNet152V2
97.3
96.7
95.9
96.7
96.7
97.4
GR
U+ResNet152V2
98.3
97.9
98.1
98.3
98.3
99
Bi-GR
U+ResNet152V2
99.8
98.1
98.6
99.8
99.8
99.4
RNN
Diabetic
fr
ame
work
for
identifying
diabetic
e
ye
diseases
(Arwa
Albelaihi)
Evaluation Warning : The document was created with Spire.PDF for Python.
1838
❒
ISSN:
2502-4752
4.4.1.
Results
of
stage
2
model
1
(RNN+ResNet152V2
model)
Figure
6
displays
the
ResNet152V2
model
confusion
matrix
of
the
RNN+ResNet152V2
model.
The
gure
sho
ws
the
ef
fecti
v
e
classication
of
four
patient
statuses:
DR,
DME,
glaucoma,
and
cataract,
with
DR
images
ha
ving
the
greatest
ratio,
follo
wed
by
cataract,
DME,
and
glaucoma.
Figure
6.
Confusion
matrix
of
stage
2-model
1:
RNN+ResNet152V2
model
4.4.2.
Results
of
stage
2
model
2
(GR
U+ResNet152V2
model)
The
GR
U+ResNet152V2
model
demonstrated
impro
v
ed
performance
with
GR
U,
as
seen
in
T
able
4;
assumed
v
alues
were
higher
.
In
Figure
7,
the
confusion
matrix
of
the
GR
U+ResNet152V2
model
classies
four
patient
statuses:
DR,
DME,
glaucoma,
and
cataract.
The
greatest
ratio
is
for
DME
and
DR
pictures,
follo
wed
by
cataract
(0.9839)
and
glaucoma
(0.9542).
Figure
7.
Confusion
matrix
of
stage
2-model
2:
GR
U+ResNet152V2
model
4.4.3.
Results
of
stage
2
model
2
(Bi-GR
U+ResNet152V2
model)
Figure
8
displays
the
performance
indicators
of
the
Bi-GR
U+ResNet152V2
model,
including
loss,
A
UC,
precision,
recall,
and
accurac
y
throughout
training
and
v
alidation,
along
with
the
number
of
epochs.
See
Figure
9
for
the
confusion
matrix
of
the
Bi-GR
U+ResNet152V2
model.
Figure
sho
ws
four
precisely
recog-
nized
patient
conditions:
cataract,
DR,
DME,
and
glaucoma.
The
DR
pictures
ha
v
e
the
highest
ratio
(0.9896),
follo
wed
by
the
DME,
cataract,
and
glaucoma.
The
y
outperform
the
GR
U+ResNet152V2
model
b
ut
are
infe-
rior
to
the
RNN+ResNet152V2
model.
Indonesian
J
Elec
Eng
&
Comp
Sci,
V
ol.
37,
No.
3,
March
2025:
1830–1844
Evaluation Warning : The document was created with Spire.PDF for Python.
Indonesian
J
Elec
Eng
&
Comp
Sci
ISSN:
2502-4752
❒
1839
Figure
8.
Loss,
A
UC,
precision,
recall,
and
accurac
y
between
the
training
and
v
alidation
phases,
with
number
of
epochs
for
stage
2-model
3:
Bi-GR
U+ResNet152V2
model
Figure
9.
Confusion
matrix
of
stage
2-model
3:
Bi-GR
U+ResNet152V2
model
4.5.
Comparati
v
e
analysis
and
discussion
This
study
recommends
three
deep
RNN
models
for
diabetic
e
ye
disease
diagnosis:
RNN+ResNet152V2,
GR
U+ResNet152V2,
and
Bi-GR
U+Res
Net152V2.
DR,
DME,
cataract,
and
glaucoma
the
four
most
common
diabetic
e
ye
diseases
are
classied
using
these
models.
The
proposed
models
were
e
v
aluated
using
accu-
rac
y
,
sensiti
vity
,
F1-score,
and
A
UC.
According
to
our
data,
Bi-GR
U+ResNet152V2
had
the
highest
clas-
sication
accurac
y
(99.8),
follo
wed
by
GR
U+ResNet152V2.
Ho
we
v
er
,
T
able
4
and
Figure
10
indicate
that
RNN+ResNet152V2
has
the
smallest
accurac
y
among
all
designs.
T
able
5
compares
the
performance
e
v
aluation
measures
of
our
proposed
RNN
Diabetic
frame
w
ork
to
e
xisting
DL
model
s
from
past
publications.
This
research
e
v
aluated
the
proposed
model
usi
n
g
A
UC,
sensiti
vity
,
specicity
,
precision,
F1-score,
and
accurac
y
.
W
e
used
tw
o
gures
to
e
xplain
the
comparisons.
Figure
11
RNN
Diabetic
fr
ame
work
for
identifying
diabetic
e
ye
diseases
(Arwa
Albelaihi)
Evaluation Warning : The document was created with Spire.PDF for Python.