- Environment: Check
requirements.txtfile which was generated usingpip list --format=freeze > requirements.txtcommand 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
datadirectory. Configuredatasets_config.pyfile 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.
- Change hyperparameters accordingly in
params.pyfile. The set values used are the default, but it is possible to alternatively change them when running the python file. - Run
python training/main.py. The training should start immediately. - Testing will be performed automatically after training is done, but it is possible to perform testing on an already trained model (see next section).
- Based on the (pre-)trained models in the
models(/pretrained)directory, load the correct model and the architecture (innetworkdirectory) usingload_model.pyfile. Change the file accordingly in case of different layer names, etc. - Performance Evaluation:
- Verification / Receiver Operating Characteristic (ROC) curve: Run
roc_eval_verification.py. Based on the generated.ptfiles indatadirectory, runplot_roc_sota.ipynbto generate ROC graph. For cases of stolen-token scenario, and user-specific token scenario, refer to the main function inverification.pyfor the configuration.
- Verification / Receiver Operating Characteristic (ROC) curve: Run
- Security and Privacy Analysis: Under the
analysis_privacy_securityfolder, run the desired criterion for desired output. Graphs will be generated in thegraphsdirectory.- Revocability / Unlinkability: In the case of revocability and unlinkability,
generate_scores.pyhas to be run first. Then, run the desired criterionevaluateRevocability.pyorevaluateUnlinkability.py. - Non-Invertibility:
evaluateNonInvertibility.pygenerates the genuine-impostor graph, whilenoninvert_calculate_sar.pycalculates the Success Attack Rate (SAR).
- Revocability / Unlinkability: In the case of revocability and unlinkability,
| Method | Intra-Modal EER (%) (Periocular) |
Intra-Modal EER (%) (Face) |
Cross-Modal EER (%) (Periocular-Face) |
|---|---|---|---|
| 9.62 | 3.21 | 9.80 | |
| 11.39 | 10.29 | 13.14 | |
| 6.39 | 3.14 | 6.50 | |
| 11.18 | 5.17 | 9.41 | |
| 6.65 | 3.19 | 6.32 | |
| 7.10 | 3.26 | 6.77 | |
| 9.18 | 4.75 | 9.77 | |
| 4.24 | 2.11 | 5.26 |
├── 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 executinggenerate_scores.py. │ ├── evaluateUnlinkability - Evaluate unlinkability criteria, only can be used after executinggenerate_scores.py. │ ├── generate_scores - Generate genuine-impostor and mated-non-mated scores that are used for revocability and unlinkability evaluation. Scores are generated ingraphs/[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 onconfig.pyfiles. │ ├── [INSERT DATASET HERE.] │ ├── The.ptfiles 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.ipynbfiles to plot ROC graphs. │ ├── plot_roc_sota.ipynb - Notebook to plot ROC curves, based on generated.ptfiles fromverification.py. Graph is generated ingraphsdirectory. │ └── roc_eval_verification.py - Evaluates Verification Equal Error Rate (EER) and generates Receiver Operating Characteristic (ROC) curve, which are saved as.ptfiles indatadirectory. Use these.ptfiles 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 inconfigsdirectory. └── train.py - Training file that is called frommain.py. Gets batch of dataloader and contains criterion for loss back-propagation.
@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}}
