# Hands-On Fundamentals of 1D Convolutional Neural Networks--A Tutorial for Beginner Users
## 4 Feed Forward Propagation  
In \(CL_{1}\), the convolution is performed using the input signal \((I)\) and a multi-filter \((K_{1,j}^{(1)})\), resulting in an array containing \(p\) elements:  
\[C^{(1)}=\Big{(}C_{1}^{(1)},C_{2}^{(1)},\ldots,C_{p}^{(1)}\Big{)}. \tag{6}\]  
Each element in (6) is then represented by  
\[C_{j}^{(1)}(i)=I(i)*K_{1,j}^{(1)}(u)=\sum_{u=1}^{s^{(1)}}I(i+u-1)K_{1,j}^{(1) }(u)+b_{j}^{(1)} \tag{7}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Layer**} & \multirow{2}{*}{**Operation**} & \multicolumn{2}{c}{**Filter**} & \multirow{2}{*}{**Output Size**} \\  & & **N.** & & **Size** \\ \hline \multirow{2}{*}{\(CL_{1}\)} & Conv + Act & \(p=4\) & \(s^{(1)}=3\) & \(C_{\sigma}^{(1)}=16\times 4\) \\  & Pool & \(1\) & \(SS^{(1)}=2\) & \(S^{(1)}=8\times 4\) \\ \hline \multirow{2}{*}{\(CL_{2}\)} & Conv + Act & \(q=6\) & \(s^{(2)}=3\) & \(C_{\sigma}^{(2)}=6\times 6\) \\  & Pool & \(1\) & \(SS^{(2)}=2\) & \(S^{(2)}=3\times 6\) \\ \hline \multirow{2}{*}{\(FCL\)} & Flat & – & – & \(f=18\times 1\) \\  & Fully connected + Act & – & – & \(2\times 1\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Description of the considered CNN. The “Layer” column describes the types of layers used sequentially, the “Operation” column indicates the type of operation performed at each layer, the “Filter” column describes the number and size of kernels used in each layer, and the “Output size” specifies the size of the signal obtained at the end of each layer. The illustration of this 1D CNN is schematized as an image in the Supplementary Materials (Figure S1). where the superscript refers to the convolutional layer number, \(j\) runs from \(1\) to the number of filters employed in the layer (\(p=4\)), \(u\) runs from \(1\) to the filter size \(s^{(1)}\), and \(b_{j}^{(1)}\) represents the bias. In this specific case, as indicated in Table 1, \(p=4\), \(s^{(1)}=3\), and \(i\) ranges from \(1\) to \(16\). An activation function \((\sigma)\) is applied to each element of \(C^{(1)}\) and the resulting output \(C_{\sigma}^{(1)}\) is then pooled. The primary objective of a pooling operation is to reduce the spatial dimensions of the input for the subsequent convolutional layer. Similar to the convolution operation, pooling uses a sliding window or a specific region that moves in stride across the input, transforming the values into representative ones. This transformation is commonly achieved by taking either the average or the maximum value from the input values within the window. The former is called \"average pooling\", while the latter is called \"max pooling\". After pooling, a new array \(S^{(1)}\) with \(p\) columns is obtained. Each column \(S^{(1)}_{j}\) is then represented by  
\[ \begin{cases}S^{(1)}_{j}(i)=Max\{C^{(1)}_{j\sigma}(i_{s})\}_{W=1,2,\ldots S^{ (1)}}&\text{Max}\\ S^{(1)}_{j}(i)=\frac{1}{S^{(1)}}\sum_{W=1}^{S^{(1)}}C^{(1)}_{j\sigma}(i_{s})& \text{Average}\end{cases}  \tag{8}\]  
where \(i_{s}=SS^{(1)}i-W+1\). In this specific case, \(i_{s}\) runs from \(1\) to \(16\), and with \(SS^{(1)}=2\), \(i\) runs from \(1\) to \(8\). For the sake of notation convenience, henceforth, \(i\) will represent the index \(i_{s}\). In \(CL_{2}\), the convolution is performed using \(S^{(1)}\) as the input signal and a multi-filter represented by a third-order tensor. Since this type of tensor refers to a three-dimensional array of numbers, for clarity, the representation of its 2D components is provided in Figure 4.  
\[ \begin{pmatrix}K^{(2)}_{11}(1)&K^{(2)}_{11}(2)&K^{(2)}_{11}(3)\\ K^{(2)}_{21}(1)&K^{(2)}_{21}(2)&K^{(2)}_{21}(3)\\ K^{(2)}_{31}(1)&K^{(2)}_{31}(2)&K^{(2)}_{31}(3)\\ K^{(2)}_{41}(1)&K^{(2)}_{41}(2)&K^{(2)}_{41}(3)\end{pmatrix} \]  
\[ \begin{pmatrix}K^{(2)}_{12}(1)&K^{(2)}_{12}(2)&K^{(2)}_{12}(3)\\ K^{(2)}_{22}(1)&K^{(2)}_{22}(2)&K^{(2)}_{22}(3)\\ K^{(2)}_{32}(1)&K^{(2)}_{32}(2)&K^{(2)}_{32}(3)\\ K^{(2)}_{42}(1)&K^{(2)}_{42}(2)&K^{(2)}_{421}(3)\end{pmatrix} \]  
\[