Facial Emotion Recognition

Seven emotions in real time, plus an overall sentiment, from a model that runs entirely on this device.

πŸ”’ Runs 100% in your browser Β· nothing is uploaded 91% RAF-DB 69% FER2013 79% unseen CK+ 4.2 M parameters
πŸ“·
Start the camera to see emotions in real time.
Video is processed on this device and never sent anywhere.
Works with several people in view. Face the light for best results.

Main face

πŸ™‚
β€”
waiting
Predictions are smoothed over a few frames so the label doesn't flicker.
πŸ–ΌοΈ
Drop a photo here or click to choose one
The largest face is analysed
Try:
Example: Migrant Mother (public domain) Example: astronaut crew (public domain)

Prediction

πŸ™‚
β€”
no photo yet
πŸ‘₯
Drop a group photo: a class, an audience, a team
Every face is classified
Try:
Example: astronaut crew (public domain) Example: astronaut crew (public domain)

Room mood

πŸ‘₯
β€”
Negativemood index β€”Positive

Sentiment split

How it works

πŸ“· Image / cameraβ†’YuNet face detectorβ†’Align eyes + tight cropβ†’DDAMFN (ONNX)β†’7 emotions β†’ sentiment

Both networks run in the browser with ONNX Runtime Web (WebAssembly). The emotion model is DDAMFN: a MixedFeatureNet backbone pretrained on MS-Celeb-1M faces with a dual-direction attention head, 4.19 M parameters. The default generalist was fine-tuned on RAF-DB + FER2013 together. Its explanations use occlusion sensitivity: hide part of the face and measure how much the prediction drops.

Results (test sets, evaluated once)

ModelRAF-DBFER2013CK+ (unseen)
Specialist (RAF-DB only)91.07%55.29%77.02%
Generalist (this page's default)90.81%69.00%78.96%
4-model ensemble (offline)91.98%71.72%77.56%

RAF-DB: 3,068 real-world test faces. FER2013: 7,178 grayscale 48Γ—48 faces (human agreement β‰ˆ 65%). CK+ was never used in training.

Highlights

  • Near state of the art on RAF-DB with ~10Γ— fewer parameters than POSTER++ (92.2%).
  • Multi-dataset training lifted FER2013 from 55% to 69% and also improved unseen CK+.
  • Robustness tested against blur, low light, noise, compression and occlusion. A mask hurts more than sunglasses.
  • Calibrated confidence scores (temperature scaling, ECE 3.8% β†’ 1.4%).
  • Deployment: ONNX export, 1.9Γ— faster than PyTorch on CPU with identical predictions.

Limitations & responsible use

Facial expression is not the same as felt emotion. Fear and Disgust are the weakest classes, and accuracy drops with heavy occlusion, blur or extreme head poses. This is a research demo and must not be used to judge, hire or surveil people.

Links

GitHub repository Β· Server version with Grad-CAM (Hugging Face)

Loading model…