Skip to content

tiongsikng/fsb_hashnet

Repository files navigation

Flexible Secure Biometrics Hashing Network (FSB-HashNet)

Flexible Secure Biometrics: A Protected Modality-Invariant Face-Periocular Recognition System

Published in Transaction of Information Forensics and Security (DOI: 10.1109/TIFS.2025.3559785)
Paper Link


Network Architecture

Pre-requisites:

  • Environment: Check requirements.txt file which was generated using pip list --format=freeze > requirements.txt command for the environment requirement. These files are slightly filtered manually, so there may be redundant packages.
  • Dataset: Download dataset (training and testing) from this link. Password is conditional_biometrics. Ensure that datasets are located in data directory. Configure datasets_config.py file to point to this data directory by changing main path.
  • Pre-trained models: (Optional) The pre-trained MobileFaceNet model for fine-tuning or testing can be downloaded from this link.

Training:

  1. Change hyperparameters accordingly in params.py file. The set values used are the default, but it is possible to alternatively change them when running the python file.
  2. Run python training/main.py. The training should start immediately.
  3. Testing will be performed automatically after training is done, but it is possible to perform testing on an already trained model (see next section).

Testing:

  1. Based on the (pre-)trained models in the models(/pretrained) directory, load the correct model and the architecture (in network directory) using load_model.py file. Change the file accordingly in case of different layer names, etc.
  2. Performance Evaluation:
    • Verification / Receiver Operating Characteristic (ROC) curve: Run roc_eval_verification.py. Based on the generated .pt files in data directory, run plot_roc_sota.ipynb to generate ROC graph. For cases of stolen-token scenario, and user-specific token scenario, refer to the main function in verification.py for the configuration.
  3. Security and Privacy Analysis: Under the analysis_privacy_security folder, run the desired criterion for desired output. Graphs will be generated in the graphs directory.
    • Revocability / Unlinkability: In the case of revocability and unlinkability, generate_scores.py has to be run first. Then, run the desired criterion evaluateRevocability.py or evaluateUnlinkability.py.
    • Non-Invertibility: evaluateNonInvertibility.py generates the genuine-impostor graph, while noninvert_calculate_sar.py calculates the Success Attack Rate (SAR).

Comparison with State-of-the-Art (SOTA) models

Method Intra-Modal EER (%)
(Periocular)
Intra-Modal EER (%)
(Face)
Cross-Modal EER (%)
(Periocular-Face)
CB-Net Paper Link
Pre-trained Weights
9.62 3.21 9.80
HA-ViT Paper Link
Pre-trained Weights
11.39 10.29 13.14
GC2SA-Net Paper Link
Pre-trained Weights
6.39 3.14 6.50
MFA-ViT Paper Link
Pre-trained Weights
11.18 5.17 9.41
AELNet Paper Link
Pre-trained Weights
6.65 3.19 6.32
FSB-HashNet (No Hash) Paper Link
Pre-trained Weights
7.10 3.26 6.77
FSB-HashNet (Stolen-Key) Paper Link
Pre-trained Weights
9.18 4.75 9.77
FSB-HashNet (User-Specific) Paper Link
Pre-trained Weights
4.24 2.11 5.26

The project directories are as follows:

├── analysis_privacy_security: Contains evaluation for security and privacy analysis - Non-Invertibility, Revocability, Unlinkability.
│   ├── evaluateNonInvertibility - Evaluate non-invertibility criteria via genuine-impostor graph.
│   ├── evaluateRevocability - Evaluate revocability criteria, only can be used after executing generate_scores.py.
│   ├── evaluateUnlinkability - Evaluate unlinkability criteria, only can be used after executing generate_scores.py.
│   ├── generate_scores - Generate genuine-impostor and mated-non-mated scores that are used for revocability and unlinkability evaluation. Scores are generated in graphs/[method] directory.
│   └── noninvert_calculate_sar - Evaluate non-invertibility criteria by calculating the Success Attack Rate (SAR).
├── configs: Contains configuration files and hyperparameters to run the codes.
│   ├── config.py - Contains directory path for dataset files. Change 'main' in 'main_path' dictionary to point to dataset, e.g., /home/fsb_hashnet/data (without slash).
│   └── params.py - Hyperparameters and arguments for training.
├── data: Directory for dataset preprocessing, and folder to insert data based on config.py files.
│   ├── [INSERT DATASET HERE.]
│   ├── The .pt files to plot the ROC graph will be generated in this directory.
│   └── data_loader.py - PyTorch DataLoader based on a given path and argument (augmentations).
├── eval: Evaluation metrics - Verification. Also contains .ipynb files to plot ROC graphs.
│   ├── plot_roc_sota.ipynb - Notebook to plot ROC curves, based on generated .pt files from verification.py. Graph is generated in graphs directory.
│   └── roc_eval_verification.py - Evaluates Verification Equal Error Rate (EER) and generates Receiver Operating Characteristic (ROC) curve, which are saved as .pt files in data directory. Use these .pt files to generate ROC curve.
├── graphs: Directory where graphs and privacy evaluations are generated.
│   ├── Security and Privacy Analysis graphs and files are generated in this directory.
│   └── ROC curve file is generated in this directory.
├── logs: Directory where logs are generated.
│   └── Logs will be generated in this directory. Each log folder will contain backups of training files with network files and hyperparameters used.
├── models: Directory to store pre-trained models. Trained models are also generated in this directory.
│   ├── [INSERT PRE-TRAINED MODELS HERE.]
│   ├── The base MobileFaceNet for fine-tuning the FSB-HashNet can be downloaded in this link.
│   └── Trained models will be generated in this directory.
├── network: Contains loss functions and network related files.
│   ├── fsb_hash_net.py - Architecture file for FSB-HashNet. Also used in the case of hashed (stolen token / user-specific token).
│   ├── fsb_hash_net_baseline - Architecture file for baseline FSB-HashNet. Also used in the case of non-hashed baseline.
│   ├── load_model.py - Loads pre-trained weights based on a given model.
│   └── logits.py - Contains some loss functions that are used.
└── training: Main files for training FSB-HashNet.
    ├── main.py - Main file to run for training. Settings and hyperparameters are based on the files in configs directory.
    └── train.py - Training file that is called from main.py. Gets batch of dataloader and contains criterion for loss back-propagation.

Citation for this work:

@ARTICLE{fsb_hashnet,
  author={Ng, Tiong-Sik and Kim, Jihyeon and Teoh, Andrew Beng Jin},
  journal={IEEE Transactions on Information Forensics and Security}, 
  title={Flexible Secure Biometrics: A Protected Modality-Invariant Face-Periocular Recognition System}, 
  year={2025},
  volume={20},
  number={},
  pages={4610-4621},
  keywords={Face recognition;Feature extraction;Codes;Security;Protection;Generators;Transforms;Transformers;Training;Privacy;Face;periocular;cancellable biometrics;flexible deployment;modality-invariant},
  doi={10.1109/TIFS.2025.3559785}}


About

Flexible Secure Biometrics: A Protected Modality-Invariant Face-Periocular Recognition System

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors