Personal ProjectML/AI
Motorcycle Crash Detection System
An edge AI system that detects motorcycle crashes in real-time using IMU sensors and CNN Autoencoder anomaly detection, sending GPS alerts via GSM without cloud dependency.

Motorcycle Crash Detection System - Edge AI Project
Project Overview
Motorcycle Crash Detection is an unsupervised anomaly detection system designed to detect crash events in real-time using inertial sensors (accelerometer and gyroscope). Optimized for edge deployment on Raspberry Pi, the system automatically sends emergency alerts with GPS location via GSM, ensuring rider safety without relying on cloud infrastructure.
Key Features
- Unsupervised Anomaly Detection: CNN Autoencoder trained solely on normal riding data
- Sliding Window Analysis: Temporal analysis with 60-sample windows and 15-sample stride
- Real-Time Inference: Optimized for edge deployment on Raspberry Pi
- Automatic Emergency Alerts: GPS acquisition and SMS transmission via GSM module
- False Positive Reduction: Requires 3 consecutive windows for crash confirmation
- Edge-Based Processing: Fully functional without cloud connectivity, ideal for remote areas
Technical Stack
- Hardware: Raspberry Pi, MPU6050 IMU, GSM/GPS Module (SIM808/SIM760)
- Programming Language: Python
- Deep Learning: TensorFlow CNN Autoencoder
- Sensor Integration: MPU6050 library for I2C communication
- GPS/GSM Communication: NMEA parsing and AT commands for SMS alerts
- Data Processing: NumPy, Pandas, scikit-learn
Technical Implementation
The system workflow:
- Sensor Data Capture → MPU6050 IMU streams accelerometer and gyroscope data to Raspberry Pi
- Sliding Window Buffer → 60-sample windows with 15-sample stride for temporal analysis
- Data Normalization → Standardization of IMU signals
- CNN Autoencoder Inference → Reconstruction error computed for anomaly detection
- Anomaly Confirmation → 3-consecutive-window check reduces false positives
- Emergency Alert → GPS location acquired and SMS sent via GSM module
Training Pipeline:
- Data collection via CARLA simulator with diverse riding behaviors
- Window creation and normalization from normal riding data
- CNN Autoencoder training with encoder-decoder architecture
- Threshold selection using maximum reconstruction error of normal data
Business Impact
- Immediate Emergency Response: Sends alerts instantly with GPS coordinates
- Reduced Accident Response Time: Ensures faster assistance for riders
- Cost-Effective Edge Solution: No recurring cloud fees required
- Unsupervised Learning: Eliminates need for crash data collection
- Enhanced Rider Safety: Reliable real-time crash detection suitable for multiple motorcycle models