The problem
Cities are full of sounds that machines should understand: sirens that traffic systems must notice, drilling that noise-monitoring networks must log, horns and alarms that assistive devices must catch. Manual listening does not scale — hours of field recordings cannot be labeled by hand — and simple loudness thresholds cannot tell a siren from a car horn. UrbanSound8K is the standard research dataset for this task: 8,732 labeled excerpts across 10 urban sound classes, sourced from freesound.org, and log-mel spectrogram CNNs are the proven approach, with Salamon & Bello's SB-CNN as the published baseline. Students usually copy a notebook they cannot explain. This project builds the full pipeline in the open: the official 10-fold splits, log-mel feature extraction with delta channels, a 3-block CNN designed for the task, training with augmentation, and evaluation with a confusion matrix and per-class metrics — plus an in-browser demo that computes genuine spectrograms and runs the pipeline end to end. Every design choice is documented, so the student can defend each one in the viva.
8,732 excerpts across 10 classes with official 10-fold train and test splits.
Follow the working sequence
How it works
- UrbanSound8K is obtained through the official release and its 10 fold CSVs define the train/test splits — no random reshuffling, so results are directly comparable with published baselines.
- Each ≤4 s excerpt is resampled to 22.05 kHz, sliced into 3 s windows, and converted to 128-band log-mel spectrograms plus first and second temporal derivatives — 128×128×3 input tensors.
- Training folds are augmented with time stretch (±10%) and pitch shift (±2 semitones) to simulate microphone and distance variation; validation and test folds are never augmented.
- The CNN — Conv(24,5×5)→BN→ReLU→MaxPool(2×2), Conv(48,4×4)→BN→ReLU→MaxPool(2×2), Conv(48,4×4)→BN→ReLU→MaxPool(2×2), Flatten→Dense(64)→Dropout(0.5)→Dense(64)→Dropout(0.5)→Softmax(10) — trains with Adam (learning rate 0.001, batch 128) and categorical cross-entropy, with early stopping on validation loss.
- Each fold is evaluated exactly once on its held-out test fold: accuracy, macro-F1, per-class precision/recall and a confusion matrix; the 10 fold scores are averaged, matching the published evaluation protocol.
- In the demo app, a synthesized clip passes through the same STFT → log-mel front end (drawn live on canvas) and a transparent feature-based classifier, demonstrating the pipeline from waveform to prediction.
Tech stack:
- Python 3, TensorFlow/Keras
- librosa (audio loading, mel spectrograms)
- NumPy, Matplotlib, scikit-learn (metrics)
- Jupyter Notebook (training & evaluation)
- UrbanSound8K dataset (Salamon, Jacoby & Bello)
- HTML5 canvas + JavaScript (pipeline demo)
- Git
Dataset & model details
- Dataset: UrbanSound8K — 8,732 labeled urban-sound excerpts (≤4 s each), 10 classes: air_conditioner (1,000), car_horn (429), children_playing (1,000), dog_bark (1,000), drilling (1,000), engine_idling (1,000), gun_shot (374), jackhammer (1,000), siren (929), street_music (1,000); sourced from freesound.org; released by Salamon, Jacoby & Bello (2014); official 10-fold splits with CSV metadata.
- Task: 10-class audio classification; input = 128×128×3 log-mel tensor (static + Δ + ΔΔ), output = probability distribution over the 10 urban sound classes.
- Model: SB-CNN-style CNN (~550k parameters, design target): Conv2D(24, 5×5) → BN → ReLU → MaxPool(2×2) → Conv2D(48, 4×4) → BN → ReLU → MaxPool(2×2) → Conv2D(48, 4×4) → BN → ReLU → MaxPool(2×2) → Flatten → Dense(64) → Dropout(0.5) → Dense(64) → Dropout(0.5) → Dense(10, softmax).
- Metrics: Mean test accuracy across the 10 folds, macro-F1, per-class precision/recall, confusion matrix. Published SB-CNN baseline ≈74–79% mean accuracy (Salamon & Bello, 2017); design target for the built-to-order training run: ≥75% mean test accuracy. No accuracy is claimed as measured until the training run is executed for the order.
| Parameter | Value |
|---|---|
| Input audio | ≤4 s excerpts, resampled 22.05 kHz (expected) |
| Feature tensor | 128 × 128 × 3 log-mel (static + Δ + ΔΔ) |
| Classes | 10 urban sound classes |
| Model parameters | Approximately 550,000 (design target) |
| Training protocol | 10 official folds, ~100 epochs with early stopping (expected) |
| Test accuracy | ≥75% fold-mean (design target, not a measured claim) |
| Training time | Approximately 2–4 h on a mid-range GPU per full 10-fold run (expected) |
| Inference | Approximately 15 ms per 3 s window on CPU (expected) |
| Demo | Single-file web app, runs offline after download |
Project features
- [UrbanSound8K data pipeline] Official 10-fold splits from the dataset's CSV metadata — 8,732 excerpts, 10 classes — sliced into 3-second windows and converted to 128-band log-mel spectrograms with delta and delta-delta channels as the CNN input.
- [3-block CNN design] Conv(24, 5×5) → Conv(48, 4×4) → Conv(48, 4×4), each with batch normalization, ReLU and 2×2 max-pooling, then two Dense(64) layers with 0.5 dropout and a 10-way softmax — after Salamon & Bello's published SB-CNN, with every choice documented.
- [Training with augmentation] Time-stretch and pitch-shift augmentation on training folds only, Adam optimizer, categorical cross-entropy, and early stopping on validation loss across the 10 folds.
- [Full evaluation kit] Accuracy, macro-F1, per-class precision/recall and a confusion matrix computed per fold and averaged, saved as plots and tables ready for the report.
- [In-browser pipeline demo] A single-file web app that synthesizes a representative clip per class, computes a genuine STFT → 64-band log-mel spectrogram live on canvas, extracts spectral features and runs a transparent template classifier — the same front end the CNN trains on.
- [Class-by-class error analysis] The report documents the known hard pairs (engine_idling vs air_conditioner, children_playing vs street_music) with spectrogram examples from the confusion matrix.
- [Complete viva kit] Report PDF, PPT and Q&A covering the mel scale, convolution over spectrograms, the 10-fold protocol, augmentation and dropout — the questions examiners actually ask.
What is included
- Complete training & evaluation Jupyter notebook (official 10-fold protocol)
- Trained CNN weights (.h5) with the exact preprocessing code
- Log-mel front-end module (librosa) with time-stretch/pitch-shift augmentation utilities
- Evaluation plots: accuracy/loss curves, confusion matrix, per-class metrics table
- In-browser pipeline demo (live spectrogram visualizer + transparent classifier)
- Project report PDF (background, mel/CNN theory, architecture rationale, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (mel scale, convolutions on spectrograms, folds, augmentation, dropout)
Limitations & prerequisites
- Trained only on UrbanSound8K's ≤4 s excerpts — long recordings need a windowing + frame-voting stage, documented as an extension, not included as shipped.
- Similar classes confuse the model by design: engine_idling vs air_conditioner and children_playing vs street_music are the known hard pairs, shown explicitly in the confusion matrix.
- The dataset's real-world recording conditions vary widely; accuracy on a student's own phone recordings is expected to differ and should be measured with the included evaluation procedure.
- ≥75% is a design target for the training run, stated honestly — the report documents the actual achieved fold scores after training.
- Gun shot (374 clips) and car horn (429 clips) are smaller than the other classes; imbalance is handled with stratified folds, but these classes get fewer examples per fold.
- The in-browser demo uses synthesized clips and a transparent template classifier, not the trained CNN — it demonstrates the pipeline, not the model's accuracy.
Frequently Asked Questions
Which dataset is used and what does it contain?
UrbanSound8K — 8,732 labeled excerpts up to 4 seconds long, across 10 urban sound classes: air conditioner, car horn, children playing, dog bark, drilling, engine idling, gun shot, jackhammer, siren and street music. The clips come from freesound.org and were released by Salamon, Jacoby and Bello in 2014, with official 10-fold splits and CSV metadata so training follows the published protocol.
Which model is used?
A 3-block CNN after Salamon & Bello's published SB-CNN: Conv(24, 5×5), Conv(48, 4×4) and Conv(48, 4×4) with batch normalization, ReLU and 2×2 max-pooling, then two Dense(64) layers with 0.5 dropout and a 10-way softmax. The input is a 128×128×3 log-mel tensor (static, delta, delta-delta), and the report explains each architectural choice for the viva.
Is the accuracy guaranteed?
No — and no listing should promise it. The published SB-CNN baseline reaches roughly 74–79% mean accuracy across the 10 folds, and the design target for the built-to-order training run is ≥75% fold-mean accuracy. The delivered report documents the actual achieved scores, confusion matrix and per-class metrics from the real training run.
What does the web demo actually do?
It is a single-file HTML app that synthesizes a representative clip for each of the 10 classes, computes a genuine STFT and 64-band log-mel spectrogram live on canvas, extracts spectral features and runs a transparent template classifier. It demonstrates the signal-processing pipeline honestly — it does not run the trained CNN and makes no accuracy claim.
Can it classify live microphone audio?
As shipped, the pipeline handles recorded excerpts; live microphone input needs a windowing and frame-voting stage around the trained model. That extension is documented in the report's future scope and can be developed as a customization for the order. The demo’s honest template classifier is replaced by the real CNN in that extension.
Is this project suitable for a final-year project?
Yes — for Computer Science, IT and AI & Machine Learning programs. It demonstrates audio signal processing (STFT, the mel scale), CNN design for non-image data, the 10-fold evaluation protocol, augmentation, and honest error analysis, with a working pipeline demo to show. The documented design decisions make viva questions straightforward to answer. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.
Components & software requirements
- Python 3, TensorFlow/Keras
- librosa (audio loading, mel spectrograms)
- NumPy, Matplotlib, scikit-learn (metrics)
- Jupyter Notebook (training & evaluation)
- UrbanSound8K dataset (Salamon, Jacoby & Bello)
- HTML5 canvas + JavaScript (pipeline demo)
- Git
Dataset & model details
- Dataset: UrbanSound8K — 8,732 labeled urban-sound excerpts (≤4 s each), 10 classes: air_conditioner (1,000), car_horn (429), children_playing (1,000), dog_bark (1,000), drilling (1,000), engine_idling (1,000), gun_shot (374), jackhammer (1,000), siren (929), street_music (1,000); sourced from freesound.org; released by Salamon, Jacoby & Bello (2014); official 10-fold splits with CSV metadata.
- Task: 10-class audio classification; input = 128×128×3 log-mel tensor (static + Δ + ΔΔ), output = probability distribution over the 10 urban sound classes.
- Model: SB-CNN-style CNN (~550k parameters, design target): Conv2D(24, 5×5) → BN → ReLU → MaxPool(2×2) → Conv2D(48, 4×4) → BN → ReLU → MaxPool(2×2) → Conv2D(48, 4×4) → BN → ReLU → MaxPool(2×2) → Flatten → Dense(64) → Dropout(0.5) → Dense(64) → Dropout(0.5) → Dense(10, softmax).
- Metrics: Mean test accuracy across the 10 folds, macro-F1, per-class precision/recall, confusion matrix. Published SB-CNN baseline ≈74–79% mean accuracy (Salamon & Bello, 2017); design target for the built-to-order training run: ≥75% mean test accuracy. No accuracy is claimed as measured until the training 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 free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.