Pig Face Recognition Based on Trapezoid Normalized Pixel Difference Feature and Trimmed Mean Attention Mechanism
Shuiqing Xu, Qihang He, Songbing Tao, Hongtian Chen, Yi Chai, Wei Xing Zheng
Abstract
Pig face recognition has a wide range of applications in breeding farms, including precision feeding and disease surveillance. This article proposes a method to guarantee its performance in complex environments such as with dirty faces and in unconstrained outdoor conditions. First, inspired by the shape of the pig face, a trapezoid normalized pixel difference (T-NPD) feature is designed to achieve more accurate detection in unconstrained outdoor conditions. Subsequently, a trimmed mean attention mechanism (TMAM) uses the trimmed mean-based squeeze method to assign more precise weights to feature channels, and then fuses it into a 50-layer ResNet (ResNet50) backbone network to classify detected pig face images with high accuracy. In addition, the TMAM can be applied in numerous common networks due to its universality. Finally, comprehensive experiments conducted on the publicly available JD pig face dataset indicate that the proposed method has superior performance compared with other methods, with an overall accuracy of 95.06%.