Tutorial: Build frictionless customer onboarding using AI APIs

About Arya APIs

With the need for digital transformation on the rise, APIs have now become a competitive business advantage. Small 'codes' acting as connectors between systems, APIs quickly interconnect new products and services, improve operations, create new business opportunities and customer experiences.

When coupled with Artificial Intelligence (AI), APIs become more intelligent and agile, providing higher levels of precision for specific and relevant tasks - also giving the strategic advantage kickstarting the AI journey.

Arya.ai recently launched an AI APIs platform, for helping organizations gain easy access to data and AI capabilities by providing logically linked workflows, driving ease of use and are most economically valuable.

Arya APIs are pretrained, readily usable AI functions offered as APIs. They are usable as plug and play applications, built using Deep Learning, Natural Language Processing, computer vision using convolution neural networks, as well as some of the image processing services.

The Arya APIs platform contains a library of 24+ AI APIs, to help organizations achieve a ‘platform at scale’ approach, rather than building one-off applications.

Benefits:

  • Plug and play - Readily usable AI functions that can easily integrate with existing ecosystem
  • Automated, digitized processes to transform core workflows with high precision
  • AI-enabled decision making for fastest responses and processing times
  • Accelerated customer onboarding and acquisition

Tutorial - Building a full-service application for customer onboarding using AI APIs

A quick guide on how Arya APIs can be clubbed together to build an application for unique, hassle free customer onboarding powered by Arya APIs.

We will be considering 4 APIs from our suite of APIs:

  • Passive face liveness detection - The API analyses any given image to predict whether the person in the picture was present and live at the moment of capture or not. This model works as an anti-spoofing technology against presentation attacks by distinguishing between a live image and a 2D printed, 3D printed or a digital image of a user’s face.
  • KYC extraction - For accurate information retrieval from any Indian KYC document, KYC Extraction API captures information from a variety of ID proof(s) that need to be submitted as part of KYC regulation. The API accurately recognizes, classifies and extracts information from the KYC documents like PAN card, AADHAR card, Voter ID, Passport, Driving license.
  • Face verification - Arya’s face recognition module is one of the robust modules trained to recognize and match faces from a variety of sources such as images from KYC documents.
  • Signature detection - Documents containing signatures can vary in size, format and location of signatures. The signature detection module works extensively on analyzing any given image to localize and extract snippets of signature present at any location. The module has the capability to detect multiple snippets in a single document, and also returns a confidence score associated with each detected signature.

Pre-requisites:

GRADIO INSTALLATION

Install Gradio for running your web applications using Arya API's. There are many alternatives other than Gradio such as Streamlit, but just for this instance we will be using Gradio to build our web application with Arya API's as the backbone.

You can more information about Gradio here

Import all the necessary modules to run our application

Set all the Tokens for the API's as environment variables

Next, we have to insert the tokens for each of these APIs. All the tokens can be found under the ‘Documentation’ tab at our Arya API's website. User’s will have to register for the particular API to access their unique tokens. The APIs can be accessed at: Arya APIs

Helper Function to convert an image to Base64 format

Step 1: Passive face liveness detection

To know more about Understanding Liveness Detection and the API, you can read our blog.

The user will first upload a selfie/picture from a webcam/mobile camera and our application will detect whether the uploaded picture is indeed a live picture or a spoof.

Define all the UI components for our Application

Gradio has an output interface with multiple options like labelling key values. Since our liveness API will only distinguish whether the images live or not, we're going to define the output format as a label where the type is confidence:

  • Input --> Image/Webcam upload box
  • Output --> Label which outputs a classification label, along with confidence scores of top categories if provided

Launch the Face Liveness Application Interface with a public url/link

Step 2: KYC Verification API

As discussed earlier,  with the KYC extraction module, verification of any client can be done in a matter of seconds and the complete onboarding process gets more efficient and streamlined. For further details, read our blog on the KYC API.

This step will consist of two parts:

  1. KYC Extraction - Which will extract all the relevant information from the KYC such as Name, DOB and so on
  2. KYC Verification - Which will use the KYC extraction Application to verify if the entered customer details match with the extracted KYC Details

Define all the UI components for our Application

  • Input --> Image upload box
  • Output --> KeyValues displays a table representing values for multiple fields

Launch the KYC Extraction Application Interface with a public url/link

KYC Verification

For this tutorial, we will verify  the below two fields :

  • Full Name
  • Date of Birth

Define all the UI components for our Application

  • Input1 --> Image upload box
  • Input 2 --> Text box for entering customer's full name
  • Input 3 --> Textbox for entering customer's date of birth
  • Output --> KeyValues displays a table representing values for multiple fields

Launch the KYC verification Application Interface with a public url/link

Step 3: KYC Face verification

The Face extracted from KYC Image will be verified with a user uploaded webcam/selfie image.

Define all the UI components for our Application

  • Input1 --> Image upload box / webcam
  • Input2 --> Image upload box
  • Output --> Label which outputs a classification label, along with confidence scores of top categories if provided

Launch the KYC Face verification Application Interface with a public url/link

Step 4: Signature Detection API

To get details on our signature APIs, read our latest blog.

Define all the UI components for our Application

  • Input --> Image upload box
  • Output --> Signature Image display

Launch the KYC Signature Detection Application Interface with a public url/link

Step 5: Creating the customer on-boarding application

Let us put all the pieces of the puzzle together and create a one shop stop application for a unique hassle free customer onboarding experience. With this module, verification of any client can be done in a matter of seconds and the complete onboarding process gets more efficient and streamlined.

The Customer Onboarding module will consist of the following steps :

  1. Upload a webcam/selfie image of the user
  2. Upload the KYC image of the user
  3. Enter user's Full Name
  4. Enter user's Date of Birth

Once all of the above information is provided, Arya's customer onboarding application processes the below important checks:

  1. Verifies whether the uploaded user webcam/selfie image is live or a spoof            (Passive Face Liveness Detection)
  2. Verifies whether the entered user information matches with extracted information from the uploaded KYC document. (KYC Verification)
  3. Verifies whether the user face matches with the uploaded KYC Face (KYC Face Verification)
  4. Detects the signature from the uploaded KYC document (KYC Signature Detection)

Define all the UI  components for our Application

Inputs:

  • Input1 --> Image webcam upload
  • Input2 --> Image upload box
  • Input3 --> Text Box for Full Name
  • Input4 --> Textbox for Date of Birth

Outputs :

  • Output1 --> Label which outputs a classification label, along with confidence scores of top categories if provided
  • Output2 --> KeyValues displays a table representing values for multiple fields.
  • Output3 --> KeyValues displays a table representing values for multiple fields.
  • Output4 --> Signature Image display
  • Output5 --> Label which outputs a classification label, along with confidence scores of top categories if provided

Launch the Arya Customer Onboarding Application Interface with a public url/link

Get free access to Arya APIs

You can try the APIs yourself using multiple documents and formats. Arya.ai is offering 500 free API calls for users registering with their business account. Get your access today at:  https://api.arya.ai/

Additional resources:

  • Access the notebook for this API tutorial here
  • Watch on-demand session for our workshop on Arya APIs here
Arya APIs platform