Obsidia Driving Event Detector
IMU-based driving event detection with matched filtering
A system for detecting driving events (hard acceleration, braking, swerving) from a vehicle-mounted IMU sensor, developed at Obsidia.ai. A Raspberry Pi reads accelerometer and gyroscope data at 833 Hz from an ISM330DHCX sensor, and either records it for offline analysis or runs real-time detection with alerts displayed on a phone via a web dashboard.
Two detection methods are implemented: matched filtering (designed in MATLAB, executed in Cython) and a simpler threshold-with-hysteresis approach in Python. Ground truth events are annotated during recording via keyboard input.
Developed January to March 2023.
Detection Methods
Matched filtering — Four filter kernels (designed in MATLAB, stored as .mat files) detect specific maneuver signatures: acceleration, braking, swerve left, and swerve right. The filters are cross-correlated with the accelerometer buffer in a Cython-optimized loop, with a detection firing when the output crosses its threshold.
Threshold method — A simpler approach where an event is detected when acceleration exceeds a threshold for at least 100 ms, with hysteresis to prevent chatter at the threshold boundary.
System
- Data acquisition — ISM330DHCX 6-axis IMU connected to Raspberry Pi via I2C at 833 Hz, with an RGB LED for status feedback
- Real-time detection — streams IMU data into overlapping buffers, applies matched filters via Cython, and sends detection alerts to the web dashboard every 200 ms
- Web dashboard — serves live accelerometer and gyroscope bar graphs plus an alert banner (green “Normal Driving” or red with event type) to a phone connected to the Pi’s WiFi access point
- Recording and annotation — records raw IMU data to CSV while an operator marks ground truth events via keyboard, for offline evaluation