FacePay – The face recognition based transaction system
This is my attempt to make a Face Recognition System for facilitating secure transactions. The application is designed such that the user had to first register and before doing any transaction, he/she had to update his/her profile picture. The system will use that same face for the reference and while making the transaction, it detects the person in front of the camera and then matches the face (in front of camera) with that referenced (registered user’s) image.
The transaction proceeds when the face is detected, recognised and matched with the registered user otherwise the transaction is terminated.
How to use
To get started, you just need a browser.
- Clone this repository and open it in your favourite IDE or in terminal (Command Prompt in Windows). If Node.js is already installed on your system then you can skip the just below step.
- Install Node.js and along with this, npm will automatically get installed.
npm installin the terminal. This will install all the dependencies related to this project.
node server.jsin the terminal. It will start the server, locally at port 3000.
http://localhost:3000/in the browser’s url.
- The application is live now.
- To stop the application, just stop the server by
Ctrl+Cin the terminal.
While using the application
Wohoo! You made it till here. Now, let’s dive into the FacePay.
- Before using you need to register in the application by clicking the
Sign Upbutton. And, then login.
- Now, upload your profile picture. You can navigate there by clicking the round-shaped image aside of Log Out button.
- Select the transaction type and fill the transaction details. Click the
- The application will start loading the camera and the ML models.
Start Verificationto verify and authenticate yourself.
- If you were verified successfully then you will be ask for initiating payment. Click
Paybutton to initiate. Now, you will be seeing the SUCCESS message on the screen.
- If you were not verified, the application will reject the payment and you will be seeing the FAILED message on the screen.
Technology Stack and Documentation
This project is possible with:
Storing and Managing Data : Google Firebase
Machine Learning: face-api.js
More on Machine Learning Models
This application is using SSD (Single Shot Multibox Detector) based on Mobilenet V1 neural network for face detection. Such a network is trained to generate a very accurate and almost unique 68 points face-landmark detection vector, given that, the images of faces which are fed to the network are properly aligned and cropped.
Then, for face recognition, a ResNet-34 like architecture is implemented to compute a face descriptor (a feature vector with 128 values) from any given face image, which is used to describe the characteristics of a person’s face. It can determine the similarity of two arbitrary faces by comparing their face descriptors using Euclidean Distance or any other classifier.