Research on Intelligent Identification Method for Nitrogen Content in Greenhouse Cucumber Leaves Integrating YOLOv11n Segmentation and Machine Learning
Weibing Jia, Sicun Lin, Zhengying Wei, Beibei Tian, Xingchen Meng, Yubin ZhangRapid and non-destructive detection of nitrogen content in greenhouse cucumber leaves is essential for precision fertilization, yet traditional chemical methods are destructive and time-consuming, and existing spectral technologies suffer from high cost and poor field adaptability. This study aims to propose a high-precision detection scheme for cucumber leaf nitrogen content based on a lightweight model, suitable for complex scenarios. A total of 698 cucumber leaf images covering three growth stages were collected to build a segmentation dataset. Four categories and eight types of deep learning segmentation models were optimized and compared, and the optimal one was selected to extract leaf regions. Nine color features were extracted and combined with Kjeldahl-measured nitrogen content to construct and optimize three machine learning models, forming a deep learning segmentation–color feature extraction–machine learning prediction process. The results showed that YOLOv11n achieved the best segmentation accuracy, with an IoU of 0.9212 and AP of 0.9998 for high-resolution images. The optimized XGBoost had the highest prediction accuracy, with an MAE of 0.469, MSE of 0.461, and RMSE of 0.679, which are 10.15%, 8.71%, and 4.36% lower than Support Vector Regression with Radial Basis Function kernel (SVR_RBF) respectively, and its predicted nitrogen content aligned well with true values. The proposed scheme integrating YOLOv11n and XGBoost offers a lightweight technical solution for nitrogen nutrition diagnosis and precise fertilization of greenhouse cucumbers.