This project implements an iris recognition system that extracts and analyzes iris features from images using various image processing and machine learning techniques. It follows the design presented by Ma et al. in their paper, "Personal Identification Based on Iris Texture Analysis" [1] (available in the appendix).
This project is built in Python and will require the user to install the following packages:
It is possible to install these dependencies with the following command:
py -m pip install -r requirements.txt
There is an example of usage in the main.py file in the src folder. It imports the package iris_recognition alongside the two available classes IrisRecognitionModel and DataLoader.
The config.json file should only be configured to modify the paths of the different used folders. The default and recommended usage is that the input dataset is located in its own folder on the same level as the iris_recognition package in the src folder.
The following UML class diagram describes the general architecture of the code:
In this project, it is assumed that the user has completed the image acquisition portion of the paper and has prepared the "input" dataset as described in the Usage section of the README. A good quality eye image should look like the following:
File: iris_localization.py
Objective: Detect and isolate the iris from the eye image.
Process:
Estimate the Pupil Center: Approximated the pupil coordinates by processing a small region around the center.
Refinement: Applied adaptive thresholding using Otsu's methods to refine the location of the pupil center using the centroid of the binary mask.
Iris Boundary Detection: Used Canny edge detection and the Hough Circle Transform to detect circular iris boundaries.
Result:
File: iris_normalization.py
Objective: Normalize the localized iris into a rectangular image for consistent feature extraction.
Process: The iris region is unwrapped using polar coordinates by generates the radial and angular coordinates and grids of shape M x N (64 x 512), computing the inner and outer boundaries of the iris, and remapping the original image to the normalized coordinates, which results in a consistent rectangular iris image of size M x N (64 x 512).
Result:
Files: iris_illumination.py and iris_enhancement.py
Objective: Improve the quality of the normalized iris image by compensating for illumination and contrast issues to improved feature extraction.
Process:
IrisIlluminater: Estimate the background illumination of the iris by dividing the image into 16 x 16 blocks, calculate the mean value for each block, contruct a block matrix of mean values, and resize the block matrix to the original image size using bicubic interpolation.
IrisEnhancer: Enhance contrast by subtracting the background illumination from the normalized image, dividing the image into 32 x 32 blocks, and applying histogram equalization to blocks of the image.
Results:
File: feature_extraction.py
Objective: Handle feature extraction from iris images using custom Gabor filters and block-based feature extraction methods.
Process:
Gabor Filters: Apply two custom Gabor filters (modulation function and Guassian envelope) to the iris' region of interest (ROI) - 48 x 512.
Block-based Features: Divide the ROI into small blocks, and for each block, calculate the mean and average absolute deviation.
Rotation: Extract features after rotating the image at multiple angles to handle angular misalignment.
File: iris_matching.py
Objective: Match input iris feature vectors to their respective classes using LDA and a nearest center classifier.
Process:
LDA Projection: Project feature vectors into a lower-dimensional space.
Nearest Center Classifier: Match the projected vector to the nearest class center in the reduced space using L1, L2, or Cosine distance. It supports both identification and verification modes used in biometrics.
File: performance_evaluation.py
Objective: Evaluate model performance using metrics such as Correct Recognition Rate (CRR), False Match Rate (FMR), and False Non-Match Rate (FNMR).
Metrics:
Correct Recognition Rate (CRR): The percentage of correctly recognized irises (identification mode)
False Match Rate (FMR): The percentage of impostor matches incorrectly classified as genuine matches (verification mode).
False Non-Match Rate (FNMR): The percentage of genuine matches incorrectly classified as non-matches (verification mode).
File: iris_preprocessing.py
Objective: Create the core pipeline that integrates the localization, normalization, enhancement, feature extraction modules to recognize irises in the given input dataset
Process:
For each image from the dataset, it performs the preprocessing and feature extraction parts
The final goal is to extract both features and labels
File: iris_recognition.py
Objective: Create the main machine learning model to recognize an iris
Process:
Currently supports both identification and verification mode used in biometrics
The computed distance are the ones mentionned in [1] (e.g. L1, L2 and Cosine)
Only calculates the CRR (accuracy) and the FMR/FNMR for the cosine distance
The dataset is loaded using the DataLoader class. It expects a folder structure where each eye's images are stored in subdirectories for training and testing:
input/
└── 001/
├── 1/
└── 2/
Here, 001 denotes the class whereas 1 and 2 refer respectively to the training and testing images for that class.
The load() method loads the images and splits them into training and testing sets.
The core recognition process is handled by the IrisDataPreprocessor class, which performs:
Localization
Normalization
Illumination Correction
Enhancement
Feature Extraction
The features extracted from the images are used for identification and verification.
The IrisRecognitionModel class provides functions to:
Train the model using the extracted features.
Identify iris classes based on a similarity metric (L1, L2, Cosine).
Verify whether a test image belongs to a claimed class using a threshold-based approach.
After model training and testing, performance metrics are computed using the PerformanceEvaluator.
The DET Curve is used to visualize the trade-off between FMR and FNMR. The function plot_det_curve
plots this curve to evaluate how different thresholds affect the model's performance.
Sensitivity to Lighting Conditions: The current image enhancement approach uses basic illumination correction and histogram equalization. It may still struggle with images taken under significantly varying lighting conditions or with non-uniform brightness across the iris. we could improve by implementing more advanced illumination correction or even deep learning-based enhancement techniques to handle more diverse lighting conditions.
Fixed Parameters: Parameters such as the Gabor filter settings, block sizes, and kernel sizes are fixed in the feature extraction process. These may not generalize well across different datasets or capture enough discriminative features under diverse conditions (e.g., noisy images, blurred irises). To combat this, we could introduce an automatic parameter tuning mechanism (e.g., grid search or cross-validation) to optimize parameters like Gabor filter settings, block sizes, and thresholds for each dataset.
Manual Threshold Selection: The thresholds for FMR and FNMR are manually tuned. This is not ideal for real-world applications, where automatic threshold optimization based on data-driven techniques would be more robust. We could replace the fixed thresholding approach with more advanced techniques, such as ROC curve-based threshold optimization or using a machine learning model to determine thresholds dynamically based on the dataset.
Limited Rotation Handling : The system handles rotation by rotating images at a few fixed angles. This approach might miss certain cases where the rotation exceeds the predefined set of angles, leading to poor recognition performance in such instances. We could explore techniques to improve the system's ability to handle extreme rotation.
Noise Reduction: Eyelashes and other obstacles may lower the model's performance and should be treated during preprocessing. We could implement eyelash masking to identify eye regions with heavy obstruction and mask them before feature extraction.
In general, we should introduce data augmentation techniques (e.g., random rotations, blurring, brightness adjustments) to make the model more resilient to variations in the iris images and improve generalization to new data.
[1] L. Ma, Y. Wang, and T. Tan, "Personal Identification Based on Iris Texture Analysis," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 25, no. 12, pp. 1519-1533, Dec. 2003.