基于云边协同的零件表面缺陷检测技术研究

A Cloud-Edge Collaborative Approach for Surface Defect Detection of Mechanical Parts

  • 摘要: 针对零件表面缺陷在线质检中静态检测模型适应能力不足、边缘端多任务并发易造成资源竞争的问题,提出一种基于云边协同的零件表面缺陷检测技术。边缘端部署检测模型完成实时检测,构建基于相邻检测节点协同判决与置信度融合的关键缺陷样本筛选方法,将疑似新缺陷、低置信度和检测结果不稳定样本上传云服务端;云服务端采用基于弹性响应蒸馏的模型增量优化方法,利用关键缺陷样本构建增量训练数据,并通过输出响应约束与空间特征蒸馏实现模型持续迭代优化。针对多检测节点并发运行下的缺陷检测、样本筛选和上传任务竞争问题,设计基于CPU和GPU资源状态的多检测节点任务调度方法,保障实时缺陷检测和关键缺陷样本持续上传。实验结果表明,在NEU-DET数据集的3类+3类和4类+2类增量学习场景下,本文方法检测精度分别达到72.4%和70.1%;在边缘节点过载条件下,平均检测时延降低至42 ms,检测帧率达30 FPS,关键缺陷样本上传完成率达到92.5%。结果表明,该技术可兼顾模型持续优化与缺陷检测任务稳定运行。

     

    Abstract: Online surface defect inspection of mechanical parts requires a detection system that maintains real-time inference, stable operation, and continuous adaptability in production. Existing edge-deployed detection models are usually trained offline and remain fixed after deployment, so their performance may decline when material batches, machining processes, illumination conditions, or defect distributions change. In addition, defect detection, key sample screening, and data uploading tasks are often executed concurrently at edge nodes, causing CPU and GPU resource contention and increased latency. To address these problems, this paper proposes a cloud-edge collaborative surface defect detection method for mechanical parts, integrating edge-side real-time detection, cloud-side incremental model optimization, and multi-node task scheduling. At the edge side, YOLOv11 is deployed as the basic defect detection model to output defect categories, locations, and confidence scores in real time. To reduce redundant transmission and provide representative samples for model updating, a key defect sample screening method based on collaborative decision-making between adjacent edge detection nodes and confidence fusion is designed. The detection boxes generated by neighboring nodes are matched using Intersection over Union, and the matched results are analyzed according to category consistency. The samples are divided into strong-consistency, weak-consistency, and single-side detected samples. Weak-consistency samples indicate unstable category prediction, single-side detected samples may correspond to missed detections or potential new defects, and low-confidence samples reflect insufficient model discrimination. These informative samples are assigned higher uploading priority and sent to the cloud server as incremental training data. At the cloud side, an incremental model optimization method based on elastic response distillation is proposed. The previous detection model is used as a frozen teacher network, while the student network is updated with uploaded key defect samples and an expanded detection head. To retain the recognition ability for old defect categories, the optimization process introduces classification-response distillation, objectness-response distillation, and bounding-box regression distillation. Considering that surface defects are often small and irregular, spatial feature distillation is further employed to constrain intermediate feature responses along horizontal and vertical directions. By jointly optimizing the detection loss on incremental samples and the distillation losses, the model learns newly emerging defect features while mitigating forgetting of existing categories. For concurrent multi-node operation, a task scheduling method driven by CPU and GPU resource states is developed. Edge nodes periodically report resource utilization to the cloud server, where their states are classified as normal, warning, or overload through sliding-average monitoring and threshold judgment. When a node becomes overloaded, sample screening and uploading tasks are first migrated to available neighboring edge nodes; if GPU load still affects detection, part of the inference task is reassigned. Experiments on the NEU-DET dataset show that the proposed method achieves mAP values of 74.8%, 72.4%, and 70.1% in the 2-class + 4-class, 3-class + 3-class, and 4-class + 2-class incremental learning scenarios, respectively. Under edge-node overload conditions, the proposed scheduling strategy reduces the average detection latency to 42 ms, maintains 30 FPS, and improves the key defect sample uploading completion rate to 92.5%. The results demonstrate that the proposed method supports continuous model adaptation while ensuring stable online defect detection.

     

/

返回文章
返回