Inspiration

Driving to school, your job, even to Hack the North you definitely have encountered potholes, sewer covers or any type of road abnormality. We grew tired of this, these are not only uncomfortable to drive over, but they also damage your rims and tires leaving you with unwanted expenses.

Facing these problems on a daily basis we knew we had to take action. Unfortunately, relying on the government to patch up potholes is insufficient as cracks and potholes can take weeks, even months to be resolved and inevitably return to the very same spot due to the structure of the ground and environment.

So instead of gambling on there not being a pothole on your drive why not just avoid as many as you can? Introducing Save Your Rims

What it does

Save Your Rims provides routes that contain the least amount of defects while still keeping ETA and travelling efficiency in mind, getting you from point A to B safe and fast.

But how does it know where the defects are?

With users reporting and in app video detection, defects are taken into account 24/7 anywhere a Save Your Rims user is.

Taking user experience into account there is a slider so YOU can decide how much potholes matter. With ranges from fastest to avoid all Save Your Rims is meant for drivers of all categories.

How we built it

Mobile app (React Native / Expo)

  1. Read raw accelerometer and gyroscope data at 100Hz alongside GPS.
  2. Run it through a JS port of the VQF sensor-fusion filter (validated against the upstream C++ reference) to convert phone-frame motion into stabilized vehicle-frame acceleration.
  3. Support parked-tilt calibration so the mount angle doesn't have to be perfect, plus a live tilt monitor that warns/vibrates if the mount slips mid-drive.
  4. For demo capture: a road-alignment screen guides mounting with a live camera preview, horizon line, and crosshair overlay.
  5. Stream both IMU data and camera frames over WebSockets to the backend in real time, auto-throttled and paused if tilt exceeds a safe threshold.
  6. Full record/export mode saves raw + stabilized IMU/GPS and a synced demo video locally.

Pothole detection model

  1. Feed each incoming window of acceleration (X/Y/Z) + speed into a four-member ensemble of neural encoders (per-window instance normalization plus a statistics branch) -- no gyro or camera needed at inference time.
  2. Predict both road roughness (IRI-style) and localized disturbances per window.
  3. Run overlap consensus across windows for live inference.
  4. Smooth results with a fixed Kalman filter with onset/offset hysteresis, so a single noisy spike doesn't false-fire and a real pothole doesn't get missed at a window boundary.
  5. Validate offline against recorded drives via a CSV inference path and a replay viewer.
  6. Also trained an experimental ordinal roughness variant on PVS road-quality data.

Route planning

  1. Pull the live road graph for any city from OpenStreetMap's Overpass API (with IPv4 forcing, mirror fallback, retries, and grid-based caching to work around Overpass's flaky connectivity).
  2. Rank multiple candidate routes using a user-controlled pothole-avoidance weight, so you can trade "shortest" against "smoothest" continuously.
  3. Support address autocomplete for origin/destination entry.
  4. Turn the winning route into real turn-by-turn navigation with live notifications as you drive.

Backend & cross-device alerts

  1. Expose the pothole/route APIs and live WebSocket streams through a FastAPI server.
  2. Store detected potholes in TigerDB (severity, confidence, hit count, detected-by-vision vs. detected-by-IMU, per-device).
  3. Given a device's live GPS position, find nearby active potholes in TigerDB and work out which are close/relevant enough to warn about.
  4. Let a pothole one car detects warn the next car approaching the same spot.

Web viewer

  1. Render a browser-based map view of detected potholes, extended with its own route-finder panel mirroring the mobile app's routing UI.
  2. Support replaying uploaded drive recordings against the model.
  3. Visualize what the ensemble predicted over time, for debugging the model without needing a phone in a car.

Extra Features

  1. Added ElevenLabs for spoken turn-by-turn directions, so drivers get voice guidance and pothole warnings without looking at the screen — important when the whole point is keeping eyes on the road.

Challenges we ran into

  • A difficult thing was having a map route return in a swiftly manner. We found that having routes from point A to B took several minutes. We solved this by measuring each step. We cached map data and parallelized address lookups.
  • Training the computer vision model and collecting all the data was very time constraining. However, we managed by designating specific tasks and staying persistent.

Accomplishments that we're proud of

We are proud of integrating so many different pieces of our solution (ML pothole detection, user app, accelerometer, gps etc.) and connecting it to one another so well We built a PatchTST-style transformer that reads 100 Hz accelerometer, gyroscope, and speed data in short windows to detect road events Combining multiple datasets helped improve the overall model

What we learned

This was our first time training a model on Baseten, and we learned a lot along the way. IMU data turned out to be extremely sensitive: small differences in how a phone is mounted or sampled change everything downstream. We found that combining multiple real datasets improved the model more than we expected, and that even small datasets helped when the data was clean. On the infrastructure side, we learned that any cloud service needs far more configuration and fallback handling than you'd expect, and we registered our first domain along the way.

What's next for Save My Rims

  1. Integrate “Save My Rims” to Apple CarPlay & Android Auto allowing users to have the app on the car screen
  2. Use a car dashcam instead of an iphone to upload data & record
  3. Collect and train more data from users around the world as well diversifying our cars in order to have more accurate and reliable defect detection

Built With

Share this project:

Updates

Submission history