## 3 Materials and Method
### Proposed Method
#### 3.2.4 Skip Loss Function  
In deep learning models, the loss function is a crucial factor that measures the difference between model predictions and actual values, directly affecting the model's training effectiveness and final performance. Traditional loss functions, such as cross-entropy loss or mean squared error loss, typically calculate the error between predictions and true values independently at each output node, then average these errors. While this method performs well in many tasks, particularly when the output layer structure is relatively simple, it may not fully utilize information passed through skip connections in deep networks with such connections, potentially leading to poor training outcomes or unstable training processes. The design of the skip loss function allows the model to consider inter-layer dependencies introduced by skip connections during loss computation. It accounts not only for errors at individual nodes but also for related errors across layers, enabling the model to better understand and utilize deep information transmitted through skip connections. The core of the skip loss function is the weighted loss terms, dynamically adjusted based on the path data take through the network, thereby optimizing the network's learning of crucial information. The specific mathematical formula is as follows:  
\[L(\theta)=\sum_{i=1}^{N}\left(\alpha_{i}\cdot L_{\text{main}}(y_{i},\hat{y}_{i })+\sum_{j\in S(i)}\beta_{ij}\cdot L_{\text{skip}}(y_{i},\hat{y}_{j})\right) \tag{7}\]  
Here, \(N\) is the number of training samples, \(y_{i}\) is the actual label for sample \(i\), \(\hat{y}_{i}\) is the corresponding model prediction, and \(L_{\text{main}}\) is the primary loss function, such as cross-entropy or mean squared error, used to calculate the main error between model output and actual labels. \(\alpha_{i}\) is the weight of the main loss term, \(S(i)\) represents the set of layers connected to sample \(i\) through skip connections, \(\beta_{ij}\) is the weight of the loss term for layer \(j\) connected to sample \(i\) through a skip connection, and \(L_{\text{skip}}\) is the loss function for skip connections, used to calculate errors across layer outputs.  
The design of the skip loss function is based on mathematical and practical considerations: in deep networks, gradient transmission issues can restrict the update of features in lower layers, hindering the model's ability to learn complex data patterns effectively. By introducing skip connections, the model can directly feedback deep features to shallower layers, but if the loss function only calculates errors at the output layer, this deep-layered information might not be sufficiently utilized. By introducing additional loss calculations for every layer with skip connections, the skip loss function allows for a more balanced update of weights across layers, enhancing information flow and learning efficiency from bottom to top layers. In complex networks utilizing the skip attention mechanism, the skip loss function offers the following advantages:1. Improved gradient flow: By adding extra loss calculations for cross-layer connections, it helps address the problem of vanishing gradients, especially evident in deeper networks.
2. Enhanced model learning capability: It enables the model to more effectively learn and utilize features transmitted through skip connections, thus improving overall prediction accuracy and generalization ability.
3. Increased training stability: By dynamically adjusting the weights of loss at different layers, it makes the training process more stable, reducing fluctuations during training.  
In summary, the introduction of the skip loss function not only optimizes the mathematical structure of the model but also provides a more effective training strategy for handling complex data. In fields like secure computing, image recognition, and natural language processing, which require processing large-scale data, this design significantly enhances the model's performance and practical applicability.