> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/sensor-setup/facial-expression-analysis/enabling-affectiva-affdex-in-imotions.md).

# Enabling Affectiva AFFDEX in iMotions

Enable Affectiva AFFDEX facial expression analysis in iMotions Lab, set up multiface detection, check the face overlay and get good recording conditions.

*How to enable Facial Expression Analysis (FEA) with Affectiva AFFDEX.*

## Enabling AFFDEX

1. [Enable your Respondent Camera in iMotions Global Settings (Audio & Video tab)](https://help.imotions.com/lab/sensor-setup/camera-setup-audio-and-video-settings.md)
2. Under the *Affectiva AFFDEX* section in the bottom check the *Enable Data Collection* button.
3. Click 'OK' to save settings.

<figure><img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2FmexdE9cU8PB9XGrPYYnI%2Fimage.png?alt=media&amp;token=591a758e-e6c0-4cdb-b24c-99b4a15bca16" alt=""><figcaption></figcaption></figure>

### Save Respondent Video

By default, iMotions is set to “Save Respondent Video” - which saves recordings from the Respondent Camera during data collection (for subsequent post-processing or analysis).

Disabling/unchecking this option will prevent iMotions from saving the Respondent Video (e.g. for participant privacy/anonymity or reducing file size).

Facial expression data would still be provided and saved. Facial expression analysis can be applied to the Respondent Camera, during data collection.

### Enabling Multiface Processing

* Check “Enable Multiface Detection” to allow detection and analysis of multiple-faces in the Respondent Camera (requires Affective Multiface module).
  * Note: Multiface analysis provides facial expression data for up to 8 faces.
* (Optional) Check "Recognize Faces" to enable the face recognition feature, which will have the analysis attempt to recognize faces and compile data for them (rather than different faces and separate data/signals)
  * Recommended if recordings contain gaps in face detection/analysis, e.g. if faces move out-of-frame of the video recording.

<figure><img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2FSl3r6gKkpumWtltM8X6b%2Fimage.png?alt=media&amp;token=a1f8d957-5266-4993-9890-c42fe29fd7d6" alt=""><figcaption></figcaption></figure>

## Viewing AFFDEX processing

### AFFDEX Overlay in Respondent Camera widget

Once AFFDEX is enabled, the AFFDEX overlay will appear in the Respondent Camera widget:

* When a face is detected, a **Facebox** and AFFDEX facial landmarks are overlaid on the respondent camera video
  * **'No Face Detected!' warning** indicates that AFFDEX can not detect a face, due to respondent position or camera focus.
* Top-left: AFFDEX processing rate/camera capture rate
  * **Processing rate** shows how many Frames Per Second are currently being processed in real-time, over the Respondent Camera capture frame rate. Typical processing for a standard 30 Hz camera, is 10-20 AFFDEX frames per second. These values vary with camera and computer performance.
* Top-right: **Facebox width** in camera video pixels
  * Facebox width indicates the width of the white box that appears around the detected face (0px if no face is detected). The Facebox width should be at least 100px.

<figure><img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-72e079cad5a72da3b527f2231cefc6107cbb60cb%2F5b425ff105_image-1727730100232.webp?alt=media" alt=""><figcaption><p>AFFDEX overlay in Respondent Camera widget</p></figcaption></figure>

### AFFDEX Signal in Sensor Preview window

Once AFFDEX is enabled, AFFDEX signals will appear in the Sensor Preview window in the Signals Menu (accessed on the left of the window).

1. Click on 'Sensor Preview'
2. Open the Signals Menu, where 'Affectiva AFFDEX' should be available.
3. Click to the left of any signal to display in the Signals Panel (along the preview timeline)
4. Check that the graphs are streaming live and that the data fluctuates as expected.

   <figure><img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-dbeb984c7879698a145ac6b8ec4b0a55423de4ed%2F8b206ee96f_image-1727732595784.webp?alt=media" alt=""><figcaption><p>Sensor Preview window with Affectiva AFFDEX signal</p></figcaption></figure>

### Best Practices for AFFDEX processing

AFFDEX processing relies upon video recording quality, as it relates to the face you want to analyze. Several factors contribute to better recording quality for AFFDEX.

* **Lighting** and **Background Environment** are critical factors for AFFDEX processing. Best results are obtained with uniform, diffused illumination of the face against a dark, contrasting background.
  * Bright background lighting, detected by the respondent camera, will 'wash out' the video image - where the camera adjusts to the bright light and loses sensitivity to light from the face. More specifically, the face detection is lost if the average pixel brightness for the face falls below 30 on a scale from 0 (black) to 255 (white).
  * Objects in the background, around the face, can interfere with AFFDEX processing. Avoid capturing other faces and/or salient objects with the respondent camera.
* **Camera-Respondent Position/Focus** is also critical for AFFDEX processing. The Respondent Camera should be set at eye level and directed to the front of the respondent's face. Movement or rotation of the face, away from this position, may result in loss of face detection.
  * It is very likely (if not necessary) that respondents will move a little or a lot - this should be accommodated by the camera position.
  * The Facebox should be at least 100px, but not take up the entire video frame – this will lower the performance of face detection algorithms.
* **Head Movement/Pose** is ideally between 5-10 degrees up/down and 40 degrees left/right for AFFDEX 5.1 or newer (25 degrees for older AFFDEX versions). Head tilt rotations are generally accommodated with face processing.
* **Respondent Compliance** can facilitate AFFDEX processing.
  * Respondent instructions, study task demands, and comfort should be considered, to ensure they can/will remain within view of the Respondent Camera.
  * Respondents should ensure that their hair, hands, clothing, hats, sunglasses, or other objects do not block the camera view. Talking, chewing gum, drinking/eating, phone use, and other distractions should be avoided.
* **Camera Quality** also affects data quality. Most cameras allow at least 640x480 video resolution at 20-30 frames per second. Higher resolution and/or frame rates may be beneficial, but may also create processing/memory demands to consider.

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-d1205c181d9cd0420dbd9a55aea5893db12556b1%2Fd9b81198bc_affdex_no_face.webp?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/sensor-setup/facial-expression-analysis/enabling-affectiva-affdex-in-imotions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
