[Paper Review] Prompting Visual-Language Models for Dynamic Facial Expression Recognition
This paper proposes DFER-CLIP, a vision-language model that enhances in-the-wild dynamic facial expression recognition by integrating temporal modeling via Transformer encoders and fine-grained textual descriptions generated by large language models. The method achieves state-of-the-art performance on DFEW, FERV39k, and MAFW benchmarks, with a 51.65% weighted accuracy on MAFW and a 2.05% UAR improvement over prior methods on DFEW.
This paper presents a novel visual-language model called DFER-CLIP, which is based on the CLIP model and designed for in-the-wild Dynamic Facial Expression Recognition (DFER). Specifically, the proposed DFER-CLIP consists of a visual part and a textual part. For the visual part, based on the CLIP image encoder, a temporal model consisting of several Transformer encoders is introduced for extracting temporal facial expression features, and the final feature embedding is obtained as a learnable "class" token. For the textual part, we use as inputs textual descriptions of the facial behaviour that is related to the classes (facial expressions) that we are interested in recognising -- those descriptions are generated using large language models, like ChatGPT. This, in contrast to works that use only the class names and more accurately captures the relationship between them. Alongside the textual description, we introduce a learnable token which helps the model learn relevant context information for each expression during training. Extensive experiments demonstrate the effectiveness of the proposed method and show that our DFER-CLIP also achieves state-of-the-art results compared with the current supervised DFER methods on the DFEW, FERV39k, and MAFW benchmarks. Code is publicly available at https://github.com/zengqunzhao/DFER-CLIP.
Motivation & Objective
- To address the limitations of existing visual-language models in recognizing subtle, dynamic facial expressions in real-world settings.
- To improve representation learning for dynamic facial expressions by incorporating fine-grained textual descriptions of facial behaviors rather than relying solely on class names.
- To enhance temporal modeling of facial expressions using a sequence of Transformer encoders on top of a CLIP image encoder.
- To explore the effectiveness of learnable context tokens in conjunction with LLM-generated descriptions for better expression discrimination.
- To achieve state-of-the-art performance on in-the-wild DFER benchmarks without requiring extensive manual prompt engineering.
Proposed method
- The visual encoder extends CLIP’s image encoder with a stack of Transformer encoders to model temporal dynamics across video frames, with the final class token used as the video-level embedding.
- The textual encoder uses LLM-generated descriptions of facial behaviors associated with each emotion class (e.g., 'smiling with raised cheeks and crinkled eyes' for happiness), replacing simple class names.
- A learnable class-specific context token is introduced before each textual description to help the model attend to relevant semantic context during training.
- The model is trained end-to-end using contrastive learning to align visual embeddings with corresponding textual descriptions.
- The prompt design positions the LLM-generated description at the end of the text input, with the learnable context preceding it, enabling better feature alignment.
- The method supports prompt engineering without a classifier head, enabling zero-shot and few-shot adaptation through textual prompting.

Experimental results
Research questions
- RQ1Can LLM-generated, behavior-based textual descriptions improve visual-language alignment for dynamic facial expression recognition compared to simple class names?
- RQ2How does the integration of a temporal modeling head based on Transformers enhance the representation of facial dynamics in video sequences?
- RQ3Does the use of learnable context tokens improve model performance and generalization across diverse facial expression classes, especially in imbalanced datasets?
- RQ4How does the proposed DFER-CLIP model compare to state-of-the-art methods in terms of UAR and WAR across multiple in-the-wild benchmarks?
- RQ5What is the optimal prompt configuration (e.g., position of description, shared vs. class-specific context) for maximizing performance?
Key findings
- DFER-CLIP achieves a 51.65% weighted accuracy on the MAFW benchmark, outperforming previous state-of-the-art methods by 4.37% in WAR.
- On DFEW, the model achieves a 59.61% UAR, representing a 2.05% improvement over the previous best method.
- On FERV39k, the model reaches 71.25% UAR and 51.65% WAR, showing a 0.04% and 0.41% improvement, respectively, over the prior state of the art.
- The ablation study confirms that placing the LLM-generated description at the end of the prompt and using class-specific learnable contexts yields the best performance.
- The method outperforms manually designed prompts such as 'a photo of [class]' and 'an expression of [class]', especially on imbalanced datasets like MAFW.
- The use of LLM-generated descriptions with learnable context tokens consistently improves performance over baseline prompts, demonstrating the effectiveness of fine-grained textual supervision.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.