{"title":"Vision transformers for automated detection of pig interactions in groups","authors":"Gbadegesin Taiwo, Sunil Vadera, Ali Alameer","doi":"10.1016/j.atech.2025.100774","DOIUrl":null,"url":null,"abstract":"<div><div>The interactive behaviour of pigs is an important determinant of their social development and overall well-being. Manual observation and identification of contact behaviour can be time-consuming and potentially subjective. This study presents a new method for the dynamic detection of pig head to rear interaction using the Vision Transformer (ViT). The ViT model achieved a high accuracy in detecting and classifying specific interaction behaviour as trained on the pig contact datasets, capturing interaction behaviour. The model's ability to recognize contextual spatial data enables strong detection even in complex contexts, due to the use of Gaussian Error Linear Unit (GELU) an activation function responsible for introduction of non-linear data to the model and Multi Head Attention feature that ensures all relevant details contained in a data are captured in Vision Transformer. The method provides an efficient method for monitoring swine behaviour for instance, contact between pigs, facilitating better livestock management and livestock welfare. The ViT can represent a significant improvement on current automated behaviour detection, opening new possibilities for accurate animal design and animal behaviour assessment with an accuracy and F1 score of 82.8 % and 82.7 %, respectively, while we have an AUC of 85 %.</div></div>","PeriodicalId":74813,"journal":{"name":"Smart agricultural technology","volume":"10 ","pages":"Article 100774"},"PeriodicalIF":6.3000,"publicationDate":"2025-01-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Smart agricultural technology","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2772375525000085","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"AGRICULTURAL ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
The interactive behaviour of pigs is an important determinant of their social development and overall well-being. Manual observation and identification of contact behaviour can be time-consuming and potentially subjective. This study presents a new method for the dynamic detection of pig head to rear interaction using the Vision Transformer (ViT). The ViT model achieved a high accuracy in detecting and classifying specific interaction behaviour as trained on the pig contact datasets, capturing interaction behaviour. The model's ability to recognize contextual spatial data enables strong detection even in complex contexts, due to the use of Gaussian Error Linear Unit (GELU) an activation function responsible for introduction of non-linear data to the model and Multi Head Attention feature that ensures all relevant details contained in a data are captured in Vision Transformer. The method provides an efficient method for monitoring swine behaviour for instance, contact between pigs, facilitating better livestock management and livestock welfare. The ViT can represent a significant improvement on current automated behaviour detection, opening new possibilities for accurate animal design and animal behaviour assessment with an accuracy and F1 score of 82.8 % and 82.7 %, respectively, while we have an AUC of 85 %.