Affect-DML: Context-Aware One-Shot Recognition of Human Affect using Deep Metric Learning

Kunyu Peng, Alina Roitberg, David Schneider, Marios Koulakis, Kailun Yang, Rainer Stiefelhagen

Introduction

Traditional Human Affect Recognition (HAR) systems typically rely on large-scale supervised learning, requiring thousands of labeled examples for every emotional category. However, human emotional expression is highly nuanced and context-dependent. Psychologists have identified dozens of distinct emotional states, making the collection of massive datasets for every possible "emotion-in-context" combination a significant bottleneck.

To address this, the authors propose Affect-DML, a framework designed for one-shot recognition. The goal is to identify novel emotional categories (e.g., "Yearning" or "Engagement") using only a single reference example. This approach mirrors human capability: we can often infer a new emotional state by comparing it to known ones, even if we have only seen that specific state once before.

Conceptual overview of the one-shot affect recognition task, where knowledge is transferred from many training examples to novel categories with only a single example.

Methodology: The Affect-DML Framework

Affect-DML reframes affect recognition as a distance learning problem rather than a standard classification task. The core of the system is a multi-modal "Affect embedder" that projects visual data into a high-dimensional space where similar emotions are clustered together.

Multi-Modal Architecture

The architecture comprises three parallel streams to capture different facets of the scene:

  1. Body Stream ($f_{body}$): A ResNet-based backbone that focuses on the person of interest.
  2. Image Stream ($f_{img}$): A secondary ResNet backbone that captures the global visual context of the entire image.
  3. Sem2Vec ($M_{\delta}$): This novel branch incorporates semantic scene context. It uses a pre-trained HRNet to perform semantic segmentation, identifying objects like "trees," "tables," or "cars." These are converted into a binary vector ($f_{sem}$) and mapped to a semantic embedding.
The Affect-DML architecture. The model fuses body, image, and semantic features into a joint embedding space optimized via Triplet and Cross-Entropy losses.

Deep Metric Learning (DML)

The model is trained using a combination of Weighted Triplet Loss and Cross-Entropy Loss. The Triplet Loss ensures that embeddings of the same emotion are pulled closer while different emotions are pushed apart. At inference time, a "support" image of a novel emotion is projected into this space. New test samples are then classified using a K-Nearest Neighbor (KNN) approach based on their proximity to the support embedding.

Experimental Setup

The researchers utilized the Emotic dataset, which contains real-world images annotated with 26 emotional categories. To evaluate one-shot performance, they created several benchmarks:

  • Categorical Splits (CAT-6:6 & CAT-6:4): Coarse emotions (e.g., Anger, Joy) are used for training, while finer, novel emotions (e.g., Disconnection, Yearning) are reserved for one-shot testing.
  • Numerical Splits (LEV-7:3 & LEV-6:4): Splits based on continuous dimensions of Valence, Arousal, and Dominance.

Key Results and Insights

The inclusion of semantic context proved to be a critical factor in one-shot performance.

  • Contextual Advantage: The Sem2Vec branch provided a substantial performance boost, improving accuracy by over 8% in categorical tasks compared to models using only body and image data. This suggests that when visual cues from the person are limited (as in one-shot scenarios), the surrounding environment provides essential "common sense" clues.
  • State-of-the-Art Performance: Affect-DML consistently outperformed existing baselines. On the CAT-6:4 split, the model achieved 36.26% accuracy, a significant improvement over the 30.22% achieved by previous methods.
  • Flexibility: The metric learning approach allows the model to adapt to various psychological theories and new emotional labels without retraining the entire classifier.

Conclusion

Affect-DML demonstrates that deep metric learning, combined with explicit semantic context, is a powerful tool for one-shot affect recognition. By learning similarity rather than fixed labels, the model can generalize to novel emotional states with minimal data. Future work will explore more complex feature fusion techniques and the application of this framework to temporal video data to better capture the dynamics of human emotion.

Summary updated

BibTeX
@inproceedings{peng2021affect,
  author = {Kunyu Peng and Alina Roitberg and David Schneider and Marios Koulakis and Kailun Yang and Rainer Stiefelhagen},
  title = {{Affect-DML: Context-Aware One-Shot Recognition of Human Affect using Deep Metric Learning}},
  booktitle = {FG},
  year = {2021},
  doi = {10.1109/fg52635.2021.9666940},
}
Figure