4.1 GeoAI for spatial prediction of future bushfire
4.1.1 Future climate data collection
Aim
We separately collected CMIP6 datasets of temperature and precipitation for 2024 and 2030. The 2024 data will be used for model training, followed by predicting bushfire burn areas for 2030.
Description of steps
Load NEX-GDDP-CMIP6 data from Google Earth Engine.
Aggregate and export the temperature and precipitation data for 2024.
Aggregate and export the temperature and precipitation data for 2030.
// Load the CMIP6 datasetvar dataset = ee.ImageCollection("NASA/GDDP-CMIP6").filter(ee.Filter.eq('model','ACCESS-CM2')) // Select climate model.filter(ee.Filter.eq('scenario','ssp585')) // Select SSP scenario.filterBounds(roi);// Restrict to the region of interest (ROI)// Extract variablesvar temperature = dataset.select('tas');// Daily mean temperature (unit: K)var precipitation = dataset.select('pr');// Daily precipitation (unit: kg m-2 s-1)// Aggregate data for 2024 and 2030var tem24 = temperature.filter(ee.Filter.calendarRange(2024,2024,'year')).mean().clip(roi).subtract(273.15);// Annual mean temperature for 2024 (°C)var tem30 = temperature.filter(ee.Filter.calendarRange(2030,2030,'year')).mean().clip(roi).subtract(273.15);// Annual mean temperature for 2030 (°C)var pre24 = precipitation.filter(ee.Filter.calendarRange(2024,2024,'year')).sum().clip(roi).multiply(86400).multiply(365);// Annual total precipitation for 2024 (mm)var pre30 = precipitation.filter(ee.Filter.calendarRange(2030,2030,'year')).sum().clip(roi).multiply(86400).multiply(365);// Annual total precipitation for 2030 (mm)// Export aggregated data to Google DriveExport.image.toDrive({image: tem24,description:'tem24',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: tem30,description:'tem30',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: pre24,description:'pre24',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: pre30,description:'pre30',scale:27830,region: roi,fileFormat:'GeoTIFF'});
4.1.2 GeoAI modelling
Aim
The step uses the gpboost model to fit temperature and precipitation data in 2024 for the next step of spatial prediction.
Description of steps
Load necessary libraries and data.
Read the data containing burned area and climate data.
Process the data to fit the gpboost model.
Build an gpboost model.
See here for more details about the gpboost model on spatio-temporal data.
# Geospatial artificial intelligence (GeoAI) for remote sensing data## GeoAI for spatial prediction of future bushfire ### Future climate data collection::: {.callout-tip title="Aim"}We separately collected CMIP6 datasets of temperature and precipitation for 2024 and 2030. The 2024 data will be used for model training, followed by predicting bushfire burn areas for 2030.:::::: {.callout-caution title="Description of steps"}1. Load NEX-GDDP-CMIP6 data from Google Earth Engine. 2. Aggregate and export the temperature and precipitation data for 2024. 3. Aggregate and export the temperature and precipitation data for 2030. :::```js// Load the CMIP6 datasetvar dataset = ee.ImageCollection("NASA/GDDP-CMIP6").filter(ee.Filter.eq('model','ACCESS-CM2')) // Select climate model.filter(ee.Filter.eq('scenario','ssp585')) // Select SSP scenario.filterBounds(roi);// Restrict to the region of interest (ROI)// Extract variablesvar temperature = dataset.select('tas');// Daily mean temperature (unit: K)var precipitation = dataset.select('pr');// Daily precipitation (unit: kg m-2 s-1)// Aggregate data for 2024 and 2030var tem24 = temperature.filter(ee.Filter.calendarRange(2024,2024,'year')).mean().clip(roi).subtract(273.15);// Annual mean temperature for 2024 (°C)var tem30 = temperature.filter(ee.Filter.calendarRange(2030,2030,'year')).mean().clip(roi).subtract(273.15);// Annual mean temperature for 2030 (°C)var pre24 = precipitation.filter(ee.Filter.calendarRange(2024,2024,'year')).sum().clip(roi).multiply(86400).multiply(365);// Annual total precipitation for 2024 (mm)var pre30 = precipitation.filter(ee.Filter.calendarRange(2030,2030,'year')).sum().clip(roi).multiply(86400).multiply(365);// Annual total precipitation for 2030 (mm)// Export aggregated data to Google DriveExport.image.toDrive({image: tem24,description:'tem24',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: tem30,description:'tem30',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: pre24,description:'pre24',scale:27830,region: roi,fileFormat:'GeoTIFF'});Export.image.toDrive({image: pre30,description:'pre30',scale:27830,region: roi,fileFormat:'GeoTIFF'});```### GeoAI modelling::: {.callout-tip title="Aim"}The step uses the gpboost model to fit temperature and precipitation data in 2024 for the next step of spatial prediction.:::::: {.callout-caution title="Description of steps"}1. Load necessary libraries and data.2. Read the data containing burned area and climate data.3. Process the data to fit the gpboost model.4. Build an gpboost model.:::See [here](https://towardsdatascience.com/tree-boosting-for-spatial-data-789145d6d97d/?sk=4f9924d378dbb517e883fc9c612c34f1) for more details about the gpboost model on spatio-temporal data.```{r , cache = FALSE, message = FALSE, echo=!knitr::is_latex_output()}#| code-fold: truelibrary(terra)pre24 = terra::rast('./data/4. GeoAI Modeling/pre24.tif')tem24 = terra::rast('./data/4. GeoAI Modeling/tem24.tif')burnedarea = terra::rast('./data/1. Data collection/BurnedArea/BurnedArea_2024.tif') |> terra::resample(tem24,method = 'average')d24 = c(pre24,tem24,burnedarea)names(d24) = c("pre","tem","burned")d24 = d24 |> terra::as.polygons(aggregate = FALSE) |> sf::st_as_sf() |> dplyr::filter(dplyr::if_all(1:3,\(.x) !is.na(.x)))d24library(gpboost)gp_model = GPModel(gp_coords = sdsfun::sf_coordinates(d24), cov_function = "exponential")# Trainingbst = gpboost(data = as.matrix(sf::st_drop_geometry(d24)[,1:2]), label = as.matrix(sf::st_drop_geometry(d24)[,3,drop = FALSE]), gp_model = gp_model, objective = "regression_l2", verbose = 0)bst```### Spatial prediction::: {.callout-tip title="Aim"}In this step, the gpboost model constructed in the previous step is used to predict the burned area of 2030.:::::: {.callout-caution title="Description of steps"}1. Read the 2030 futural climate data.2. Process the data to use the gpboost model to predict.3. Do spatial prediction by the gpboost model.:::```{r , cache = FALSE, message = FALSE, echo=!knitr::is_latex_output()}#| code-fold: truepre30 = terra::rast('./data/4. GeoAI Modeling/pre30.tif')tem30 = terra::rast('./data/4. GeoAI Modeling/tem30.tif')d30 = c(pre30,tem30)names(d30) = c("pre","tem")d30 = d30 |> terra::as.polygons(aggregate = FALSE) |> sf::st_as_sf() |> dplyr::filter(dplyr::if_all(1:3,\(.x) !is.na(.x)))d30pred = predict(bst, data = as.matrix(sf::st_drop_geometry(d30)[,1:2]), gp_coords_pred = sdsfun::sf_coordinates(d30), predict_var = TRUE, pred_latent = FALSE)predd30$burned = pred$response_meand30```## Analysing future bushfire patterns::: {.callout-tip title="Aim"}In this step, the predicted burned area of 2030 is used to analyse the future bushfire patterns.:::::: {.callout-caution title="Description of steps"}1. Visualise the predicted burned area of 2030.2. Analyse the future bushfire patterns.:::