- Executive Summary
- Overview
- Video Demonstration
- The Problem We Solve
- System Architecture
- Complete Workflow
- Technical Stack
- Current Status
- The Gap: What We Need
- Getting Started
- Environment Setup
- Project Structure
- Contributing
- Partnership Opportunities
- Roadmap
- Scientific References
- Developer
- License
- Acknowledgments
- Contact
This Minimum Viable Product (MVP) demonstrates the world's first end-to-end explainable AI system for extreme weather event attribution. Being built on:
- FengWu (foundation weather model by OpenEarthLab)
- SHAP (game-theoretic explainability framework)
- ERA5 (historical reanalysis data)
- Google Gemini (natural language generation)
The system provides scientific, evidence-based explanations for extreme weather events, making AI-driven climate insights accessible to operational forecasters, policymakers, and the public.
| Capability | Operational Benefit |
|---|---|
| Explainability | Understand why the AI makes predictions, not just what |
| Attribution | Link extreme events to specific atmospheric drivers spatially through saliency maps |
| Reproducibility | Scientific paper format with complete methodology |
| Accessibility | Natural language output bridges AI and human expertise |
| Scalability | GPU-accelerated for operational deployment |
The Weather AI Explainability System is a production-ready Minimum Viable Product (MVP) that answers critical questions about extreme weather events. By combining:
- FengWu โ A foundation model for weather forecasting (69 atmospheric variables) โ OpenEarthLab/FengWu
- SHAP โ Feature importance analysis for model interpretability โ Lundberg, S. M., & Lee, S. I. (2017). A unified approach to interpreting model predictions. In NIPS'17 (pp. 4768โ4777)
- ERA5 โ Historical weather reanalysis data via Google Earth Engine โ Hersbach, H., et al. (2020). The ERA5 global reanalysis. Q. J. R. Meteorol. Soc.
- Google Gemini โ Natural language processing and explanation generation โ Gemini Team (2023). Gemini: A Family of Highly Capable Multimodal Models
- First integration of FengWu foundation model with SHAP explainability
- Novel consensus mechanism across multiple similar historical dates
- Automated scientific report generation in operational forecaster format
- RAG-enhanced explanations combining quantitative AI results with scientific context
- ECMWF / WMO: Operational extreme event attribution
- NOAA / Met Office: Forecast verification and model improvement
- IPCC / UNFCCC: Climate change impact assessment
- National Weather Services: Public communication of extreme events
- Research Institutions: Opening AI black boxes for scientific discovery
Watch the complete workflow demonstration of the Weather Explainable AI System:
| Challenge | Our Solution |
|---|---|
| Black-box AI models | SHAP-based explainability reveals which input variables drove predictions more and where they have more weights |
| Complex weather data | Interactive map interface + natural language queries |
| Expertise gap | Gemini translates technical results into plain English explanations |
| Reproducibility | Scientific paper format with figures and PDF download |
| Operational trust | Evidence-based attribution builds confidence in AI forecasts |
| Knowledge transfer | RAG system captures and applies scientific literature |
| Computational cost | GPU-accelerated analysis on A100 server |
1. USER INPUT
โ
โข Load web interface (React + Leaflet map); API then the frontend
โข Draw region โ coordinates captured
โข Enter query: For example "Why was there extreme heat in this region on 2023-06-15?"
โข Click "Analyze" button
2. Gemini does the QUERY PARSING
โ
โข Gemini Extract: Target date, coordinates, and variable
โข Output: Structured parameters for analysis
3. GEE uses ERA5 and FIND SIMILAR DATES
โ
โข Search ERA5 history (ยฑ5 days around target date with a sigma ยฑ14.38 which can be customized)
โข Use GEE API to extract similar weather patterns
โข Output: List of similar dates with matching conditions
4. FENGWU MODEL RUN (FOR EACH DATE)
โ
โข Run FengWu AI foundation model for each similar date
โข 69 atmospheric variables processed
โข Each run takes ~6 hours (GPU-intensive)
โข Output: Model predictions for each date
5. Conduct SHAP ANALYSIS (XAI) for each similar date
โ
โข Apply SHAP algorithm to each date's model output
โข Identify feature importance (which input variables drove predictions most)
โข Method: SHAP (Lundberg & Lee, 2017)
โข Output: Top features with importance scores
6. Perform SALIENCY MAPS of top features for each similar date
โ
โข Create heatmaps for top features
โข Show spatial locations with strongest influence
โข Output: Global region importance visualizations
7. CONSENSUS ANALYSIS
โ
โข Aggregate importance across all similar dates
โข Identify consistently important features
โข Create consensus saliency maps
โข Output: Unified importance rankings
8. RAG + GEMINI EXPLANATION
โ
โข Combine: SHAP results + Consensus maps + Gemini knowledge
โข Generate natural language explanation
โข Structure: Problem โ Analysis โ Conclusion (Bottom-up)
9. FINAL REPORT
โ
โข Display results in scientific paper format
โข Show: Feature importance, saliency maps, consensus regions
โข Provide downloadable multi-page PDF
โข Answer user's original question with evidence
10. OUTPUT
โ
โข "The extreme heat was primarily driven by high v1000 (wind) and t2m (temperature)
anomalies, with strong signals over the North Atlantic region..."
| Component | Technology | Purpose |
|---|---|---|
| API Server | FastAPI + Uvicorn | RESTful API endpoints |
| GPU Computing | NVIDIA A100 40GB | Model inference + SHAP analysis |
| Foundation Model | FengWu (ONNX) | Weather forecasting (69 variables) |
| XAI Framework | SHAP (GPU-accelerated) | Feature importance analysis |
| Geospatial | Google Earth Engine API | ERA5 data access |
| LLM | Google Gemini | Query parsing + explanation generation |
| RAG System | Custom implementation | Combines SHAP + Gemini knowledge |
| Database | Redis (optional) | Caching for performance |
| Component | Technology | Purpose |
|---|---|---|
| UI Framework | React | Interactive web application |
| Mapping | Leaflet | Region selection on world map |
| Styling | Tailwind CSS | Modern, responsive design |
| PDF Generation | jsPDF + html2canvas | Multi-page report download |
| Component | Technology | Purpose |
|---|---|---|
| Containerization | Docker | Consistent deployment |
| Process Management | PM2 | Production process monitoring |
| Proxy | Psiphon (SOCKS5) | Gemini API access (if behind firewall) |
| Monitoring | nvtop, htop | GPU and system monitoring |
| Component | Status | Progress |
|---|---|---|
| Mock Data Implementation | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| API Server | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Frontend Core | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Gemini Integration | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| GEE Integration | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Results Page | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| PDF Download | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Saliency Maps | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Bottom-Up Processing | โ Complete | โโโโโโโโโโโโโโโโโโโโ 100% |
| Component | Status | Progress |
|---|---|---|
| Server Setup (A100) | ๐ In Progress | โโโโโโโโโโโโโโโโโโโโ 60% |
| Real SHAP Implementation | ๐ In Progress | โโโโโโโโโโโโโโโโโโโโ 40% |
| FengWu Model Integration | ๐ In Progress | โโโโโโโโโโโโโโโโโโโโ 30% |
| GPU Acceleration | ๐ In Progress | โโโโโโโโโโโโโโโโโโโโ 50% |
| Real Data Pipeline | ๐ Planned | โโโโโโโโโโโโโโโโโโโโ 0% |
| Validation & Testing | ๐ Planned | โโโโโโโโโโโโโโโโโโโโ 0% |
The system is 100% functionally complete as an MVP but currently uses mock data for the computationally expensive parts. We have successfully demonstrated the entire pipeline with simulated SHAP results.
- Computational cost: A100 GPU instances require significant investment.
- Financial constraint: Currently bootstrapped with no external funding.
- Research validation: Need real data to validate the approach.
| Support Type | Description | Impact |
|---|---|---|
| GPU Access | Provide A100 compute time | Enable real SHAP analysis |
| Scientific Validation | Expert review of methodology | Build credibility |
| Funding | Support development and deployment | Scale to production |
| Collaboration | Joint research and development | Accelerate progress |
# System Requirements
- Python 3.10+
- CUDA 11.8+ (for GPU)
- 32GB+ RAM
- 100GB+ storage
# For Full System (with GPU)
- NVIDIA A100 40GB+ (or equivalent)
- ONNX Runtime GPU
- PyTorch with CUDA# Clone the repository
git clone https://github.com/yourusername/Weather-Explainable-AI-System.git
cd Weather-Explainable-AI-System
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys (Gemini, GEE)
# Run the API server
uvicorn src.main:app --host 0.0.0.0 --port 8000
# In another terminal, run the frontend
cd frontend
npm install
npm start
# Access the application
# Open http://localhost:3000 in your browserThe system requires a Google Service Account JSON key file to access:
- Google Gemini API โ For query parsing and explanation generation
- Google Earth Engine (GEE) โ For ERA5 historical weather data
- Go to Google Cloud Console
- Create a new project or select an existing one
- Note your Project ID (e.g.,
your-project-id-123)
# Enable APIs via gcloud command line
gcloud services enable aiplatform.googleapis.com
gcloud services enable earthengine.googleapis.com
gcloud services enable cloudresourcemanager.googleapis.com- Go to IAM & Admin โ Service Accounts
- Click Create Service Account
- Set name:
gemini-weather-ai - Assign roles:
- Vertex AI User (for Gemini)
- Earth Engine User (for GEE access)
- Select your service account
- Go to Keys โ Add Key โ Create New Key
- Choose JSON format
- Download the file and rename it to
credentials
Create credentials.example.json in your project root:
{
"type": "service_account",
"project_id": "YOUR_GCP_PROJECT_ID",
"private_key_id": "YOUR_PRIVATE_KEY_ID",
"private_key": "-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY_HERE\n-----END PRIVATE KEY-----\n",
"client_email": "YOUR_SERVICE_ACCOUNT_EMAIL@YOUR_PROJECT_ID.iam.gserviceaccount.com",
"client_id": "YOUR_CLIENT_ID",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/YOUR_SERVICE_ACCOUNT_EMAIL%40YOUR_PROJECT_ID.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}To set up your environment:
Create .env in main directory:
# Google APIs
GOOGLE_API_KEY=your_gemini_api_key_here
GEE_PROJECT=your_gcp_project_id_here
GEE_CREDENTIALS=./credentials
# Server
HOST=0.0.0.0
PORT=8000
DEBUG=False
CORS_ORIGINS=http://localhost:3000,http://localhost:8000
# GPU
CUDA_VISIBLE_DEVICES=0
ONNX_PROVIDER=CUDAExecutionProvider
GPU_MEMORY_FRACTION=0.8
# Proxy (Psiphon)
HTTP_PROXY=socks5://127.0.0.1:1080
HTTPS_PROXY=socks5://127.0.0.1:1080
ALL_PROXY=socks5://127.0.0.1:1080
# Model Paths
FENGWU_MODEL_PATH=./models/fengwu_v2.onnx
DATA_MEAN_PATH=./models/data_mean.npy
DATA_STD_PATH=./models/data_std.npy
FENGWU_INPUT_DATA_DIR=./models/input_data/
# Reports
REPORTS_DIR=./reports
TEMPLATES_DIR=./templates
# Features
USE_MOCK_DATA=True
SIMILAR_DATES_COUNT=5
SIMILAR_DATES_SIGMA=14.38
ENABLE_TELECONNECTION=FalseWeather-Explainable-AI-System/
โ
โโโ .env # Your actual environment variables (not committed)
โโโ .env.example # Template for users (committed)
โโโ credentials # Your actual credentials file (not committed)
โโโ credentials.example.json # Template for users (committed)
โโโ .gitignore # Excludes sensitive files
โโโ README.md # Project documentation (committed)
โ
โโโ project documentation.txt # Detailed project specifications
โโโ required commands # Essential command references
โโโ requirements # Python dependencies
โ
โโโ src/ # Backend source code
โ โโโ main.py # FastAPI application entry point
โ โโโ api/
โ โ โโโ routes.py # API endpoints
โ โ โโโ models.py # Pydantic data models
โ โโโ core/
โ โ โโโ gemini_parser.py # Query parsing with Gemini
โ โ โโโ gee_client.py # Google Earth Engine + ERA5
โ โ โโโ fengwu_model.py # FengWu model interface
โ โ โโโ shap_analyzer.py # SHAP implementation
โ โโโ services/
โ โ โโโ rag_service.py # RAG + Gemini explanation
โ โ โโโ report_service.py # PDF generation
โ โโโ utils/
โ โโโ logger.py # Logging configuration
โ โโโ config.py # App configuration
โ
โโโ frontend/ # React + Leaflet frontend
โ โโโ src/
โ โ โโโ components/ # UI components
โ โ โโโ pages/ # Main pages
โ โ โโโ services/ # API service layer
โ โโโ public/ # Static assets
โ
โโโ scripts/ # Utility scripts
โ โโโ setup_server.sh # A100 server setup
โ โโโ check_gpu.py # GPU verification
โ โโโ run_all.sh # Full pipeline execution
โ
โโโ tests/ # Unit and integration tests
Due to size limitations, the following files are not included in this repository:
| File | Size | Where to Get It |
|---|---|---|
| FengWu Model | ~500 MB+ | Download from Releases |
| Data files (.npy) | ~200 MB+ | Download from Releases |
| Node modules | ~100 MB+ | Run npm install in frontend directory |
| Python venv | ~50 MB+ | Run python -m venv venv |
We welcome contributions from climate scientists, AI researchers, and operational forecasters to push this MVP into production.
- ๐ฅ SHAP GPU Optimization โ Implement real SHAP with GPU acceleration
- ๐ฅ FengWu Integration โ Connect model with the processing pipeline
- ๐ฅ Data Pipeline โ Automate ERA5 โ SHAP โ Results workflow
- ๐ Teleconnection Detection โ Identify remote climate drivers
- ๐ Validation Framework โ Test system performance against known events
We are actively seeking partnerships with:
- ECMWF โ Integration with operational forecasting
- WMO โ Standardization for extreme event attribution
- NOAA / NWS โ US operational deployment
- Met Office (UK) โ UK operational deployment
- Mรฉtรฉo-France โ European collaboration
- DWD (Germany) โ German weather service collaboration
- JMA (Japan) โ Asian operational deployment
- **.....
- NCAR / UCAR โ Climate science validation
- IPCC โ Climate change impact assessment
- NASA โ Earth science applications
- C3S (Copernicus) โ Climate data integration
- University Climate Research Centers โ Scientific validation
- **.....
| Model | Description | Ideal For |
|---|---|---|
| Research Collaboration | Joint R&D, shared publications | Universities, Research Centers |
| Operational Pilot | Deploy at an operational center | National Weather Services |
| Funding Partnership | Financial support for development | Foundations, Government Agencies |
| Data Partnership | Access to operational data | Forecasting Centers |
- API server with FastAPI
- React frontend with Leaflet map
- Gemini integration for query parsing
- GEE integration for ERA5 data
- Mock SHAP implementation
- RAG explanation generation
- PDF report generation
- Saliency map visualization
- Server setup (A100 + CUDA + Psiphon)
- Real SHAP implementation with GPU acceleration
- FengWu model integration
- Complete data pipeline
- Validation with real weather events
- Multi-user support
- Advanced caching with Redis
- Kubernetes deployment
- Teleconnection detection
- Ensemble analysis
- Real-time monitoring
- Integration with other foundation models
- Climate change attribution
- Subseasonal forecasting
- API monetization
-
Chen, L., et al. (2023). FengWu: A Foundation Model for Weather Forecasting. arXiv:2306.12345. OpenEarthLab/FengWu
-
Lundberg, S. M., & Lee, S. I. (2017). A unified approach to interpreting model predictions. In NIPS'17: Proceedings of the 31st International Conference on Neural Information Processing Systems (pp. 4768โ4777). Curran Associates Inc.
-
Hersbach, H., et al. (2020). The ERA5 global reanalysis. Quarterly Journal of the Royal Meteorological Society, 146(730), 1999-2049.
-
Gemini Team (2023). Gemini: A Family of Highly Capable Multimodal Models. Google Research.
-
Rasp, S., et al. (2020). WeatherBench: A benchmark dataset for data-driven weather forecasting. Journal of Advances in Modeling Earth Systems.
-
Bi, K., et al. (2023). Pangu-Weather: A 3D high-resolution model for fast and accurate global weather forecast. Nature.
-
Pathak, J., et al. (2022). FourCastNet: A global data-driven high-resolution weather model using adaptive Fourier neural operators. arXiv:2202.11214.
| Name | Role | Expertise |
|---|---|---|
| Reza Kanadan | Lead Developer | Weather AI, XAI, Full-Stack, PhD in Remote Sensing and GIS |
This project is licensed under the MIT License.
- FengWu team (OpenEarthLab) for the foundation model
- Google for Gemini API and Earth Engine
- SHAP contributors for the explainability framework
- ECMWF for ERA5 data
- Open-source community for the amazing tools and libraries
If you find this project useful, please consider:
- โญ Starring this repository
- ๐ Forking and contributing
- ๐ฐ Sponsoring the project
- ๐ฃ Sharing with your network
- ๐ค Exploring partnership opportunities
We invite ECMWF, WMO, NOAA, Met Office, and other climate organizations to:
- Watch the demonstration video to see the system in action
- Explore this MVP and its potential for operational use
- Validate the scientific approach and methodology
- Collaborate on the next phase of development
- Support the transition from MVP to operational system
๐๐ฆ๏ธ Together, let's open the black box of AI weather forecasting!
Last Updated: August 2026*