Generalized adaptive smoothing based neural network architecture for
  traffic state estimation
The adaptive smoothing method (ASM) is a standard data-driven technique used
in traffic state estimation. The ASM has free parameters which, in practice,
are chosen to be some generally acceptable values based on intuition. However,
we note that the heuristically chosen values often result in un-physical
predictions by the ASM. In this work, we propose a neural network based on the
ASM which tunes those parameters automatically by learning from sparse data
from road sensors. We refer to it as the adaptive smoothing neural network
(ASNN). We also propose a modified ASNN (MASNN), which makes it a strong
learner by using ensemble averaging. The ASNN and MASNN are trained and tested
two real-world datasets. Our experiments reveal that the ASNN and the MASNN
outperform the conventional ASM.
Chuhan Yang, Sai Venkata Ramana Ambadipudi, Saif Eddin Jabari
# Generalized adaptive smoothing based neural network architecture for traffic state estimation

###### Abstract

The adaptive smoothing method (ASM) is a standard data-driven technique used in traffic state estimation. The ASM has free parameters which, in practice, are chosen to be some generally acceptable values based on intuition. However, we note that the heuristically chosen values often result in un-physical predictions by the ASM. In this work, we propose a neural network based on the ASM which tunes those parameters automatically by learning from sparse data from road sensors. We refer to it as the adaptive smoothing neural network (ASNN). We also propose a modified ASNN (MASNN), which makes it a strong learner by using ensemble averaging. The ASNN and MASNN are trained and tested two real-world datasets. Our experiments reveal that the ASNN and the MASNN outperform the conventional ASM.

## 1 Introduction

Macroscopic traffic state variables such as flow rate and average vehicle speed, as key measurements of traffic conditions on road segments in a traffic network, have been instrumental in transportation planning and management. The accurate estimation of traffic state variables has received considerable attention because traffic state variables cannot be directly measured everywhere due to technological and financial limitations, and need to be estimated from noisy and incomplete traffic data. As a result, the process of the inference of traffic state variables from partially observed traffic data, which is referred to as _Traffic state estimation_ (TSE), has been the subject of much systematic investigation. Commonly, traffic data comes from many heterogeneous sources including stationary detector data (SDD) collected by sensors fixed in the infrastructure or floating-car data (FCD) collected by GPS devices and cellphones.

The approaches of interest are often grouped into model-driven and data-driven [15]. Model-driven approaches like Lighthill-Whitham-Richards (LWR) model [11], [13], Aw-Rascle-Zhang (ARZ) model [1] use hyperbolic conservation laws coupled with dynamical measurement models to estimate traffic states. Data-driven approaches use supervised learning algorithms to predict the traffic states. A widely used data-driven approach to estimate the traffic state is the adaptive smoothing method (ASM) [19]. Other data-driven approaches used in TSE include deep neural networks [8], [2], [18], support vector regression [22] and matrix factorization [10].

The ASM is widely used in traffic state estimation because of its simplicity in implementation and low computational cost. It is basically an interpolation method that reconstructs the spatio-temporal traffic state by passing a nonlinear low-pass filter to discrete traffic data to produce missing traffic state variables as smooth functions of space and time. Specifically, the ASM accounts for the fact that perturbations in traffic flow propagate downstream in free-flow and upstream in congestion with a characteristic constant velocity, and estimates the traffic states as superpositions of two linear anisotropic lowpass filters with an adaptive weight factor.

A major disadvantage of ASM is the free parameters in the method. Ideally, one would determine the free-parameters by calibrating them to match real data. However, in most cases the real data available is so sparse and scattered that conventional fitting methods are not efficient. This leads to non-physical traffic state predictions by the method.

To address this shortcoming, we develop a neural network architecture based on ASM which we call ASNN. We
believe the proposed ASNN allows for better parameter estimation from sparse data. We first develop a vanilla version of the ASNN and then build a more sophisticated version, MASNN, by adding multiple smoothing nodes with different initializations and incorporating multiple a priori estimates. The MASNN allows for finding suitable parameters for ASM where no easy access exists to prior information for the parameters. We compare ASM and our proposed method's performance on data from the Next Generation Simulation Program (NGSIM) and the Germany Highway Drone (HighD) dataset with different input settings.

The rest of the paper is organized as follows: Section 2 reviews the relevant literature. In Section 3, we present the ASM and our proposed method ASNN, we also discuss ASNN's workflow and the generalization of ASNN, MASNN. The experiment details are illustrated in Section 4, followed by a brief discussion of results in Section 5. Finally, we draw our conclusion and discuss future research in Section 6.

## 2 Related Work

The adaptive smoothing method (ASM) belongs to the group of data-driven methods known as structured-learning methods, which honor physics constraints such as conservation laws in order to improve the performance or interpretability, see [18], [17], [16], [4], [14], [3]. The physical constraints are incorporated in the model fitting stage, e.g., [16], [4] or infused in the model architecture, e.g., [6], [5], [7], [18]. Structured-learning methods have shown robust estimation performance and require limited data in the function fitting process. ASM is a structured-learning method because the interpolation process in ASM considers free-flow and congested traffic wave propagation characteristics.

Different attempts exist in the literature regarding improvement and modification of the conventional ASM. For instance, [14] discretized the ASM and applied Fast Fourier Transform techniques to further reduce the computation time for real-time applications. In [3]'s work, the smoothing width parameters of the ASM dynamically change in a rolling- horizon framework to capture complicated traffic states. But this work ignored other ASM parameters (free-flow and shock wave speeds, transition width, critical speed) and their values are fixed. The method proposed in our paper overcomes this limitation by systematically searching for optimal parameters considered in ASM. Anisotropic kernels of the ASM are also applied in designing efficient convolutional neural networks for traffic speed estimation in [18]. A recent work of [23] investigated ASM from a matrix completion perspective and proposed a systematic procedure to calculate the optimal weight factors instead of using the conventional heuristic weight factors.

## 3 Methodology

### Notation

We denote matrices using uppercase bold Roman letters (\(\mathbf{W},\mathbf{Z},\mathbf{V}\),etc). We specify \(\mathbf{J}\) as the all-ones matrix, in which every element is equal to one. The symbol \(\odot\) represents the Hadamard product. \(\|\cdot\|_{\mathrm{F}}\) is the Frobenius norm of a matrix. The symbol \(*\) represents convolution operation. Other notations are described in Table 1.

### Conventional Adaptive Smoothing Method (ASM)

The adaptive smoothing method takes any macroscopic traffic quantity \(\mathbf{Z}\) as input. The elements of \(\mathbf{Z}\), \(\mathbf{Z}(x,t)\), can can represent traffic flux at space-time indices \((x,t)\) denoted \(q(x,t)\), speeds \((v(x,t))\), or traffic densities \((\rho(x,t))\). ASM calculates the estimated field based on the assumption that traffic is in one of two regimes: In free-flow traffic, perturbations essentially move downstream of the flow whereas the perturbations move upstream in the congested traffic. According to kinematic wave theory, the perturbations travel with a constant wave speed along the characteristic curves over space and time in each of these regimes. ASM first calculates two a priori fields as follows:

\[\mathbf{Z}^{\mathrm{free}}(x,t)=\frac{1}{N(x,t)}\sum_{n}\phi\left(x-x_{n},t-t_ {n}-\frac{x-x_{n}}{c_{\mathrm{free}}}\right)z_{n}, \tag{1}\]

\[\mathbf{Z}^{\mathrm{cong}}(x,t)=\frac{1}{N(x,t)}\sum_{n}\phi\left(x-x_{n},t-t _{n}-\frac{x-x_{n}}{c_{\mathrm{cong}}}\right)z_{n}, \tag{2}\]

where \(c_{\mathrm{free}}\) is the characteristic wave speed in free-flow regime and \(c_{\mathrm{cong}}\) is the characteristic wave speed in the congested regime and \(N(x,t)\) is a normalization constant, \(\phi(\cdot,\cdot)\) is the smoothing kernel function:

\[\phi(x,t)=\exp\Big{(}-\frac{|x|}{\sigma}-\frac{|t|}{\tau}\Big{)}. \tag{3}\]

\((x_{n},t_{n})\) are discrete position and time pairs at which the data \((z_{n})\) are measured. \(\sigma\) and \(\tau\) represent the range of spatial smoothing in \(x\) and temporal smoothing in \(t\). We can also apply other localized functions such as a two-dimensional Gaussian kernels. The output will be a superposition of these two a priori estimates with an adaptive weight field \(\mathbf{W}^{\mathrm{cong}}\) is written in a compact form as

\[\mathbf{Z}=\mathbf{W}^{\mathrm{cong}}\odot\mathbf{Z}^{\mathrm{cong}}+( \mathbf{J}-\mathbf{W}^{\mathrm{cong}})\odot\mathbf{Z}^{\mathrm{free}}. \tag{4}\]
\(\mathbf{W}^{\text{cong}}\in[0,1]\) also depends nonlinearly on the two a priori estimates, given by:

\[\mathbf{W}^{\text{cong}}=\frac{1}{2}\left[1+\tanh\left(\frac{Z_{\text{thr}}- \min\{\mathbf{Z}^{\text{free}},\mathbf{Z}^{\text{cong}}\}}{\Delta Z}\right) \right]. \tag{4}\]

Note the operators \(\min\{\cdot,\cdot\}\) and \(\tanh(\cdot)\) in Eq.(4) are applied elementwise. \(Z_{\text{thr}}\) is the critical threshold, \(\Delta Z\) is the transition range between congested and free traffic.

There are six parameters involved in ASM estimation. The typical values of ASM parameters and their interpretation are summarized in Table 1. [20] suggested that suitable values for \(\sigma\) and \(\tau\) are half of the inter-detector spacing and half of the sampling time respectively. Further, they performed a sensitivity analysis by visual inspection and noted that the ASM is less sensitive to remaining parameters. However, we noted in our experiments and also it can be observed from figure 3 in [20] that the ASM is sensitive to parameter values and we expect that the sensitivity is due to \(Z_{thr}\) and \(\Delta Z\). This demands for a robust algorithm to optimize the ASM parameters. Moreover, there are cases where we have no prior knowledge of the parameter values to start with and a method of tuning ASM parameters is essential. For example, we don't know the smoothing width value with mixture signals input recorded by heterogeneous sources. To this end, we formulate ASM as a neural network (ASNN) to efficiently handle the tuning of the field parameters. Our architecture can also accommodate multiple wave speeds, which allows one to determine optimal parameters setting when typical values as those given in Table 1 do not work.

### Adaptive smoothing neural network (ASNN)

Our adaptive smoothing neural network (ASNN) built using the ASM. It is, thus, designed to respect the kinematic wave theory inherently in the hidden layers as explained below.

ASNN is illustrated graphically in Fig.1. The ASNN consists of the following layers: (i) An input layer where stationary detector or heterogeneous source data are fed into the neural network. (ii) An output layer where a estimated field is reconstructed and given as output. (iii) Hidden layers, where information is processed between the input and output layers while respecting kinematic wave theory. From left to right in the hidden layers in Fig.1, the first hidden layer is the smoothing layer. In the smoothing layer, the input is fed into smooth spatio-temporal functions Eq.(2) to generate an estimate of \(\mathbf{Z}^{\text{free}}\) and \(\mathbf{Z}^{\text{cong}}\) as given in Eq.(1). The second hidden layer is the weighting layer. \(\mathbf{Z}^{\text{free}}\) and \(\mathbf{Z}^{\text{cong}}\) from the smoothing layer are used to calculate the weight matrix \(\mathbf{W}^{\text{cong}}\) according to (4). \(\mathbf{W}^{\text{cong}}\) is then used in the convex combination (3) of the \(\mathbf{Z}^{\text{free}}\) and \(\mathbf{Z}^{\text{cong}}\) to predict the output in the output layer. This architecture strictly preserves the workflow of ASM, thus when we use the same parameter values from Table 1 as initialization, one feedforward of ASNN would reproduce the results of the conventional ASM.

The cost function measures the average estimation accuracy for the neural network. In each training iteration, weights in neurons are adjusted to minimize the cost. In this work, we propose two cost functions for ASNN:

1. Convolution cost function: We apply the \(\ell_{1}\) regularized root mean square error based on the heuristic that the state of every cell in the estimated matrix should be close to those of its neighbors. The cost function is

\[\frac{\|\mathsf{P}_{\Omega}(\mathbf{Z}^{\text{est}}-\mathbf{Z}^{\text{true}} )\|_{F}}{\|\mathsf{P}_{\Omega}(\mathbf{J})\|_{F}}+\lambda\frac{\sum_{(x,t)}| \omega*\mathbf{Z}^{\text{est}}(x,t)|}{\|\mathbf{J}\|_{F}} \tag{5}\]

The binary mask operator \(\mathsf{P}_{\Omega}\) evaluates the objective function only at the observed indices \(\Omega\). \(\lambda\) is the regularization parameter (or penalty parameter). The penalty term is a kernel convolution operation on the estimated matrix \(\mathbf{Z}^{\text{est}}\). \(\omega\) is a filter kernel that takes two inputs that represent distance, \(-a\leq dx\leq a\) and \(-b\leq dy\leq b\), and produces a weight. For \(|dx|>a\) or \(|dy|>b\), \(\omega(dx,dy)=0\). The expression of the convolution is:

\[\omega*\mathbf{Z}^{\text{est}}(x,t)\\ =\sum_{dx=-a}^{a}\sum_{dy=-b}^{b}\omega(dx,dy)\mathbf{Z}^{\text{ est}}(x-dx,y-dy) \tag{6}\]

It measures the magnitude of the difference between each cell's estimated value and its neighbors' estimated values.

2. Physics-informed cost function: We can encode traffic flow models as a regularization term in the cost function, which encourages the estimated result to follow some physics-based constraint. In this work, we consider a sim

\begin{table}
\begin{tabular}{|c|c|l|} \hline Parameter & Value & Description \\ \hline \(c_{\text{cong}}\) & -15 km/h & Congested wave speed \\ \(c_{\text{free}}\) & 80 km/h & Free-flow wave speed \\ \(v_{\text{thr}}\) & 60 km/h & Critical traffic speed \\ \(\Delta v\) & 20 km/h & Transition width \\ \(\sigma\) & \(\Delta x/2\) & Space coordinate smoothing width \\ \(\tau\) & \(\Delta t/2\) & Time coordinate smoothing width \\ \hline \end{tabular}
\end{table} TABLE 1: Parameter Settings
ple conservation principle based on the Lighthill-Witham-Richards (LWR) traffic flow model [11], [13]:

\[\partial_{t}\rho(x,t)=-\partial_{x}Q\big{(}\rho(x,t)\big{)}, \tag{7}\]

where \(Q(\cdot)\) is a concave flux function that describes the local rate of flow (\(q(x,t)\)) as a function of traffic density (\(\rho(x,t)\)). See in Fig. 1(a) for illustration.

LWR-type models are non-linear hyperbolic partial differential equations (PDEs), written in a conservative form [9]. A Godunov scheme developed to numerically solve the hyperbolic PDE results in the following discrete dynamical system:

\[\rho(x+\Delta x,t)=\rho(x,t)+\frac{\Delta x}{\Delta t}[q_{j-1\to j}-q_{j \to j+1}], \tag{8}\]

where \(q_{j-1\to j}\) and \(q_{j\to j+1}\) denote the numerical traffic flux (the number of vehicles moving from cell \(j-1\) to cell \(j\) and from cell \(j\) to cell \(j+1\), respectively). Numerical traffic flux is calculated using the minimum supply-demand principle [21]:

\[q_{j-1\to j}=\min\big{\{}Q_{\text{dem}}(x,t-\Delta t),Q_{\text{sup}}(x,t)\big{\}} \tag{9}\]

\[q_{j\to j+1}=\min\big{\{}Q_{\text{dem}}(x,t),Q_{\text{sup}}(x,t+\Delta t) \big{\}} \tag{10}\]

The demand and supply functions in cell \((x,t)\) are defined as

\[Q_{\text{dem}}(x,t)=\begin{cases}Q(\rho(x,t))&\text{if }\rho(x,t)\leq\rho_{ \text{cr}}\\ q_{\text{max}}&\text{otherwise}\end{cases} \tag{11}\]

and

\[Q_{\text{sup}}(x,t)=\begin{cases}Q(\rho(x,t))&\text{if }\rho(x,t)>\rho_{ \text{cr}}\\ q_{\text{max}}&\text{otherwise}\end{cases}, \tag{12}\]

respectively. \(\rho_{\text{cr}}\) is the critical traffic density and \(q_{\text{max}}=Q(\rho_{\text{cr}})\) is the maximal local flux. These local demand and supply relations are illustrated in Fig. 1(b) and Fig. 1(c), respectively.

We use Eq.(8) as a regularization term

\[l_{\text{P}}=\sum_{(x,t)}\|\rho(x+\Delta x,t)-\rho(x,t)-\frac{\Delta x}{ \Delta t}[q_{j-1\to j}-q_{j\to j+1}]\|_{2} \tag{13}\]

and obtain the physics-informed cost function as follows:

\[\frac{\|\mathbb{P}_{\Omega}(\mathbf{Z}^{\text{est}}-\mathbf{Z}^{\text{true} })\|_{F}}{\|\mathbb{P}_{\Omega}(\mathbf{J})\|_{F}}+\lambda\frac{l_{\text{P}}} {\|\mathbf{J}\|_{F}}. \tag{14}\]

It promotes solutions that satisfy the discrete conservation equation (8).

Figure 1: Adaptive Smoothing Neural Network for Traffic State estimation
### _ASNN workflow and MASNN_

To evaluate the model, we split the ground truth traffic state dataset into a training set and a testing set, where the training set consists of the partially observed traffic data (SDD or FCD). The training set is fed into the neural network as input. The cost function averages loss over the entire training set, and computes its gradients with respect to the parameters using backpropagation. The gradients are used to update each parameter. The training process takes multiple epochs to converge. In the event of no change in total cost, a maximum iteration number concludes the learning process.

ASNN inherits its architecture from ASM; it consists of the same six parameters as weights. We should point out that similar to other gradient-based learning methods, the ASNN architecture also faces the challenge of the diminishing gradient effects and weights in smoothing layers (\(c,\sigma,\tau\)) receive only minor changes in each update during training. This phenomenon indicates that parameters from smoothing layers require reasonable initialization for overall efficiency. Fortunately, these parameters are shared by ASNN and ASN and have the same interpretation, we can use their typical values as initialization and freeze the smoothing layers for fast convergence.

We noted from our experiments that the ASNN is a weak learner. For instance, when the data is hybrid i.e., when it comes from heterogeneous sources including stationary detectors and floating cars, the ASNN estimations are sensitive to the initialization. To alleviate this problem and to make the ASNN a robust learner, we develop the multiple a priori adaptive smoothing neural network (MASNN). MASNN is graphically demonstrated in Fig. 3.

The MASNN basically uses the ensemble averaging technique to make the predictions independent of initial guess. To that effect, we consider an ensemble of ASNNs with different possible initializations and a convex combination layer is added to combine all ASNN estimations produced by different initializations. The weights of the ASNN and the convex combination layer are determined together by optimizing the cost function.

## 4 Experimental Setup

We test the performance of our method using the NGSIM US 101 highway data and German highway data. The NGSIM US 101 data consists of vehicle trajectories from a road section which is 670 meters in length and German highway data consists of vehicle trajectories from a 400 meter road section. They are converted to a ground-truth macroscopic speed field \(\mathbf{V}(\mathbf{x},\mathbf{t})\). Thus in this work, we deal with estimating the speed field. Heatmaps of the speed

Figure 2: Flux, demand, and supply relations. \(\rho_{\text{jam}}\) is the ‘jam density’, which is a maximum traffic density at which vehicles cease to move, i.e., their speeds are zero, which results in zero flux.
Figure 3: Multiple A Priori Adaptive Smoothing Neural Network for Traffic State estimation
fields are shown in Fig. 4 and Fig. 5 for NGSIM US 101 and German highway data, respectively, both over an interval of length 600 seconds. The US101 data come from 4 evenly spaced stationary traffic sensors (inductance loop detectors). Input of German highway data come from a combination of 5% floating car trajectories and 2 stationary detectors. Both cases involve complex build-up and dissipation of congestion with mixtures of free flow, congested traffic, and shock-waves traveling in the opposite direction of traffic (the red bands in the figures).

We conduct two kinds of experiments in this study. In the first experiment, we compare the estimation error of the proposed ASNN algorithm and that of the conventional ASM. We use the typical values from Table 1 as optimal settings for ASM and as initialization of ASNN. The ASNN is trained is using both convolution cost function and the physics-informed cost functions. In the second experiment, we evaluate the benefits of the proposed MASNN estimation algorithm when the data is from heterogeneous sources where a good initialization of the ASNN parameters wasn't known.

We optimize \(\lambda\) using a grid search on candidate values \([10,5,1,0.5,0.1,0.05,0.01]\) and set \(\lambda\) to 0.01 in both experiments. The kernel \(\omega\) in the convolution cost function is chosen as

\[\omega=\begin{bmatrix}-1&0&0\\ -1&3&0\\ -1&0&0\end{bmatrix} \tag{15}\]

The heuristic behind this kernel is that current traffic states are influenced by past states.

The traffic density \(\rho\) introduced in the physics-informed cost function is calculated by inverting the Newell-Franklin relation [12], \(v=V(\rho)=\frac{1}{\rho}Q(\rho)\), to transform speed value in each cell to a density as follows:

\[\rho(x,t)=V^{-1}\big{(}\rho(x,t)\big{)}=\frac{\rho_{\rm jam}}{1-\frac{v_{\rm f }}{|c_{\rm cong}|}\ln{(1-\frac{v(x,t)}{v_{\rm f}})}}, \tag{16}\]

where \(\rho_{\rm jam}\) is the jam density (roughly 120 veh/km/lane), \(v_{\rm f}\) is the desired (free-flow) speed, which is comparable to the speed limit of the road. We set \(v_{\rm f}=100\) km/h, which is greater than maximum value of speed data observed, and \(c_{\rm cong}\) is the congested wave speed. With this set of parameters, \(\rho_{\rm cr}\) is 30 veh/km/lane.

We investigate the algorithm's accuracy numerically and by reconstructing the resulting heatmap visually. The estimation quality of the speed field \(\mathbf{\hat{V}}\) is measured by the relative error in all experiments:

\[m_{\rm r}=\frac{\|\mathbf{\hat{Z}}-\mathbf{Z}\|_{\rm F}}{\|\mathbf{Z}\|_{\rm F}} \tag{17}\]

## 5 Result Analysis and Discussion

_Expt 1: Comparison of ASM and ASNN:_

The estimation errors \(m_{\rm r}\) for conventional ASM and ASNN with both convolution and physics losses are summarized in Table 2, with best performance highlighted in bold.

We observe that the ASNN estimations have better performance over ASM in both cases. While the error estimates of ASM and ASNN don't differ significantly, we note that the conventional ASM predictions are non-physical for US 101 data when the typical parameter values in Table

\begin{table}
\begin{tabular}{|c|c||c|c|} \hline US101 & \(m_{\rm r}\) & Germany & \(m_{\rm r}\) \\ \hline ASM & 0.12417 & ASM & 0.08179 \\ ASNN (Conv) & 0.11868 & ASNN (Conv) & **0.08123** \\ ASNN (Phys) & **0.11866** & ASNN (Phys) & **0.08123** \\ \hline \end{tabular}
\end{table} TABLE 2: Estimation errors results

Figure 4: US101 data with stationary detector inputs

Figure 5: German highway data with heterogeneous inputs
1 are used. Specifically, we observe a cross-hatch in the ASM estimates when in free-flow, which violates causality in traffic (free-flowing traffic propagates with the direction of travel of the vehicles). The ASNN corrected the non-physical predictions produced by ASM (see Fig.6).

We note that as the data available for interpolation increases, the ASM gives more accurate predictions and its accuracy gets closer to that of ASNN. For instance, we used trajectory data in addition to detector data to estimate the traffic state for the German highway and noted that the ASM results are closer to ASNN results. See Fig. 7.

ASNNs trained using convolution cost and the physics cost perform equally well in this case. This indicates that temporal causality considered in the convolution cost function is effective in reconstructing traffic patterns. It also suggests that it is reasonable to adopt traffic flow models as regularization terms if we have prior information on the traffic patterns to be reconstructed. We noted in our experiments that the ASNN converges well if the initialization parameter values are chosen to be within the range between 0 and their typical values in Table 1.

_Expt 2: MASNN with multiple a priori estimates_

Here, we discuss the results we obtained using 5 sets of possible initializations for the German highway data with heterogeneous inputs. We use 5 different initialization values for \(\{\tau:2.5,5,7.5,10,12.5\}\). The congested and free-flow wave speeds are fixed at -15 km/hr and 80 km/hr, respectively for each initialization set. \(V_{\mathrm{thr}}\) and \(\Delta v\) are initialized to 1 km/hr in all the sets. The \(\sigma\) is still considered to be \(\Delta x/2\) i.e., half the distance between the detectors. The five different initializations for \(\tau\) were chosen because of uneven time gaps in the floating car data. We note that adding more initializations doesn't change the results significantly.

The estimation accuracy \(m_{\mathrm{r}}\) of MASNN is 0.08021. We note from Table 2 and also visually observe from the Fig.7 and Fig.8, MASNN's ability to combine multiple a priori estimates to improve its performance over that of ASNN.

The trained weights in the convex combination layer are recorded in Table 3. Each weight setting is then tested with conventional ASM estimation and its corresponding estimation error is recorded. The initialization set with highest trained weight is highlighted in bold. A comparison of the corresponding ASM error reveals that MASNN preferred weights that produce better estimation results for ASM, which indicates that MASNN is also capable of choosing suitable parameters for conventional ASM. Fig. 8

Figure 6: Estimation results for US101 data with stationary detector inputs: In the pane showing the conventional ASM case, non-physical patterns are highlighted with dark arrows and a red circle.

Figure 7: Estimation results for German highway data with heterogeneous inputs
displays a heatmap of the speed field produced by MASNN and ASM with different parameter settings.

We observe that MASNN produced better shockwave patterns in comparison to the ground truth visualization than those estimated by ASM and ASNN in Fig. 7. Even with the parameter set(s) determined by MASNN, the ASM has smoothened out the sharp changes more than the MASNN. The smoothening effect in ASM increases with increase in \(\tau\).

## 6 Summary and Conclusion

In this study, we develop a neural network (ASNN) based on adaptive smoothing method (ASM). The ASNN tunes the parameters of the ASM by sparse data from detectors and reconstructs the traffic state all along the road. We tested the ASNN with two cost functions. One minimizes data loss with a regularizer that penalizes sharp differences in speed in neighboring cells. The other cost function minimizes the data loss with a physics-informed regularizer based on the principle of conservation of traffic density. We also proposed a way to enhance the robustness of the ASNN in learning by using an ensemble averaging technique which we refer as MASNN. We applied the ASNN and the MASNN on two real-world data sets; one is the NGSIM US 101 highway data set which is from stationary detectors, the other uses German highway data from heterogeneous sources including stationary detectors and floating vehicles. Our experiments reveal that ASNN initialized with typical parameter values used for ASM outperforms the ASM in estimating the traffic state in all the cases. In the case of heterogeneous detectors where a good initialization set for parameters is not known, the MASNN has shown excellent performance in estimating traffic. We also note that the initialization parameters with the highest weights as predicted by MASNN, can serve as good parameter values for conventional ASM. Overall, we find that the MASNN and the ASNN are promising tools for traffic state estimation.

We find scope for future improvements: The ASNN architecture suffers from the vanishing gradient effect which affects the the parameters in the initial layers. Moreover, the ASM being a smoothing method, it smears out sharp variations in the patterns. A feed-forward network, in-lieu of the smoothing layer might improve the performance in both the above-mentioned aspects. The use of Frobenius-norm based costs focused on large numbers, which results in inaccurate estimates when the speeds are low. One can circumvent this by using density as the variable to be estimated or adding alternate penalty terms to emphasize low-speed traffic.

\begin{table}
\begin{tabular}{|c|c|c|} \hline Germany: \(\sigma,\tau\) & weight & ASM \(m_{\tau}\) \\ \hline
**50,2.5** & **1** & **0.08240** \\
**50,5** & **1** & **0.08674** \\
50,7.5 & 0 & 0.09367 \\
50,10 & 0 & 0.10154 \\
50,12.5 & 0 & 0.10963 \\ \hline \end{tabular}
\end{table} TABLE III: MASNN trained weights in convex combination layer

Figure 8: MASNN estimation results and its optimal temporal smoothing widths applied in ASM
## Acknowledgment

This work was supported by the NYUAD Center for Interacting Urban Networks (CITIES), funded by Tamkeen under the NYUAD Research Institute Award CG001. The opinions expressed in this article are those of the authors alone do not represent the opinions of CITIES.
