- Emotion recognition
- CNN + Vision Transformer
- RAF-DB
- TensorFlow / Keras
GlobalFaceNet
Reading emotion from a single face, by looking at the fine detail and the whole face at once.
- 85.0%Accuracy on RAF-DB
- 3.2 msInference per image
- 7Emotion classes
Seven emotions from one face
Given a single face image, the model picks one of seven expressions from the RAF-DB dataset. No audio, no video: just the still image.
- surprise
- fear
- disgust
- happy
- sad
- angry
- neutral
RAF-DB is available to researchers on request and isn't hosted here; the faces below are simple drawings, for illustration.
A 100×100 face
Each face is resized to 100×100 with three colour channels and normalised. Light augmentation (rotation, shifts, horizontal flip) is used during training.
100 × 100 × 3 · normalised to [0, 1]
Convolutions read local structure
Four convolution blocks grow the channels and shrink the map (32 → 64 → 128 → 512), turning pixels into local features (edges, brows, mouth shapes).
Local detail + global context, then fused
The feature maps feed two branches. The CNN path pools the deep 512-channel map for fine local detail. The Transformer path cuts the 128-channel map into 2×2 patches, adds positional encodings, and runs two Transformer blocks (8 heads) to capture global spatial relationships. The two are concatenated, then a dense head predicts the emotion.
Pick an emotion, watch it classify
Choose an expression; the face shows it and the model's seven-way output updates. (Illustrative example outputs: the shape of a confident prediction.)