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 (2)

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.

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)

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 abstract (PDF)

Related guides

All guides
Blueprint-style technical illustration of multiple decision trees voting together into one final predictionStudents with basic Python and pandas skills who want a reliable first classifier for ML coursework and tabular data projects.

Random Forests Explained: Why Decision Trees Vote Better Together

Decision trees are readable but overfit; random forests fix this by training hundreds of varied trees on bootstrapped data with random feature subsets, then letting them vote. This guide explains Gini impurity, bagging, out-of-bag validation and the four hyperparameters that matter, with a complete scikit-learn workflow, honest feature-importance practices, and the mistakes students keep making.

Read guide
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
Get a quotation