> 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/getting-started/multimodal-data-overview/introduction-to-facial-expression-analysis.md).

# Introduction to: Facial Expression Analysis

Understand how automatic facial expression analysis detects faces and classifies expressions, how results are visualized, and what it cannot measure.

**Facial expression analysis (FEA) measures movements of facial muscles to capture expressed emotions like joy, sadness, disgust, and overall valence in response to stimuli.**

**Background**

* Facial muscle activity is specialized for expression - it allows us to share social information with others.
* Almost all facial muscles are controlled by a single nerve, the facial nerve. This nerve can be triggered by emotionally relevant stimuli. Emotions and the facial nerve are so closely connected that the same regions in the brain that trigger our facial expressions also control emotional processing and regulation.
* Emotions can be defined as complex action programs triggered by the presence of certain external or internal stimuli. These “action programs” include facial muscle movements as part of an emotional episode.
* Though there are thousands of slightly varying sets of facial expressions, basic emotion theory (Ekman) proposes a small set of distinctive facial configurations that people associate with certain emotions across cultures. Joy, Anger, Surprise, Fear, Contempt, Sadness, and Disgust are known as the “7 basic emotions”, and facial expression analysis engines such as AFFDEX classify expressions of these seven. How universal these expressions are, and how reliably a facial configuration reveals what someone feels, is debated: people do not always show the same expression when they feel an emotion, and how expressions are read varies between cultures ([Barrett et al., 2019](https://doi.org/10.1177/1529100619832930)).

**How it Works**

* Facial expression analysis (FEA) can be collected and analyzed in three different ways:
  * Tracking of facial electromyographic activity (fEMG)
  * Live observation and manual coding of facial activity
  * Automatic facial expression analysis using computer-vision
* The iMotions platform uses automatic FEA.
* Automatic facial coding procedures have been developed and made available to the broader public, instantaneously detecting faces, coding facial expressions, and classifying them as expressions of emotions.
  * This breakthrough has been mainly enabled by the adoption of state-of-the-art computer vision and machine learning algorithms along with the gathering of high-quality databases of facial expressions all across the globe.
* For the most part, all facial expression analysis engines comprise the same steps. Affectiva AFFDEX, for example, applies the following:
  * Face detection
  * Facial action units (AU) detection and registration
  * Facial expression and emotion classification

These processes can be explained as follows:

* Face detection: The position of the face is found in a video frame or image, which can be achieved by applying an algorithm that results in a box framing the detected face.
* Feature detection: Within the detected face, facial landmarks such as eyes, brows, mouth, and other facial features are detected. After this, an internal face model is adjusted in position, size, and scale to match the respondent’s actual face. Whenever the respondent’s face moves or changes expressions, the face model adapts and follows instantaneously.
  * The face must be fully in view for the algorithm to detect the face, meaning that it is important to ensure the face is not obstructed from view when collecting facial data.

**Facial Expression and Emotion Classification + Quantification**

* The translation from face features into metrics is accomplished statistically, comparing the actual appearance of the face and the configuration of the features numerically with the normative databases provided by facial expression engines.
  * This means that the current facial expression of a respondent is not compared one-by-one with all hundreds of thousands of pictures in the database. Instead, the databases contain statistics and normative distributions of all feature characteristics across respondents from multiple geographic regions and demographic profiles as well as stimulus categories and recording conditions. Every FEA engine uses a different database.
  * Classification is done on a purely statistical level. Refer to the image below. The filled dots are all mouth configurations that are not classified as smiles, while the white dots are mouth configurations that are regarded as smiles. Thus, the classifier returns only a probabilistic result, reflecting the likelihood or chance that the expression is an authentic “smile.”

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

**Data Visualizations**

* One way to visualize facial expressions is by comparing levels of expression using a bar graph. One valuable metric to investigate is the percent of time participants spend exhibiting a specific facial expression.
  * In the example below comparing a website’s old design to the new prototype design, we can conclude that across three assigned tasks, participants evoked the most brow furrow while navigating the old design website. This finding may suggest that participants experienced a higher level of frustration while completing tasks on the old website. Eye tracking can then be utilized to determine the sticking points in the design that produced these reactions. These biosensor-based findings can also be supplemented with further probing about the participant experience through self-reported measures.

    ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-13420d6aa85aa7f37ecc81de087b6ea394f7350b%2F6b7cb0c232_FEA2.webp?alt=media)
* Another way to visualize facial expressions is by using the affective circumplex. The circumplex model of emotion suggests that emotions are understood in a two-dimensional circular space, containing arousal and valence dimensions. Arousal represents the Y-axis and valence represents the X-axis. In the example below, scent stimuli are placed in a circumplex showing their arousal intensity measured by GSR, and their valence level based on facial expressions.

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

**What FEA Doesn’t Measure**

* One of the core limitations of facial expression analysis is its inability to assess someone’s emotional arousal, that is, the intensity of an emotion. It is important to remember that facial expression classifiers typically output probability. There is indeed some correlation between a high expression probability and the intensity of the expression, but they are not the same, and it is very difficult to quantify off of webcam-based measures alone. Facial expressions provide you information on what is *expressed.* For this reason, a multimodal approach is the best way to paint a full picture of the participant experience, by adding other biosensors such as GSR and EEG to shed extra light on how someone is reacting physiologically to a stimulus.

**Academic Applications**

For researchers, emotions are fundamental in understanding human behavior, as they are a crucial part of non-verbal communication and a rich source of social signals. Facial expression analysis and emotion data provide insights that allow researchers to investigate complex human behaviors in greater depth.

Academically, facial expression analysis is widely used in research on emotions. For instance, many researchers utilize FEA to understand emotional experiences in different cultures. FEA is also used in different fields related to medicine and psychology for diagnostic purposes, since some clinical populations show different facial reactions to emotional stimuli than the normal population (e.g. autism and schizophrenia). Monitoring facial expressions while patients are exposed to emotionally arousing stimuli or social cues can significantly boost the success of the underlying cognitive-behavioral therapy, both during the diagnostic as well as the intervention phase.

Facial expressions are also used in psychological research. Psychologists may analyze facial expressions to identify how humans respond emotionally towards external and internal stimuli. In systematic studies, researchers can specifically vary stimulus properties and social expectancies to evaluate how personality characteristics and individual learning histories impact facial expressions.

Facial expression analysis can also be used to quantify deterioration and evaluate the success of surgical interventions and occupational and physical therapy targeted towards reactivating paralyzed muscle groups in the face.

**Commercial Applications**

Commercially, FEA is used to understand expressive responses to marketing stimuli. In consumer neuroscience and neuromarketing fields, tracking facial expressions can be leveraged to substantially enrich self-reports with quantified measures of emotional responses towards a product or service. Based on these findings, products can be optimized, market segments can be assessed, and target audiences and personas can be identified. In the case of media testing and advertisements, individual respondents or focus groups can be exposed to TV advertisements, trailers, and full-length pilots while monitoring their facial expressions. These data can then be used to complement galvanic skin response moment to moment graphs, EEG behavioral response, and eye tracking metrics used in video ad testing.

FEA is used for software UI and website design, too. Monitoring facial expressions while testers browse websites or software dialogs can provide insights into the emotional satisfaction of the desired target group. For example, whenever users encounter roadblocks or get lost in complex sub-menus, we can certainly see that the “negative” facial expressions, such as brow furrowing, increase.

Finally, the latest breakthroughs in hardware technology, computer vision, and machine learning have laid the foundation for artificial social agents, which can reliably detect and flexibly respond to emotional states of the human communication partner.

**For more in-depth explanations of FEA, please check out our blog.**


---

# 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/getting-started/multimodal-data-overview/introduction-to-facial-expression-analysis.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.
