# Multiscale Backcast Convolution Neural Network for Traffic Flow Prediction in The Frequency Domain
## 3 Model Architecture
### Multiscale Backcast Convolution Neural Network
#### 3.2.2 Overall Architecture  
The overall architecture diagram of our model is shown in Figure 3. First, the input multivariate sequence \(\mathcal{X}_{T}\in\mathbb{R}^{N\times T}\) is transformed to obtain the frequency domain representation. Real and imaginary parts of the complex matrix are separated by the reverse operation to form a three-dimensional real matrix \(\mathcal{W}_{k}\in\mathbb{R}^{N\times k\times 2}\), which is then used as input for the model. \(\mathcal{W}_{k}\) goes through the first multiscale convolutional layer to obtain a feature map of three sets with half frequency length:  
\[\mathcal{U}_{1}^{1},\mathcal{U}_{2}^{1},\mathcal{U}_{3}^{1}=MultiscaleConv( \mathcal{W}_{k})\] \[\mathcal{U}_{i}^{1}\in\mathbb{R}^{m\times\frac{k}{2}\times 2}\,\ i\in\{1,\ 2,\ 3\}\]  
In the above expression, \(\mathfrak{m}\) indicates the number of convolutional kernels in the convolutional layer, which is set to 512 for the experiments reported in this article. By applying a similar operation, we obtain a second multiscale convolutional layer \(\mathcal{U}_{1}^{2},\mathcal{U}_{2}^{2},\mathcal{U}_{3}^{2}\) with frequency length \(4/k\).  
Figure 2: Multiscale convolutional layers.  
After obtaining three sets of feature maps, we use the concatenation operation to connect the three sets of feature maps:  
\[\mathcal{U}^{3}=concat\left\{\mathcal{U}_{1}^{2},\mathcal{U}_{2}^{2},\mathcal{U} _{3}^{2}\right\}\in\mathbb{R}^{m\times\frac{3\times k}{4}\times 2}\]  
\(\mathcal{U}^{3}\) is used as an encoding feature for forecasting. We are inspired by the Autoencoder and StemGNN [6], where the feedback branch and the prediction branch are used separately. First, the two branches expand or shorten the frequency length of \(\mathcal{U}^{3}\) through their respective fully connected layers, to accommodate the requirements of both branches for their respective frequency bands:  
\[\mathcal{U}_{forecast}^{4}=\mathcal{U}^{3}W_{f}\in\mathbb{R}^{m\times l\times 2},\]  
\[\mathcal{U}_{backcast}^{4}=\mathcal{U}^{3}W_{b}\in\mathbb{R}^{m\times k\times 2}\]  
\(W_{f}\) and \(W_{b}\) are learnable parameters. Following this step, the two sets of features are processed by the convolutional layer. The output is represented in the frequency domain, so it needs to be converted to the time domain via inverse Fourier transformation.  
\(\mathcal{U}_{backcast}^{4}\) is used to reconstruct the \(\mathcal{X}_{T}\) of the input sequence to stabilize the hidden features of the model, while \(\mathcal{U}_{forecast}^{4}\) is used to predict the future. The errors of the two together constitute the training loss function:  
\[\text{loss}=\sum\left(B_{t}^{i}(\mathcal{X}_{T})-x_{t}^{i}\right)^{2}+\sum \left(\hat{y}_{l}^{i}-y_{l}^{i}\right)^{2}\]  
In the expression above, \(B_{t}^{i}(\mathcal{X}_{T})\) is the reconstruction value of the \(i\)th variable output by the model backcasting at moment \(t\), \(x_{t}^{i}\) is the input value of the simulcast, \(\hat{y}_{l}^{i}\) is the  
Figure 3: Multiscale backcast convolution neural network structure.  
predicted value of the \(l\)-moment of the \(i\)th variable, and \(y_{l}^{i}\) is the real value of the simulcast. The result is added as the loss value of the model, and model parameters are optimized using the Adam optimizer [34].