chukewang
commited on
Commit
·
d7af179
1
Parent(s):
9a6b961
Init: add images via LFS
Browse files- README.md +67 -0
- img/case.png +3 -0
- img/overview.png +3 -0
README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- audio-classification
|
| 5 |
+
- automatic-speech-recognition
|
| 6 |
+
- question-answering
|
| 7 |
+
tags:
|
| 8 |
+
- Audio
|
| 9 |
+
- Large Audio Language Models
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
metrics:
|
| 13 |
+
- F1
|
| 14 |
+
- IOU
|
| 15 |
+
- accuracy
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# TimeAudio: Bridging Temporal Gaps in Large Audio-Language
|
| 19 |
+
|
| 20 |
+
🚀🚀 The repo of **TimeAudio**!
|
| 21 |
+
|
| 22 |
+
Recent Large Audio-Language Models (LALMs) exhibit impressive capabilities in understanding audio content for conversational QA tasks. However, these models struggle to accurately understand timestamps for temporal localization (e.g., Temporal Audio Grounding) and are restricted to short audio perception, leading to constrained capabilities on fine-grained tasks. We identify three key aspects that limit their temporal localization and long audio understanding: (i) timestamp representation, (ii) architecture, and (iii) data. To address this, we introduce TimeAudio, a novel method that empowers LALMs to connect their understanding of audio content with precise temporal perception. Specifically, we incorporate unique temporal markers to improve time-sensitive reasoning and apply an absolute time-aware encoding that explicitly grounds the acoustic features with absolute time information. Moreover, to achieve end-to-end long audio understanding, we introduce a segment-level token merging module to substantially reduce audio token redundancy and enhance the efficiency of information extraction. Due to the lack of suitable datasets and evaluation metrics, we consolidate existing audio datasets into a new dataset focused on temporal tasks and establish a series of metrics to evaluate the fine-grained performance. Evaluations show strong performance across a variety of fine-grained tasks, such as dense captioning, temporal grounding, and timeline speech summarization, demonstrating TimeAudio's robust temporal localization and reasoning capabilities.
|
| 23 |
+
|
| 24 |
+
<div style='display:flex; gap: 0.25rem; '>
|
| 25 |
+
<a href='https://arxiv.org/pdf/.pdf'><img src='https://img.shields.io/badge/paper-PDF-green'></a>
|
| 26 |
+
<a href='https://huggingface.co/lysanderism/TimeAudio'><img src='https://img.shields.io/badge/huggingface-checkpoint-yellow'></a>
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Structure
|
| 31 |
+
|
| 32 |
+
TimeAudio is based on the fundamental architecture of SALMONN. Specifically, TimeAudio is consists of four components: a sliding audio encoder, a window Q-former, a segment-level token merging module, and an LLM to process raw audio. The sliding audio encoder first divides long audio into shorter segments and combines the BEATs and the Whisper encoder to extract features for each segments independently. Then, the window Q-former projects these encoded audio tokens into the language space and applies a segment-level token merging mechanism based on attention scores to filter out unimportant acoustic information.
|
| 33 |
+
Finally, the audio embeddings and the textual token embeddings of user prompts are fed into the LLM to generate response.
|
| 34 |
+
|
| 35 |
+
<div align=center><img src="img/overview.png" height="100%" width="75%"/></div>
|
| 36 |
+
|
| 37 |
+
## Demos
|
| 38 |
+
|
| 39 |
+
Compared with traditional speech and audio processing tasks such as speech recognition and audio caption, Example of failed cases by Qwen2-Audio and Qwen2-Audio-R1 on fine-grained tasks that require both semantics and timestamps as output.
|
| 40 |
+
|
| 41 |
+
<div align=center><img src="img/case.png" height="100%" width="75%"/></div>
|
| 42 |
+
|
| 43 |
+
## How to inference in CLI
|
| 44 |
+
|
| 45 |
+
You need to use the following dependencies:
|
| 46 |
+
|
| 47 |
+
1. Our environment: The python version is 3.10.16, and other required packages can be installed with the following command: ```pip install -r requirements.txt```.
|
| 48 |
+
2. Download [whisper large v2](https://huggingface.co/openai/whisper-large-v2/tree/main) to ```whisper_path```.
|
| 49 |
+
3. Download [Fine-tuned BEATs_iter3+ (AS2M) (cpt2)](https://valle.blob.core.windows.net/share/BEATs/BEATs_iter3_plus_AS2M_finetuned_on_AS2M_cpt2.pt?sv=2020-08-04&st=2023-03-01T07%3A51%3A05Z&se=2033-03-02T07%3A51%3A00Z&sr=c&sp=rl&sig=QJXmSJG9DbMKf48UDIU1MfzIro8HQOf3sqlNXiflY1I%3D) to `beats_path`.
|
| 50 |
+
4. Download [vicuna 7B v1.5](https://huggingface.co/lmsys/vicuna-7b-v1.5/tree/main) to ```vicuna_path```.
|
| 51 |
+
5. Download [salmonn-7b v0](https://huggingface.co/tsinghua-ee/SALMONN-7B/blob/main/salmonn_7b_v0.pth) to ```ckpt_path```.
|
| 52 |
+
6. Running with ```python3 cli_inference.py --ckpt_path xxx --whisper_path xxx --beats_path xxx --vicuna_path xxx``` to start cli inference. Please make sure your GPU has more than 40G of memory. If your GPU does not have enough memory (e.g. only 24G), you can quantize the model using the `--low_resource` parameter to reduce the memory usage, and can reduce the LoRA scaling factor to maintain the model's emergent abilities, e.g. `--lora_alpha=28`.
|
| 53 |
+
|
| 54 |
+
## Launch a QA
|
| 55 |
+
|
| 56 |
+
1. Same as **How to inference in CLI: 1-5**.
|
| 57 |
+
2. Running with ```python3 web_demo.py --ckpt_path xxx --whisper_path xxx --beats_path xxx --vicuna_path xxx``` in your machine. You can add `--low_resource` parameter if the GPU memory is not enough, and reduce the LoRA scaling factor to maintain the model's emergent abilities.
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
## Citation
|
| 61 |
+
If you find SALMONN great and useful, please cite our paper:
|
| 62 |
+
```
|
| 63 |
+
@article{,
|
| 64 |
+
title={TimeAudio: Bridging Temporal Gaps in Large Audio-Language Models},
|
| 65 |
+
author={Hualei Wang, Yiming Li, Shuo Ma, Hong Liu, Xiangdong Wang },
|
| 66 |
+
journal={arXiv preprint arXiv:},
|
| 67 |
+
year={2025},
|
| 68 |
+
url={https://arxiv.org/abs/}
|
| 69 |
+
}
|
| 70 |
+
```
|
img/case.png
ADDED
|
Git LFS Details
|
img/overview.png
ADDED
|
Git LFS Details
|