A road can remain visible on a map even when flooding has changed what is happening on the ground.
That gap interested me when choosing a deep learning project. My teacher asked us to build a model with a dataset and predictions. I wanted to use that assignment to explore a problem I could continue working on beyond the semester.
The result is "Raasta", a research prototype for detecting flooded-road pixels from paired satellite images.
The idea has particular relevance to Pakistan, but there is an important distinction: the current project uses historical SpaceNet 8 data from Germany and Louisiana. Its performance in Pakistan has not yet been validated.
"What the model receives"
Raasta takes two georeferenced RGB satellite images of the same location: one before a flood and one after it.
These cannot simply be two unrelated pictures. Their geographic coverage must overlap, and the images need to be aligned so that corresponding pixels represent the same area.
The preprocessing pipeline aligns the imagery and prepares road labels for training. It then combines the two RGB images into a six-channel input.
A compact U-Net, implemented in PyTorch, predicts three classes:
- Background
- Road with no flood label
- Flooded road
This is a segmentation task: the model assigns a class to each pixel rather than giving the entire image a single label.
The outputs include a prediction overlay, a flooded-road score map and georeferenced files that can be examined outside the notebook.
"Where the dataset comes from"
Raasta uses SpaceNet 8, a dataset developed for studying flooded roads and buildings.
The notebook downloads selected imagery and annotations from the official SpaceNet dataset source. With Google Drive enabled, it stores the raw files and processed samples there, alongside the training checkpoints and results.
This makes the data source and storage location explicit. It also helps make the experiment reproducible: the notebook records which files were selected.
Historical data provides a starting point for developing the pipeline. It does not tell us the condition of a particular road today.
"Making the project practical in Colab"
One issue I regularly encountered was returning to a notebook the next day and discovering that the runtime had lost its variables and files.
For Raasta, persistence became part of the design.
The workflow saves checkpoints and supporting files to Google Drive. A restoration cell reloads the previous setup, allowing training or prediction to continue after reconnecting.
The project also includes an interface inside the notebook. A user can select a saved test example or upload a compatible image pair, run prediction and download the outputs.
Keeping the complete workflow in Google Colab makes it easier to demonstrate in class and share through the repository.
"Why I am looking beyond accuracy"
A segmentation model can achieve high overall pixel accuracy while still missing the road pixels that matter.
Imagine an image in which most pixels are background. A model that predicts background everywhere could appear accurate, despite failing at flooded-road detection.
Raasta therefore includes a background-only baseline and evaluates precision, recall, F1 and intersection over union alongside pixel accuracy.
Each metric answers a different question. Recall helps reveal how many labelled flooded-road pixels the model finds. Precision helps reveal how many of its flooded-road predictions agree with the labels. Intersection over union measures the overlap between predicted and labelled regions.
Another distinction matters: "confidence is not accuracy". For an uploaded image without reference labels, the interface can display model scores, but it cannot measure whether those predictions are correct.
I am not reporting a final benchmark score in this article. The evaluation code is available so that measured results can be reported with their run settings and checkpoint details.
"What still needs work"
A useful research direction is not the same thing as an operational system.
Clouds, shadows, image alignment and differences between regions can affect predictions. A model developed on one dataset may perform differently on imagery from Pakistan.
Flood classification also does not establish whether a vehicle can safely use a road. Water depth, road damage and local conditions require additional evidence.
The next steps are to evaluate dated local imagery with reliable labels, investigate failure cases and improve how model uncertainty is communicated.
The notebook includes a separate synthetic inspection-planning experiment, but connecting predictions to a real road network remains future work.
For me, Raasta is a way to learn how data preparation, deep learning, geospatial outputs and evaluation fit together around a concrete problem.
The code and Colab notebook are available here:
https://github.com/adkhan001/Raasta
Dataset and reference implementation:
https://www.spacenet.ai/sn8-challenge/
https://github.com/SpaceNetChallenge/SpaceNet8
If you work with remote sensing or geospatial machine learning, I would welcome your thoughts: what would you test first before applying a flooded-road model to a new region?
— Allah Ditta