## 2 Materials and Methods
### DBN-Based Path-Tracking Deviation Pattern Identification Model and Dataset Preparation
#### 2.3.1 Training of DBN  
1. Structure of DBN  
Deep Belief Network (DBN) is essentially a probabilistic generative model, which is a multilayer perceptual network stacked with Restricted Boltzmann Machine (RBM) [25], which centers on a layer-by-layer greedy learning algorithm [26]. The DBN training is divided into two phases: first, an unsupervised pre-training phase, followed by a supervised backward fine-tuning phase (which can be viewed as a BP session). Its overall structure is shown in Figure 5.  
The RBM is divided into visible and hidden layers; there are omnidirectional connections between the nodes in the visible and hidden layers, and the nodes within the layers are unconnected. Its internal structure is shown in Figure 6.  
Figure 5: Structure of DBN.  
During training, nodes within the visible layer obtain features from the dataset and pass them to the hidden layer. Then, the nodes within the hidden layer multiply them with the weights to obtain the bias and add it to the result. The output is processed through the activation function and passed to the next hidden layer again. This hierarchical learning approach not only improves the learning efficiency of DBN; it also enhances the multi-feature extraction capability of the model.
2. Unsupervised pre-training process  
In the pre-training phase, the probability distribution function \(p(V,H)\) is shown in (12).  
\[p(V,H)=\frac{e^{-E(V,H)}}{N} \tag{12}\]  
where \(E(V,H)\) is the energy function and \(N\) is a normalization constant.  
The energy function \(E(V,H)\) of the visible and hidden layer nodes is  
\[E(V,H)=-(\sum_{i=1}^{n}a_{i}\cdot V_{i}+\sum_{j=1}^{m}b_{j}\cdot H_{j}+\sum_{i =1}^{n}\sum_{j=1}^{m}W_{ij}\cdot V_{i}\cdot H_{j}) \tag{13}\]  
where \(a_{i}\) is the deviation of the visible layer, \(b_{j}\) is the deviation of the hidden layer, \(V_{i}\) is the node of the visible layer, \(H_{j}\) is the node of the hidden layer, and \(W_{ij}\) is the connection weight between the visible and hidden layers.  
The normalization constant \(N\) is the sum of the energy of all nodes between the visible and hidden layers.  
\[N=\sum_{V}\sum_{H}e^{-E(V,H)}, \tag{14}\]  
In the process of unsupervised learning, the log-likelihood function is key to the model and reflects the model's learning ability.  
\[L=\sum_{z=1}^{l}lnp(V,H), \tag{15}\]  
where \(l\) denotes the sum of all training data.  
During the RBM training process, the Contrastive Divergence (CD) method is utilized to update the weights \(W_{ij}\) and deviations \(a_{i}\), \(b_{j}\) of the visible and hidden layers. The CD algorithm is shown in Equations (16)-(18).  
\[\Delta W_{ij}=\theta\cdot\Big{[}\big{(}V_{i}\cdot H_{j}\big{)}_{Label}-\big{(} V_{i}\cdot H_{j}\big{)}_{Predict}\Big{]}, \tag{16}\]  
\[\Delta a_{i}=\theta\cdot\big{[}\big{(}V_{i}\big{)}_{Label}-\big{(}V_{i}\big{)}_ {Predict}\big{]}, \tag{17}\]  
\[\Delta b_{j}=\theta\cdot\Big{[}\big{(}H_{j}\big{)}_{Label}-\big{(}H_{j}\big{)} _{Predict}\Big{]}, \tag{18}\]  
where \(\theta\) denotes the learning rate, \(\big{(}\cdot\big{)}_{Label}\) denotes the value of the actual data, and \(\big{(}\cdot\big{)}_{Predict}\) denotes the value of the predicted data.  
Figure 6: Structure of RBM.  
Supervised reverse fine-tuning process  
After the pre-training process, the reverse fine-tuning begins. In this process, the model is updated cyclically based on the weights \(W_{ij}\), the node bias \(b_{j}\) of the hidden layer, and the loss function \(E_{Loss}\). The formula is shown in Equations (19) and (20).  
\[W_{ij}=W_{ij}-\theta\cdot\frac{\partial E_{Loss}}{\partial W_{ij}}, \tag{19}\]  
\[b_{j}=b_{j}-\theta\cdot\frac{\partial E_{Loss}}{\partial b_{j}}\, \tag{20}\]