欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture

• •    

机器学习揭示土壤养分对玉米产量形成驱动作用——以云南地区为例

孙佳泽1,2, 曲明山3, 杨积忠4, 娄垂新4, 李光伟2, 张钟莉莉5()   

  1. 1. 中国农业大学信息与电气工程学院,北京 100083,中国
    2. 北京市农林科学院信息技术研究中心,北京 100097,中国
    3. 北京市农业技术推广站,北京 100029,中国
    4. 云南供销产业投资有限公司,云南 昆明 650000,中国
    5. 北京市农林科学院智能装备技术研究中心,北京 100097,中国
  • 收稿日期:2025-08-27 出版日期:2026-06-01
  • 基金项目:
    云南省重大科技专项计划项目(202202AE090013); 国家玉米产业技术体系(CARS-02); 北京市农林科学院优秀青年科学家培养(YXQN202304-C)
  • 作者简介:

    孙佳泽,在读博士生,研究方向为智慧水肥调控技术与装备。E-mail:

  • 通信作者:
    张钟莉莉,副研究员,研究方向为智慧水肥调控技术与装备,E-mail:

Machine Learning Reveals the Driving Effects of Soil Nutrients on Maize Yield Formation: A Case Study of Yunnan, China

SUN Jiaze1,2, QU Mingshan3, YANG Jizhong4, LOU Chuixin4, LI Guangwei2, ZHANG Zhonglili5()   

  1. 1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China
    2. Information Technology Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    3. Beijing Agricultural Technology Extension Station, Beijing 100029, China
    4. Yunnan Supply and Marketing Industrial Investment Co. , Ltd. , Kunming 650000, China
    5. Intelligent Equipment Research Center, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
  • Received:2025-08-27 Online:2026-06-01
  • Foundation items:Yunnan Provincial Major Science and Technology Special Project(202202AE090013); China Agriculture Research System of Maize(CARS-02); Training Program for Excellent Young Scientists of Beijing Academy of Agriculture and Forestry Sciences(YXQN202304-C)
  • About author:

    SUN Jiaze, E-mail:

  • Corresponding author:
    ZHANG Zhonglili, E-mail:

摘要:

【目的】 云南省玉米种植区地形破碎、气候垂直分异明显,土壤养分与产量均存在较强空间差异。为明确主要土壤养分对玉米产量差异的影响,并提高复杂山地环境下产量预测结果的可解释性,构建融合空间信息与土壤养分特征的机器学习模型,为分区施肥和耕地质量提升提供依据。 【方法】 基于2005—2020年云南省测土配方施肥土壤基础养分数据和5 km玉米产量栅格数据,选取有机质、全氮、有效磷、速效钾及经纬度变量,采用粒子群优化-极端梯度提升模型(Particle Swarm Optimization-Extreme Gradient Boosting,PSO-XGBoost)开展产量预测,并与多种机器学习模型进行对比。为检验空间相邻样本可能导致的精度高估风险,进一步设置空间分块交叉验证和去除经纬度的消融实验;同时引入沙普利加和解释(SHapley Additive exPlanations,SHAP)方法分析各变量贡献及主导因子的空间分布。 【结果】 PSO-XGBoost在随机划分下决定系数R2为0.91,优于LightGBM(Light Gradient Boosting Machine)、CatBoost(Categorical Boosting)和未优化极端梯度提升模型(Extreme Gradient Boosting,XGBoost)等模型;空间分块验证下R2为0.847,说明模型在更严格的空间验证条件下仍保持较好的预测能力。去除经纬度后R2降至0.698,表明空间背景信息对云南玉米产量预测具有重要作用。SHAP分析显示,经纬度反映的区域环境差异贡献较高,有机质、全氮、有效磷和速效钾均对产量形成具有影响,且不同区域主导因子存在差异。 【结论】 云南玉米产量受土壤养分与空间环境共同影响,单一养分难以完全解释产量差异。PSO-XGBoost结合SHAP可用于识别区域产量差异及主要养分约束,为云南山地玉米分区施肥和耕地质量管理提供参考。

关键词: 玉米产量预测, PSO-XGBoost, SHAP, 土壤养分, 空间异质性

Abstract:

[Objective] Maize production in Yunnan province is strongly affected by its mountainous terrain, fragmented cropland, and pronounced vertical climatic gradients. These natural conditions lead to large spatial differences in soil nutrient status and maize yield across the province. In contrast to more homogeneous plain regions, yield variation in Yunnan is usually not controlled by one nutrient factor alone. It is more likely the combined result of soil fertility, climate background, terrain constraints, and other spatial environmental conditions. Therefore, using only traditional statistical methods or single soil indicators is often insufficient to explain regional yield differences. To address this issue, an interpretable machine learning approach that combines soil nutrient variables with spatial information was developed. The purpose was to improve maize yield prediction and, more importantly, to identify the main factors related to yield differences in different parts of Yunnan. [Methods] Soil testing and formula fertilization data from Yunnan province during 2005–2020 were combined with 5 km gridded maize yield data. Four soil nutrient indicators were selected, including soil organic matter, total nitrogen, available phosphorus, and available potassium. Longitude and latitude were also used as input variables. In this study, these two variables were not treated simply as location labels. They were included because spatial position can partly reflect regional environmental gradients that are difficult to describe using soil nutrient data alone, such as differences in elevation, heat and moisture conditions, terrain fragmentation, and cropping background. Based on these variables, particle swarm optimization was used to tune the main hyperparameters of the XGBoost model, forming a PSO-XGBoost yield prediction model. The optimized model was compared with LightGBM, CatBoost, random forest, support vector regression, and the original XGBoost model. Considering that nearby samples may share similar environmental conditions, random partitioning alone may overestimate model performance. Therefore, spatial block cross-validation was further used to examine the model's ability to predict yield under spatial separation. In addition, longitude and latitude were removed in an ablation experiment to test the contribution of spatial background information. Finally, SHAP was used to interpret the trained model, quantify the contribution of each variable, analyze the response of yield prediction to soil nutrients and spatial factors, and identify the dominant limiting factors in different maize-growing areas. [Results and Discussions] PSO-XGBoost showed the best performance among the tested models. Under random data partitioning, the model achieved an R2 of 0.91, indicating that it could effectively capture the relationship among soil nutrients, spatial background, and maize yield. Compared with LightGBM, CatBoost, and the unoptimized XGBoost model, PSO-XGBoost gave more accurate and stable predictions. This result suggested that particle swarm optimization improved the parameter configuration of XGBoost and made it more suitable for yield prediction in complex mountainous regions. Under spatial block cross-validation, the R2 decreased to 0.847. Although this value was lower than that obtained from random partitioning, it still showed good predictive performance under a stricter validation strategy. This also indicated that the model did not rely only on the similarity between neighboring samples, but retained a certain ability to predict yield in spatially separated areas. The ablation experiment further confirmed the importance of spatial information. After longitude and latitude were removed, the model R2 dropped sharply to 0.698. This decline showed that maize yield patterns in Yunnan cannot be well explained by soil nutrient indicators alone. Spatial variables probably contain information related to elevation-induced climatic differences, regional hydrothermal conditions, terrain fragmentation, and differences in the cropping environment. The SHAP results led to a similar conclusion. Longitude and latitude had relatively large contributions, suggesting that regional environmental gradients played an important role in yield formation. Among the soil nutrient variables, soil organic matter, total nitrogen, available phosphorus, and available potassium were all related to maize yield, but their roles differed across Yunnan. In some areas, yield was more closely associated with organic matter and nitrogen supply, while in others phosphorus or potassium appeared to be more limiting. This spatial difference suggested that the main constraints on maize production were not the same across the province. For this reason, a province-wide fertilization scheme would be difficult to apply effectively. Nutrient management in Yunnan should instead be adjusted according to local soil conditions and the environmental background of different mountainous regions. [Conclusions] Maize yield in Yunnan province is affected by both soil nutrient conditions and broader spatial environmental factors. Soil fertility is still an important basis for yield formation in mountainous farmland, but it does not explain the spatial yield differences on its own. By combining PSO-XGBoost with SHAP, this study provides a way to improve yield prediction while also tracing the main factors related to regional yield variation. The framework can be used to identify areas where nutrient constraints are more likely to occur, as well as areas where terrain, climate background, or other regional environmental factors may have a stronger influence. These results can support more targeted fertilization, cultivated land quality improvement, and sustainable maize production in the mountainous agricultural areas of Yunnan.

Key words: maize yield prediction, PSO-XGBoost, SHAP, soil nutrients, spatial heterogeneity

中图分类号: