/ Модель

Характеристики

Лицензия
Своя лицензия
Базовая модель
MossFormer2_SE_48K
Опубликована
14 ноя 2026

hear-magic-clean

Обработка аудиоАудио → аудио3 профессии

Дообученная MossFormer2 для подавления шума и нежелательных звуков в записях чтецов говорящих газет Hear.

0скачиваний за 30 дней0лайковвеса обновлены15 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Hear Magic Clean — модель второго этапа очистки речи в инструменте Magic Clean, разработанная для записей говорящих газет Hear. Автор дообучил MossFormer2 для обработки аудио с частотой 48 кГц на реальных записях Hear. Модель анализирует четырёхсекундные окна и формирует частотно-временную маску, которая помогает убрать кашель, чихание, лай, хлопки дверей и фоновый шум, сохраняя голос чтеца.

Модель работает после DeepFilterNet3, а не заменяет его: дополнительный защитный этап возвращает тихие окончания слов, которые модель могла удалить, а также сохраняет продолжительные громкие фрагменты музыки и других звуков. Вход — аудиофункции для одного четырёхсекундного окна; выход — маска для спектрограммы. Пакет содержит TorchScript-модель размером 225 МБ; для запуска требуются Linux, NVIDIA GPU и PyTorch с CUDA. Модель дообучена на записях Hear, а целевой сценарий — очистка англоязычных записей говорящей прессы. Лицензия указана как other, конкретные условия в предоставленных данных не раскрыты.

Сценарии применения

  • удаление кашля и чихания из записей чтецов
  • подавление лая и хлопков дверей в голосовых записях
  • очистка фонового шума в аудио говорящей прессы
  • сохранение тихих окончаний слов при очистке речи
  • обработка 48-кГц WAV-записей по отдельным каналам

Ограничения

Модель рассчитана на аудио 48 кГц и для запуска требует Linux, NVIDIA GPU, PyTorch 2.8 и CUDA 12; каналы обрабатываются отдельно. Она может удалять тихие окончания речи, поэтому в штатном конвейере используется защитный этап на основе DeepFilterNet3.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Hear Magic Clean models

The second cleaning stage behind Magic Clean, the tool that tidies up speech recordings for UK talking newspapers on Hear. It takes a recording of someone reading and removes coughs, sneezes, barks, door slams and background noise while keeping the reader's voice.

The model is MossFormer2 (48 kHz speech enhancement) fine-tuned on real Hear recordings. It runs after DeepFilterNet3 in the Hear cleaner, not in place of it. DeepFilterNet3's output is kept as a safety net and is put back wherever this model removes soft speech.

PartFileSizeJob
Modelsecond-stage/mossformer2-hear-d.ts.pt225 MBFor each 4-second window, decides how much of every frequency to keep
Tone targetsecond-stage/tone-target.npy4 KBThe average spectrum of clean Hear recordings, used by the tone step
Settingssecond-stage/settings.json2 KBEvery number the recipe below needs
Portable weightsweights/mossformer2-hear-d.safetensors221 MBThe same weights as a plain state dict, for retraining or re-export
Reference codereference/15 KBA small, complete implementation of the three steps

Contents

Repository layout

manifest.json                         version, size and SHA-256 of every file
second-stage/
  mossformer2-hear-d.ts.pt            the model, ready to load with torch.jit.load
  tone-target.npy                     1,025 values, one per frequency bin of a 2,048-point FFT at 48 kHz
  settings.json                       window sizes, mask settings, guard thresholds, tone limit
weights/
  mossformer2-hear-d.safetensors      929 tensors, 55.3 million parameters
reference/
  second_stage.py                     model stage: features, windows, mask shaping
  guard.py                            speech guard
  tone.py                             tone step, as NumPy and as an FFmpeg filter

A build only needs the second-stage/ folder. The weights/ and reference/ folders are for people working on the model.

Loading the model

Requirements: Linux, an NVIDIA GPU as device 0, PyTorch 2.8 with CUDA 12 and torchaudio 2.8. The model file was exported with torch 2.8.0+cu128 and runs on the GPU only.

import torch
from huggingface_hub import hf_hub_download

path = hf_hub_download(
    "samuelr3/hear-magic-clean",
    "second-stage/mossformer2-hear-d.ts.pt",
    revision="v1",
)
model = torch.jit.load(path).eval()

with torch.inference_mode(), torch.jit.optimized_execution(False):
    mask = model(features)
  • Do not pass map_location. The file stores its weights on cuda:0 and a few shape constants on the CPU, and moving either breaks it.
  • Call it inside torch.jit.optimized_execution(False). Otherwise PyTorch recompiles the model for 10 to 15 seconds the second time it meets each new batch size. Steady speed is within 10% either way.
  • Input: features, float32, shape (batch, 496, 180), on cuda:0. That is one 4-second window per row.
  • Output: a mask, float32, shape (batch, 496, 961). Multiply it into the window's spectrogram.
  • Batch size is free. 16 windows peak at about 0.7 GB of GPU memory.

To clean a file with the reference code:

python reference/second_stage.py second-stage/mossformer2-hear-d.ts.pt input.wav cleaned.wav

The input must be a 48 kHz WAV. Each channel is cleaned separately.

In a Docker build

The repository is public, so a build needs no token or login. Pin the revision and download only the build folder:

RUN huggingface-cli download samuelr3/hear-magic-clean \
      --revision v1 --include "second-stage/*" "manifest.json" \
      --local-dir /models/magic-clean/hear-magic-clean

Every file also has a plain URL, for builds without the Hugging Face client:

https://huggingface.co/samuelr3/hear-magic-clean/resolve/v1/second-stage/mossformer2-hear-d.ts.pt
https://huggingface.co/samuelr3/hear-magic-clean/resolve/v1/second-stage/tone-target.npy
https://huggingface.co/samuelr3/hear-magic-clean/resolve/v1/second-stage/settings.json

Then check every file against manifest.json before the image is used:

import hashlib, json, pathlib

root = pathlib.Path("/models/magic-clean/hear-magic-clean")
for item in json.loads((root / "manifest.json").read_text())["files"]:
    path = root / item["path"]
    if path.exists():
        assert path.stat().st_size == item["bytes"], item["path"]
        assert hashlib.sha256(path.read_bytes()).hexdigest() == item["sha256"], item["path"]

How the cleaner uses these files

The recording is decoded to 48 kHz and cleaned by DeepFilterNet3 first. Three steps follow. All the numbers are in second-stage/settings.json.

1. Model stage

  1. Cut each channel into 4-second windows that start every 3 seconds.
  2. Scale each window to a standard loudness (about -25 dB), and remember the scale.
  3. Compute the features: a 60-band Kaldi filter bank (40 ms window, 8 ms step) with its first and second differences, 180 values per frame. Add the dither to each frame first: random noise one 16-bit step in size. The model was trained with it, and leaving it out changes the result by 6 to 28 dB on real recordings.
  4. Run the model to get the mask, and shape it:
    • Raise the mask to the power 2 where it is below 1. This deepens the noise removal.
    • Where the speech in a window stops below about 9 kHz, relax the power to 0.5 above 3 to 5 kHz while speech is present. Without this, the top of the voice in narrow-band recordings is lost.
    • If the profile sets an attenuation limit, never go below it.
  5. Multiply the mask into the window's spectrogram, turn it back into sound, undo the loudness scale, and keep the middle 3 seconds of each window.

2. Speech guard

The model sometimes removes soft word endings, such as a final "s". DeepFilterNet3 keeps them. The guard looks at short frames (10 ms steps) of the original, the DeepFilterNet3 output and the model output, and cross-fades the DeepFilterNet3 audio back in where all of these hold:

  • the frame is within 0.2 s before or 0.8 s after speech;
  • DeepFilterNet3 kept the sound (within 6 dB of the original);
  • the model removed it (more than 8 dB below DeepFilterNet3);
  • it is quiet compared with normal speech (its quarter-second average is at least 5 dB below the median speech level).

The last rule matters: a cough is as loud as speech, so it is never restored.

The guard also leaves long loud stretches with no speech alone. If the model removes at least 20 dB from a loud passage for 3 seconds or more, that passage is taken from DeepFilterNet3. This keeps jingles and music from being deleted.

On the test sets the guard restores between 0.1% and 1% of the audio.

3. Tone step

The cleaned recording's average spectrum is compared with tone-target.npy and nudged towards it by at most 3 dB per band, up to 14 kHz or the recording's own bandwidth. reference/tone.py shows the correction in NumPy and as one FFmpeg firequalizer filter. The Hear cleaner applies the same curve as a 2,049-tap filter with no delay, on the GPU.

Training

Starting point: the released MossFormer2_SE_48K weights from ClearerVoice-Studio.

Data:

KindSourceAmount
Clean speech, realHear talking-newspaper recordings that passed a strict cleanliness check1,593 recordings from about 160 publications, cut into 29,108 four-second clips
Noisy speech, realHear recordings that failed the check17,964 four-second clips, 14,000 used
Noise, realPauses cut from noisy Hear recordings1,049 noise beds
Clean speech, studioVCTK 0.92 and LibriTTS-R6,000 clips, passed through MP3 coding
Sudden noisesFSD50K clips and VocalSound coughs, sneezes and throat clears19,263 clips
Steady noiseDEMAND and FSD50K ambient clipsAbout 6 GB of 48 kHz audio

About 475 hours of Hear recordings from 226 publications were scored to make this selection. Recordings with digitally silent pauses were left out, so the model is not taught to produce dead silence. Sixty publications were kept out of training entirely and used for testing.

Passes:

  1. First pass. 52,309 pairs: real clean clips with noise added (32,309), real noisy clips paired with the output of a mildly fine-tuned DeepFilterNet3 as the target (14,000), and studio clips (6,000). Learning rate 2e-5, batch 4, 13,078 steps.
  2. Second pass. Started from step 12,000 of the first. The same pairs, with 60% of the real clean targets replaced by that DeepFilterNet3's output on the same clip. Learning rate 1.5e-5, 13,078 steps. The checkpoint at step 12,000 scored best on a validation set of 60 held-out recordings and is the model published here.

The training target is the phase-sensitive mask, and the noisy input and its clean target are scaled by the same gain.

Results

"Chain" means all three steps above. "DeepFilterNet3" means the stock model at full strength. DNSMOS and NISQA are automatic listening scores from 1 to 5 that need no clean reference. PESQ compares against a clean reference.

TestMeasureInputDeepFilterNet3Chain
Ten difficult recordings (28 minutes, 96 kbps MP3)DNSMOS overall2.533.043.14
NISQA2.363.023.56
Sixty recordings from publications held out of trainingDNSMOS overall3.113.253.30
NISQA3.463.784.08
Eight clips with a cough, sneeze, throat clear or barkPESQ1.902.783.61

On the sixty held-out recordings the chain scored higher than DeepFilterNet3 on 46 and lower on 6 (NISQA).

In the Hear cleaner (Studio Voice profile, delivered MP3) the ten difficult recordings score DNSMOS 3.17 and NISQA 3.55 with this stage, and 3.07 and 3.13 without it. Whisper hears 7.7% of the original's words differently with the stage and 7.8% without.

Model stage alone, on studio speech with noise mixed in:

TestDeepFilterNet3Model stage
Clean speech, PESQ4.514.62
Quiet clean speech, PESQ3.894.47
Speech with sudden noises, PESQ2.813.20
Sudden noises with no speech, dB removed20.438.1

Speed: in the Hear cleaner all three steps take about 25 seconds for 60 minutes of mono audio on an RTX A40, and 55 seconds for stereo. GPU memory peaks at 0.7 GB with 16 windows per batch.

Limits

  • Soft speech. On clean recordings the chain turns quiet parts of speech down by 2.7 dB, against 0.9 dB for DeepFilterNet3. Do not run the model without the guard.
  • Needs DeepFilterNet3. The guard uses its output and the original recording.
  • No repair. It does not rebuild missing high frequencies or fix clipping, so heavily damaged recordings still sound damaged.
  • Music and jingles. The model treats them as noise. Only the guard's long-passage rule protects them.
  • Material. Trained and tested on English read speech. Other languages, singing and conversation with overlapping speakers are untested.
  • GPU only. The model file is tied to PyTorch 2.8 with CUDA. For another version, rebuild it from the portable weights with the ClearerVoice-Studio model code.
  • Repeatability. The dither is random, so two runs differ a little: by 40 to 55 dB below the signal on most recordings, and by a few dB inside passages the model is already removing. Seed the dither if you need the same output every time. The Hear cleaner does.
  • Automatic scores. The scores above did not catch two faults that listening did (clipped word endings, and coughs restored by an earlier guard). Listen before changing any setting.

Licences and credits

This repository mixes licences. Check them before passing the weights on.

PartSourceLicence
Base model and architectureMossFormer2_SE_48K, ClearerVoice-StudioApache-2.0
Studio speechVCTK 0.92, LibriTTS-RCC BY 4.0
Sudden and steady noisesFSD50K, clips under CC0 or CC BY onlyCC0, CC BY
Coughs, sneezes, throat clearsVocalSoundCC BY-SA 4.0
Steady noiseDEMANDCC BY-SA 3.0
Real speech and noiseHear talking-newspaper recordingsNot public; used with Hear's permission
Teacher for the noisy clipsDeepFilterNet3, fine-tunedMIT or Apache-2.0

The fine-tuned weights, the tone target and the reference code belong to Hear.

Versions

VersionDateContents
v12026-11-15Second-pass model, guard with the cough and long-passage rules, tone limit 3 dB

The files under second-stage/ have not changed since v1. Later commits on main only update this page and the reference code.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Обработка «аудио → аудио» пока не поддерживается рантаймом.

Ревизия весов
defad43

0 моделей