0% found this document useful (0 votes)
6 views

630 document final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

630 document final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

A MAJOR PROJECT REPORT ON

GLAUCOMA EYE DISEASE DETECTION IN FUNDUS


IMAGES USING CONVOLUTIONAL NEURAL
NETWORK
Submitted in partial fulfillment for the award of the degree of
BACHELOR OF TECHNOLOGY
In

Computer Science and Technology


By
K. SaiAparna (19A81A0630)

Under the Esteemed Supervision of


K.Satya Narayana,M.Tech
Assistant Professor

Department of Computer Science and Engineering (Accredited by N.B.A.)


SRI VASAVI ENGINEERING COLLEGE(Autonomous)
(Affiliated to JNTUK, Kakinada)
Pedatadepalli, Tadepalligudem-534101, A.P 2021-22
SRI VASAVI ENGINEERING COLLEGE (Autonomous)

Department Of Computer Science and Engineering

Pedatadepalli, Tadepalligudem

This is to certify that the Project Report entitled “Glaucoma eye disease detection in
fundus images” submitted by K.SAIAPARNA (19A81A0630) for the award of the
degree of Bachelor of Technology in the Department of Computer Science and Technology
during the academic year 2022-2023.

Name of Project Guide Head of the Department


Mr. K.SatyaNarayana,M.Tech
Dr. D Jaya Kumari M.Tech.,Ph.D..
Assistant Professor
Professor & HOD.

ExternalExaminer
DECLARATION

We hereby declare that the project report entitled “Glaucoma eye disease detection
in fundus images” submittedby us to Sri Vasavi Engineering College(Autonomous),
Tadepalligudem, affiliated to JNTUK Kakinada in partial fulfilment of the
requirement for the award of the degree of B.Tech in Computer Science and
Technology is a record of Bonafide project work carried out by us under the guidance
of K.Satyanarayana,M.Tech. We further declare that the work reported in this project
has not been submitted and will not be submitted, either in part or in full, for the
award of any other degree in this institute orany other institute or University.

Project Associates

K. Sai Aparna (19A81A0630)


ACKNOWLEDGEMENT

First and foremost, we sincerely salute to our esteemed institute

SRI VASAVI ENGINEERING COLLEGE, for giving us this golden

opportunity to fulfill our warm dream to become an engineer.


Our sincere gratitude to our project guide Mr.K.Satyanarayana ,Assistant
professor, Department of Computer Science and Engineering, for his timely
cooperation and valuable suggestions while carrying out this project.
We express our sincere thanks and heartful gratitude to Dr. D. Jaya Kumari,
Professor & Head of the Department of Computer Science and Engineering, for
permitting us to do our project.
We express our sincere thanks and heartful gratitude to Dr. G.V.N.S.R.
Ratnakara Rao, Principal, for providing a favourable environment and supporting us
during the development of this project.
Our special thanks to the management and all the teaching and non-teaching staff
members, Department of Computer Science and Engineering, for their support and
cooperation in various ways during our project work. It is our pleasure to
acknowledge the help of all those respected individuals.
We would like to express our gratitude to our parents, friends who helped to
complete this project.

Project Associates

K.Sai Aparna (19A81A0630)


ABSTRACT

Glaucoma is the first cause of irreversible blindness since it affects the eye’s optic nerve. Glaucoma
is a disease that relates to the vision of the human eye. It is one of the causes of lifelong blindness
among adults over 60 years of age. Fundus imaging is the most used screening technique for
glaucoma detection for its trade-off between portability, size, and costs. This disease is considered as
the irreversible disease that results in the vision deterioration. It is a disorder that gradually damages
the optic nerve causing partial loss of vision. Fundus imaging is the commonly used testing
technique for the detection of glaucoma. We will train the system with the fundus images of the
retina and to predict the possibility of occurrence of Glaucoma using the Convolution Neural
Network Technique. In this project we are going to present a computational tool for automatic
glaucoma detection. We will use CNN approach for the early detection of Glaucoma to avoid vision
loss.
Keywords: Glaucoma, NeuralNetwork ,CNN DeepLearning Fundus images.

I
TABLE OF CONTENTS

S.NO TITLE PAGENO


ABSTRACT i
1 INTRODUCTION 1-3

1.1 Introduction 2

1.2 Motivation 2

1.3 Scope 2

1.4 Project Outline 3

2 LITERATURE SURVEY 4-7

3 SYSTEM STUDY AND ANALYSIS 8-11

3.1 Problem statement 9

3.2 Existing System 9

3.3 Limitations of Existing System 9

3.4 Proposed System 9

3.5 Advantages of Proposed System 10

3.6 Functional requirements 10

3.7 Non-Functional requirements 10

3.8 User Interface Requirements 11

3.8.1 System requirements 11

3.8.1.1 Hardware requirements 11

3.8.1.2 Software requirements 11

4 SYSTEM DESIGN 12-17

4.1 System Architecture Design 13

4.2 UML Diagrams 13-17

5 TECHNOLOGIES 18-23

5.1 Python 19
5.1.1 Introduction Of Python 19

5.1.2 History Of Python 19

5.1.3 Features Of Python 20

5.1.4 Required Python Libraries 21-22

5.2 About PyCharm Community 23

6 IMPLEMENTATION 24-31

6.1 Implementation Steps 25

6.2 About CNN 25-31

7 TESTING 32-34

7.1 Introduction to testing 33

7.2 Test Objectives 33

7.3 Testing Strategies 33

7.3.1 Unit Testing 33

7.3.2 Integration Testing 33

7.3.3 Functional Testing 34

7.3.4 System Testing 34

7.3.5 Acceptance Testing 34

8 SCREENSHOTS 35-42

9 CONCLUSION AND FUTURE WORK 43-45

10 REFERENCES 46-48
CHAPTER-1
INTRODUCTION

1
1. INTRODUCTION

1.1 Introduction
Glaucoma is the first cause of irreversal blindness since it affects the eye’s optic nerve.
In most of the cases patients do not experience symptoms of vision loss until advanced stages.
According to Mohammadi and Jeyaraman, it is estimated that in developed countries, at least half
of glaucoma patients feel no signals of the disease, which is expected to be worse in developing
countries. In a study of glaucoma prevalence from worldwide published data found that by 2020,
over 11.1 million people will be bilaterally blind from primary glaucoma. In was also reported the
increasing economical cost of treatment of glaucoma in advanced stages. In Colombia, the
Ministry of Health and Social Security estimates that there is around 296,000 blind people for
several causes, having glaucome a prevalence of 3.9% in people over 40 years old in
Bucaramanga. This gets worse by the fact that in the country, based on the population in 2011,
there are 2 opthalmologists for 100,000 patients.
The retinal fundus image is used to measure the thickness of the retinal nerve fiber layer
(RNFL) to diagnose glaucoma. It is one of the noninvasive techniques most used by
ophthalmologists. Its major advantage is that images can be taken easily for either healthy and
nonhealthy retinas, it is also portable and not difficult to use for any health professional, specially
in screening campaigns among population without access to health care services. The thickness of
the RNFL is calculated by measuring the proportion among the size of the optic nerve (named disc)
and the size of the excavation inside the optic nerve produced by the increasing eye’s pressure
(named cup). This parameter is known as the Cup-to-Disc ratio (CDR).

1.2 Motivation
Glaucoma is the main source of visual impairment among African Americans and Hispanics in the
U.S. The very expanding request of this ailment wind up hazardous from everywhere throughout
the world. The factor of this infection like high Myopia, Diabetes, eye Surgery and hypertension
turn into a reason for dejection. Utilization of corticosteroids (for instance, eye drops, pills,
inhalers and creams) Prescription eye drops could cut African Americans danger of getting
glaucoma into equal parts. In excess of 3 million Americans are living with glaucoma, and 2.7
million of whom-matured 40 and more established are influenced by its most regular frame, open-
edge glaucoma. Get the certainties about glaucoma. We will assemble a framework which can
recognize this malady in beginning times.
2
1.3 Scope
The main objective behind this project is to detect the glaucoma in initial stages itself. If the
disease is detected in the initial stages the patient can cure the disease by doing some excercises,
meditation and yoga. If the disease is not cured in the initial stages then the patient can get
blindness which is incurable. So creating a project which can detect the disease can help the
patient to cure.

1.4Project Outline
Chapter-1 Introduction
Chapter-2 Literature survey
Chapter-3 System Study and analysis
Chapter-4 Technologies
Chapter-4 Implementation
Chapter-5 Testing
Chapter-6 Screenshots
Chapter-7 Conclusion and future work

3
CHAPTER-2
LITERATURE SURVEY

4
2. LITERATURE SURVEY

Literature survey is the most important step in software development process. Before developing
the tool it is necessary to determine the time factor, economy n company strength. Once these
things r satisfied, ten next steps are to determine which operating system and language can be used
for developing the tool. Once the programmers start building the tool the programmers need lot of
external support. This support can be obtained from senior programmers, from book or from
websites. Before building the system the above consideration are taken into account for
developing the proposed system.
1. S. S. Kanse and D. M. Yadav. Retinal fundus image for glaucoma detection: A review
and study

Glaucoma is one of the severe visual diseases that lead to damage the eyes irreversibly by
affecting the optic nerve fibers and astrocytes. Consequently, the early detection of glaucoma
plays a virtual role in the medical field. The literature presents various techniques for the early
detection of glaucoma. Among the various techniques, retinal image-based detection plays a major
role as it comes under noninvasive methods of detection. While detecting glaucoma disorder using
retinal images, various medical features of the eyes, such as retinal nerve fiber layer, cup-to-disc
ratio, apex point, optic disc, and optic nerve head, and image features, such as Haralick texture,
higher-order spectra, and wavelet energy, are used. In this paper, a review and study were
conducted for the different techniques of glaucoma detection using retinal fundus images.
Accordingly, 45 research papers were reviewed and the analysis was provided based on the
extracted features, classification accuracy, and the usage of different data sets, such as
DIARETDB1 data set, MESSIDOR data set, IPN data set, ZEISS data set, local data set, and real
data set. Finally, we present the various research issues and solutions that can be useful for the
researchers to accomplish further research on glaucoma detection.
2. S.M. Nikam and C.Y. Patil. Glaucoma detection from fundus images using matlab

A troublesome disease in which damages of the optic nerve of eye's is nothing but the glaucoma,
which causes irretrievable loss of vision. Glaucoma is a disease where if treatment is get late, the
person can blind. Normally glaucoma detects when there is an increase in the fluid in the front of
eye. When that extra fluid is increased, the pressure in your eye is also getting increased.
Accordingly, the size of the optic disc and optic cup is increased as a result diameter also
increased. The ratio of the cup and disc diameter is called cup-to-disc ratio (CDR). Threshold type
segmentation method is used in this system for localizing the optic disc and optic cup. Another

5
edge detection and ellipse fitting algorithm are also used. The proposed system for optic disc and
optic cup localization and CDR calculation is MATLAB GUI software.
3. Jyotiprava Dash and Nilamani Bhoi. A thresholding based technique to extract
retinal blood vessels from fundus images

Retinal imaging has become the significant tool among all the medical imaging technology, due to
its capability to extract many data which is linked to various eye diseases. So, the accurate
extraction of blood vessel is necessary that helps the eye care specialists and ophthalmologist to
identify the diseases at the early stages. In this paper, we have proposed a computerized technique
for extraction of blood vessels from fundus images. The process is conducted in three phases:
(i) pre-processing where the image is enhanced using contrast limited adaptive histogram
equalization and median filter, (ii) segmentation using mean-C thresholding to extract retinal
blood vessels, (iii) post-processing where morphological cleaning operation is used to remove
isolated pixels. The performance of the proposed method is tested on and experimental results
show that our method achieve an accuracies of 0.955 and 0.954 on Digital retinal images for
vessel extraction (DRIVE) and Child heart and health study in England (CHASE_DB1) databases
respectively.
4. S. Nawaldgi. Review of automated glaucoma detection techniques.

Glaucoma, an eye disease, is often referred to as the silent thief of sight. The damage done by
glaucoma is irreversible. Early detection and treatment of glaucoma is the only solution. Till date
many works have been done towards automatic glaucoma detection using Color Fundus Images
(CFI) and Optical Coherence Tomography (OCT) images by extracting structural features.
Structural features can be extracted from optic nerve head (ONH) analysis in case of CFI and
Retinal Layers (RL) analysis in OCT images for glaucoma assessment. But unfortunately, the
works till date fall short of expected accuracy in this regard. A review of automated glaucoma
detection techniques is presented in this paper. The paper also discusses various structural features
that are relevant to CFI and OCT images respectively for automated glaucoma detection. The
paper concludes that combining structural features from both CFI and OCT images would result in
more accurate glaucoma assessment.
5. J. Ayub, J. Ahmad, J. Muhammad, L. Aziz, S. Ayub, U. Akram, and I. Basit.
Glaucoma detection through optic disc and cup segmentation using K-mean
clustering.

One of the primary cause of blindness is Glaucoma. Although the disease is incurable but its
symptoms can be minimized therefore early detection of the disease is essential. Elevated

6
intraocular pressure, gradual vision loss which is a step towards blindness, structural damage to
the retina are the marked symptoms of Glaucoma. Manually. It is diagnosed by examination of
size, structure, shape of optic disc and optic cup. In patient of glaucoma Cup size increases while
disc area remains the same hence cup to disc ratio (CDR) increases in glaucoma patient. CDR is
the ratio of optic cup area to the optic disc area, which provides basis for the diagnosis of
glaucoma. This article focuses on automated detection of glaucoma from fundus images using
CDR. Region of interest (ROI) extraction through intensity weighted centroid method which is
followed by preprocessing and recursively applied k-mean clustering segmentation for the
detection of Optic cup (OC) and optic disc (OD). Ellipse fitting is implied for boundary
smoothening of OC and OD. Performance of the proposed technique is assessed on 100 fundus
images collected locally. Proposed approach gives an accuracy of 92% for glaucoma and Mean
square error of 0.002 for CDR.

7
CHAPTER-3
SYSTEM STUDY
AND ANALYSIS

8
3. SYSTEM

STUDY AND
ANALYSIS
3.1 Problem Statement
Optic nerve carries information that we can see through eye to brain. Optic nerve head is
called optic disc .It connects retina and optic nerve. The center of optic disk is called optic cup and
the optic cup enlarges and enlarges and occupy more area of optical disk then the cup to disc ratio
increases.
3.2 EXISTING SYSTEM
The existing system has unable to find out the glaucoma in eye. It’s not supporting the machine
learning (ML), artificial intelligence (AI).here database only capturing the data only management
the data base. The existing system to totally failures the capturing Images to identifying the
glaucoma in eye to prediction in data.

3.3 DISADVANTAGES
 Efficiency is less.
 Difficult to evaluate the project.
 Loss of time to identify the glaucoma
 There are no accurate results.

3.4 PROPOSED SYSTEM


Glaucoma is an ocular condition to progression leads to permanent blindness. Glaucoma is a
chronic disease whose progression can only be stopped if detected accurately at an early stage.
Proposed algorithm provides an automated glaucoma detection computer aided system that
enables the ophthalmologists in early diagnosis of glaucoma patients with high accuracy. Intensity
and textural features are extracted from the image to train and test the classier. Result from
glaucoma detection using CDR and features are combined to classify the image as glaucoma, non-
glaucoma or suspect. Fundus image obtained is preprocessed before cup and disc detection to
extract reduces the image size, thus reduces the time complexity of algorithm by processing only
the required region. Moreover, fundus image might contain bright lesions or fringes which may be
considered as optic disc. Fundus image is preprocessed using contrast enhancement followed by.
All the detected blobs are the candidate regions for optic disc. Region with largest vessels density
is finally selected as the optic disc location based to find out the glaucoma in eye.

9
BLOCK DIAGRAM:

3.5 ADVANTAGES
 Results from Classification and our proposed network are combined to have more accurate
results.
 Fundus images of both healthy and non-healthy eyes.
 Time saving to find the glaucoma.
 The absolute success of detection of the glaucomatous
 More efficiency and less time consuming.

3.6 FUNCTIONAL REQUIREMENTS


Functional requirements describe what the software should do (the functions). In developing
the software for Glaucoma detection, some of the functional requirements could include:
 The software shall accept an image as input.
 The software shall do pre-processing images(removing blur images).
 It processes the given input data by producing the most possible outcomes of a whether the
person has glaucoma or not.
3.7 NON-FUNCTIONAL REQUIREMENTS
 The result(whether the person has disease or not) will displayed on the monitor to
provide acknowledgement
 It provides ease of usability and convenience to the user.

10
3.8 USER INTERFACE REQUIREMENTS
3.8.1 System requirements
3.8.1.1 Hardware requirements
 Processor - I3/Intel Processor
 RAM - 4GB (min)
 Hard Disk - 160GB
 Key Board - Standard Windows Keyboard
 Mouse - Two or Three Button Mouse
 Monitor - SVGA
3.8.1.2 Software System Configuration:-
 Operating System : Windows 7/8/10

 Server side Script : Python

 Environment : Pycharm Community/ Jupyter

11
CHAPTER-4

SYSTEM DESIGN

12
4. SYSTEM DESGIN
4.1 System Architecture Design

The system architecture explains that initially when the system starts to work, it
takes the Fundus image of an eye as an input to detect whether the person has glaucoma or
not. First we will train the images and then we will test. The person can login to interface
and he will give his fundus eye image as input then our system will detect that the person
has glaucoma or not.

4.2 UML DIAGRAMS


UML stands for Unified Modeling Language. UML is a standardized general-purpose modeling
language in the field of object-oriented software engineering. The standard is managed, and was
created by, the Object Management Group.
The goal is for UML to become a common language for creating models of object oriented
computer software. In its current form UML is comprised of two major components: a Meta-
model and a notation. In the future, some form of method or process may also be added to; or
associated with, UML.
The Unified Modeling Language is a standard language for specifying, Visualization,

13
Constructing and documenting the artifacts of software system, as well as for business modeling
and other non-software systems.
The UML represents a collection of best engineering practices that have proven successful in the
modeling of large and complex systems.
The UML is a very important part of developing objects oriented software and the software
development process. The UML uses mostly graphical notations to express the design of software
projects.
GOALS:
The Primary goals in the design of the UML are as follows:
Provide users a ready-to-use, expressive visual modeling Language so that they can develop and
exchange meaningful models.
Provide extendibility and specialization mechanisms to extend the core concepts.
Be independent of particular programming languages and development process.
Provide a formal basis for understanding the modeling language.
Encourage the growth of OO tools market.
Support higher level development concepts such as collaborations, frameworks, patterns and
components.
Integrate best practices
USE CASE DIAGRAM:
A use case diagram in the Unified Modeling Language (UML) is a type of behavioral diagram
defined by and created from a Use-case analysis. Its purpose is to present a graphical overview of
the functionality provided by a system in terms of actors, their goals (represented as use cases),
and any dependencies between those use cases. The main purpose of a use case diagram is to
show what system functions are performed for which actor. Roles of the actors in the system can
be depicted.

14
CLASS DIAGRAM:
In software engineering, a class diagram in the Unified Modelling Language (UML) is a type of
static structure diagram that describes the structure of a system by showing the system's classes,
their attributes, operations (or methods), and the relationships among the classes. It explains which
class contains information.

15
ACTIVITY DIAGRAM:
Activity diagrams are graphical representations of workflows of stepwise activities and actions
with support for choice, iteration and concurrency. In the Unified Modeling Language, activity
diagrams can be used to describe the business and operational step-by-step workflows of
components in a system. An activity diagram shows the overall flow of control.

COMPONENT DIAGRAM
A component diagram, also known as a UML component diagram, describes the organization and
wiring of the physical components in a system. Component diagrams are often drawn to help
model implementation details and double-check that every aspect of the system's required
functions is covered by planned development.

16
DEPLOYMENT DIAGRAM
Deployment diagram represents the deployment view of a system. It is related to the component
diagram. Because the components are deployed using the deployment diagrams. A deployment
diagram consists of nodes. Nodes are nothing but physical hardwares used to deploy the
application.

17
CHAPTER-5
TECHNOLOGIES

18
5. TECHNOLOGIES
5.1 Python:
5.1.1 Introduction to python
Python is currently the most widely used multi-purpose, high-level programming language.
Python is an interpreted, object-oriented, high-level programming language with dynamic
semantics. It is a high-level built-in data structures, combined with dynamic typing and
dynamic binding, make it very attractive for Rapid Application Development, as well as for
use as a scripting or glue language to connect existing components together. Python's simple,
easy to learn syntax emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which encourages program
modularity and code reuse. The Python interpreter and the extensive standard library are
available in source or binary form without charge for all major platforms, and can be freely
distributed.

5.1.2 History of Python

Python is a widely-used general-purpose, high-level programming language. It was initially


designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It
was mainly developed for emphasis on code readability, and its syntax allows programmers
to express concepts in fewer lines of code. In the late 1980s, history was about to be written.
It was that time when working on Python started. Soon after that, Guido Van Rossum began
doing its application-based work in December of 1989 at Centrum Wiskunde & Informatica
(CWI) which is situated in the Netherlands. It was started firstly as a hobby project because
he was looking for an interesting project to keep him occupied during Christmas. The
programming language in which Python is said to have succeeded is ABC Programming
Language, which had interfacing with the Amoeba Operating System and had the feature of
exception handling. He had already helped to create ABC earlier in his career and he had
seen some issues with ABC but liked most of the features. After that what he did was really
very clever. He had taken the syntax of ABC, and some of its good features. It came with a
lot of complaints too, so he fixed those issues completely and had created a good scripting
language that had removed all the flaws. The inspiration for the name 17 came from BBC‟s
TV Show – „Monty Python‟s Flying Circus‟, as he was a big fan of the TV show and also
he wanted a short, unique and slightly mysterious name for his invention and hence he
named it Python! He was the “Benevolent dictator for life” (BDFL) until he stepped down
from the position as the leader on 12th July 2018. For quite some time he used to work for

19
Google, but currently, he is working at Dropbox. The language was finally released in 1991.
When it was released, it used a lot fewer codes to express the concepts, when we compare it
with Java, C++ & C. Its design philosophy was quite good too. Its main objective is to
provide code readability and advanced developer productivity. When it was released it had
more than enough capability to provide classes with inheritance, several core data types
exception handling and functions.

5.1.3 Features of Python

Python provides many useful features which make it popular and valuable from the other
programming languages. It supports object-oriented programming, procedural programming
approaches and provides dynamic memory allocation. We have listed below a few essential
features.

1. Easy to learn and use

Python is easy to learn as compared to other programming languages. Its syntax


is straightforward and much the same as the English language. There is no use of the
semicolon or curly-bracket, the indentation defines the code block. It is the
recommended programming language for beginners.

2. Expressive Language

Python can perform complex tasks using a few lines of code. A simple example,
the hello world program you simply type print("Hello World"). It will take only one line
to execute, while Java or C takes multiple lines.

3. Interpreted Language

Python is an interpreted language; it means the Python program is executed


one line at a time. The advantage of being interpreted language, it makes debugging
easy and portable.

4. Cross-platform Language

Python can run equally on different platforms such as Windows, Linux, UNIX,
and Macintosh, etc. So, we can say that Python is a portable language. It enables
programmers to develop the software for several competing platforms by writing a
program only once.

5. Free and Open Source

Python is freely available for everyone. It is freely available on its official


website www.python.org. It has a large community across the world that is

20
dedicatedly working towards make new python modules and functions. Anyone can
contribut to the Python community. The open-source means, "Anyone can download
its source code without paying any penny."

6. Object-Oriented Language

Python supports object-oriented language and concepts of classes and objects


come into existence. It supports inheritance, polymorphism, and encapsulation, etc.
The object-oriented procedure helps to programmer to write reusable code and
develop applications in less code.

7. Extensible

It implies that other languages such as C/C++ can be used to compile the code
and thus it can be used further in our Python code. It converts the program into byte
code, and any platform can use that byte code.

8. Large Standard Library

It yprovides a vast range of libraries for the various fields such as machine
learning, web developer, and also for the scripting. There are various machine
learning libraries, such as Tensor flow, Pandas, Numpy, Keras, and Pytorch, etc.
Django, flask, pyramids are the popular framework for Python web development.

9. GUI Programming Support

Graphical User Interface is used for the developing Desktop application. PyQT5,
Tkinter, Kivy are the libraries which are used for developing the web application.

10. Integrated

It can be easily integrated with languages like C, C++, and JAVA, etc.
Python runs code line by line like C,C++ Java. It makes easy to debug the code.

5.1.4 Required Python Libraries

 Open CV

 Scipy

 NumPy

 Pandas

 Tensor Flow

 Keras.

21
OpenCV:
OpenCV (Open Source Computer Vision Library) is an open source computer vision
and machine learning software library. OpenCV was built to provide a common
infrastructure for computer vision applications and to accelerate the use of machine
perception in the commercial products

SciPy:

Scipy is the computation library that uses NumPy underneath. SciPy stands for Scientific
Python.It provides more utility functions for optimization, stats and signal processing.Like
NumPy, SciPy is open source so we can use it freely. SciPy was created by NumPy's creator
Travis Olliphant.

NumPy:

NumPy is a Python library used for working with arrays.It also has functions for working in
domain of linear algebra, fourier transform, and matrices.NumPy was created in 2005 by
Travis Oliphant. It is an open source project and you can use it freely. NumPy stands for
Numerical Python.

In Python we have lists that serve the purpose of arrays, but they are slow to
process. NumPy aims to provide an array object that is up to 50x faster than traditional
Python lists. The array object in NumPy is called ndarray, it provides a lot of supporting
functions that make working with ndarray very easy. Arrays are very frequently used in data
science, where speed and resources are very important.

Pandas:

Pandas is a Python library used for working with data sets. It has functions for
analyzing, cleaning, exploring, and manipulating data. The name "Pandas" has a reference
to both "Panel Data", and "Python Data Analysis" and was created by Wes McKinney in
2008.Pandas allows us to analyze big data and make conclusions based on statistical
theories. Pandas can clean messy data sets, and make them readable and relevant. Relevant
data is very important in data science.

TensorFlow

The TensorFlow platform helps you implement best practices for data automation, model
tracking, performance monitoring, and model retraining. TensorFlow is an end-to-end open
source platform for machine learning. TensorFlow is a rich system for managing all aspects
of a machine learning system; however, this class focuses on using a particular TensorFlow
API to develop and train machine learning models.

22
Keras
Keras is an open-source high-level Neural Network library, which is written in Python is
capable enough to run on Theano, TensorFlow, or CNTK. It was developed by one of the
Google engineers, Francois Chollet. It is made user-friendly, extensible, and modular for
facilitating faster experimentation with deep neural networks. It not only supports
Convolutional Networks and Recurrent Networks individually but also their combination.

5.2 PyCharm Community


PyCharm is the most popular IDE used for Python scripting language. This chapter
will give you an introduction to PyCharm and explains its features. PyCharm offers
some of the best features to its users and developers in the following aspects −

 Code completion and inspection

 Advanced debugging

 Support for web programming and frameworks such as Django and Flask
Features of PyCharm

Besides, a developer will find PyCharm comfortable to work with because of the features
mentioned below −

 Code Completion
PyCharm enables smoother code completion whether it is for built in or for an

external package.

 SQLAlchemy as Debugger

You can set a breakpoint, pause in the debugger and can see the SQL

representation of the user expression for SQL Language code.

 Git Visualization in Editor


When coding in Python, queries are normal for a developer. You can check

the last commit easily in PyCharm as it has the blue sections that can define

the difference between the last commit and the current one.

 Code Coverage in Editor

You can run .py files outside PyCharm Editor as well marking it as code

coverage details elsewhere in the project tree, in the summary section etc.

23
CHAPTER-6
IMPLEMENTATION

24
6. IMPLEMENTATION
6.1 Implementation Steps
The modules are as follows:
Upload:
First we prepare the dataset and then we can upload the images dataset and the data set to view
the data set in PyCharm.
View:
Upload the dataset that data can be viewed
Preprocessing:
Preprocessing the data the data will be extract and remove the empty files and to clean the null
values and dataset.
Classification:
We can classify the data the data will be classified into the target value and performance the
resultant values and based to use different types of algorithms wise to performance the in
machine learning and to target value and predict the values. Algorithms used they are CNN,
DENSE, CONVOLUTION, MAX POOLING
Metrics:
Accuracy is used to measure the performance of the model being trained.

6.2 About CNN


Convolutional Neural Network:
The convolutional neural networks are very similar to the neural networks they are formed by
neurons that have parameters in the form of weights and biases that can be learned.
Basic components of a convolutional neural network neuronal:
The convolution operation:
The fundamental difference between a densely connected layer and a specialized layer in the
convolution operation, which we will call the convolutional layer, is that the dense layer learns
global patterns in its global input space, while the convolutional layers learn local patterns in small
windows of two dimensions.
In general, the convolutions layers operate on 3D tensors, called feature maps, with two spatial
axes of height and width, as well as a channel axis also called depth. For an RGB color image, the
dimension of the depth axis is 3, because the image has three channels: red, green and blue.

25
The pooling operation:
In addition to the convolutional layers that we have just described, convolutional neural networks
accompany the convolution layer with pooling layers, which are usually applied immediately after
the convolutional layers. A first approach to understand what these layers are for is to see that the
pooling layers simplify the information collected by the convolutional layer and create a condensed
version of the information contained in them.

Basic architecture of a convolutional neuronal network:


Let’s move on to implement our first convolutional neuronal network, which will consist of a
convolution followed by a max-pooling. In our case, we will have 32 filters using a 5×5 window
for the convolutional layer and a 2×2 window for the pooling layer. We will use the ReLU
activation function. In this case, we are configuring a convolutional neural network to process an
input tensor of size (28, 28, 1) and we specify it by means of the value of the argument input shape
= (28, 28,1) in our first layer.
A simple model:
And in order to build a “deep” neural network, we can stack several layers. To show the reader how
to do it, we will create a second group of layers that will have 64 filters with a 5×5 window in the
convolutional layer and a 2×2 window in the pooling layer. In this case, the number of input
channels will take the value of the 32 features that we have obtained from the previous layer,
although, as we have seen previously, it is not necessary to specify it because Keras deduces it :

26
CODE:

from flask import Flask, request, render_template, send_from_directory,session,flash

import pandas as pd

import string

import os

import mysql.connector

import numpy as np

from datetime import timedelta

import sys

from PIL import Image

import base64

import io

import re

simport PIL.Image
from datetime import datetime

app = Flask( name )

app.config['SECRET_KEY'] = 'the random string'

classes = ['System Detected Image as Glaucoma Negative',

'System Detected image as Glaucoma Positive']

27
@app.route("/")

def index():

return render_template("index.html")

@app.route("/user")

def user():

return render_template("user.html")

@app.route("/reg")

def reg():

return render_template("ureg.html")

@app.route('/regback',methods = ["POST"])

def regback():

if request.method=='POST':

name=request.form['name']

email=request.form['email']

pwd=request.form['pwd']

cpwd=request.form['cpwd']

pno=request.form['pno']

#email = request.form["email"]

print("**************")

mydb = mysql.connector.connect(

host="localhost",

user="root",

passwd="",

database="Glaucoma"

)
mycursor = mydb.cursor()

28
print("**************")

sql = "select * from ureg"

result = pd.read_sql_query(sql, mydb)

email1 = result['email'].values

print(email1)

if email in email1:

flash("email already exists","warning")

return render_template('ureg.html')

if(pwd==cpwd):

sql = "INSERT INTO ureg (name,email,pwd,pno) VALUES(%s,%s,%s,%s)"

val = (name, email, pwd, pno)

mycursor.execute(sql, val)

mydb.commit()

flash("You registered successfully", "success")

return render_template('user.html')

else:

flash("Password and Confirm Password are not same", "danger")

return render_template('ureg.html')

flash("Something wrong", "danger")

return render_template('user.html')

@app.route('/userlog',methods=['POST', 'GET'])

def userlog():

global name, name1

global user

if request.method == "POST":

username = request.form['email']

password1 = request.form['pwd']

print('p')

29
mydb = mysql.connector.connect(host="localhost", user="root", passwd="",
database="Glaucoma")

cursor = mydb.cursor()

sql = "select * from ureg where email='%s' and pwd='%s'" % (username,


password1)

print('q')

x = cursor.execute(sql)

print(x)

results = cursor.fetchall()

print(results)

if len(results) > 0:

print('r')

# session['user'] = username

# session['id'] = results[0][0]

# print(id)

# print(session['id'])
flash("Welcome to website", "success")

return render_template('userhome.html', msg=results[0][1])

else:

flash("Invalid Email/password", "danger")

return render_template('user.html')

return render_template('user.html')

@app.route("/userhome")

def userhome():

return render_template("userhome.html")

@app.route("/upload", methods=["POST","GET"])

def upload():

print('a')

myfile=request.files['file']

fn=myfile.filename

30
mypath=os.path.join('D:/Glaucoma disease detetion/images/', fn)

myfile.save(mypath)

print("{} is the file name",fn)

print ("Accept incoming file:", fn)

print ("Save it to:", mypath)

#import tensorflow as tf

import numpy as np

from tensorflow.keras.preprocessing import image

from tensorflow.keras.models import load_model

img="dataset/test/Positive/622.jpg"

new_model = load_model("D:/Glaucoma disease detetion/VGG16Model.h5")

test_image = image.load_img(mypath, target_size=(128, 128))

test_image = image.img_to_array(test_image)

test_image = np.expand_dims(test_image, axis=0)

result = new_model.predict(test_image)

prediction=classes[np.argmax(result)]

return render_template("template.html",image_name=fn, text=prediction)

@app.route('/upload/<filename>')

def send_image(filename):
return send_from_directory("D:/Glaucoma disease detetion/images", filename)

@app.route('/upload1')

def upload1():

return render_template("upload.html")

@app.route("/about")

def about():

return render_template("about.html")

if name == " main ":

app.run()

31
CHAPTER-7
TESTING

32
7. TESTING
7.1 Introduction of Testing

The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is the
process of exercising software with the intent of ensuring that the Software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of tests. Each test type addresses a specific testing requirement.

7.2 Test Objectives

 All field entries must be filled properly

 Pages must be activated in every level.

 The messages and responses must not be delayed.

7.3 Test Strategies

7.3.1 Unit Testing

Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs. All
decision branches and internal code flow should be validated. It is the testing of individual
software units of the application. It is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path of
a business process performs accurately to the documented specifications and contains
clearly defined inputs and expected results.

7.3.2 Integration Testing

Integration tests are designed to test integrated software components to determine if


they run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components
were individually satisfaction, as shown by successfully unit testing, the combination of
components is correct and consistent.

33
7.3.3 Functional Testing
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system documentation,
and user manuals. Functional testing is centered on the following items: Valid Input:
identified classes of valid input must be accepted. Invalid Input: identified classes of invalid
input must be rejected. Functions: identified functions must be exercised. Output: identified
classes of application outputs must be exercised.

7.3.4 System Testing

System testing ensures that the entire integrated software system meets requirements.
It tests a configuration to ensure known and predictable results. An example of system
testing is the configuration-oriented system integration test. System testing is based on
process descriptions and flows, emphasizing pre-driven process links and integration points.
White Box Testing White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least its
purpose. It is used to test areas that cannot be reached from a black box level. Black Box
Testing Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as most other
kinds of tests, must be written from a definitive source document, such as specification or
requirements document. The test provides inputs and responds to outputs without
considering how the software works.

7.3.5 Acceptance Testing

Acceptance testing, a testing technique performed to determine whether or not the


software system has met the requirement specifications. The main purpose of this test is to
evaluate the system's compliance with the business requirements and verify if it is has met
the required criteria for delivery to end users.

34
CHAPTER-8
SCREENSHOTS

35
8. SCREENSHOTS
Open Xampp and click on start MYSQL.

Now open SQL Yogg enterprise and connect it to mysql

36
Now open Pycharm and run your code. Then we will get the link of our webpage. Open it.

Our webpage home page looks like below

37
There are three columns in our webpage. When we click on about project column

When we click on customer/user column a login page appears as shown below.


The customer/user can sign up/login to the page

38
If the password doesnot matches with confirm password an alert message appears as below

Click on register and it navigates to login page displaying “You registered sucessfully” now login
in with the details you given while registering.

39
After successful login the result will displayed as:

Now click on upload image and upload the fundus image of the eye by clicking choose files
button

40
Now click on predict button and the result is displayed as whether the person as glaucoma or not
If the person has glaucoma the result is displayed as follows:

If the person donot has glaucoma the result is displayed as follows:

41
If you want to upload another image click on “predict another image”

Now you can logout from the page after the completion of test:

42
CHAPTER-9
CONCULSION AND FUTURE WORK

43
9. CONCULSION AND FUTURE WORK
Conclusion:
This study brings evidence that deep neural networks are a viable methodology for
medical imaging, even though they solve the task in question in a different way than virtually all
well documented past work. We find this encouraging, in particular. This study brings evidence
that deep neural networks are a viable methodology for medical imaging, even though they
solve the task in question in a different way than virtually all well-documented past work. We find
this encouraging, in particular given the entirely supervised character of the neural approach,
which learns from raw pixel data and does not rely on any prior domain knowledge on vessel
structure. While learning, a network autonomously extracts low-level features that are invariant to
small geometric variations, then gradually transforms and combines them into higher order
features. In this way, the raw raster image is transformed into a more abstract and a priori
unknown representation that fosters effective vessel segmentation. The features learned at multiple
levels of abstraction are then automatically composed into a complex function that maps an input
patch to its label. An average accuracy of 95.64% is determined in the classification of blood
vessel or not. Optic cup is also segmented from the optic disc by Fuzzy C Means Clustering
(FCM). This proposed algorithm is tested on a sample of hospital images and CDR value is
determined.
The obtained values of CDR is compared with the given values of the sample images and hence
the performance of proposed system in which Convolutional Neural Networks for segmentation is
employed, is excellent in automated detection of healthy and Glaucoma images. given the entirely
supervised character of the neural approach, which learns from raw pixel data and does
not rely on any prior domain knowledge on vessel structure. While learning, a network
autonomously extracts low-level features that are invariant to small geometric variations,
then gradually transforms and combines them into higher order features. In this way, the raw
raster image is transformed into a more abstract and a priori unknown representation that fosters
effective vessel segmentation. The features learned at multiple levels of abstraction are
then automatically composed into a complex function that maps an input patch to its label.
An average accuracy of 95.64% is determined in the classification of blood vessel or not. Optic
cup is also segmented from the optic disc by Fuzzy C Means Clustering (FCM). This proposed
algorithm is tested on a sample of hospital images and CDR value is determined. The obtained
values of CDR is compared with the given values of the sample images and hence the
performance of proposed system in which Convolutional Neural Networks for segmentation is
employed, is excellent in automated.

44
FUTURE WORK:
We will convert that model into real time application for detection of glaucoma. The
application will be easy to access to each person.

45
CHAPTER-10
REFERENCES

46
10. REFERENCES
[1] Seyed-Farzad Mohammadi, Ghasem Saeedi-Anari, Cyrus Alinia, Elham Ashrafi, Ramin
Daneshvar, and Alfred Sommer. Is screening for glaucoma necessary? a policy guide and analysis.
Journal of ophthalmic & vision research, 9(1):3, 2014.
[2] Maya M Jeyaraman, Maya Jeyaraman, William G Hodge, Cindy Hutnik, John Costella, and
Monali S Malvankar-Mehta. The effectiveness of teleglaucoma versus in-patient examination for
glaucoma screening: A systematic review and meta-analysis. 2014.
[3] Rohit Varma, Paul P Lee, Ivan Goldberg, and Sameer Kotak. An assessment of the health and
economic burdens of glaucoma. American journal of ophthalmology, 152(4):515–522, 2011.
[4] A. T. Broman H. A. Quigley. The number of people with glaucoma worldwide in 2010 and
2020. British Journal of Ophthalmology, 90:262—-267, 2006.
[5] J.C. Rueda, D.P. Lesmes, J. C. Parra, R. Urrea, J.J. Rey, L.A. Rodriguez, C.A. Wong, and V.
Galvis. Valores de paquimetr´ıa en personas sanas y con glaucoma en una poblacion Colombiana.
´ MedUNAB, 10(2):81–85, 2007.
[6] Ministerio de Salud y Proteccion Social. An ´ alisis de situaci ´ on de ´ salud visual en
Colombia, 2016.
[7] S. S. Kanse and D. M. Yadav. Retinal fundus image for glaucoma detection: A review and
study. Journal of Intelligent Systems, 28(1):43– 56, 2017.
[8] S. Nawaldgi. Review of automated glaucoma detection techniques. In 2016 International
Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), pages
1435–1438, 2016.
[9] C. Anusorn, W. Kongprawechnon, T. Kondo, S. Sintuwong, and K. Tungpimolrut. Image
processing techniques for glaucoma detection using the cup-to-disc ratio. Science and Technology
Asia, 18(1):22–34, 2013.
[10] C. Dhumane and S.B. Patil. Automated glaucoma detection using cup to disc ratio.
International Journal of Innovative Research in Science, Engineering and Technology, 4(7):5209–
5216, 2015.
[11] J. Ayub, J. Ahmad, J. Muhammad, L. Aziz, S. Ayub, U. Akram, and I. Basit. Glaucoma
detection through optic disc and cup segmentation using K-mean clustering. In 2016 International
Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pages 143–147,
2016.
[12] S.M. Nikam and C.Y. Patil. Glaucoma detection from fundus images using matlab gui. In
2017 3rd International Conference on Advances in Computing, Communication & Automation
(ICACCA)(Fall), pages 1–4, 2S017.

47
[13] Jyotiprava Dash and Nilamani Bhoi. A thresholding based technique to extract retinal blood
vessels from fundus images. Future Computing and Informatics Journal, 2(2):103–109, 2017.
[14] Jose Abel De La Fuente-Arriaga, Edgardo M Felipe-River ´ on, and ´ Eduardo Garduno-
Calder ˜ on. Application of vascular bundle displace- ´ ment in the optic disc for glaucoma
detection using fundus images. Computers in biology and medicine, 47:27–35, 2014.

48

You might also like