Detection of Pig Movement and Aggression Using Deep Learning Approaches

Motion and aggressive behaviors in pigs provide important information for the study of social hierarchies in pigs and can be used as a selection indicator for pig health and aggression parameters. However, relying only on visual observation or surveillance video to record the number of aggressive ac...

Full description

Bibliographic Details
Main Authors: Jiacheng Wei, Xi Tang, Jinxiu Liu, Zhiyan Zhang
Format: Article
Language:English
Published: MDPI AG 2023-09-01
Series:Animals
Subjects:
Online Access:https://www.mdpi.com/2076-2615/13/19/3074
_version_ 1797576257665236992
author Jiacheng Wei
Xi Tang
Jinxiu Liu
Zhiyan Zhang
author_facet Jiacheng Wei
Xi Tang
Jinxiu Liu
Zhiyan Zhang
author_sort Jiacheng Wei
collection DOAJ
description Motion and aggressive behaviors in pigs provide important information for the study of social hierarchies in pigs and can be used as a selection indicator for pig health and aggression parameters. However, relying only on visual observation or surveillance video to record the number of aggressive acts is time-consuming, labor-intensive, and lasts for only a short period of time. Manual observation is too short compared to the growth cycle of pigs, and complete recording is impractical in large farms. In addition, due to the complex process of assessing the intensity of pig aggression, manual recording is highly influenced by human subjective vision. In order to efficiently record pig motion and aggressive behaviors as parameters for breeding selection and behavioral studies, the videos and pictures were collected from typical commercial farms, with each unit including 8~20 pigs in 7~25 m<sup>2</sup> space; they were bred in stable social groups and a video was set up to record the whole day’s activities. We proposed a deep learning-based recognition method for detecting and recognizing the movement and aggressive behaviors of pigs by recording and annotating head-to-head tapping, head-to-body tapping, neck biting, body biting, and ear biting during fighting. The method uses an improved EMA-YOLOv8 model and a target tracking algorithm to assign a unique digital identity code to each pig, while efficiently recognizing and recording pig motion and aggressive behaviors and tracking them, thus providing statistics on the speed and duration of pig motion. On the test dataset, the average precision of the model was 96.4%, indicating that the model has high accuracy in detecting a pig’s identity and its fighting behaviors. The model detection results were highly correlated with the manual recording results (R<sup>2</sup> of 0.9804 and 0.9856, respectively), indicating that the method has high accuracy and effectiveness. In summary, the method realized the detection and identification of motion duration and aggressive behavior of pigs under natural conditions, and provided reliable data and technical support for the study of the social hierarchy of pigs and the selection of pig health and aggression phenotypes.
first_indexed 2024-03-10T21:50:44Z
format Article
id doaj.art-9795772e26b945bea94cddc24e85dc27
institution Directory Open Access Journal
issn 2076-2615
language English
last_indexed 2024-03-10T21:50:44Z
publishDate 2023-09-01
publisher MDPI AG
record_format Article
series Animals
spelling doaj.art-9795772e26b945bea94cddc24e85dc272023-11-19T13:59:52ZengMDPI AGAnimals2076-26152023-09-011319307410.3390/ani13193074Detection of Pig Movement and Aggression Using Deep Learning ApproachesJiacheng Wei0Xi Tang1Jinxiu Liu2Zhiyan Zhang3State Key Laboratory for Pig Genetic Improvement and Production Technology, Jiangxi Agricultural University, Nanchang 330045, ChinaState Key Laboratory for Pig Genetic Improvement and Production Technology, Jiangxi Agricultural University, Nanchang 330045, ChinaState Key Laboratory for Pig Genetic Improvement and Production Technology, Jiangxi Agricultural University, Nanchang 330045, ChinaState Key Laboratory for Pig Genetic Improvement and Production Technology, Jiangxi Agricultural University, Nanchang 330045, ChinaMotion and aggressive behaviors in pigs provide important information for the study of social hierarchies in pigs and can be used as a selection indicator for pig health and aggression parameters. However, relying only on visual observation or surveillance video to record the number of aggressive acts is time-consuming, labor-intensive, and lasts for only a short period of time. Manual observation is too short compared to the growth cycle of pigs, and complete recording is impractical in large farms. In addition, due to the complex process of assessing the intensity of pig aggression, manual recording is highly influenced by human subjective vision. In order to efficiently record pig motion and aggressive behaviors as parameters for breeding selection and behavioral studies, the videos and pictures were collected from typical commercial farms, with each unit including 8~20 pigs in 7~25 m<sup>2</sup> space; they were bred in stable social groups and a video was set up to record the whole day’s activities. We proposed a deep learning-based recognition method for detecting and recognizing the movement and aggressive behaviors of pigs by recording and annotating head-to-head tapping, head-to-body tapping, neck biting, body biting, and ear biting during fighting. The method uses an improved EMA-YOLOv8 model and a target tracking algorithm to assign a unique digital identity code to each pig, while efficiently recognizing and recording pig motion and aggressive behaviors and tracking them, thus providing statistics on the speed and duration of pig motion. On the test dataset, the average precision of the model was 96.4%, indicating that the model has high accuracy in detecting a pig’s identity and its fighting behaviors. The model detection results were highly correlated with the manual recording results (R<sup>2</sup> of 0.9804 and 0.9856, respectively), indicating that the method has high accuracy and effectiveness. In summary, the method realized the detection and identification of motion duration and aggressive behavior of pigs under natural conditions, and provided reliable data and technical support for the study of the social hierarchy of pigs and the selection of pig health and aggression phenotypes.https://www.mdpi.com/2076-2615/13/19/3074deep learningtarget detectionYOLOv8video trackingpig attack behavior
spellingShingle Jiacheng Wei
Xi Tang
Jinxiu Liu
Zhiyan Zhang
Detection of Pig Movement and Aggression Using Deep Learning Approaches
Animals
deep learning
target detection
YOLOv8
video tracking
pig attack behavior
title Detection of Pig Movement and Aggression Using Deep Learning Approaches
title_full Detection of Pig Movement and Aggression Using Deep Learning Approaches
title_fullStr Detection of Pig Movement and Aggression Using Deep Learning Approaches
title_full_unstemmed Detection of Pig Movement and Aggression Using Deep Learning Approaches
title_short Detection of Pig Movement and Aggression Using Deep Learning Approaches
title_sort detection of pig movement and aggression using deep learning approaches
topic deep learning
target detection
YOLOv8
video tracking
pig attack behavior
url https://www.mdpi.com/2076-2615/13/19/3074
work_keys_str_mv AT jiachengwei detectionofpigmovementandaggressionusingdeeplearningapproaches
AT xitang detectionofpigmovementandaggressionusingdeeplearningapproaches
AT jinxiuliu detectionofpigmovementandaggressionusingdeeplearningapproaches
AT zhiyanzhang detectionofpigmovementandaggressionusingdeeplearningapproaches