高级检索+

基于改进YOLO11n的轻量化核桃外部缺陷检测方法

Lightweight walnut external defect detection model based on improved YOLO11n

  • 摘要: 针对实际生产线中核桃滚动速度快,细小缺陷难以捕捉、狭窄裂缝与核桃自身生长纹路难以区分的问题,该研究提出了一种基于YOLO11n的轻量化核桃外部缺陷检测模型YOLO-EBM。首先,通过引入EfficientNetV2轻量级网络替换原有骨干网络,在提升模型整体检测精度的同时降低参数量;其次,引入双向特征金字塔网络,优化多尺度特征融合效率,用精度的小幅度下降换取参数量的大幅度下降;最后,在小目标层加入多尺度扩张注意力机制,增强模型对细小缺陷特征的捕捉能力,提高整体的识别准确率,从而达到精度和模型大小的平衡。结果表明,改进后的模型平均检测精度达93.3%,参数量降至0.773M,权重文件大小缩至2.18MB;与改进前的基线模型YOLO11n相比,平均精度提升2.1个百分点,参数量降低70.1%,权重文件大小缩减58.2%。该研究提出的模型具备较高准确率与轻量化特性,更有利于模型的部署与移植,可满足生产线的实时性需求,为核桃外部缺陷的自动化检测提供一定的参考。

     

    Abstract: Aiming at the practical problems existing in the actual walnut production lines, including the high rolling speed of walnuts that makes it difficult to capture their tiny defects, and the difficulty in distinguishing narrow cracks from the natural growth textures of walnuts themselves, this study proposes a lightweight walnut external defect detection model named YOLO-EBM based on YOLO11n. In order to effectively solve the above engineering challenges and realize the dual requirements of high-precision detection and real-time operation in industrial scenarios, the model adopts three targeted structural optimization strategies, which are designed to achieve an optimal balance between detection accuracy and model lightweight performance without deviating from the actual application needs of walnut production lines. Firstly, the original backbone network of the baseline YOLO11n model is replaced by the lightweight EfficientNetV2 network. Compared with the original backbone, the EfficientNetV2 network adopts a more efficient feature extraction structure, which can not only enhance the model’s ability to extract key features of walnut defects, thereby improving the overall detection accuracy of the model, but also effectively reduce the number of redundant parameters of the model, laying a solid foundation for the lightweight design of the entire model. Secondly, a Bidirectional Feature Pyramid Network (BiFPN) is introduced into the model’s feature fusion module to optimize the efficiency of multi-scale feature fusion. This strategy appropriately sacrifices a small range of detection accuracy, and in turn achieves a substantial reduction in the number of model parameters, further promoting the lightweight level of the model while ensuring that the detection performance meets the actual production requirements. Finally, a Multi-Scale Dilated Attention (MSDA) mechanism is added to the small-object detection layer of the model. This mechanism can effectively enhance the model’s ability to capture fine-grained features of tiny defects and narrow cracks, strengthen the model’s discrimination ability between real defects and walnut natural growth textures, and further improve the overall recognition accuracy of the model, thus finally achieving a ideal balance between detection precision and model size. Comprehensive experimental tests were carried out to verify the performance of the proposed YOLO-EBM model, and the experimental results show that the improved model achieves a mean average precision (mAP) of 93.3%, the number of parameters is reduced to 0.773 M, and the size of the model weight file is compressed to 2.18 MB. Compared with the baseline YOLO11n model before improvement, the mean average precision of the YOLO-EBM model is increased by 2.1 percentage points, the number of parameters is reduced by 70.1%, and the size of the weight file is reduced by 58.2%. The model proposed in this study has both high detection accuracy and excellent lightweight characteristics, which is more conducive to the deployment and transplantation of the model on resource-constrained industrial production equipment, and can fully meet the real-time detection requirements of actual walnut production lines. In summary, this study provides a reliable technical reference and practical solution for the automatic and intelligent detection of walnut external defects in the agricultural product processing industry, and also provides a certain theoretical and technical basis for the research on lightweight detection models of other agricultural product defects.

     

/

返回文章
返回