# LSTGINet: Local Attention Spatio-Temporal Graph Inference Network for Age Prediction
## 3 Proposed Framework of LSTGINet
### Temporal Branch (TEM)  
Multi-level features are helpful for age prediction, and there is a close correlation between brain information and age. We can obtain important temporal information from brain information in different periods, which can compensate for the shortcomings of single spatial features in age prediction. The TEM module consists of an initial feature component, a 4-stage backbone network, an improved \(BIndRNN++\)[33], and average pooling position path attention (\(PA+\)), average pooling and linear layers. First, an initial feature extraction block and a 4-stage backbone network similar in structure to the SPM module are used to obtain local spatial information of brain information in temporal data. Then, unlike the traditional LSTM, we use a newly designed \(BIndRNN++\) module with convolution operation to model the temporal information of the brain from both positive and negative directions. Since each recurrent unit in this module is independent of each other and connected across layers, different independent weight matrices are used to determine the long-term dependency and make it more effective in terms of temporal context and global semantics. Secondly, the \(PA+\) is used to refine this temporal information and focus on representing salient features and global semantics. Finally, the large-scale average pooling operation and linear layer squeeze the high-level temporal features to further improve contextual semantics' representation. The operation steps of the temporal features are as follows:  
Step 3. The input time series data are \(X_{B}\in\mathbb{R}^{C\times N\times T}\), where \(N,T,C=1\) represents the time series and channel dimensions of the input, respectively. The time series data are input into the initial feature extraction block and the high-order spatial feature extraction module, which are similar in structure to the SPM module, and the local spatial time series features \(f^{\prime}_{b}\) and the time series prior knowledge \(f_{b}\) are obtained. \(f_{b}\) and \(f^{\prime}_{b}\) are shown in Equation (4). \[ \begin{split} f^{\prime}_{b}&=\varphi(f_{b})\\ &=\varphi(MaxPool(\
abla^{*}(BN(Conv_{7\times 7}(X_{B})))))\end{split}  \tag{4}\]  
Secondly, the spatial feature map of the time series is squeezed using convolution and input into the \(BIndRNN++\) module for semantic modeling from both positive and negative directions to obtain the time series features \(f^{\prime\prime}_{b}\) containing global detail semantics. Finally, these time series features with local spatial and global semantic information are input into \(PA+\) for refinement to generate time series features \(\mathcal{F}_{b}\) containing global and local details. The specific calculation is shown in Equation (5). \[\mathcal{F}_{b}=\mathcal{H}_{PA+}(\psi(BN(Conv_{3\times 3}(f^{\prime}_{b})))) \tag{5}\]  
where \(BN(\cdot)\) indicates the batch normalization operation. \(Conv_{3\times 3}(\cdot)\) indicates the \(3\times 3\) convolution operation. \(\psi(\cdot)\) indicates the \(BIndRNN++\) operation. \(\mathcal{H}_{PA+}(\cdot)\) indicates the operation of large-scale average pooling patch attention. The output feature \(H_{t}\) of the \(BIndRNN++\) at the \(t^{th}\) moment is shown in Equation (6). \[ \begin{cases}h^{\leftarrow}_{t}=\sigma(W^{\leftarrow}\chi_{t}+[(\mu^{ \leftarrow}_{t-1}\odot h^{\leftarrow}_{t-1})\otimes(\mu^{\leftarrow}_{t-2} \odot h^{\leftarrow}_{t-2})]+b^{\leftarrow})\\ h^{\rightarrow}_{t}=\sigma(W^{\rightarrow}\chi_{t}+[(\mu^{\rightarrow}_{t-1} \odot h^{\rightarrow}_{t-1})\otimes(\mu^{\rightarrow}_{t-2}\odot h^{ \rightarrow}_{t-2})]+b^{\rightarrow})\\ H_{t}=Cat(h^{\leftarrow}_{t},h^{\rightarrow}_{t})\end{cases}  \tag{6}\]  
where \(h^{\leftarrow}_{t}\) and \(h^{\rightarrow}_{t}\) represent the forward and reverse output features at the \(t^{th}\) moment. \(W\) represents the matrix weight. \(\mu^{\leftarrow}_{t-1},\mu^{\rightarrow}_{t-1}\) represents the weight matrix at \((t-1)^{th}\) time.