## 4 Method
### Normalized Virtual Softmax Loss
By inserting a virtual class to every two real classes, the intra-class feature space is compressed and the inter-class feature space is pulled apart, and the ReID problem of intra-class variation and  
Figure 8: The relationship among (**a**) the weight matrix, (**b**) the feature space and (**c**) the FC layer. Figure 9: The feature space of original softmax and normalized virtual softmax. inter-class similarity may be solved. This idea is shown in the Figure 9(a), in which the gray areas indicate the inserted virtual classes. Introducing virtual class to vehicle ReID task is intuitively feasible, but the difficulty lies that how to insert the virtual class into two real classes accurately, for the FC layer of network is randomly initialized and it is difficult to track the change of the parameters during back propagation. If the virtual class is not inserted accurately, the opposite result is caused--further aggravating the problem of feature space confusion, as shown in Figure 9(b). To avoid incorrect insertion of virtual class, we take the work of [PERSON] et al. [26] as reference and discard the method of [PERSON] et al. [27], creating a new loss function called **Normalized Virtual Softmax Loss** (NV-softmax Loss). The process is as follows. **Firstly**, the output of the feature extraction network \(\mathbf{X}\) is normalized to \(\mathbf{X}^{*}\) (Equation (8)) to eliminate the sample bias that exists in original virtual softmax (Figure 11). From Equation (23), it is easy to see that \(|\mathbf{X}_{k}|\) affect the results of back propagation, which resulting in a sample-dependent bias and affects the performance of the network. Furthermore, this kind of bias just come from the network parameters and have nothing to do with the dataset, so it is endogenous bias and should be avoided as much as possible. Figure 11: The feature space with and without bias. Figure 10: Correct and incorrect insertion of virtual classes. **Secondly**, in the FC layer, the row vectors of the weight matrix \(\mathbf{W}_{i}\) is normalized to \(\mathbf{W}_{i}^{*}\) (Equation (9)) to eliminate the anchor bias which exists in the original virtual softmax (Figure 11). It is also endogenous bias. In Equation (2), the class with larger \(|\mathbf{W}_{i}|\) occupies larger region in the feature space (boundary condition is \(|\mathbf{X}||\mathbf{W}_{1}|cos\theta_{1}=|\mathbf{X}||\mathbf{W}_{2}|cos\theta _{2}\), so when \(|\mathbf{W}_{1}|>|\mathbf{W}_{2}|\), \(\theta_{1}>\theta_{2}\), as shown in Figure 11). This may not affect the performance of the network in an ordinary classification task, but in the vehicle ReID task with a large number of classes, the original virtual softmax may constrain some classes' feature space too small, increasing the possibility of misclassification. In order to make the feature spaces of all classes in the same size, we do a row normalization of \(\mathbf{W}\) from \(\mathbf{W}_{i}\) to \(\mathbf{W}_{i}^{*}\). **Thirdly**, we construct the class anchor of the virtual class \(\mathbf{W}_{v\_add}^{*}\) using the sample itself (Equation (10)). In this way, the virtual class is successfully inserted between two real classes, while no sample's ground truth belongs to the virtual class. Here the sample vector \(\mathbf{X}^{*}\) has been normalized in the first step when eliminating the sample bias, so we can just insert \(\mathbf{W}_{v\_add}^{*}=\mathbf{X}^{*}\) into \(\mathbf{W}^{*}\) directly. The placement of the insertion is of no difference, and for convenience it is inserted into the last row, which constitutes \(\mathbf{W}_{v\_ir}^{*}\) (Equation (11)). \(\mathbf{X}^{*}\) is multiplied with \(\mathbf{W}_{vir}^{*}\), to obtain \(\mathbf{S}_{vir}\), and \(\mathbf{S}_{vir}\) is normalized by softmax function to get \(\mathbf{S}_{vir}^{*}\). Referring to Equations (3) and (4), the process above can be described as Equation (12) and Equation (13), respectively. Finally a new loss \(L_{k,vir}\) is produced (Equation (14)).