## 2 Methodology
### Improved TimesNet Module  
Subway passenger flow prediction inherently requires time series forecasting. Recent studies have seen a surge of prediction methodologies based on Transformer model variants, such as the Informer model composed of multi-head self-attention mechanisms and the Autoformer model that involves decomposing and then forecasting sequences before recombining data. These models have provided theoretical support for modeling subway passenger flow data prediction in this paper. In ICLR 2023 (a prominent academic conference in the field of machine learning and AI), the TimesNet model composed of multiple \"Timesblock\" modules emerged as a state-of-the-art (SOTA) model across various domains of time series modeling. TimesNet is capable of predicting chaotic signals by leveraging its unique design, which focuses on multi-periodicity modeling. Chaotic signals are often characterized by their complexity and sensitivity to initial conditions, making them difficult to predict using conventional time series models. However, TimesNet overcomes this challenge by transforming 1D temporal data into 2D tensors, which capture both intra-period (short-term) and inter-period (long-term) variations. This structure allows the model to disentangle complex patterns and better capture the chaotic nature of the signal. In the original TimesNet model, the TimesBlock module, which inputs sequence data, simply combines them in parallel to generate the final prediction data. In dealing with different patterns \"within the cycle\" of the data, the processing of each component is very uniform and standardized, lacking the ability to extract and predict specific characteristics of the data. The main techniques contained in our I-TimesNet module used in this paper are as follows:First and foremost, the TimesBlock is the central component of our I-TimesNet model, with its primary function being the identification of multi-periodicity within sequences and the capture of corresponding temporal changes. TimesBlock accomplishes this objective through the following three principal steps: Initially, it mines the data cycles. TimesBlock utilizes the Fast Fourier Transform (FFT) to detect multi-periodicity within the time series. FFT is a robust tool for analyzing the spectral composition of time series data, revealing periodic patterns therein. Specifically, for one-dimensional time series data \(X_{1D}\in R^{L\times C}\), where L is the sequence length and C is the number of variables, the periodic amplitude can be expressed by the following formula:  
\[A=Avg(Amp(FFT(X_{1D}))) \tag{12}\]  
In Equation (12), the formula represents the computation of the periodic amplitude using the Fast Fourier Transform (FFT) on the 1D time series data \(X_{1D}\). The result of the FFT is averaged to obtain the overall periodic amplitude \(A\), which helps in detecting the multi-periodic patterns within the data. To avoid contamination by high-frequency noise, only the first k amplitude values (frequencies) are selected. The specific selection method is as follows:  
\[f_{1},\cdots,f_{k}=argTopk(A) \tag{13}\]  
\[f_{k}\in\left\{1,\cdots,\left[\frac{T}{2}\right]\right\} \tag{14}\]  
Here, _Topk_ refers to the selection of the top k frequencies from the amplitude values. This selection process ensures that only the most significant frequencies, which are relevant for modeling the multi-periodicity, are considered. The combination of the aforementioned formula can be summarized as follows:  
\[A,\left\{f_{1},\cdots,f_{k}\right\},\left\{p_{1},\cdots p_{k}\right\}=Period (X_{1D}) \tag{15}\]  
Continuing, the second step is the transformation from 1D to 2D sequences: After detecting the multi-periodicity within the time series, TimesBlock reshapes the one-dimensional time series into a set of two-dimensional tensors based on these periods.