In “Spatial Interaction Models: From the Gravity
to the Neural Network Approach” (Fischer and Reg-
giani, 2005), Fischer and Reggiani discuss different
forms of spatial interaction models, from singly and
doubly constrained through to a singly constrained
neural spatial interaction model, including the choice
of activation function (ϕ(v
k
) in equation 3). Their
conclusion states that the classic gravity model equa-
tions (equation 1) are the preferred choice because
of the “simplicity of their mathematical form and the
theoretical nature of their underlying assumptions”.
However, they go on to say that the neural network
approach is attractive in “data-rich environments” and
where “little is known about the form of the spatial
interaction function to be approximated”. In “Why
does deep and cheap learning work so well?” (Lin
et al., 2017), Lin shows how a three layer continu-
ous input feed forward network can be made to ap-
proximate a gate multiplier to any degree of accuracy.
Their analysis of the types of functions that deep neu-
ral networks can be made to approximate is impor-
tant in the context of modelling when the function
underlying the observed data is under investigation.
This final point fits with our statement in the intro-
duction about discovering new avenues of research.
The initial research with our previous QUANT model
was to see whether a large-scale model covering the
whole of England and Wales was possible. One of the
difficulties with spatial interaction modelling is that
the algorithm is of order O(n
2
), while the number of
zones, n, can be in the thousands in order to combat
edge effects and demonstrate the finer grain detail of
the model. It should be noted that the QUANT sys-
tem currently runs equation 1 in 1.23 seconds on an
8 core CPU using parallel optimisations
1
, while a test
using OpenCL achieved the same result, but taking
only 0.25 seconds. This test was using dual NVIDIA
GTX 980 Ti GPUs, each with 640 cores clocked and a
quoted speed of 1306 GFLOPS. This evidence forms
our basis for believing that urban modelling can be
influenced by the current pace of AI research. One
thing stands out about equation 1 above all else. It is
‘pure parallel’, in that there are no loop dependencies
between different i or j indexes, so every T
i j
can be
calculated independently without having to wait for
a prior dependency. This fact, which is backed by
the evidence in the following results section, is the
cornerstone of our argument. The re-formulation of
the spatial interaction model equations into a parallel
form enables maximum usage of all available process-
ing cores on any massively parallel architecture.
1
The gravity model formula in equation1 needs to exe-
cute n x n times to compute every value in the matrix where
n = 7201 zones, giving rise to ≈ 52million iterations.
The final point to note regards the number of zones
in the model. While Black’s example (Black, 1995)
had 9 zones, Openshaw’s example of Durham had
73 zones. The example here has 7,201 zones for the
whole of England and Wales, so the goodness of fit of
a neural spatial interaction model of this size is one
metric to be investigated, as it is possible that the net-
work might not train on a model of this size. Also, the
observed matrix contains 51, 854, 401 training sam-
ples.
In the following sections we demonstrate our cur-
rent work on building a web-based urban modelling
framework. The key consideration influencing the de-
sign is for immediate results, rather than having to
wait hours for a simulation to run, as was the case in
the past. This focuses our work on urban modelling
for experimentation and exploration.
3 OVERVIEW
Previously, it has not been possible to create models
with the number of zones we require and that also run
fast enough on the hardware to make “Urban Mod-
elling as a Service” (UMaaS) a viable proposition.
Our method enables this through a set of web ser-
vices acting as a “model view controller” and provid-
ing the client with a REST API for the urban mod-
elling functions. As this is a real-time modelling ser-
vice, the main requirement is to provide the user with
model outputs fast enough to be interactive. In or-
der to achieve this, we use the software and hardware
improvements being driven by “AI as a Service” to
power “Urban Modelling as a Service”.
While equation 1 introduced the basic gravity
model equation, there are four variants that are de-
fined as follows: unconstrained, singly constrained
origin, singly constrained destination and doubly con-
strained. A complete description can be found in
“A Family of Spatial Interaction Models” (Wilson,
1971). For simplicity, the results presented here fo-
cus on the singly constrained origin model, but the
results are directly applicable to all four variants.
Of paramount importance to our case for ‘urban
modelling as a service’ is the quantity and variety of
data required to build a real urban model, as opposed
to a theoretical example. The data required for the
model are: zone boundaries, zone centroids, network
graphs for each mode of travel (e.g. road, rail, bus),
cost function between zones per mode of travel (c
i j
),
resident population, workplace population, travel to
work flow matrix per mode (T
i j
), land use (building
constraints on space), green belt, parks and protected
areas.
Accelerating Urban Modelling Algorithms with Artificial Intelligence
107