Build a study from zero.
Welcome to the Affect Lens docs. This handbook walks through everything from building your first 5-minute study to exporting and analysing the data, all from the browser, no code required.
Quickstart, your first study in 5 minutes
Everything happens in the visual study builder. A minimal hybrid study chains one media phase and one survey phase, then exports as a single joined table.
- Create a study from the dashboard, or clone a template.
- Add a consent phase: pick a built-in IRB template or paste your own.
- Add a media phase: upload your video or audio clip and toggle on emotion + attention capture. Drop scene markers anywhere on the timeline.
- Add a survey phase: drag in question items (Likert, NPS, open-ended…). Reference tracking data with piping if you want.
- Share the link and watch results arrive in real time.
Phase types
| Type | Identifier | Description |
|---|---|---|
| Consent | consent | IRB-style consent screen with custom copy |
| Media | media | Video or audio playback with optional tracking |
| Survey | survey | One or more question items with logic |
| Hybrid | hybrid | Media + time-locked survey items in one phase |
| Instruction | instruction | Text/image/video instruction with timing controls |
| Randomiser | randomiser | Counter-balance, latin square, or random |
| Branch | branch | Route on any signal from earlier phases |
Emotion signals
Per-frame output, time-aligned to media playback. Sampled at 30fps when the participant's device permits, downsampled to 15fps automatically on slower hardware.
| Signal | Range | Notes |
|---|---|---|
| joy | 0..1 | Probability score |
| surprise | 0..1 | Probability score |
| sadness | 0..1 | Probability score |
| anger | 0..1 | Probability score |
| fear | 0..1 | Probability score |
| disgust | 0..1 | Probability score |
| contempt | 0..1 | Probability score |
| valence | -1..1 | Continuous, smoothed over 200ms window |
| arousal | 0..1 | Continuous, smoothed over 200ms window |
argmax for a single label per frame.Signal pipeline
Every captured frame passes through the same on-device pipeline before a signal is recorded. Understanding the stages helps you interpret the data and set quality thresholds for your study.
| Stage | What happens | Output |
|---|---|---|
| 1 · Detect | Face mesh + landmark detection per frame | 468 landmarks |
| 2 · Validate | Reject frames below quality threshold (face out of frame, occluded, too dark) | valid / dropped |
| 3 · Classify | Expression model maps landmarks → emotion probabilities | 7 affects |
| 4 · Smooth | Valence/arousal smoothed over a 200ms rolling window to suppress jitter | continuous |
| 5 · Align | Each sample is stamped with the media playback time, not wall-clock | timestamp_ms |
Capture runs at 30fps where the device allows, automatically dropping to 15fps on slower hardware. Dropped-frame ratio is recorded per participant so you can filter low-quality sessions out of analysis.
Attention & engagement index
Attention is a composite index (0–100) computed per timestamp, not a single survey number. It blends three on-device signals:
| Component | Derived from | Weight |
|---|---|---|
| Gaze stability | Eye/head steadiness toward the screen | 0.45 |
| Expression intensity | Magnitude of affect (any direction) | 0.30 |
| Presence | Face fully in frame, eyes open | 0.25 |
The engagement index is the attention curve weighted by absolute valence, capturing moments that are both attended and emotionally charged. Both curves are exported per frame and aggregated per scene.
Derived metrics
For every scene marker you place on a clip, the system auto-computes a standard set of metrics , no manual coding required.
| Metric | Definition | Unit |
|---|---|---|
| peak_valence | Highest smoothed valence within the scene | -1..1 |
| mean_valence | Average valence across the scene | -1..1 |
| time_to_smile | Latency from scene start to first joy onset | ms |
| peak_attention | Maximum attention index in the scene | 0..100 |
| dropoff_count | Number of attention drop-off events | count |
| dwell_ratio | Share of scene spent above attention threshold | 0..1 |
| emotion_share | Proportion of frames per dominant emotion | % per affect |
Cohort aggregation
Individual traces are aggregated into cohort views in real time as participants complete. You can slice by any survey variable or segment marker.
- Average emotion trace: mean valence/arousal across the cohort, with a confidence band, plotted over the media timeline.
- Normative comparison: overlay two arms (e.g. ad A vs ad B) on one axis to spot where they diverge.
- Segment cross-tabs: break any derived metric down by a survey answer (age band, prior brand use, condition).
- Synchronised replay: scrub the cohort emotion curve and the clip together to find the exact frame behind a peak.
Export schema
Every study exports as a set of CSV or Parquet files keyed by participant_id × phase_id × timestamp_ms.
We ship starter notebooks for R and Python covering the common paradigms (ANOVA, mixed-effects, time-series of emotion traces) so you can go from export to analysis in minutes.
Privacy & on-device processing
All facial analysis runs locally in the participant's browser. The raw webcam video never leaves their device and is never uploaded. Only the derived signals, emotion probabilities, attention scores, valence/arousal, and survey responses are transmitted.
Validated scales (built-in)
| Scale | Items | Use |
|---|---|---|
| PANAS | 20 | Positive/negative affect |
| SAM | 3 | Self-assessment manikin (valence/arousal/dominance) |
| SUS | 10 | System usability |
| UEQ-S | 8 | User experience (short) |
| NPS | 1 | Net promoter |
| BFI-10 | 10 | Big Five inventory (short) |