## 2 Proposed Methodology
### Structure  
The forecasting model is composed of layers of residual blocks made up of stacked dilated convolution layers, non-linearity functions, and dropout layers. The overall architecture is illustrated in Figure 2. Instead of utilizing causal one-dimensional convolution, these residual blocks are used to ensure that the forecasted values solely depend on the series' history values, \(x\). In order to maintain the same length between the input and output, zero-padding is added on input to ensure the uniformity of length in each layer and it also applies on the successive layers of the dilated convolutional layer present on the residual blocks. Dilated convolutional layer replaces the conventional convolutional layer because dilation increases the input's receptive field \(r_{f}\) while maintaining the number of layers relatively small. In choosing the minimum number of residual blocks \(R_{b}\) that guarantees that the output sequence utilized full history coverage, can be computed as:  
\[R_{b}=\log_{d_{b}}\left(\frac{(m-1)(d_{b}-1)}{(k-1)\cdot 2}+1\right) \tag{1}\]The dilation base \(d_{b}\) is an integer whereby dilation \(d=[{d_{b}}^{0},\ldots,{d_{b}}^{l-1}]\) refers to the space between the input elements on each layer \(l\) of a convolutional layer, \(m\) is the input length. In the equation, \(k\) is the kernel size of which is the length of sequential elements in the input. These series of elements with length \(k\) are multiplied with a kernel vector of leaned weights of the same to get the input of the proceeding layer. The output of the causal convolution layer is normalized using weight normalization and further transformed to learn the non-linear representation of the data using the rectified linear unit (ReLU) function. To safeguard the model from overfitting, a dropout layer is introduced at the end of the convolutional later of the residual block. Note that in the final output of the model, the ReLU is deactivated for \(y\) to take on negative values as well.  
The time-series output \(y\) is subjected to predictive anomaly detection through threshold classification. The control system is designed to counteract the two possible scenarios:  
1. The predicted nozzle temperature is below the normal printing temperature which is from 185 \({}^{\circ}\)C to 220 \({}^{\circ}\)C [37]. This case happens due to the filament flow rate is high, and the nozzle begin to drop its temperature due to heat transfer between the filament  
Figure 1: The two-stage sliding window strategy. **(a)** The first sliding window performed on the training set. The data involved are \(x_{1}\) to \(x_{train\_max}\), which is the last element of the training set. It has a time window length, \(\Delta\) and sliding step, \(\delta\), and the split segment are indicated by \(s_{1}\) up to \(s_{j}\), the last segment containing \(x_{train\_max}\). **(b)** Segment \(s_{1}\) is segmented by \(m\) is the input length and target series bearing the forecasting interval \(h\).  
Figure 2: The temporal neural network architecture. It includes a total of \(R_{b}=10\) residual blocks, receptive field \(r_{f}=8\), dilation base \(d=2\) and the kernel size \(k=3\).  
and nozzle. The operation will partially halt giving time to the nozzle to stabilize its temperature.
2. The temperature of the nozzle is above the normal printing temperature: In contrast to the first scenario, the action taken by the control system will be the activation of fan to cool the nozzle. This action is taken to stabilize the normal printing temperature range mentioned.