Varshik
Using AI and Geospatial Intelligence to Identify Urban Flooding Hotspots
Varshik: Building an AI-Powered Urban
Flood-Risk Analysis Platform on AWS
Three deep-learning models on Amazon SageMaker, smartphone sensor fusion, open elevation data and hydrological modelling, to help cities investigate flood risk before the rain arrives.

Figure 1. Varshik's end-to-end architecture on AWS.
1. The problem behind the project
For me, flooding has never been just a problem to solve with technology. It is something I have lived through.
I grew up in Tamil Nadu, where I saw the fear and uncertainty that devastating floods bring. My family struggled through difficult circumstances, and I lost friends to these tragedies. They were not statistics or images on a screen. They were reminders of how quickly a life can change.
The 2015 Chennai floods are a painful example of how vulnerable a city is when extreme rainfall overwhelms its drainage. A flooded road can cut off a neighbourhood. A flooded home can erase years of savings. For families already struggling, recovery takes far longer than the rain.
I kept coming back to one question:
What if we could identify roads likely to accumulate water before severe rainfall arrives, understand why they are vulnerable, and give city officials evidence to investigate them earlier?
Varshik is my attempt to answer it. It combines computer vision, deep learning, smartphone sensor fusion, geospatial analysis and hydrological modelling to flag road segments that may hold water, estimate standing-water depth under different storms, and help municipal engineers decide where to look first.
The hard part was not detecting a pothole or drawing a heatmap. It was connecting what a camera sees, how the road is shaped, what the terrain does and how much rain falls into one coherent system, and then making it usable.
2. Why satellite elevation alone is not enough
Satellite elevation models are good for the broad landscape. Urban flooding is decided by features far smaller than their resolution.
An underpass can collect water even though the roads around it look flat in a 30 m model. A road can have a subtle sag, a blocked kerb cut or a depression a few centimetres deep that decides where water ends up.
So no single input is treated as proof of flood risk. Varshik combines several kinds of evidence, each with known limits:
Data source | What it contributes | Why it matters |
|---|---|---|
Dashcam / road imagery | Road regions, kerbs, surface defects | Visual context for each road segment |
Smartphone GPS | Position and speed | Ties observations to road segments, corrects for braking |
Smartphone tilt sensors | Orientation changes | Basis for road-height profiles |
Monocular depth estimates | Relative surface shape | Hints at depressions |
Copernicus GLO-30, FABDEM | Terrain elevation | Low-lying areas, catchments, flow paths |
Drainage maps (where available) | Drainage context | Possible capacity constraints |
Rainfall scenarios | 2-, 5-, 10-year storms | Scenario-based water depth |
3. Architecture

Figure 2. From road imagery and sensors to flood-risk insights.

Plain text
Dashcam framesSageMaker endpointSegFormer-B2 · Depth Anything V2 · YOLOv8m-segPhone GPS + tiltRoad-height profilePer-frame road findingsCopernicus GLO-30 / FABDEM(AWS Open Data)Terrain + flow analysis (pysheds)2 / 5 / 10-year stormsWater-balance modelDepth + drainage estimatesReact / MapLibre appS3 + CloudFrontAmazon Bedrock · Nova Liteplain-language briefs
Visual inference is deliberately separated from the analysis that follows. The models extract evidence from images; sensors and terrain add physical context; the hydrological model turns that into scenario-based water depth. A detected pothole is not evidence of flooding until it is read against terrain, drainage and rainfall.
4. Three deep-learning models, one SageMaker endpoint
All three models are served from a single real-time Amazon SageMaker endpoint on a GPU instance (ml.g4dn.xlarge). A Lambda function calls it once per frame and the result flows into the rest of the pipeline.
Model | Task | Contribution |
|---|---|---|
SegFormer-B2 (Cityscapes fine-tuned) | Semantic segmentation | Road, footpath, kerb and vehicle regions |
Depth Anything V2 (Small) | Monocular depth estimation | Relative surface geometry and possible dips |
YOLOv8m-seg | Instance segmentation | Potholes and surface defects |
SegFormer-B2 tells the system where the drivable surface ends, which gives every later geometric step a frame of reference.
Depth Anything V2 produces relative depth, not calibrated elevation. Varshik never treats it as a survey. It is cross-checked against road geometry and sensor data.
YOLOv8m-seg finds potholes. A pothole alone does not mean flooding, so the analysis asks whether the feature is measurably lower than the road around it.
Packaging three models into one container, loading them once, and returning one structured record per frame was a real engineering task: it is the difference between three notebooks and a service the rest of the platform can depend on.
5. Recovering road height from a phone
Satellite models miss small changes in road height. Varshik derives road-height profiles from smartphone tilt readings combined with distance travelled, using GPS speed to account for braking. These profiles can reveal sags and underpasses that terrain data does not.
Phone sensors are noisy and vehicles move unpredictably, so the profile is evidence to combine with other signals, not a replacement for a professional survey.
6. Open data from the AWS Registry of Open Data
Water accumulation also depends on the landscape. I used the AWS Registry of Open Data to access the Copernicus GLO-30 Digital Elevation Model, so I did not have to build a terrain dataset from scratch. FABDEM bare-earth elevation and pysheds add terrain conditioning, flow routing and catchment analysis, and official drainage plans add context where they exist.
GLO-30 has roughly 30 m resolution: useful for catchments, too coarse for kerbs and road crowns. That gap is exactly why the image and phone-sensor layers exist.
7. From road segments to flood risk
Road segments are analysed at roughly 60 m intervals. A water-balance model estimates potential standing-water depth under 2-, 5- and 10-year storms, and can work backwards from a target road condition to the drainage flow (litres per second) that might be needed.
The output answers three practical questions:
- Where might water accumulate?
- Why there: geometry, terrain or drainage?
- What should be investigated first?
These are model estimates, not forecasts or drainage designs. Real outcomes depend on rainfall, blockages and local conditions.
8. Deploying on AWS
AWS service | Role in Varshik |
|---|---|
Amazon SageMaker | Real-time GPU endpoint serving all three vision models |
AWS Step Functions + Lambda | Per-frame invocation and result assembly |
Amazon Bedrock (Nova Lite) | Plain-language briefs and visual evidence descriptions |
Amazon S3 + CloudFront | Storage and delivery of the web app and results |
Amazon EventBridge Scheduler | Runs the rainfall-analysis workflow on a schedule |
Amazon SNS | Daily forecast notifications |
Amazon DynamoDB | Stores officer actions and field observations |
AWS Registry of Open Data | Copernicus GLO-30 elevation |
AWS CDK v2 (TypeScript) | Infrastructure as code, with project tagging |
The backend is Python 3.12; the frontend is React 19, TypeScript, Vite and MapLibre.
SageMaker and Bedrock do different jobs: SageMaker runs the three vision models, while Bedrock turns technical findings into explanations an engineer or official can read. Bedrock output is validated against a JSON schema, with one controlled retry, so malformed responses never reach the UI.

Figure 3. How the AI-driven workflows connect.
9. From model output to something people can use
A risk score alone is hard to act on, so the app lets users explore why:
- 3D flood-risk heatmap with flow lines
- Twelve switchable map layers
- Estimated standing-water depth, with flags for places unsafe for two-wheelers
- A rainfall simulator from drizzle to cloudburst
- Guided, street-level findings
- City-level PDF reports and plain-language Bedrock briefs
-
10. What has been validated
Evaluation | Result | How to read it |
|---|---|---|
Underpass identification, 45 km of Bengaluru ORR | AUC 0.69 with phone road profiles vs 0.47 for satellite elevation (chance level) | The phone profile adds signal that satellite data lacks |
Kadubeesanahalli underpass | Flagged on both driving directions | Reported waterlogged by traffic police in June 2023 |
Synthetic road-dip test | 11 of 11 planted 8 cm dips found; 3 cm dips are not, by design | A sensitivity test on synthetic dips in real frames, not field accuracy |
Delhi hotspot comparison | AUC 0.66 (95% CI 0.60 to 0.72), 36 reported hotspots vs 400 random main-road points | Modest but real discrimination |
These results are preliminary. They do not show that Varshik predicts every flood, guarantees safe roads, or generalises to every city. Next steps are field validation, fuller drainage data and broader testing across road types and weather.
11. Lessons learned
- Combining evidence beats trusting one model. Appearance, depth, motion, terrain and drainage each answer a different part of the question.
- Inference is only one layer. Hosting models on SageMaker matters, but the value comes from structuring their outputs and connecting them to analysis and an interface.
- Resolution matters. A dataset can be right for a region and wrong for a kerb.
- Communicate uncertainty. Model output should direct an inspection, not replace one.
12. Why I keep building
I cannot change what my family went through or bring back the friends I lost. But I can use what I learn to work towards a future where communities have better information, authorities can prepare earlier, and fewer families live through what flooding leaves behind.
Varshik is not a claim that AI can eliminate floods. It cannot replace engineering assessment or remove the uncertainty of extreme weather. What it can do is make risk more visible, point attention to places that need it, and support decisions made before the rain.
I started with a painful question about what could have been done earlier. I am building Varshik to help answer it for someone else.
Behind every data point is a road someone travels, a home someone depends on, and a life worth protecting.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article