## 2 Methodology
### Hybrid Time-Frequency Loss  
A novel Hybrid Time-Frequency Loss (HTFLoss) function was implemented. Traditional MSE methods calculate prediction errors considering only time-domain information [39], and treat all errors equally. However, for tasks such as predicting joint moments, focusing on errors in the frequency domain is crucial. High-frequency components are typically associated with rapid changes in joint moments, while low-frequency components correspond to slower variations [40]. Frequency domain analysis aids in better understanding the dynamic characteristics of movement (e.g., muscle force exertion and joint kinematics). HTFLoss combines time-domain and frequency-domain errors, capturing dynamic changes in predictions more comprehensively and enhancing the model's sensitivity to rapid changes and smoothing transitional states. Figure 4: The diagram of the SFT model illustrates the replacement of the traditional attention mechanism with a Multilayer Perceptron (MLP). Initially, the MLP is used to extract features from the input. To mitigate overfitting, dropout is applied to randomly discard a subset of weights. Subsequently, Layer Normalization (LN) is performed to regularize the model. This process is then repeated, and the final output is the adaptive weights of the SFT model. In fact, by combining the time domain with the frequency domain, the HTFLoss function is specifically tuned to enhance sensitivity to sudden, significant changes by assigning greater weight to frequency domain errors in tasks involving dynamic motion, which is essential for accurate moment prediction is crucial. This targeted approach allows for better understanding and handling of prediction errors, ensuring that significant changes in joint dynamics do not go unnoticed, which is critical for precise movement control and injury prevention. Paying more attention to frequency domain components can help accurately capture the local characteristics of joint motion, which is crucial in scenarios such as rehabilitation treatment and sports performance monitoring, thus greatly improving the overall prediction accuracy of the model. The specific process involves the following mathematical expressions, where _Abs_ represents the modulus of the complex number, \(FFT\) stands for the fast Fourier Transform, \(W_{F}\) denotes the weights for the frequency domain, with a range of 0.6 to 0.9, performing best at 0.9, and \(W_{T}\) represents the weights for the time domain, with a range of 0.1 to 0.4, performing best at 0.1, and _Mean_ signifies the calculation of the average:  
(1) Compute the error between predicted values and ground truth :  
\[Error=Prediction-Target \tag{3}\]  
(2) Decompose the error into frequency domain using Fourier transformation:  
\[Frequency_{domain}=Abs(FFT(Error)) \tag{4}\]  
(3) Assign weights to the frequency domain and time domain:  
\[F_{loss}=W_{F}\times Mean(Frequency_{domain}{}^{2}) \tag{5}\]  
\[T_{loss}=W_{T}\times Mean(Error^{2}) \tag{6}\]  
(4) Sum the losses of the frequency domain and time domain to obtain the total loss:  
\[Total_{loss}=F_{loss}+T_{loss} \tag{7}\]  
This chapter mainly introduces the design concept of the model, aiming to improve the performance of the model in related tasks.