基于智能化养殖的发展需求,以牛脸图像作为研究对象,提出了一种基于改进YOLO v7的牛脸识别方法。收集1525张牛脸图像,进行筛选与预处理,形成图像识别数据集。基于目标检测算法YOLO v7的性能基础,针对牛脸识别的特点,提出了适用于牛脸识别的目标检测算法YOLO_C(You Only Look Once_Cattle)。首先,使用更适合视觉任务的FReLU激活函数取代了原算法中的SiLU激活函数;其次,将注意力机制CBAM融合到算法网络的骨干层中,提升算法的特征提取能力;最后,在特征融合层引入CARAFE上采样模块以更好恢复牛脸图像细节,提升模型对牛脸个体的识别精度。实验结果表明,YOLO_C与原算法相比,在牛脸识别数据集上识别精确率由87%提升到89。4%,召回率由93%提升到94。4%,平均精度从89%提高到92。9%,检测速度达到83 FPS。
Research on Cow Face Recognition Method Based on Improved YOLO v7
Based on the development needs of intelligent farming,taking cow face images as the research object,a cow face rec-ognition method based on improved YOLO v7 is proposed.Collecting 1525 cow face images,and filter and preprocess the ima-ges to form an image recognition dataset.Based on the performance basis of the target detection algorithm YOLO v7,and ai-ming at the characteristics of cow face recognition,a target detection algorithm YOLO_C(You Only Look Once_Cattle)suit-able for cow face recognition is proposed.First,the SiLU activation function in the original algorithm is replaced by the FReLU activation function that is more suitable for visual tasks;Secondly,the attention mechanism CBAM is integrated into the back-bone layer of the algorithm network to improve the feature extraction ability of the algorithm;Finally,the CARAFE upsam-pling module is introduced in the feature fusion layer to better restore the details of the cow face image and improve the recogni-tion accuracy of the model for the individual cow face.The experimental results show that compared with the original algo-rithm,YOLO_C improves the recognition accuracy rate from 87%to 89.4%,the recall rate from 93%to 94.4%,and the av-erage precision from 89%to 92.9%.The speed reaches 83 FPS.