Research Article
BibTex RIS Cite

Effects of Data Augmentation Methods on YOLO v5s: Application of Deep Learning with Pytorch for Individual Cattle Identification

Year 2023, Volume: 33 Issue: 3, 363 - 376, 30.09.2023
https://doi.org/10.29133/yyutbd.1246901

Abstract

In this paper, we investigate the performance of the YOLO v5s (You Only Look Once) model for the identification of individual cattle in a cattle herd. The model is a popular method for real-time object detection, accuracy, and speed. However, since the videos obtained from the cattle herd consist of free space images, the number of frames in the data is unbalanced. This negatively affects the performance of the YOLOv5 model. First, we investigate the model performance on the unbalanced initial dataset obtained from raw images, then we stabilize the initial dataset using some data augmentation methods and obtain the model performance. Finally, we built the target detection model and achieved excellent model performance with an mAP (mean average precision) of 99.5% on the balanced dataset compared to the model on the unbalanced data (mAP of 95.8%). The experimental results show that YOLO v5s has a good potential for automatic cattle identification, but with the use of data augmentation methods, superior performance can be obtained from the model.

References

  • Altınbilek, H. F., & Kızıl, U. (2022). Identification of Paddy Rice Diseases Using Deep Convolutional Neural Networks. Yuzuncu Yıl University Journal of Agricultural Sciences, 32(4), 705-713. https://doi.org/10.29133/yyutbd.1140911
  • Andrew W., Greatwood C., Burghardt T. (2017). Visual localisation and individual identification of holstein friesian cattle via deep learning. In Proceedings of the IEEE international conference on computer vision workshops. pp. 2850-2859.
  • Andrew, W., Hannuna, S., Campbell, N., & Burghardt, T. (2016). Automatic individual holstein friesian cattle identification via selective local coat pattern matching in RGB-D imagery. Proceedings - International Conference on Image Processing, ICIP, 2016-August, 484–488. https://doi.org/10.1109/ICIP.2016.7532404
  • Bati, C. T., & Ser, G. (2023). SHEEPFEARNET: Sheep fear test behaviors classification approach from video data based on optical flow and convolutional neural networks. Computers and Electronics in Agriculture, 204, 107540. https://doi.org/10.1016/J.COMPAG.2022.107540
  • Bocaj, E., Uzunidis, D., Kasnesis, P., & Patrikakis, C. Z. (2020). On the Benefits of Deep Convolutional Neural Networks on Animal Activity Recognition. Proceedings of 2020 International Conference on Smart Systems and Technologies, SST 2020, 83–88. https://doi.org/10.1109/SST49455.2020.9263702
  • Bochkovskiy, A., Wang, C.-Y., & Liao, H.-Y. M. (2020). YOLOv4: Optimal Speed and Accuracy of Object Detection. https://arxiv.org/abs/2004.10934v1
  • Chen, Z., Wu, R., Lin, Y., Li, C., Chen, S., Yuan, Z., Chen, S., & Zou, X. (2022). Plant Disease Recognition Model Based on Improved YOLOv5. Agronomy 2022, Vol. 12, Page 365, 12(2), 365. https://doi.org/10.3390/AGRONOMY12020365
  • Dac H.H., Gonzalez Viejo C., Lipovetzky N., Tongson E., Dunshea F. R., Fuentes S. (2022). Livestock Identification Using Deep Learning for Traceability. Sens. 22(21): 8256.
  • de Lima Weber, F., de Moraes Weber, V. A., de Moraes, P. H., Matsubara, E. T., Paiva, D. M. B., de Nadai Bonin Gomes, M., de Oliveira, L. O. F., de Medeiros, S. R., & Cagnin, M. I. (2023). Counting cattle in UAV images using convolutional neural network. Remote Sensing Applications: Society and Environment, 29, 100900. https://doi.org/10.1016/J.RSASE.2022.100900
  • Egi, Y., Hajyzadeh, M., & Eyceyurt, E. (2022). Drone-Computer Communication Based Tomato Generative Organ Counting Model Using YOLO V5 and Deep-Sort. Agriculture (Switzerland), 12(9), 1290. https://doi.org/10.3390/AGRICULTURE12091290/S1
  • Huang, X., Li, X., & Hu, Z. (2019). Cow tail detection method for body condition score using Faster R-CNN. 2019 IEEE International Conference on Unmanned Systems and Artificial Intelligence, ICUSAI 2019, 347–351. https://doi.org/10.1109/ICUSAI47366.2019.9124743
  • Jintasuttisak T., Edirisinghe E., Elbattay, A. (2022). Deep neural network based date palm tree detection in drone imagery. Comput. Elect. Agricul. 192: 106560.
  • Jocher G. (2020). YOLOv5. Available online: https://github.com/ultralytics/yolov5.
  • Kasfi, K. T., Hellicar, A., & Rahman, A. (2016). Convolutional Neural Network for time series cattle behaviour classification. ACM International Conference Proceeding Series, 8–12. https://doi.org/10.1145/3014340.3014342
  • Lee, J., Lim, K., & Cho, J. (2022). Improved Monitoring of Wildlife Invasion through Data Augmentation by Extract–Append of a Segmented Entity. Sensors, 22(19). https://doi.org/10.3390/s22197383
  • Li, Z., Tian, X., Liu, X., Liu, Y., & Shi, X. (2022). A Two-Stage Industrial Defect Detection Framework Based on Improved-YOLOv5 and Optimized-Inception-ResnetV2 Models. Applied Sciences 2022, Vol. 12, Page 834, 12(2), 834. https://doi.org/10.3390/APP12020834
  • Liu, S., Qi, L., Qin, H., Shi, J., & Jia, J. (2018). Path Aggregation Network for Instance Segmentation. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition. https://doi.org/10.1109/CVPR.2018.00913
  • Luo, W., Zhang, Z., Fu, P., Wei, G., Wang, D., Li, X., Shao, Q., He, Y., Wang, H., Zhao, Z., Liu, K., Liu, Y., Zhao, Y., Zou, S., & Liu, X. (2022). Intelligent Grazing UAV Based on Airborne Depth Reasoning. Remote Sensing 2022, Vol. 14, Page 4188, 14(17), 4188. https://doi.org/10.3390/RS14174188
  • Masebo, N. T., Marliani, G., Cavallini, D., Accorsi, P. A., Di Pietro, M., Beltrame, A., Gentile, A., & Jacinto, J. G. P. (2023). Health and welfare assessment of beef cattle during the adaptation period in a specialized commercial fattening unit. Research in Veterinary Science, 158, 50–55. https://doi.org/10.1016/J.RVSC.2023.03.008
  • Paszke A. et al., (2019). PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems 32. Curran Associates, Inc. pp. 8024–8035. Available at: http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf.
  • Ser, G., & Bati, C. T. (2019). Determining the best model with deep neural networks: Keras application on mushroom data. Yuzuncu Yil University Journal of Agricultural Sciences, 29(3). https://doi.org/10.29133/yyutbd.505086
  • Shojaeipour, A., Falzon, G., Kwan, P., Hadavi, N., Cowley, F. C., & Paul, D. (2021). Automated muzzle detection and biometric identification via few-shot deep transfer learning of mixed breed cattle. Agronomy, 11(11). https://doi.org/10.3390/agronomy11112365
  • Shorten, C., & Khoshgoftaar, T. M. (2019). A survey on Image Data Augmentation for Deep Learning. Journal of Big Data, 6(1). https://doi.org/10.1186/s40537-019-0197-0
  • Skalski P. (2019). Make Sense. Available online: https://github.com/SkalskiP/make-sense/
  • Subedi, S., Bist, R., Yang, X., & Chai, L. (2023). Tracking pecking behaviors and damages of cage-free laying hens with machine vision technologies. Computers and Electronics in Agriculture, 204, 107545. https://doi.org/10.1016/J.COMPAG.2022.107545
  • Sun, F., Wang, H., & Zhang, J. (2021). A Recognition Method of Cattle and Sheep Based on Convolutional Neural Network. Proceedings - 2021 2nd International Seminar on Artificial Intelligence, Networking and Information Technology, AINIT 2021, 420–424. https://doi.org/10.1109/AINIT54228.2021.00088
  • Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual (Scotts Valley, CA: CreateSpace;).[Google Scholar].
  • Yan, B., Fan, P., Lei, X., Liu, Z., & Yang, F. (2021). A real-time apple targets detection method for picking robot based on improved YOLOv5. Remote Sensing, 13(9). https://doi.org/10.3390/rs13091619
  • Zhang, Y., Yu, C., Liu, H., Chen, X., Lei, Y., Pang, T., & Zhang, J. (2022). An Integrated Goat Head Detection and Automatic Counting Method Based on Deep Learning. Animals, 12(14). https://doi.org/10.3390/ani12141810
Year 2023, Volume: 33 Issue: 3, 363 - 376, 30.09.2023
https://doi.org/10.29133/yyutbd.1246901

Abstract

References

  • Altınbilek, H. F., & Kızıl, U. (2022). Identification of Paddy Rice Diseases Using Deep Convolutional Neural Networks. Yuzuncu Yıl University Journal of Agricultural Sciences, 32(4), 705-713. https://doi.org/10.29133/yyutbd.1140911
  • Andrew W., Greatwood C., Burghardt T. (2017). Visual localisation and individual identification of holstein friesian cattle via deep learning. In Proceedings of the IEEE international conference on computer vision workshops. pp. 2850-2859.
  • Andrew, W., Hannuna, S., Campbell, N., & Burghardt, T. (2016). Automatic individual holstein friesian cattle identification via selective local coat pattern matching in RGB-D imagery. Proceedings - International Conference on Image Processing, ICIP, 2016-August, 484–488. https://doi.org/10.1109/ICIP.2016.7532404
  • Bati, C. T., & Ser, G. (2023). SHEEPFEARNET: Sheep fear test behaviors classification approach from video data based on optical flow and convolutional neural networks. Computers and Electronics in Agriculture, 204, 107540. https://doi.org/10.1016/J.COMPAG.2022.107540
  • Bocaj, E., Uzunidis, D., Kasnesis, P., & Patrikakis, C. Z. (2020). On the Benefits of Deep Convolutional Neural Networks on Animal Activity Recognition. Proceedings of 2020 International Conference on Smart Systems and Technologies, SST 2020, 83–88. https://doi.org/10.1109/SST49455.2020.9263702
  • Bochkovskiy, A., Wang, C.-Y., & Liao, H.-Y. M. (2020). YOLOv4: Optimal Speed and Accuracy of Object Detection. https://arxiv.org/abs/2004.10934v1
  • Chen, Z., Wu, R., Lin, Y., Li, C., Chen, S., Yuan, Z., Chen, S., & Zou, X. (2022). Plant Disease Recognition Model Based on Improved YOLOv5. Agronomy 2022, Vol. 12, Page 365, 12(2), 365. https://doi.org/10.3390/AGRONOMY12020365
  • Dac H.H., Gonzalez Viejo C., Lipovetzky N., Tongson E., Dunshea F. R., Fuentes S. (2022). Livestock Identification Using Deep Learning for Traceability. Sens. 22(21): 8256.
  • de Lima Weber, F., de Moraes Weber, V. A., de Moraes, P. H., Matsubara, E. T., Paiva, D. M. B., de Nadai Bonin Gomes, M., de Oliveira, L. O. F., de Medeiros, S. R., & Cagnin, M. I. (2023). Counting cattle in UAV images using convolutional neural network. Remote Sensing Applications: Society and Environment, 29, 100900. https://doi.org/10.1016/J.RSASE.2022.100900
  • Egi, Y., Hajyzadeh, M., & Eyceyurt, E. (2022). Drone-Computer Communication Based Tomato Generative Organ Counting Model Using YOLO V5 and Deep-Sort. Agriculture (Switzerland), 12(9), 1290. https://doi.org/10.3390/AGRICULTURE12091290/S1
  • Huang, X., Li, X., & Hu, Z. (2019). Cow tail detection method for body condition score using Faster R-CNN. 2019 IEEE International Conference on Unmanned Systems and Artificial Intelligence, ICUSAI 2019, 347–351. https://doi.org/10.1109/ICUSAI47366.2019.9124743
  • Jintasuttisak T., Edirisinghe E., Elbattay, A. (2022). Deep neural network based date palm tree detection in drone imagery. Comput. Elect. Agricul. 192: 106560.
  • Jocher G. (2020). YOLOv5. Available online: https://github.com/ultralytics/yolov5.
  • Kasfi, K. T., Hellicar, A., & Rahman, A. (2016). Convolutional Neural Network for time series cattle behaviour classification. ACM International Conference Proceeding Series, 8–12. https://doi.org/10.1145/3014340.3014342
  • Lee, J., Lim, K., & Cho, J. (2022). Improved Monitoring of Wildlife Invasion through Data Augmentation by Extract–Append of a Segmented Entity. Sensors, 22(19). https://doi.org/10.3390/s22197383
  • Li, Z., Tian, X., Liu, X., Liu, Y., & Shi, X. (2022). A Two-Stage Industrial Defect Detection Framework Based on Improved-YOLOv5 and Optimized-Inception-ResnetV2 Models. Applied Sciences 2022, Vol. 12, Page 834, 12(2), 834. https://doi.org/10.3390/APP12020834
  • Liu, S., Qi, L., Qin, H., Shi, J., & Jia, J. (2018). Path Aggregation Network for Instance Segmentation. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition. https://doi.org/10.1109/CVPR.2018.00913
  • Luo, W., Zhang, Z., Fu, P., Wei, G., Wang, D., Li, X., Shao, Q., He, Y., Wang, H., Zhao, Z., Liu, K., Liu, Y., Zhao, Y., Zou, S., & Liu, X. (2022). Intelligent Grazing UAV Based on Airborne Depth Reasoning. Remote Sensing 2022, Vol. 14, Page 4188, 14(17), 4188. https://doi.org/10.3390/RS14174188
  • Masebo, N. T., Marliani, G., Cavallini, D., Accorsi, P. A., Di Pietro, M., Beltrame, A., Gentile, A., & Jacinto, J. G. P. (2023). Health and welfare assessment of beef cattle during the adaptation period in a specialized commercial fattening unit. Research in Veterinary Science, 158, 50–55. https://doi.org/10.1016/J.RVSC.2023.03.008
  • Paszke A. et al., (2019). PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems 32. Curran Associates, Inc. pp. 8024–8035. Available at: http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf.
  • Ser, G., & Bati, C. T. (2019). Determining the best model with deep neural networks: Keras application on mushroom data. Yuzuncu Yil University Journal of Agricultural Sciences, 29(3). https://doi.org/10.29133/yyutbd.505086
  • Shojaeipour, A., Falzon, G., Kwan, P., Hadavi, N., Cowley, F. C., & Paul, D. (2021). Automated muzzle detection and biometric identification via few-shot deep transfer learning of mixed breed cattle. Agronomy, 11(11). https://doi.org/10.3390/agronomy11112365
  • Shorten, C., & Khoshgoftaar, T. M. (2019). A survey on Image Data Augmentation for Deep Learning. Journal of Big Data, 6(1). https://doi.org/10.1186/s40537-019-0197-0
  • Skalski P. (2019). Make Sense. Available online: https://github.com/SkalskiP/make-sense/
  • Subedi, S., Bist, R., Yang, X., & Chai, L. (2023). Tracking pecking behaviors and damages of cage-free laying hens with machine vision technologies. Computers and Electronics in Agriculture, 204, 107545. https://doi.org/10.1016/J.COMPAG.2022.107545
  • Sun, F., Wang, H., & Zhang, J. (2021). A Recognition Method of Cattle and Sheep Based on Convolutional Neural Network. Proceedings - 2021 2nd International Seminar on Artificial Intelligence, Networking and Information Technology, AINIT 2021, 420–424. https://doi.org/10.1109/AINIT54228.2021.00088
  • Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual (Scotts Valley, CA: CreateSpace;).[Google Scholar].
  • Yan, B., Fan, P., Lei, X., Liu, Z., & Yang, F. (2021). A real-time apple targets detection method for picking robot based on improved YOLOv5. Remote Sensing, 13(9). https://doi.org/10.3390/rs13091619
  • Zhang, Y., Yu, C., Liu, H., Chen, X., Lei, Y., Pang, T., & Zhang, J. (2022). An Integrated Goat Head Detection and Automatic Counting Method Based on Deep Learning. Animals, 12(14). https://doi.org/10.3390/ani12141810
There are 29 citations in total.

Details

Primary Language English
Subjects Agricultural, Veterinary and Food Sciences
Journal Section Articles
Authors

Cafer Tayyar Bati 0000-0002-4218-4974

Gazel Ser 0000-0003-2756-4116

Early Pub Date September 11, 2023
Publication Date September 30, 2023
Acceptance Date May 29, 2023
Published in Issue Year 2023 Volume: 33 Issue: 3

Cite

APA Bati, C. T., & Ser, G. (2023). Effects of Data Augmentation Methods on YOLO v5s: Application of Deep Learning with Pytorch for Individual Cattle Identification. Yuzuncu Yıl University Journal of Agricultural Sciences, 33(3), 363-376. https://doi.org/10.29133/yyutbd.1246901
Creative Commons License
Yuzuncu Yil University Journal of Agricultural Sciences by Van Yuzuncu Yil University Faculty of Agriculture is licensed under a Creative Commons Attribution 4.0 International License.