# Optical Cable Lifespan Prediction Method Based on Autoformer
## 4 Autoformer-Based Optical Cable Life Prediction Model  
### Architecture of Autoformer  
Autoformer is an innovative sequence modeling framework that breaks the paradigms of traditional sequence models. This model merges conventional sequence decomposition methods with novel auto-correlation mechanisms to more accurately capture the trends and dependencies within sequential data. Unlike traditional approaches, Autoformer is not limited to merely decomposing sequences into sub-sequences but instead incorporates the decomposition process into the model's network structure, enabling a more flexible handling of future sequence predictions. Furthermore, Autoformer leverages the transformer's self-attention mechanism, capturing the complex relationships between sequencesthrough point-to-point similarities, which enhances the model's efficiency and precision during learning. In time series data analysis, sub-sequences at the same position across different periods may exhibit similar trends. The auto-correlation mechanism introduced by Autoformer further strengthens the model's ability to capture the characteristics of sequential data, thereby improving the accuracy and stability of predictions. The structure of the Autoformer model is illustrated in Figure 1. It primarily consists of three modules: the auto-correlation mechanism, the series decomposition module, and the feed forward network layer [8]. The encoder primarily focuses on the periodic elements, using the preceding I time steps to compose the input time series. Governed by autocorrelation mechanisms, the encoder performs an initial sequence decomposition, dividing the original input time series into trend and periodic elements sent to the decoder. As a result, the decoder's input consists of both trend and periodic elements, signifying long-term trends and periodicity. The specific calculation formula is outlined as follows:  
\[x_{t}=AvgPool(Padding(x)), \tag{16}\]  
where \(x\) denotes the input time series, and \(x\) undergoes a sliding average operation (AvgPool) to derive the trend component \(x_{t}\)[17]. The AvgPool operation utilizes a sliding window of 60 days, meaning each data point in \(x_{t}\) represents the trend value, calculated from the preceding 60 days of the input time series \(x\). Additionally, the Padding operation preserves the sequence length [18]. \[x_{s}=x-x_{t}, \tag{17}\]  
where \(x_{s}\) represents the periodic component, obtained by subtracting the trend component derived from (16) from the original input time series. The decoder, fed with seasonal and trend components, engages in a layer-by-layer sequence dissection governed by the autocorrelation mechanism. Moreover, each decoding layer manipulates complete time series data, not discrete points, ensuring step-by-step predictions to enhance forecast reliability and accuracy. The decoder operates through two key components: firstly, it iteratively extracts trend-related information by synthesizing inputs from the encoder's trend output. Then, for processing the encoder's seasonal output, it applies a stacked autocorrelation mechanism to detect patterns and integrate related sub-processes. This sequence aims to progressively refine the model's ability to predict by understanding and leveraging the temporal structure inherent within the data. Considering a decoder with \(N\) encoding layers, let us take the first decoding layer as an example to illustrate its operation. Given that the decoding layer manages operations entailing both the input time series and output derived from  
Figure 1: Autoformer architecture. The encoder eliminates the long-term trend–cyclical part by series decomposition blocks and focuses on seasonal patterns modeling. The decoder accumulates the trend part extracted from hidden variables progressively. The past seasonal information from encoder is utilized by the encoder–decoder auto-correlation. the encoding layer, the depiction of the initial decoding layer is articulated by \(x_{d}^{l}=Decoder\Big{(}x_{de}^{l-1},x_{ent}^{N}\Big{)}\).