geospaNN: A Python package for geospatial neural networks
Abstract
Geostatistical models are essential for analyzing data with spatial structure across the geosciences, such as climate, ecology, and environmental science.At the same time, modern machine learning methods, especially neural networks (NNs), offer powerful tools for capturing complex, nonlinear relationships.Our package geospaNN bridges these two worlds by providing a Python library that integrates NN modeling with scalable spatial statistics.The software enables users to fit flexible spatial regression models, estimate complex mean structures, and generate Gaussian process (GP)-based spatial predictions with uncertainty quantification.Built on the PyG library designed for efficient graph neural network (GNN) training, geospaNN supports efficient computation on large, irregular spatial datasets.To handle modern geospatial data sizes, geospaNN incorporates the Nearest Neighbor Gaussian Process (NNGP) approximation (Datta et al., 2016) for fast covariance computations. Statement of NeedResearchers in geoscience and related fields frequently need to model relationships among spatially distributed variables and generate reliable spatial predictions.Although many Python machine learning libraries can fit complex nonlinear regression models, they typically ignore spatial correlation, leading to biased estimates and misleading inference when applied to geospatial data.Existing spatial modeling tools in Python provide only partial solutions: some rely on complex neural architectures that sacrifice scientific interpretability, while others use full GP models whose computational demands make them impractical for large datasets.geospaNN addresses these limitations by providing a spatial regression framework that combines the flexibility of NNs with the interpretability and statistical rigor of geostatistical models.It is designed for geoscientists, environmental researchers, and machine learning practitioners who need scalable and principled spatial modeling tools in Python.geospaNN enables geometry-aware covariance estimation and spatial prediction at scales-tens of thousands of locations-that are feasible on a personal laptop.This makes advanced spatial analysis accessible to individual researchers without specialized computing infrastructure.
Fields of Study & Subjects
Gaussian Processes and Bayesian Inference
Spatial and Panel Data Analysis
Soil Geostatistics and Mapping
Publication details
- Journal / source
- The Journal of Open Source Software
- Volume
- 11
- Issue
- 117
- Pages
- 8389–8389
- Publication date
- 29 January 2026