Overview#
LUNA ID is a set of development tools that includes libraries and neural networks for face recognition and analysis in a mobile app. It also supports OCR (Optical Character Recognition) for document scanning and recognition.
Document scanning and recognition by means of OCR is provided by Regula. Regula is a third-party vendor and using the feature requires a license. For details, please refer to the Regula documentation.
Embedding LUNA ID in your mobile app allows you to use LUNA ID key features, as well as take advantage of LUNA PLATFORM 5 functionality to perform OneShotLiveness estimation and descriptor matching. For details, see Interaction of LUNA ID with LUNA PLATFORM 5.
Supported operating systems and programming languages#
LUNA ID is compatible with the Android and iOS operating systems. For details, see System and hardware requirements.
The supported programming languages are:
- Kotlin for Android app development
- Swift for iOS app development
Use cases#
Embedding LUNA ID in your mobile app allows you to implement the following use cases:
- Client enrollment
Flow: Registration
The process of creating a new user account, which includes face recognition and, optionally, document recognition. - User authentication
Flow: Verification (1:1)
The process of verifying a user when logging into an app account against the authorized biometry for the specified login. Available after registration.
The use case does not involve the use of OCR. - User recognition
Flow: Identification (1:N)
The process of user identification when a user's face is compared with all the faces in the database to recognize the user among the existing ones and to match the detected face with an existing user account.
You can use OCR in this use case.
Key features#
LUNA ID provides the following features:
- Getting the best shot:
- Estimating the best shot by the following criteria:
- Number of faces in the frame
- Face detection bounding box size
- Frame edges offset
- Eyes state (open, closed, or occluded)
- Head pose (pitch, yaw, and roll)
- Average garbage score (AGS)
- Image quality (lightness, darkness, and blurriness)
- Medical mask presence (in LUNA ID for iOS only)
For details, see Best shot estimations.
- Sending images with the detected face to LUNA PLATFORM 5 to perform OneShotLiveness estimation on the backend. OneShotLiveness estimation enables you to confirm whether a person in the image is "real" or a fraudster using a fake ID (printed face photo, video, paper, or 3D mask). For details, see Performing OneShotLiveness estimation.
- Dynamic Liveness estimation to determine whether a person is alive by interacting with a camera. The estimation is performed on your device without processing it on the backend. For details, see Performing Dynamic Liveness estimation
- Estimating the best shot by the following criteria:
- Video stream recording and face detection in the video stream. For details, see Information about a recorded video stream. You can record either full video sessions or only video sessions in which a face was detected in at least one frame.
-
Optional document scanning and recognition by means of OCR.
The feature is provided by Regula. For details, please refer to the Regula documentation.
-
Sending source images to LUNA PLATFORM 5 for descriptor matching on the backend. It allows you to perform the following tasks:
- Verify that the face in an image belongs to a person from a client list (1:N identification).
- Match the detected face with the face that corresponds to the client ID in a global database (1:1 verification).
Interaction of LUNA ID with LUNA PLATFORM 5#
Interaction between LUNA ID and LUNA PLATFORM 5 extends LUNA ID functionality and allows you to perform the following tasks:
- Perform OneShotLiveness estimation to determine whether a person’s face is real or fake, for example, a photo or printed image.
- Send the best shot for descriptor matching to compare a set of properties and helper parameters, which describe a person’s face, with the source image to determine the similarity of represented objects. The result is a similarity score, where 1 means completely identical, and 0 means completely different.
LUNA ID interacts with LUNA PLATFORM 5 via REST API.
LUNA PLATFORM 5 functions as the backend and lets you create and use handlers. Handlers are sets of rules or policies that describe how to process the received images. For details on how to create and use handlers, see the LUNA PLATFORM 5 documentation.
The below diagram shows how LUNA ID interacts with LUNA PLATFORM 5. We recommend that you use it to integrate LUNA ID into your app.
As the diagram shows, the process of interaction between LUNA ID and LUNA PLATFORM 5 is a back-and-forth communication between the frontend and backend.
Your mobile app runs on the frontend and embeds LUNA ID to use its key features. LUNA ID sends requests to LUNA PLATFORM 5 that functions as the backend.
But, when your production system is deployed, an interaction between LUNA ID and LUNA PLATFORM 5 is not realized directly. The interaction occurs via a secure channel through a middleware service that provides encryption and protection of the data being transferred.
Important. This document describes an example of direct interaction between LUNA ID and LUNA PLATFORM 5. VisionLabs does not provide security solutions for data transfer. You need to provide data protection by yourself.
We recommend that you use security best practices to protect data transfer. You should pay attention to the following security aspects:
- If you want to use the HTTPS protocol, then you need to add NGINX or other similar software to the backend.
- If you want to use the TLS cryptographic protocol, then you need to implement it at your mobile app.
- You might need to configure a firewall correctly.
- To restrict access, you can use LUNA PLATFORM 5 tokens, which can be transferred to a request header from LUNA ID.
Usage scenarios#
This section describes sample LUNA ID usage scenarios.
These are only examples. You need to change them according to your business logic.
Scenario 1: Getting images#
Scenario description#
You want to get a photo with a person's face, and then implement your own business logic for processing the image.
Scenario realization stages#
Applying this scenario in your mobile app proceeds in stages:
- Getting the best shot with the detected face for best shot estimation.
- Getting a warp or source image with the face on a mobile device to transfer it to an external system.
Scenario realization steps#
The scenario has the following steps:
1․ Video stream processing and face detection.
2․ Getting the best shot based on standard best shot estimations. In some cases, the best shot is an image that also successfully passed OneShotLiveness estimation.
3․ Getting a warp.
4․ Saving the warp on the device. You can then send it to a middleware for further processing.
The diagram below shows the steps of this scenario:
Scenario 2: Complete face recognition cycle#
Scenario description#
You want to run a full face recognition cycle using frontend and backend.
Scenario realization stages#
Applying a full face recognition cycle in your mobile app proceeds in stages:
- Getting the best shot with the detected face for best shot and OneShotLiveness estimation.
- Identifying that the face in the image belongs to a person from a client list (1:N identification).
- Matching the detected face with the face corresponding to the client ID in a global database (1:1 verification).
Prerequisites#
To use this scenario, you need to configure LUNA PLATFORM 5 for it to work with LUNA ID. For details on how LUNA PLATFORM 5 works, see the LUNA PLATFORM 5 documentation.
The preliminary steps are:
1․ Create a LUNA PLATFORM 5 account. For details, see Create account.
2․ Create a list of faces in LUNA PLATFORM 5 for further identification and verification. For details, see Create list.
3․ Add faces to the list by generating a handler event with the link_to_lists_policy
enabled.
4․ Create handlers for the following operations:
Scenario realization steps#
The scenario has the following steps:
You should perform some of the scenario realization steps in LUNA PLATFORM 5.
1․ Video stream processing and face detection.
2․ Getting the best shot.
3․ Sending the selected best shot for OneShotLiveness estimation in the backend.
4․ Performing OneShotLiveness estimation at the LUNA PLATFORM 5 /liveness
resource. The source image is required for the estimation.
5․ Creating a warp for further face recognition, if the previous steps were successfully passed.
6․ Saving the video stream with the detected face on the mobile device.
7․ Sending the best shot to LUNA PLATFORM 5 for identification according to the existing list.
8․ Performing the identification at the LUNA PLATFORM 5 /handlers/handler_id/events
resource. This step creates a temporary attribute that will be used in step 11.
9․ Receiving the results.
10․ Sending a request for verification according to the existing list to LUNA PLATFORM 5.
11․ Performing the verification at the LUNA PLATFORM 5 /verifiers/verifier_id/verification
resource.
The resource does not create event objects in LUNA PLATFORM 5 with information about image processing.
12․ Returning the attribute ID.
When implementing the scenario, you can either perform identification (step 8) or verification (step 10), not necessarily perform the both.
The diagram below shows the steps of this scenario:
Information about a recorded video stream#
LUNA ID saves video stream to file with the following parameters:
Parameters | Android | iOS |
---|---|---|
Duration limits | None | None |
Resolution | 320x240 pixels | 1280x720 pixels |
Frame rate | 30 fps | 30 fps |
File format | .mp4 | .mov |
Video compression standard | .H264 | .H264 |
Audio recording | None | None |
Video stream re-recording | Yes The file with the recorded video stream is overwritten when a new video session starts. |
Yes The file with the recorded video stream is overwritten when a new video session starts. |
As LUNA ID does not limit a duration of a video stream, we recommend that you limit it at the client app level. This will help you minimize the size of the video file and possible security issues.