## 3 Temperature Prediction Model for Subgrade
### NARX Network Principle and Structure  
When discussing the NARX network, several concepts need clarification. Artificial neural networks consist of a series of interconnected neurons that form a complex system. The arrangement and connectivity of these neurons significantly influence the network's operation and performance. Among these networks, the multilayer perceptron (MLP) is a frequently used feedforward neural network, consisting of an input layer, one or more hidden layers, and an output layer. In an MLP, information flows in a single direction from the input layer to the output layer, characterizing it as a feedforward neural network. Conversely, neural networks that utilize feedback connections enable reverse or lateral information transmission and are known as recurrent neural networks (RNNs) [33]. The NARX network is a type of RNN designed for modeling nonlinear time series. It has been successfully applied in various fields [34; 35; 36]. A distinctive feature of the NARX network is its ability to store past inputs and outputs by incorporating delays of various time steps, allowing for accurate future predictions. This capability means that delayed processing of subgrade monitoring data can track the physical lag effects of water content and frost heave behind temperature changes. Existing studies indicate that temperature plays a significant role in the migration of moisture and water vapor [29; 37], which subsequently affects water content and ultimately influences frost heave. Additionally, the NARX network employs an output feedback mechanism, where the network's output is fed back into the input layer. This ensures that future output values are influenced not only by independent input values but also by previous outputs [38; 39]. This feedback-enabled structure, known as a closed-loop (or parallel) structure, is typically used for multi-step predictions. During the training phase, an open-loop (or series-parallel) structure is often adopted to enhance the accuracy of past true values in the time series. This approach offers two main advantages: firstly, using actual observed values, such as temperature, water content, and frost heave, as inputs for the feedforward neural network enhances accuracy; secondly, the resulting network structure remains purely feedforward. This allows the use of static backpropagation algorithms for training, simplifying the process and enhancing both training speed and efficacy [40]. As depicted in Figure 5, in the open-loop structure, the next step prediction temperature value, \(y(n+1)\), is determined based on the past values of \(x(n)\) and \(y(n)\). In contrast, the closed-loop structure predicts the next temperature value, \(y(n+1)\), using the past values of \(x(n)\) and the previously predicted values of \(y(n)\)[41]. TDL in Figure 5 stands for time-delay linear, indicating that the predicted output variable is obtained by delaying the model input for several time steps and then linearly combining it with the current model input. It should be noted that the type of \(x(n)\) can be consistent with or different from that of \(y(n)\). In this research, \(x(n)\) was designed to include two types of data, water content and frost heave, while \(y(n)\) was designed to temperature. Figure 5: NARX network structure: **(a)** open-loop structure (used for training); **(b)** closed-loop structure (used for predictions). Note: TDL stands for time-delay linear. The mathematical model of the NARX network can be given as follows:  
\[y(n+1)=f(x(n),x(n-1),\cdots,\ x(n-dx),y(n),\ y(n-1),\cdots,\ y(n-dy)) \tag{1}\]  
where \(x(n)\) and \(y(n)\) represent the network input and output at time step \(n\), respectively, and \(dx\) and \(dy\) (\(dx\geq 1\), \(dy\geq 1\)) are positive integers representing input and output delays. The function \(f(0)\) is a nonlinear function that can be approximated by an MLP [42].