# Time Series Forecasting Method Based on Multi-Scale Feature Fusion and Autoformer
## 2 Materials and Methods
### Proposed Method
#### 2.3.3 Prediction Model  
Integrating the sub-methods proposed above, this paper presents a time-series prediction model, named MD-Autoformer, which is based on Autoformer. This model incorporates multi-scale feature fusion and date-time encoding techniques, and its network structure is shown in Figure 3. The input data of the model includes multiple features closely related to apparel sales. The input of the encoder is denoted as \(x_{\text{en}}\in\mathbb{R}^{I\times d}\), where \(I\) represents the length of the sequence and \(d\) represents the dimension of the data. The input of the decoder mainly consists of two parts: the seasonal component input \(x_{\text{des}}\in\mathbb{R}^{(\frac{I}{2}+\alpha)\times d}\) and the trend component input \(x_{\text{det}}\in\mathbb{R}^{(\frac{I}{2}+\alpha)\times d}\). Both parts are provided by the encoder with extracted information of length \(\frac{I}{2}\), where \(O\) is a placeholder used to fill in the initial values of the predicted sequence. The mathematical expressions of the model's input are shown in Equations (10)-(12). \(x_{0}\) and \(x_{\text{mean}}\) represent the zero-padding placeholder and the mean value of \(x_{\text{en}}\), respectively.  
\[x_{\text{ens}},\ x_{\text{ent}}=\text{SeriesDecomp}\Big{(}x_{\text{en}\frac{ I}{2}:I}\Big{)} \tag{10}\]  
\[x_{\text{des}}=\text{Contact}(x_{\text{ens}},x_{0}) \tag{11}\]  
\[x_{\text{det}}=\text{Contact}(x_{\text{ent}},x_{\text{mean}}) \tag{12}\]  
The multi-scale feature fusion matrix processed by the encoder is combined with the seasonally initialized input and the trend-initialized input. It is then processed again through the automatic correlation mechanism and the sequence decomposition module. Finally, the seasonal decomposition module and the multi-scale feature fusion network further extract deep features, enhancing the model's nonlinear expression capability and  
Figure 3: The network architecture of MD–Autoformer.  
generating the final prediction results. This process not only takes into account the seasonality and trend components of the time series, but also captures the subtle features in the sequence through the multi-scale feature fusion network, thereby improving the model's ability to explain the periodicity and random disturbances of the time series.  
The MD-Autoformer addresses stationarity and seasonality through the following mechanisms: First, the seasonal decomposition module in the Autoformer framework separates time series into seasonal and trend components using moving average operations to isolate periodic patterns. Second, the multi-scale feature fusion network enhances multi-periodicity modeling through parallel convolutional branches with varying receptive fields. For stationarity, two practical measures are implemented: (1) input normalization stabilizes statistical properties across features, and (2) in data preprocessing, we conduct the Augmented Dickey-Fuller (ADF) test for stationarity. Non-stationary series undergo first-order differencing until passing the ADF test. This combined strategy ensures robust handling of both stationary and non-stationary components in time series.