YeriAddict / iris-recognition

An iris recognition model inspired by Li Ma's research on biometric recognition methods based on Gabor multichannel filtering
6 stars 2 forks source link

IrisRecognition

Table of Contents
  1. Overview
  2. Project Structure
  3. Usage
  4. Limitations & Improvements
  5. Resources

Overview

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).

model_desing

Requirements

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

How to get started

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.

Project Structure

The following UML class diagram describes the general architecture of the code:

class_diagram

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:

image_before_preprocessing

1. Iris Localization

File: iris_localization.py

Objective: Detect and isolate the iris from the eye image.

Process:

Result:

localized_image

2. Iris Normalization

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:

normalized_image

3. Image Enhancement

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:

Results:

estimated_background_illumination

enhanced_image

4. Feature Extraction

File: feature_extraction.py

Objective: Handle feature extraction from iris images using custom Gabor filters and block-based feature extraction methods.

Process:

5. Iris Matching

File: iris_matching.py

Objective: Match input iris feature vectors to their respective classes using LDA and a nearest center classifier.

Process:

6. Performance Evaluation

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:

7. Iris Preprocessing

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:

8. Iris Recognition Model

File: iris_recognition.py

Objective: Create the main machine learning model to recognize an iris

Process:

Usage

1. Data Loading

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.

2. Pipeline Execution

The core recognition process is handled by the IrisDataPreprocessor class, which performs:

The features extracted from the images are used for identification and verification.

3. Model Training and Evaluation

The IrisRecognitionModel class provides functions to:

After model training and testing, performance metrics are computed using the PerformanceEvaluator.

4. Detection Error Trade-off (DET) Curve

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.

Limitations & Improvements

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Resources

[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.