Giter Club home page Giter Club logo

otroshi / maximal-linkability Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 4 KB

Maximal Linkability metric to evaluate the linkability of (protected) biometric templates. Paper: "Measuring Linkability of Protected Biometric Templates using Maximal Leakage", IEEE-TIFS, 2023.

License: BSD 2-Clause "Simplified" License

Python 100.00%
biometric-template-protection biometrics btp evaluation linkability metrics template template-protection benchmarking unlinkability

maximal-linkability's Introduction

Evaluating Linkability of Biometric Templates

If you want to evaluate the linkability of your biometric templates using the Maximal Linkability, you can use the provided function in maximal_linakbility.py and as follows:

import numpy

def maximal_linakbility_metric(mated_scores, nonmated_scores, n_bin=30):
    """
    Parameters:
        (array) mated_scores:    mated scores
        (array) nonmated_scores: nonmated scores
        (int)   n_bin:         the number of histogram bins 

    Return:
        (float) linkability of templates in [0,1] interval. 
                higher value indicates higher link between templates.
    """
    
    # find histogram bin edges
    min_interval_scores = min(mated_scores.min(), nonmated_scores.min())
    max_interval_scores = max(mated_scores.max(), nonmated_scores.max())
    bin_edges = min_interval_scores + numpy.arange(n_bin+1)* (max_interval_scores - min_interval_scores)/n_bin

    # calculate histograms
    y1 = numpy.histogram(mated_scores, bins = bin_edges, density = True)[0]
    y2 = numpy.histogram(nonmated_scores, bins = bin_edges, density = True)[0]

    # calclulate maximal leakage
    MaxLeakage_score = 0 
    for i in range(n_bin):
        MaxLeakage_score += max(y1[i], y2[i])

    return numpy.log2( MaxLeakage_score * ( bin_edges[1]-bin_edges[0] ) )

NOTE: This code only requires numpy package to be installed.

You can also use the following command to evaluate the linkability of biometric templates:

python maximal_linakbility.py --mated_scores <path_to_mated_scores> --nonmated_scores <path_to_nonmated_scores>

Reference

If you use this metric, please cite the following paper, which is published in the IEEE Transactions on Information Forensics and Security. The PDF version of the paper is available as open access on the IEEE-Xplore. The complete source code for reproducing all experiments in the paper is also publicly available in the official repository.

@article{linkability_maxleakage,
  title={Measuring Linkability of Protected Biometric Templates using Maximal Leakage},
  author={Otroshi Shahreza, Hatef and Shkel, Yanina Y. and Marcel, S{\'e}bastien},
  journal={IEEE Transactions on Information Forensics and Security},
  year={2023},
  publisher={IEEE}
}

maximal-linkability's People

Contributors

otroshi avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.