--- title: Diabetic Retinopathy Detection App emoji: 🐢 colorFrom: blue colorTo: purple sdk: gradio sdk_version: 4.22.0 app_file: app.py license: mit --- ![diabetic-retinopathy-detection](https://github.com/bhimrazy/diabetic-retinopathy-detection/assets/46085301/bb45b4cf-9441-435f-819a-176226e1ac00) # Diabetic Retinopathy Detection: Utilizing Multiprocessing for Processing Large Datasets and Transfer Learning to Fine-Tune Deep Learning Models Efficiently process large datasets & develop advanced model pipelines for diabetic retinopathy detection. Streamlining diagnosis. ## TL;DR: In this project, large datasets are efficiently handled by downloading, extracting, and preparing them for analysis. Utilizing PyTorch Lightning, a robust system for diabetic retinopathy detection is developed, categorizing images into distinct disease stages. The model pipeline is enriched with various pretrained backbone models, with progress tracked using TensorBoard. Furthermore, a user-friendly web app is created to showcase the model's capabilities. The approach pursued aims to streamline both data processing and model development, facilitating accurate and accessible diabetic retinopathy diagnosis. ## Getting Started **Introduction:** Diabetic retinopathy (DR) remains a significant global health concern, with early detection playing a critical role in preventing vision loss. For those eager to contribute to this vital area of research, a comprehensive project studio is readily available. This studio has already tackled many essential tasks involved in DR detection, providing researchers and enthusiasts with a ready-to-use platform for experimentation. **Get Started with the Project Studio:** Researchers and enthusiasts alike can access the necessary tools and resources by duplicating this project studio. This streamlined solution offers an immediate starting point for experimentation on the [Diabetic Retinopathy Dataset](https://www.kaggle.com/c/diabetic-retinopathy-detection). **What the Studio Offers:** - Efficient Handling of Large Datasets: The studio automates the management of large datasets, including downloading, extracting, and data preparation. - Advanced Model Development: Utilizing PyTorch Lightning, the studio facilitates the development of a sophisticated system for DR detection, categorizing images into different disease stages. - Integration of Pretrained Backbone Models: Various pretrained backbone models are integrated into the pipeline, allowing for experimentation with different architectures. - Progress Tracking with TensorBoard: Researchers can monitor progress seamlessly with TensorBoard integration, tracking metrics and visualizing model performance. - User-Friendly Web Application: A user-friendly web application is provided for showcasing model capabilities and sharing findings effortlessly. Here's a more structured and standardized version of the steps in a blog format: --- ## Downloading and Preprocessing Diabetic Retinopathy Dataset: > Note: You can skip this entire step, as this studio already has it done for you. In this step, we'll walk through the process of downloading and preprocessing the Diabetic Retinopathy Detection dataset. This dataset is commonly used for developing algorithms to identify diabetic retinopathy in eye images. ### Prerequisites Before we begin, ensure you have the following prerequisites: - Kaggle API key (Get one [here](https://www.kaggle.com/account/login?phase=startRegisterTab&returnUrl=%2Faccount%2Flogin%3Fphase%3Dregister)) - `kaggle` library installed (`pip install kaggle`) **Note:** Before proceeding with the steps below, make sure to change your current directory to `dr-detection` and install the required dependencies by running the following commands: ```bash cd dr-detection pip install -r requirements.txt ``` ## Step 1: Download the Dataset There are two ways to download the dataset: ### First Way: Downloading as a Complete Zip File ```bash kaggle competitions download -c diabetic-retinopathy-detection # Extract unzip diabetic-retinopathy-detection.zip -d data/diabetic-retinopathy-detection rm diabetic-retinopathy-detection.zip ``` ### Second Way: Downloading as Parts ```bash ./scripts/download-dr-dataset.sh # Merge and extract the parts ./scripts/merge_and_extract.sh ``` ## Step 2: Preprocess Images Once the dataset is downloaded, preprocess the images to crop and resize them.
Example of cropping and resizing