# Midspan Deflection Prediction of Long-Span Cable-Stayed Bridge Based on DIWPSO-SVM Algorithm
## 2 DIWPSO-SVM Algorithm
### Deflection Prediction Process of Midspan Deflection Based on DCWPSO-SVM Model  
For the accuracy and efficiency of deflection predictions, a hybrid model combining the dynamic inertia weight particle swarm optimization (DIWPSO) with support vector machine (SVM) was established, considering various influencing factors such as vertical deflection signals, ambient temperature, and vehicle load. The deflection prediction process of midspan deflection based on the DCWPSO-SVM model (Figure 3) is described as follows:  
Step (1): Data collection. Midspan essential data from the main bridge girder are collected, including the vertical deflection signals, ambient temperature, and vehicle load, which form the foundation for subsequent analysis and model training. In the collected signals, Savitzky-Golay filtering was applied to suppress high-frequency noise in deflection measurements; the Hampel filter detected and replaced outliers; and KNN estimated missing values by averaging the \(k\) nearest temporal neighbors.  
Step (2): Wavelet transform and statistical characterization. The vertical deflection signals collected are subjected to wavelet transform to decompose and reconstruct the vertical deflection database of the main girder under temperature load and vehicle load. Bystatistically characterizing the probability density of the decomposed deflection curves in terms of hours and fitting them with the normal distribution function, the hourly deflection characteristic value with the most significant probability density is identified, which serves as the sampling point for model prediction comparison, ensuring that the model is trained on representative data.  
Step (3): Algorithm improvement with DIWPSO. Addressing the instability and convergence issues of the standard PSO algorithm, the DIWPSO algorithm proposes adopting DIW, which enhances the algorithm's performance by mitigating the risk of slow convergence or falling into local extreme values. The DIWPSO algorithm, thus, provides a more robust optimization framework for parameter tuning in the SVM prediction model.  
Step (4): SVM parameter optimization. Utilizing the improved DIWPSO algorithm, the basic parameters of SVMs are optimized, involving iteratively adjusting the SVM to find the optimal combination that maximizes prediction accuracy. The DIWPSO-SVM prediction model combines the strengths of both DIWPSO and SVM for enhanced performance.  
Step (5): Bridge deflection prediction. This DIWPSO-SVM model is used to predict the bridge's midspan deflection based on the optimized parameters and the input data collected in Step (1). The model's ability to generalize from the training data is crucial for accurate predictions under varying conditions.  
Step (6): Model validation and comparison. The DIWPSO-SVM model is validated by comparing the predicted deflection sampling curves with the measured deflection sampling curves. The goodness of fit is assessed using the root-mean-square error (RMSE). This comparison allows for a quantitative evaluation of the model's performance and enables a comparison with other prediction models. The effectiveness of the DIWPSO-SVM model is determined by improving deflection prediction accuracy.  
Figure 3: Flowchart of midspan deflection prediction based on DIWPSO-SVM model.