MOSAIKS Temperature Prediction
June 30, 2026 · View on GitHub
Reed Colloton, Nolan Hofle
CSCI 4622: Machine Learning, University of Colorado Boulder
Abstract
MOSAIKS random convolutional features from satellite imagery predict ground-level yearly average temp at R² = 0.85, beating a latitude-only baseline by 28.5%. The technique works well for interpolation, but not under regional holdout, suggesting that the model is learning the characteristics of local climates in a non-generalizable way.
Introduction
Climate and temperature monitoring traditionally relies on weather station networks, which are unevenly distributed globally (dense in wealthy regions, sparse in developing countries and remote areas). This creates significant gaps in our understanding of local climate patterns, particularly in regions most vulnerable to climate change. Note that this project specifically predicts annual average temperatures rather than daily weather, seasonal changes, or extreme events. As the climate changes, the landscape will as well, and this change should be reflected in the model's prediction, allowing researchers to track temperature across years. But confirming this is a matter for further research, as we only have a MOSAIKS feature set for 2019.
MOSAIKS computes task-agnostic features once which can be reused for diverse classification tasks.
MOSAIKS benefits:
- Universal features — 4,000 random convolutional features can predict temperature, income, population, forest cover, etc., using simple regression.
- Cheap inference — Ridge regression, instead of deep neural networks, means any researcher can run MOSAIKS on their laptop.
- Works with limited data — Training a MOSAIKS model only takes a few labeled ground truth data points.
How MOSAIKS was created:
- Split up satellite imagery (Planet Labs, 2019) into grid squares at different resolutions.
- Applied 4,000 random convolutional filters to create a feature vector for each grid square.
- Combined each vector with coordinates to create the dataset.
Credit to the MOSAIKS team for creating and distributing the features.
Methodology
Data:
- MOSAIKS features of the contiguous United States at 0.25° × 0.25° grid square resolution.
- NOAA weather station annual temperature averages from 2019 (totaling 1,709 stations with >100 days recorded).
Example data rows:
| lat | lon | X_0 | X_1 | … | X_3999 | celsius |
|---|---|---|---|---|---|---|
| 35.625 | -105.375 | 0.0234 | 0.0012 | … | 0.0089 | 12.4 |
| 40.125 | -88.875 | 0.0156 | 0.0098 | … | 0.0145 | 10.8 |
| 33.375 | -112.125 | 0.0312 | 0.0045 | … | 0.0067 | 22.1 |
Pipeline:
- 80/20 training/testing split
- Temperature normalization using StandardScaler
- Ridge regression with cross-validation
- Yearly average temperature predicted in Celsius
- Converted to Fahrenheit for our American eyes
Results
| Model | R² (Train) | R² (Test) | RMSE (C) | RMSE (F) | MAE (C) | MAE (F) |
|---|---|---|---|---|---|---|
| Latitude only | — | 0.5609 | 3.92 | 7.06 | 3.14 | 5.66 |
| Lat + Lon | — | 0.5755 | 3.85 | 6.94 | 3.02 | 5.44 |
| MOSAIKS only | 0.88 | 0.8457 | 2.32 | 4.18 | 1.84 | 3.30 |
| MOSAIKS + Lat | — | 0.8438 | 2.34 | 4.21 | 1.82 | 3.27 |
| MOSAIKS + Lat + Lon | — | 0.8477 | 2.31 | 4.16 | 1.81 | 3.25 |
Figure 1: Model predictions vs actual temperature for the test set.
Figure 2: Prediction errors spatial distribution. Colored red/blue = high/low.
Discussion
- MOSAIKS features alone achieve R² = 0.85, improving 28.5% over the latitude-only baseline (R² = 0.56).
- Adding coordinates doesn't improve R², suggesting MOSAIKS learns geographic patterns from imagery.
Spatial Cross-Validation
To assess how well the model extrapolates to unseen regions (vs. interpolating between nearby training points), we evaluated using holdout spatial cross-validation. We trained on the western US and tested on the eastern US.
| Split Strategy | R² | RMSE (°C) | Interpretation |
|---|---|---|---|
| Random 80/20 | 0.85 | 2.32 | Interpolation performance |
| Spatial holdout | -0.45 | 6.31 | Regional extrapolation |
Spatial CV interpretation:
- Random split (R² = 0.85): Test points are geographically close to training points. The model borrows information from nearby cells and might learn local geographic patterns and climates.
- Spatial CV (R² negative): When entire regions are held out, the model must extrapolate to geographies it's never seen. Negative R² means the predictions are worse than random guessing.
What MOSAIKS may capture:
- Regional vegetation patterns (Oregon forests vs Arizona deserts vs Ohio cropland)
- Elevation indicators (snow cover, vegetation zones)
- Water bodies and rivers (coastal vs inland vs highland vs valley)
Training using spatial holdout may not learn the geographic characteristics of, for example, the New York Adirondack Mountains, if it has only seen Colorado's Rocky Mountains.
Future Work
- Use MOSAIKS features trained across multiple years of imagery to predict temperature trends or detect climate change signals.
- Predict temperature extremes rather than yearly averages.
- Higher resolution: test whether finer grid resolutions (0.1° or 0.05°) improve predictions in new geographies.
- Identify which of the 4,000 MOSAIKS features most strongly predict temperature and what geographic patterns they correlate to.
- Train temperature with related variables (precipitation, humidity) to improve all temperature predictions.
Conclusion
When to use this model:
- Filling gaps in yearly temperatures for a weather station network within the US.
- Understanding what satellite imagery patterns correlate with temperature.
- Educational demonstrations of satellite imagery and machine learning.
When not to use this model:
- Predicting temperature in new geographies (e.g., Africa, Asia).
- Daily local weather forecasting.
Appendix: Running the Codebase
Files
temp-mosaiks/
├── README.md # Project description and details
├── requirements.txt # Python dependencies
├── .gitignore # Excluded large data directories
├── data/
│ ├── us_grid_025deg.csv # Training data (0.25° grid with temp labels)
│ └── global_grid_1deg.csv # Global MOSAIKS features (1° grid, for predictions)
└── src/
├── train.py # Model training script
├── evaluate.py # Model comparison + spatial CV
├── predict.py # Predict temperature from address or coordinates
├── visualize.py # Generate figures
├── utils.py # Shared utility functions
└── output/
├── model.joblib # Trained model (generated)
├── test_predictions.csv # Model predictions (generated)
├── model_comparison.csv # Evaluation results (generated)
├── spatial_cv_results.csv # Spatial CV results (generated)
├── scatter_actual_vs_predicted.png # Scatter plot figure (generated)
└── map_prediction_errors.png # Error map figure (generated)
1. Setup
pip install -r requirements.txt
2. Train Model
python src/train.py
3. Evaluate
python src/evaluate.py
4. Predict from Address or Coordinates
python src/predict.py
You can enter either:
- A street address (requires setting a Google Maps API key).
- Or direct coordinates, e.g.,
39.7392, -104.9903.
5. Generate Visualizations
python src/visualize.py
References
- Rolf et al. (2021). "A generalizable and accessible approach to machine learning with global satellite imagery." Nature Communications, 12, 4392.