This invention belongs to the field of image classification in
computer vision, specifically relating to a
facial expression recognition method based on the fusion of visual
Transformer and convolutional network. The method has the following features and includes the following steps: Step 1, preprocessing the image to be trained to obtain a preprocessed image; Step 2, inputting the preprocessed image into a model based on the fusion of visual
Transformer and convolutional network for training, thereby obtaining the model's weight file. This model includes a convolutional module, an
encoder, and an attention mechanism. The convolutional layer includes associating the positional information of image features; the
encoder includes multiple residual modules, which use the
encoder's input and final output as the encoder's final output. The encoder consists of multiple residual modules, and these outputs are used as inputs for the fusion attention mechanism; the fusion attention mechanism uses the output of the
pooling layer as input to the attention mechanism module, and uses an adaptive attention mechanism to find different weight responses in the features of the input feature map, finally inputting it into the visual
Transformer for training; Step 3, loading the model weight file, inputting the test
facial expression image into the model to obtain the expression prediction result. Furthermore, the
facial expression recognition
cutting model of the present invention can better separate features between different categories, thereby improving the accuracy of the expression recognition
model prediction.