The application discloses a
pedestrian re-identification method and device integrating multi-head self-attention and
convolution. The proposed double-layer multi-head self-attention (DL-MHSA) divides a
feature matrix by a grid, and decomposes the MHSA into two
layers, the first layer only calculates the features in a single grid, and the second layer calculates the overall features on the basis of the grid, and the two-step operation reduces the calculation complexity; the DL-MHSA is introduced into the OSNet, the features of different scales and global features are fused, the model can obtain more recognizable features for the input pictures, and the
pedestrian re-identification performance is improved; and the model is pre-trained by using a large-scale unlabeled
pedestrian dataset, the model obtains high-level
semantics beneficial to the task, the performance of subsequent fine-tuning training on a labeled dataset is improved, and the generalization capability of the model is stronger.