{"title":"基于改进型 YOLOv8n 的热红外图像猪耳检测技术","authors":"Hui Han, Xianglong Xue, Qifeng Li, Hongfeng Gao, Rong Wang, Ruixiang Jiang, Zhiyu Ren, Rui Meng, Mingyu Li, Yuhang Guo, Yu Liu, Weihong Ma","doi":"10.20517/ir.2024.02","DOIUrl":null,"url":null,"abstract":"In the current pig scale breeding process, considering the low accuracy and speed of the infrared thermal camera automatic measurement concerning the pig body surface temperature, this paper proposes an improved algorithm for target detection of the pig ear thermal infrared image based on the YOLOv8n model. The algorithm firstly replaces the standard convolution in the CSPDarknet-53 and neck network with Deformable Convolution v2, so that the convolution kernel can adjust its shape according to the actual situation, thus enhancing the extraction of input features; secondly, the Multi-Head Self-Attention module is integrated into the backbone network, which extends the sensory horizons of the backbone network; finally, the Focal-Efficient Intersection Over Union loss function was introduced into the loss of bounding box regression, which increases the Intersection Over Union loss and gradient of the target and, in turn, improves the accuracy of the bounding box regression. Apart from that, a pig training set, including 3,000 infrared images from 50 different individual pigs, was constructed, trained, and tested. The performance of the proposed algorithm was evaluated by comparing it with the current mainstream target detection algorithms, such as Faster-RCNN, SSD, and YOLO families. The experimental results showed that the improved model achieves 97.0%, 98.1% and 98.5% in terms of Precision, Recall and mean Average Precision, which are 3.3, 0.7 and 4.7 percentage points higher compared to the baseline model. At the same time, the detection speed can reach 131 frames per second, which meets the requirement of real-time detection. The research results show that the improved pig ear detection method based on YOLOv8n proposed in this paper can accurately locate the pig ear in thermal infrared images and provide a reference and basis for the subsequent pig body temperature detection.","PeriodicalId":426514,"journal":{"name":"Intelligence & Robotics","volume":"277 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-01-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Pig-ear detection from the thermal infrared image based on improved YOLOv8n\",\"authors\":\"Hui Han, Xianglong Xue, Qifeng Li, Hongfeng Gao, Rong Wang, Ruixiang Jiang, Zhiyu Ren, Rui Meng, Mingyu Li, Yuhang Guo, Yu Liu, Weihong Ma\",\"doi\":\"10.20517/ir.2024.02\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In the current pig scale breeding process, considering the low accuracy and speed of the infrared thermal camera automatic measurement concerning the pig body surface temperature, this paper proposes an improved algorithm for target detection of the pig ear thermal infrared image based on the YOLOv8n model. The algorithm firstly replaces the standard convolution in the CSPDarknet-53 and neck network with Deformable Convolution v2, so that the convolution kernel can adjust its shape according to the actual situation, thus enhancing the extraction of input features; secondly, the Multi-Head Self-Attention module is integrated into the backbone network, which extends the sensory horizons of the backbone network; finally, the Focal-Efficient Intersection Over Union loss function was introduced into the loss of bounding box regression, which increases the Intersection Over Union loss and gradient of the target and, in turn, improves the accuracy of the bounding box regression. Apart from that, a pig training set, including 3,000 infrared images from 50 different individual pigs, was constructed, trained, and tested. The performance of the proposed algorithm was evaluated by comparing it with the current mainstream target detection algorithms, such as Faster-RCNN, SSD, and YOLO families. The experimental results showed that the improved model achieves 97.0%, 98.1% and 98.5% in terms of Precision, Recall and mean Average Precision, which are 3.3, 0.7 and 4.7 percentage points higher compared to the baseline model. At the same time, the detection speed can reach 131 frames per second, which meets the requirement of real-time detection. The research results show that the improved pig ear detection method based on YOLOv8n proposed in this paper can accurately locate the pig ear in thermal infrared images and provide a reference and basis for the subsequent pig body temperature detection.\",\"PeriodicalId\":426514,\"journal\":{\"name\":\"Intelligence & Robotics\",\"volume\":\"277 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-01-31\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Intelligence & Robotics\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.20517/ir.2024.02\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Intelligence & Robotics","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.20517/ir.2024.02","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
摘要
在当前生猪规模化养殖过程中,考虑到红外热像仪自动测量猪体表温度的精度和速度较低,本文提出了一种基于YOLOv8n模型的猪耳热红外图像目标检测改进算法。该算法首先将 CSPDarknet-53 和颈部网络中的标准卷积替换为 Deformable Convolution v2,使卷积核可以根据实际情况调整形状,从而增强了对输入特征的提取;其次,在骨干网络中集成了多头自注意力模块,扩展了骨干网络的感知范围;最后,在边界框回归的损失中引入了 Focal-Efficient Intersection Over Union 损失函数,增加了目标的 Intersection Over Union 损失和梯度,从而提高了边界框回归的准确性。此外,还构建、训练和测试了一个猪训练集,其中包括来自 50 头不同个体猪的 3,000 张红外图像。通过与当前主流的目标检测算法(如 Faster-RCNN、SSD 和 YOLO 系列)进行比较,评估了所提出算法的性能。实验结果表明,改进后的模型在精确度、召回率和平均精确度方面分别达到了 97.0%、98.1% 和 98.5%,与基线模型相比分别提高了 3.3、0.7 和 4.7 个百分点。同时,检测速度可以达到每秒 131 帧,满足了实时检测的要求。研究结果表明,本文提出的基于 YOLOv8n 的改进型猪耳检测方法能够准确定位热红外图像中的猪耳,为后续的猪体温检测提供参考和依据。
Pig-ear detection from the thermal infrared image based on improved YOLOv8n
In the current pig scale breeding process, considering the low accuracy and speed of the infrared thermal camera automatic measurement concerning the pig body surface temperature, this paper proposes an improved algorithm for target detection of the pig ear thermal infrared image based on the YOLOv8n model. The algorithm firstly replaces the standard convolution in the CSPDarknet-53 and neck network with Deformable Convolution v2, so that the convolution kernel can adjust its shape according to the actual situation, thus enhancing the extraction of input features; secondly, the Multi-Head Self-Attention module is integrated into the backbone network, which extends the sensory horizons of the backbone network; finally, the Focal-Efficient Intersection Over Union loss function was introduced into the loss of bounding box regression, which increases the Intersection Over Union loss and gradient of the target and, in turn, improves the accuracy of the bounding box regression. Apart from that, a pig training set, including 3,000 infrared images from 50 different individual pigs, was constructed, trained, and tested. The performance of the proposed algorithm was evaluated by comparing it with the current mainstream target detection algorithms, such as Faster-RCNN, SSD, and YOLO families. The experimental results showed that the improved model achieves 97.0%, 98.1% and 98.5% in terms of Precision, Recall and mean Average Precision, which are 3.3, 0.7 and 4.7 percentage points higher compared to the baseline model. At the same time, the detection speed can reach 131 frames per second, which meets the requirement of real-time detection. The research results show that the improved pig ear detection method based on YOLOv8n proposed in this paper can accurately locate the pig ear in thermal infrared images and provide a reference and basis for the subsequent pig body temperature detection.