DL Assignment 1
DL Assignment 1
NATIONAL INSTITUTE OF
TECHNOLOGY DELHI
Session (2024-2025)
Assignment 1
“Deep Learning”
Introduction
Retinal diseases are a leading cause of vision impairment worldwide. Early detection
of retinal lesions plays a crucial role in preventing irreversible vision loss. In this
project, we focus on segmenting retinal lesions from a dataset of retina images. This
process involves using image segmentation techniques to identify specific regions in
retinal images that correspond to lesions such as Exudates (EX), Macular Edema
(ME), Retinal Exudates (SE), and Hemorrhages (HE). The primary goal is to train a
model that can accurately identify one type of lesion, chosen from the four, and
evaluate its performance using established metrics such as Intersection over Union
(IoU) and Average Precision (AP).
This report details the approach used to perform image segmentation, including data
preprocessing, model architecture, training process, and performance evaluation.
Objective
The primary objective of this project is to develop a deep learning-based image
segmentation model to identify and delineate retinal lesions in medical images.
Retinal lesions, such as exudates, macular edema, and hemorrhages, are critical
indicators of severe eye conditions, including diabetic retinopathy. Early and precise
detection of these lesions is crucial for timely diagnosis and treatment, potentially
preventing vision impairment or blindness.
In this study, we aim to segment lesions from a given dataset consisting of retinal
images, where each image has corresponding masks for different lesion types. The
dataset is structured into training, validation, and test sets, with separate folders
containing images and labeled segmentation masks.
To achieve this goal, we will:
1. Select One Lesion Type: Among the four available lesion masks (EX, ME,
SE, HE), we will choose one type for segmentation.
3. Train the Model: Use the training dataset to optimize the model parameters
and improve its ability to distinguish between lesion and non-lesion regions.
4. Validate and Test the Model: Evaluate the model’s performance on unseen
validation and test sets to ensure its accuracy and generalizability.
5. Measure Performance Using IoU and AP: Assess the effectiveness of the
model using Intersection over Union (IoU) and Average Precision (AP), which
are standard evaluation metrics in image segmentation tasks.
Methodology
Model Architecture
1. Data Preprocessing: The images are resized to a standard dimension. Both
the input images and the corresponding label masks are normalized to ensure
that the model can learn efficiently.
2. Data Augmentation: Techniques like flipping, rotating, and cropping are
applied to increase the diversity of the training data and prevent overfitting.
3. Loss Function: The model is trained using the binary cross-entropy loss
function, which is effective for pixel-wise classification tasks like
segmentation.
4. Optimizer: Adam optimizer is used to minimize the loss during training due to
its adaptive learning rate properties.
The model is trained for several epochs until convergence, and the best-performing
model is selected based on validation performance.
Evaluation Metrics
The performance of the segmentation model is evaluated using two primary metrics:
1. Intersection over Union (IoU): This metric calculates the overlap between the
predicted segmentation mask and the ground truth mask. It is defined as:
Higher values of IoU indicate better performance.
2. Average Precision (AP): This metric evaluates the precision-recall tradeoff by
computing the area under the precision-recall curve. A higher AP indicates
better overall model accuracy in detecting lesions.
These metrics will be computed for the chosen lesion type (e.g., EX) on the test and
validation datasets.
These results indicate that the model performs well in identifying retinal lesions, with
a high degree of accuracy and precision. The slight improvement on the validation
set compared to the test set suggests that the model may have slightly overfitted to
the test set, but overall, it generalizes well.
Output(For EX) IoU AP(Average Precision)
Conclusion
In this project, we successfully implemented a deep learning-based image
segmentation model to identify retinal lesions in retinal images. The U-Net model
was trained on a dataset containing various lesion types, and we focused on
segmenting one specific lesion type. The model performed well, achieving high IoU
and average precision scores, demonstrating its effectiveness in automated retinal
lesion detection.