# Face Authentication

The Face Authentication module captures a returning user's face with the device camera and matches it against the face already enrolled for that user. It then returns a pass or fail result.

For an overview of this module and how it works, see [Face Authentication](https://developer.incode.com/docs/face-authentication).

# Supported with:

:white_check_mark: Workflows | :white_check_mark: Flows

# Add Face Authentication to Workflows

1. In the left menu, click **Flow Builder** > **Workflows**.
2. Click **New**.
3. From the Modules list, drag and drop the Face Authentications module into the builder.
4. On the module node, you can click the three dots > **Edit** to change specific settings for the module, like using 1:N, setting image quality, or setting a different number of allowed capture attempts. The [Configuration Options]() section below describes all of these settings. The default settings work as designed, so no changes are needed.
5. Add a Condition after the Face Authentications module and configure it:
   1. IF `Face authentication result` `STATUS` `==` `OK`
   2. Select **Yes path** for _Configure what happens with existing steps after condition_.
   3. Click **Save Condition**.
6. Click **Save & Publish**.

# Add Face Authentication to Flows

1. In the left menu, click **Flow Builder** > **Flows**.
2. Click **New**.
3. On the Select Modules tab, find the Face Authentication Module and click **Add**.
4. You can click **Details & Configurations** to change specific settings for the module, like using 1:N, setting image quality, or setting a different number of allowed capture attempts. The [Configuration Options]() section below describes all of these settings. The default settings work as designed, so no changes are needed.
5. Click **Save Changes**.

# Configuration Options

After adding the _Face Authentication_ module to your Incode Flow or Workflow, there are several settings you can configure based on your needs. Click the module in the Workflow to open the configuration panel, adjust the settings as needed, then click **Save configurations**.

![](https://files.readme.io/d17cdbe3787c9b5458e347d5a2e88988d36de7855a4fe959a0317a3625a777bf-image.png)

Refer to the table below for details about each setting.

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Setting
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **_Mode_**
      </td>

      <td>
        Determines the mode of comparison. Select one:

        - _1:1_: compares the authentication selfie against a specific existing user
        - _1:N_: compares the authentication selfie against all the faces in the customer organization and finds the closest match

        Default value: _1:1_
      </td>
    </tr>

    <tr>
      <td>
        **_Number of attempts_**
      </td>

      <td>
        The maximum number of auto capture attempts Incode will make. As soon as there is a successful attempt, the module ends. Enter a number.
        Default value: _3_
      </td>
    </tr>

    <tr>
      <td>
        **_Auto capture timout (secs)_**
      </td>

      <td>
        The maximum number of seconds Incode will attempt to auto capture the selfie. After which time, manual capture is required. Enter a number of seconds.
        Default value: _25_
      </td>
    </tr>

    <tr>
      <td>
        **_Show face capture tutorial_**
      </td>

      <td>
        Controls whether the user sees a tutorial on how to capture the best possible selfie.
        Selected by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Stateless face match_**
      </td>

      <td>
        When enabled, allows face authentication for users who have deleted their biometric data. The face match process uses the selfie submitted via API instead of a stored template.
      </td>
    </tr>

    <tr>
      <td>
        **_Exact face match check_**
      </td>

      <td>
        When enabled, compares the selfie captured during authentication against the selfie from the original onboarding session to detect the reuse of identical images. Face recognition scores above a fixed threshold are failed. This setting is disabled by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Face Match Threshold_**
      </td>

      <td>
        Controls the severity on the model that does the face matching process. A high threshold is better for security, but a low threshold is better for conversions. Select one:

        - _Lo_
        - _Me_
        - _Hi_

        Default value: _Me_
        Note that this setting cannot be deselected as it is a crucial part of the authentication process.
      </td>
    </tr>

    <tr>
      <td>
        **_Liveness Threshold_**
      </td>

      <td>
        Controls the severity on the model that performs liveness checks. A high threshold is better for security, but a low threshold is better for conversions. There are three separate Liveness checks:

        - **_Physical attack_**: Selected by default. Default value: _Me_
        - **_Digital attack_**: Deselected by default. Default value: _Lo_
        - **_Evasion attack_**: Deselected by default. Default value: _Me_
      </td>
    </tr>

    <tr>
      <td>
        **_Image Quality Threshold_**
      </td>

      <td>
        Checks for the quality of the captured selfie. A high threshold is better for security, but a low threshold is better for conversions. Select one:

        - _Lo_
        - _Me_
        - _Hi_

        Default value: _Me_
      </td>
    </tr>

    <tr>
      <td>
        **_Lenses validation_**
      </td>

      <td>
        In the Face Attributes section. Controls whether the system checks if the user is wearing lenses or sunglasses in the selfie.
        Selected by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Mask validation_**
      </td>

      <td>
        In the Face Attributes section. Controls whether the system checks if the user is wearing a mask in the selfie.
        Selected by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Hat validation_**
      </td>

      <td>
        In the Face Attributes section. Controls whether the system checks if the user is wearing a hat in the selfie.
        Selected by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Closed eyes validation_**
      </td>

      <td>
        In the Face Attributes section. Controls whether the system checks if the user's eyes are closed in the selfie.
        Selected by default.
      </td>
    </tr>

    <tr>
      <td>
        **_Brightness validation_**
      </td>

      <td>
        In the Face Attributes section. Controls whether the system checks for minimum necessary brightness of the image.
        Selected by default.
      </td>
    </tr>
  </tbody>
</Table>

{/ _There is a mention of Deepsight configurations in the draft document, but no further info, and I don't see those in the demo env_ /}

<br />

## Scoring

Every authentication attempt gets its own score.

When Liveness is OFF {/*& Deepsight is OFF*/}

- The numerical score represents the face recognition/match score.
- The face attributes have binary impact on the scoring - if any fail, the attempt fails

When Liveness is ON

- The numerical score represents combination face recognition/match score and Liveness score.
- The face attributes have binary impact on the scoring - if any fail, the attempt fails

#

{/*

When Deepsight is ON

* The numerical score represents combination face recognition/match score and Deepsight MMI score.
* The face attributes have binary impact on the scoring - if any fail, the attempt fails
* Deepsight trust checks need to be added to rules via scoring.

*/}

<br />
