This project implements a web application for classifying Diabetic Retinopathy (DR) in retinal fundus images using a pre-trained deep learning model and Flask for the backend.
This project combines a pre-trained CNN model for DR classification with a user interface built using HTML, CSS, and JavaScript. Users can upload retinal fundus images, and the system will predict the presence and severity of DR based on the model's output.
Key Components:
- Frontend (HTML, CSS, JS): A user interface designed with HTML, styled with CSS, and potentially uses JavaScript for interactivity. It allows users to upload images, visualize results, and potentially provide feedback.
- Backend (Flask): A Python Flask application handles user interaction, image uploads, communication with the pre-trained model, and returns the classification results.
- Pre-trained CNN Model: A pre-trained CNN model, trained on a large dataset of retinal fundus images with corresponding DR grades, performs the actual image classification.
DR Classes:
The pre-trained model will likely classify the uploaded image into one of several DR classes, such as:
- No DR
- Mild DR
- Moderate DR
- Severe DR
- Proliferative DR
The specific classes and their definitions will depend on the chosen pre-trained model.
A good resource for obtaining a dataset of retinal fundus images with corresponding DR grades is https://www.kaggle.com/datasets/ascanipek/eyepacs-aptos-messidor-diabetic-retinopathy. This dataset contains over 92,000 images from various sources and provides labels for each image indicating the presence and severity of DR.
Choosing a pre-trained model often involves considering the dataset it was trained on. Ensure compatibility between the DR classes used in your chosen dataset and the model's output classes.
- Accessibility: Enables easy access to DR screening for individuals who might not have immediate access to medical professionals.
- Quick Results: Provides real-time classification based on the model's prediction.
- User-Friendly Interface: Simplifies the DR screening process for users without technical expertise.
- Python: Required for Flask and any additional libraries used for image processing or model interaction.
- Flask: Python web framework for building the backend server.
- HTML, CSS, JS: Technologies for building the user interface.
Requirements:
The specific Python libraries required for this project will be listed in a file named requirements.txt. You can install these dependencies using the following command:
pip install -r requirements.txt- Project Setup:
- Clone or download the project repository.
- Install the required Python libraries using
pip install -r requirements.txt. - Develop the Flask app to handle image uploads, model interaction, and result presentation.
- The Flask app should process the uploaded image, use the model to predict the DR class, and return the predicted class and potentially a confidence score.
- Design the user interface using HTML, CSS, and potentially JavaScript.
- The UI should allow users to upload images and display the predicted DR class and confidence score in a clear and user-friendly manner.
- Integrate the pre-trained model with your Flask app.
- Running the Application:
- Run the Flask application using
flask run. - Access the application URL in your browser (typically
http://127.0.0.1:5000/).
- Run the Flask application using
- Image Upload and Classification:
- Users can upload retinal fundus images through the provided interface.
- The Flask app processes the image, interacts with the model, and displays the predicted DR class and potentially a confidence score.
Disclaimer: This application is for informational purposes only and should not be used for medical diagnosis. Always consult a qualified healthcare professional for any medical concerns regarding DR.
- This
README.mdwill be further updated with code examples for the Flask app and potential frontend design suggestions. - Security considerations for handling user-uploaded images will be addressed.
- Resources on pre-trained CNN models for DR classification will be provided, including information about the specific DR classes used by the model.
This project demonstrates a Flask-based web application for DR screening. Remember, the provided results should be used alongside consultations with medical professionals.
If you have any questions or feedback about this project, you can reach the developer, Rudra Patidar, at [rudrapatidar3@gmail.com]