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.
- 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
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 |
- Python 3.8+
- Node.js 16+
- npm or yarn
- Git
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
-
Clone the repository
git clone https://github.com/gaurav241102/diabetic-retinopathy-detection.git cd diabetic-retinopathy-detection
-
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
-
Start the backend server
uvicorn main:app --reload
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
-
Install dependencies
cd ../frontend npm install
-
Start the development server
npm run dev
- Access at: http://localhost:5173
Contributions are what make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- APTOS 2019 Blindness Detection for the dataset
Gaurav Prakash - @yourtwitter - [email protected]
Project Link: [https://github.com/gaurav241102/diabetic-retinopathy-detection]
- Open the frontend in your browser (default:
http://localhost:5173
) - Upload a retinal fundus image using the interface
- The system will process the image and display the predicted DR grade
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
- 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