> ## Documentation Index
> Fetch the complete documentation index at: https://developers.argosidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Best Practices for Face Liveness

> Guidelines for optimal Face Liveness detection and accuracy

<Callout type="info">
  To ensure optimal performance and accuracy, the following image file guidelines must be followed for identity verification processing.
</Callout>

## Image Quality Requirements

<CardGroup cols={2}>
  <Card title="Resolution" icon="image">
    Use high-resolution images (minimum 640x480 pixels) for better detection accuracy.
  </Card>

  <Card title="Format" icon="file">
    Supported formats: JPEG, PNG, WebP. Ensure proper compression without quality loss.
  </Card>

  <Card title="Lighting" icon="sun">
    Ensure adequate, even lighting without harsh shadows or overexposure.
  </Card>

  <Card title="Focus" icon="camera">
    Images should be clear and in focus, avoiding blurry or pixelated content.
  </Card>
</CardGroup>

## Image Content Constraints

### 1. Face Area

<Check>
  * Only one visible face allowed
  * Face must be fully visible — no cropping at top, sides, or chin- Minimum face box size: 150 x 150 pixels
  * Minimum pupil-to-pupil distance (distance between eyes): 50 pixels or more
  * Padding between face and image borders: at least 15 pixels
  * No occlusions (e.g. hair, hand, mask, accessories)
  * No background faces or partial faces in the image
</Check>

### 2. Face Orientation

<Check>
  * Frontal face required
  * Pitch / yaw angle must be within ±30 degrees
  * No extreme tilt or side-view
  * Eyes, nose, and mouth must be symmetrically aligned
</Check>

## Conditions That May Cause Failure

<Danger>
  * Motion blur
  * Filtered images (e.g. texture smoothing, beautify filters)
  * Strong light reflections or glare on the face
  * Low light or colored lighting conditions
  * Wide-angle or fish-eye lens distortion
  * Sunglasses or heavily tinted glasses
</Danger>

## Content Guidelines

<Steps>
  <Step title="Natural Expression">
    Capture natural facial expressions without forced smiles or exaggerated poses.
  </Step>

  <Step title="Direct Gaze">
    Eyes should be open and looking directly at the camera for optimal detection.
  </Step>

  <Step title="Full Face">
    Ensure the entire face is visible, including ears and hairline when possible.
  </Step>

  <Step title="No Obstructions">
    Avoid glasses, masks, hats, or other items that may cover facial features.
  </Step>
</Steps>

## Common Issues to Avoid

<CardGroup cols={1}>
  <Card title="Poor Lighting" icon="moon" color="red">
    Avoid low light conditions, harsh shadows, or overexposed images that may interfere with detection.
  </Card>

  <Card title="Blurry Images" icon="eye-low-vision" iconType="regular" color="red">
    Ensure images are clear and in focus. Blurry images may result in detection failures.
  </Card>

  <Card title="Partial Face" icon="user-xmark" iconType="solid" color="red">
    Avoid cropping that cuts off parts of the face or showing only partial facial features.
  </Card>

  <Card title="Multiple Faces" icon="users" color="red">
    Images should contain only one face. Multiple faces may cause detection issues.
  </Card>

  <Card title="Reflections" icon="sun" color="red">
    Avoid reflections on glasses or other surfaces that may interfere with facial analysis.
  </Card>
</CardGroup>

## Technical Requirements

<AccordionGroup>
  <Accordion title="Image Format Specifications">
    * **Format**: JPEG, PNG, WebP
    * **Maximum Size**: 10MB
    * **Minimum Resolution**: 640x480 pixels
    * **Aspect Ratio**: 1:1 to 4:3 recommended
    * **Color Space**: RGB or sRGB
  </Accordion>

  <Accordion title="Base64 Encoding">
    * Remove MIME type prefix (e.g., "image/png;base64,")
    * Use standard base64 encoding
    * Ensure no line breaks or special characters
    * Maximum encoded length: 15MB
  </Accordion>

  <Accordion title="Processing Time">
    * Typical response time: 2-5 seconds
    * May vary based on image size and server load
    * Larger images may take longer to process
  </Accordion>
</AccordionGroup>

## Success Tips

<Steps>
  <Step title="Test with Sample Images">
    Use our sample images to test the API before implementing in production.
  </Step>

  <Step title="Implement Retry Logic">
    Add retry mechanisms for failed requests due to temporary issues.
  </Step>

  <Step title="Monitor Response Times">
    Track API response times and adjust image sizes if needed.
  </Step>

  <Step title="Validate Results">
    Always validate the liveness score and implement appropriate thresholds for your use case.
  </Step>
</Steps>

<Callout type="warning">
  Remember that liveness detection is not 100% foolproof. Always implement additional security measures and consider the liveness score as part of a broader verification strategy.
</Callout>

## Photo Guidelines

<img src="https://mintcdn.com/argosidentity/XDoaaMLWTIfazlLD/images/verify/face_liveness_photo_guideline.png?fit=max&auto=format&n=XDoaaMLWTIfazlLD&q=85&s=2805a5bf1bc8a2bf27db04af4dc41866" alt="Alt text describing the image" width="1614" height="1916" data-path="images/verify/face_liveness_photo_guideline.png" />
