## 4 Streed-Net
### Decoder  
The decoder is the last component of and its task is to generate the flow prediction starting from the latent representation that corresponds to the output of the cascading hierarchical block. As shown in Figure 5, the decoder takes as input a tensor \(z=X_{cmu}+X_{ext}\), where \(z\in\mathbb{R}^{N\times M\times C^{\prime}}\), which is the result of the sum of the outputs of the hierarchical structure and the network dedicated to incorporate external factors. \(X_{ext}\) is added at this point of the network to allow the model to use the information extracted from the external factors during the reconstruction phase. Figure 4: Cascading Hierarchical Block. Figure 5: Decoder. The decoder architecture features a structure that is somehow symmetrical to that of the encoder with an array of residual units preceded and followed by a convolutional layer (Equation (21)). \[D^{(0)}=BN(ReLU(W_{d}^{(0)}*z+b_{d}^{(0)})) \tag{21}\]  
Nevertheless, this symmetry is breached by the presence of two significant differences. The first one is the presence of a long skip connection before every residual unit. The long skip connection is used to improve the accuracy and to recover the fine-grained details from the encoder. Another benefit is a significant speed up in model convergence [48]. The impact of the long skip connection on the prediction quality is assessed and discussed in Section 5.4. A generic decoding block \(D^{(l)},~{}\forall l\in\{1\dots L\}\) can be formally defined as the sequential application of the following three operations:  
\[sc^{(l)} = Conv2 DTranspose(D^{(l-1)})+ERU_{1}^{(L+1-l)} \tag{22}\] \[U^{(l)} = BN(ReLU(sc^{(l)}))\] (23) \[D^{(l)} = ResUnit(U^{(l)}) \tag{24}\]  
where \(D^{(l-1)}\) corresponds to the input block, _Conv2 DTranspose_ indicates the transposed convolution operation (also known as deconvolution), which doubles the height and width of the input, and \(sc^{(l)}\) (skip connection) is the sum of \(u\) with \(ERU_{1}^{(L+1-l)}\), i.e., the output of the remaining encoder unit at level \(L+1-l\) for the most recent frame. The residual units of the decoder are structured exactly like those of the encoder. After the convolutional stage of the decoder, a three-dimensional tensor, referred to as \(D^{(L)}\in\mathbb{R}^{N\times M\times C^{\prime}}\), is obtained with the channel size \(C^{\prime}\). Since the dimension of the channel also includes the temporal aspects compressed by the cascading hierarchical block, the channel attention [49] has been introduced to identify and emphasize the most valuable channels. Figure 6 depicts the inner structure of the _Channel Attention Block_. Given the input tensor, \(D^{(L)}\) a channel attention map \(A_{c}\in\mathbb{R}^{1\times 1\times C^{\prime}}\) is created by applying attention block deduction operations on the channels. More precisely, through the operation of global average pooling and global max pooling performed simultaneously, two different feature maps (\(X^{max}\) and \(X^{avg}\)) of size \(1\times 1\times C^{\prime}\) each are spawned. The rationale behind the choice to use both pooling strategies is that the avg pooling (\(X^{avg}\)) allows for the computation of spatial statistics [50], whereas max pooling (\(X^{max}\)) provides basic translation invariance to the internal representation by observing the maximum presence of different features. The two feature maps (\(X^{max}\) and \(X^{avg}\)) go through two Fully Connected (FC) layers that allow the model to learn (and assess) the importance of each channel. The first layer performs a dimensionality reduction, downsizing the input feature maps to \(1\times 1\times\frac{C}{s}\), based on the choice of the reduction ratio \(s\); the second layer restores the feature maps to their original size. This approach has proven to increase the model efficiency without accuracy reduction [41].