## 4 ATT-BiLSTM Anomaly Data Processing
### ATT-BiLSTM Model Setup and Training  
In the ATT-BiLSTM model construction and training process, the two core components--the BiLSTM layer and the Attention Mechanism--are fully utilized. For the bridge deflection data anomalies, based on experience and experimental results, after many iterations of parameter tuning, we finally obtained the optimal model parameters and structural settings. The following is a detailed introduction of the model hyperparameters and the network structure design. 1. Hyperparameterization 1. Learning Rate: The learning rate is a pivotal hyperparameter that dictates the step size of the model during parameter updates, thereby influencing the rate of model convergence. A modest learning rate was selected to guarantee the model's steady convergence during the training process. The learning rate was established at 0.001, as specified by learning_rate = 0.001. Through a series of experiments and research studies, it was ascertained that this specific learning rate facilitated rapid convergence of the model while ensuring that the optimal solution was not bypassed during the training process, thereby yielding favorable outcomes. 2. Dropout Rate: The dropout rate is employed to regulate the random disconnection of neurons during the training process. It is set to 0.01 to maximize the model's expressive capacity during training while mitigating the risk of overfitting, as specified by dropout_rate = 0.01. 3. Number of Layers: The number of network layers refers to the number of LSTM layers in the model. According to related studies, a two-layer bidirectional LSTM is beneficial for the model to capture long-term dependencies in the input sequences. Therefore, the number of network layers in this model is set to two, which is specified by num_layers = 2 [29]. 4. Hidden Size: The quantity of hidden layer nodes is contingent upon the number of neurons in each LSTM layer, constituting a pivotal parameter within the model. In order to guarantee that the model does not become excessively complex while simultaneously acquiring knowledge of the task features, subsequent to parameter tuning, the number of hidden layer nodes is configured to 128, as specified by the hidden_size parameter set to 128. 2. Model structure setup 1. BiLSTM Layer: A bidirectional LSTM layer is employed for the purpose of bi-directional modeling of input sequences. The number of input features is designated as input_size, while the number of output features is calculated as hidden_size multiplied by two (bidirectional) with num_layers layer, created by nn.LSTM. 2. Attention Mechanism: The Attention Mechanism is employed to enhance the model's attention to the input sequence. Attention inputs are of size hidden_size \(\times\) 2, and outputs are of size hidden_size \(\times\) 2. Two linear layers were created by nn.Linear. 3. Full Connectivity Layer: The Attention output was mapped to the final output dimension, with an input feature count of hidden_size \(\times\) 2 and an output feature count of 1. This mapping was created by nn.Linear. 3. Loss function and optimizer selection 1. Loss Function: The primary objective of this model is to predict the value of deflection, a process often referred to as regression. The mean square error, a statistical measure of the average squared difference between predicted and actual values, is employed in regression analysis. The formula for the mean square error is as follows: \[MSE=\frac{1}{n}\sum_{i=1}^{n}\Big{(}y_{i}-\hat{y}_{i})^{2}\] (10) where \(n\) is the number of samples, \(y_{i}\) is the actual label, and \(\hat{y}_{i}\) is the predicted output of the model. 2. Optimizer: The Adam optimizer (torch.optim.Adam) is an adaptive learning rate optimization algorithm that automatically adjusts the learning rate for each parameter, with different learning rates for different parameters, so that this training process converges more efficiently. 4. Training Process 1.