高级检索+

融合类别特定焦点损失与向量缩放校准的番茄叶片病害检测

Tomato leaf-level disease detection via class-specific focal loss and vector scaling calibration

  • 摘要: 【目的】针对番茄叶片多种病虫害检测中识别难度不平衡和模型置信度校准精度不足的问题,该研究对Faster R-CNN架构进行改进,提出类别特定焦点损失(class-specific focal loss,CSFL)与双参数置信度校准(dual-parameter calibration,DPC)技术,以期在保证检测精度的同时提升模型输出置信度的可靠性。【方法】针对叶片级框选检测任务的特性,为不同病害类别预置差异化的α和γ参数,构建CSFL函数以缓解各类别间识别难度不平衡问题;采用向量缩放(Vector Scaling)思想联合优化温度参数和偏置参数以实现DPC;并引入期望校准误差(expected calibration error,ECE)作为核心评价指标,在包含早疫病、晚疫病、叶霉病、白粉病、斑枯病、番茄花叶病毒6种主要番茄病害的数据集上进行训练与测试。【结果】改进后模型平均精度均值mAP0.5达到96.07%,相较RT-DETR、RetinaNet等模型在检测精度上具有显著优势;与YOLOv8s相比,本研究模型的mAP0.5指标略逊于其98.69%,但校准可靠性更优:ECE由校准前的4.49%降至2.96%,显著低于YOLOv8s的5.41%,最大校准误差(maximum calibration error,MCE)为27.07%,远低于YOLOv8s的42.96%,有效缓解了深度学习模型在农业病害检测中普遍存在的置信度虚高问题。在真实复杂田间测试集中,该模型仍保持90.23%的mAP0.5,且ECE稳定控制在8.02%的较低水平。【结论】该研究提出的模型在番茄叶片级病害检测中实现了精度与可靠性的平衡,证实了其在复杂开放环境下的决策稳健性与实际落地潜力,可为农业病害检测模型的可靠性优化提供参考。

     

    Abstract: Abstract
    Objective Accurate identification of diverse tomato leaf diseases is often hindered in practical agricultural applications by two coupled problems: substantial visual variation among disease categories leads to imbalanced recognition difficulty, and deep-learning-based detectors frequently produce confidence scores that deviate from the actual empirical accuracy, undermining the trustworthiness of automated decisions. To address these problems jointly, this study improves the Faster R-CNN framework by introducing a class-specific focal loss (CSFL) and a dual-parameter calibration (DPC) strategy, aiming to enhance detection accuracy for multiple tomato diseases while simultaneously improving the reliability of the model's confidence outputs.
    Methods Considering the characteristics of leaf-level bounding-box detection tasks, differentiated scaling factor α and focusing parameter γ were preset for each disease category according to its visual feature complexity and sample scarcity, in order to construct the CSFL function. Instead of applying a single uniform loss across all categories, this category-specific parameter configuration reweights the training gradients according to category-specific recognition difficulty and thereby alleviates the imbalance in identification difficulty among categories with markedly different lesion morphologies. For confidence calibration, the idea of vector scaling was adopted to jointly optimize a class-specific temperature parameter and bias parameter within the logit transformation layer, realizing the proposed DPC mechanism as a post-hoc calibration step without altering the bounding-box coordinates or degrading detection precision.The expected calibration error (ECE) was introduced as the core evaluation metric to quantify the discrepancy between predicted confidence and empirical accuracy, and the maximum calibration error (MCE) was additionally reported to capture worst-case miscalibration. The proposed framework was trained and tested on a dataset covering six major tomato diseases, namely early blight, late blight, leaf mold, powdery mildew, septoria leaf spot, and tomato mosaic virus, and was further validated on an independent field dataset collected under real agricultural conditions with complex backgrounds, occluded leaves, and uncontrolled illumination, so as to examine the model's generalization capability beyond the controlled training environment.
    Results The improved model achieved a mean average precision (mAP0.5) of 96.07%, showing a clear advantage in detection accuracy over mainstream detectors such as RT-DETR (92.31%) and RetinaNet (75.01%). Meanwhile, the model maintained a real-time detection speed with a frame rate of 80.21 FPS, outperforming the baseline Faster R-CNN (79.20 FPS). Compared with YOLOv8s, the proposed model's mAP0.5 was slightly lower than YOLOv8s's 98.69%, but its calibration reliability was markedly superior: the ECE decreased from 4.49% of the baseline Faster R-CNN to 2.96% after DPC was applied, notably lower than YOLOv8s's 5.41% and RT-DETR's 4.82%, while the MCE was 27.07%, far below YOLOv8s's 42.96% and RetinaNet's 46.99%. These results indicate that the proposed calibration mechanism effectively alleviates the overconfidence problem that is commonly observed in deep-learning-based agricultural disease detection models. Under the more challenging field test set, characterized by natural background interference and uncontrolled lighting, the model still maintained an mAP0.5 of 90.23% while keeping the ECE stable at a relatively low level of 8.02%, demonstrating consistent detection accuracy and calibration robustness beyond the controlled training environment.
    Conclusions The proposed model achieves a favorable balance between detection precision and confidence reliability in tomato leaf-level disease detection, confirming its decision-making robustness and practical deployment potential under complex and open field environments. These findings provide a valuable reference for optimizing the reliability of deep-learning-based models applied to agricultural disease detection, and lay a foundation for extending this calibration-aware detection paradigm to a broader range of crop protection applications.

     

/

返回文章
返回