Introduction
Weather conditions significantly impact diverse sectors, including agriculture, disaster management, and public health. However, developing accurate predictive models for these domains is often hindered by the scarcity of high-quality, long-term datasets. While modern Transformer architectures excel at capturing complex patterns, they are prone to overfitting when trained on the limited data typical of specific regional or seasonal applications.
WeatherFormer addresses this challenge by introducing a "pretrain-then-finetune" paradigm to meteorological modeling. By leveraging decades of satellite data, WeatherFormer learns generalized weather representations that can be effectively transferred to data-scarce downstream tasks, such as crop yield prediction and disease outbreak forecasting.
Methodology
WeatherFormer is a transformer-based encoder architecture designed specifically for continuous environmental data. Unlike standard NLP models designed for discrete text tokens, it incorporates several domain-specific innovations to handle the complexity of atmospheric science:
- Spatiotemporal Positional Encoding: To account for the four-dimensional nature of weather data (latitude, longitude, time, and seasonality), the model employs a custom encoding scheme. This ensures the model understands the geographic and temporal context of every measurement.
- Learnable Input Scalers: To handle the varying magnitudes of continuous variables—such as the difference between atmospheric pressure and temperature—learnable scalers align raw inputs with the model's internal latent space.
- Masked Feature Prediction: The model is pretrained using a novel self-supervised task. Instead of masking tokens to zero, the model is presented with 21 weather variables and must predict the remaining 10 masked variables. This forces the encoder to learn the deep physical correlations between different atmospheric conditions.
Data and Evaluation
The model was pretrained on a massive 60 GB dataset compiled from the NASA Power Project, encompassing 31 daily weather variables across the Americas from 1984 to 2022. Evaluation focused on two critical downstream tasks characterized by small datasets:
- Soybean Yield Prediction: Utilizing county-level data from the US "corn belt" (1980–2022), where weather data is combined with soil characteristics and management practices.
- Influenza Forecasting: Predicting weekly Influenza-like Illness (ILI) percentages in New York City (2010–2022).
Key Results and Insights
WeatherFormer demonstrated superior performance across both evaluation domains, proving that large-scale pretraining is the "secret sauce" for small-dataset success:
- Agriculture: In soybean yield prediction, a hybrid model using WeatherFormer achieved a Root Mean Square Error (RMSE) of 4.83, significantly outperforming the previous CNN-RNN baseline of 5.50.
- Epidemiology: For 10-week ahead influenza forecasting, the model achieved a Mean Absolute Error (MAE) of 0.297, compared to 0.427 for traditional ARIMA statistical models.
Ablation studies confirmed that models trained from scratch on small datasets performed significantly worse, highlighting the importance of the learned representations. Furthermore, the success of the 2M parameter version suggests that "right-sized" pretrained models are often more effective than massive architectures for niche environmental tasks.
Conclusion and Future Directions
WeatherFormer establishes a foundational approach for applying large-scale pretraining to environmental science. While currently limited to the Americas, future work will focus on expanding the geographic scope to global datasets and integrating ground-level station data for higher precision. Additionally, the authors note that the model will require periodic retraining to account for shifts in weather patterns driven by climate change.
Summary updated