Update README.md
Browse files
README.md
CHANGED
@@ -17,18 +17,97 @@ license: mit
|
|
17 |
Efficiently process large datasets & develop advanced model pipelines for diabetic retinopathy detection. Streamlining diagnosis.
|
18 |
|
19 |
## TL;DR:
|
20 |
-
In this project,
|
21 |
|
|
|
|
|
|
|
22 |
|
|
|
|
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
## Gradio - Diabetic Retinopathy Detection App
|
27 |
<!--
|
28 |
<iframe src="https://bhimrazy-diabetic-retinopathy-detection.hf.space" frameborder="0" width="1920" height="1080"></iframe>
|
29 |
-->
|
30 |
### Overview
|
31 |
-
Welcome to
|
32 |
|
33 |
### Try It Out
|
34 |
Use the interactive interface below to upload retinal images and get predictions on diabetic retinopathy severity.
|
@@ -43,8 +122,6 @@ Use the interactive interface below to upload retinal images and get predictions
|
|
43 |
3. Once the image is uploaded, the model will process it and provide predictions on the severity of diabetic retinopathy.
|
44 |
4. Interpret the results provided by the model.
|
45 |
|
46 |
-
|
47 |
-
|
48 |
## License
|
49 |
|
50 |
[MIT](./LICENSE)
|
|
|
17 |
Efficiently process large datasets & develop advanced model pipelines for diabetic retinopathy detection. Streamlining diagnosis.
|
18 |
|
19 |
## TL;DR:
|
20 |
+
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.
|
21 |
|
22 |
+
## Getting Started
|
23 |
+
**Introduction:**
|
24 |
+
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.
|
25 |
|
26 |
+
**Get Started with the Project Studio:**
|
27 |
+
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).
|
28 |
|
29 |
+
**What the Studio Offers:**
|
30 |
+
- Efficient Handling of Large Datasets: The studio automates the management of large datasets, including downloading, extracting, and data preparation.
|
31 |
+
- Advanced Model Development: Utilizing PyTorch Lightning, the studio facilitates the development of a sophisticated system for DR detection, categorizing images into different disease stages.
|
32 |
+
- Integration of Pretrained Backbone Models: Various pretrained backbone models are integrated into the pipeline, allowing for experimentation with different architectures.
|
33 |
+
- Progress Tracking with TensorBoard: Researchers can monitor progress seamlessly with TensorBoard integration, tracking metrics and visualizing model performance.
|
34 |
+
- User-Friendly Web Application: A user-friendly web application is provided for showcasing model capabilities and sharing findings effortlessly.
|
35 |
|
36 |
|
37 |
+
Here's a more structured and standardized version of the steps in a blog format:
|
38 |
+
|
39 |
+
---
|
40 |
+
|
41 |
+
## Downloading and Preprocessing Diabetic Retinopathy Dataset:
|
42 |
+
|
43 |
+
> Note: You can skip this entire step, as this studio already has it done for you.
|
44 |
+
|
45 |
+
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.
|
46 |
+
|
47 |
+
### Prerequisites
|
48 |
+
|
49 |
+
Before we begin, ensure you have the following prerequisites:
|
50 |
+
|
51 |
+
- Kaggle API key (Get one [here](https://www.kaggle.com/account/login?phase=startRegisterTab&returnUrl=%2Faccount%2Flogin%3Fphase%3Dregister))
|
52 |
+
- `kaggle` library installed (`pip install kaggle`)
|
53 |
+
|
54 |
+
**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:
|
55 |
+
```bash
|
56 |
+
cd dr-detection
|
57 |
+
pip install -r requirements.txt
|
58 |
+
```
|
59 |
+
|
60 |
+
## Step 1: Download the Dataset
|
61 |
+
|
62 |
+
There are two ways to download the dataset:
|
63 |
+
|
64 |
+
### First Way: Downloading as a Complete Zip File
|
65 |
+
|
66 |
+
```bash
|
67 |
+
kaggle competitions download -c diabetic-retinopathy-detection
|
68 |
+
|
69 |
+
# Extract
|
70 |
+
unzip diabetic-retinopathy-detection.zip -d data/diabetic-retinopathy-detection
|
71 |
+
rm diabetic-retinopathy-detection.zip
|
72 |
+
```
|
73 |
+
|
74 |
+
### Second Way: Downloading as Parts
|
75 |
+
|
76 |
+
```bash
|
77 |
+
./scripts/download-dr-dataset.sh
|
78 |
+
|
79 |
+
# Merge and extract the parts
|
80 |
+
./scripts/merge_and_extract.sh
|
81 |
+
```
|
82 |
+
|
83 |
+
## Step 2: Preprocess Images
|
84 |
+
|
85 |
+
Once the dataset is downloaded, preprocess the images to crop and resize them.
|
86 |
+
|
87 |
+
<div align="center">
|
88 |
+
<img src="https://github.com/bhimrazy/diabetic-retinopathy-detection/assets/46085301/9fa28dea-38cd-4fba-abb0-0ed8001a8075" alt="Preprocessing Image" height="400" width="auto">
|
89 |
+
<p style="text-align:center;">Example of cropping and resizing</p>
|
90 |
+
</div>
|
91 |
+
|
92 |
+
```bash
|
93 |
+
python scripts/crop_and_resize.py --src data/diabetic-retinopathy-dataset/train data/diabetic-retinopathy-dataset/resized/train
|
94 |
+
python scripts/crop_and_resize.py --src data/diabetic-retinopathy-dataset/test data/diabetic-retinopathy-dataset/resized/test
|
95 |
+
```
|
96 |
+
|
97 |
+
## Step 3: Split Data and Save to CSV
|
98 |
+
|
99 |
+
Finally, split the data into train and validation sets and save them to CSV files.
|
100 |
+
|
101 |
+
```bash
|
102 |
+
python scripts/split_dataset.py
|
103 |
+
```
|
104 |
+
|
105 |
## Gradio - Diabetic Retinopathy Detection App
|
106 |
<!--
|
107 |
<iframe src="https://bhimrazy-diabetic-retinopathy-detection.hf.space" frameborder="0" width="1920" height="1080"></iframe>
|
108 |
-->
|
109 |
### Overview
|
110 |
+
Welcome to Diabetic Retinopathy Detection App! This app utilizes deep learning models to detect diabetic retinopathy in retinal images. Diabetic retinopathy is a common complication of diabetes and early detection is crucial for effective treatment.
|
111 |
|
112 |
### Try It Out
|
113 |
Use the interactive interface below to upload retinal images and get predictions on diabetic retinopathy severity.
|
|
|
122 |
3. Once the image is uploaded, the model will process it and provide predictions on the severity of diabetic retinopathy.
|
123 |
4. Interpret the results provided by the model.
|
124 |
|
|
|
|
|
125 |
## License
|
126 |
|
127 |
[MIT](./LICENSE)
|