In Defense of the Classification Loss for Person Re-Identification

Yao Zhai, Xun Guo, Yan Lu, Houqiang Li

TL;DR

While the Person Re-ID field has pivoted toward complex metric learning (like triplet loss) and spatial part-based models, this paper demonstrates that a refined approach to standard classification loss can actually outperform them. By partitioning global features into "channel groups" and applying multiple classification branches, the authors achieve state-of-the-art accuracy with significantly faster inference speeds.

What Problem Does This Paper Address?

Person Re-Identification (Re-ID) is the task of identifying the same individual across different, non-overlapping camera views. It is notoriously difficult due to variations in lighting, pose, and background clutter.

Historically, researchers moved away from simple classification loss (softmax) because of a "target mismatch": classification loss trains a network to identify specific people in a training set, but at test time, the network must distinguish between entirely new, unseen identities.

To solve this, the field turned to metric learning (which optimizes the distance between image embeddings) and part-based models (which slice images into horizontal stripes). However, metric learning requires tricky "hard-sample mining," and spatial slicing is sensitive to poorly cropped images or pose changes.

Methods

The authors propose a "channel grouping" framework that sticks to classification loss but changes the architecture to make it more robust:

  1. Global Feature Extraction: An image passes through a standard backbone (like ResNet-50) to produce a global feature vector via Global Average Pooling (GAP).
  2. Channel Grouping: Instead of treating the feature vector as one block, they divide it into $N_c$ groups (e.g., 8 groups).
  3. Shared 1x1 Convolutions: Each group passes through a shared 1x1 convolutional layer. This forces the network to learn discriminative patterns that are consistent across different feature dimensions.
  4. Multi-branch Classification: Each group gets its own fully-connected (FC) layer and its own softmax loss during training.
  5. Inference Flexibility: At test time, the FC layers are discarded. Users can concatenate all channel groups for maximum accuracy or use just one group for "Fast Mode" inference.

Datasets

The model was evaluated on the three most prominent Re-ID benchmarks:

  • Market-1501: 1,501 identities, 32,668 images.
  • DukeMTMC-reID: A large-scale dataset with 1,812 identities.
  • CUHK03: A challenging dataset containing both manually labeled and automatically detected bounding boxes.

Key Insights and Ideas

  • The "FC Layer" is the Bottleneck: The authors argue that in standard classification, the final FC layer does too much "heavy lifting" to bridge the gap between features and labels. By using multiple branches, the gradients from several losses force the backbone to learn more diverse and robust features.
  • Channels vs. Space: Most Re-ID models slice the image spatially (head, torso, legs). This paper slices the feature channels. Since different channels naturally focus on different attributes (e.g., some on color, others on texture), this acts as an implicit part-based model that is immune to spatial misalignment.
  • Data Utilization: Unlike triplet loss, which only compares a few samples at a time and ignores specific class IDs, classification loss utilizes the global relationship between all classes in the training set, leading to more stable optimization.

Key Results

The proposed method demonstrates significant qualitative and quantitative improvements. As shown in the t-SNE visualizations, the feature embeddings learned by the proposed method are much more compact and well-separated compared to standard classification or triplet loss.

t-SNE visualization of feature embeddings for different loss functions.
  • Superior Accuracy: On Market-1501, the proposed method achieved 92.6% Rank-1 accuracy, significantly higher than the standard classification baseline (85.9%) and even outperforming the popular Triplet Hard Loss (88.1%).
  • Efficiency: Because the model relies on global features rather than complex spatial alignments, it is much faster. In "Fast Mode" (using only a fraction of the feature vector), it maintains high accuracy while drastically reducing the computational cost of calculating distance matrices.
  • Synergy: When combined with traditional spatial part-based methods (like PCB), the accuracy climbed even higher to 93.9%, setting a new state-of-the-art at the time of publication.

Limitations and Future Work

  • Implicit vs. Explicit: While the authors hypothesize that different channel groups focus on different body parts or attributes, the paper does not provide extensive visualization (like heatmaps) to prove exactly what each channel group is "looking at."
  • Hyperparameter Sensitivity: The performance varies based on the number of channel groups ($N_c$). While 8 or 16 worked best here, the optimal number might change depending on the backbone architecture or dataset size.
  • Future Directions: The authors suggest these strategies could be applied to other computer vision tasks beyond Re-ID where the training and testing categories do not overlap.

Summary updated

BibTeX
@inproceedings{zhai2019defense,
  author = {Yao Zhai and Xun Guo and Yan Lu and Houqiang Li},
  title = {{In Defense of the Classification Loss for Person Re-Identification}},
  booktitle = {Workshops @ CVPR},
  year = {2019},
  doi = {10.1109/cvprw.2019.00194},
}
Figure