Ear biting in pigs - a welfare challenge
Ear biting is a welfare challenge in commercial pig farming. Pigs sustain injuries at the site of bite paving the way for bacterial infections. Early detection and management of this behaviour is important to enhance animal health and welfare, increase productivity whilst minimising inputs from medication. Pig management using physical observation is not practical due to the scale of modern pig production systems. The same applies to the manual analysis of captured videos from pig houses. Therefore, a method of automated detection is desirable. We introduce an automatic approach based on deep learning for the detection and quantification of ear biting episodes. The dataset described here is from an experimental farm where the farmer previously reported ear biting.
Download and unzip the dataset. Within the main directory are two folders namely images and labels. The directory structure is as shown below:
- Images – folders containing images (.jpg files)
- Labels – folder containing labels (.txt files corresponding to each image)
This data structure is compatible with Yolov7 without modification. To train a Yolov4, move the text files in the training labels folder into the training image folders and also move the text files in the validation labels folder into validation images folder. There are 5197 and 5608 images and bounding boxes, respectively, in the AFBI dataset. For each image file, there is an annotation text file. There are 4672 images and 5087 annotations for training. The validation folder contains 525 and 524 images and annotations, respectively.