Skip to content

This project is based on ResNet101 and YOLOv8 to detect the focus that cause high myopia

License

Notifications You must be signed in to change notification settings

Cx33032/pathological-myopia-detection

Repository files navigation

Pathological High Myopia Detection

This project is based on ResNet101 and YOLOv8 to detect the focus that cause high myopia

Ackowledgement

I do not have much specialize knowledge on ophthalmology and I am doing this because this is a meaningful project to learn and deploy. If there is any problems related to my contents, welcome to pull request or post and issue. Thanks a lot!

Table of Content

Final Product

In the webui, the user can upload an ultra high definition fundus image and type in the name

input

The program will run classification model and trained YOLOv8 model to identify the focus (Labeled image and word result)

output

After identification, the program will summarize all of the data into a pdf file

pdf
Output File

Dataset Preparation

The dataset can be divided into two parts:

Classification

The Classification is mainly classifying the pictures with leopard-spot lesion or not.

There are two directory under classification:

├─dataset
   ├─classification
      ├─train   <- Training
      │  ├─no       <- Without leopard-spot lesion
      │  └─yes      <- With leopard-spot lesion
      └─val     <- Validation
          ├─no
          └─yes

Detection

Focus list:

Name Label
peripapillary atrophy PPA
macular degeneration MD
vitreous opacities weiss
drusen DR
optic disc OD
fuchs dystrophy Fuch

Peripapillary Atrophy (PPA)

Peripapillary atrophy describes atrophy or thinning in the layers of the retina and retinal pigment epithelium around the optic nerve in the back of the eye

PPA

Macular Degeneration (MD)

Age-related macular degeneration is the most common cause of severe loss of eyesight among people 50 and older. Only the center of vision is affected with this disease. It is important to realize that people rarely go blind from it.

MD

Vitreous Opacities (weiss)

Vitreous opacities are floating objects inside the vitreous body. They can be of different sizes, shapes and densities. New objects are treated conservatively, and laser treatment is not usually indicated until the floaters stabilize in size and density.

weiss

Drusen (DR)

Drusen bodies are extracellular deposits of lipids, proteins, and cellular debris which are found within the layers of the retina and appear as small, yellow deposits on dilated eye exams.

DR

Optic Disc (OD)

The optic disc is the round spot on the retina formed by the passage of the axons of the retinal ganglion cells, which transfer signals from the photoreceptors of the eye to the optic nerve, allowing us to see.

OD

Fuchs Dystrophy (Fuchs)

Fuchs (pronounced "fooks") dystrophy is an eye disease in which cells lining the inner surface of the cornea slowly start to die off. The disease most often affects both eyes.

Quick Start

Install Dependencies

Installastion of PyTorch: link

pip install -r requirements.txt

Train the classification model (Default is ResNet18)

python classification.py 

or use jupyter notebook to run

The training result of ResNet18 with pre-trained model:

ResNet18_Result

Train YOLOv8 detection model

python yolo.py

or use jupyter notebook to run

The training result of YOLOv8 with pre-trained model yolov8s.pt:

YOLO_Result

Run the webui

Usage: python webui.py [options]

A common command: python webui.py

-l --language       Language of the UI site

Reference

About

This project is based on ResNet101 and YOLOv8 to detect the focus that cause high myopia

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published