Built to order

Raga Recognition using CNN

A deep-learning project that identifies Hindustani ragas from audio recordings. Thirty-second clips from the open Saraga dataset (CompMusic) are converted to tonic-normalized log-mel spectrograms and chroma features, and a compact 2D CNN learns the characteristic melodic shapes of 10 ragas. A demo app visualizes the chromagram and returns top-5 predictions with confidence bars, while the training notebook logs accuracy, macro-F1 and the full confusion matrix. Suitable for B.E./B.Tech final-year projects in AI/ML, Computer Science and related branches.

Raga Recognition using CNN - project prototype demo screenshot
More project photos (3)

The problem

A raga is far more than a scale: it is a melodic framework defined by characteristic phrases (pakad), ornamentation (meend, gamak) and note hierarchies that even trained listeners take years to internalize. Automating raga identification is a classic music-information-retrieval problem and an excellent deep-learning project, because the signal is genuinely hard — near-neighbour ragas share the same notes and differ only in how they move between them. The open Saraga dataset from the CompMusic project provides annotated Hindustani recordings with raga labels. This project trains a compact 2D CNN on log-mel spectrograms and chroma features to classify 30-second clips into 10 ragas, served through a demo app with confidence-ranked predictions and an honest, fully-logged evaluation.

SYSTEM FLOW

5 components 5 connections

Live flow
Drag to explore
100%
storageSaraga recordings

Open Hindustani recordings split at recording level.

Follow the working sequence

How it works

  1. Saraga Hindustani recordings are segmented into 30-second clips, split at the recording level into train, validation and test sets.
  2. Each clip is converted to a 128-band log-mel spectrogram plus tonic-normalized 12-bin chroma features.
  3. Training clips pass through augmentation (time/frequency masking, ±1 semitone pitch shift) into the 2D CNN with cross-entropy loss.
  4. The network trains for about 40 epochs with Adam, cosine decay and early stopping; every epoch logs accuracy, macro-F1 and loss curves.
  5. At inference the demo app computes the same features for a clip, runs the trained weights and displays top-5 raga probabilities with confidence bars.
  6. The notebook's confusion matrix shows which near-neighbour raga pairs confuse the model, forming the report's error analysis.

Tech stack:

  • Python 3.10, PyTorch (CNN training and inference)
  • librosa (audio loading, mel spectrograms, chroma)
  • scikit-learn (metrics: accuracy, F1, confusion matrix)
  • Matplotlib, Seaborn (training curves, per-class analysis)
  • Saraga Hindustani collection subset (open dataset, CompMusic)
  • Flask / static demo app (prediction interface)
Parameter Value
Dataset Saraga Hindustani collection: 108 recordings, 43.6 hours, 61 unique ragas (CompMusic, open)
Classes 10 ragas with the most recordings (e.g. Yaman, Bhairavi, Malkauns, Bhimpalasi) — a selected subset
Input 30 s clips → 128-band log-mel + tonic-normalized 12-bin chroma
Model 2D CNN (~1.2M params): 3 conv blocks, dilated conv, time-axis pooling, dense-256, softmax-10
Training Adam, lr 3e-4, cosine decay, ~40 epochs, early stopping; SpecAugment-style augmentation
Evaluation Accuracy, macro-F1, per-class precision/recall, confusion matrix — computed by the notebook on held-out recordings
Design target Approximately 80% clip-level accuracy (target, not a measured claim)
Demo Clip selection, chromagram heatmap, top-5 predictions with confidence

Project features

  • [Saraga dataset pipeline] Recording-level train/validation/test splits on a 10-raga subset of the open Saraga Hindustani collection — no clip leakage between splits
  • [Tonic-normalized features] 128-band log-mel spectrograms plus 12-bin chroma, normalized to each recording's annotated tonic (Sa)
  • [Compact 2D CNN] Three convolutional blocks plus dilated conv layers, time-axis pooling and a 10-way softmax — about 1.2M parameters
  • [Audio augmentation] SpecAugment-style time/frequency masking and ±1 semitone pitch shifting during training
  • [Full evaluation logging] Accuracy, macro-F1, per-class precision/recall and confusion matrix computed on held-out recordings
  • [Demo prediction app] Clip selection, chromagram heatmap visualization and top-5 raga predictions with confidence bars
  • [Error analysis] Confusion matrix documenting exactly which raga pairs the model confuses — the honest core of the report
  • [Configurable class set] The 10-raga subset is defined in one place; adding ragas with enough recordings is a documented procedure

What is included

  • Complete source code (preprocessing, training, evaluation, demo app)
  • Jupyter training and evaluation notebook (buyer-run: prepare data, train, evaluate)
  • Trained CNN weights from the reference training run
  • Project report PDF (background, dataset analysis, model design, evaluation, error analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document (CNNs, spectrograms, chroma, augmentation, raga musicology basics)
  • Setup guide (environment, downloading the Saraga subset, training your own run)

Advantages

  • Identifies Hindustani ragas from audio using 30-second clips from the open Saraga dataset, with recording-level train, validation and test splits and no clip leakage between splits.
  • Features are tonic-normalized log-mel spectrograms plus chroma, normalized to each recording's annotated tonic.
  • A compact 2D CNN with three convolutional blocks, dilated conv layers, time-axis pooling and a 10-way softmax learns the melodic shapes of 10 ragas.
  • Training uses audio augmentation including time and frequency masking and pitch shifting, and the notebook logs accuracy, macro-F1, per-class precision and recall and the full confusion matrix.
  • A demo app visualizes the chromagram and returns top-5 predictions with confidence bars, with error analysis documenting exactly which raga pairs the model confuses.

Disadvantages

  • The model classifies only the 10 ragas in the training subset; recordings in other ragas will be forced into one of the 10.
  • Near-neighbour ragas that share note sets and differ only in phrase movement are the expected confusion cases.
  • Performance depends on recording quality: heavy accompaniment, applause or poor microphones shift features away from the training distribution.
  • The Saraga recordings are concert performances, so the model may not transfer to casual humming or harmonium renditions without retraining, and no accuracy is claimed upfront.

Limitations & prerequisites

  • The model classifies only the 10 ragas in the training subset; recordings in other ragas will be forced into one of the 10, and the report states this boundary.
  • Near-neighbour ragas that share note sets (differing only in phrase movement) are the expected confusion cases — the confusion matrix documents them rather than hiding them.
  • Performance depends on recording quality: heavy accompaniment, applause or poor microphones shift features away from the training distribution.
  • The Saraga recordings are concert performances, so a model trained on them may not transfer to casual humming or harmonium renditions without retraining.
  • No accuracy is claimed upfront: every reported number comes from the notebook's evaluation on your held-out recordings during your build.

Frequently Asked Questions

Which dataset is used?

The Saraga Hindustani collection from the CompMusic project (Universitat Pompeu Fabra) — 108 recordings, 43.6 hours, 61 unique ragas, openly licensed for research. The build uses a selected subset of the 10 ragas with the most recordings.

Which model is used?

A compact 2D convolutional neural network (~1.2M parameters) operating on log-mel spectrograms and chroma features: three conv blocks, dilated convolutions, time-axis pooling, a dense layer and a 10-way softmax.

Is the accuracy guaranteed?

No — and any listing that guarantees it is inventing numbers. The design target is approximately 80% clip-level accuracy; the included notebook computes the actual accuracy, macro-F1 and confusion matrix on your held-out recordings, and the report presents your build's measured numbers.

Why chroma features and not just the audio?

Raga identity lives in pitch movement and ornamentation. Tonic-normalized chroma folds every octave into 12 pitch classes relative to the recording's Sa, letting the CNN see melodic shapes independent of the singer's absolute pitch.

Is this project suitable for a final-year project?

Yes — it is listed under AI & Machine Learning and suits AI/ML, Data Science and Computer Science students. It demonstrates audio signal processing, CNN design, augmentation strategy and honest model evaluation.

What will I receive with the project?

Complete source code, the training/evaluation notebook, trained weights, project report PDF, PPT, viva Q&A and the setup guide. Suitable for B.E./B.Tech final-year projects in AI/ML, Data Science, Computer Science and related branches.

Components & software requirements
  • Python 3.10, PyTorch (CNN training and inference)
  • librosa (audio loading, mel spectrograms, chroma)
  • scikit-learn (metrics: accuracy, F1, confusion matrix)
  • Matplotlib, Seaborn (training curves, per-class analysis)
  • Saraga Hindustani collection subset (open dataset, CompMusic)
  • Flask / static demo app (prediction interface)
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 free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Singh & Arora, Explainable Deep Learning Analysis for Raga Identification in Indian Art Music (arXiv:2406.02443)

Get a quotation