# ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery- architecture

> Architecture diagram of the GitHub repository ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-
- Repository: https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-

## Overview

RoadAI is a road-segmentation product: users submit satellite imagery for U-Net predictions, inspect and export masks and overlays, or compare pre- and post-disaster road networks. Its backend serves inference, while a separate offline workflow prepares paired datasets, trains candidate checkpoints, and evaluates model quality. The frontend and inference wiring is visible in sampled source; training and deployment capabilities are represented only where the README documents them, so their internal call paths are not expanded.

Main entry points: [`backend/app.py`](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/backend/app.py) (Flask API), [`train.py`](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/train.py) (Candidate training), [`src/components/PredictionCard.jsx`](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/PredictionCard.jsx) (Image prediction), [`evaluate.py`](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/evaluate.py) (Model evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["App navigation<br/>[App.jsx]"]
  node_home["Home workflow<br/>[Home.jsx]"]
  node_prediction["Image prediction<br/>[PredictionCard.jsx]"]
  node_comparison["Result comparison<br/>[ComparisonView.jsx]"]
  node_disaster_ui["Disaster comparison"]
end

subgraph group_inference["Inference service"]
  node_backend["Flask API<br/>[app.py]"]
  node_mask_cleanup["Mask cleanup<br/>[utils.py]"]
end

subgraph group_lifecycle["Model lifecycle"]
  node_preprocessing["Dataset pairing<br/>[preprocess.py]"]
  node_training["Candidate training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_config["Model configuration<br/>[config.py]"]
end

subgraph group_artifacts["Models and files"]
  node_unet_model["U-Net inference<br/>[best_model.keras]"]
  node_upload_store["Upload files"]
  node_output_store["Inference outputs"]
  node_dataset["Paired dataset<br/>[dataset.py]"]
  node_production_model["Production checkpoint<br/>[best_model.keras]"]
  node_candidate_model["Candidate checkpoint"]
end

node_user(("Analyst"))
node_external_dataset(("Road imagery dataset"))

node_user -->|"navigates"| node_app
node_app -->|"shows"| node_home
node_home -->|"opens prediction"| node_prediction
node_prediction -->|"POST /predict"| node_backend
node_backend -->|"predicts with"| node_unet_model
node_backend -->|"cleans mask"| node_mask_cleanup
node_backend -->|"stores uploads"| node_upload_store
node_backend -->|"writes visualizations"| node_output_store
node_backend -->|"loads by default"| node_production_model
node_user -->|"submits image pair"| node_disaster_ui
node_disaster_ui -->|"POST /disaster-analysis"| node_backend
node_prediction -->|"shows results"| node_comparison
node_external_dataset -->|"supplies imagery"| node_preprocessing
node_preprocessing -->|"pairs splits"| node_dataset
node_dataset -->|"provides training data"| node_training
node_training -->|"saves candidate"| node_candidate_model
node_training -->|"validation selects threshold"| node_evaluation
node_evaluation -->|"evaluates checkpoint"| node_production_model
node_evaluation -->|"compares checkpoint"| node_candidate_model
node_config -->|"configures run"| node_training
node_config -->|"selects checkpoint"| node_backend

click node_app "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/App.jsx"
click node_home "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/pages/Home.jsx"
click node_prediction "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/PredictionCard.jsx"
click node_comparison "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/ComparisonView.jsx"
click node_disaster_ui "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/DisasterAnalysisCard.jsx"
click node_backend "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/backend/app.py"
click node_unet_model "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model.keras"
click node_mask_cleanup "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/utils.py"
click node_upload_store "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/tree/main/backend/uploads"
click node_output_store "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/tree/main/backend/outputs"
click node_dataset "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/dataset.py"
click node_preprocessing "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/preprocess.py"
click node_training "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/train.py"
click node_evaluation "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/evaluate.py"
click node_production_model "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model.keras"
click node_candidate_model "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model_improved.keras"
click node_config "https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_prediction,node_comparison,node_disaster_ui toneBlue
class node_backend,node_mask_cleanup toneAmber
class node_preprocessing,node_training,node_evaluation,node_config toneMint
class node_unet_model,node_upload_store,node_output_store,node_dataset,node_production_model,node_candidate_model toneRose
class node_user,node_external_dataset toneIndigo
```

## Components

### User interface

- [App navigation](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/App.jsx): `src/App.jsx`
- [Home workflow](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Image prediction](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/PredictionCard.jsx): `src/components/PredictionCard.jsx`
- [Result comparison](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/ComparisonView.jsx): `src/components/ComparisonView.jsx`
- [Disaster comparison](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/src/components/DisasterAnalysisCard.jsx): `src/components/DisasterAnalysisCard.jsx`

### Inference service

- [Flask API](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/backend/app.py): `backend/app.py`
- [Mask cleanup](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/utils.py): `utils.py`

### Model lifecycle

- [Dataset pairing](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/preprocess.py): `preprocess.py`
- [Candidate training](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/train.py): `train.py`
- [Model evaluation](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/evaluate.py): `evaluate.py`
- [Model configuration](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/config.py): `config.py`

### Models and files

- [U-Net inference](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model.keras): `models/best_model.keras`
- [Upload files](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/tree/main/backend/uploads): `backend/uploads`
- [Inference outputs](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/tree/main/backend/outputs): `backend/outputs`
- [Paired dataset](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/dataset.py): `dataset.py`
- [Production checkpoint](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model.keras): `models/best_model.keras`
- [Candidate checkpoint](https://github.com/ranjitha1065/a-system-and-method-for-ai-based-automatic-road-network-extraction-from-satellite-imagery-/blob/main/models/best_model_improved.keras): `models/best_model_improved.keras`

### Other components

- **Analyst**
- **Road imagery dataset**

## Connections

- Analyst → App navigation: navigates
- App navigation → Home workflow: shows
- Home workflow → Image prediction: opens prediction
- Image prediction → Flask API: POST /predict
- Flask API → U-Net inference: predicts with
- Flask API → Mask cleanup: cleans mask
- Flask API → Upload files: stores uploads
- Flask API → Inference outputs: writes visualizations
- Flask API → Production checkpoint: loads by default
- Analyst → Disaster comparison: submits image pair
- Disaster comparison → Flask API: POST /disaster-analysis
- Image prediction → Result comparison: shows results
- Road imagery dataset → Dataset pairing: supplies imagery
- Dataset pairing → Paired dataset: pairs splits
- Paired dataset → Candidate training: provides training data
- Candidate training → Candidate checkpoint: saves candidate
- Candidate training → Model evaluation: validation selects threshold
- Model evaluation → Production checkpoint: evaluates checkpoint
- Model evaluation → Candidate checkpoint: compares checkpoint
- Model configuration → Candidate training: configures run
- Model configuration → Flask API: selects checkpoint
