GokseninYuksel commited on
Commit
d3a9240
·
verified ·
1 Parent(s): f0ddc66

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -82
README.md CHANGED
@@ -14,49 +14,47 @@ pipeline_tag: feature-extraction
14
 
15
  # Model Card for Model ID
16
 
17
- GRAM (General Purpose Audio Representation Model) is trained on AudioSet with newly proposed naturalistic training methadology.
18
- GRAMs utilize MWMAE (Multi-window multi-head attention), and RIR augmentations to achieve state-of-the-art results on downstream tasks such as FSD50K, ESC50, VL even when conditions are very adverse. What is different about GRAMs is the spatial reasoning capabilities, and the robustness to noise and reverberation.
19
- GRAMs natively support binaural localization, and ambisonics localization tasks unlike other models in the literature. Therefore, GRAMs can be used for understanding spatial scenes as well as classifying sounds, or recognizing speech in very noisy and reverberant environments.
20
 
21
 
22
  ## Model Details
23
 
24
- The GRAM learns spatial audio representation by reconstructing multi-channel masked spectrogram
25
  patches. First, a patch extractor consisting of a single convolutional layer with 2D convolutional
26
  filters divides each multi-channel spectrogram into n non-overlapping patches. Nonmasked patch embeddings are input to the encoder, for which we selected the 12-layer ViT-Base
27
  (ViT-B) Transformer (Dosovitskiy et al., 2021) similar to Huang et al. (2022); Yadav et al. (2024).
28
  The encoder outputs patch representations that can be further used for fine-tuning.
 
29
  ### Model Description
30
 
31
- GRAM is a self-supervised, multi-channel masked auto-encoder model that efficiently learns spatial general-purpose audio representations
32
- from simulated real-world sound scenes. To train GRAM, we developed a custom pipeline which
33
  makes use of the Soundspace 2.0 platform (Chen et al., 2022a) to simulate high-quality real-world
34
  sound scenes from AudioSet (Gemmeke et al., 2017), and of WHAMR! (Maciejewski et al., 2020)
35
- for adding background noise. We present two versions of GRAM to ensure flexible application across audio formats:
36
- GRAM-Binaural for two-channel audio clips, and GRAM-Ambisonics for four-channel audio clips in
37
- the first-order Ambisonics format.
38
 
39
 
40
  - **Developed by:** Goksenin Yuksel, goksenin.yuksel@ru.nl
41
  - **Model type:** Transformers, Audio Foundation Models
42
- - **Language(s) (NLP):** GRAMs support all languages, but mainly English.
43
  - **License:** MIT
44
 
45
  ### Model Sources
46
 
47
- - **Repository:** https://github.com/labhamlet/GRAM-T
48
  - **Paper:** https://arxiv.org/abs/2506.00934
49
 
50
  ## Uses
51
 
52
- GRAMs can be used as a powerful feature extractor for downstream tasks such as enviromental sound classification, speech recognition, speaker counting, sound localization.
53
  Later, training a linear head on top of these extracted features would yield a fine-tuned audio scene analysis model.
54
 
55
 
56
  ## How to Get Started with the Model
57
 
58
 
59
- GRAMs have three strategies to choose from; "raw", "mean" or "cls". We advise to use "raw" strategy as this prooduces embeddings over the time frames, and is more robust to silent parts.
60
 
61
  Raw : Break audio clips into non-overlapping 2 second chunks, concatenating the features in time and finally taking a mean over the time axis to generate a fixed vector representation independent of the input audio duration
62
  Mean : Break audio clips into non-overlapping 2 second chunks, and taking a mean over all the patches to generate a fixed vector representation independent of the input audio duration
@@ -64,8 +62,8 @@ Cls : Break audio clips into non-overlapping 2 second chunks, and return the "[C
64
  ~~~python
65
  from transformers import AutoModel, AutoFeatureExtractor
66
 
67
- model = AutoModel.from_pretrained("labhamlet/gramt-ambisonics", trust_remote_code=True)
68
- extractor = AutoFeatureExtractor.from_pretrained("labhamlet/gramt-ambisonics", trust_remote_code=True)
69
 
70
  audio = torch.zeros([1,4,320000])
71
  extracted = extractor(audio, return_tensors="pt")
@@ -73,9 +71,6 @@ log_mel = extracted['input_values']
73
  print(model(log_mel, strategy = "raw").shape)
74
  ~~~
75
 
76
- ## Training Details
77
-
78
-
79
  ### Training Data
80
 
81
  The 85,000 naturalistic scenes were split into a train set of 70,000 scenes (corresponding to 70 Matterport3D houses), and a test set of 15,000 scenes (15
@@ -86,70 +81,21 @@ Specifically, during training we randomly paired an AudioSet clip with a noise s
86
  WHAMR! background noise database (Maciejewski et al., 2020). WHAMR! noise clips longer than
87
  10 s were trimmed to 10 s duration and a linear fade-in/fade-out of 200 ms was applied to every noise
88
  clip prior to mixing of the sound scene.
89
- To create a naturalistic sound scene, we then convolved the AudioSet clip either with BRIR(s, r, θ)
90
- for GRAM-Binaural, or with a ARIR(s, r, θ) for GRAM-Ambisonics, to obtain T. Similarly, we
91
- convolved the WHAMR! noise clip with the to obtain naturalistic scenes.
92
-
93
-
94
- ### Training Procedure
95
-
96
- We transformed the channels of each sound scene (i.e., the waveforms) into logscale mel spectrograms using 128 mel filters in the frequency range of 50-16000 Hz with a 25 ms
97
- Hanning window and 10 ms hop length, resulting in spectrograms of dimension 1024 × 128. For
98
- GRAM-Ambisonic, we extracted normalized active Intensity Vectors (IVs) from the spectrograms
99
- as additional input features encoding spatial information. We concatenated mel
100
- spectrograms and intensity vectors, resulting in input x = [xmel, IV s] for each naturalistic scene
101
- generated from an AudioSet clip. In-batch sampling: As the online mixing of naturalistic acoustic scenes is computationally expensive
102
- due to multiple long convolutions, we used a random in-batch sampling procedure to increase the
103
- effective batch size in a computationally efficient manner. We randomly sampled 16 partially
104
- overlapping segments of 2 seconds to create 16 samples of dimension 200 × 128. This increases the
105
- original batch size of 96 to an effective batch size of 1536.
106
-
107
- For pre-training, we divided the binaural spectrogram into 2×8×16,ambisonics spectrograms into 7×8×16 patches. We used an adapted version
108
- of the mask-based framework of MW-MAE (Yadav et al., 2024), randomly selecting a subset of
109
- n patches M1, . . . , Mn for i = 1, . . . , n for masking (masking ratio = 0.8) and replacing their
110
- embedding with a learnable mask token. Finally, we added fixed sinusoidal positional embeddings to
111
- all embedded patches.
112
-
113
-
114
- We trained all GRAMs for 500 K steps on an H100 92 GB GPU machine
115
- with 16 CPU cores. We used the AdamW optimizer (Loshchilov & Hutter, 2017) with weight decay
116
- rate of 0.01, gradient clipping, and a cosine learning rate scheduler with 10 K steps warm-up. The
117
- initial learning rate was set to 0.0002, and decayed to 0. We optimize the mean squared error (MSE)
118
- loss function between the predicted masked patches and their corresponding input spectrogram
119
- patches.
120
 
121
  #### Preprocessing
122
 
123
  Firstly, RMS Normalization was applied to audio clips to get all of them in the same loudness levels. Later, instance normalization was applied to the convolved scenes
124
 
125
 
126
- #### Training Hyperparameters
127
-
128
- - **Training regime:**: GRAMs were trained with mixed precision, torch.compile and flash attention.
129
-
130
  ## Evaluation
131
 
132
- We evaluate GRAM and other state-of-the-art models on the HEAR benchmark
133
  task suite, which presents a wide range of tasks to evaluate the downstream performance of audio
134
- representation models (Turian et al., 2022). We additionally evaluated performance on simulated real-worldsound scenes using Nat-HEAR.
135
- ### Testing Data, Factors & Metrics
136
 
137
  #### Testing Data
138
 
139
- **HEAR**: The aim of the HEAR benchmark is to develop a general-purpose audio representation that provides a strong basis for learning in a wide variety of tasks and scenarios.
140
- HEAR evaluates audio representations using a benchmark suite across a variety of domains, including speech, environmental sound, and music.
141
- HEAR was launched as a NeurIPS 2021 shared challenge. It still remains an open question whether one single general-purpose audio representation can perform as holistically as the human ear.
142
-
143
- **NatHEAR**: Orovides a naturalistic version of all selected datasets in the HEAR benchmark suite in
144
- two audio formats: a two-channel, binaural format and a four-channel, first-order Ambisonics
145
- format. Weincluded sound localization tasks for two different domains which we generated using
146
- HEAR benchmark datasets: A speech localization task based on SC-5, and an environmental sound
147
- localization task based on ESC-50. The localization tasks are modeled as a multi-output regression
148
- task in which model outputs represent the estimated 3D Cartesian coordinates [x, y, z] on the unit
149
- sphere (Adavanne et al., 2018). Finally, to assess the transferability of GRAM to real-world sound
150
- scenes, we evaluate also on the sound event detection and localization tasks in TUT Sound Events
151
- 2018 REAL (Adavanne et al., 2019)
152
-
153
 
154
  ### Results
155
 
@@ -165,18 +111,8 @@ scenes, we evaluate also on the sound event detection and localization tasks in
165
  | BEATs | – | 54.1 | 77.8 ± 1.2 | 85.8 ± 2.9 | 66.9 ± 2.5 | 39.7 ± 4.3 | 86.9 | 68.6 | 94.1 ± 3.5 | 95.5 ± 0.4 | 96.6 ± 0.5 | 61.4 |
166
  | MW-MAE | 94.2 | 51.8 | 80.3 ± 1.9 | 82.2 ± 3.2 | 74.4 ± 1.5 | 45.5 ± 1.7 | 91.6 | 69.4 | 95.8 ± 4.3 | 97.5 ± 0.4 | 97.6 ± 0.6 | 71.0 |
167
  | SSAM | 87.3 | 53.5 | 75.5 ± 1.4 | 82.9 ± 3.6 | 70.2 ± 0.4 | 56.4 ± 5.2 | 89.3 | 72.6 | 93.2 ± 3.5 | 97.8 ± 0.5 | 96.9 ± 0.5 | 71.2 |
168
- | **GRAM-Binaural** | 95.6 | 56.1 | 81.0 ± 1.1 | 86.7 ± 2.4 | 75.0 ± 1.4 | 53.2 ± 3.0 | 92.5 | 77.0 | 94.9 ± 3.2 | 97.3 ± 0.3 | 98.1 ± 0.2 | 74.6 |
169
- | **GRAM-Ambisonics** | 94.3 | 53.0 | 79.4 ± 1.5 | 85.9 ± 1.5 | 71.9 ± 1.9 | 53.7 ± 1.2 | 89.6 | 73.8 | 94.9 ± 4.9 | 97.6 ± 0.5 | 98.5 ± 0.4 | 73.4 |
170
- | **GRAM-Mono** | 95.3 | 56.8 | 81.3 ± 1.8 | 87.5 ± 2.3 | 75.1 ± 0.6 | 57.3 ± 3.4 | 93.5 | 75.8 | 95.8 ± 3.7 | 97.4 ± 0.3 | 98.0 ± 0.2 | 76.1 |
171
-
172
- #### Summary
173
-
174
- We present a General-purpose, Real-world Audio representation Model (GRAM), which learns spatial
175
- audio representations using a multi-channel masked auto-encoder approach. GRAM demonstrates
176
- remarkable performance in naturalistic sound scenes as well as clean sound scenes, surpassing all
177
- state-of-the-art self-supervised spectrogram-based audio foundation models while requiring only a
178
- fraction of the training data. Moreover, GRAM is the first audio foundation model that is available
179
- in both a two-channel, binaural format and a four-channel, first-order ambisonics format
180
 
181
  ## Model Card Contact
182
 
 
14
 
15
  # Model Card for Model ID
16
 
17
+ AudioSphere is trained on AudioSet with joint spatial-acoustic reconstruction loss.
18
+ AudioSphere supports ambisonics localization tasks unlike other models in the literature. Therefore, this model can be used for understanding spatial scenes as well as classifying mono sounds.
 
19
 
20
 
21
  ## Model Details
22
 
23
+ AudioSphere earns spatial audio representation by reconstructing multi-channel masked spectrogram
24
  patches. First, a patch extractor consisting of a single convolutional layer with 2D convolutional
25
  filters divides each multi-channel spectrogram into n non-overlapping patches. Nonmasked patch embeddings are input to the encoder, for which we selected the 12-layer ViT-Base
26
  (ViT-B) Transformer (Dosovitskiy et al., 2021) similar to Huang et al. (2022); Yadav et al. (2024).
27
  The encoder outputs patch representations that can be further used for fine-tuning.
28
+
29
  ### Model Description
30
 
31
+ AudioSphere is a self-supervised, multi-channel masked auto-encoder model that efficiently learns acoustic-spatial representations
32
+ from simulated real-world sound scenes. To train AudioSphere, we developed a custom pipeline which
33
  makes use of the Soundspace 2.0 platform (Chen et al., 2022a) to simulate high-quality real-world
34
  sound scenes from AudioSet (Gemmeke et al., 2017), and of WHAMR! (Maciejewski et al., 2020)
35
+ for adding background noise.
 
 
36
 
37
 
38
  - **Developed by:** Goksenin Yuksel, goksenin.yuksel@ru.nl
39
  - **Model type:** Transformers, Audio Foundation Models
40
+ - **Language(s) (NLP):** AudioSphere supports all languages, but mainly English.
41
  - **License:** MIT
42
 
43
  ### Model Sources
44
 
45
+ - **Repository:** https://github.com/labhamlet/AudioSphere
46
  - **Paper:** https://arxiv.org/abs/2506.00934
47
 
48
  ## Uses
49
 
50
+ AudioSphere can be used as a powerful feature extractor for downstream tasks such as environmental sound classification, speech recognition, speaker counting, sound localization.
51
  Later, training a linear head on top of these extracted features would yield a fine-tuned audio scene analysis model.
52
 
53
 
54
  ## How to Get Started with the Model
55
 
56
 
57
+ AudioSphere have three strategies to choose from; "raw", "mean" or "cls". We advise to use "raw" strategy as this prooduces embeddings over the time frames, and is more robust to silent parts.
58
 
59
  Raw : Break audio clips into non-overlapping 2 second chunks, concatenating the features in time and finally taking a mean over the time axis to generate a fixed vector representation independent of the input audio duration
60
  Mean : Break audio clips into non-overlapping 2 second chunks, and taking a mean over all the patches to generate a fixed vector representation independent of the input audio duration
 
62
  ~~~python
63
  from transformers import AutoModel, AutoFeatureExtractor
64
 
65
+ model = AutoModel.from_pretrained("labhamlet/AudioSphere", trust_remote_code=True)
66
+ extractor = AutoFeatureExtractor.from_pretrained("labhamlet/AudioSphere", trust_remote_code=True)
67
 
68
  audio = torch.zeros([1,4,320000])
69
  extracted = extractor(audio, return_tensors="pt")
 
71
  print(model(log_mel, strategy = "raw").shape)
72
  ~~~
73
 
 
 
 
74
  ### Training Data
75
 
76
  The 85,000 naturalistic scenes were split into a train set of 70,000 scenes (corresponding to 70 Matterport3D houses), and a test set of 15,000 scenes (15
 
81
  WHAMR! background noise database (Maciejewski et al., 2020). WHAMR! noise clips longer than
82
  10 s were trimmed to 10 s duration and a linear fade-in/fade-out of 200 ms was applied to every noise
83
  clip prior to mixing of the sound scene.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  #### Preprocessing
86
 
87
  Firstly, RMS Normalization was applied to audio clips to get all of them in the same loudness levels. Later, instance normalization was applied to the convolved scenes
88
 
89
 
 
 
 
 
90
  ## Evaluation
91
 
92
+ We evaluate AudioSphere and other state-of-the-art models on the HEAR benchmark
93
  task suite, which presents a wide range of tasks to evaluate the downstream performance of audio
94
+ representation models (Turian et al., 2022). We additionally evaluated performance on real-worldsound scenes using the newly released RealSELD benchmark.
 
95
 
96
  #### Testing Data
97
 
98
+ **HEAR**: The HEAR benchmark aims to develop a general-purpose audio representation that provides a strong basis for learning in a wide variety of tasks and scenarios.
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  ### Results
101
 
 
111
  | BEATs | – | 54.1 | 77.8 ± 1.2 | 85.8 ± 2.9 | 66.9 ± 2.5 | 39.7 ± 4.3 | 86.9 | 68.6 | 94.1 ± 3.5 | 95.5 ± 0.4 | 96.6 ± 0.5 | 61.4 |
112
  | MW-MAE | 94.2 | 51.8 | 80.3 ± 1.9 | 82.2 ± 3.2 | 74.4 ± 1.5 | 45.5 ± 1.7 | 91.6 | 69.4 | 95.8 ± 4.3 | 97.5 ± 0.4 | 97.6 ± 0.6 | 71.0 |
113
  | SSAM | 87.3 | 53.5 | 75.5 ± 1.4 | 82.9 ± 3.6 | 70.2 ± 0.4 | 56.4 ± 5.2 | 89.3 | 72.6 | 93.2 ± 3.5 | 97.8 ± 0.5 | 96.9 ± 0.5 | 71.2 |
114
+ | **AudioSphere** | 94.3 | 53.0 | 79.4 ± 1.5 | 85.9 ± 1.5 | 71.9 ± 1.9 | 53.7 ± 1.2 | 89.6 | 73.8 | 94.9 ± 4.9 | 97.6 ± 0.5 | 98.5 ± 0.4 | 73.4 |
115
+
 
 
 
 
 
 
 
 
 
 
116
 
117
  ## Model Card Contact
118