"In high-noise meteorological tasks, explicit physical constraints offer a more efficient and more accurate alternative to self-attention mechanisms."
Important
Implementation Note: This repository contains the core architecture and settings as described in the associated research paper. However, some code structures and experimental configurations have been slightly adjusted to facilitate educational study, modification, and independent testing. The codebase will be fully synchronized with the exact methodology presented in the manuscript upon the paper's final formal publication.
Key Discovery: While the AI community races toward ever-larger Transformer architectures, we demonstrate that a lightweight Physics-Informed CNN-BiLSTM with only 15 engineered features from NASA POWER can outperform complex attention-based models by 36% in RMSE.
| Metric | 🧠 Physics-Guided (Ours) | 🤖 Attention Baseline |
|---|---|---|
| RMSE | 19.53 W/m² ✅ | 30.64 W/m² |
| Approach | Domain Knowledge First | Complexity First |
| Architecture | CNN → BiLSTM → Attention | Full Transformer |
┌─────────────────────────────────────────────────────┐
│ │
│ ☀️ NASA POWER Input (15 Physics Features) │
│ GHI, DNI, DHI, SZA, KT, Tamb, RH, ... │
│ │ │
│ ┌─────▼─────┐ │
│ │ 1D-CNN │ Spatial extraction │
│ └─────┬─────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ BiLSTM │ Temporal deps. │
│ └────────┬────────┘ │
│ │ │
│ ┌─────────────▼─────────────┐ │
│ │ 🎯 Attention Layer │ Placed │
│ │ (after BiLSTM) │ AFTER BiLSTM│
│ └─────────────┬─────────────┘ │
│ │ │
│ ┌──────────▼──────────┐ │
│ │ Physics Gate │ Night=0 │
│ │ (SZA + Clear-Sky) │ enforcement │
│ └──────────┬──────────┘ │
│ │ │
│ 📊 GHI Prediction (W/m²) │
│ │
└─────────────────────────────────────────────────────┘
| Principle | Implementation |
|---|---|
| 🌡️ 15 Physics Features | Clear-Sky, SZA, KT, DNI, DHI, Tamb, RH, cyclical time |
| 🪟 Sliding Window | 3 time-step stride — prevents temporal over-sampling |
| 🎯 Attention Placement | After BiLSTM — focused temporal weighting |
| 🔧 Hyperparameter Tuning | Bayesian Optimization (30 iterations) |
📦 Physics-Guided-CNN-BiLSTM-Solar/
│
├── 📁 training_code/
│ ├── 🧠 train_hybrid_model.txt # Main training pipeline (MATLAB)
│ └── 🔧 utils_helper_functions.txt # Clear-sky calculation utilities
│
├── 📁 training_data/
│ ├── 📊 Hourly_2010_2015.csv # NASA POWER hourly data
│ ├── 📊 Hourly_2015_2020.csv
│ └── 📊 Hourly_2020_2025.csv
│
├── 📄 Physics_Guided_CNN_BiLSTM_Paper.pdf # Published paper
├── 📄 Physics_Guided_CNN_BiLSTM_Paper.docx
└── 📖 README.md
% 1. Open MATLAB R2022a+
% 2. Navigate to the training_code/ directory
% 3. Run the main training script:
run('training_code/train_hybrid_model.txt')
% The script will:
% → Load NASA POWER data automatically
% → Engineer 15 physics-informed features
% → Run Bayesian Optimization (30 iterations)
% → Train final CNN-BiLSTM model
% → Output RMSE, MAE, R² metricsWant to explore the model architecture interactively? We built a full scrollytelling 3D simulation powered by Three.js + KaTeX:
@misc{abdullah2026physicsguidedcnn,
title = {Outperforming Self-Attention Mechanisms in Solar Irradiance
Forecasting via Physics-Guided Neural Networks},
author = {Mohammed Ezzeldin Babiker Abdullah},
year = {2026},
eprint = {2604.13455},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2604.13455}
}APA 7th Edition: Abdullah, M. E. B. (2026). Outperforming Self-Attention Mechanisms in Solar Irradiance Forecasting via Physics-Guided Neural Networks. arXiv. https://arxiv.org/abs/2604.13455