Inspiration
Neither new nor experienced runners have an easy way to analyze their running form to ensure safety. This application aims to address this problem by providing runners with a viable way to learn how to improve their form to prevent injury and plan a safe route.
What it does
SafeStride AI is an advanced, intelligent, computer vision–powered web platform built to enhance outdoor running safety through real-time environmental analysis. It dynamically detects high-traffic roads, poorly lit streets, isolated areas, and high-risk zones, using deep learning and geospatial data to generate proactive, data-driven safety alerts. The application analyzes various running health metrics to assign an overall health score to the runner and adjust the dynamic health ranges they should work towards based on their physical characteristics, experience, and preferences.
How we built it
As part of our biomechanical analysis pipeline, we developed a backend system using Python and Flask. For tracking video segments and overlays, we used OpenCV. We also incorporated MediaPipe's Pose Landmarker, which has high-accuracy tracking for 33 points.
To create our own custom analytics engine, we used the NumPy library. To extract useful information, we used the engine to perform real-time vector math on the video. We did this using the dot product and the arctangent to compute metrics for stride angle, knee flexion, and pelvic drop, along with others.
Using the Gemini 2.0 Flash API, we were able to introduce personalization to the system. Instead of using fixed guidelines, our system customizes the "Red Flag" safety ranges. The system configures the data to include user variables (BMI, injury history, and surface preference). Our proprietary health scoring algorithm uses logarithmic and exponential decay functions to weigh deviation based on injury risk.
Using React and TypeScript, we developed the front end, resulting in a responsive dashboard that displays these metrics through interactive graphs and real-time video.
Challenges we ran into
One of the major challenges was developing a weighting system for each metric to assign an overall health score to the run. Each metric was tied to others in diverse ways, and a parameter impacted more than one metric. Framing the challenge as a multivariate optimization problem accurately determined which parameters affected which metrics most, allowing assignment from highest to lowest effect. Deviations were scored using a tiered penalty curve and concepts from Fourier analysis. Using a weighted average, an overall health score was assigned.
Accomplishments that we're proud of
We were able to calculate a wide assortment of metrics using just the x and y coordinates in an image. Using statistical methods and linear algebra, we were able to extrapolate data points like distance, pace, ground collision time, foot strike, and more. Using real-time geospatial data, we also recommended the best routes for runners based on distance and location.
What We Learned
Live tracking, pose estimation, cost estimation, loss functions, object detection, interactive UI
What's next for SafeStride AI
Biometric Syncing: Integrating real-time heart rate and HRV data to detect fatigue-induced form breakdown.
Micro-Hazard Detection: Using advanced computer vision to identify tripping hazards like uneven pavement and potholes.
Audio Coaching: Converting our text-based gait corrections into immediate audio cues for safer, heads-up running.
Log in or sign up for Devpost to join the conversation.