Built to order

Hindi Speech Recognition using Wav2Vec2

This project fine-tunes the pre-trained wav2vec2-large-xlsr-53 model on the Mozilla Common Voice Hindi dataset to build a Hindi speech-to-text system. It covers the full ASR pipeline — audio preprocessing, CTC fine-tuning with SpecAugment, KenLM language-model rescoring, and WER/CER evaluation — and ships with the training notebook, the fine-tuned model, and an interactive web demo with a voice recorder and transcription display. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning.

Hindi Speech Recognition using Wav2Vec2 — project thumbnail preview
More project photos (2)

The problem

Hindi is spoken by hundreds of millions, yet high-quality open Hindi ASR still lags English — a gap final-year students can meaningfully work on. This project takes facebook/wav2vec2-large-xlsr-53, a transformer pre-trained on 53 languages of unlabeled speech, and fine-tunes it on the validated Hindi subset of Mozilla Common Voice with a CTC objective. Students learn how self-supervised speech models work, why SpecAugment matters, how CTC decoding turns frame predictions into Devanagari text, and how a KenLM language model rescores hypotheses. Evaluation uses word and character error rates on a held-out split. The web demo provides the recorder-and-transcription interface with representative outputs.

How it works

  1. The Common Voice Hindi validated subset is downloaded and resampled to 16 kHz mono.
  2. Transcripts are normalized (Devanagari script, punctuation handling) and split 90/10 train/validation.
  3. SpecAugment applies time and frequency masking during training for robustness.
  4. wav2vec2-large-xlsr-53 is fine-tuned with CTC loss using Adam and learning-rate warmup.
  5. A 5-gram KenLM language model is trained on Hindi text for decoder rescoring.
  6. The held-out split is decoded with CTC beam search + KenLM; WER and CER are computed for the report.
  7. The web demo records audio and displays a representative transcription with word confidences.

Tech stack:

  • Python 3, PyTorch
  • Hugging Face Transformers
  • facebook/wav2vec2-large-xlsr-53
  • Mozilla Common Voice Hindi
  • KenLM (5-gram LM)
  • LibriSpeech-style eval (jiwer)
  • HTML/CSS/JS voice demo

Dataset & model details

  • Dataset: Mozilla Common Voice (Hindi, hi) — community-contributed read speech, ~37 hours validated, 16 kHz mono with Devanagari transcripts, CC-0 licensed; 90/10 train/validation split for fine-tuning.
  • Task: Automatic speech recognition; input = 16 kHz Hindi speech waveform, output = Devanagari transcript.
  • Model: facebook/wav2vec2-large-xlsr-53 (315M params: CNN feature encoder + 24-layer transformer) fine-tuned with a CTC character head; KenLM 5-gram rescoring at decode.
  • Metrics: Word error rate 18–22% (design target), character error rate 6–9% (design target), real-time factor ~0.3× on CPU (expected). No WER is claimed as measured until the fine-tuning run is executed for the order.
Parameter Value
Input format 16 kHz mono WAV
Output Devanagari text transcript
Dataset size ~37 h validated Hindi speech
Model parameters Approximately 315,000,000
Word error rate 18–22% (design target, not a measured claim)
Training time Approximately 8–12 h on a T4 GPU (expected)
Real-time factor ~0.3× on CPU (expected)
Model file ~1.2 GB fp32 / ~315 MB int8 (expected)
Demo Single-file web app with recorder UI

Project features

  • Fine-tuned Hindi ASR wav2vec2-large-xlsr-53 fine-tuned on Common Voice Hindi with CTC loss — real transfer learning for speech.
  • Real speech dataset Mozilla Common Voice Hindi: ~37 hours of validated 16 kHz read speech with Devanagari transcripts (CC-0).
  • Full training notebook Data prep, SpecAugment, CTC fine-tuning, checkpointing and WER/CER evaluation in one reproducible notebook.
  • KenLM rescoring A 5-gram Hindi language model rescores CTC beam-search hypotheses — the classic ASR second pass, explained in the report.
  • Interactive voice demo Single-file web app with recorder, live waveform visualization and word-level transcription display.
  • Honest error analysis WER/CER on the held-out split plus error-type breakdown (substitutions, deletions, insertions) for the viva.
  • Viva kit Report PDF, PPT and Q&A covering transformers for speech, CTC, SpecAugment and language modelling.

What is included

  • Common Voice Hindi preparation scripts
  • Complete CTC fine-tuning & evaluation notebook
  • Fine-tuned wav2vec2 model + KenLM language model
  • Interactive voice demo web app with sample utterances
  • WER/CER evaluation tables and error-type analysis
  • Decoding pipeline documentation
  • Project report PDF, PPT presentation
  • Viva Q&A preparation document

Limitations & prerequisites

  • Read speech only — conversational, accented or code-mixed (Hinglish) speech degrades WER.
  • WER design targets assume clean recordings; noisy audio needs additional augmentation.
  • 18–22% WER is a design target, stated honestly — the report documents the actual achieved figure.
  • The 315M-parameter model needs a GPU for training; inference runs on CPU in real time.
  • The web demo simulates the pipeline with representative outputs; it does not run the 315M model in-browser.

Frequently Asked Questions

Which dataset and model are used?

Mozilla Common Voice Hindi (~37h validated, CC-0) for fine-tuning, and facebook/wav2vec2-large-xlsr-53 — a transformer pre-trained on 53 languages — as the base model with a CTC head.

What is CTC?

Connectionist Temporal Classification: it lets the model map audio frames to characters without frame-level alignment labels. The report explains the blank token, collapsing and beam-search decoding in viva-ready depth.

Why add a KenLM language model?

The acoustic model proposes character sequences; the 5-gram LM rescores them toward fluent Hindi, fixing many substitution errors. The report shows WER with and without it.

How does the demo work?

Press record, speak, then stop — the app shows a live waveform while recording and displays a representative Devanagari transcription with word confidences and transliteration.

Can it handle Hinglish?

Not reliably as shipped — training data is Hindi read speech. Code-mixed speech is listed as future scope with data notes.

Is this project suitable for a final-year project?

Yes — for AI & Machine Learning programs. It demonstrates self-supervised transfer learning, CTC, language modelling and proper ASR evaluation. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning.

Components & software requirements
  • Python 3, PyTorch
  • Hugging Face Transformers
  • facebook/wav2vec2-large-xlsr-53
  • Mozilla Common Voice Hindi
  • KenLM (5-gram LM)
  • LibriSpeech-style eval (jiwer)
  • HTML/CSS/JS voice demo

Dataset & model details

  • Dataset: Mozilla Common Voice (Hindi, hi) — community-contributed read speech, ~37 hours validated, 16 kHz mono with Devanagari transcripts, CC-0 licensed; 90/10 train/validation split for fine-tuning.
  • Task: Automatic speech recognition; input = 16 kHz Hindi speech waveform, output = Devanagari transcript.
  • Model: facebook/wav2vec2-large-xlsr-53 (315M params: CNN feature encoder + 24-layer transformer) fine-tuned with a CTC character head; KenLM 5-gram rescoring at decode.
  • Metrics: Word error rate 18–22% (design target), character error rate 6–9% (design target), real-time factor ~0.3× on CPU (expected). No WER is claimed as measured until the fine-tuning run is executed for the order.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation