# Towards Robust Representations of Spatial Networks Using Graph Neural Networks
## 1 Introduction
While advances in machine learning techniques and a proliferation of spatial data have benefited Geo-AI efforts in solving many inference tasks, there have been concerns about the robustness of general models versus specialised models for Geo-AI. Studies have shown that specialised models for spatial tasks usually perform better than general models for spatial data [8; 9]. For example, [PERSON] et al. [10] demonstrate that encoding the geographical location as a probability prior improves the model performance of off-the-shelf fine-grained image classifiers. Similarly, [PERSON] et al. [11] who show that leveraging geographical information could significantly improve model performance for image classifiers in resource-constrained environments. [PERSON] et al. [12] develop mathematical embeddings for places using spatial context which outperforms mainstream embeddings. This begs the question: _What defines a specialised model for spatial data?_ We adopt the definition by [PERSON] [13] which outlines the following criteria to identify a specialised model for spatial data. 1. Invariance test--the model results should vary across space. 2. Representation test--the model should contain spatial representations. Figure 1: Figure showing a heterogeneous graph representation of spatial entities from a map. To the left is a map snippet with streets and buildings highlighted. To the right is the graph representation with the triangles representing buildings on the maps, circles representing the streets. The edges between the shapes denote some defined relation such as distance or spatial intersection. An abstract depiction of heterogeneous graph representations is shown in Figure 2.  
Formulation test--the model formulation should use spatial concepts. Outcome test--the model inputs and outputs should differ. A model is said to be specialised for spatial data if it meets at least one of the four criteria. It is important to mention that equal importance is assumed for all the criteria. In this article, we focus on criteria 2--the representation test. In this article, we study the link between data representations and the performance of machine learning models on spatial problems. Fundamentally, we seek to understand the impact of data representations on model performance. We focus on Graph Neural Network models for the problem of semantic inference on spatial networks. Spatial semantics can be defined as the descriptions or meanings of spatial objects, such as the type of a street, the use of a building. The process of predicting these semantics is referred to as _semantic inference_. We formulate two semantic inference tasks to guide our study: inference of street types and inference of building types (Section 3). These tasks are formulated specially to address the semantic inference problem on OpenStreetMap [5]. We propose an approach to derive heterogeneous graph representations from spatial entities of different types (Section 4). We develop this approach into a reusable code package called HetSpatial. Then, we develop a neural network framework for transductive learning on heterogeneous graph representations to address the inference tasks (Section 5). Similarly, we train models for the homogeneous graph representations using state of the art GNN methods. We compare the performance for models trained using the heterogeneous graph representation and homogeneous graphs representations. Our evaluations show model improvements of up to 40% average F-score using heterogeneous graph representations and 20% average F-score using homogeneous graph representations. To the best of our knowledge, this is the first attempt to empirically measure the impact of representations on model performance for spatial tasks. We release the code and data used for our experiments. The deepening integration of artificial intelligence and geographical information science vis-a-vis Geo-AI demands investigation into the efficient development of prediction models.