This paper addresses the challenge of person re-identification (ReID) in wide area video surveillance, focusing on reducing intra-class variations and increasing inter-class variations to improve model generalization. The authors propose a quadruplet loss, which extends the triplet loss by adding a new constraint that pushes away negative pairs from positive pairs with different probe images. This design aims to achieve smaller intra-class variations and larger inter-class variations, enhancing the model's performance on unseen testing identities. The proposed quadruplet deep network uses margin-based online hard negative mining to select hard samples for training, adaptively setting the margin threshold based on the trained model. Extensive experiments on datasets such as CUHK03, CUHK01, and VIPeR demonstrate that the proposed method outperforms most state-of-the-art algorithms, showing significant improvements in performance. The paper also includes a theoretical analysis of the relationships between different losses, providing a unified view of their effectiveness in person ReID.This paper addresses the challenge of person re-identification (ReID) in wide area video surveillance, focusing on reducing intra-class variations and increasing inter-class variations to improve model generalization. The authors propose a quadruplet loss, which extends the triplet loss by adding a new constraint that pushes away negative pairs from positive pairs with different probe images. This design aims to achieve smaller intra-class variations and larger inter-class variations, enhancing the model's performance on unseen testing identities. The proposed quadruplet deep network uses margin-based online hard negative mining to select hard samples for training, adaptively setting the margin threshold based on the trained model. Extensive experiments on datasets such as CUHK03, CUHK01, and VIPeR demonstrate that the proposed method outperforms most state-of-the-art algorithms, showing significant improvements in performance. The paper also includes a theoretical analysis of the relationships between different losses, providing a unified view of their effectiveness in person ReID.