Improving Hard Negative Handling for Individual Dog Re-identication with Facial Biometrics
Main Article Content
Abstract
Visual biometrics, such as facial recognition, play an important role in authentication and identification. This concept extends to animal biometrics, particularly for identifying individual dogs, which is useful for veterinary care, ownership verification, population control, and disease monitoring. However, distinguishing visually similar dogs within the same breed remains challenging due to hard negative samples. In this work, we propose a deep learning model for individual dog re-identification using contrastive learning with a binary cross-entropy loss function. Instead of treating each dog as a separate class, the proposed framework learns a similarity function from positive and negative image pairs, including a high proportion of hard negative pairs during training, to better capture fine-grained facial differences. Experimental results show that the proposed model achieves 96.83% accuracy on hard negative samples and 81.48% accuracy on the public Flickr dog dataset in a zero-shot setting, demonstrating improved performance in same-breed dog re-identification over traditional multiclass classification approaches.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
W. Thanapongtharm et al., “Spatial distribution and population estimation of dogs in Thailand: Implications for rabies prevention and control,” Front. Vet. Sci., vol. 8, p. 790701, Dec. 2021.
I. Yaqoob, M. U. Hassan, D. Niu, X. Zhao, I. A. Hameed and S.-U. Hassan, “A novel person reidentification network to address low-resolution problem in smart city context,” ICT Express, vol. 9, no. 5, pp. 809–814, Oct. 2023.
H. S. K¨uhl and T. Burghardt, “Animal biometrics: Quantifying and detecting phenotypic appearance,” Trends in Ecology & Evolution, vol. 28, no. 7, pp. 432–441, Jul. 2013.
M. Lahiri, C. Tantipathananandh, R. Warungu, D. I. Rubenstein and T. Y. Berger-Wolf, “Biometric animal databases from field photographs: Identification of individual zebra in the wild,” in Proceedings of the 1st ACM International Conference on Multimedia Retrieval (ICMR ’11), no.6, pp. 1–8, 2011.
A. Ardovini, L. Cinque and E. Sangineto, “Identifying elephant photos by multi-curve matching,” Pattern Recognition, vol. 41, no. 6, pp. 1867–1877, Jun. 2008.
S. Kumar and S. K. Singh, “Automatic identification of cattle using muzzle point pattern: A hybrid feature extraction and classification paradigm,” Multimedia Tools and Applications, vol. 76, pp. 26551–26580, Dec. 2016.
X. Tu, K. Lai and S. Yanushkevich, “Transfer Learning on Convolutional Neural Networks for Dog Identification,” 2018 IEEE 9th International Conference on Software Engineering and Service Science (ICSESS), Beijing, China, pp. 357-360, 2018.
A. Khosla, N. Jayadevaprakash, B. Yao and F.-F. Li, “Novel dataset for fine-grained image categorization: Stanford Dogs,” in Proceedings CVPR Workshop Fine-Grained Visual Categorization (FGVC), 2011.
M. Chanvichitkul, P. Kumhom and K. Chamnongthai, “Face recognition based dog breed classification using coarse-to-fine concept and PCA,” 2007 Asia-Pacific Conference on Communications, Bangkok, Thailand, pp. 25-29, 2007.
P. Prasong and K. Chamnongthai, “Facerecognition-based dog-breed classification using size and position of each local part, and PCA,” 2012 9th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology, Phetchaburi, Thailand, pp. 1-5, 2012.
N. Dalal and B. Triggs, “Histograms of oriented gradients for human detection,” 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), San Diego, CA, USA, vol. 1, pp. 886-893 , 2005.
O. M. Parkhi, A. Vedaldi, A. Zisserman and C. V. Jawahar, “Cats and dogs,” 2012 IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, pp. 3498-3505, 2012.
J. Liu, A. Kanazawa, D. Jacobs and P. Belhumeur, “Dog breed classification using part localization,” in Computer Vision – ECCV 2012, Florence, Italy, pp. 172–185, Oct. 2012.
T. P. Moreira, M. L. Perez, R. d. O. Werneck and E. Valle, “Where is my puppy? Retrieving lost dogs by facial features,” Multimedia Tools and Applications, vol. 76, pp. 15325–15340, 2017.
K. Lai, X. Tu and S. Yanushkevich, “Dog Identification using Soft Biometrics and Neural Networks,” 2019 International Joint Conference on Neural Networks (IJCNN), Budapest, Hungary, pp. 1-8, 2019.
D. Batic and D. Culibrk, “Identifying individual dogs in social media images,” arXiv:2003.06705, 2020. [Online]. Available: https://arxiv.org/ abs/2003.06705.
F. Schroff, D. Kalenichenko and J. Philbin, “FaceNet: A unified embedding for face recognition and clustering,” 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, pp. 815-823, 2015
P. Khosla et al., “Supervised contrastive learning,” Proceedings of the 34th International Conference on Neural Information Processing Systems, no.1567, pp. 18661–18673, 2020.
T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in Proceedings of the 37th International Conference on Machine Learning, no. 149, pp. 1597–1607, 2020.
W. Wang, W. Zhou, J. Bao, D. Chen and H. Li, “Instance-wise Hard Negative Example Generation for Contrastive Learning in Unpaired Image-to-Image Translation,” 2021 IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada, pp. 1400014009, 2021.
W. Cui, L. Bai, X. Yang and J. Liang, “A new contrastive learning framework for reducing the effect of hard negatives,” Knowledge-Based Systems, vol. 260, no. 110121, 2023.
N. Sundaram and S. D. Meena, “Integrated animal monitoring system with animal detection and classification capabilities: A review on image modality, techniques, applications, and challenges,” Artificial Intelligence Review, vol. 56, pp. 1–51, 2023.
A. G. Howard et al., “MobileNets: Efficient convolutional neural networks for mobile vision applications,” arXiv:1704.04861, 2017. [Online]. Available: http://arxiv.org/abs/1704. 04861.
A. Dutta and A. Zisserman, “The VIA annotation software for images, audio and video,” in Proceedings of the 27th ACM International Conference on Multimedia, pp. 2276–2279, 2019.