Inspiration

My dad is a professor at UNC Chapel Hill. In July 2025, he told me about a major sewage spill that had just happened in the area. Tropical Storm Chantal brought record flooding, and over 81,000 gallons of untreated wastewater poured into Bolin Creek. The flooding damaged homes, businesses, and infrastructure across Chapel Hill and Orange County.

I didn't think about it again until months later when this Gemini 3 Hackathon came around. I was searching for a problem worth solving, and that conversation came back to me. I started researching and discovered this wasn't just a Chapel Hill issue.

Across North Carolina in 2025, infrastructure was failing everywhere. Jacksonville had a broken sewer main dump 129,000 gallons into Scales Creek. Southport saw 17,000 gallons flood the Cape Fear River after just three inches of rain. Charlotte dealt with 348,000 gallons pouring into Dixon Branch. Asheville had contractors accidentally hit a line, releasing 19,000 gallons into a French Broad River tributary.

The pattern became clear: these weren't freak accidents. They were symptoms of failing infrastructure. And it frustrated me. In 2025, we had AI that can diagnose diseases from medical images, detect manufacturing defects in real-time, and analyze satellite imagery for climate patterns. Why were we still waiting for sewage to hit the streets before we acted?

That question became Sewer Sentinel.

What It Does

Sewer Sentinel analyzes sewer pipe inspection imagery and predicts when pipes will fail, why they will fail, and how much it will cost to fix them proactively versus waiting for an emergency.

The system detects defects using industry-standard PACP (Pipeline Assessment and Certification Program) codes, assigns severity grades, estimates time to failure based on degradation models, and generates itemized cost comparisons between proactive repair and emergency response. It accounts for regional cost differences, different repair methods, and the specific failure mechanisms at play.

For critical decisions, ensemble mode runs three independent analyses and only reports results where all three agree.

How I Built It

I started with basically nothing. My first move was trying to find an API that could provide real-time CCTV data from municipal systems. That search went nowhere. For security reasons, municipalities don't hand out access to infrastructure monitoring systems. If people knew exactly where vulnerable pipes were, that creates other problems.

So I pivoted to understanding how inspection actually works. What do inspectors look for? How do they classify problems? What makes one crack dangerous and another one minor?

I grabbed a random sewer pipe image from the internet and fed it to Gemini with a simple prompt asking what was wrong. The results were terrible. Inconsistent at best, completely wrong at worst. I had no way to know if the answers were accurate because I had no baseline.

The breakthrough came when I found the Sewer-ML dataset (1.3 million professionally annotated sewer inspection images) and PACP standards documentation. Suddenly I had the framework that certified inspectors actually use.

I embedded the PACP grading rubrics directly into my prompts using Gemini's long-context capabilities. Instead of hoping the model would figure it out, I gave it the exact thresholds: what a Grade 2 crack looks like versus Grade 4, how to measure deformation, when root intrusion becomes critical.

As the analysis improved, I started thinking about what real users would need. If I were a city infrastructure manager, I wouldn't just want to know there's a crack. I'd need to know when it would fail, how much it would cost to fix, and which pipes to prioritize.

That's when I started thinking about failure mechanisms. Why do pipes fail? A crack in concrete fails differently than corrosion in cast iron. Root intrusion compounds with joint separation. Clay soil retains moisture and accelerates certain degradations. Traffic load creates cyclic stress. Understanding the why determines the fix.

I built time-to-failure predictions based on degradation rate models. Then cost estimation, but generic numbers wouldn't work. Fixing a pipe in rural North Carolina costs different than downtown Charlotte. So I added regional cost modeling with labor rates, permit costs, and equipment expenses for six different US regions.

The final piece was reliability. I implemented ensemble analysis running three independent passes, only reporting where all three agreed. For critical infrastructure, "I don't know" needed to be an acceptable answer.

The system uses Gemini's multimodal capabilities for visual analysis and reasoning. Long-context prompting embeds 90 lines of PACP thresholds and 15 calibrated examples in each request. Temperature is set to zero for reproducible results. Traditional engineering formulas handle calculations downstream.

Challenges I Ran Into

The biggest challenge was working within real constraints. I couldn't access live municipal CCTV feeds, so I had to build a system that works with whatever historical data cities already have.

Learning the domain was harder than the coding. Understanding how different pipe materials degrade, what external factors matter, how defects interact and compound. The Sewer-ML dataset documentation helped, but I spent hours researching how sewer systems actually work, what inspectors look for, and what factors influence pipe longevity.

Another challenge was building for trust. Cities won't deploy systems that can't explain their reasoning. Every prediction needed to be auditable with detailed breakdowns and confidence scores.

Accomplishments That We're Proud Of

Getting the PACP standards implementation right. The system doesn't just detect problems, it classifies them the same way certified inspectors do, with consistent grading that municipalities can actually use.

The ensemble analysis mode. Running three independent passes and requiring consensus was computationally expensive but necessary for high-stakes decisions.

Regional cost modeling. Breaking down repairs into itemized estimates with labor, materials, equipment, permits, and traffic control means cities can verify the numbers against their own procurement data.

Building something that respects both the technology and the domain. This isn't just a demo. It's designed around how infrastructure decisions are actually made.

What I Learned

Building applied AI is as much about understanding the problem as it is about model capabilities. The most meaningful progress came from domain learning, not prompt engineering.

Working within constraints makes systems better. Not having perfect data access forced me to build something more practical and deployable.

For critical infrastructure, uncertainty needs to be acknowledged. The system that says "confidence too low" when appropriate is more valuable than one that always gives an answer.

What's Next for Sewer Sentinel

Validation with actual municipal partners to test against their inspection data and get feedback from certified inspectors.

Integration with work order management systems so predictions can flow directly into maintenance scheduling.

Expansion to other infrastructure types: water distribution systems, stormwater networks, bridge inspections.

Historical failure data correlation to improve prediction models based on what actually happened versus what was predicted.

But for now, Sewer Sentinel represents what I set out to prove: that AI can help us stop waiting for sewage in the streets before we act.

Built With

  • custom-cost-estimation-engine-with-regional-modeling
  • git/github
  • google-gemini-3-api-(gemini-2.0-flash-exp)
  • json-structured-outputs
  • nassco-pacp-v7.0-standards
  • pillow-(pil)
  • python
  • sewer-ml-dataset-(1.3m-images)
  • streamlit
Share this project:

Updates