# Optical Cable Lifespan Prediction Method Based on Autoformer
## 5 Analysis of Cable Life Prediction Model Based on Autoformer  
### Comparison of Cable Life Prediction Model Results  
Predicting the lifespan of fiber optic cables demands a rigorous model assessment. This paper utilizes root mean square error (RMSE), mean absolute error (MAE), and mean square error (MSE) as pivotal metrics to gauge the accuracy of predictive models against actual values.  
In this paper, the optical cable information dataset was divided into training, validation, and test sets in a 4:1:1 ratio to ensure comprehensive coverage across different data distributions for model training, validation, and evaluation. During the experimental process, the model was configured to utilize a time window of 60 days as input, employing data from the past 60 days as input to capture the historical change trends in cable length. The encoder and decoder layers were set to two and one layers, respectively, balancing model complexity with the effective learning of data features and dependencies. The d_model was set to 4, correlating with the count of autocorrelation coefficients, to capture the temporal relationships in sequence data while ensuring computational efficiency. The learning rate was set to 0.0001, with 15 training epochs and a batch size of 16, to ensure stable model convergence during training and minimizing the occurrence of overfitting. To ensure the fairness and validity of the experiment, the configurations for the comparison models were kept identical to those of the proposed model. The comparative analysis results, as depicted in Table 1, reveal that the model proposed in this paper outperforms the comparative models across three evaluative metrics. Compared to the Bi-LSTM + Attention model, the Autoformer model achieved reductions in the RMSE, MAE, and MSE metrics by 35.46%, 49.63%, and 58.34% respectively.  
Figure 3 illustrates a comparison of forecast results for changes in optical cable lengths in 2023 within the test set between the Autoformer model and comparison models. As can be observed in Figure 3, each model is proficient in accurately predicting future information, with a minor deviation from the actual data. This indicates that the models are proficient in mining time series sequences, effectively and precisely forecasting future trends in cable length variations. Notably, the Autoformer model proposed in this paper achieves a better fit in its predictions compared to actual values, displaying heightened predictive accuracy. Furthermore, the Autoformer model's smooth and coherent prediction line overall suggests its stability and consistency in analyzing and projecting optical cable lifespan, particularly manifesting this trend when the data span a broader time range.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **RMSE** & **MAE** & **MSE** \\ \hline LSTM & 1.3184 & 1.0828 & 1.7383 \\ Bi-LSTM & 1.2361 & 0.9582 & 1.5278 \\ Bi-LSTM + Attention & 0.9131 & 0.7321 & 0.8338 \\ Autoformer & 0.5893 & 0.3687 & 0.3473 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance metrics for different models.  
It is important to note that the chosen values for the time window length and d_model are based on our understanding of the problem and the experimental results presented in this study. These values may not be optimal for all scenarios, and further investigation and fine-tuning may be required for specific applications.