Skip to content

Create a machine learning model that could detect diabetic retinopathy disease in retinal images

Notifications You must be signed in to change notification settings

abiwinanda/diabetic-retinopathy-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diabetic Retinopathy Detection

This project aims to develop a machine learning model capable of detecting diabetic retinopathy from retinal images.

Table of Contents


Project Structure

The repository contains the following files and directories:

  • label-rule.json: Contains labeling rules for the dataset.
  • preprocess.py: Script for preprocessing images.
  • seperate-dataset.py: Script to separate the dataset into training and validation sets.
  • train.py: Script to train the machine learning model.
  • utility: Directory containing utility functions and modules:
    • model.py: Defines the machine learning model architecture and training functions.

Setup Instructions

To set up the project on your local machine, follow these steps:

1. Clone the Repository

git clone https://github.com/abiwinanda/diabetic-retinopathy-detection.git
cd diabetic-retinopathy-detection

2. Create a Virtual Environment

It is recommended to use a virtual environment to manage dependencies.

python3 -m venv venv
source venv/bin/activate  # On Windows, use venv\Scripts\activate

3. Install Dependencies

Ensure you have the required Python packages installed. Since the repository doesn't provide a requirements.txt, you may need to install the dependencies manually based on the imports in the scripts.

For example:

pip install numpy pandas tensorflow opencv-python

Usage

The project involves three main steps: data preprocessing, dataset separation, and model training.

1. Data Preprocessing

Run the preprocess.py script to preprocess the retinal images. This may include resizing, normalization, and other image enhancement techniques.

python preprocess.py

Ensure that the script points to the correct directory containing your raw images.

2. Dataset Separation

Separate the dataset into training and validation sets using the seperate-dataset.py script.

python seperate-dataset.py

This script organizes your data into appropriate directories for training and validation.

3. Model Training

Train the machine learning model using the train.py script.

python train.py

The training script utilizes the model architecture defined in utility/model.py.


Utility Functions

The utility/ directory contains helper functions and modules. Below is an overview of the most important module:

  • model.py
    • Defines the model architecture.
    • Includes training-related functions such as:
      • train_model(): Handles the training loop, including forward propagation, loss calculation, and backpropagation.
      • get_trainable_params(): Identifies and returns the parameters of the model that should be updated during training.

Refer to model.py for details.

About

Create a machine learning model that could detect diabetic retinopathy disease in retinal images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages