Skip to content

Moh97746/Physics-Guided-CNN-BiLSTM-Solar

Repository files navigation

Solar AI

Physics-Guided Neural Networks for Solar Irradiance Forecasting

Outperforming Self-Attention: A Leaner, Smarter Approach


arXiv License: MIT MATLAB NASA POWER


Author

"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.


🎯 The Complexity Paradox

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

🏗️ Architecture Overview

┌─────────────────────────────────────────────────────┐
│                                                     │
│   ☀️  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²)               │
│                                                     │
└─────────────────────────────────────────────────────┘

🔬 Design Principles

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)

📂 Repository Structure

📦 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

🚀 Quick Start

% 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² metrics

🎮 Interactive 3D Visualization

Want to explore the model architecture interactively? We built a full scrollytelling 3D simulation powered by Three.js + KaTeX:

3D Viz

Animated data flow • Mathematical notation • Layer-by-layer walkthrough


📚 Related Research Papers

# Paper Repository arXiv
1 Physics-Guided CNN-BiLSTM (this repo) 🌟 Repo arXiv
2 Physics-Informed State Space Model (PI-SSM) Repo arXiv
3 Thermodynamic Liquid Manifold Networks Repo arXiv
4 Asymmetric-Loss Industrial RUL Prediction Repo arXiv
🎮 Interactive 3D Architecture Visualization Repo

📖 Citation

@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


👤 Author

Mohammed Ezzeldin Babiker Abdullah

GitHub


© 2026 Mohammed Ezzeldin Babiker Abdullah — All rights reserved.

About

Official code for arXiv:2604.13455 - Physics-Guided CNN-BiLSTM for Solar Irradiance Forecasting

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors