Andy004 commited on
Commit
b1e0d0f
·
verified ·
1 Parent(s): 31b30be

add README.md

Browse files
Files changed (1) hide show
  1. README.md +51 -78
README.md CHANGED
@@ -12,88 +12,60 @@ language:
12
  - en
13
  ---
14
 
15
- # JEPA-Q2D2: A Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure
16
-
17
- A **1.6 kbps neural speech codec** that pairs a JEPA (Joint-Embedding Predictive
18
- Architecture) encoder with **Q2D2**, a geometry-aware 2-D rhombic-lattice
19
- quantizer, and a HiFi-GAN decoder. Trained **without adversarial losses on the
20
- codec objective** (a frozen WavLM perceptual loss is used during decoder
21
- training).
22
-
23
- This repository accompanies the APSIPA ASC 2026 paper *"JEPA-Q2D2: A
24
- Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure."*
25
- Code: https://github.com/anant-004/jepa-q2d2
26
-
27
- ## Models
28
-
29
- | Subfolder | Operating point | Quantizer | Bitrate | Reported quality |
30
- |---|---|---|---|---|
31
- | [`jepa-q2d2-cd64-12.5hz`](./jepa-q2d2-cd64-12.5hz) | 12.5 Hz, code-dim 64 (**main model**) | Q2D2 | 1.6 kbps (100 tok/s) | PESQ **2.53**, ESTOI **0.80** |
32
- | [`jepa-q2d2-sigreg-cd32-25hz`](./jepa-q2d2-sigreg-cd32-25hz) | 25 Hz, code-dim 32, SIGReg co-design | Q2D2 | 1.6 kbps (100 tok/s) | ESTOI **0.79** |
33
- | [`teacher-cd128-fsq-12.5hz`](./teacher-cd128-fsq-12.5hz) | 12.5 Hz, code-dim 128 (**teacher**) | FSQ | ~2.85 kbps (237.5 tok/s) | PESQ ~**2.91** |
34
-
35
- All metrics are on the paper's fixed 50-utterance LibriLight protocol. ESTOI is
36
- **extended** STOI (systematically lower than vanilla STOI; comparable only
37
- within this paper's identical pipeline).
38
-
39
- ### Main codec (cd64, 12.5 Hz)
40
- The headline reconstruction system. At 1.6 kbps it exceeds EnCodec at a
41
- comparable operating point (+0.91 PESQ, +0.15 ESTOI vs EnCodec-1.5 kbps) and
42
- beats Mimi on PESQ (+0.25) while trailing it on ESTOI. Under a matched internal
43
- ablation, Q2D2 improves over finite scalar quantization (FSQ) by **+0.37 PESQ**
44
- at the same bitrate.
45
-
46
- ### SIGReg co-design model (cd32, 25 Hz)
47
- Demonstrates the paper's central finding: at the aggressive 25 Hz / 32-dim
48
- operating point the codec **collapses** (ESTOI -0.004) unless the encoder's
49
- latent distribution is Gaussianized with **SIGReg** (lambda = 0.05), which
50
- restores normal training (ESTOI 0.79). Two checkpoints are identical except for
51
- this term.
52
-
53
- ### Teacher codec (cd128, FSQ, 12.5 Hz)
54
- The original higher-rate codec (code dim 128, FSQ quantizer, 237.5 tok/s,
55
- ≈2.85 kbps, PESQ ~2.91). Architecturally distinct from the Q2D2 models — it uses
56
- finite scalar quantization rather than the Q2D2 lattice. Released because it
57
- serves as the **distillation teacher** for the 1.6 kbps cd64 student and is a
58
- useful higher-quality reference point.
59
-
60
- ## Each model folder contains
61
- - `pytorch_model.pt` — inference checkpoint (`ckpt["state_dict"]` = full
62
- encoder + Q2D2 quantizer + HiFi-GAN decoder; optimizer / discriminator state
63
- stripped).
64
- - `model.safetensors` — the same weights in safetensors format.
65
- - `config.json` — strides, code dim, frame rate, bitrate, sample rate (24 kHz),
66
- training step, and the checkpoint's eval metric.
67
-
68
- ## Usage
69
 
70
  ```python
71
- import torch
72
- # model definition lives in the companion repo:
73
- # git clone https://github.com/anant-004/jepa-q2d2
74
- from koe.fast.benchmark_codecs import build_v2_model # see repo for exact entry point
75
-
76
- ckpt = torch.load("jepa-q2d2-cd64-12.5hz/pytorch_model.pt",
77
- map_location="cpu", weights_only=False)
78
- model = build_v2_model(ckpt["config"])
79
- model.load_state_dict(ckpt["state_dict"], strict=False)
80
- model.eval()
81
-
82
- # wav: (1, T) mono @ 24 kHz
83
- tokens = model.encode(wav) # discrete Q2D2 tokens
84
- recon = model.decode(tokens) # reconstructed 24 kHz waveform
85
  ```
86
 
87
- See the GitHub repo for runnable encode/decode scripts and the evaluation
88
- harness.
 
89
 
90
- ## Training data
91
- LibriLight (English read speech), 24 kHz. The codec is an English-trained
92
- reconstruction system; the cross-lingual structure reported in the paper is an
93
- **emergent** property of the JEPA encoder features, evaluated zero-shot on
94
- FLEURS.
95
 
96
- ## Citation
97
  ```bibtex
98
  @inproceedings{shukla2026jepaq2d2,
99
  title = {JEPA-Q2D2: A Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure},
@@ -103,5 +75,6 @@ FLEURS.
103
  }
104
  ```
105
 
106
- ## License
107
- CC-BY-4.0. Weights are released for research use.
 
 
12
  - en
13
  ---
14
 
15
+ # jepa-q2d2
16
+
17
+ a 1.6 kbps neural speech codec. a jepa (joint-embedding predictive architecture) encoder feeds q2d2, a geometry-aware 2d rhombic-lattice quantizer, and a hifi-gan decoder. the codec objective is trained without any adversarial loss (a frozen wavlm perceptual loss is used while training the decoder).
18
+
19
+ - code: https://github.com/anant-004/jepa-q2d2
20
+ - paper: apsipa asc 2026
21
+
22
+ ## models
23
+
24
+ each folder has `pytorch_model.pt`, `model.safetensors`, and `config.json`.
25
+
26
+ | folder | operating point | quantizer | bitrate | quality |
27
+ |--------|-----------------|-----------|---------|---------|
28
+ | `jepa-q2d2-cd64-12.5hz` | 12.5 hz, code dim 64 (main) | q2d2 | 1.6 kbps (100 tok/s) | pesq 2.53, estoi 0.80 |
29
+ | `jepa-q2d2-sigreg-cd32-25hz` | 25 hz, code dim 32, sigreg | q2d2 | 1.6 kbps (100 tok/s) | estoi 0.79 |
30
+ | `teacher-cd128-fsq-12.5hz` | 12.5 hz, code dim 128 | fsq | ~2.85 kbps (237.5 tok/s) | pesq ~2.91 |
31
+
32
+ quality is on a fixed 50-utterance librilight set. estoi is extended stoi, comparable only within this paper's pipeline. the main cd64 model is ahead of encodec at a comparable rate and ahead of mimi on pesq. the sigreg model is the co-design point: at the aggressive 25 hz / cd32 setting the codec collapses unless the encoder distribution is gaussianized with sigreg. the teacher is the higher-rate fsq codec used to distill the cd64 student.
33
+
34
+ ## emergent properties
35
+
36
+ the codec is trained on english read speech only and never sees language or emotion labels. the encoder features still pick up structure it was not supervised on.
37
+
38
+ cross-lingual: a 5-nn probe on frozen pre-quantization features separates 6 fleurs languages at 0.85 (chance 0.167), ahead of mimi 0.63, encodec 0.61, dac 0.45, and close to multilingual ssl models. cluster nmi against language is higher too (0.26 vs encodec 0.10, dac 0.07). the utterance-disjoint number is the same (0.85).
39
+
40
+ ![cross-lingual separability](assets/crosslingual_summary.png)
41
+
42
+ style and emotion: utterance embeddings separate by speaking style on a hindi 5-class set (angry, excited, neutral, sad, whisper). whisper splits off cleanly and the rest form distinct regions for the jepa encoders, while encodec and dac mix them.
43
+
44
+ ![emotion separation](assets/emotion_tsne.png)
45
+
46
+ ## usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  ```python
49
+ import torch, soundfile as sf
50
+ from koe.fast.hf_codec import load_codec_from_hf # from the github repo
51
+
52
+ model, info = load_codec_from_hf("main", device="cpu") # downloads weights from here
53
+ print(info)
54
+
55
+ wav, sr = sf.read("in.wav") # mono, resampled to 24 khz internally
56
+ x = torch.from_numpy(wav).float().view(1, 1, -1)
57
+ z_q = model.encode(x)[0] # discrete q2d2 tokens
58
+ recon = model.decode(z_q) # 24 khz waveform
 
 
 
 
59
  ```
60
 
61
+ model code lives in the github repo. the released checkpoints already include the fine-tuned encoder, so inference needs only these files plus the repo code.
62
+
63
+ ## training data
64
 
65
+ librilight, english read speech, 24 khz. the cross-lingual structure above is evaluated zero-shot on fleurs.
66
+
67
+ ## citation
 
 
68
 
 
69
  ```bibtex
70
  @inproceedings{shukla2026jepaq2d2,
71
  title = {JEPA-Q2D2: A Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure},
 
75
  }
76
  ```
77
 
78
+ ## license
79
+
80
+ cc-by-4.0, released for research use.