CoolFace
Modelpublic

harphool17/parakeet-asr-adapter

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes6downloads
Model Card

๐ŸŽ™๏ธ Parakeet TDT 0.6B โ€” Fine-Tuned for Children's Speech Recognition

![Live Demo](https://harphool17-parakeet-asr-competition-winner.hf.space/) ![Competition](https://www.drivendata.org/competitions/308/childrens-word-asr/) ![Model](https://huggingface.co/nvidia/parakeet-tdt-0.6b-v2) ![License](LICENSE)


๐ŸŒ Try It Live โ€” No Code Needed!

We built a free online demo where anyone can upload audio and get children's speech transcribed instantly!

๐Ÿ‘‰ Click Here to Try the Demo

What you can do on the website:

  • โ€”๐Ÿ“ Upload any audio file (WAV, MP3, FLAC, OGG, M4A)
  • โ€”๐ŸŽค Record directly from your microphone
  • โ€”โšก Get instant transcription results
  • โ€”โฑ๏ธ See processing time
  • โ€”๐Ÿ”„ Clear and try again

The website is completely free and requires no account or installation!


๐Ÿง  What is This Model?

Think of this model as a specialist teacher's assistant who has been specially trained to understand children's speech.

Most speech recognition systems fail on children's voices because:

ProblemExample
Higher pitchChildren's voices are 1-2 octaves higher than adults
Mispronunciation"elephant" โ†’ "efant", "spaghetti" โ†’ "pasketti"
Different rhythmChildren speak with irregular pace
Incomplete words"gonna" instead of "going to"
Speech disordersLisping, stuttering, articulation issues

Our Solution: We took NVIDIA's powerful Parakeet TDT 0.6B model and added a specially trained adapter โ€” a small but powerful neural network module that teaches the model to understand children's voices without forgetting what it already knows about adult speech.


๐Ÿ† Competition Background

This model was built for the "On Top of Pasketti: Children's Speech Recognition Challenge" on DrivenData โ€” a competition with a $120,000 prize pool to build the world's best children's speech recognition system.

Competition Results

ModelValidation WERPublic Leaderboard WER
Our Parakeet Adapter10.64% ๐Ÿ”ฅ29.26%
Competition #1-19.37%
Official Parakeet Baseline-31.77%
Whisper Baseline-~60%+
WER = Word Error Rate โ€” Lower is always better! If a child says 10 words and model gets 2 wrong = 20% WER

๐ŸŽฏ Key Achievement

We beat the official baseline Parakeet model (31.77% โ†’ 29.26%) using only adapter fine-tuning with 0.26% trainable parameters!


๐Ÿ“ What's Inside This Repository

This repository contains one file โ€” but it's everything you need!

ASR-Adapter.nemo (2.5 GB) โ€” The Complete Model Package

A .nemo file is NVIDIA's special format that packages everything the model needs into a single file. Think of it like a USB drive containing all the model's knowledge.

What's packed inside this single file:

ComponentWhat it Does
Base Model WeightsThe original Parakeet TDT 0.6B knowledge (619M parameters)
Adapter WeightsOur specially trained children's speech adapter (1.6M parameters)
Audio PreprocessorConverts raw audio โ†’ mel spectrograms automatically
TokenizerConverts predicted tokens โ†’ readable English text
Model ConfigArchitecture settings (encoder layers, decoder type, etc.)
Decoding ConfigHow to generate the final text output

The adapter we trained:

  • โ€”Only 1,622,016 parameters trainable (0.26% of total!)
  • โ€”Added as linear layers to each encoder layer
  • โ€”Base model was frozen (its knowledge preserved)
  • โ€”Adapter learned children's acoustic patterns

๐Ÿš€ How to Use This Model

Method 1 โ€” Use Our Live Website (Easiest!)

No installation needed. Just go to: [https://harphool17-parakeet-asr-competition-winner.hf.space/](https://harphool17-parakeet-asr-competition-winner.hf.space/)

Upload your audio file and get the transcription instantly! โœ…


Method 2 โ€” Use in Python Code

Step 1 โ€” Install Requirements
bash
# Install NeMo framework (required for Parakeet)
pip install nemo_toolkit[asr]

# Install audio processing libraries
pip install librosa soundfile
โš ๏ธ Note: NeMo installation can take 5-10 minutes. Be patient!
Step 2 โ€” Download the Model
python
from huggingface_hub import hf_hub_download

# Download the model (2.5GB โ€” takes a few minutes)
model_path = hf_hub_download(
    repo_id="harphool17/parakeet-asr-adapter",
    filename="ASR-Adapter.nemo"
)
print(f"Model downloaded to: {model_path}")
Step 3 โ€” Load and Use the Model
python
import torch
import librosa
import soundfile as sf
import numpy as np
from nemo.collections.asr.models import ASRModel
from omegaconf import open_dict

# โ”€โ”€ Load Model โ”€โ”€
print("Loading model... (may take 1-2 minutes)")
model = ASRModel.restore_from(
    model_path,
    map_location="cuda" if torch.cuda.is_available() else "cpu"
)

# Disable CUDA graph decoder (compatibility fix)
with open_dict(model.cfg):
    model.cfg.decoding.greedy.use_cuda_graph_decoder = False
model.change_decoding_strategy(model.cfg.decoding)

# Enable our trained adapter
if model.is_adapter_available():
    model.set_enabled_adapters(enabled=True)
    print("โœ… Adapter enabled!")

model.eval()
print("โœ… Model ready!")

# โ”€โ”€ Transcribe Audio โ”€โ”€
def transcribe_audio(audio_path):
    """
    Transcribe an audio file containing children's speech.
    
    Args:
        audio_path: Path to audio file (WAV, FLAC, MP3, etc.)
    
    Returns:
        Transcribed text string
    """
    # Load and convert audio to 16kHz mono (required format)
    audio, sr = sf.read(audio_path, dtype="float32")
    
    # Convert stereo to mono if needed
    if audio.ndim > 1:
        audio = audio.mean(axis=1)
    
    # Resample to 16kHz if needed
    if sr != 16000:
        audio = librosa.resample(audio, orig_sr=sr, target_sr=16000)
    
    # Save as temporary WAV file
    import tempfile, os
    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
        sf.write(f.name, audio, 16000)
        temp_path = f.name
    
    try:
        # Run transcription
        result = model.transcribe([temp_path], verbose=False)
        
        # Extract text from result
        if isinstance(result, tuple):
            result = result[0]
        text = result[0].text if hasattr(result[0], "text") else result[0]
        
        return text.lower().strip()
    finally:
        os.unlink(temp_path)

# โ”€โ”€ Example Usage โ”€โ”€
transcription = transcribe_audio("child_speaking.wav")
print(f"Child said: '{transcription}'")
Step 4 โ€” Batch Processing (Multiple Files)
python
# Process multiple audio files at once (faster!)
audio_files = [
    "child1.wav",
    "child2.wav", 
    "child3.wav"
]

results = model.transcribe(audio_files, batch_size=8, verbose=False)
if isinstance(results, tuple):
    results = results[0]

for audio_file, result in zip(audio_files, results):
    text = result.text if hasattr(result, "text") else result
    print(f"{audio_file}: {text}")

Supported Audio Formats

FormatExtensionQualityNotes
WAV.wavโญ BestRecommended format
FLAC.flacโญ BestLossless audio
MP3.mp3โœ… GoodLossy but works
OGG.oggโœ… GoodOpen format
M4A.m4aโœ… GoodApple format

Best practice: Use WAV or FLAC for highest accuracy. The code automatically converts any sample rate to 16kHz mono.


Common Errors and How to Fix Them

ErrorCauseFix
ModuleNotFoundError: nemoNeMo not installedpip install nemo_toolkit[asr]
CUDA out of memoryNot enough GPU memoryUse CPU: map_location="cpu"
Channel selector average not foundMulti-channel audio issueConvert to mono first (code above does this)
FileNotFoundErrorWrong audio pathCheck the file path is correct
Model loads but gives bad resultsAdapter not enabledMake sure model.set_enabled_adapters(enabled=True) runs

๐Ÿ”ฌ Technical Details โ€” How We Trained This Model

What is an Adapter?

Imagine the base Parakeet model is like a brilliant doctor who trained for 10 years on adult patients. We can't retrain all 10 years of knowledge (too expensive!). Instead, we gave this doctor a short specialized course on treating children โ€” that's the adapter!

Base Parakeet Model (619M params) โ†โ”€โ”€ FROZEN, not changed
         +
Adapter Layers (1.6M params)     โ†โ”€โ”€ TRAINED on children's speech
         =
Final Model (620M total, only 0.26% changed!)

Training Configuration

python
# Our exact training settings
BATCH_SIZE    = 16      # Audio clips processed at once
LEARNING_RATE = 0.001   # How fast the adapter learns
MAX_STEPS     = 8000    # Total training iterations
VAL_INTERVAL  = 700     # Evaluate every 700 steps
PRECISION     = "bf16-mixed"  # Memory-efficient format
OPTIMIZER     = "AdamW"       # Learning algorithm
LR_SCHEDULE   = "CosineAnnealing"  # Learning rate decay
WARMUP_STEPS  = 500     # Gradual LR warmup

Training Data

PropertyValue
Total utterances90,083 (after filtering)
Training set85,578 samples
Validation set4,505 samples
Total audio~148 hours
Age groups3-4, 5-7, 8-11 years
Max clip duration25 seconds
Sample rate16kHz mono
SourceDrivenData Pasketti Competition

Training Progress

StepValidation WERNotes
70012.90%First evaluation
1,400~11.5%Improving
2,800~11.0%Steady improvement
5,000~10.8%Continuing
7,44910.64% ๐Ÿ”ฅBest model saved!
8,000Training stoppedmax_steps reached

Hardware Used

ComponentSpecification
GPUNVIDIA RTX 4500 Ada Generation
VRAM24 GB
Training Time~3 hours
FrameworkNVIDIA NeMo 2.7.2
PyTorch2.6.0 + CUDA 12.4

๐Ÿ“Š Understanding WER (Word Error Rate)

WER is the main metric for speech recognition. Here's how it works:

Child says:    "I have two cats and a dog"    (7 words)
Model predicts: "I have to cats in a dog"     (7 words)

Errors:
- "two" โ†’ "to"     = 1 Substitution
- "and" โ†’ "in"     = 1 Substitution

WER = (Substitutions + Deletions + Insertions) / Total Reference Words
WER = (2 + 0 + 0) / 7 = 0.286 = 28.6%

Our scores:

  • โ€”Validation WER: 10.64% โ€” about 1 error per 10 words โœ…
  • โ€”Public test WER: 29.26% โ€” competition test set (harder, unseen data)

๐Ÿ—๏ธ Architecture Details

This model uses Parakeet TDT (Token-and-Duration Transducer) architecture:

Audio Input (WAV file)
       โ†“
Audio Preprocessor (converts to 80-bin mel spectrogram)
       โ†“
Conformer Encoder (with our adapter layers) โ† Our adapter adds here!
       โ†“
RNN-T Decoder
       โ†“
Text Output ("the child said hello")

Why RNN-T instead of Whisper's approach?

  • โ€”Whisper generates text one token at a time (slow for long audio)
  • โ€”RNN-T generates text streaming (faster, more efficient)
  • โ€”Parakeet can't output capital letters, punctuation, or digits โ€” only lowercase a-z and spaces (perfect for WER evaluation!)

๐Ÿ”— Related Resources

ResourceLink
๐ŸŒ Live Demo Websiteharphool17-parakeet-asr-competition-winner.hf.space
๐Ÿ’ป GitHub Codeharphool-singh/whisper-children-asr
๐Ÿ† CompetitionDrivenData Pasketti Challenge
๐Ÿ“ฆ Base Modelnvidia/parakeet-tdt-0.6b-v2
๐Ÿค— Whisper Modelharphool17/whisper-large-v3-children-asr

๐Ÿ’ก Lessons Learned

For anyone wanting to build similar models:

  1. 1.Adapters are incredibly efficient โ€” We trained only 0.26% of parameters and got excellent results. You don't always need to retrain everything!
  1. 1.Pre-compute features โ€” Computing mel spectrograms during training slows everything down. Pre-compute once and save as files.
  1. 1.Library versions matter โ€” NeMo 2.7.2 locally vs 2.5.x on server caused our adapter to not apply during inference. Always test on the same version you'll deploy!
  1. 1.Children's speech is genuinely hard โ€” Even with fine-tuning, the gap between validation (10.6% WER) and public test (29.26%) shows how diverse children's speech really is.
  1. 1.Validation WER โ‰  Real Performance โ€” Our model proved excellent in validation but faced distribution shift on the real test set. Always test on completely unseen data!

๐Ÿ‘ค About the Author

Harphool Singh โ€” built this model as part of an NLP course project and DrivenData competition participation.


๐Ÿ“„ License

This model is released under the MIT License โ€” free to use, modify, and distribute for any purpose including commercial use.

The base model (Parakeet TDT 0.6B) is released by NVIDIA under their own license โ€” please check NVIDIA's model page for terms.


Built with โค๏ธ to make AI work better for children's education