brand banner

DriveSafe: Video Classification Notes

Early DriveSafe notes on driving behavior classification, training data, model evaluation, and ways to incorporate temporal information from video.

Updated · 1 min read · #project · #computer-vision · #machine-learning

DriveSafe: Video Classification Notes

Early DriveSafe notes on driving behavior classification, training data, model evaluation, and ways to incorporate temporal information from video.

https://pyimagesearch.com/2019/07/15/video-classification-with-keras-and-deep-learning

Features

Lane weaving

[lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua]

Collisions

[lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua]

Tailgating

[lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua]

Training Data

700 samples just like pyimagesearch’s example

Fixes

lr is named learning_rate instead

.h5 file name

https://stackoverflow.com/questions/61742556/valueerror-shapes-none-1-and-none-2-are-incompatible

Biases

Blur out damage counter during input

Training Time

Training time on M2 Pro 25 vs 50 epochs

Outcome

Show timelapse of safe driving vs risky driving

Improvements

Temporal information

RNN, LTSM, GRU, 3D CNN, 3D ResNet, 3D ResNet + LSTM, 3D ResNet + GRU, 3D ResNet + LTSM

              precision    recall  f1-score   support

       risky       1.00      0.40      0.57       347
        safe       0.00      0.00      0.00         0

    accuracy                           0.40       347

macro avg 0.50 0.20 0.28 347
weighted avg 1.00 0.40 0.57 347

TODO

Todo for website: sep coop from ec

  • Idea: Show cumulative scores as the video plays. (safe vs risky scores increasing side by side)

  • DriveSafe AI (76%) — Driver risk assessment from dashcam footage, using a ResNet50 + LSTM model to classify driving as safe, collision, tailgating, or weaving.
  • Handwired: Programs as Neural Networks (38%) — How Handwired replaces control flow with numeric data flow, and what that does—and does not—make possible.
  • Maximum Likelihood and Cross-Entropy (37%) — A mathematical textbook connecting likelihood, entropy, KL divergence, statistical estimation, and probabilistic machine learning, with worked examples and solved exercises.
  • Bayesian Inference: Alice’s Coin, Likelihood, MLE, and MAP (34%) — One hidden coin connects conditional independence, Bayesian updating, prediction, Naive Bayes, and maximum-likelihood estimation.
  • The Kernel Trick (SVM) (33%) — Understanding the kernel trick in SVMs, focusing on the roles of alpha and the inference formula.
  • Superliminal in Three.js (33%) — Recreation of the 'Superliminal' game's 'Forced Perspective' effect using Three.js. Used Raycaster, Quaternion Rotations, Bounding Boxes, and Linear Transformations.
  • Data Augmentation for Bias Term (30%) — Adding a constant feature folds the intercept into linear regression’s weight vector without conflating it with statistical bias.
  • AirBoard (28%) — AirBoard is a portable digital whiteboard system engineered to allow teachers to make handwritten annotations on any flat surface using infrared diodes (~940nm), optical sensors, Computer Vision, and perspective transform.

© 2026 James Yap

Personal Website and Knowledge Base