###### Abstract  
The relationships among different subregions in facial images and their varying contributions to facial expression recognition indicate that using a fixed subregion weighting scheme would result in a substantial loss of valuable information. To address this issue, we propose a facial expression recognition network called BGA-Net, which combines bidirectional gated recurrent units (BiGRUs) with an attention mechanism. Firstly, a convolutional neural network (CNN) is employed to extract feature maps from facial images. Then, a sliding window cropping strategy is applied to divide the feature maps into multiple subregions. The BiGRUs are utilized to capture the dependencies among these subregions. Finally, an attention mechanism is employed to adaptively focus on the most discriminative regions. When evaluated on CK+, FER2013, and JAFFE datasets, our proposed method achieves promising results.  
facial expression recognition; attention mechanism; sliding window; Bi-GRU 2  
Neurons in recurrent neural networks (RNNs) can receive information not only from themselves but also from other neurons through a recurrent mechanism, and this mechanism can effectively alleviate the problem of not being able to obtain the long-range inductive bias in CNNs [20]. BiGRU is a branch of RNN. It can solve the gradient vanishing or gradient explosion problem in backpropagation and makes learning the contextual information of the provided sequence easier [21; 22]. Sequence data is the input for BiGRU and, as it can create global dependencies between sequence data, it is frequently used for tasks like language production and speech recognition. There are also global dependencies between different facial regions, so it is also suitable for FER.  
In summary, BGA-Net is proposed to alleviate the uncertainty of facial expression; by adopting the sliding window cropping strategy, the facial region feature information and the facial global feature information are completely retained, and the dependency between different facial regions is captured by BiGRU; by using the attention mechanism, different weights are assigned to multiple facial region features of the inputs, to inhibit the influence of the useless facial region features and the noisy region features; and Focal Loss is introduced [23], which enables the model to take more note of the difficult-to-classify objects by focusing on the focusing parameter, thereby enhancing the model's classification performance.  
The following is a brief summary of our study's contributions.  
* A novel facial expression recognition method fusing an attention mechanism is proposed, by which attention to key regions can be enhanced.
* A sliding window cropping strategy is applied to acquire multiple facial subregion feature vectors and the effects of different scales of windows as well as step size on expression recognition are explored.
* The BiGRU structure is employed to establish the global dependency between the global region and each facial subregion in two directions, and the effects of different network layers and different input sequence feature dimensions are explored.
* The Focal Loss function is adopted to cope with difficult samples in the facial expression recognition issue and the effect of hyperparameters on FER is investigated.