earlab commited on
Commit
7d9ac58
Β·
verified Β·
1 Parent(s): ec63b01

init weights

Browse files
Files changed (3) hide show
  1. README.md +172 -1
  2. configs/ear_vae2.json +18 -0
  3. weights/ear_vae2.pt +3 -0
README.md CHANGED
@@ -1,3 +1,174 @@
 
 
 
 
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ξ΅ar-VAE2
2
+
3
+ [[Demo Page](https://eps-acoustic-revolution-lab.github.io/EAR_VAE2/)] - [[Paper (coming soon)](#)] - [[Models (coming soon)](#)]
4
+
5
  ---
6
+
7
+ <p align="center">
8
+ <img src="./assets/architecture.png" width="95%" alt="Ξ΅ar-VAE2 Architecture" />
9
+ </p>
10
+
11
+ ## Overview
12
+
13
+ A spectral-domain music autoencoder compressing **48 kHz stereo** audio into a **128-dimensional** continuous latent sequence at **25 Hz** β€” a **1920Γ— temporal downsampling** β€” through two frequency-aware components: **Spec-SnakeBeta** (per-bin periodic activation with log-frequency initialization) and a **Duplex-Aware Refiner** (band-specific magnitude/phase correction motivated by psychoacoustic masking).
14
+
15
+ ## ✨ Highlights
16
+
17
+ - 🎡 **Complex spectral domain** β€” operates on STFT real/imag channels, not raw waveform
18
+ - 🧬 **Spec-SnakeBeta** β€” per-(channel, frequency-bin) periodic activation with log-frequency initialization; each bin learns its own oscillatory bias
19
+ - πŸŽ›οΈ **Duplex-Aware Refiner** β€” band-specific mag/phase correction following psychoacoustic dominance (phase-only < 1.5 kHz, joint mid-band, mag-only > 4 kHz)
20
+ - πŸ“Š **1920Γ— compression** β€” 48 kHz stereo β†’ 128-d Γ— 25 Hz continuous latent
21
+ - πŸ† **SOTA reconstruction** on Song Describer Dataset across spectral metrics
22
+
23
+ ## Main Results
24
+
25
+ Reconstruction quality on **Song Describer Dataset** (546 full tracks, 48 kHz stereo):
26
+
27
+ | System | SI-SDR ↑ | STFT Dist ↓ | Mel Dist ↓ | CCPC ↑ |
28
+ |--------|:---:|:---:|:---:|:---:|
29
+ | Ξ΅ar-VAE | 12.4 | 0.880 | 0.509 | 0.973 |
30
+ | SA-Open | 6.7 | 1.016 | 0.612 | 0.933 |
31
+ | Levo 2 | 8.1 | 0.971 | 0.599 | 0.947 |
32
+ | SAME-L | 12.5 | 0.986 | 0.539 | 0.970 |
33
+ | **Ξ΅ar-VAE2 (base)** | 10.9 | 0.916 | 0.572 | 0.966 |
34
+ | **Ξ΅ar-VAE2 (full)** | **11.3** | **0.870** | **0.461** | **0.973** |
35
+
36
+ > Ξ΅ar-VAE2 (full) achieves the best spectral fidelity (STFT Dist, Mel Dist) among all systems while matching the phase coherence (CCPC) of the larger Ξ΅ar-VAE baseline.
37
+
38
+ ## Spec-SnakeBeta
39
+
40
+ <p align="center">
41
+ <img src="./assets/spec_snakebeta.png" width="80%" alt="Spec-SnakeBeta activation visualization" />
42
+ </p>
43
+
44
+ *Per-(channel, frequency-bin) periodic activation with log-scale parameterization. Low-frequency bins stay near-identity; high-frequency bins become progressively oscillatory β€” providing a physically motivated inductive bias for spectral processing.*
45
+
46
+ ## Input Representation
47
+
48
+ <p align="center">
49
+ <img src="./assets/input_repr.png" width="95%" alt="Five-paradigm input representation comparison" />
50
+ </p>
51
+
52
+ *Complex STFT preserves organized high-frequency harmonic structure (panel A) where the same-backbone waveform-patch paradigm degrades (panel B). The spectral domain provides a physical frequency-axis inductive bias unavailable to waveform methods.*
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ # Clone the repository
58
+ git clone https://github.com/Eps-Acoustic-Revolution-Lab/EAR_VAE2.git
59
+ cd EAR_VAE2
60
+
61
+ # Install dependencies
62
+ pip install -r requirements.txt
63
+
64
+ # Download pretrained weights (coming soon)
65
+ # huggingface-cli download eps-acoustic-revolution-lab/ear-vae2-small --local-dir checkpoints/
66
+ ```
67
+
68
+ ## Usage
69
+
70
+ ### Python API
71
+
72
+ ```python
73
+ import torch
74
+ from ear_vae2 import EarVAE2
75
+
76
+ # Load model (full model, with refiner β€” see configs/ear_vae2.json)
77
+ config = {
78
+ "C0": 64, "D": 128, "use_vae": True,
79
+ "refiner": {"type": "banded", "dim": 256, "intermediate_dim": 1024,
80
+ "num_layers": 12, "layer_norm_eps": 1e-5},
81
+ }
82
+ model = EarVAE2(config)
83
+ ckpt = torch.load("ear_vae2.pt", map_location="cpu")
84
+ model.load_state_dict(ckpt["gen"] if "gen" in ckpt else ckpt)
85
+ model.eval().cuda()
86
+
87
+ # Encode & decode
88
+ audio = torch.randn(1, 2, 48000 * 10).cuda() # 10s stereo @ 48kHz
89
+ audio_padded, orig_len = model.preprocess_audio(audio)
90
+ latents = model.encode_audio(audio_padded, chunked=True, chunk_size=512, overlap=16, deterministic=True)
91
+ reconstructed = model.decode_audio(latents, chunked=True, chunk_size=512, overlap=16)
92
+ reconstructed = reconstructed[:, :, :orig_len]
93
+ ```
94
+
95
+ ### Command Line
96
+
97
+ ```bash
98
+ python inference.py --checkpoint ear_vae2.pt --config configs/ear_vae2.json --input input.wav --output output.wav
99
+ ```
100
+
101
+ <details>
102
+ <summary><b>πŸ“ Project Structure</b></summary>
103
+
104
+ ```
105
+ EAR_VAE2/
106
+ β”œβ”€β”€ README.md
107
+ β”œβ”€β”€ LICENSE
108
+ β”œβ”€β”€ requirements.txt
109
+ β”œβ”€β”€ inference.py # CLI inference script
110
+ β”œβ”€β”€ configs/
111
+ β”‚ └── ear_vae2.json # Full model config (with refiner)
112
+ β”œβ”€β”€ ear_vae2/
113
+ β”‚ β”œβ”€β”€ __init__.py
114
+ β”‚ └── model.py # Self-contained EarVAE2 model
115
+ β”‚ # (encoder, decoder, Spec-SnakeBeta,
116
+ β”‚ # refiner, STFT helpers)
117
+ β”œβ”€β”€ assets/
118
+ β”‚ β”œβ”€β”€ architecture.png
119
+ β”‚ β”œβ”€β”€ spec_snakebeta.png
120
+ β”‚ └── input_repr.png
121
+ └── docs/ # Demo page (GitHub Pages, served from /docs)
122
+ β”œβ”€β”€ index.html
123
+ β”œβ”€β”€ config.js
124
+ β”œβ”€β”€ css/
125
+ β”œβ”€β”€ js/
126
+ β”œβ”€β”€ assets/
127
+ └── cases/
128
+ ```
129
+
130
+ </details>
131
+
132
+ ## Model Details
133
+
134
+ | Config | Params (M) | Latent dim | Rate (Hz) | Compression |
135
+ |--------|:---:|:---:|:---:|:---:|
136
+ | Small (C0=64) | ~42.6 | 128 | 25 | 1920Γ— |
137
+
138
+ - **Sample rate**: 48 kHz stereo
139
+ - **STFT**: 3840-point FFT, 1920-sample hop β†’ 25 Hz frame rate
140
+ - **Latent**: 128-d continuous (VAE with KL regularization)
141
+ - **Refiner**: 12-layer banded Transformer (256-d, 1024 intermediate)
142
+
143
+ > **⚠️ Note on open-source weights:** Due to data licensing constraints, the open-source model weights are **retrained on publicly available datasets** (not the full internal training corpus). Performance may differ from the numbers reported in the paper, which were obtained with the full-scale proprietary training data.
144
+
145
  ---
146
+
147
+ ## Citation
148
+
149
+ ```bibtex
150
+ @inproceedings{earvae2,
151
+ title = {Frequency-Aware Spectral Autoencoding for High-Fidelity Music Reconstruction},
152
+ author = {Anonymous},
153
+ booktitle = {International Conference on Learning Representations (ICLR)},
154
+ year = {2026}
155
+ }
156
+ ```
157
+
158
+ ---
159
+
160
+ ## Acknowledgements
161
+
162
+ We gratefully acknowledge the following projects that inspired components of Ξ΅ar-VAE2:
163
+
164
+ - [**BigVGAN**](https://github.com/NVIDIA/BigVGAN) β€” SnakeBeta periodic activation design
165
+ - [**Vocos**](https://github.com/gemelo-ai/vocos) β€” ConvNeXt block architecture for spectral modeling
166
+ - [**Stable Audio Tools**](https://github.com/Stability-AI/stable-audio-tools) β€” Training infrastructure and audio pipeline patterns
167
+
168
+ ---
169
+
170
+ ## License
171
+
172
+ This project is licensed under the [Apache License 2.0](LICENSE).
173
+
174
+ Copyright 2026 Epsilon Acoustic Revolution Lab.
configs/ear_vae2.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": {
3
+ "gen": {
4
+ "config": {
5
+ "C0": 64,
6
+ "D": 128,
7
+ "use_vae": true,
8
+ "refiner": {
9
+ "type": "banded",
10
+ "dim": 256,
11
+ "intermediate_dim": 1024,
12
+ "num_layers": 12,
13
+ "layer_norm_eps": 1e-5
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
weights/ear_vae2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c87215f857c909156c11159ff8e3aa05a15522d6963a4d9eceb7493aa8c14840
3
+ size 713542691