Parent GitHub Repository: https://github.com/abdullah00ashraf/sentinel-v7-mumbai
Ecosystem Documentation: Axiyon / Producttolaunch Catalog
Sentinel-Mumbai PINN v1 is a high-capacity Physics-Informed Neural Network (PINN) engineered for hyper-local urban flood depth forecasting and storm surge dynamics across Mumbai / Salsette Island.
Trained across multi-decadal telemetry (rainfall, cumulative precipitation, tidal surge oscillations, elevation, urban impermeability, and drainage networks), the model embeds physical boundary laws directly into its optimization objective, preventing unphysical mass disappearance during coastal hydraulic lock events.
torch.nn)Input Sequence: [Batch, 24 Hours, 9 Features]
│
▼
6-Layer Bidirectional LSTM (512 units/dir = 1024 hidden dims, dropout=0.3)
│
▼
Self-Attention Mechanism:
Attention Weights = Softmax(Linear(1024, 1))
Context Vector = Sum(Attention Weights * LSTM Sequences)
│
▼
Non-Linear Decoder:
Linear(1024 -> 256) -> ReLU -> Dropout(0.3)
Linear(256 -> 64) -> ReLU
Linear(64 -> 1) -> Pred: Continuous Flood Depth (m)
The model optimizes a composite objective balancing empirical data fidelity against hydraulic conservation of mass:
$$\mathcal{L}{\text{total}} = \alpha \cdot \mathcal{L}{\text{data}} + \beta \cdot \mathcal{L}_{\text{physics}}$$
To provide robust gradient descent that is resilient against extreme monsoon outliers without suffering from quadratic explosion: $$\mathcal{L}{\text{data}} = \frac{1}{N} \sum{i=1}^N \ln\left(\cosh(\hat{y}_i - y_i)\right)$$
During high-tide sea surges ($>4.5\text{m}$, or normalized tide $>0.85$) coinciding with cloudburst precipitation ($>0.01$), gravity-fed urban storm drains cannot discharge into the Arabian Sea ("Hydraulic Lock"). Water is physically constrained to accumulate or stagnate: $$\mathcal{L}{\text{physics}} = \frac{1}{N} \sum{i=1}^N \text{ReLU}(0.1 - \hat{y}i) \cdot \mathbb{I}{(\text{tide} > 0.85)} \cdot \mathbb{I}_{(\text{rain} > 0.01)}$$ If the network attempts to predict near-zero flood depth during a locked storm event, a severe penalty is injected, enforcing conservation of mass.
| Index | Feature Key | Unit | Description |
|---|---|---|---|
| 0 | precip_mm_hr |
mm/hr | Instantaneous hourly rainfall |
| 1 | cumulative_rain_24h |
mm | Accumulated precipitation over trailing 24 hours |
| 2 | tidal_height_m |
meters | Coastal Arabian Sea tidal gauge level |
| 3 | avg_elevation_m |
meters | Ward-level mean topographic elevation |
| 4 | impermeability_index |
[0.0 - 1.0] | Urban concrete/asphalt soil sealing fraction |
| 5 | drainage_capacity_m3_s |
$\text{m}^3/\text{s}$ | Municipal storm-water drainage throughput capacity |
| 6 | distance_to_coast_m |
meters | Euclidean proximity to coastline / creeks |
| 7 | temperature_c |
°C | Ambient surface temperature |
| 8 | soil_moisture |
fraction | Pre-storm Antecedent Soil Moisture Condition (AMC) |
pip install torch numpy huggingface_hub
from huggingface_hub import hf_hub_download
import torch
import sys
# 1. Download model architecture & weights
weights_path = hf_hub_download(repo_id="abdullahashraf122/sentinel-mumbai-pinn-v1", filename="sentinel_mumbai_v1.pt")
arch_path = hf_hub_download(repo_id="abdullahashraf122/sentinel-mumbai-pinn-v1", filename="bi_lstm_mumbai_v1.py")
import importlib.util
spec = importlib.util.spec_from_file_location("bi_lstm_mumbai_v1", arch_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
# 2. Instantiate and load
model = module.SentinelMumbaiPINN(input_dim=9, hidden_dim=512, num_layers=6, output_dim=1)
state_dict = torch.load(weights_path, map_location="cpu")
model.load_state_dict(state_dict)
model.eval()
# 3. Predict on a 24-hour sequence [batch_size, 24, 9]
dummy_telemetry = torch.rand(1, 24, 9)
with torch.no_grad():
predicted_depth = model(dummy_telemetry)
print(f"Predicted Flood Depth: {predicted_depth.item():.4f} meters")
Released under the MIT License.