Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# R1-Omni: Explainable Omni-Multimodal Emotion Recognition with Reinforcement Learning
|
2 |
+
|
3 |
+
[](https://github.com/Jiaxing-star/R1-Omni)
|
4 |
+
[](https://modelscope.cn/models/iic/R1-Omni-0.5B)
|
5 |
+
[](https://arxiv.org/abs/2503.05379)
|
6 |
+
|
7 |
+
|
8 |
+
## 📖 Introduction
|
9 |
+
**R1-Omni** is the industry’s first application of Reinforcement Learning with Verifiable Reward (RLVR) to an Omni-multimodal large language model. We focus on emotion recognition, a task where both visual and audio modalities play crucial roles, to validate the potential of combining RLVR with Omni model. Our findings reveal several key insights:
|
10 |
+
1) **Enhanced Reasoning Capability**: R1-Omni demonstrate superior reasoning abilities, enabling a clearer understanding of how visual and audio information contribute to emotion recognition.
|
11 |
+
2) **Improved Understanding Capability**: Compared to SFT, RLVR significantly boosts performance on emotion recognition tasks.
|
12 |
+
3) **Stronger Generalization Capability**: RLVR models exhibit markedly better generalization capabilities, particularly excelling in out-of-distribution scenarios.
|
13 |
+
|
14 |
+
|
15 |
+
## 🏆 Performance
|
16 |
+
|
17 |
+
Below are the performance on emotion recognition datasets. We use symbols to indicate whether the data is **in-distribution (⬤)** or **out-of-distribution (△)**.
|
18 |
+
|
19 |
+
| Method | DFEW (WAR) ⬤ | DFEW (UAR) ⬤ | MAFW (WAR) ⬤ | MAFW (UAR) ⬤ | RAVDESS (WAR) △ | RAVDESS (UAR) △ |
|
20 |
+
|----------------------------------|---------------|---------------|---------------|---------------|------------------|------------------|
|
21 |
+
| HumanOmni-0.5B | 22.64 | 19.44 | 20.18 | 13.52 | 7.33 | 9.38 |
|
22 |
+
| EMER-SFT | 38.66 | 35.31 | 38.39 | 28.02 | 29.00 | 27.19 |
|
23 |
+
| MAFW-DFEW-SFT | 60.23 | 44.39 | 50.44 | 30.39 | 29.33 | 30.75 |
|
24 |
+
| R1-Omni | 65.83 | 56.27 | 57.68 | 40.04 | 43.00 | 44.69 |
|
25 |
+
|
26 |
+
|
27 |
+
### Legend
|
28 |
+
- **⬤**: Indicates **in-distribution data** (DFEW and MAFW).
|
29 |
+
- **△**: Indicates **out-of-distribution data** (RAVDESS).
|
30 |
+
|
31 |
+
|
32 |
+
## 🛠️ Environment Setup
|
33 |
+
Our code is built on the R1-V framework. To set up the environment, please follow the installation instructions in the [R1-V repository](https://github.com/Deep-Agent/R1-V/)
|
34 |
+
|
35 |
+
## 🔍 Inference
|
36 |
+
Our inference code is based on the implementation from **HumanOmni**. To ensure the model runs inference smoothly, follow these steps:
|
37 |
+
|
38 |
+
1. **Download the Required Models**:
|
39 |
+
- [siglip-224](https://huggingface.co/google/siglip-base-patch16-224).
|
40 |
+
- [whisper-large-v3](https://huggingface.co/openai/whisper-large-v3).
|
41 |
+
|
42 |
+
2. **Update the Configuration File**:
|
43 |
+
- In the directory where you downloaded the R1-Omni model, locate the config.json file.
|
44 |
+
- Update the paths on line 23 and line 31 to point to the local folders where you saved the models.
|
45 |
+
|
46 |
+
|
47 |
+
#### Example: Updating config.json
|
48 |
+
If you saved the models to the following local paths::
|
49 |
+
- `/path/to/local/models/siglip-base-patch16-224`
|
50 |
+
- `/path/to/local/models/whisper-large-v3`
|
51 |
+
|
52 |
+
Update the relevant lines in config.json as follows:
|
53 |
+
```json
|
54 |
+
"mm_audio_tower": "/path/to/local/models/whisper-large-v3",
|
55 |
+
"mm_vision_tower": "/path/to/local/models/siglip-base-patch16-224"
|
56 |
+
```
|
57 |
+
|
58 |
+
We provide inference.py for singe video inference.
|
59 |
+
```
|
60 |
+
python inference.py --modal video_audio \
|
61 |
+
--model_path ./R1-Omni-0.5B \
|
62 |
+
--video_path video.mp4 \
|
63 |
+
--instruct "As an emotional recognition expert; throughout the video, which emotion conveyed by the characters is the most obvious to you? Output the thinking process in <think> </think> and final emotion in <answer> </answer> tags."
|
64 |
+
```
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
## 🧠 Training
|
69 |
+
### Cold Start
|
70 |
+
we initialize the HumanOmni-0.5B by fine-tuning it on a combined dataset consisting of 232 samples from the [Explainable Multimodal Emotion Reasoning](https://github.com/zeroQiaoba/AffectGPT) dataset and 348 samples from HumanOmni dataset.
|
71 |
+
An example json file of the training data:
|
72 |
+
```
|
73 |
+
[
|
74 |
+
{
|
75 |
+
"video": "MER24/sample_00000967.mp4",
|
76 |
+
"conversations": [
|
77 |
+
{
|
78 |
+
"from": "human",
|
79 |
+
"value": "<video>\n<audio>\nAs an emotional recognition expert; throughout the video, which emotion conveyed by the characters is the most obvious to you? Output the thinking process in <think> </think> and final emotion in <answer> </answer> tags."
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"from": "gpt",
|
83 |
+
"value": "<think>The video depicts a bright and tranquil indoor setting, where a man in a white Polo shirt stands by the window, engaged in a phone call. His furrowed brow and open mouth suggest he is experiencing tension and anxiety. According to the audio content of the video, his speech is fast-paced, and his tone is filled with confusion and stress. A comprehensive analysis reveals that the man is facing a moderate level of anxiety, closely linked to the challenging phone conversation he is having. Consequently, the entire emotional analysis report emphasizes his anxiety and nervousness in handling challenging situations.</think>\n<answer>anxious</answer>"
|
84 |
+
}
|
85 |
+
]
|
86 |
+
},
|
87 |
+
...
|
88 |
+
]
|
89 |
+
```
|
90 |
+
All of the cold-start data will be released as soon as possible.
|
91 |
+
|
92 |
+
### RLVR
|
93 |
+
In this stage, we utilize the training sets from the [MAFW](https://mafw-database.github.io/MAFW/) and DFEW(https://dfew-dataset.github.io/) datasets, comprising a total of 15,306 video sample.
|
94 |
+
An example json file of the training data:
|
95 |
+
```
|
96 |
+
[
|
97 |
+
{
|
98 |
+
"video": "DFEW/videos/1.mp4",
|
99 |
+
"conversations": [
|
100 |
+
{
|
101 |
+
"from": "human",
|
102 |
+
"value": "<video>\n<audio>\nAs an emotional recognition expert; throughout the video, which emotion conveyed by the characters is the most obvious to you?"
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"from": "gpt",
|
106 |
+
"value": "sad"
|
107 |
+
}
|
108 |
+
],
|
109 |
+
},
|
110 |
+
...
|
111 |
+
]
|
112 |
+
```
|
113 |
+
|
114 |
+
|
115 |
+
## 🤝 Related Work
|
116 |
+
- [R1-V](https://github.com/Deep-Agent/R1-V)
|
117 |
+
- [HumanOmni](https://github.com/HumanMLLM/HumanOmni)
|
118 |
+
- [DeepSeek-R1](https://github.com/deepseek-ai/DeepSeek-R1)
|
119 |
+
|
120 |
+
## 📚 Citation
|
121 |
+
If you find our work helpful, feel free to give us a cite.
|
122 |
+
```
|
123 |
+
{zhao2025r1omniexplainableomnimultimodalemotion,
|
124 |
+
title={R1-Omni: Explainable Omni-Multimodal Emotion Recognition with Reinforcement Learning},
|
125 |
+
author={Jiaxing Zhao and Xihan Wei and Liefeng Bo},
|
126 |
+
journal={arXiv preprint arXiv:2503.05379},
|
127 |
+
year={2025}
|
128 |
+
}
|
129 |
+
```
|