Update README.md
Browse files123---license: mit---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176---license: mittags:- audio- audio-enhancement- speech-enhancement- bandwidth-extension- codec-repair- neural-codec- waveform-processing- pytorchlibrary_name: pytorchpipeline_tag: audio-to-audioframeworks: PyTorchlanguage:- en---# Brontes: Synthesis-First Waveform Enhancement**Brontes** is a time-domain audio enhancement model designed for neural codec repair and bandwidth extension. This is the general pretrained model trained on diverse audio data.## Model DescriptionBrontes upsamples and repairs speech degraded by neural codec compression. Unlike conventional Wave U-Net approaches that rely on dense skip connections, Brontes uses a **synthesis-first architecture** with selective deep skips, forcing the model to actively reconstruct rather than copy degraded input details.### Key Capabilities- **Neural codec repair** — removes compression artifacts from neural codec outputs- **Bandwidth extension** — upsamples from 24 kHz to 48 kHz (2× extension)- **Waveform-domain processing** — operates directly on audio samples, no spectrogram conversion- **Synthesis-first design** — only the two deepest skips retained, preventing artifact leakage- **LSTM bottleneck** — captures long-range temporal dependencies at maximum compression### Model Architecture- **Type:** Encoder-decoder U-Net with selective skip connections- **Stages:** 6 encoder stages + 6 decoder stages (4096× total compression)- **Bottleneck:** Bidirectional LSTM for temporal modeling- **Parameters:** ~29M- **Input:** 24 kHz mono audio (codec-degraded)- **Output:** 48 kHz mono audio (enhanced)## Intended UseThis is a **general pretrained model** trained on diverse audio data. For optimal performance on your specific use case:⚠️ **It is strongly recommended to fine-tune this model on your target dataset** using the `--pretrained` flag.### Primary Use Cases- Repairing audio degraded by neural codecs (e.g., EnCodec, SoundStream, Lyra)- Bandwidth extension from narrowband/wideband to fullband- Speech enhancement and quality improvement- Post-processing for codec-compressed audio## Quick StartFor detailed usage instructions, training, and fine-tuning, please see the [GitHub repository](https://github.com/ZDisket/Brontes).### Basic Inference Example```pythonimport torchimport torchaudioimport yamlfrom brontes import Brontes# Setup devicedevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')# Load configwith open('configs/config_brontes_48khz_demucs.yaml', 'r') as f:config = yaml.safe_load(f)# Create modelmodel = Brontes(unet_config=config['model'].get('unet_config', {})).to(device)# Load checkpointcheckpoint = torch.load('path/to/checkpoint.pt', map_location=device)model.load_state_dict(checkpoint['model'] if 'model' in checkpoint else checkpoint)model.eval()# Load audioaudio, sr = torchaudio.load('input.wav')target_sr = config['dataset']['sample_rate']# Resample if necessaryif sr != target_sr:resampler = torchaudio.transforms.Resample(sr, target_sr)audio = resampler(audio)# Convert to mono and normalizeif audio.shape[0] > 1:audio = audio.mean(dim=0, keepdim=True)max_val = audio.abs().max()if max_val > 0:audio = audio / max_val# Add batch dimension and processaudio = audio.unsqueeze(0).to(device)with torch.no_grad():output, _, _, _ = model(audio)# Save outputoutput = output.squeeze(0).cpu()if output.abs().max() > 1.0:output = output / output.abs().max()torchaudio.save('output.wav', output, target_sr)```Or use the command-line interface:```bashpython infer_brontes.py \--config configs/config_brontes_48khz_demucs.yaml \--checkpoint path/to/checkpoint.pt \--input input.wav \--output output.wav```## Training Details### Training DataThe model was trained on diverse audio data including:- Clean speech recordings- Codec-degraded audio pairs- Various acoustic conditions and speakers### Training Procedure- **Pretraining:** 10,000 steps generator-only training- **Adversarial training:** Multi-Period Discriminator (MPD) + Multi-Band Spectral Discriminator (MBSD)- **Loss functions:** Multi-scale mel loss, pitch loss, adversarial loss, feature matching- **Precision:** BF16 mixed precision- **Framework:** PyTorch with custom training loop## Fine-tuning RecommendationsTo achieve best results on your specific dataset:1. **Prepare paired data:** Input (degraded) and target (clean) audio pairs2. **Use the `--pretrained` flag** to load model weights without optimizer state3. **Train for 10-50k steps** depending on dataset size4. **Monitor validation loss** to prevent overfittingSee the [repository README](https://github.com/ZDisket/Brontes) for detailed fine-tuning instructions.## Limitations- **Domain-specific performance:** General model may not perform optimally on highly specialized audio (fine-tuning recommended)- **Mono audio only:** Currently supports single-channel audio- **Fixed sample rates:** Designed for 24 kHz input → 48 kHz output- **Codec-specific artifacts:** Performance may vary across different codec types- **Long-form audio:** Very long audio files may require chunking or sufficient GPU memory## Ethical Considerations- This model is designed for audio enhancement and should not be used to create misleading or deceptive content- Users should respect privacy and consent when processing speech recordings- Enhanced audio should be clearly labeled as processed when used in sensitive contexts## LicenseBoth the model weights and code are released under the MIT License.## Additional Resources- **GitHub Repository:** [https://github.com/ZDisket/Brontes](https://github.com/ZDisket/Brontes)- **Technical Report:** See the repository- **Issues & Support:** [GitHub Issues](https://github.com/ZDisket/Brontes/issues)## AcknowledgmentsCompute resources provided by Hot Aisle and AI at AMD.
README.md+176-3