Introduction to Corrformer
Corrformer is an innovative deep learning model introduced in a paper published in Nature Machine Intelligence. It is designed to enhance weather forecasting by employing a Multi-Correlation mechanism, which integrates both temporal auto-correlation and spatial correlation into a unified learning structure.
Key Features
-
Efficient Complexity Reduction: Traditional spatiotemporal modeling is resource-intensive, exhibiting double quadratic complexity. Corrformer streamlines this process, reducing the complexity to linear for spatial modeling and log-linear for temporal modeling. This efficiency breakthrough enables the model to deliver forecasts collaboratively for tens of thousands of weather stations under one cohesive deep learning framework.
-
Interpretable Weather Predictions: Corrformer not only provides accurate forecasts but also generates predictions that are interpretable. By analyzing the inferred propagation directions of weather processes, it aims to foster a fully data-driven AI approach, potentially offering new insights into meteorological science.
-
State-of-the-Art Performance: The model achieves superior forecasting results on various datasets, including global, regional, and citywide scales. Its performance surpasses that of traditional statistical methods and recent deep learning models, and it stands on par with numerical methods, particularly in near-surface weather forecasting.
Code Structure
The Corrformer project is structured to facilitate its deployment and management:
- Data Provider: Manages data loading operations.
- Experiment Pipelines: Includes training, validation, and testing routines.
- Core Layers: Implements key equations and mechanisms per the research paper, such as embedding, encoding/decoding processes, causal convolution, and the Multi-Correlation mechanism.
- Model Framework: The overall system architecture is defined here.
- Utilities and Scripts: Provide additional functionality and automation scripts for operations.
Reproduction Instructions
To replicate the Corrformer results, follow these steps:
-
System Setup: Utilize a device with GPU capability, preferably an RTX 24GB GPU, running on a Linux system. Install Python 3.6 and PyTorch 1.7.1 using the provided requirements.
pip install -r requirements.txt
-
Data Acquisition: Download the necessary datasets from the Code Ocean repository and position them within the
./dataset
directory. -
Model Training and Evaluation: Execute the training and evaluation scripts for both global temperature and wind datasets.
bash ./scripts/Global_Temp/Corrformer.sh bash ./scripts/Global_Wind/Corrformer.sh
Note: The raw data for Global Temp and Global Wind have been scaled; correct the Mean Squared Error (MSE) and Mean Absolute Error (MAE) calculations by dividing them by 100 and 10, respectively.
Demo Execution
To explore a demonstration of Corrformer's capabilities:
-
Set up the environment as outlined. Note that the demo requires approximately 4GB of GPU memory.
-
Obtain datasets and pretrained models from the Code Ocean repository and place the models in the
./checkpoints
folder. -
Run the demo with these commands:
bash ./scripts/Demo/Global_Temp_demo.sh bash ./scripts/Demo/Global_Wind_demo.sh
Again, ensure to adjust the MSE and MAE by dividing them as described due to data scaling.
Contribution and Contact
Contributors to this project are encouraged to cite the respective paper in their own work. For any inquiries or feedback, Haixu Wu can be contacted via email at [email protected] or [email protected].