Skip to content

Web-based semi-automated retinal fluid segmentation tool for OCT images. Combines traditional image processing with deep learning models (U-Net, MedSAM) to help medical professionals efficiently annotate and segment retinal fluid regions. Features interactive annotation tools, multiple segmentation algorithms, and user-friendly web interface.

License

Notifications You must be signed in to change notification settings

sinemistoktas/KITE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

219 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KITE: Web-Based Semi-Automated Retinal Fluid Segmentation Tool

Light Theme

An interactive web application for segmenting retinal fluid regions in OCT images

Screenshots β€’ Installation β€’ Usage

🩺 Overview

KITE is a web-based tool designed to assist medical professionals in segmenting retinal fluid regions in Optical Coherence Tomography (OCT) images. The tool combines traditional image processing techniques with state-of-the-art deep learning models to provide accurate, efficient, and user-friendly medical image annotation.

Key Features

  • πŸ–ΌοΈ Interactive Annotation Tools: Point, line, box, and fill tools for precise manual annotation
  • πŸ€– Multiple Segmentation Algorithms:
    • KITE Algorithm: Custom region-growing approach using OpenCV
    • U-Net: Deep learning model trained on DUKE OCT dataset
    • MedSAM: Foundation model for medical image segmentation
  • 🌐 Web-Based Interface: Django based
  • πŸ“Š Real-Time Processing: Fast segmentation with immediate visual feedback
  • πŸ’Ύ Export Capabilities: Download results in PNG and NPY formats
  • 🎨 Layer Management: Organize and edit multiple segmentation layers

🎯 Applications

  • Clinical Research: Generate annotated datasets for training ML models
  • Medical Education: Teaching tool for understanding retinal pathology
  • Ophthalmology Practice: Assist in diagnosis and treatment planning

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚     Backend      β”‚    β”‚   AI Models     β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β€’ HTML/CSS/JS   │◄──►│ β€’ Django REST    │◄──►│ β€’ U-Net         β”‚
β”‚ β€’ Konva.js      β”‚    β”‚ β€’ Image Pipeline β”‚    β”‚ β€’ MedSAM        β”‚
β”‚ β€’ Annotation    β”‚    β”‚ β€’ File Handling  β”‚    β”‚ β€’ Traditional   β”‚
β”‚   Tools         β”‚    β”‚                  β”‚    β”‚   CV Methods    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Installation

Prerequisites

  • Python 3.8+
  • Node.js (for frontend dependencies)
  • CUDA-compatible GPU (optional, for faster deep learning inference)

1. Clone the Repository

git clone https://github.com/your-username/KITE.git
cd KITE

2. Set Up Python Environment

Using conda (recommended):

conda create --name kite-env python=3.10
conda activate kite-env

Using venv:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Download Model Weights

To use the MedSAM segmentation model, you need to manually download the model weights.

Instructions are provided in: models/README.md

5. Database Setup

cd website
python manage.py migrate
python manage.py collectstatic

6. Run the Application

python manage.py runserver

Visit http://localhost:8000 to access the application.

πŸ“– Usage

Quick Start

  1. Select Algorithm: Choose between KITE, U-Net, or MedSAM
  2. Upload Image: Upload your OCT image (JPEG format) or choose provided the demo image
  3. Annotate (if using KITE / MedSAM): Use annotation tools to mark regions of interest
  4. Segment: Click "Ready to Segment!" to process the image
  5. Edit: Refine results using manual editing tools
  6. Export: Download segmentation masks in your preferred format

Note: It is possible to upload previous annotations or mask results and edit them in KITE mode.

Detailed Workflows

KITE Algorithm Workflow

Upload Image β†’ Annotate ROI β†’ Traditional Segmentation β†’ Manual Refinement β†’ Export

U-Net Workflow

Upload Image β†’ Automatic Segmentation β†’ Manual Refinement β†’ Export

MedSAM Workflow

Upload Image β†’ Draw Bounding Boxes β†’ AI Segmentation β†’ Manual Refinement β†’ Export

πŸ› οΈ Technology Stack

Frontend

  • HTML5/CSS3: Modern web standards
  • JavaScript: Interactive functionality
  • Konva.js: Canvas-based annotation tools

Backend

  • Django: Web framework and REST API
  • Python: Core programming language
  • OpenCV: Traditional image processing
  • NumPy/SciPy: Scientific computing

Deep Learning

  • PyTorch: Deep learning framework
  • U-Net: Custom trained model on DUKE dataset
  • MedSAM: Foundation model integration

πŸ“· Screenshots

(from KITE mode)

  • Annotation

Annotation

  • Segmentation

Segmentation

  • Mask Layers

Segmentation

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘₯ Team

KoΓ§ University COMP 491 Capstone Project Team

  • Duru Tandoğan
  • Mislina AkΓ§a
  • Sinemis Toktaş
  • YamaΓ§ Γ–mΓΌr

Project Advisor: Γ‡iğdem GΓΌndΓΌz Demir – KoΓ§ University

πŸ™ Acknowledgments

  • DUKE University OCT Dataset
  • U-Net and MedSAM research communities
  • OpenCV and PyTorch communities

πŸ“ˆ Future Work

  • Integration with additional clinical data (text, metadata)
  • Support for other medical imaging modalities (MRI, CT)
  • Real-time collaborative annotation
  • Advanced AI model fine-tuning capabilities
  • Clinical validation studies

πŸ“š References

  1. Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional networks for biomedical image segmentation.
  2. Ma, J., He, Y., Li, F., et al. (2024). Segment anything in medical images. Nature Communications.

About

Web-based semi-automated retinal fluid segmentation tool for OCT images. Combines traditional image processing with deep learning models (U-Net, MedSAM) to help medical professionals efficiently annotate and segment retinal fluid regions. Features interactive annotation tools, multiple segmentation algorithms, and user-friendly web interface.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5