Downloads · 30 days
7
20% of all-time downloads
Yaromanol/dubclean-voice
dubclean-voice is a audio-to-audio model from Yaromanol. Use it for the audio-to-audio task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as agpl-3.0.
Reference-conditioned removal of the original-language speech from a dubbed soundtrack.
Downloads · 30 days
7
20% of all-time downloads
All-time downloads
35
Public
Repo size
62.5 MB
Likes
0
Public
Click a slice to open those files.
.pt62.5 MB · 100%
From the Hugging Face model README
Reference-conditioned removal of the original-language speech from a dubbed soundtrack.
Russian voice-over releases usually keep the English dialogue audible under the translation. DubClean Voice takes the speech of the dubbed track together with the speech of the original track — the reference — and returns the translation with the matched foreign speech removed.
The model is the speech-cleaning stage of DubClean, a local Windows service for rebuilding a dubbed soundtrack. It is published on its own so that the checkpoint can be inspected, reused and evaluated independently of that application.
| Task | reference-conditioned speech removal (audio-to-audio) |
| Input | two time-aligned mono speech stems, 24 kHz |
| Output | translated speech with the matched foreign speech removed, 24 kHz mono |
| Parameters | 3,883,906 (~15.5 MB fp32) |
| Architecture | complex-ratio-mask U-Net over STFT magnitudes |
| Training | 98,242 six-second examples, epoch 37 selected |
| License | AGPL-3.0-or-later |
| File | Size | SHA-256 | Use |
|---|---|---|---|
dubclean_voice.pt | 46,909,206 B | FE1172C629C085F7ED8F7E264E2E37D4AEDE95C9448BB134EB9BAF8D5DEA53C9 | production checkpoint, drop-in for a DubClean Portable install |
dubclean_voice_inference.pt | 15,611,318 B | 5B6ED6B0E319B0AED13289F1C47CD13BE78BFBC026F3A7F3BA981906E557A68D | inference-only export: same weights, no optimizer state |
dubclean_voice.py | architecture and checkpoint loader | ||
infer.py | streaming command-line inference | ||
selftest.py | offline check that the checkpoint loads and runs |
Both checkpoints hold bit-identical weights and produce identical output. The
production file additionally carries the AdamW optimizer state and the training
history of the run that produced it, and its SHA-256 is the one recorded in
DubClean Portable's portable_manifest.json. For plain inference prefer
dubclean_voice_inference.pt.
pip install torch numpy scipy soundfile huggingface_hub
hf download Yaromanol/dubclean-voice --local-dir dubclean-voice
cd dubclean-voice
python selftest.py --checkpoint dubclean_voice_inference.pt
python infer.py \
--checkpoint dubclean_voice_inference.pt \
--mixture dubbed_speech.flac \
--reference original_speech.flac \
--output translated_speech_clean.flac
From Python:
import soundfile as sf
from dubclean_voice import load_model
from infer import read_mono, separate
model = load_model("dubclean_voice_inference.pt", device="cpu")
mixture = read_mono("dubbed_speech.flac") # translated speech + leaked foreign speech
reference = read_mono("original_speech.flac") # foreign speech to remove
voice = separate(model, mixture, reference, device="cpu")
sf.write("translated_speech_clean.flac", voice, 24000)
The model itself is a plain nn.Module:
output = model(mixture_tensor, reference_tensor) # float32 [B, T] at 24 kHz
output["voice"] # translated speech
output["reference"] # removed component = mixture - voice
This is the part that decides whether the model works at all.
infer.py resamples and downmixes for you. The output is
band-limited to 12 kHz — inside DubClean the full-band music and effects come
from a separate model, so the band limit applies only to the speech layer.STFT with n_fft=512, hop_length=256, Hann window, center=True → 257 bins
at 24 kHz. Six input planes are stacked from the mixture spectrum X and the
reference spectrum R:
log1p(12·|X|) and log1p(12·|R|);Phase relation never enters the network. A U-Net (base 16 channels →
16/32/64/96, bottleneck 128, skip connections) processes those planes; the
bottleneck holds ten identity-initialised residual blocks with time-axis
dilations 1,2,4,8,16,1,2,4,8,16, which is what carries tolerance to jitter and
local timing drift.
The two output planes form an unbounded complex ratio mask
mask = (1 + 2·tanh(a)) + i·(2·tanh(b))
applied to the mixture spectrum, followed by iSTFT. The mask is deliberately not constrained to 0…1: cancelling speech that overlaps in time and frequency needs gains above one, negative real parts and a real phase correction. A narrow mask capped suppression at roughly 4–6 dB in earlier versions of this model.
The removed component is defined as mixture − voice, so the two outputs always
sum back to the input.
Inference is windowed: 6 s windows, 3 s hop, raised-cosine cross-fade. Memory
use does not grow with file length. On CPU (torch 2.5.1, Windows 10) the
reference implementation runs at roughly 8× real time; a GPU is faster but not
required.
The model was trained on semantic-balanced-replay-20260720-v1: 98,242
examples of 6.0 s at 24 kHz, split 82,241 / 8,001 / 8,000 into train /
validation / test.
Every example is synthesized from real speech clips: a translated-speech target, a foreign-speech component embedded under it, and the reference the model is conditioned on, mixed under a controlled factor plan (18 factors, 113 options — voice types, overlap, ducking, reference shift, speed edits, level ratios, backgrounds, extractor quality). Because the mixture is composed explicitly, the ground-truth target and the ground-truth removed component are exact.
Composition by supervision policy:
| Policy | Examples | Meaning |
|---|---|---|
remove_matched_en | 79,200 | remove the foreign speech that matches the reference |
preserve_ru | 13,074 | keep the translation untouched |
no_op | 3,343 | silence, background or no foreign speech — output the input |
preserve_all_speech | 2,625 | wrong or unrelated reference — remove nothing |
20% of the training split are negative cases (no_op, preserve_all_speech,
preserve_ru), replayed on purpose: a separator that also has to not act is
much safer on real films than one trained only on removals.
21 scenarios are represented, among them typical voice-over, monologue, dense dialogue, equal-level overlap, foreign speech louder than the translation, very low embedded foreign speech, partial or extra-phrase references, wrong reference, timing drift, local edit jumps, similar-sounding voices, speech-like background, and a 32,000-example "hard master" block in which the two tracks are pushed through independent mastering chains (5.1→stereo downmix, AC-3→AAC, broadcast versus release master, piecewise gain envelopes, time-varying ducking, micro-timing jitter, codec+EQ+dynamics chains).
Source material: speech clips extracted from film soundtracks held by the maintainer — 12,959 clips (~25 h) from 45 audio tracks of 25 works, Russian and English. Clips are split by source work (16 works train, 3 validation, 4 test), so validation and test films never contribute speech to training.
Individual titles are not published. See
TRAINING_DATA_DISCLOSURE.md: publishing this
model grants no rights to the films, translations or recordings behind the
dataset, and the dataset itself is not distributed.
Metrics on the held-out splits of the synthetic benchmark, at the selected
epoch. EN suppression is 10·log10( MSE(mixture − target) / MSE(output − target) ) — how much of the error against the clean translation is removed.
RU SI-SDR is the scale-invariant SDR of the output against the clean
translation, i.e. how intact the translation stays.
| Validation | Test | |
|---|---|---|
| EN suppression | 7.41 dB | 7.54 dB |
| RU SI-SDR | 25.94 dB | 24.23 dB |
| SI-SDR improvement | 6.58 dB | 7.15 dB |
| Loss | 0.2736 | 0.3249 |
By channel condition (validation, 40 examples each):
| Condition | EN suppression | RU SI-SDR |
|---|---|---|
| independently randomised mastering (legacy) | 8.45 dB | 22.30 dB |
| drift + local edit | 9.02 dB | 12.87 dB |
| broadcast vs release master | 7.79 dB | 11.18 dB |
| AC-3 5.1 → AAC stereo | 7.64 dB | 13.78 dB |
| extractor pair asymmetry | 7.49 dB | 12.39 dB |
| micro-timing jitter | 6.89 dB | 11.38 dB |
| piecewise gain envelope | 6.64 dB | 10.15 dB |
| time-varying ducking | 6.56 dB | 18.23 dB |
| independent downmix | 6.33 dB | 11.38 dB |
| compound codec + EQ + dynamics | 6.07 dB | 12.29 dB |
| very low embedded foreign speech | 4.51 dB | 24.68 dB |
Acceptance run for the release, on top of the table above:
These numbers are a synthetic benchmark. Read them as a comparison between checkpoints, not as a promise about a particular film.
Restoring the speech layer of a dubbed soundtrack you have a lawful basis to process — personal archives, restoration work, dubbing and localisation research, and evaluation of reference-conditioned separation.
Out of scope: passing off the output as an official release, and any use of source material you have no right to process. The AGPL grants rights to this model and its code only. It grants nothing over films, translations, recordings or subtitles.
original track ──► speech extractor ──────────────► reference (EN speech)
│
dubbed track ──► speech extractor ──► alignment ──► mixture (RU + leaked EN)
│
▼
DubClean Voice ← this model
│
clean RU speech ───┼──► remix ──► soundtrack
│
dubbed track ──► DubClean M&E ──► music and effects
DubClean M&E, the companion model that rebuilds speech-free music and
effects, is part of the DubClean application and is not published here.
The weights and the code in this repository are AGPL-3.0-or-later. The full
text is in LICENSE; scope and exclusions are in
MODEL_LICENSE.md; attribution and third-party notes are in
NOTICE.
If you run a modified version of this model as a network service, the AGPL
requires you to offer the corresponding source to its users. For terms outside
the AGPL, see PROPRIETARY_LICENSING.md.
Media processed with DubClean is not licensed by DubClean, and processing it does not place it under the AGPL.
@software{dubclean_voice_2026,
title = {DubClean Voice: reference-conditioned removal of original-language
speech from dubbed soundtracks},
author = {DubClean contributors},
year = {2026},
note = {AGPL-3.0-or-later},
url = {https://huggingface.co/Yaromanol/dubclean-voice}
}
Russian version of this card: README_RU.md.