The invention discloses a facial expression recognition method and device based on spatial attention. The method comprises the steps of obtaining a spatial attention module; building a depth feature extraction network according to the spatial attention module; training the deep feature extraction network on a public natural facial expression data set to obtain a facial expression recognition model; and inputting a target face image into the face expression recognition model for recognition. The technical problem of insufficient extraction of local detail features in facial expression feature extraction in the prior art is solved. The technical effects that a spatial attention mechanism is added during facial expression feature extraction, spatial weight distribution of facial features canbe learned adaptively, the weight of an area with recognition information in facial expressions can be enhanced, the negative influence of a background and an unrelated area can be reduced, and a facial expression recognition result is improved are achieved.
Facial expression recognition method and device based on spatial attention