# Cross-Camera Erased Feature Learning for Unsupervised Person Re-Identification
## 3 Materials and Methods
### Cross-Camera Global Feature Learning  
In supervised person re-identification method, the distance between pictures with same identity is usually minimized, and the distance between pictures of different identity is maximized. But there is no identity information in unsupervised person re-identification. In order to obtain more accurate category information, we classify features by minimizing intra-class gaps while maximizing inter-class gaps in feature space of the whole image. We use circular sorting to mine negative samples in mini-batch,  
Figure 2: The structure of our unsupervised Cross-camera Erased Feature Learning (CEFL) network. In the three branches from top to bottom, we used three different components and loss functions. Features is classified by minimizing intra-class gaps while maximizing inter-class gaps in cross-camera global feature learning. Similar erased feature vectors are pulled together and dissimilar features are pushed away in erased partial feature learning. Global features and erased features are used together in joint global and partial feature learning. and use different styles of pictures generated by Camstyle network as positive samples. On this basis, we propose a corresponding quadruple loss function. In this section, we will guide the cross-camera global feature learning branch to mine discriminative information on unlabeled datasets. **Selection of negative samples:** We determine negative samples in mini-batch image set. If there are two pedestrian images with same identity in mini-batch, they are most likely to be the nearest neighbors to each other. In the same way, if two samples in a mini-batch are not nearest neighbors of each other, they may have different identities. Based on this concept, we add a circular sort to determine negative samples from a mini-batch set. Given a mini-batch of \(M\) global sample features \([S_{i}]_{i=1}^{M}\), ranking result of each global feature \(s_{i}\) are generated based on pairwise similarity measure method. And Euclidean distance metric is used to calculate the similarity between two global features. A ranking list \(L_{i}\) of \(s_{i}\) is obtained by sorting the obtained similarity measurement results. Then, we traverse the sorted list \(L_{i}\) in turn. For each negative sample candidate of global features \(s_{j}\in L_{i}\), Euclidean distance measurement method is also used to calculate the sorted list of \(s_{j}\). If \(s_{i}\) is not the top- \(t\) nearest neighbor of \(s_{j}\), it is considered that \(s_{j}\) is a negative sample of \(s_{i}\). We choose the first and second feature of ranking list \(L_{i}\) as negative sample candidates in cross-camera global feature learning. And we select the first global feature of ranking list \(L_{i}\) as a negative sample in joint global and partial feature learning. **Selection of positive samples:** Since the probability of finding two images with same identity is really low in a mini-batch set, we directly use the pedestrian images generated in Camstyle [34] as the positive samples. By adopting Camstyle [34], for each original training image, images with styles of other cameras are generated. As shown in Figure 3, these generated images maintain the original identity information while benefit the cross-camera feature learning. The loss function of global feature learning is defined as follows:  
\[L_{G}=\max\{\big{\|}|s_{i}-p_{i}\big{\|}_{2}-\big{\|}s_{i}-n1_{i}\big{\|}_{2}+ \text{g}1,0\}+\max\{\big{\|}|s_{i}-p_{i}\big{\|}_{2}-\big{\|}n1_{i}-n2_{i} \big{\|}_{2}+g2,0\} \tag{1}\]  
where \(p_{i}\) is the positive sample feature replaced by the generated image, \(n1_{i}\) and \(n2_{i}\) are negative sample features. \(g1\) and \(g2\) are threshold parameters, where \(g1=0.2\), \(g2=0.1\). We choose the first and second feature of ranking list \(L_{i}\) as negative sample candidates \(n1_{i}\), \(n2_{i}\), respectively.