saurabhati commited on
Commit
b0ec723
·
verified ·
1 Parent(s): 188c073

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -176
README.md CHANGED
@@ -1,199 +1,105 @@
1
  ---
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
 
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
 
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
  ## How to Get Started with the Model
 
 
 
 
71
 
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
- #### Speeds, Sizes, Times [optional]
 
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
 
100
 
101
- [More Information Needed]
 
 
 
102
 
103
- ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
 
115
- #### Factors
 
 
 
 
 
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
 
 
 
118
 
119
- [More Information Needed]
 
 
 
 
120
 
121
- #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
124
 
125
- [More Information Needed]
126
 
127
  ### Results
128
 
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
+ license: bsd-3-clause
3
+ pipeline_tag: audio-classification
4
  library_name: transformers
5
+ tags:
6
+ - PyTorch
7
+ - State-space
8
+ - Mamba
9
  ---
10
 
11
+ # DASS: Distilled Audio State-space Models
12
+ This version is distilled from SSLAM (88M), DASS small (30M) mAP: 50.1 and DASS medium (49M) mAP: 50.2.
13
 
14
+ It is introduced in the paper [DASS: Distilled Audio State Space Models Are Stronger and More Duration-Scalable Learners](https://arxiv.org/pdf/2407.04082) and
15
+ first released in [this repository](https://github.com/Saurabhbhati/DASS).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  ## How to Get Started with the Model
19
+ ```python
20
+ import torch
21
+ import librosa
22
+ from transformers import AutoConfig, AutoModelForAudioClassification, AutoFeatureExtractor
23
 
24
+ config = AutoConfig.from_pretrained('saurabhati/DASS_small_AudioSet_50.1',trust_remote_code=True)
25
+ audio_model = AutoModelForAudioClassification.from_pretrained('saurabhati/DASS_small_AudioSet_50.1',trust_remote_code=True)
26
+ feature_extractor = AutoFeatureExtractor.from_pretrained('saurabhati/DASS_small_AudioSet_50.1',trust_remote_code=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ waveform, sr = librosa.load("audio/eval/_/_/--4gqARaEJE_0.000.flac", sr=16000)
29
+ inputs = feature_extractor(waveform,sr, return_tensors='pt')
30
 
31
+ with torch.no_grad():
32
+ logits = torch.sigmoid(audio_model(**inputs).logits)
33
 
34
+ predicted_class_ids = torch.where(logits[0] > 0.5)[0]
35
+ predicted_label = [audio_model.config.id2label[i.item()] for i in predicted_class_ids]
36
+ predicted_label
37
+ ['Animal', 'Domestic animals, pets', 'Dog']
38
 
39
+ ```
40
 
41
+ ## Model Details
 
 
 
 
 
 
 
 
42
 
43
+ <!-- Provide a quick summary of what the model is/does. -->
44
+ DASS: Distilled Audio State-space Models is an audio classification model finetuned on AudioSet-2M.
45
+ DASS is the first state-space model that outperforms transformer-based audio classifiers such as AST (Audio Spectrogram Transformer), HTS-AT, and Audio-MAE.
46
+ DASS achieves state-of-the-art performance on the audio-classification
47
+ task on Audioset while significantly reducing the model size. For example, compared to AST which contains approximately 87M
48
+ parameters, DASS-small contains one-third, 30M, parameters and outperforms the AST model (AudioSet-2M map: 45.9 vs DASS small mAP: 47.2).
49
 
50
+ It is available in two sizes: DASS small (30M) mAP: 47.2 and DASS medium (49M) mAP: 47.6.
51
+ DASSv2 model is distilled from an ensemble of AST and
52
+ HTS-AT which sigificantly boosts the performance on Audio classification task.
53
+ New performance: DASS small (30M) mAP: 48.6 and DASS medium (49M) mAP: 48.9.
54
 
55
+ It is also significantly more duration robust (training on shorter audio and testing on long audio without fine-tuning on longer audio) than the AST model.
56
+ For example, for both AST and DASS models training on 10-second long audios, the performance of AST models drops to less than 5 mAP when
57
+ the input is 50 seconds, which is < 12% of the performance for 10-second input, while DASS’s performance is 45.5 mAP (96%) in the same setting.
58
+ On a single A6000 GPU, DASS can take up to 2.5-hours of audio input and still maintain 62% of its
59
+ performance compared to a 10-second input.
60
 
 
61
 
62
+ DASS model in based on the [VMamba: Visual State Space Model](https://arxiv.org/pdf/2401.10166) applied to audio.
63
+ It is trained with binary cross entropy loss w.r.t. ground truth labels and kl-divergence loss w.r.t teacher AST model.
64
 
 
65
 
66
  ### Results
67
 
68
+ Below are the results for DASS models finetuned and evaluated on AudioSet-2M.
69
+
70
+ | | Params | Pretrain | mAP |
71
+ |-------------------------------------------|:------:|:--------:|:----:|
72
+ | Transformer based models |
73
+ | [AST](https://arxiv.org/pdf/2104.01778) | 87M | IN SL | 45.9 |
74
+ | [HTS-AT](https://arxiv.org/pdf/2202.00874) | 31M | IN SL | 47.1 |
75
+ | [PaSST](https://arxiv.org/pdf/2110.05069) | | IN SL | 47.1 |
76
+ | [Audio-MAE](https://arxiv.org/pdf/2207.06405) | 86M | SSL | 47.3 |
77
+ | [BEATS_iter3](https://arxiv.org/pdf/2212.09058) | 90M | AS SSL | 48.6 |
78
+ | [EAT](https://arxiv.org/pdf/2401.03497v1) | 88M | AS SSL | 48.6 |
79
+ | [SSLAM](https://openreview.net/pdf?id=odU59TxdiB) | 88M | AS SSL | 50.2
80
+ | Concurrent SSM models | | | |
81
+ | [AuM](https://arxiv.org/pdf/2406.03344) | 26M | IN SL | 39.7 |
82
+ | [Audio Mamba](https://arxiv.org/pdf/2405.13636) | 40M | IN SL | 44.0 |
83
+ | DASS-Small | 30M | IN SL | 47.2 |
84
+ | DASS-Medium | 49M | IN SL | 47.6 |
85
+ | DASS-Small (teach: AST + HTS-AT) | 30M | IN SL | 48.6 |
86
+ | DASS-Medium (teach: AST + HTS-AT) | 49M | IN SL | 48.9 |
87
+ | DASS-Small (teach: SSLAM) | 30M | IN SL | 50.1 |
88
+ | DASS-Medium (teach: SSLAM) | 49M | IN SL | 50.2 |
89
+
90
+ ## Citation
91
+
92
+ ```bibtex
93
+ @article{bhati2024dass,
94
+ title={DASS: Distilled Audio State Space Models Are Stronger and More Duration-Scalable Learners},
95
+ author={Bhati, Saurabhchand and Gong, Yuan and Karlinsky, Leonid and Kuehne, Hilde and Feris, Rogerio and Glass, James},
96
+ journal={arXiv preprint arXiv:2407.04082},
97
+ year={2024}
98
+ }
99
+ ```
100
+
101
+ ## Acknowledgements
102
+
103
+ This project is based on AST([paper](https://arxiv.org/pdf/2104.01778), [code](https://github.com/YuanGongND/ast/tree/master)),
104
+ VMamba([paper](https://arxiv.org/pdf/2401.10166), [code](https://github.com/MzeroMiko/VMamba/tree/main)) thanks for their excellant works.
105
+ Please make sure to check them out.