Inspiration
Cities deploy thousands of expensive IoT sensors to monitor infrastructure — but every citizen already carries a powerful sensor in their pocket. I asked: what if we could turn every smartphone into a smart city sensor, AND build an autonomous intelligence engine that turns reports into optimized action plans? CityPulse was born from that idea.
What it does
Citizens snap a photo of an urban issue and CityPulse triggers an autonomous intelligence cascade:
- AI classifies the issue type, severity, and department in seconds (Groq Llama 4 Scout vision)
- Bayesian anomaly detection (Poisson-Gamma priors, O(1)) flags unusual spikes per neighborhood
- LP budget optimizer (scipy linprog) reallocates maintenance budget across 6 departments
- Crew dispatch optimizer (K-means + 2-opt TSP) routes maintenance crews with provable distance savings
- Graph diffusion prediction (heat equation on Laplacian) predicts where issues will spread in 7/14/30 days
- Weibull SLA survival analysis predicts resolution probability over time
- Chain-of-thought severity reasoning explains WHY a severity was assigned with 5 factors
- Priority scoring engine ranks all reports by composite urgency (severity × age × confirmations × anomaly × SLA risk)
Plus: DBSCAN clustering, IoT sensor simulator (20 virtual sensors), pHash duplicate detection, work order generator (topological sort), transparency dashboard, Granger causality detection, city health forecasting, and 15 interactive dashboard panels with real-time SSE updates.
How I built it
- Backend: FastAPI monolith with 19 algorithmic modules
- AI: Groq Llama 4 Scout (vision) + Llama 3.1 8B (chat, briefings, translation)
- Algorithms: 9 families — Bayesian inference, LP optimization, combinatorial optimization (TSP), graph PDEs (matrix exponential), signal processing (DCT), survival analysis (Weibull), topological sort, cross-correlation, linear regression
- Testing: 316 pytest tests — zero failures
- Frontend: Vanilla HTML/CSS/JS with 15 interactive panels, dark mode, PWA
- Deployment: VPS + nginx + Let's Encrypt SSL at citypulse.help
Challenges I ran into
- Making Bayesian anomaly detection truly O(1) per observation without batch reprocessing — solved with conjugate priors and exponential decay
- Ensuring the 2-opt TSP converges quickly enough for real-time crew dispatch
- Balancing 15 dashboard panels without overwhelming users — solved with a landing page and progressive disclosure
- Pivoting from Gemini to Groq mid-development when Google's quota ran out
Accomplishments I'm proud of
- 40 features built and deployed solo — every one through 3-session peer review (design → implement → adversarial review)
- 316 passing tests with zero regressions throughout development
- 9 algorithm families spanning probabilistic inference to graph PDEs
- The system forms a coherent feedback loop: report → anomaly → budget → dispatch → SLA → transparency
- Live and functional at citypulse.help — not a prototype
What I learned
- Conjugate priors enable real-time probabilistic inference without retraining
- Graph diffusion on neighborhood Laplacians accurately predicts issue spread patterns
- Adversarial peer review (even between AI agents) catches bugs that solo development misses
- For hackathons, algorithmic depth + working deployment beats feature count every time
What's next for CityPulse
- Real IoT sensor integration (currently simulated)
- Department portal with SLA enforcement
- Predictive maintenance using historical patterns
- Native mobile app for seamless camera/GPS access
Built With
- fastapi
- folium
- groq
- leaflet.js
- numpy
- python
- scikit-learn
- scipy
- sqlite
Log in or sign up for Devpost to join the conversation.