File size: 1,891 Bytes
93a92d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
license: mit
tags:
- audio
- speech
- caarma
- speaker augmentation
- distance-estimation
- self-supervised
- speaker-analysis
language:
- en
---

# HowFar-Caarma

HuBERT-based model for **distance estimation from speech** — predicting the
physical distance between a speaker and a microphone from the audio signal.

Backbone: `facebook/hubert-large-ls960-ft` with a classification head trained
on GAN-augmented data using the CAARMA framework.

## Files

- `epoch18_val_acc7997.ckpt` — PyTorch Lightning checkpoint (epoch 18, val acc 79.97%)
- `inference.py` — minimal loader + embedding extraction script

## Usage

```bash
pip install torch torchaudio transformers pytorch-lightning huggingface_hub

# Download the checkpoint
huggingface-cli download MassaBaali/HowFar-Caarma epoch18_val_acc7997.ckpt --local-dir .

# Run inference
python inference.py --ckpt epoch18_val_acc7997.ckpt --audio sample.wav
```

Or load it directly in Python:

```python
from inference import load_model, extract_embedding

model = load_model("epoch18_val_acc7997.ckpt", device="cuda")
embedding = extract_embedding(model, "sample.wav", device="cuda")
print(embedding.shape)
```

## Notes

- Expects 16 kHz mono audio.
- The checkpoint was trained with PyTorch Lightning; `strict=False` is used on
  load to tolerate minor state-dict key differences.
- This is the raw Lightning checkpoint rather than a `transformers`-native
  format, so standard `AutoModel.from_pretrained` will not work.

## Citation

If you use this model, please cite:

```bibtex
@article{baali2025caarma,
  title={CAARMA: Class augmentation with adversarial mixup regularization},
  author={Baali, Massa and Li, Xiang and Chen, Hao and Hannan, Syed Abdul and Singh, Rita and Raj, Bhiksha},
  journal={Findings of the Association for Computational Linguistics: EMNLP},
  volume={2025},
  pages={9732--9742},
  year={2025}
}
```