
基于XGBoost的土壤含水量传感器温度补偿模型研究
沈欣, 吴勇, 孟范玉, 张赓, 于景鑫, 史凯丽
基于XGBoost的土壤含水量传感器温度补偿模型研究
Research on Temperature Compensation Model for Soil Moisture Content Sensors Based XGBoost
土壤含水量传感器数值测定的准确性是其应用于精准灌溉实现农业节水的前提,然而土壤温度的变化对土壤含水量传感器数值采集的偏差具有显著影响。研究的目的在于分析不同土壤温度对土壤含水量传感器测定影响,进一步提出基于XGBoost(eXtreme Gradient Boosting)的土壤含水量传感器温度补偿模型,并验证和对比其预测精度。研究中分别配制土壤含水量为10%、15%、20%、25%、35%的12组梯度湿土土样基准,记录传感器在各土样中0~45 ℃温度变化过程的读数,并将数据集划分后用于模型训练和测试。结果表明:同一土样基准中土壤含水量传感器读数随着土壤温度的升高而增加,各土样基准类别传感器读数最大值与最小值的变幅为[3.6%,7.9%],平均读数变幅为6.25%;所提出的XGBoost土壤含水量温度校正模型能够实现对传感器土壤含水量温度影响的补偿,对测试集的均方误差(MSE)、平均绝对误差(MAE)、均方根误差(RMSE)和决定系数(R 2)分别为0.013%、0.825%、1.165%和0.973。此外,与其他基于树和常用的机器学习模型对比结果显示研究提出的XGBoost温度校正模型具有最佳预测精度。
The accuracy of soil water content sensor measurement values is a prerequisite for its application in precision irrigation to achieve water conservation in agriculture, but the variation of soil temperature has a significant impact on the deviation of soil water content sensor values. The purpose of this study is to analyze the effect of different soil temperatures on the measurement of soil water content sensors, and to further propose an XGBoost (eXtreme Gradient Boosting) based temperature compensation model for soil water content sensors and to verify and compare its prediction accuracy. In this study, 12 sets of gradient wet soil sample benchmarks with soil moisture content of 10%, 15%, 20%, 25%, and 35% were prepared, the sensor readings during the temperature change process from 0 °C to 45 °C in each soil sample were recorded, and the data sets were divided and used for model training and testing. The results showed that: the soil water content sensor readings in the same soil sample benchmark increased with the increase of soil temperature, and the variation of the maximum and minimum sensor readings in each soil sample benchmark category was within [3.6%, 7.9%], with an average reading variation of 6.25%; the proposed XGBoost soil water content temperature correction model could compensate the influence of the sensor soil moisture temperature. The mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R 2) of the test set were 0.013%, 0.825%, 1.165%, and 0.973, respectively; moreover, the comparison results with other tree-based and commonly used machine learning models showed that the XGBoost temperature correction model proposed in the study had the best prediction accuracy.
土壤含水率 / 土壤水分 / XGBoost / 温度补偿 / 机器学习 / 传感器 {{custom_keyword}} /
soil moisture content / soil moisture / XGBoost / temperature compensation / machine learning / sensors {{custom_keyword}} /
表1 土壤背景值测试结果Tab.1 Test results of soil background values |
土源 | 土壤类别 | 砂粒含量/% | 粉粒含量/% | 黏粒含量/% | 干容重/(g·cm-3) | 凋萎系数/% | 田间持水量/% | 饱和含水量/% |
---|---|---|---|---|---|---|---|---|
小汤山土 | 砂质黏壤土 | 54.12 | 24.14 | 21.88 | 1.40 | 17.47 | 26.34 | 38.92 |
表2 XGBoost模型主要参数设置Tab.2 XGBoost model main parameter settings |
参数 | 参数值 | 可选区间 | 释义 |
---|---|---|---|
eta | 0.3 | [0, | 更新时使用的步长尺寸,以防止过度拟合 |
max_depth | 6 | [0,∞] | 树的最大深度,增加会使得模型变得复杂且更容易过拟合 |
min_child_weight | 1 | [0,∞] | 子节点树中所需的实例权重最小和 |
gamma | 0 | [0,∞] | 树的叶结点上进一步分割所需的最小损失 |
subsample | 1 | (0,1] | 训练实例的子样本比例 |
colsample_bytree | 1 | (0,1] | 构建每棵树时列的子样本比例 |
表 3 不同温度下土壤含水量传感器读数值与基准值的差值 (%)Tab.3 Difference between soil moisture sensor measurements and reference values at different temperatures |
真实值 | 与基准值差值 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
0 ℃ | 5 ℃ | 10 ℃ | 15 ℃ | 20 ℃ | 25 ℃ | 30 ℃ | 35 ℃ | 40 ℃ | 45 ℃ | |
9.58 | 3.52 | 4.22 | 4.82 | 5.62 | 5.82 | 6.12 | 6.52 | 6.72 | 7.42 | 9.02 |
9.77 | 3.93 | 4.33 | 5.03 | 5.63 | 6.53 | 6.93 | 7.23 | 7.93 | 8.33 | 9.73 |
10.10 | 4.00 | 4.40 | 5.20 | 5.80 | 6.70 | 7.10 | 7.40 | 8.10 | 8.60 | 10.00 |
14.25 | 5.15 | 6.25 | 7.15 | 8.35 | 8.65 | 9.05 | 9.65 | 9.95 | 10.95 | 12.35 |
17.49 | 4.31 | 5.01 | 5.21 | 5.61 | 6.81 | 7.31 | 8.41 | 9.31 | 9.61 | 11.11 |
18.25 | 3.25 | 3.85 | 4.55 | 5.45 | 6.35 | 6.95 | 7.65 | 8.35 | 9.75 | 10.05 |
18.36 | 4.34 | 5.04 | 5.24 | 5.74 | 6.94 | 7.44 | 8.64 | 9.54 | 9.84 | 11.44 |
22.40 | 5.50 | 6.40 | 6.60 | 7.10 | 8.70 | 9.30 | 10.70 | 11.50 | 12.40 | 13.40 |
26.74 | 5.16 | 5.66 | 5.86 | 5.86 | 6.66 | 7.16 | 7.46 | 7.76 | 8.36 | 8.76 |
27.00 | 4.90 | 5.40 | 5.60 | 5.60 | 6.40 | 6.90 | 9.20 | 10.00 | 11.80 | 12.50 |
27.01 | 3.79 | 4.39 | 5.19 | 5.99 | 6.39 | 6.59 | 6.99 | 7.29 | 8.09 | 7.09 |
34.17 | 8.53 | 9.03 | 9.53 | 10.13 | 10.20 | 10.82 | 11.83 | 12.73 | 13.93 | 14.93 |
表 4 XGBoost及不同机器学习模型的土壤含水量校正精度对比Tab.4 Comparison of the accuracy of soil moisture content correction for XGBoost and different machine learning models |
算法 | 5折交叉验证预测误差 | 测试集预测误差 | ||||||
---|---|---|---|---|---|---|---|---|
MSE/% | MAE/% | RMSE/% | R 2 | MSE/% | MAE/% | RMSE/% | R 2 | |
XGBoost | 0.011 | 0.701 | 1.056 | 0.978 | 0.013 | 0.825 | 1.165 | 0.973 |
Tree | 0.029 | 0.923 | 1.701 | 0.945 | 0.020 | 0.674 | 1.416 | 0.961 |
Random Forest | 0.023 | 0.976 | 1.524 | 0.956 | 0.023 | 0.970 | 1.508 | 0.955 |
Bagging | 0.019 | 0.866 | 1.366 | 0.964 | 0.023 | 0.889 | 1.511 | 0.955 |
Adaboost | 0.022 | 1.212 | 1.501 | 0.956 | 0.024 | 1.302 | 1.556 | 0.952 |
KNN | 0.368 | 5.041 | 6.073 | 0.294 | 0.442 | 5.318 | 6.647 | 0.121 |
SVR | 0.498 | 5.743 | 7.061 | 0.046 | 0.467 | 5.781 | 6.834 | 0.071 |
1 |
操信春, 任杰, 吴梦洋, 等. 基于水足迹的中国农业用水效果评价[J]. 农业工程学报, 2018, 34(5): 1-8.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
2 |
顾哲, 袁寿其, 齐志明, 等. 基于ET和水量平衡的日光温室实时精准灌溉决策及控制系统[J]. 农业工程学报, 2018, 34(23): 101-108.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
3 |
谌文武, 陈浩鑫, 毕骏, 等. 不同方法快速测定土的含水率的可靠性研究[J]. 中南大学学报(自然科学版), 2020, 51(8): 2 152-2 161.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
4 |
田宏武, 郑文刚, 李寒. 大田农业节水物联网技术应用现状与发展趋势[J]. 农业工程学报, 2016, 32(21): 1-12.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
5 |
郭文川, 朱新华. 国外农产品及食品介电特性测量技术及应用[J]. 农业工程学报, 2009, 25(2): 308-312.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
6 |
郁进元, 何岩, 赵忠福, 等. 农田土壤水分各种测量方法的比较与分析[J]. 浙江水利科技, 2007(6): 1-2,12.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
7 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
8 |
孙道宗, 王卫星, 姜晟. 基于双传感器数据融合的土壤湿度测量与建模[J]. 农业工程学报, 2012, 28(15): 60-64.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
9 |
高磊, 施斌, 唐朝生, 等. 温度对FDR测量土壤体积含水量的影响[J]. 冰川冻土, 2010, 32(5): 964-969.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
10 |
张荣标, 刘骏, 张磊, 等. EC-5土壤水分传感器温度影响机理及补偿方法研究[J]. 农业机械学报, 2010, 41(9): 168-172.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
11 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
12 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
13 |
刘洪滨. 基于PSO-LSSVM算法的阶梯式溢洪道复氧率预测[J]. 中国农村水利水电, 2019(11): 198-201.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
14 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
15 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
16 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
17 |
刘燕, 赵武, 郭文远, 等. 2种土壤水分监测仪测墒精度的比较[J]. 气象与环境科学, 2007(增1): 175-178.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
18 |
曹美, 徐晓辉, 苏彦莽, 等. 温度对FDR土壤湿度传感器的影响研究[J]. 节水灌溉, 2015(1): 17-19,23.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
19 |
赛音朝格图, 马文娟, 塔娜. 日光温室内土壤温度对土壤含水率变化的影响[J]. 中国农业大学学报, 2019, 24(3): 102-108.
{{custom_citation.content}}
{{custom_citation.annotation}}
|
20 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
21 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
22 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
23 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
24 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
25 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
26 |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
{{custom_ref.label}} |
{{custom_citation.content}}
{{custom_citation.annotation}}
|
/
〈 |
|
〉 |