Skip to content

Optimizes genetic algorithm parameters to generate highly accurate, cancelable biometric templates using Python, OpenCV, and NumPy.

Notifications You must be signed in to change notification settings

sanjaykohli/TRWI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm for Biometric Image Encryption Optimization

This project focuses on optimizing the parameters of a genetic algorithm (GA) to generate encrypted biometric images. The aim is to create cancelable biometric templates with high accuracy by fine-tuning the GA's crossover and mutation rates.

Table of Contents

Project Overview

The project involves the following steps:

  1. Generate Initial Population: Create an initial population of encrypted biometric images using multiple rounds of XOR encryption with random keys.
  2. Optimize GA Parameters: Use the genetic algorithm to optimize the crossover and mutation rates for generating cancelable biometric templates.
  3. Evaluate Accuracy: Evaluate the accuracy of the cancelable templates generated by the GA.

Prerequisites

  • Python 3.x
  • OpenCV
  • NumPy

Installation

  1. Clone the repository:
    git clone https://github.com/JayArcher9/TRWI.git
    cd TRWI
  2. Install the required Python packages:
    pip install opencv-python numpy

Usage

  1. Place the original biometric image in the project directory. The image should be named download.jpg.
  2. Run the main script:
    python main.py
  3. The script will generate initial encrypted images and optimize the GA parameters, printing the accuracy scores for each combination of crossover and mutation rates.

Project Structure

  • main.py: Main script to execute the project.
  • generate_initial_population: Function to generate initial population images using multiple rounds of encryption.
  • optimize_ga_parameters: Function to optimize GA parameters (crossover and mutation rates).
  • evaluate_population, select_parents, crossover_and_mutate, crossover, mutate, next_generation: Helper functions for GA operations.

Functions Description

generate_initial_population(original_biometric_image, num_images, num_rounds)

Generates an initial population of encrypted biometric images using XOR encryption.

Parameters:

  • original_biometric_image: The original biometric image.
  • num_images: Number of initial population images to generate.
  • num_rounds: Number of encryption rounds.

Returns:

  • initial_population: List of encrypted images.

optimize_ga_parameters(initial_population)

Optimizes the genetic algorithm parameters (crossover and mutation rates) to find the best cancelable template.

Parameters:

  • initial_population: Initial population of encrypted images.

Returns:

  • accuracy_scores: Dictionary containing accuracy scores for each combination of crossover and mutation rates.

Helper Functions

  • evaluate_population(population): Evaluates the fitness of each cancelable template in the population.
  • select_parents(population, fitness_scores): Selects parent cancelable templates for reproduction based on fitness scores.
  • crossover_and_mutate(parents, crossover_rate, mutation_rate): Performs crossover and mutation operations on the parent cancelable templates.
  • crossover(parent1, parent2): Performs crossover operation on two parent cancelable templates.
  • mutate(individual, mutation_rate): Performs mutation operation on a cancelable template.
  • next_generation(population, offspring, fitness_scores, offspring_fitness): Combines the offspring and parents, and selects the fittest individuals for the next generation.

Acknowledgements

This project was developed using Python, OpenCV, and NumPy. Special thanks to the open-source community for providing valuable resources and libraries.

About

Optimizes genetic algorithm parameters to generate highly accurate, cancelable biometric templates using Python, OpenCV, and NumPy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages