Coder Social home page Coder Social logo

secure-face-matching's Introduction

By Vishnu Naresh Boddeti

Introduction

Face Matching over encrypted feature vectors. The library contains three main parts, the SEAL library, the enrollment script and the authentication script.

The SEAL library is the cryptographic library from Microsoft Research, supporting the underlying fully homomorphic encryption functionality.

The library supports both 1:1 matching and 1:N matching. It also supports both the BFV (with integer quantization) scheme as well as the CKKS (real values) scheme.

The "face-matching/enrollment/enrollment-bfv-1-to-1.cpp" script implements the enrollment stage, for 1:1 matching using BFV scheme, where keys are generated, feature vector is obtained, feature vector is encrypted using the public key and encrypted feature vector is stored in database along with the public, relinearization and Galois keys (typically on the remote server). Note that the keys only need to be generated once per user.

The "face-matching/authentication/authentication-bfv-1-to-1.cpp" script implements the matching stage, for 1:1 matching using BFV scheme, a probe feature vector is obtained, probe is encrypted using the public key, encrypted feature vector is matched against encrypted gallery vector using the relinearization keys and Galois keys, the encrypted score is then decrypted using the private key (typically on the client).

Assumptions

The face feature vectors are assumed be normalized to unit-norm both during enrollment as well as during the authentication stage. We then compute the inner product between the normalized features. This is equivalent to computing the cosine similarity between the un-normalized feature vectors.

Citation

If you think this library is useful to your research, please cite:

@article{boddeti2018secure,
    title={Secure Face Matching Using Fully Homomorphic Encryption},
    author={Boddeti, Vishnu Naresh},
    booktitle={IEEE International Conference on Biometrics: Theory, Applications, and Systems (BTAS)},
    year={2018}
}

@article{engelsma2020hers,
    title={HERS: Homomorphically Encrypted Representation Search},
    author={Joshua Engelsma, Anil Jain and Vishnu Boddeti},
    journal={arXiv:2003.12197},
    year={2020}
}

Installation

Installation involves compiling the SEAL library, the enrollment and authentication scripts. We have included a python script "data/gendata.py" that can generate fake data (64-dimensional vector) for the gallery and probe.

$ git clone --recursive https://github.com/human-analysis/secure-face-matching.git
$ cd secure-face-matching
$ cd 3rdparty/SEAL/native/src/
$ cmake .
$ make clean; make; sudo make install
$ cd ../../../../face-matching/
$ cd enrollment
$ mkdir build; cd build
$ cmake ../
$ make clean; make
$ cd ../../authentication
$ mkdir build; cd build
$ cmake ../
$ make clean; make
$ cd ../../../data
$ python gendata.py
$ cd ../bin

Usage

Authentication takes an additional parameter, the number of gallery samples to match with. This should match the number of gallery samples enrolled.

1:1 Matching with BFV scheme

$ ./enrollment-bfv-1-to-1
$ ./authentication-bfv-1-to-1 16

1:N Matching with BFV scheme

$ ./enrollment-bfv-1-to-n
$ ./authentication-bfv-1-to-n 16

1:1 Matching with CKKS scheme

$ ./enrollment-ckks-1-to-1
$ ./authentication-ckks-1-to-1 16

1:N Matching with CKKS scheme

$ ./enrollment-ckks-1-to-n
$ ./authentication-ckks-1-to-n 16

secure-face-matching's People

Contributors

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