## 3 Proposed Method
### Attention-Based Feature Extractor  
**PTN.** Vehicle pictures are taken by surveillance cameras, which essentially show the projection of the real scene on the camera chip, as in Figure 5. Owing to the different camera parameters and environmental factors, the obtained vehicle pictures often contain varying degrees of distortion. To eliminate the effects of projection transformations in different scenes, we propose a PTN, which predicts the transformation \(\theta\) to apply to the input image using Equation (6), as shown in Figure 6. The main structure of the PTN comprise two convolutional networks, both of which output a \(3\times 3\) transformational matrix. We apply this transformational matrix to the features after the first block. The first two rows of the transformational matrix are identical to the affine matrix, which implements linear transformation and translation, and the third row is used to implement perspective transformation.  
\[\left(\begin{array}{c}x^{\prime}_{i}\\ y^{\prime}_{i}\\ w^{\prime}_{i}\end{array}\right)=\mathcal{T}_{\theta}\left(G_{i}\right)= \left[\begin{array}{ccc}\theta_{11}&\theta_{12}&\theta_{13}\\ \theta_{21}&\theta_{22}&\theta_{23}\\ \theta_{31}&\theta_{32}&\theta_{33}\end{array}\right]\left(\begin{array}{c }x^{t}_{i}\\ y^{\prime}_{i}\\ 1\end{array}\right), \tag{6}\]  
where \((x^{t}_{i},y^{t}_{i})\) are the target coordinates of the regular grid in the output feature map, and \((x^{s}_{i}=x^{\prime}/w^{\prime},y^{s}_{i}=y^{\prime}/w^{\prime})\) are the source coordinates in the input feature map that define the sample points. The main purpose of PTN is to eliminate the deformation by perspective transformations of vehicles in the images.  
Figure 4: Visualizations of input images and their corresponding attention descriptor.White areas represent larger weights to the images.  
**CTL.** We used ResNet-50 [36] as the base model of the feature extractor after PTN. As mentioned earlier, a component in the model was dedicated to extracting explicit key areas of images; some implicit features that play an important role in the re-ID task could not be extracted at the pixel level. Therefore, we applied the attention map \(\mathbf{M}\in\mathbb{R}^{1\times H\times W}\) to the intermediate feature map. The activated feature, \(\mathbf{f}^{\prime}\in\mathbb{R}^{C\times H\times W}\), can be expressed as follows:  
\[\mathbf{f}^{\prime}=\mathbf{M}\otimes\mathbf{f}, \tag{7}\]  
where \(\otimes\) and \(\mathbf{f}\) denote the element-wise multiplication and input feature, respectively. We obtained an attention map \(\mathbf{M}\) through a transposed convolutional layer after a convolutional layer (CTL), as shown in Figure 7. The main purpose of the CTL is to extract the more informative part of the feature.  
Figure 5: Schematic of projection transformation. \((x,y)\) are the coordinates in the real scene, and \((x_{proj},y_{proj})\) are the corresponding coordinates in the camera chip. Different cameras exhibit different degrees of distortion.  
Figure 6: The perspective transformer network(PTN) architecture, composed of two convolutional networks, is used to transform the image. \(\theta\) is a \(3\times 3\) transformation matrix.