## 2 Materials and Methods
### Details Structure of LightExNet
#### 2.2.4 Stacked Center Loss Function  
After the feature maps are processed by the network, they are usually computed directly using the cross-entropy loss function, as shown in Formula (6):  
\[L_{loss}=-\sum\limits_{l=1}^{m}\log\frac{e^{w_{y_{i}}^{T}x_{i}}}{\sum\limits_{j= 1}^{n}e^{w_{j}^{T}x_{i}}} \tag{6}\]  
In Formula (6): \(x_{i}\) is the output of the sample \(i\) before entering the FC layer (the last convolutional layer of the network is actually a FC layer), which belongs to the category \(y_{i}\). \(w_{j}\) denotes the weight parameter of FC layer \(j\). \(m\) is the size of the batch in a training. \(n\) denotes the number of categories.  
To enhance intra-class feature compactness and inter-class discriminability, we augment the standard cross-entropy loss with center loss, and the center loss calculation process is shown in the Formula (7):  
\[L_{c}=\frac{1}{2}\sum\limits_{i=1}^{m}\left\|x_{i}-C_{y_{i}}\right\|^{2} \tag{7}\]  
In Formula (7), \(C_{y_{i}}\) is the feature center of category \(y_{i}\). When the category \(y_{i}\) training is updated, in order to avoid the new center jittering too much, the momentum mechanism is introduced, which makes the update of the category center smoother and reduces the impact of a single sample update on the center. The update of the category center is no longer completely dependent on the features of the current batch of samples, but combines the center position of the previous round and the adjustment amount of the current batch, as shown in Formula (8):  
\[C_{y_{i}}^{(t+1)}=\beta*C_{y_{i}}^{t}+(1-\beta)*\Delta C_{y_{i}}^{t} \tag{8}\]  
In the Formula (8), \(C_{y_{i}}^{t}\) is the center of category \(y_{i}\) at the iteration \(t\). \(\Delta C_{y_{i}}^{t}\) is the adjustment amount of the current batch to the center. \(\beta\) is the momentum coefficient (usually taken as 0.5-0.9, with a value of 0.5 at the beginning of training (the first 50% of epoch) to quickly approximate the real center, and gradually increasing to 0.9 at the end of training (the last 50% of epoch) to stabilize the center position), which controls the degree of update smoothing. This approach significantly mitigates training instability while demonstrating enhanced robustness to noisy samples and label outliers.  
In facial expression recognition tasks, the use of an improved central loss function is aimed at improving the classification performance and generalization ability of the model, but at the same time, it also introduces additional computational overhead, generally increasing training time by about 10% to 20%. However, the specific proportion of computational increase that will result depends on multiple factors, making this consideration particularly critical for lightweight models where resource constraints are paramount. In order to alleviate the additional computational burden caused by the central loss function, the following measures have been taken in this paper:  
* Low-frequency update: reduce the update frequency of \(C_{y_{i}}\), in this paper \(C_{y_{i}}\) updates once every three iterations.
* Asynchronous updates: even with low-frequency updates, instead of updating the centers of all categories with each update, updates are made only for those categories that appear in the current batch.  
Finally, the overall loss function equation is:  
\[L=L_{loss}+\lambda L_{c} \tag{9}\]In Formula (9), \(\lambda\) denotes the central loss coefficient, which is used to control the proportion of the loss function. In this paper, the value of \(\lambda\) is carefully adjusted after many experimental optimizations, and finally the value of 0.03 is taken in the first 50% of the epoch to strengthen the feature aggregation, and the value of 0.008 is taken in the last 50% of the epoch to maintain the classification accuracy.  
The algorithm of the stacked center loss function module is as follows: