Abstract
Pig face detection plays a pivotal role in the intelligent management of pig farms. This study proposes a novel lightweight pig face detection model, named channel pruning pig face detection method based on augment group diverse attention mechanism(CPADA). Firstly, to overcome the adverse effects of pig face smudges occlusion and significant intra-class variations on the detection performance, this paper innovatively proposes an attention module named augment group diverse attention (ADA). Subsequently, in order to compress the size of the pig face detection model while preserving its detection capability as much as possible, this paper designs an efficient channel pruning method. Furthermore, based on the pruning margin for each layer, a hierarchical pruning strategy is designed to mitigate the impact of "layer collapse" phenomenon on the detection capability of the pruned model. The experimental results confirm the effectiveness of our proposed ADA attention method for pig face detection task and also validate that the proposed channel pruning and hierarchical pruning strategy outperform other state-of-the-art pruning methods at the same pruning rate. Furthermore, from the practical implementation perspective, the pruned models are deployed on the Raspberry Pi 4B edge computing platform, achieving nearly five times space compression and nearly four times inference speed improvement on edge devices.