A Lightweight Pig Face Recognition Method Based on Automatic Detection and Knowledge Distillation
Source abstract
Abstract
Identifying individual pigs is crucial for efficient breeding, health management, and disease control in modern farming. Traditional animal face identification methods are labor-intensive and prone to inaccuracies, while existing CNN-based pig face recognition models often struggle with high computational demands, large sizes, and reliance on extensive labeled data, which limit their practical application. This paper addresses these challenges by proposing a novel, decoupled approach to pig face recognition that separates detection from identification. This strategy employs a detection model as a pre-processing step, significantly reducing the need for extensive re-annotation for new datasets. Additionally, the paper introduces a method that integrates offline knowledge distillation with a lightweight pig face recognition model, aiming to build an efficient and embedding-friendly system. To achieve these objectives, the study constructs a small-scale, high-quality pig face detection dataset consisting of 1500 annotated images from a selection of 20 pigs. An independent detection model, trained on this dataset, then autonomously generates a large-scale pig face recognition dataset with 56 pig classes. In the face recognition stage, a robust teacher model guides the student model through a distillation process informed by a knowledge distillation loss, enabling the student model to learn relational features from the teacher. Experimental results confirm the high accuracy of the pig face detection model on the small-scale detection dataset and the ability to generate a large-scale dataset for pig face recognition on unlabeled data. The recognition experiments further verify that the distilled lightweight model outperforms its non-distilled counterparts and approaches the performance of the teacher model. This scalable, cost-effective solution shows significant promise for broader computer vision applications beyond agriculture.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Animal Behavior and Welfare Studies · Food Supply Chain Traceability · Industrial Vision Systems and Defect Detection
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Division of Electronics and Information Engineering, Jeonbuk National University, Jeonju 54896, Republic of Korea
Core Research Institute of Intelligent Robots, Jeonbuk National University, Jeonju 54896, Republic of Korea
Funding
Korea Institute of Planning and Evaluation for Technology in Food, Agriculture and Forestry (IPET) · Korea Smart Farm R&D Foundation · National Research Foundation (NRF)
References (44)
Show source-provided references
1. Pig identification using deep convolutional neural network based on different age range10.1007/s42853-021-00098-7 ↗
2. Salman, M.D. (2003). Animal Disease Surveillance and Survey Systems: Methods and Applications, John Wiley & Sons, Inc.10.1002/9780470344866 ↗
3. Medical diagnostic systems using artificial intelligence (ai) algorithms: Principles and perspectives10.1109/ACCESS.2020.3042273 ↗
4. A complete farm management system based on animal identification using RFID technology10.1016/j.compag.2009.07.009 ↗
5. Radio frequency identification10.1007/s12045-017-0498-6 ↗
6. Monitoring trough visits of growing-finishing pigs with UHF-RFID10.1016/j.compag.2017.11.036 ↗
7. Methods to construct feeding visits from RFID registrations of growing-finishing pigs at the feed trough10.1016/j.compag.2016.08.010 ↗
8. A survey on animal identification techniques past and present
9. Liu, L., Chen, M., Chen, X., Zhu, S., and Tan, P. (2021). GB-CosFace: Rethinking softmax-based face recognition from the perspective of open set classification. arXiv.
10. From classical methods to animal biometrics: A review on cattle identification and tracking10.1016/j.compag.2016.03.014 ↗
11. Laishram, M., Mandal, S.N., Haldar, A., Das, S., Bera, S., and Samanta, R. (2023). Biometric identification of Black Bengal goat: Unique iris pattern matching system vs. deep learning approach. Anim. Biosci., 36.10.5713/ab.22.0157 ↗
12. Technologies in individual animal identification and meat products traceability10.1080/13102818.2019.1711185 ↗
13. Meng, Q., Zhao, S., Huang, Z., and Zhou, F. (2021, January 19–25). Magface: A universal representation for face recognition and quality assessment. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Virtual.10.1109/CVPR46437.2021.01400 ↗
14. Automatically detecting pig position and posture by 2D camera imaging and deep learning10.1016/j.compag.2020.105391 ↗
15. Real-time goat face recognition using convolutional neural network
16. CattleFaceNet: A cattle face identification approach based on RetinaFace and ArcFace loss10.1016/j.compag.2021.106675 ↗
17. Manna, A., Upasani, N., Jadhav, S., Mane, R., Chaudhari, R., and Chatre, V. (2023). Bird Image Classification using Convolutional Neural Network Transfer Learning Architectures. Int. J. Adv. Comput. Sci. Appl., 14.10.14569/IJACSA.2023.0140397 ↗
18. Recognition of aggressive episodes of pigs based on convolutional neural network and long short-term memory10.1016/j.compag.2019.105166 ↗
19. A lightweight deep learning model for cattle face recognition10.1016/j.compag.2022.106848 ↗
20. Duong, C.N., Quach, K.G., Jalata, I., Le, N., and Luu, K. (2019, January 23–26). Mobiface: A lightweight deep learning face recognition on mobile devices. Proceedings of the 2019 IEEE 10th International Conference on Biometrics Theory, Applications and Systems (BTAS), Tampa, FL, USA.10.1109/BTAS46853.2019.9185981 ↗
21. Jocher, G., Chaurasia, A., and Qiu, J. (2023, April 20). YOLO by Ultralytics. Available online: https://github.com/ultralytics/ultralytics.
22. Event triggered intelligent video recording system using MS-SSIM for smart home security10.1016/j.asej.2016.10.001 ↗
23. Park, W., Kim, D., Lu, Y., and Cho, M. (2019, January 15–20). Relational knowledge distillation. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA.10.1109/CVPR.2019.00409 ↗
24. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., and Gelly, S. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. arXiv.
25. Ma, N., Zhang, X., Zheng, H.T., and Sun, J. (2018, January 8–14). Shufflenet v2: Practical guidelines for efficient cnn architecture design. Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany.10.1007/978-3-030-01264-9_8 ↗
26. Shao, H., Pu, J., and Mu, J. (2021). Pig-posture recognition based on computer vision: Dataset and exploration. Animals, 11.10.3390/ani11051295 ↗
27. Pig Face Recognition Using Eigenspace Method
28. Towards on-farm pig face recognition using convolutional neural networks10.1016/j.compind.2018.02.016 ↗
29. An adaptive pig face recognition approach using Convolutional Neural Networks10.1016/j.compag.2020.105386 ↗
30. Two-stage method based on triplet margin loss for pig face recognition10.1016/j.compag.2022.106737 ↗
31. Tan, M., Pang, R., and Le, Q.V. (2020, January 14–19). Efficientdet: Scalable and efficient object detection. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, DC, USA.10.1109/CVPR42600.2020.01079 ↗
32. Knowledge distillation: A survey10.1007/s11263-021-01453-z ↗
33. Bucilua, C., Caruana, R., and Niculescu-Mizil, A. (2006, January 20–23). Model compression. Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Philadelphia, PA, USA.10.1145/1150402.1150464 ↗
34. Hinton, G., Vinyals, O., and Dean, J. (2015). Distilling the knowledge in a neural network. arXiv.
35. Meng, Z., Li, J., Zhao, Y., and Gong, Y. (2019, January 12–17). Conditional teacher-student learning. Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Brighton, UK.10.1109/ICASSP.2019.8683438 ↗
36. Kim, S.W., and Kim, H.E. (2017, January 24–26). Transferring knowledge to smaller network with class-distance loss. Proceedings of the ICLRW, Toulon, France.
37. Müller, R., Kornblith, S., and Hinton, G.E. (2019). When does label smoothing help?. Adv. Neural Inf. Process. Syst., 32.
38. Network representation learning: A survey
39. Romero, A., Ballas, N., Kahou, S.E., Chassang, A., Gatta, C., and Bengio, Y. (2020). Fitnets: Hints for thin deep nets. arXiv.
40. Passalis, N., and Tefas, A. (2018, January 8–14). Learning deep representations with probabilistic knowledge transfer. Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany.10.1007/978-3-030-01252-6_17 ↗
41. Chen, D., Mei, J.P., Zhang, Y., Wang, C., Wang, Z., Feng, Y., and Chen, C. (2021, January 2–9). Cross-layer distillation with semantic calibration. Proceedings of the AAAI Conference on Artificial Intelligence, Virtually.
42. Liu, Y., Cao, J., Li, B., Yuan, C., Hu, W., Li, Y., and Duan, Y. (2019, January 15–20). Knowledge distillation via instance relationship graph. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA.10.1109/CVPR.2019.00726 ↗
43. Tung, F., and Mori, G. (November, January 27). Similarity-preserving knowledge distillation. Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea.
44. Park, W., Kim, D., Lu, Y., and Cho, M. (2019). Ensemble knowledge distillation for learning improved and efficient networks. arXiv.10.1109/CVPR.2019.00409 ↗