# Pedestrian Re-Identification Algorithm Based on Unmanned Aerial Vehicle Imagery
## 3 Improvement of Transformer-Based Pedestrian Re-Identification Algorithm  
The Transformer model was initially introduced for natural language processing but has been successfully applied to computer vision tasks. Its self-attention mechanism enables the capture and integration of global contextual information. This mechanism overcomes the limitations of convolutional neural networks (CNNs), which are confined to extracting features within a fixed local receptive field. Consequently, the Transformer model exhibits greater adaptability and robustness in processing pedestrian images under varying poses, dynamic lighting conditions, and complex backgrounds. Vision Transformer (ViT) is an adaptation of the Transformer architecture specifically designed for vision tasks. ViT partitions input images into smaller patches and employs positional encoding to maintain spatial relationships. This approach allows the model to efficiently process image data by capturing both global and local features.  
To address the challenges associated with cross-camera variations, ViT incorporates modules such as the Jigsaw Patch Module and the Side Information Embedding Module. These components enhance the model's robustness to local perturbations and enable the integration of non-visual information, such as camera ID and viewpoint. However, despite these advancements, ViT's ability to extract local feature and global feature context remains insufficient when handling the complex behaviors of pedestrians in multi-view UAV aerial imagery.  
To address these limitations, we propose MNTReID, a novel framework that combines three core components: the Transformer network, the multi-scale graph convolutional network (MU-GCN), and the non-local attention mechanism. In the local feature extraction branch of the Transformer, the MU-GCN utilizes multi-scale convolutional kernels to capture detailed features of pedestrians effectively. The extracted features are further refined through graph convolutional operations, which enhance the model's ability to focus on complex pedestrian behavioral patterns. In the global feature branch, the non-local attention mechanism addresses the Transformer's limitations in capturing long-range dependencies. By establishing dependencies between arbitrary positions in the image, this mechanism allows the model to integrate global contextual information more effectively, thereby enhancing performance in multi-view UAV imagery. The structure of MNTReID is illustrated in Figure 1.  
During the model training phase, this study employs a combined approach of ArcFace Loss and Triplet Loss. ArcFace Loss improves the separability of inter-class features by incorporating angular constraints during classification. It also reduces intra-class feature variations. This dual effect enhances the model's ability to distinguish between similar pedestrians. In contrast, Triplet Loss refines the organization of the feature space by minimizing the distance between positive samples and maximizing the distance between negative samples. This process improves the model's discriminative capability. The joint application of these loss functions aims to enhance both the identification accuracy and the generalization capability of the model.  
To fully exploit the complementary nature of global and local features, the global feature vectors, local feature vectors, and multi-scale graph convolutional features are concatenated during the testing phase. This concatenation results in a more comprehensive and discriminative pedestrian embedding. Pedestrian matching is efficiently conducted by computing the Euclidean distance between the integrated feature representation and the stored features in the pedestrian database.