You are on page 1of 23

IRIS Segmentation

Group members: Supervised by:


Omar Osama 20107848 Dr.Aliaa Youssef
Ali Mahmoud 20105724
Eng.Engy Ehab
Table of contents
1 Introduction
2 Problem statement
3 dataset
4 pipeline

5 Pre-processing

6 Evaluation

7 run
Introduction

1
Introduction
Iris segmentation is the process of isolating
the iris region from an image. The primary
task of segmentation is to determine pixels in
the image that correspond to the iris
region. Iris segmentation is a critical
component of any iris biometric system;
inaccuracies in localizing the iris can
severely impact the matching accuracy of
the system, thereby undermining its
utility.The segmentation process is
challenging due to the presence of the pupil,
eyelids, eyelashes, and sclera in the image .
Problem Statement
Background:
Eye Health is Crucial: The health of the eyes is paramount for overall well-being and quality of life. Early detection of eye abnormalities is
essential for effective intervention and preventing vision impairment.
Iris as a Unique Identifier: The iris, with its distinctive patterns and characteristics, serves as a unique identifier similar to a fingerprint.
Analyzing iris patterns can provide valuable insights into an individual's eye health.

Objectives:

1. Early Detection of Eye Abnormalities:


The primary objective is to develop a system for the early detection of potential eye abnormalities by analyzing iris patterns.
2. Automated Iris Segmentation:
Implement an automated iris segmentation algorithm to isolate the iris region from eye images. This segmentation is crucial
for detailed analysis.
3. Medical Applications:
In medical imaging, iris segmentation can be used for diagnostic purposes or as a part of a broader system for eye health
monitoring.
Problem Statement
Target Users:

The system is designed to benefit individuals seeking a convenient and accessible method for eye health assessment. This
includes people in both urban and rural settings.

Challenges:
The project acknowledges potential challenges, including variability in iris patterns, the need for robust algorithms, and ensuring
accuracy and reliability in health assessments.

Conclusion:
In conclusion, this project addresses a critical need for early and accessible eye health assessments. By leveraging iris
segmentation and recognition technologies, we aim to provide a user-friendly platform that complements traditional
examinations, ultimately contributing to the improvement of eye health outcomes. As we embark on this journey, we
anticipate overcoming challenges, fostering innovation, and making a meaningful impact on individuals' lives through
enhanced eye health care.
Dataset
OpenEDS (Open Eye Dataset) is a large scale data set of
eye-images captured using a virtual-reality (VR) head
mounted display mounted with two synchronized
eyefacing cameras at a frame rate of 200 hertz under
controlled illumination, dataset contain 12,759 image

https://www.kaggle.com/datasets/soumicksarker/op
eneds-dataset
Pipeline
Step 1 :Input image
In the first step of our iris segmentation pipeline, we
begin by loading the input image that we want to
process. The image is read from the specified file path
using the OpenCV library (cv2.imread). This image serves
as the starting point for our subsequent preprocessing
steps.
Step 2 :Resize and gaussian
blur
In this initial stage of our iris segmentation pipeline, we
take our input image and perform two crucial
preprocessing steps to enhance subsequent feature
extraction.
Resizing:
Resizing is a common preprocessing step in computer vision to
standardize input dimensions, reduce computational
complexity, and ensure that images have consistent sizes
before further processing.
Gaussian Blur:
Objective: Reduce noise and enhance feature extraction.
Reasoning: Gaussian blurring helps in smoothing the image,
effectively reducing high-frequency noise and sharpening
edges.
Step 3:Convert to Grayscale
In this step, we convert the resized and blurred image to
grayscale.
Converting to grayscale simplifies the image
representation, reducing the complexity of subsequent
processing steps. as it allows us to focus on variations in
intensity rather than color information

Gray scale image has 1 channel compared to color image


3 channels(RGB), Gray scale image make it easier to
apply operations on the images

We will apply thresholding and morphological


operations which require the image to be in gray scale

Haar cascade model accept the gray scale images for


easily eye detection
Step 4:Eye Detection using
Haar cascade
In this step, we employ a Haar Cascade Classifier

Haar Cascade Classifier is a machine learning-based


method used for object detection in images or video. It
identifies objects or features by training on positive and
negative samples

The model is given a lot of positive images consisting of eyes,


and a lot of negative images not consisting of any eyes to train
on them

if a region passes all stages, it is considered a positive


detection of the object or feature.
How Haar cascade work

1-Features: The model uses simple rectangular patterns called Haar-like features to understand different
aspects of an image, like edges or textures.

2-Integral Image: It uses a clever trick called an integral image to quickly calculate the sum of pixel values in
specific regions of the image.

3-Training: The model is trained using a machine learning algorithm (Adaboost) to pick the most informative
Haar-like features that help distinguish between positive (object) and negative (non-object) examples.

4-Cascade Structure: The selected features are organized into a cascade of stages. Each stage checks a
different aspect of the image. If a region fails one stage, it's quickly rejected, making the process efficient.

5-Sliding Window: The model scans the image with a sliding window at different scales. At each window
position, the cascade of stages is applied. If a region passes all stages, it's considered a positive detection.
Step 5:Iris Detection (Hough
Transform)
Hough circle transform is a feature extraction method
used to detect circles in an image

● Step 1:edge detection


detect edges of circle in the image using canny edge detector

● Step 2: Find Circles


Create an accumulator array for circle parameters.
For each edge pixel, consider possible circles and vote in the
accumulator.
● Step 3: Identify Circles
Set a threshold on the accumulator to find potential circles.
Extract circle parameters from the peaks.
● Step 4: Visualize
Draw the detected circles on the original image.
Step 6:Image Thresholding and
Morphological Operations
Image Thresholding:
Objective:
In iris detection, thresholding helps to distinguish the iris
region from the rest of the image. By setting a threshold,
pixels with intensity values above or below the threshold
are classified as part of the iris or background

Morphological Operations:
Objective:
Morphological operations help refine the segmented
regions, eliminating noise and irregularities, resulting in
a cleaner representation of the iris.
2 operations
● Opening: Erosion followed by dilation. It helps in removing
noise and fine details from the binary image.
● Closing: Dilation followed by erosion. It helps in closing
small gaps or dark spots within the regions of interest.
Step 7:Segment Iris Using
binary Masks
Objective:
Precisely isolate the iris region from the detected eye in the image.

Binary Masks Creation:


Mask 1 (mask1):
White-filled mask with the same dimensions as the original image.
Mask 2 (mask2):
Initially a black mask where a white circle is drawn to represent the detected iris position and size.
Combining Masks:

Mask 3 (mask3):
Extract the first channel of mask2 to create a binary mask that highlights the iris region.

Bitwise AND Operation:


Utilize cv2.bitwise_and to combine the original resized image (img_resized) and mask1 using mask3.
This operation preserves only the iris region, making the rest transparent.
UNET model
U-NET
Definition
The UNET model is a convolutional neural network (CNN) architecture
designed for semantic segmentation tasks, where the goal is to classify and
segment objects within an image at the pixel level. Introduced by Olaf
Ronneberger, Philipp Fischer, and Thomas Brox in 2015, the UNET architecture
is characterized by its U-shaped structure, featuring a contracting path for
context extraction and an expansive path for precise localization.

the model captures features and context through convolutional and pooling
layers, reducing the spatial dimensions of the input image. The expansive path
then performs upsampling and concatenation operations to recover the spatial
information, generating detailed segmentation masks. This unique
architecture allows UNET to excel in tasks that demand a high level of detail
and accuracy in segmentation, such as medical image analysis and other
domains involving intricate visual patterns.
U-NET preprocessing steps
Image Reading and Decoding:

The original image is read from a file.


The image is decoded using the PNG format, and its color channels are reduced to one by converting it to grayscale. Grayscale simplifies
subsequent processing steps.
Resizing:

The image is resized to a standardized dimension of 256x256 pixels. Standardization ensures uniform input size for the neural network during
training.
Normalization:

Pixel values of the image are normalized to a scale between 0 and 1 by dividing each pixel value by 255.0. Normalization helps the neural
network converge faster during training.
Mask Reading, Decoding, Resizing, and Normalization:

The corresponding mask image (ground truth segmentation) is read and decoded.
The mask is resized to match the dimensions of the resized image.
Mask pixel values are normalized to a scale between 0 and 1, ensuring consistency with the normalized image data.
Data Augmentation:

Random brightness and contrast adjustments are applied to the image. This introduces variability in the training data, improving the model's
ability to generalize to different lighting conditions and contrasts.
output
Model Evaluation
Evaluation Metric: Test Dice Coefficient

The Test Dice Coefficient is essentially the Dice Coefficient calculated


specifically on a test dataset to evaluate how well a model's predictions
match the ground truth. It provides a measure of the model's accuracy
in capturing the relevant features or objects in the test images. A value
closer to 1 indicates better performance, where the model's predictions
closely align with the ground truth.

Test Dice Coefficient Value for 30 epoch: 0.9485

Dice score = 2 * (number of common elements) / (number of


elements in set A + number of elements in set B)

sets A and B are typically the sets of pixels in the predicted


segmentation mask and the ground truth mask

It provides a single value that indicates how well the segmentation


mask predicted by a model aligns with the ground truth masks for the
test set
run
Thank you

You might also like