Multi-threshold deep metric learning for facial expression recognition

Wenwu Yang, Jinyi Yu, Tuo Chen, Zhenguang Liu, Xun Wang, Jianbing Shen

Introduction

Facial Expression Recognition (FER) remains a significant challenge in computer vision due to the dominance of "identity bias." In many feature spaces, the visual differences between two individuals making the same expression can be greater than the differences between the same individual making two different expressions. Deep metric learning, particularly triplet loss, is frequently employed to mitigate this by ensuring that an "anchor" image is closer to a "positive" (same expression) than a "negative" (different expression) by a margin $\tau$.

However, standard triplet loss suffers from two primary limitations: the difficulty of selecting an optimal global margin $\tau$ and the potential for "incomplete judgments," where training stabilizes even when negative examples remain too close to positive clusters.

Proposed Method: Mul-DML

To address these issues, this paper introduces a Multi-threshold Deep Metric Learning (Mul-DML) framework. The architecture utilizes a ResNet-18 backbone followed by a specialized Metric Learning Block (MLB).

The Mul-DML architecture integrates a DCNN with a Multi-threshold Metric Learning Block (MLB) featuring Dual Triplet Loss.

1. Multi-threshold Embedding Slices

Rather than optimizing for a single, elusive "Goldilocks" threshold, the authors partition the final embedding layer into $N$ non-overlapping slices. Each slice is trained using a distinct threshold $\tau$ sampled from a range (e.g., 0.15 to 0.75). This approach allows the model to capture inter-class variations at multiple granularities simultaneously, creating a more robust and discriminative feature representation.

t-SNE visualizations demonstrate how different margin thresholds (\tau) capture varying granularities of expression clusters.

2. Dual Triplet Loss

To resolve the "incomplete judgment" problem—where a negative example might satisfy the anchor-based constraint while remaining dangerously close to the positive example—the authors propose a Dual Triplet Loss. This modified objective function includes an additional term that explicitly considers the distance between the positive and negative examples, breaking the cycle of training instabilities and leading to faster convergence.

Experimental Results

The Mul-DML approach was evaluated on both lab-controlled and real-world datasets, achieving state-of-the-art (SOTA) performance across the board:

  • CK+ & MMI: Achieved 98.49% and 81.57% accuracy, respectively, setting new benchmarks for lab-controlled environments.
  • RAF-DB: On this large-scale real-world dataset, the model reached 87.58% accuracy.
  • SFEW 2.0: In highly variable "in-the-wild" movie scenes, the model achieved a competitive 60.09% accuracy.

Conclusion

By moving away from the search for a single optimal threshold and instead leveraging a multi-threshold slicing strategy, the proposed Mul-DML framework significantly improves the discriminative power of facial expression embeddings. The addition of Dual Triplet Loss further stabilizes training, making this a robust solution for both controlled and real-world FER tasks. Future work will explore integrating these techniques with label-uncertainty learning to further improve performance on noisy, real-world data.

Summary updated

BibTeX
@article{yang2024multi,
  author = {Wenwu Yang and Jinyi Yu and Tuo Chen and Zhenguang Liu and Xun Wang and Jianbing Shen},
  title = {{Multi-threshold deep metric learning for facial expression recognition}},
  journal = {Pattern Recognition},
  year = {2024},
  url = {https://openreview.net/forum?id=FoEvXqXCph},
}
Figure