2 Background and problem statement
In this section, we first introduce some basics of spatiotemporal traffic forecasting and adversarial
attack, then formally define the problem we aim to address.
2.1 Spatiotemporal traffic forecasting
Let
Gt= (V,E)
denote a traffic network at time step
t
, where
V
is a set of
n
nodes (e.g., regions,
road segments, roadway sensors, etc.) and
E
is a set of edges. The construction of
Gt
can be
categorized into two types, (1) prior-based, which pre-define
Gt
based on metrics such as geographical
proximity and similarity [
10
], and (2) learning-based, which automatically learns
Gt
in an end-to-
end way [
2
]. Note the
Gt
can be static or time-evolving depending on the forecasting model. We
denote
Xt= (x1,t,x2,t,· · · ,xn,t)
as the spatiotemporal features associated to
Gt
, where
xi,t ∈Rc
represents the
c
-dimensional time-varying traffic conditions (e.g., traffic volume, traffic speed) and
contextual features (e.g., weather, surrounding POIs) of node
vi∈ V
at
t
. The spatiotemporal traffic
forecasting problem aims to predict traffic states for all vi∈ V over the next τtime steps,
ˆ
Yt+1:t+τ=fθ(Ht−T+1:t),(1)
where
Ht−T+1:t={(Xt−T+1,Gt−T+1),...,(Xt,Gt)}
denotes the traffic states contains input
features and the traffic network in previous
T
time steps,
fθ(·)
is the spatiotemporal traffic forecasting
model parameterized by
θ
, and
ˆ
Yt+1:t+τ={ˆ
Yt+1,ˆ
Yt+2,· · · ,ˆ
Yt+τ}
is the estimated traffic condi-
tions of interest of
V
from time step
t+1
to
t+τ
. We denote
Yt+1:t+τ={Yt+1,Yt+2,· · · ,Yt+τ}
as the ground truth of Ht−T+1:t.
Note the above formulation is consistent with the state-of-the-art Graph Neural Network (GNN)
based spatiotemporal traffic forecasting models [
2
,
10
,
11
,
12
], and is also generalizable to other
variants such as Convolutional Neural Network (CNN) based approaches [13].
2.2 Adversarial attack
Given a machine learning model, adversarial attack aims to mislead the model to derive biased
predictions by generating the optimal adversarial example
x∗∈arg max
x0L(x0, y;θ)s.t. kx0−xkp≤ε, (2)
where
x0
is the adversarial example with maximum bound
ε
under
Lp
norm to guarantee the pertur-
bation is imperceptible to human, and yis the ground truth of clean example x.
Various gradient-based methods have been proposed to generate adversarial examples, such
as FGSM [
14
], PGD [
8
], MIM [
9
], etc. For instance, the adversarial example
x0=x+
εsign(∇xLCE (x, y;θ))
in FGSM, where
sign(·)
is the Signum function and
LCE (·)
is the cross
entropy loss.
Note the adversarial attack happened in the testing stage, and the attackers cannot manipulate the
forecasting model or its output. On the benign testing set, the forecasting model can perform well.
Based on the amount of information the attacker can access in the testing stage, the adversarial attack
can be categorized into three classes. White-box attack. The attacker can fully access the target model,
including the model architecture, the model parameters, gradients, model outputs, the input traffic
states, and the corresponding labels. Grey-box attack. The attacker can partially access the system,
including the target model and the input traffic states, but without the labels. Black-box attack. The
attacker can only access the input traffic states, query the outputs of the target model or leverage a
surrogate model to craft the adversarial examples.
2.3 Adversarial attack against spatiotemporal traffic forecasting
This work aims to apply adversarial attacks to spatiotemporal traffic forecasting models. We first
define the adversarial traffic state as follow,
H0
t=n(X0
t,Gt) : kStk0≤η, k(X0
t−Xt)·Stkp≤εo,(3)
3