## 2 Materials and Methods
### Details Structure of LightExNet
#### 2.2.3 Spatial Attention Module  
In the facial expression recognition task, the features that are meaningful for expression classification are mainly concentrated on the key parts such as eyebrows, eyes, nose, and mouth, this is due to the fact that these positions contain more texture information, and the features (such as gradient and grayscale, etc.) of these positions will change drastically when a person makes different expressions, so the weight of these key parts can be increased in the feature map by the spatial attention module, which makes the network focus more on the features that are crucial for expression recognition and improve the feature extraction ability of the network. The features of different parts (e.g., eyes, nose, mouth, etc.) may exist in different sizes of receptive fields, and according to the different proportions of the face in the input image, the texture features will also exist in different sizes of receptive fields, if the receptive field is too small, only local features can be observed, and if the receptive field is too large, too much ineffective information is obtained. To address this, we integrate multi-scale feature extraction with spatial attention mechanisms, which can extract weighted features more robustly than single-scale attention. Figure 6 shows the spatial attention module proposed in this paper. We combines multi-scale feature extraction with spatial attention, which can compute the spatial attention map more finely. In order to calculate the spatial attention, it is first necessary to aggregate the channel information and encode the input feature map into a spatial descriptor in the channel dimension, and we adopts maximum pooling and 3 \(\times\) 3 convolution to realize this operation. First, the input feature map is maximally pooled to form a maximally pooled layer feature map \(H\times W\times 1\), and then the input feature map \(F\in\mathbf{R}^{\times h\times w}\) is input into a convolutional layer with a convolutional kernel size of 3 \(\times\) 3, in order to extract the features in the sensory field of convolutional kernel with the size of 3 \(\times\) 3. To preserve edge information during convolution operations, we employ zero-padding with a single-pixel border around the feature map boundaries, and the size of the feature map obtained after the convolution is \(H\times W\times 1\), so the size of output feature maps obtained from the maximally pooled layer and the 3 \(\times\) 3 convolution layer is same, i.e., \(F_{1}\in\mathbf{R}^{1\times H\times W}\), \(F_{2}\in\mathbf{R}^{1\times H\times W}\). Combine \(F_{1}\) and \(F_{2}\) in the channel direction to generate an effective feature description, and then use a \(7\times 7\) convolution kernel (the feature map boundary needs to be filled with 3 layers to avoid losing edge information) for convolution calculation to obtain a spatial attention feature vector with a size of \(H\times W\times 1\). Finally, the resulting feature vector undergoes nonlinear transformation via sigmoid activation, compressing each spatial feature descriptor to a range of 0-1, and finally outputting the spatial attention feature map \(M_{S}\). At last, the spatial attention map is used as a weight and multiplied  
Figure 5: Channel attention module. In the figure, the green represents the input feature map, the red indicates the 3 \(\times\) 3 average pooling branch, the purple represents the 3 \(\times\) 3 max pooling branch, the dark blue corresponds to the 1 \(\times\) 1 max pooling branch, and the yellow denotes the 1 \(\times\) 1 average pooling branch. element by element with each channel of the input feature map to obtain the final weighted feature map. The spatial attention calculation method is shown in Formula (4).