基于模型剪枝的棉花氮素营养水平诊断

    Diagnosing the nitrogen content of cotton using model pruning

    • 摘要: 确定棉花的氮素营养水平是实施精准施肥的先决条件和基础。近年来,深度学习逐渐应用于氮素营养水平诊断中,但该方法对高性能设备的依赖性较高,限制了其在资源受限边缘设备上的部署应用。针对这一问题,该研究提出一种基于树莓派4B的棉花氮素营养水平诊断方法。研究采用ResNet101网络构建诊断模型,并通过网络瘦身算法对模型进行剪枝优化,最终将剪枝比例为87%的模型部署在资源受限的树莓派4B上。试验结果表明:当剪枝比例达到87%时,模型精度损失2.55个百分点,同时剪枝后模型参数量、计算量和存储体积分别为4.37 M、1.05 G和16.65 MB,明显提高模型在计算能力有限设备上的推理速度,有助于快速、准确地评估田间棉花的氮素营养状况,从而实现对棉花的精准施肥,提高产量和质量。该研究不仅为实现棉花氮素营养水平的大面积快速诊断提供了技术参考,同时对于作物营养水平诊断的智能终端装备研发具有参考价值。

       

      Abstract: Cotton nitrogen deficiency can seriously reduce the grain yield and quality. It is the prerequisite condition to detect the nitrogen nutrition level of cotton, and then implement the accurate fertilization and foundation. Traditional diagnostic technology cannot fully meet the large-scale production in recent years, due to the destructive, time-consuming and labor consuming. Artificial intelligent (AI) technology can be expected to identify the nitrogen nutrient level of cotton in a shorter period of time without any breakage to the cotton. Among them, deep learning has been gradually applied to the diagnosis of the nitrogen nutrition level of crops, due to its automation, high accuracy, and robustness. But the high dependence on high-performance devices has limited the deployment and application of resource-constrained edge devices. In this study, a Raspberry Pi 4B-based model was proposed to diagnose the nitrogen nutrient level of cotton. The data was collected at different nitrogen levels (0, 72, 144, 192, and 240 kg/hm2) during the bolling stage. The images were converted from the RGB to HSI color space. The overexposed or underexposed noises in the images were adjusted to make the features clearer using the gamma function (Gamma). Random flip, rotation and mirroring were also utilized for data enhancement. The final dataset with 5780 images was randomly divided into training, validation and test sets, according to the ratio of 8:1:1. The ResNet101 network was used to construct the diagnostic model, due to the special structure and powerful performance. The model was also pruned and optimized by the network thinning. A comparison was made on the model accuracy, the number of parameters, FLOPs, and model storage volume of the models with different pruning ratios. The results showed that the model with a pruning ratio of 87% was suitable for diagnostic modeling. The model with 87% was suitable to be deployed on Raspberry Pi 4B with limited resources; The model inference time was shortened from 3.22 to 0.91s when the model was converted from PyTorch to ONNX format. Raspberry Pi 4B was ported for the inference with ONNX Runtime. The experimental results show that when the model pruning ratio reached 87%, the loss of model accuracy was 2.55%, while the number of model parameters, FLOPs, and storage volume were 4.37 M, 1.05 G, and 16.65 MB, respectively. The inference speed of the model was significantly improved on the equipment with limited computing power. The nitrogen nutritional status of cotton was rapidly and accurately assessed in the field. The precise application of nitrogen to cotton was realized in this case. Thus, the accurate fertilization of cotton was realized to improve the yield and quality. This finding can provide a technical reference to realize the rapid diagnosis of the nitrogen nutrition level of cotton over a large area. A strong reference was also offered for the research and development of intelligent terminal equipment to detect the crop nutrition level.

       

    /

    返回文章
    返回