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.
https://www.youtube.com/watch?v=-gx1-4fLTf4&lc=UgwK4QJ7QgIvJNXnCNZ4AaABAg&ab_channel=DiptiSharma
Website link:https://facepay-b93d2.web.app/
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.
- Run
npm install
in the terminal. This will install all the dependencies related to this project. - Run
node server.js
in the terminal. It will start the server, locally at port 3000. - Type
http://localhost:3000/
in the browser's url. - The application is live now.
- To stop the application, just stop the server by
Ctrl+C
in the terminal.
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 Up
button. 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
Next
button. - The application will start loading the camera and the ML models.
- Click
Start Verification
to verify and authenticate yourself. - If you were verified successfully then you will be ask for initiating payment. Click
Pay
button 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.
This project is possible with:
-
Backend: Vanilla JavaScript, Node.js (Express)
-
Storing and Managing Data : Google Firebase
-
Machine Learning: face-api.js
JavaScript API for face detection and face recognition in the browser implemented on top of the tensorflow.js core API (tensorflow/tfjs-core)
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.