Cattle behavior recognition based on improved YOLOv7 algorithm
An improved model based on YOLOv7 algorithm is proposed.Firstly,a self-attention mechanism is incorporated into the Head part,and three attention modules,CA,SimAM and CBAM,are added to improve the network structure,adaptively selecting the input features to improve the model's detection accuracy rate of each behavior of the cattle as well as its performance ability in complex backgrounds;secondly,taking into account the differences in the distances between the cattle and the equipment during the daily behavior collection process,the hyper-parameter Focal EIOU loss function is introduced to balance the contribution of high-quality samples and low-quality samples to the Loss,and to improve the recognition rate of samples under the multi-classification task.After experimental analysis,the average accuracy of sample detection of the improved model reaches 95.2%,which is improved by 5.4 percentage points compared with the pre-improvement period,and the average time for single image detection is 0.010 6 s.Compared with other models such as SSD and Faster RCNN,the detection accuracy and detection speed of the improved YOLOv7 model are both greatly improved.
cattle behaviortarget detectionYOLOv7attention mechanismloss function