Skip to content

gaurav241102/diabetic-retinopathy-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘οΈ RetinaScan: Diabetic Retinopathy Detection

A deep learning-powered web application that helps detect and classify Diabetic Retinopathy from retinal fundus images. Built with a FastAPI backend and React frontend.

✨ Key Features

  • 5-Stage Classification: Detects and grades Diabetic Retinopathy from No DR to Proliferative DR
  • Real-time Analysis: Get instant predictions with confidence scores
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Developer Friendly: Well-documented API with Swagger UI
  • Easy Deployment: Docker support for hassle-free setup

πŸ›  Tech Stack

Area Technologies
Frontend React 18, TypeScript, Tailwind CSS, Vite
Backend FastAPI, Python 3.8+
ML/DL PyTorch, OpenCV
Deployment Docker, GitHub Actions
CI/CD GitHub Actions

πŸ“Έ Screenshots

image image image

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • npm or yarn
  • Git

πŸ“ Project Structure

diabetic-retinopathy-detection/
β”œβ”€β”€ backend/                     # Python FastAPI backend
β”‚   β”œβ”€β”€ main.py                  # FastAPI application entry point
β”‚   β”œβ”€β”€ model.py                 # Deep learning model implementation
β”‚   β”œβ”€β”€ preprocess.py            # Image preprocessing utilities
β”‚   β”œβ”€β”€ requirements.txt         # Python dependencies
β”‚   β”œβ”€β”€ trained_model.pth        # Trained PyTorch model
β”‚   └── test_model.py            # Model testing script
β”œβ”€β”€ frontend/                    # React frontend
β”‚   β”œβ”€β”€ public/                  # Static files
β”‚   └── src/
β”‚       β”œβ”€β”€ components/         # Reusable UI components
β”‚       β”œβ”€β”€ pages/               # Application pages
β”‚       β”œβ”€β”€ App.tsx              # Main application component
β”‚       └── main.tsx             # Application entry point
β”œβ”€β”€ .github/                     # GitHub configurations
β”‚   └── workflows/               # GitHub Actions workflows
β”œβ”€β”€ .gitignore                   # Git ignore file
β”œβ”€β”€ docker-compose.yml           # Docker Compose configuration
β”œβ”€β”€ Dockerfile                   # Docker configuration
β”œβ”€β”€ LICENSE                      # Project license
└── README.md                    # Project documentation

πŸ’» Local Development

Backend Setup

  1. Clone the repository

    git clone https://github.com/gaurav241102/diabetic-retinopathy-detection.git
    cd diabetic-retinopathy-detection
  2. Set up Python environment

    # Create and activate virtual environment
    python -m venv venv
    .\venv\Scripts\activate  # Windows
    # source venv/bin/activate  # Mac/Linux
    
    # Install dependencies
    cd backend
    pip install -r requirements.txt
  3. Start the backend server

    uvicorn main:app --reload

Frontend Setup

  1. Install dependencies

    cd ../frontend
    npm install
  2. Start the development server

    npm run dev

🀝 Contributing

Contributions are what make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ™ Acknowledgments


Built with ❀️ by Gaurav

πŸ“¬ Contact

Gaurav Prakash - @yourtwitter - [email protected]

Project Link: [https://github.com/gaurav241102/diabetic-retinopathy-detection]

Usage

  1. Open the frontend in your browser (default: http://localhost:5173)
  2. Upload a retinal fundus image using the interface
  3. The system will process the image and display the predicted DR grade

API Endpoints

  • POST /predict/ - Accepts an image file and returns the predicted DR grade
    • Request: Form-data with key 'file' containing the image
    • Response: JSON with 'grade' and 'confidence' fields

Notes

  • The model expects retinal fundus images in JPG or PNG format
  • For best results, use high-quality images with proper lighting and focus
  • The system is designed for screening purposes only and should not replace professional medical diagnosis

About

Automated Early Detection of Diabetic Retinopathy Using Deep Learning on Retinal Fundus Images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •