01Five seconds are easy. A whole track is not.
Most style-transfer demos ask you to judge five seconds. This project asked whether a system could rewrite a full track into another genre and keep the song recognisable. Before any model was trained, six pass marks were written into the proposal, dated 10 February 2026. They did not move when the results arrived.
Four stages: split the audio into content and style, build a target space you can aim at, synthesise the target, then make it survive a whole track. Each stage removed one ambiguity before the next one was judged.
02The problem is not style. It is the dataset.
Genre and recording source are the same variable in the data. XTC hip-hop, FMA lo-fi and symbolic baroque arrive from different collections. A model can appear to transfer style while learning one collection's recording chain instead. This project treats that as the central threat, not as a footnote.
The design follows from it. Splits group by track, so the same song cannot sit on both sides. Genre buckets draw from more than one source. A leakage audit re-derives labels from the audio instead of trusting the corpus. A style judge built on MERT embeddings scores the output. The audits still disagree with each other, and the results page records the disagreement instead of smoothing it.
03Stage 1: pull the song apart
An encoder maps audio into a 128-D content vector and a 128-D style vector. A gradient-reversal branch pushes style out of the content vector. A style probe asks whether the style vector still carries genre; a content probe asks whether genre leaks back in. A music gate separates music from non-music.
Leakage is the number that matters. A content probe at 0.85 might be reading style rather than content. Leakage is its accuracy above the 0.500 chance baseline, measured on 600 embeddings balanced 300/300. At 0.1083, the content branch is mostly not a relabelled style branch. Style-probe accuracy reached 0.9417 and the gate ROC-AUC 0.9299.
The gate ranks well but is not calibrated at its operating point. At a 0.5 threshold the false-positive rate is 0.136. Reaching the 2% target needs 0.890, which drops music recall to 0.558. The ranking is useful; the threshold is an open trade.
04Stage 2: turn style into a destination
A vector is only a control signal if you can aim at it. The project concatenates the 128-D style vector with 32 hand-built descriptors into a 160-D target vector, then estimates a centroid per genre. On 4,011 embeddings across four genres, the cosine silhouette was 0.4939, linear-probe accuracy 0.8554, nearest-centroid accuracy 0.8514.
That is separability, not proof of musical meaning. The centroids exist to give the next stage a stable destination and to make the geometry auditable. Lab 2's job was to make the control signal operational, and it did.
05Stage 3: two ways to synthesise
Two branches, built to compare realism against control.
The codec branch translates frozen EnCodec latents to waveform, with FiLM conditioning injecting the target style into intermediate layers. It produced the strongest short-form result: melodic preservation 0.9565, target-style confidence 0.8940, style accuracy 0.9492.
The diffusion branch generates log-mel spectrograms with v-prediction, DDIM sampling and classifier-free guidance, then vocodes with BigVGAN. It is the more flexible branch and the more fragile one. Its best validation loss came at epoch 18 (0.0386). The checkpoint kept is epoch 6 (0.0442), because lower loss did not sound better.
06Stage 4: make it last
Local quality does not survive a full song. Long-form remastering generates overlapping chunks, forward-diffuses the source to an anchor point, and pulls each chunk toward the target style. At every DDIM step, the overlap prefix is overwritten with a noise-matched version of the previous chunk's tail. Periodic re-anchoring, mel smoothing and source blending hold the drift down.
On a 160-second run the boundary statistics were clean: 64 chunks, mean mel MSE 0.0018347, mean discontinuity 2.87 dB. The residue past roughly 160 seconds is warble and static, not seams. That is a different failure from the one the boundary metric measures, and the page says so.
07Results against thresholds fixed in advance
| Stage | Metric | Target | Achieved |
|---|---|---|---|
| Deconstruction | style-probe accuracy | ≥ 0.85 | 0.9417 |
| Deconstruction | content leakage above chance | ≤ 0.15 | 0.1083 |
| Deconstruction | music-gate ROC-AUC | ≥ 0.90 | 0.9299 |
| Target space | silhouette (cosine) | ≥ 0.45 | 0.4939 |
| Synthesis (codec) | melodic preservation | ≥ 0.90 | 0.9565 |
| Synthesis (codec) | target-style confidence | ≥ 0.85 | 0.8940 |
Six automatic targets cleared. The seventh stage, the perceptual one, never ran.
08The part that did not run
The proposal's Lab 5 was a blind A/B listening test plus Fréchet Audio Distance. It was designed and never executed. Every quality claim on this page therefore rests on a trained classifier and spectral diagnostics, not on listeners.
Two artifacts also disagree with the numbers printed beside them. The selected deconstruction audit reports leakage 0.1083 in its confidence block and 0.2125 in its preflight, which fails its own gate. The best codec run writes the script's 0.4 style threshold where the design target is 0.85. Both achieved values clear the design targets, so no claim depends on either file. They are published anyway, each with the path that produced it.
- Leakage, one run, two blocks0.1083 confidence · 0.2125 preflightdocs/explanation/results.md → Provenance
- Style gate written below design0.40 script default · 0.85 design targetlab 3/run_lab3_codec.py
- Music gate at its operating pointFPR 0.136 at 0.5 · 0.890 for 2% · recall 0.558gate_summary.json
- Perceptual metricLab 5 designed, not runREADME.md → Limitations
09What this shows
The model is not the contribution. The order is. Fix the thresholds before training, remove one ambiguity per stage, treat the dataset as the threat rather than the model, and publish the leg that did not run. When diffusion loss kept falling while the audio stopped improving, the pipeline already had the vocabulary to say why: the measurement had failed, not the model.
Six targets met, one perceptual test not run, every disagreement left in the repository. That is the result I would defend in an interview.
↳Reproduce
No checkpoints and no corpora ship with the repository. It is the code, the report and the sample clips. Inference needs a compatible checkpoint; retraining needs the datasets and their manifest CSVs.
python -m pip install -r requirements.txt
cp .env.example .env # set DGGR_DATA_ROOT and DGGR_MANIFESTS_ROOT
- Deconstruction encoder
- notebooks/01_lab1_deconstruction_encoder.ipynb
- Target-vector space
- dggr/lab2_pipeline.py
- Codec-latent transfer
- dggr/lab3_codec_train.py
- Diffusion branch
- dggr/lab3_diffusion_train.py
- Style judge and metrics
- dggr/lab3_codec_judge.py
- Long-form coherence
- lab 3/run_lab4_longform_coherence.py
- Source-leakage audit
- lab 3/run_lab3_quality_audit.py
Built for CMPUT 414 at the University of Alberta, Winter 2026, in a group of three. The code, the repository and the audits are mine; the report and the proposal are co-authored with Sahara Kaul and Kelsey Pattison. MIT covers the code and documentation; the two co-authored PDFs are carved out in NOTICE.