Li Junqiu, Wang Jiayi, Kong Dexiao, Zhang Qinghui, Qiang Zhenping
College of Big Data and Intelligent Engineering, Southwest Forestry University, Kunming 650224, China.
School of Automation Engineering, University of Electronic Science and Technology of China, Chengdu 611731, China.
J Imaging. 2024 Dec 2;10(12):309. doi: 10.3390/jimaging10120309.
Walnuts possess significant nutritional and economic value. Fast and accurate sorting of shells and kernels will enhance the efficiency of automated production. Therefore, we propose a FastQAFPN-YOLOv8s object detection network to achieve rapid and precise detection of unsorted materials. The method uses lightweight Pconv (Partial Convolution) operators to build the FasterNextBlock structure, which serves as the backbone feature extractor for the Fasternet feature extraction network. The ECIoU loss function, combining EIoU (Efficient-IoU) and CIoU (Complete-IoU), speeds up the adjustment of the prediction frame and the network regression. In the Neck section of the network, the QAFPN feature fusion extraction network is proposed to replace the PAN-FPN (Path Aggregation Network-Feature Pyramid Network) in YOLOv8s with a Rep-PAN structure based on the QARepNext reparameterization framework for feature fusion extraction to strike a balance between network performance and inference speed. To validate the method, we built a three-axis mobile sorting device and created a dataset of 3000 images of walnuts after shell removal for experiments. The results show that the improved network contains 6071008 parameters, a training time of 2.49 h, a model size of 12.3 MB, an mAP (Mean Average Precision) of 94.5%, and a frame rate of 52.1 FPS. Compared with the original model, the number of parameters decreased by 45.5%, with training time reduced by 32.7%, the model size shrunk by 45.3%, and frame rate improved by 40.8%. However, some accuracy is sacrificed due to the lightweight design, resulting in a 1.2% decrease in mAP. The network reduces the model size by 59.7 MB and 23.9 MB compared to YOLOv7 and YOLOv6, respectively, and improves the frame rate by 15.67 fps and 22.55 fps, respectively. The average confidence and mAP show minimal changes compared to YOLOv7 and improved by 4.2% and 2.4% compared to YOLOv6, respectively. The FastQAFPN-YOLOv8s detection method effectively reduces model size while maintaining recognition accuracy.
核桃具有显著的营养和经济价值。快速准确地分选核桃壳和核桃仁将提高自动化生产效率。因此,我们提出了一种FastQAFPN - YOLOv8s目标检测网络,以实现对未分选物料的快速精确检测。该方法使用轻量级的Pconv(部分卷积)算子构建FasterNextBlock结构,作为Fasternet特征提取网络的骨干特征提取器。结合EIoU(高效交并比)和CIoU(完整交并比)的ECIoU损失函数加快了预测框的调整和网络回归。在网络的Neck部分,提出了QAFPN特征融合提取网络,基于QARepNext重参数化框架用Rep - PAN结构取代YOLOv8s中的PAN - FPN(路径聚合网络 - 特征金字塔网络)进行特征融合提取,以在网络性能和推理速度之间取得平衡。为验证该方法,我们构建了一个三轴移动分选装置,并创建了一个包含3000张去壳核桃图像的数据集用于实验。结果表明,改进后的网络包含6071008个参数,训练时间为2.49小时,模型大小为12.3MB,平均精度均值(mAP)为94.5%,帧率为52.1帧每秒。与原始模型相比,参数数量减少了45.5%,训练时间减少了32.7%,模型大小缩小了45.3%,帧率提高了40.8%。然而,由于轻量级设计牺牲了一些精度,导致mAP下降了1.2%。与YOLOv7和YOLOv6相比,该网络的模型大小分别减少了59.7MB和23.9MB,帧率分别提高了15.67帧每秒和22.55帧每秒。平均置信度和mAP与YOLOv7相比变化极小,与YOLOv6相比分别提高了4.2%和2.4%。FastQAFPN - YOLOv8s检测方法在保持识别精度的同时有效减小了模型大小。