Inspiration
What## Inspiration
Lagos floods every rainy season - not because we lack drains, but because drains are blocked with plastic waste. In 2024 alone, Lagos recorded 200+ flood incidents. As a Lagosian, I have seen streets turn to rivers. I wanted to build a vision system that SEES the blockage, REASONS the flood risk, and ACTS before disaster strikes.
What it does
DrainSage is a 7-step AI vision system:
- Community worker takes a photo of a drain with phone
- Frontend (GitHub Pages + Netlify) uploads image
- AWS Lambda on Graviton4 ARM64 runs OpenCV 5 + UNet 3.2M model to SEE blockage %
- Image stored in Amazon S3 Data Lake
- Amazon Bedrock Claude 3.5 Sonnet REASONS: Is it high risk? What action needed?
- Amazon SNS sends SMS alert to LAWMA team
- Outcome: Flood risk mitigated, community safe
Live demo: Upload any drain photo, get instant blockage detection + AI reasoning.
How we built it
- Frontend: HTML/JS on GitHub Pages (https://josephine2016.github.io/Drainsage-lagos-flood-safe/) + Netlify backup
- Backend: Serverless Lambda Function URL on AWS Graviton4 - 40% cheaper, low carbon, COOL optimized
- Vision Model: OpenCV 5 + UNet 3.2M parameters for segmentation
- Storage: Amazon S3 for image lake
- Reasoning: Amazon Bedrock Claude 3.5 Sonnet
- Action: Amazon SNS for SMS alerts
- Theme: Build vision systems that see, reason, act
Architecture: 7-box flow (Community Phone -> Frontend -> Lambda Graviton4 -> S3 -> Bedrock -> SNS -> LAWMA Safe)
Challenges we ran into
- GitHub Pages deployment with index.html nested in folder
- Lambda cold start with OpenCV layer - solved with ARM64 Graviton optimization
- Making UNet model lightweight enough for Lambda 512MB
- Converting webp images to png for Devpost gallery
Accomplishments that we're proud of
- 3 LIVE deployments: GitHub Pages, Netlify, and AWS Lambda Function URL
- 7-step architecture working end-to-end
- Graviton4 COOL optimization - 40% cost saving, low carbon
- Real impact for LAWMA and Lagos flood prevention
What we learned
- How to deploy serverless computer vision on AWS Lambda + Graviton4
- How to chain S3 + Lambda + Bedrock + SNS for see-reason-act pattern
- How OpenCV UNet can run in serverless with optimization
- Importance of community-driven AI for African cities
What's next for DrainSage
- Add IoT water-level sensors
- Add Yoruba/Pidgin SMS alerts
- Partner with Lagos State LAWMA for pilot in 3 flood-prone LGAs
- Add map dashboard of high-risk drains
it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for DrainSage - Lagos Flood Safe
Built With
- amazon-web-services
- amazonbedrock
- amazonsns
- amazonss
- arm64
- claude3.5
- cloudwatch
- github
- graviton4
- html
- javascript
- lambd
- netlify
- opencv
- python
- unet

Log in or sign up for Devpost to join the conversation.