Sentinel-Mumbai Hybrid PINN: Keras Mixed-Precision PDE Architecture
Model Summary
Sentinel-Mumbai Hybrid PINN is an attention-augmented Physics-Informed Neural Network (PINN) developed in Keras 3 and optimized for high-throughput GPU inference (Tesla T4 mixed-precision float16).
The network incorporates a 24-hour temporal sequence lookback and enforces hydraulic mass conservation via a partial differential equation (PDE) continuity constraint during gradient descent:
$$\text{PDE Residual} = \frac{\partial \hat{y}}{\partial t} - (\text{Rainfall} - \text{Infiltration}) = 0$$
Where $\text{Infiltration} \approx 0.0$ on impervious urban concrete surfaces (landcover class 80).
- Architecture: Dual Bidirectional LSTM (128 $\to$ 64 units) + Temporal Self-Attention + SiLU Latent Projections + Sigmoid Risk Head
- Framework: Keras 3 (
keras>=3.0.0) / TensorFlow (tensorflow>=2.15.0)
- Lookback Memory: 24 timesteps
- Input Features: 8 Fused Geospatial & Oceanographic Features
8 Sequence Features
| Index |
Feature Key |
Unit / Range |
Description |
| 0 |
longitude |
degrees E |
Cell longitude (Mumbai bounds: 72.75 - 73.05) |
| 1 |
latitude |
degrees N |
Cell latitude (Mumbai bounds: 18.89 - 19.30) |
| 2 |
rainfall |
normalized |
Hourly precipitation from ERA5 reanalysis |
| 3 |
tide_height |
normalized |
1-minute gauge tidal level (Arabian Sea) |
| 4 |
soil_moisture |
normalized |
Antecedent soil moisture saturation |
| 5 |
elevation_m |
meters ASL |
Topographic elevation from NASA DEM |
| 6 |
slope |
radians |
Topographic gradient ($\arctan(\Delta \text{elev})$) |
| 7 |
landcover_class |
integer |
ESA WorldCover 10m categorical tag (80 = Built-up) |
Quickstart & Standalone Inference
Installation
pip install keras tensorflow numpy huggingface_hub
Running Inference via Python
from huggingface_hub import hf_hub_download
import keras
import numpy as np
import importlib.util
# 1. Download model and architecture definition
model_path = hf_hub_download(repo_id="abdullahashraf122/sentinel-mumbai-hybrid-pinn-keras", filename="v7_best_brain.keras")
arch_path = hf_hub_download(repo_id="abdullahashraf122/sentinel-mumbai-hybrid-pinn-keras", filename="model_architecture.py")
spec = importlib.util.spec_from_file_location("model_architecture", arch_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
# 2. Load model
model = keras.models.load_model(
model_path,
custom_objects={"SentinelPhysicsModel": module.SentinelPhysicsModel},
compile=False
)
# 3. Predict on a 24-hour sequence [batch_size, 24, 8]
sample_sequence = np.random.uniform(0.1, 0.9, size=(1, 24, 8)).astype(np.float32)
sample_sequence[0, -1, 7] = 80.0 # Urban concrete
probability = float(model(sample_sequence, training=False)[0, 0])
print(f"Predicted Inundation Probability: {probability:.6f}")
Training Methodology
- Loss Objective: Fused Loss = Data Loss (Binary Cross-Entropy) + $\lambda \cdot \text{Mean}(\text{PDE Residual}^2)$
- Optimization: AdamW with cosine decay, gradient clipping = 1.0, and XLA JIT compilation.
- Source Subfolder:
MUMBAI_mlc/HUFP_mumbai.
License
Released under the MIT License.