s vehicle 0.91 pedestrian 0.87 bicycle 0.79 sign 0.83 ● REC 00:04:32 CAM: FRONT 30fps EECS 351 CAM SPEED: 42 mph GPS: 42.2830° N, -83.7350° W NORTH
Umich  ·  March 2026  ·  EECS 351

Road Object
Classification

Baseline ML classifiers on dashcam footage — KNN, Naive Bayes, SVM, and Decision Tree tested across 2, 3, and 5+ object classes in MATLAB.

KNN Naive Bayes SVM Decision Tree MATLAB
↓ Read Report
Scroll to explore
Project Overview

Roadside Object Classification

A compact summary of the project goal, classifier comparison, main result, and why the result matters for real-world driving image data.

Goal

Classify roadside objects from dashcam-style images using MATLAB image preprocessing and baseline machine-learning classifiers.

Compared

KNN, Naive Bayes, SVM, and Decision Tree models were trained and tested on labeled road-object image datasets.

Main Result

SVM performed best on the refined real-world dataset, reaching about 91.4% accuracy on the car, pedestrian, and sign run.

Why It Matters

The results show how dataset quality, class balance, and feature choices can change classifier performance as much as the model itself.

01 — Introduction

PIPELINE

This report describes the results of running four MATLAB classifiers on labeled dashcam image datasets, evaluating differences in computation speed and accuracy: K Nearest Neighbors (KNN), Naive Bayes, Support Vector Machine (SVM), and Decision Tree.

All images were resized to a common resolution and converted into fixed-length grayscale pixel feature vectors. Datasets were balanced at 50 images per class for initial experiments.

4
Classifiers
6
Object Classes
1100+
Personally Taken Images (for dataset)
Road Object Classification Pipeline
Road Object Classification Pipeline.jpg
Methods

What We Did

Our project followed a full road-object image classification pipeline, which we later repeated after improving the realism and quality of the dataset. We began by gathering labeled object images and organizing them by class. Each image was resized to a common resolution and preprocessed through steps such as grayscale conversion, normalization, and data cleaning to make the inputs more consistent. We then compared multiple feature representations, including raw pixel values, edge-based features, frequency-domain features derived from the discrete Fourier transform, and color-based features. Using these representations, we trained and evaluated four MATLAB classifiers: KNN, Naive Bayes, SVM, and Decision Tree. Model performance was measured using confusion matrices, accuracy comparisons, and analysis across both balanced and refined real-world datasets. After finding that the original dataset contained unrealistic and suboptimal images, we replaced many of those examples with more representative dashcam-style objects and reran the classification pipeline to observe how dataset realism changed the results.

  1. Collected and curated labeled image datasets for roadside objects.
  2. Removed poor, unrealistic, staged, or badly cropped images.
  3. Resized images and converted them to grayscale as signal preparation.
  4. Extracted raw-pixel, edge, DFT, color, and learned-style features.
  5. Trained four MATLAB classifiers: KNN, Naive Bayes, SVM, and Decision Tree.
  6. Evaluated each model with confusion matrices and accuracy scores.
  7. Reran the classifiers on improved real-world dashcam data.
Example preprocessing output showing image preparation steps
images/preprocessed_example.pngExample output from the preprocessing pipeline
Example preprocessing output from the MATLAB pipeline, showing how an image is prepared before feature extraction.
DSP Tools Used

Signal Processing in the Pipeline

The image data was treated as a 2D signal: first prepared into a consistent form, then transformed into features that classifiers could compare.

2D Convolution / FIR Filtering

Sobel-style edge filters were used to emphasize object boundaries and local intensity changes before classification.

Image Preprocessing

Grayscale conversion and resizing standardized each image so every sample became a comparable fixed-length signal.

2D DFT / FFT Features

Frequency-domain features summarized how image energy was distributed across low, middle, and high spatial frequencies.

Outside Tools

HOG and CNN-style features were considered as stronger learned or shape-aware feature options beyond the core DSP tools.

Feature comparison chart for raw, edge, DFT, and combined features
images/feature_comparison_chart.pngRaw vs edge vs DFT vs edge + DFT + color, grouped by classifier
Feature comparison chart showing how different feature sets affect classifier accuracy.
CNN accuracy and confusion matrix comparison
images/cnn_comparison.png if CNN is included: CNN accuracy alongside classical models and/or CNN confusion matrix
CNN comparison figure for showing learned-feature performance against the classical models.
Feature Extraction

From Images to Numbers

Each classifier needs a numerical feature vector, so the images were transformed into several representations before training.

Raw Pixels

Flattened grayscale image values provide a simple baseline representation.

Edge Features

Filtered edge magnitude and direction summarize object outlines.

DFT Features

FFT band-energy values describe frequency content in the image.

Color Histograms

RGB histograms capture broad color distribution for traffic signs, cars, and pedestrians.

HOG / CNN

outside features can capture shape patterns or learned visual structure better than raw pixels alone.

02 — Datasets

What We
Classified

Initially, we struggled finidng good datasets with cropped dash-cam images of the classes we desired. So we used some suboptimal datasets while we procured and produced our own dataset.
We used labeled datasets from Kaggle and dashcam-related sources. Initial experiments balanced all classes at 50 images each. Later runs used unbalanced real-world proportions (e.g. 414 cars, 234 pedestrians, 3029 signs) to better reflect deployment conditions.

To improve realism, we moved away from an older car dataset after finding many images that were not representative of dashcam footage. It contained luxury vehicles (e.g., Rolls-Royces), heavily edited promotional images, text overlays, and staged settings. Using such images risks teaching the model non-generalizable patterns that would hurt roadside detection in practice. BadCar(43).jpg is an example of an image that triggered this refinement.

We created part of our own dataset by cropping objects from authentic dashcam footage, improving perspective, lighting, motion blur, and framing consistency. However, this custom set has limitations: many clips were sourced from Russia and fewer from the United States, Canada, and China. Pedestrian data may underrepresent demographic, clothing, and environment diversity in North America, which could produce uneven model performance across groups and regions. pedestrian46.jpg exemplifies this limitation. Expanding to broader demographic and geographic data is an important next step.

All images were in JPG format for their smaller file size and prevalence in real dashcam footage.

  • Bicycle — Kaggle balanced subset
  • Motorcycle — Kaggle balanced subset
  • Vehicle / Car — 414 images (unbalanced run)
  • Pedestrian — 234 images (unbalanced run)
  • Traffic Sign — 3,029 images (unbalanced run)
  • Traffic Light — Kaggle balanced subset
OBJECT CLASSES · BALANCED: 50 EACH 🚲 Bicycle 50 imgs 🏍️ Motorcycle 50 imgs 🚗 Vehicle 414 imgs* 🚶 Pedestrian 234 imgs* 🚦 Traffic Light 50 imgs 🪧 Traffic Sign 3029 imgs* ⚠ *Unbalanced counts from the newer expanded run (car:414, pedestrian:234, sign:3029) — Train:2942, Test:735
BadCar(43)
✗ BadCar(43).jpg
Luxury vehicle, edited, staged — not representative of real dashcam
car116
✓ car116.jpg
Ideal: fully in frame, unobstructed, directly in front
car113
car113.jpg
Extreme upclose view, person slightly obstructing
car39
car39.jpg
Distant view, partially obscured by pedestrian
pedestrian46
pedestrian46.jpg
Class count bar chart for the expanded real-world run
images/expanded_class_counts.pngBar chart: car 414, pedestrian 234, sign 3029
Class count figure emphasizing the imbalance in the expanded real-world dataset.
03 — Results

Balanced Dataset
Results

Actual MATLAB output charts from the 2-class and 3-class balanced runs (50 images per class). Accuracy decreases as more classes are added. Must disclaim that we initally used suboptimal datasets which included images that weren't fully cropped nor sourced from dashcam footage.

2-Class Run

Bicycle vs. Vehicle

Train: 80 images  |  Test: 20 images

65%
KNN
55%
Naive Bayes
55%
SVM
65%
Decision Tree
2-class MATLAB bar chart
2ClassComp.png
3-Class Run

Bicycle, Motorcycle, Vehicle

Train: 120 images  |  Test: 30 images

36.7%
KNN
50%
Naive Bayes
★ best
40%
SVM
36.7%
Dec. Tree
Full MATLAB output for the 3-class run
3Class.png
3-class MATLAB bar chart
MATLAB output — 3-class accuracy comparison
Balanced 2-class classifier comparison bar chart
images/balanced_2class_bar.png2-class bar chart comparing KNN, Naive Bayes, SVM, and Decision Tree
Balanced dataset classifier comparison for the 2-class run.
Balanced 3-class classifier comparison bar chart
images/balanced_3class_bar.png3-class bar chart comparing KNN, Naive Bayes, SVM, and Decision Tree
Balanced dataset classifier comparison for the 3-class run.
Accuracy across 2-class, 3-class, and refined real-world runs
images/accuracy_across_runs.pngLine or grouped bar chart: 2-class vs 3-class vs refined real-world run
Interpretive accuracy trend showing how results changed across dataset versions.
04 — Expanded Run with Refined Dataset

Real-World Dataset
Results

A new run with refined, unbalanced, real-world class proportions: 3 classes (car, pedestrian, sign) with over 700 screenshots taken by us from real dashcam footage.
— Car: 414, Pedestrian: 234, Sign: 3,029. Training set: 2,942 · Test set: 735.

MATLAB terminal output 3-class
Full MATLAB session — confusion matrices for all 4 classifiers on the expanded 3-class run
Updated Accuracy

Car · Pedestrian · Sign

With a larger, refined, and unbalanced dataset that accurately reflects realworld data. Most classifiers perform dramatically better — especially SVM, which achieves over 91% accuracy. However, Naive Bayes performed significantly worse than any other classifier which revealed a fundamental flaw. That the Naive Bayes classifier will assign a prior probability based on how often a class appears in training sets.

89.1%
KNN
51.4%
Naive Bayes
91.4%
SVM
★ best
87.2%
Dec. Tree

Important caveat: Signs dominate at 3,029 images. High accuracy may reflect class imbalance rather than true model strength. Naive Bayes drops to 51% — it struggles with imbalanced distributions.

SVM confusion matrix for the refined real-world run
images/refined_svm_confusion_matrix.pngHigh-priority confusion matrix for the best refined-run classifier
SVM confusion matrix for the refined real-world car, pedestrian, and sign dataset.
All four refined-run confusion matrices side by side
images/refined_all_confusion_matrices.png side-by-side grid: KNN, Naive Bayes, SVM, Decision Tree
all-model confusion matrix figure for comparing refined-run error patterns.
🏆
Key Finding — Expanded Run, Refined Dataset

SVM is the clear winner at 91.43%, consistent with literature suggesting SVM handles high-dimensional pixel features well. The jump from 55% → 91% from balanced-50 to the real dataset underscores how data volume dramatically impacts baseline classifiers. Naive Bayes remains the weakest, sensitive to class imbalance.

Why Naive Bayes Struggled
Naive Bayes failure figure or annotated confusion matrix
images/naive_bayes_failure.pngZoomed confusion matrix or annotation explaining sign prior / class imbalance
Naive Bayes failure figure highlighting how class imbalance and pixel independence hurt performance.
05 — Survey Paper

Turay and Vladimirova's Paper on
Image Classification

Turay, T. & Vladimirova, T. "Toward performing image classification and object detection with CNNs in autonomous driving systems: A survey." IEEE Access, vol. 10, pp. 14076–14119, 2022.

  • Design for real conditions — High benchmark accuracy alone isn't enough; models must handle real driving scenarios.
  • Speed vs. precision tradeoff — Lightweight models can outperform larger ones in real-time deployment.
  • Varied conditions matter — Training must account for weather and lighting. We assumed good conditions as a simplification.
Future Directions
  • → CNN-based models for learned feature extraction
  • → Lightweight real-time models for road deployment
  • → Video-based classification pipelines
  • → Balanced, expanded datasets with 1000+ per class
  • → Semi-trucks, emergency vehicles, road obstacles
ACCURACY TREND — ALL RUNS 0% 25% 50% 75% 100% 2-class 3-class expanded ★ 91% KNN Naive Bayes SVM ★ Dec. Tree
Reflection

Strengths, Weaknesses,
Improvements

Strengths
  • Clear baseline comparison across four classifiers.
  • Improved results after using a better real-world dataset.
  • Strong interpretation of SVM performance versus Naive Bayes.
Weaknesses
  • Class imbalance, especially the large number of sign images.
  • Early datasets included poor-quality or unrealistic images.
  • The project performs classification, not full object detection.
Improvements
  • Collect more balanced data across all classes.
  • Add more object classes and driving conditions.
  • Use CNNs or stronger learned features.
  • Extend to full-frame detection or video later.
Code / Reproducibility

Run the Demo

The main script is run_demo.m. It loads the included sample dataset, preprocesses each image, extracts selected features, trains the four classifiers, and displays confusion matrices plus an accuracy comparison chart.

A small sample dataset is included in dataset_sample/ so the demo can run from the project zip. The full development dataset and MATLAB project files are hosted separately in the Google Drive file Road_Object_Classification.zip.

Project Files

The website summarizes the project story and results, while the MATLAB files provide the reproducible classifier pipeline used for the sample run.

06 — Team

Group Members

Submitted March 22, 2026 · Umich

LO
Lucas Orlebeke

Helped source and clean datasets, compare classifier results, and interpret the improved real-world run.

JP
Joshua Peterson

Worked on MATLAB classifier coding, confusion-matrix evaluation, and result analysis across model runs.

PF
Pok Wai Fong

Contributed to dataset review, report writing, and the paper summary connecting the work to autonomous-driving literature.

HT
Hoa Tran

Built and refined the website design, organized the visual results, and connected the code outputs to the web report.

BY
Boyu Jin

Supported feature-extraction experiments, dataset preparation, and analysis of strengths, weaknesses, and future improvements.

07 — References

Datasets & Citations

  1. Vehicles — Kaggle: vehicle-classification
  2. Traffic Lights — Kaggle: traffic-light-detection-dataset
  3. Traffic Lights (2) — Kaggle: traffic-light-detection-image-set
  4. Pedestrians / Cars — Kaggle: dashcam-pedestrianlocate
  5. Traffic Signs — Kaggle: traffic-signs
  6. Road Obstacles — EPFL CVLab Road Anomaly
  7. Turay, T. & Vladimirova, T. — IEEE Access, vol. 10, pp. 14076–14119, 2022.