A from-scratch multilingual speech-to-text system for English, Hindi, and Odia
Overview โข Features โข Architecture โข Installation โข Usage โข Documentation
This project implements a complete Automatic Speech Recognition (ASR) pipeline from scratch, designed to convert spoken audio in English, Hindi, and Odia into text.
- No Third-Party Speech APIs: No Google Speech, Whisper, Azure, AWS, or any external ASR services
- No Pretrained Models: All models are trained from scratch using raw datasets
- Complete Pipeline: From audio preprocessing to final transcription
- Multilingual Support: Handles three languages with automatic language detection
- Educational Purpose: Designed to understand the inner workings of ASR systems
| Feature | Description |
|---|---|
| ๐ Audio Preprocessing | Mono conversion, 16kHz resampling, normalization, silence removal |
| ๐ Feature Extraction | MFCC with delta and delta-delta coefficients |
| ๐ Language Detection | Automatic identification of English, Hindi, or Odia |
| ๐ง Acoustic Modeling | Separate CNN+BiLSTM models per language |
| ๐ Language Modeling | N-gram based language models for each language |
| ๐ค Decoding | Viterbi/Beam search for optimal transcription |
| ๐ค Real-time Input | Live microphone capture and processing |
| ๐ฅ๏ธ Premium UI | Modern HTML/CSS/JS frontend with Flask backend |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AUDIO INPUT โ
โ (.wav, 16kHz, Mono) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PREPROCESSING โ
โ โข Mono Conversion โข Resampling โข Normalization โ
โ โข Silence Removal โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FEATURE EXTRACTION โ
โ MFCC (13-40 coefficients) โ
โ + Delta + Delta-Delta โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LANGUAGE IDENTIFICATION โ
โ SVM / Neural Network โ
โ โ
โ โโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโ โ
โ โ English โ Hindi โ Odia โ โ
โ โโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ English ASR โ โ Hindi ASR โ โ Odia ASR โ
โ โ โ โ โ โ
โ Acoustic Model โ โ Acoustic Model โ โ Acoustic Model โ
โ Language Model โ โ Language Model โ โ Language Model โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DECODER โ
โ Viterbi / Beam Search Algorithm โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TEXT OUTPUT โ
โ Transcribed text in detected language โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Python 3.10+
| Category | Libraries |
|---|---|
| Numerical Computing | NumPy, SciPy |
| Audio Processing | Librosa, SoundDevice, PyAudio |
| Machine Learning | Scikit-learn |
| Deep Learning | PyTorch |
| Visualization | Matplotlib |
| User Interface | Tkinter |
โ ๏ธ Note: These libraries are tools for implementation, not intelligence. All model architectures and training are done from scratch.
| Dataset | Source |
|---|---|
| Mozilla Common Voice | commonvoice.mozilla.org |
| Dataset | Source |
|---|---|
| Mozilla Common Voice (Hindi) | commonvoice.mozilla.org |
| AI4Bharat Hindi | ai4bharat.org |
| Dataset | Source |
|---|---|
| AI4Bharat Odia | ai4bharat.org |
| OpenSLR Indic Corpora | openslr.org |
Each dataset entry must contain:
- โ Audio file (.wav format)
- โ Exact text transcript
multilingual-indic-asr/
โ
โโโ ๐ README.md # This file
โโโ ๐ LICENSE # MIT License
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ setup.py # Package setup
โโโ ๐ config.yaml # Configuration file
โ
โโโ ๐ data/ # Dataset storage
โ โโโ raw/ # Raw audio files
โ โ โโโ english/
โ โ โโโ hindi/
โ โ โโโ odia/
โ โโโ processed/ # Preprocessed data
โ โ โโโ english/
โ โ โโโ hindi/
โ โ โโโ odia/
โ โโโ transcripts/ # Text transcripts
โ โโโ english/
โ โโโ hindi/
โ โโโ odia/
โ
โโโ ๐ src/ # Source code
โ โโโ __init__.py
โ โโโ preprocessing/ # Audio preprocessing
โ โ โโโ __init__.py
โ โ โโโ audio_utils.py
โ โ โโโ preprocessor.py
โ โโโ features/ # Feature extraction
โ โ โโโ __init__.py
โ โ โโโ mfcc_extractor.py
โ โโโ language_id/ # Language identification
โ โ โโโ __init__.py
โ โ โโโ model.py
โ โ โโโ train.py
โ โโโ acoustic_model/ # Acoustic models
โ โ โโโ __init__.py
โ โ โโโ model.py
โ โ โโโ train.py
โ โ โโโ models/
โ โ โโโ english/
โ โ โโโ hindi/
โ โ โโโ odia/
โ โโโ language_model/ # Language models
โ โ โโโ __init__.py
โ โ โโโ ngram.py
โ โ โโโ models/
โ โ โโโ english/
โ โ โโโ hindi/
โ โ โโโ odia/
โ โโโ decoder/ # Decoding algorithms
โ โ โโโ __init__.py
โ โ โโโ viterbi.py
โ โ โโโ beam_search.py
โ โโโ utils/ # Utility functions
โ โโโ __init__.py
โ โโโ metrics.py
โ โโโ visualization.py
โ
โโโ ๐ models/ # Saved model weights
โ โโโ language_id/
โ โโโ acoustic/
โ โ โโโ english/
โ โ โโโ hindi/
โ โ โโโ odia/
โ โโโ language/
โ โโโ english/
โ โโโ hindi/
โ โโโ odia/
โ
โโโ ๐ notebooks/ # Jupyter notebooks
โ โโโ 01_data_exploration.ipynb
โ โโโ 02_feature_analysis.ipynb
โ โโโ 03_model_evaluation.ipynb
โ
โโโ ๐ tests/ # Unit tests
โ โโโ test_preprocessing.py
โ โโโ test_features.py
โ โโโ test_models.py
โ
โโโ ๐ ui/ # User interface
โ โโโ __init__.py
โ โโโ app.py
โ
โโโ ๐ scripts/ # Utility scripts
โ โโโ download_data.py
โ โโโ prepare_data.py
โ โโโ train_all.py
โ
โโโ ๐ docs/ # Documentation
โโโ problem_statement.md
โโโ system_architecture.md
โโโ dataset_details.md
โโโ feature_extraction.md
โโโ language_identification.md
โโโ acoustic_model.md
โโโ language_model.md
โโโ decoder.md
โโโ evaluation.md
โโโ future_work.md
- Python 3.10 or higher
- pip package manager
- Git
- Clone the repository
git clone https://github.com/yourusername/multilingual-indic-asr.git
cd multilingual-indic-asr- Create virtual environment
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Download & Organize Datasets
- Download datasets manually or using
scripts/download_data.py. - Place them in
data/raw/<language>/. - Run the organization script:
- Download datasets manually or using
python scripts/organize_dataset.py- Prepare data
python scripts/prepare_data.py- Train the models
python scripts/train_all.pypython scripts/train_all.py# Language Identification
python -m src.language_id.train
# Acoustic Models
python -m src.acoustic_model.train --language english
python -m src.acoustic_model.train --language hindi
python -m src.acoustic_model.train --language odia
# Language Models
python -m src.language_model.ngram --language allpython -m src.inference --audio path/to/audio.wavpython -m ui.appfrom src.preprocessing import AudioPreprocessor
from src.features import MFCCExtractor
from src.language_id import LanguageIdentifier
from src.inference import ASRPipeline
# Initialize pipeline
pipeline = ASRPipeline()
# Transcribe audio
result = pipeline.transcribe("audio.wav")
print(f"Detected Language: {result['language']}")
print(f"Transcription: {result['text']}")| Metric | Description | Target |
|---|---|---|
| Word Error Rate (WER) | Measures transcription accuracy | 30-40% |
| Language Detection Accuracy | Correct language identification | 85%+ |
| Inference Latency | Time to process audio | < 2x audio length |
๐ Note: Target accuracy of 60-70% is acceptable for a student-built from-scratch ASR system.
Detailed documentation is available in the /docs folder:
| Document | Description |
|---|---|
| Problem Statement | Problem definition, scope, and constraints |
| System Architecture | Detailed pipeline and data flow |
| Dataset Details | Dataset sources and preprocessing |
| Feature Extraction | MFCC and feature engineering |
| Language Identification | Language detection model |
| Acoustic Model | Speech-to-phoneme modeling |
| Language Model | N-gram language modeling |
| Decoder | Viterbi and beam search |
| Evaluation | Metrics and results |
| Future Work | Planned improvements |
- Deep Understanding: Learn the fundamental principles of speech recognition
- No Black Boxes: Understand every component of the ASR pipeline
- Educational Value: Perfect for academic projects and learning
- Customization: Full control over every aspect of the system
- Indic Language Focus: Specialized for Indian languages
- Digital signal processing for audio
- Feature extraction techniques (MFCC)
- Machine learning for classification
- Sequential modeling with RNNs/LSTMs
- Language modeling with N-grams
- Decoding algorithms (Viterbi, Beam Search)
| Language | WER | Language Detection |
|---|---|---|
| English | ~35% | 90% |
| Hindi | ~45% | 85% |
| Odia | ~50% | 80% |
โ ๏ธ Not production-ready (educational project)โ ๏ธ Lower accuracy than commercial systemsโ ๏ธ Limited vocabulary coverageโ ๏ธ Sensitive to background noiseโ ๏ธ Requires significant training time
- Phase 1: Core pipeline implementation
- Phase 2: Basic model training
- Phase 3: UI development
- Phase 4: Optimization and evaluation
- Phase 5: Real-time microphone support
- Phase 6: Additional language support
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mozilla Common Voice for English and Hindi datasets
- AI4Bharat for Indian language resources
- OpenSLR for Indic speech corpora
- The open-source community
Made with โค๏ธ for Indic Languages