Inspiration

On November 18, 2026, a record-breaking storm hit San Francisco. Water poured up out of storm drains in the Mission, streets flooded across the city, and 311 logged 837 flood reports in two days. The city has about 25,000 storm drains and asks crews and volunteers to keep them clear, but nobody can check them all before the next storm. We wanted to answer one question: using only data from before a storm, can we tell crews which drains to check first?

What it does

DrainGuard ranks San Francisco's storm drains by how likely they are to need checking before a storm. The Command Center shows a live storm banner built from the National Weather Service forecast, an urgency-ranked list of drains (Urgent, High, Watch), and a map with neighborhood outlines and topographic views. In Volunteer mode, neighbors see the priority drains closest to them and report back whether each one is clear, blocked, or couldn't be reached. Blocked drains go straight to SF 311, and volunteers only look and report, never during a storm. An Evidence page shows how well the ranking performed on a real storm it never saw.

How we built it

We pulled all of our data live from public sources: 33,370 SF 311 flood and clogged-drain reports (2008 to 2026) and 23,905 storm drain locations from DataSF, SF's 41 neighborhood boundaries, and National Weather Service forecasts.

We cleaned the data in four steps. First, the city renamed its flood categories in June 2024, so we merged both labeling systems. Second, we kept only storm days, meaning days with 25 or more flood reports citywide, which filtered out everyday plumbing problems and left 177 storm days. Third, we merged reports made on the same day within 30 meters of each other into a single incident to remove duplicates. Fourth, we used only data from before November 18, 2026 to build the ranking, with an automatic check in the code that stops if any test data leaks in.

To rank drains, we used a greedy maximum-coverage algorithm. Each drain "covers" the past flood incidents within 100 meters of it. The algorithm repeatedly picks the drain that adds the most new coverage, which spreads picks across different flood spots instead of stacking them on one corner. This method is mathematically guaranteed to reach at least 63% of the best possible coverage.

We tested the ranking on the November 18 storm (831 incidents), which it never saw. Our main measure was hit rate: the share of our top drains that had a real flood report within 100 meters that day. 19 of our 25 Urgent drains (76%) were at real flood spots, compared with roughly 1 in 5 for randomly chosen drains.

Before submitting, we ran a security scan of our codebase with ArgosX to check for vulnerabilities, since the app handles volunteer sign-ups and reports.

Challenges we ran into

The city's 2024 category rename would have silently dropped years of data if we hadn't caught it. Our first measure of success, the share of all citywide flood reports near our picks, came out at only 6 to 9 percent, because 25 drains can't cover a whole city. Switching to hit rate asked a fairer question: when DrainGuard flags a drain, is it actually a flood spot? We also had to guard against leakage, since it's easy to accidentally "predict" a storm using data from that same storm. San Francisco doesn't publish which drains are clogged or cleaned, so we rank where to look first instead of claiming to predict clogs, and volunteer reports are our way of starting that missing dataset. Finally, getting the maps, hover cards, and neighborhood labels to display correctly inside the app took several rounds of fixes.

What we learned

Validation matters more than features: one honest test on unseen data was worth more than any extra button. The right measure changes the story, because the same ranking can look like 9% or 76% depending on the question you ask, so you have to choose the question that matches the real decision. Public city data is powerful but messy, and duplicates, label changes, and reporting bias all have to be handled before any modeling.

What's next

Next, we want to add terrain (low spots where water collects) and the city's official flood zone map to the model, and test it on more past storms. We also want to run a larger random comparison so we can report a confidence range alongside our results. Longer term, we want to partner with SFPUC's Adopt-a-Drain program so volunteer reports become real clog data, and to expand to other cities like Sunnyvale.

Built With

  • analysis-neighborhoods)
  • datasf-(sf-311-cases
  • folium
  • leaflet.js
  • national-weather-service-api
  • numpy
  • pandas
  • python
  • scipy
  • security
  • stormwater-inlets
  • streamlit
  • streamlit-folium
  • usgs-national-map
Share this project:

Updates

Submission history