Najma Nour
← All articles

Case Study: Classifying Urban Noise with Machine Learning and Deep Learning

Comparing Random Forest, SVM and a lightweight CNN for recognising car horns, jackhammers and sirens — the CNN reached 97.1% accuracy. Published at IEEE Smart Mobility 2026.

  • deep learning
  • cnn
  • audio
  • smart cities
  • ieee
CASE STUDY /Urban noiseclassification.NAJMA NOUR

A noise meter can tell you that a street is loud. It cannot tell you why. This project asks whether a small, efficient model can listen to a short clip and name the source — a car horn, a jackhammer or a siren — so a city can respond to the right problem. I led the work with Maryam Alblooshi and Khalid Elgazzar, and it was published at the 2026 IEEE International Conference on Smart Mobility.

97.1%
CNN test accuracy — best of the three models
3
Models compared: Random Forest, SVM, CNN
210
Balanced audio clips, 70 per class
3
Sound classes: car horn, jackhammer, siren
23
Hand-crafted features for the classical models
128 × 64
Mel-spectrogram input for the CNN

Why classify noise, not just measure it

Long-term exposure to environmental noise is linked by the World Health Organization to heart disease, poor sleep and reduced concentration, and cities like Dubai are growing quickly. Traditional monitoring reports a single loudness level, which mixes every source together. Knowing what is making the noise — traffic, construction or emergency vehicles — is what lets a city target the right fix, and it is the job a network of smart acoustic sensors needs to do automatically.

The data

The study uses UrbanSound8K, a public benchmark of 8,732 labelled clips of up to four seconds across ten everyday city sounds. We picked three sources that are common in traffic and very different acoustically, and took a balanced sample of 70 clips from each so no class could dominate. The small, balanced set deliberately mimics what a low-power street sensor would be trained on. Clips were split 80/20 into training and test sets with a fixed random seed so the results can be reproduced.

The three sound classes

ClassTypical sourceWhat makes it recognisable
Car hornTrafficShort, tonal bursts with strong harmonics
JackhammerConstructionRepetitive impacts spread across a wide band of frequencies
SirenEmergency vehiclesA tone that sweeps up and down in pitch

Two ways to describe a sound

Classical models need a sound turned into a short list of numbers, while a CNN can learn directly from an image of the sound. We built one representation for each.

Input features per model

Random Forest & SVMCNN
Representation23-number feature vectorMel-spectrogram image
Contents20 MFCCs, Chroma, Spectral Centroid, Spectral Rolloff128 mel frequency bands converted to decibels
Size23 values per clip128 × 64 per clip
ScalingStandardised to zero mean, unit varianceNormalised per clip

End-to-end pipeline

One audio clip goes down two paths: hand-crafted features for the classical models, and a mel-spectrogram image for the CNN. All three models are scored the same way.

  1. 1

    Load and trim the audio

    Read each clip with Librosa at its native sample rate and keep a short window; corrupted files are dropped.

  2. 2

    Extract features

    Compute the 23 hand-crafted features for the classical models and the mel-spectrogram for the CNN.

  3. 3

    Train three classifiers

    Random Forest, an RBF-kernel SVM and a lightweight two-block CNN, all with a fixed seed of 42.

  4. 4

    Evaluate on held-out clips

    Compare accuracy, per-class precision, recall and F1, and confusion matrices on clips the models never saw.

  5. 5

    Try it live

    A Gradio demo in the notebook classifies any uploaded .wav file with each of the three models.

Model settings

As described in the paper. The CNN was kept small on purpose so it could run on an edge device.

ModelConfiguration
Random Forest150 trees, max depth 20, min samples split 4
SVMRBF kernel, C = 10, γ = scale
CNN2 conv blocks (16 and 32 filters, 3×3, ReLU, 2×2 max-pool) → 64-unit dense layer, 40% dropout → 3-class softmax; Adam, batch size 32

Results

Test accuracy by model

Accuracy on the held-out test clips, as reported in the paper.

  • CNN97.1
  • Random Forest91.4
  • SVM88.6

Bar length = % accuracy

The CNN came out on top at 97.1%. Learning features directly from the spectrogram captured patterns — such as the sweep of a siren — that a fixed list of averages smooths away. The Random Forest was a strong runner-up at 91.4% with a macro F1 of 0.92, and it is far cheaper to run, which makes it attractive for very constrained hardware. The SVM, at 88.6%, struggled most where classes overlap.

Where the models get it right — and wrong

Confusion matrices from the saved notebook run on the held-out test clips (14 car horn, 8 jackhammer, 13 siren). Hammer = jackhammer.

Random Forest

32 of 35 correct

HornHammerSirenHorn1301Hammer080Siren1111

CNN

34 of 35 correct

HornHammerSirenHorn1400Hammer080Siren0112

Rows = actual class, columns = predicted class. The diagonal holds correct predictions; darker cells hold a larger share of that row. Hover a cell for details.

Per-class scores

Precision, recall and F1 from the same notebook run.

ModelClassPrecisionRecallF1
Random ForestCar horn0.930.930.93
Random ForestJackhammer0.891.000.94
Random ForestSiren0.920.850.88
CNNCar horn1.001.001.00
CNNJackhammer0.891.000.94
CNNSiren1.000.920.96

Limitations

  • The models were trained and tested on a small, balanced subset of three classes, so the results may not carry over to all ten UrbanSound8K classes.
  • A single hold-out split was used instead of the dataset's ten cross-validation folds.
  • No data augmentation was applied, and with so little data the very high CNN accuracy may partly reflect overfitting.

What I learned

A small CNN can beat carefully engineered features even on a tiny dataset — but a strong classical baseline is what makes that result meaningful, and the Random Forest stays a practical choice when every milliwatt counts. The honest next steps are clear: train on all ten classes, use the official cross-validation folds, add augmentation such as time-shifting and background noise, and test the model on a real street-level sensor in Dubai.

Tools

AreaTools
Audio processingLibrosa
Classical modelsscikit-learn (Random Forest, SVM)
Deep learningTensorFlow / Keras
Analysispandas, NumPy, Matplotlib, Seaborn
DemoGradio

Citation

N. Nour, M. Alblooshi and K. Elgazzar, “Urban Noise Monitoring and Classification Using Machine Learning and Deep Learning,” 2026 IEEE International Conference on Smart Mobility (SM), Al Alamein City, Egypt, 2026. DOI: 10.1109/SM69703.2026.11614142.