欢迎您访问《智慧农业(中英文)》官方网站! English
专题--智能农业传感器技术

非接触电导检测土壤养分离子的谱峰自动识别方法

  • 唐超礼 , 1 ,
  • 李浩 , 1, 3 ,
  • 王儒敬 , 2, 3 ,
  • 王乐 1, 3 ,
  • 黄青 2, 3, 4 ,
  • 王大朋 2, 3 ,
  • 张家宝 3 ,
  • 陈翔宇 , 2, 3
展开
  • 1. 安徽理工大学 电气与信息工程学院,安徽 淮南 232001,中国
  • 2. 中国科学院合肥物质科学研究院,智能机械研究所,安徽省智慧农业工程实验室,安徽 合肥 230031,中国
  • 3. 中科合肥智慧农业协同创新研究院,农业传感器与智能感知安徽省技术创新中心,安徽 合肥 231131,中国
  • 4. 中国科学技术大学,安徽 合肥 230026,中国
1. 王儒敬,博士,研究员,研究方向为农业传感器与智能感知。E-mail:;2
陈翔宇,博士,副研究员,研究方向为农业传感器与现场快检装备。E-mail:

唐超礼,研究方向为信号与信息处理。E-mail:

TANG C

haoli, E-mail:

收稿日期: 2023-09-27

  网络出版日期: 2024-02-06

Automatic Identification Method for Spectral Peaks of Soil Nutrient Ions Using Contactless Conductivity Detection

  • TANG Chaoli , 1 ,
  • LI Hao , 1, 3 ,
  • WANG Rujing , 2, 3 ,
  • WANG Le 1, 3 ,
  • HUANG Qing 2, 3, 4 ,
  • WANG Dapeng 2, 3 ,
  • ZHANG Jiabao 3 ,
  • CHEN Xiangyu , 2, 3
Expand
  • 1. School of Electrical and Information Engineering, Anhui University of Science and Technology, Huainan 232001, China
  • 2. Hefei Institutes of Physical Science, Chinese Academy of Sciences, Institute of Intelligent Machines, Intelligent Agriculture Engineering Laboratory of Anhui Province, Hefei 230031, China
  • 3. Agricultural Sensors and Intelligent Perception Technology Innovation Center of Anhui Province, Zhongke Hefei Institutes of Collaborative Research and Innovation for Intelligent Agriculture, Hefei 231131, China
  • 4. University of Science and Technology of China, Hefei 230026, China
1. WANG Rujing, E-mail: ; 2
CHEN Xiangyu, E-mail:

Received date: 2023-09-27

  Online published: 2024-02-06

Supported by

National Key Research and Development Program of China(2023YFD1701800)

National Natural Science Foundation of China(12304236)

Anhui Provincial Natural Science Foundation(2308085QA19)

Scientific and Technological Resources in Anhui Province(S2022t06010123)

The Dean Foundation of Hefei Institutes of Physical Science, Chinese Academy of Sciences(YZJJ2024QN38)

Copyright

copyright©2024 by the authors

摘要

目的/意义 电容耦合非接触式电导检测(Capacitively Coupled Contactless Conductivity Detection, C4D)在农业土壤养分离子检测方面发挥着重要作用。对C4D信号中离子特征峰的有效识别,有利于后续对离子特征峰的定性和定量分析,为加强农业土壤养分管理提供依据。然而,C4D信号的特征峰检测仍然存在无法自动精准识别、人工操作复杂、效率低等缺点。 方法 提出一种基于连续小波变换结合粒子群优化(Particle Swarm Optimization, PSO)和最大类间方差法(Otsu)的谱峰自动识别算法,旨在实现准确、高效、自动化的C4D信号峰识别。采用C4D检测样品溶液,得到离子谱图信号,对谱图信号进行连续小波变换,得到小波变换系数矩阵。通过搜索小波系数变换系数矩阵极值,识别出脊线和谷线。将小波系数矩阵转换为灰度图像,结合PSO和Otsu寻找最佳阈值,进一步对灰度图像的背景和目标分割,再结合原始谱图中的脊谷线识别谱图中的特征峰。[结果与讨论]测试含有41、61和102个峰的数据集,以受试者工作特性(Receiver Operating Characteristic, ROC)曲线和度量值作为评估峰值检测算法性能的准则。与其他方法相比,基于连续小波变换结合粒子群优化的最大类间方差法分割图像(Continuous Wavelet Transform Combined with Particle Swarm Optimization of Otsu to Segment Image, CWTSPSO)的谱峰自动识别算法的ROC曲线均保持在0.9以上,度量值分别为0.976、0.915和0.969。CWTSPSO能够有效检测出更多弱峰和重叠峰,同时检测出更少的假峰,有利于提升C4D信号的谱峰识别率和精准性。 结论 本研究提出的CWTSPSO能为非接触式电导检测农业土壤养分离子信号分析提供有力支持。

本文引用格式

唐超礼 , 李浩 , 王儒敬 , 王乐 , 黄青 , 王大朋 , 张家宝 , 陈翔宇 . 非接触电导检测土壤养分离子的谱峰自动识别方法[J]. 智慧农业, 2024 , 6(1) : 36 -45 . DOI: 10.12133/j.smartag.SA202309028

Abstract

Objective Capacitive coupled contactless conductivity detection (C4D) plays an important role in agricultural soil nutrient ion detection. Effective identification of characteristic ion peaks in C4D signals is conducive to subsequent qualitative and quantitative analysis of characteristic ion peaks, which provides a basis for improving agricultural soil nutrient management. However, the detection of characteristic peaks in C4D signals still has shortcomings, such as the inability of automatic and accurate identification, complicated manual operation, and low efficiency. Methods In this study, an automatic spectral peak identification algorithm based on continuous wavelet transform combined with particle swarm optimization (PSO) and maximum interclass variance method (Otsu) was proposed to achieve accurate, efficient and automated identification of C4D signal peaks. Capillary electrophoresis (CE) combined with a C4D device (CE-C4D) was used to detect the standard ions and soil sample solutions to obtain the C4D ion signal spectra, which were simulated according to the characteristics of the real C4D signal spectra to obtain the C4D simulated signals containing single Gaussian peaks and multi-Gaussian peaks. The continuous wavelet transform was performed on the C4D spectrogram signal to obtain the wavelet transform coefficient matrix. The local maxima and local minima of the continuous wavelet transform coefficient matrix were searched by the staircase scanning method, and the local maxima and local minima were connected to form ridges and valleys. The wavelet coefficient matrix was converted to a gray-scale image by logistic mapping to visualize the data. The number of particle populations in PSO was set to 15, the gray scale threshold of 15 particles was set to a random integer within the gray scale level of 0~255, and the initial velocity of the particles was set to 5. The combination of PSO and Otsu calculated the fitness (variance value) of each particle, updated the individual best position and the global best position, further updated the velocities and positions of the particles to find the global best position (the maximum interclass variance), and defined the maximum interclass variance was defined as the optimal threshold value, used the optimal threshold value for background and target segmentation of the gray-scale image and extracted the ridges within the peak region segmented from the gray-scale image by the PSO-Otsu algorithm. A threshold was set according to the length of the ridge line; the ridge lines larger than the threshold were extracted; the valley lines on both sides of the ridge line were found according to the filtered ridge line; and the start and end points of the peak region were obtained from the valley lines. The filtered ridge lines were used to identify the peak location of the peak region, and the edge threshold was set to remove the false peaks due to continuous wavelet transform (CWT) located in the edge region of the C4D signal and to accurately identify the location of the true peak value. Results and Discussions The datasets containing 41, 61 and 102 peaks were tested, and the Receiver Operating Characteristic (ROC) curves and metric values were used as a guideline to evaluate the performance of the peak detection algorithms. Compared to the two methods, multi scale peak detection (MSPD) and CWT-based image segmentation (CWT-IS), the CWT combined with Particle Swarm Optimization based maximum spectral peaks automatic identification algorithm based on Continuous Wavelet Transform combined with Particle Swarm Optimization of Otsu to segment image (CWTSPSO) method of interclass variance segmentation (CWT-IS), the ROC curves of the three groups remained above 0.9. Testing the dataset containing 102 peaks, the ROC curves of MSPD and CWT-IS were also high only in the case of high false discovery rate. The highest metric values of CWTSPSO were 0.976, 0.915, and 0.969, respectively, and the highest metric values of 1 set of MSPD and CWT-IS were 0.754 and 0.505. The results showed that the ROC curves of CWTSPSO in the 3 sets of dataset were not high. Using ROC curves and metric values as a criterion comparison to evaluate the performance of peak detection algorithms, the characteristic peak recognition performance was outstanding, which could achieve a higher correct rate while maintaining a lower false discovery rate, effectively detected more weak and overlapping peaks while detecting fewer false peaks, which was conducive to the enhancement of the spectral peak recognition rate and accuracy of the C4D signals. Conclusions This study provided a fast and accurate method for the identification of characteristic peaks in the spectrograms of ion signals detected by contactless conductivity, CWTSPSO could accurately identify the weak and overlapping peaks in the spectrograms of ion signals detected by contactless conductivity. The automatic identification algorithm of the spectrogram peaks of CWTSPSO would provide powerful support for the characterization and quantification of the signals of nutrient ions detected by contactless conductivity in agricultural soils and would further strengthen the precision of soil fertilization and crop growth management fertilization and crop growth management.

0 引 言

电容耦合非接触电导检测(Capacitively Coupled Contactless Conductivity Detection, C4D)因其极高的准确性、灵敏度及无需直接接触溶液等优 点,在农业土壤、农业用水等复杂农业环境样品检测1, 2中应用广泛。C4D信号中的特征峰高度3或面积4与样品离子浓度在一定范围内存在线性关系。因此,C4D信号峰检测是进一步定量样品中离子浓度的关键步骤。然而,C4D信号会受到多种因素的影响,如样品不纯、基线漂移和仪器产生的随机噪声5, 6,这可能会导致识别出假峰或漏识别真峰。此外,通过可视化手动验证峰检测结果非常耗时,这对峰检测提出了巨大挑战。因此,设计一种自动且准确的C4D信号峰检测方法对定量复杂农业环境样品离子浓度具有重要意义。
目前,峰自动识别算法主要有导数法7, 8、曲线拟合法9, 10、滑动窗口法11, 12、自适应寻峰法13, 14、小波变换法15-18等。Zhai等19通过检测农作物表面毒死蜱物质得到的谱图,利用自适应缩放和二阶导数结合的方法识别谱图中的特征峰;Hong等20利用分数阶导数的方法识别农业土壤中的重金属离子谱图中的特征峰;李传文等21通过毛细管结合电容耦合非接触电导检测(Capillary Electrophoresis and Capacitively Coupled Contactless Conductivity Detection, CE-C4D)仪器检测农业土壤中的养分离子,利用导数法和高斯曲线拟合的方法识别谱图中的特征峰。以上方法虽然能够有效识别出特征峰,但也会识别出因噪声产生的假峰或识别的峰值位置不准确。
相比于其他谱峰自动识别方法,小波变换因其受干扰影响较小、对弱峰和重叠峰识别效果较好22, 23等优势在谱峰自动识别算法中应用广泛。Du等15应用基于连续小波变换的峰值检测算法,降低了噪声和基线漂移对峰检测的干扰,此方法虽然提高了对弱峰的识别,但对重叠峰的检测结果并不理想。Liu等16改进了母小波以缩短其线宽,识别谱峰并取得了良好的效果。该方法在重叠峰检测方面有较好的表现,但仍会导致弱峰丢失和识别假峰。Zheng等17提出了改进连续小波变换的方法,将小波变换与疯狂攀登算法相结合可以有效识别弱峰和重叠峰,但也会识别出较多的假峰。Zhou等18提出了基于图像分割的峰值检测算法,与基于遗传算法的最大类间方差法(Otsu)结合,克服了传统Otsu方法无法处理长尾单峰直方图的不足,能准确识别弱峰和重叠峰,识别出较少的假峰。然而,该方法计算过于复杂。
综上所述,自动准确的峰值检测方法既要有效识别弱峰和重叠峰,又要保持较低的误发现率。针对该问题,本研究提出一种基于连续小波变换结合粒子群优化的最大类间方差法分割图像(Continuous Wavelet Transform Combined with Particle Swarm Optimization of Ostu to Segment Image,CWTSPSO)算法,从而将小波空间中的峰值区域与背景分离,同时消除假脊,结合提取脊线对C4D信号进行峰识别和峰筛选得到准确峰位置,实现土壤养分离子的谱峰自动识别。

1 理论与方法

1.1 连续小波变换

连续小波变换(Continuous Wavelet Transform, CWT)通过在每个尺度的平移变换,使C4D信号中的峰值信息更加明显。CWT表示为公式(1)
C W T ( a , b ) = - + x ( t ) × 1 a ψ t - b a d t
式中: x ( t )为输入信号; t为时间,s; a为尺度参数; b为平移参数; ψ ( t )为小波母函数。
C4D信号峰与高斯峰的形状类似21。基于此特征,本研究选择具有近似对称性和一个主高斯峰的墨西哥帽小波,通过墨西哥帽小波对C4D信号进行CWT,建立CWT系数矩阵。
为评估所选小波的有效性,引入高斯差分(Difference of Gaussians, DOG)近似墨西哥帽小波,类似于带通滤波器,将DOG与小波的匹配程度作为评价标准。图1对比了DOG与墨西哥帽小波。由图1(a)可知,利用两个高斯函数差得到DOG,其相对标准差分别为σ=0.8,σ=1.2。图1(b)中DOG乘以5,用于逼近墨西哥帽小波。结果表明,DOG小波与墨西哥帽小波的匹配度较好,墨西哥帽小波与DOG的均方根误差(Root Mean Square Error, RSME)仅为0.014 5。因此,把墨西哥帽小波作为母小波对C4D信号进行CWT是一个合理的选择。
图1 连续小波变换小波选择

Fig. 1 Continuous wavelet transform wavelet selection

1.2 小波空间中的脊和谷

将C4D信号进行CWT,如图2(a)图2(b)所示。图2(a)为C4D仿真信号谱图;图2(b)为C4D的CWT系数矩阵。在CWT系数矩阵中寻找局部最大值和局部最小值作为脊线和谷线。脊线对应峰值所在位置,谷线用于确定峰值所在区域。搜索局部最大值和局部最小值如公式(2)公式(3)所示。
M ( j , i ) > m a x M ( j , i - 1 ) , M ( j , i + 1 ) M ( j , i ) > T , B ( j , i ) = " T u r e "
M ( j , i ) < m i n M ( j , i - 1 ) , M ( j , i + 1 ) M ( j , i ) < T , B ( j , i ) = " T u r e "
式中: B为布尔二维矩阵; M为CWT系数矩阵中的一个元素; i j分别为滑动坐标和尺度。
为找出每一个刻度上的极值,首先设置一个窗口大小为3的滑动窗口用于搜索CWT系数矩阵的局部极值,搜索到的局部极值形成局部最大值布尔矩阵和局部最小值布尔矩阵。但是,当窗口过大时会导致寻找到的局部极值点比较稀疏或不明显;当窗口选择过小,无法确定合适的中值作为局部最大值及局部最小值。
后续步骤是将局部极值连接成脊线和谷线。本研究选择楼梯扫描法连接局部最大值成脊线、局部最小值成谷线。楼梯扫描法能够充分考虑局部极大值的分布特征,避免人为参数的不确定性,很少导致脊的误判或漏辨24。局部极值扫描后的脊线和谷线如图2(c)图2(d)所示。
图2 仿真C4D信号脊线和谷线查找

Fig. 2 Simulation C4D signal ridge and valley line search

1.3 灰度转换

将CWT系数矩阵转换为灰度图像后再分割灰度图像。由于CWT系数之间的差异较大,为防止灰度的分辨率过低而无法有效识别脊线和谷线区域,使用Logistic映射模式25。Logistic映射为非线性映射,可以根据图像的特性自动调整映射函数的参数,如公式(4)所示。
f ( x ) = 255 1 + e 2 × ( x - m ) σ
式中: f ( x )为CWT系数矩阵中特定元素的转换值; x为CWT系数矩阵中该元素的值; m为连续小波变换矩阵的均值; σ为CWT系数矩阵的标准差。
对CWT系数矩阵中的每个值进行处理。较大的值对应较亮的像素;较小的值对应较暗的像素。通过均值和标准差进行缩放和偏移,应用Logistic函数,将值映射到[0,255]的范围内。

1.4 PSO结合Otsu

在本研究中,使用Otsu算法将CWT系数矩阵映射的灰度图像分成目标和背景两部分26,目标与背景的类间方差越大,分割效果越好。然而,当灰度直方图类似于长尾的单峰直方图时,Otsu算法无法处理。利用PSO算法操作简单、收敛速度快27,及适用于全局寻找最优解的优点,将PSO与Otsu结合,通过PSO算法初始化粒子位置和速度,计算每个粒子的适应度(方差值),更新个体最佳位置和全局最佳位置,进一步更新粒子的速度和位置,找到全局最佳位置(最大类间方差)。利用最佳分割阈值,分割更完整目标信息。
PSO优化Otsu最佳分割阈值寻找步骤:
1)粒子群的个体初始化:设定粒子种群数量为15,另外15个粒子的灰度阈值设置为0~255灰度级内的随机整数。
2)设置每个粒子的初始速度:设定粒子的初始速度为5。
3)计算每个粒子的最佳位置和全局最佳位置:计算每个粒子的最大类间方差,并找到全局最大类间方差确定其位置。
4)判断算法是否结束:如果全局最大方差对应的位置不是最优值则重复1)~3)步骤,直到找到最佳分割阈值。
CWT系数矩阵经Logistic映射转换成灰度图像后,应用PSO结合Otsu对灰度图进行分割,峰值区域的灰度值高于平缓区域的灰度值,从而分割出峰值区域。

1.5 峰值识别

在CWT系数矩阵中获取过滤后的脊线和谷线结合PSO-Otsu算法分割出的灰度图像,识别特征峰。峰值识别步骤:
1)提取经PSO-Otsu算法从灰度图像中分割出来的峰区域内的脊线。
2)为消除不规则噪声产生的假峰,根据脊线的长度设置阈值,提取大于该阈值的脊线。
3)根据过滤后的脊线,寻找脊线两侧的谷线,并通过谷线获取峰区域的起点和终点。
4)根据筛选的脊线识别峰区域的峰值位置。
5)根据C4D信号峰位特性对识别的峰值位置进行过滤,特征峰不会过度密集。对于具有相同或相近横坐标的峰,仅保留具有最大纵坐标值的峰。设置边缘阈值,删除位于C4D信号的边缘区域内因CWT产生的假峰,以避免误识别。
在上述峰值识别的过程中,经过PSO-Otsu处理后的峰值区域,在每个峰值区域只会出现一个峰,有效避免假峰,准确识别出真峰,对于弱峰和重叠峰能准确识别出峰值位置。

2 实验结果和讨论

2.1 实验数据

2.1.1 模拟C4D信号谱图数据

为验证所提峰值检测算法的性能,根据公式(5)仿真生成含有高斯白噪声的C4D信号谱图。
f ( x ) = A × e -   ( x - μ ) 2 2 σ 2
式中: f ( x )为高斯函数在 x处峰的幅度; A为峰的高度; μ为峰的中心位置; σ为峰的标准差。仿真谱图中的峰都不同,包括单峰、重叠峰和弱峰,峰的具体参数如表1所示。
表1 峰识别研究的高斯峰仿真数据

Table 1 Gaussian peak simulation data for peak recognition research

A μ σ

1

2

3

4

10.0

9.0

8.0

0.5

1.0

3.0

3.6

7.0

0.12

0.20

0.18

0.12

为进一步评估CWTSPSO方法进行峰值检测的准确性,使用公式(5)继续生成3组C4D信号数据集,每个数据集里分别含有41、61和102个高斯峰。

2.1.2 真实C4D离子信号谱图数据

通过本课题组研发的毛细管电泳(Capillary Electrophoresis,CE)结合C4D装置(CE-C4D)检测不同浓度的标准离子溶液和真实土壤样品溶液(土壤均采集于在安徽省合肥市农田)。首先,确保仪器部件接线正确,依次打开高压电源、检测器和采集程序。将预处理好的土壤样品溶液放置在毛细管进样口处,进样电压设为10 kV,然后开始仪器的电注射程序,高压模块放电驱动毛细管两端溶液中离子在毛细管中运动4。对于钾离子、铵根离子等阳离子检测,采用阳离子缓冲液,电泳电压设置为+14 kV;对于硝酸盐离子、磷酸盐等阴离子检测,采用磷酸盐缓冲溶液和硝酸盐缓冲溶液,电泳电压设置为-14 kV。高压供电后,采集程序将开始记录电泳信号频谱图,目标离子电泳峰出现后,关闭高压电源并停止采集程序,数据在计算机上自动保存28。通过CE-C4D装置检测标准溶液和土壤样品溶液,得到的离子谱图包括铵根离子、钾离子、硝酸根离子、磷酸根离子标准溶液谱图,以及农田土壤样品溶液谱图。得到的谱图数据可用于本研究提出的谱峰自动识别算法的验证。

2.2 CWTSPSO的可行性和有效性

本研究通过多组含有噪声的模拟C4D信号谱图验证CWTSPSO在谱峰识别中的可行性和有效性。CWTSPSO具体识别仿真峰的实验结果,如图3所示。
图3 仿真C4D信号峰识别过程

Fig. 3 Simulation of C4D signal peak recognition process

图3(a)表1数据的C4D信号仿真图。图3(b)表示CWT系数矩阵经过Logistic映射转化为灰度图像。基于PSO的Otsu阈值法对图像进行分割,最佳分割阈值在灰度直方图如图3(c)所示。图3(d)为分割后的峰值区域。通过分割后的区域结合脊线提取出峰值区域的脊线,结果如图3(e)所示。图3(f)为根据脊线和谷线识别的特征峰。根据以上实验结果,可以得到无论是重叠峰(峰2和峰3)还是弱峰(峰4),通过CWTSPSO算法可以很好地实现峰值区域的分割以及脊线提取,准确识别峰值。因此,该实验结果体现了所提出的峰检测方法的可行性和有效性。

2.3 CWTSPSO的可靠性

本研究使用真实C4D信号谱图验证CWTSPSO在谱峰识别中的可靠性,通过CE-C4D设备检测样品溶液得到C4D信号谱图。CWTSPSO检测真实C4D信号谱图的实验结果,如图4所示。
图4 标准离子溶液和农田土壤浸提液谱图峰识别

Fig. 4 Peak detection in standard ion solution and soil leachate spectra

通过图4(a)钾离子标准溶液、图4(b)铵根离子标准溶液和图4(c)硝酸根离子标准溶液C4D信号谱图中特征峰识别结果可知,本研究所提出的方法可以有效识别真实特征峰,可以有效避免噪声产生的假峰。由图4(d)磷酸根离子标准溶液、图4(e)图4(f)农田土壤样品溶液C4D信号谱图可知,本研究所提出的方法能够充分利用提取的脊线,结合谷线对真实C4D信号中的弱峰和重叠峰也能精准识别。实验结果证明了CWTSPSO算法检测C4D信号谱图的可靠性。

2.4 峰值检测结果和比较

为进一步评估CWTSPSO算法的峰值检测性能,与多尺度峰值检测(Multi Scale Peak Detection, MSPD)和基于CWT的图像分割(Continuous Wavelet Transform and Image Segmentation, CWT-IS)两种方法进行比较。MSPD方法是Zhang等29用Python语言开发的开源算法,是在连续小波变换的基础上,充分利用小波空间中的附加信息(包括脊、谷和过零)提出的多尺度峰检测。该方法可从https://github.com/zmzhang/libPeak获得。CWT-IS是Yang等25在MATLAB中开发的一种算法。连续小波变换结合图像分割,在图像分割中使用基于模糊数学理论的改进版Otsu方法分割峰值区域,识别特征峰。该方法可以从参考文献[25]的补充信息中下载。使用受试者工作特征(Receiver Operating Characteristic, ROC)曲线作为衡量谱峰识别算法的优劣准则。ROC的误发现率(False Discovery Rate, FDR)和正确率(True Positive Rate, TPR)可以通过公式(6)公式(7)计算。
T P R = T P / ( T P + F N ) = T P / P
F D R = F P / ( F P + T P )
式中: T P为在真值峰值误差范围内检测到的峰值数,个; F N为未被检测到的峰值数,个; P为真实峰的数量,个; F P为误检测到峰的数量,个。对于具有相同 F D R的峰值检测方法, T P R越大,方法性能越好。可以逐步调整各方法的阈值,计算出相应的 F D R T P R
在本研究中,选择仿真的3组数据集,分别含有41、61和102个高斯峰。每组数据都通过3种峰检测法重复处理。通过改变每种方法中的阈值参数,可以获得每组C4D仿真信号的 F D R值和 T P R值。CWT-IS的参数设置为20~300,MSPD的阈值从0.001逐渐增加到1,CWTSPSO的阈值从0.001逐渐增加到0.07。根据重复实验每组仿真信号的 F D R值和 T P R值的平均值 绘制每种方法的最终ROC曲线。通过3种方法处理含有41、61和102个峰的仿真数据得到的ROC曲线如图5所示,CWTSPSO的ROC曲线均保持在0.9以上,CWT-IS的 T P R在相同的 F D R下最小,CWTSPSO的 T P R在所有相同的 F D R下都远高于CWT-IS和MSPD的值。
图5 仿真C4D信号峰3种峰值检测方法(CWTSPSO, MSPD和CWT-IS)的ROC曲线

Fig. 5 ROC curves of three peak detection methods (CWTSPSO,MSPD and CWT-IS) of Simulation of C4D

为进一步评估不同方法的峰检测性能,使用 F 1度量值作为比较3种方法峰检测性能的另一个标准。 F 1是误发现率和正确率之间的综合折中,以量化算法的性能。一个更大的 F 1意味着更好的峰检测性能。 F 1定义为公式(8)
F 1 = 2 × ( 1 - F D R ) × T P R 1 - F D R + T P R
通过3种方法获得的 F 1对比结果列于表2中。显然,CWTSPSO方法获得的这3组数据集 F 1均大于MSPD和CWT-IS,CWTSPSO的 F 1度量值最高分别为0.976、0.915和0.969,MSPD和CWT-IS的 F 1度量值最高的1组分别为0.754和0.505。通过PSO优化的Otsu算法找到最佳分割阈值分割灰度图像后,即使是弱峰,峰值区域也会很明显,证明CWTSPSO可以实现具有更高正确率的峰检测,同时保持较低的误发现率。
表2 3种算法不同组数据测量值

Table 2 Measurements of different groups of data with three algorithms

方法 41 peaks 61 peaks 102 peaks

CWTSPSO

MSPD

CWT-IS

0.976

0.467

0.168

0.915

0.545

0.114

0.969

0.754

0.505

2.5 CWTSPSO在农业土壤养分离子检测的应用

本研究使用CE-C4D装置分别检测4份农田土壤中的养分离子,包括磷酸根离子、铵根离子、钾离子和硝酸根离子谱图。使用CWTSPSO算法识别谱图中的特征峰。通过图6检测结果可知,对于检测磷酸根离子、铵根离子谱图中的单峰,图6(a)中的峰1、图6(b)中的峰1、2和3均可识别;对于检测钾离子、硝酸根离子谱图中重叠峰和弱峰;图6(c)中的峰1和峰2、图6(d)中峰2和峰3的都能准确识别。综合图4(e)可知,谱图中的弱峰也能精准识别。另外,CWTSPSO算法不受基线漂移的影响,对于因电压波动和噪声产生的假峰能有效过滤,不会识别出假峰,极少出现误识别。因此,本研究所提出的CWTSPSO算法可用于非接触电导检测农业土壤养分离子谱图中的特征峰识别。
图6 农田土壤样品溶液谱图峰识别

Fig. 6 Spectral peak identification of farmland soil samples in solution

3 结 论

本研究提出了基于连续小波变化的粒子群优化结合最大类间方差法的谱峰自动识别算法用于识别C4D信号中的特征峰。首先,将C4D信号连续小波变换后,搜索局部极值,使用阶梯扫描法连接局部极值成脊线和谷线。其次,利用PSO-Otsu方法找到将CWT系数转换为灰度图像的最佳分割阈值,分割灰度图像,提取出真实的峰值区域,将真实的峰值区域结合脊线和谷线提取出真实区域内的脊线。最后,筛选出真峰所在的准确位置。与其他方法相比,本研究提出的CWTSPSO方法表现出更好的峰检测性能,对C4D信号的弱峰和重叠峰能够精准识别,有效提升了C4D信号的谱峰识别率和精准性。通过此方法,对于后续的峰面积计算来定量样品离子浓度含量能够更准确,为土壤精准施肥和农作物生长管理提供有力支持。

利益冲突声明

本研究不存在研究者以及与公开研究成果有关的利益冲突。

1
CAPPELINI L T D, DE FÁTIMA MENEGOCI EUGÊNIO P, LEÃO P A G C, et al. Capillary electrophoresis coupled to contactless conductivity detection for analysis of amino acids of agricultural interest in composting[J]. Electrophoresis, 2016, 37(19): 2449-2457.

2
SMOLKA M, PUCHBERGER-ENENGL D, BIPOUN M, et al. A mobile lab-on-a-chip device for on-site soil nutrient analysis[J]. Precision agriculture, 2017, 18(2): 152-168.

3
WANG J J, LIU Y P, HE W H, et al. A novel planar grounded capacitively coupled contactless conductivity detector for microchip electrophoresis[J]. Micromachines, 2022, 13(3): ID 394.

4
ZHANG J Q, WANG R J, JIN Z, et al. Development of on-site rapid detection device for soil macronutrients based on capillary electrophoresis and capacitively coupled contactless conductivity detection (C4D) method[J]. Chemosensors, 2022, 10(2): ID 84.

5
WANG C L, XING H Y, ZHENG B Z, et al. Simulation and experimental study on doubled-input capacitively coupled contactless conductivity detection of capillary electrophoresis[J]. Scientific reports, 2020, 10: ID 7944.

6
ZHANG S, YUAN H, XIAO D. A Study on double inputs direct contact and single output capacitively coupled conductivity detector[J]. Sensors (basel), 2022, 22(7): ID 2729.

7
SADAT A, JOYE I J. Peak fitting applied to Fourier transform infrared and Raman spectroscopic analysis of proteins[J]. Applied sciences, 2020, 10(17): ID 5918.

8
汪雪元, 何剑锋, 刘琳, 等. 小波变换导数法X射线荧光光谱自适应寻峰研究[J]. 光谱学与光谱分析, 2020, 40(12): 3930-3935.

WANG X Y, HE J F, LIU L, et al. Research on adaptive peak detection of X-ray fluorescence spectrum with wavelet transform and derivative method[J]. Spectroscopy and spectral analysis, 2020, 40(12): 3930-3935.

9
YU Y J, XIA Q L, WANG S, et al. Chemometric strategy for automatic chromatographic peak detection and background drift correction in chromatographic data[J]. Journal of chromatography A, 2014, 1359: 262-270.

10
ZHENG Y, TIAN D, LIU K, et al. Peak detection of TOF-SIMS using continuous wavelet transform and curve fitting[J]. Internationaljournal of mass spectrometry, 2018, 428: 43-48.

11
MESSER M, BACKHAUS H, FU T, et al. A multi-scale approach for testing and detecting peaks in time series[J]. Statistics, 2020, 54(5): 1058-1080.

12
JIA M Z, WU M, LI Y J, et al. Quantitative method for liquid chromatography–mass spectrometry based on multi-sliding window and noise estimation[J]. Processes, 2022, 10(6): ID 1098.

13
HAO Z H, ZHANG X M, LAI Z X. Adaptive R-peak detection algorithm based on brown exponential smoothing model[J]. IEEE access, 2022, 10: 114355-114363.

14
ZHANG W F, ZHANG M, WANG X Y, et al. The analysis of FBG central wavelength variation with crack propagation based on a self-adaptive multi-peak detection algorithm[J]. Sensors, 2019, 19(5): ID 1056.

15
DU P, KIBBE W A, LIN S M. Improved peak detection in mass spectrum by incorporating continuous wavelet transform-based pattern matching[J]. Bioinformatics, 2006, 22(17): 2059-2065.

16
LIU M H, DONG Z R, XIN G F, et al. An improved method based on a new wavelet transform for overlapped peak detection on spectrum obtained by portable Raman system[J]. Chemometrics and intelligent laboratory systems, 2018, 182: 1-8.

17
ZHENG Y, FAN R L, QIU C L, et al. An improved algorithm for peak detection in mass spectra based on continuous wavelet transform[J]. International journal of mass spectrometry, 2016, 409: 53-58.

18
ZHOU J F, LI J H, GAO W Q, et al. Combination of continuous wavelet transform and genetic algorithm-based Otsu for efficient mass spectrometry peak detection[J]. Biochemical and biophysical research communications, 2022, 624: 75-80.

19
ZHAI C, YONGYU L, PENG Y K, et al. Detection of chlorpyrifos in apples using gold nanoparticles based on surface enhanced Raman spectroscopy[J]. International journal of agricultural and biological engineering, 2015, 8(5): 113-120.

20
HONG Y S, SHEN R L, CHENG H, et al. Estimating lead and zinc concentrations in peri-urban agricultural soils through reflectance spectroscopy: Effects of fractional-order derivative and random forest[J]. Science of the total environment, 2019, 651: 1969-1982.

21
李传文, 魏圆圆, 陈翔宇, 等. 基于非接触式电导信号的土壤速效钾含量检测方法[J]. 分析测试学报, 2020, 39(7): 851-859.

LI C W, WEI Y Y, CHEN X Y, et al. A detection method for soil available potassium content based on capacitively coupled contactless conductivity signal[J]. Journal of instrumental analysis, 2020, 39(7): 851-859.

22
ZHOU Y J, MA J, LI F, et al. An improved algorithm for peak detection based on weighted continuous wavelet transform[J]. IEEE access, 2022, 10: 118779-118788.

23
WAHAB M F, O'HAVER T C. Wavelet transforms in separation science for denoising and peak overlap detection[J]. Journal of separation science, 2020, 43(9/10): 1998-2010.

24
DENG F L, LI H, WANG R X, et al. An improved peak detection algorithm in mass spectra combining wavelet transform and image segmentation[J]. International journal of mass spectrometry, 2021, 465: ID 116601.

25
YANG G F, DAI J C, LIU X J, et al. Spectral feature extraction based on continuous wavelet transform and image segmentation for peak detection[J]. Analytical methods, 2020, 12(2): 169-178.

26
MERZBAN M H, ELBAYOUMI M. Efficient solution of Otsu multilevel image thresholding: A comparative study[J]. Expert systems with applications, 2019, 116: 299-309.

27
ZHENG J F, GAO Y C, ZHANG H, et al. OTSU multi-threshold image segmentation based on improved particle swarm algorithm[J]. Applied sciences, 2022, 12(22): ID 11514.

28
WEI Y Y, WANG R J, ZHANG J Q, et al. Partition management of soil nutrients based on capacitive coupled contactless conductivity detection[J]. Agriculture, 2023, 13(2): ID 313.

29
ZHANG Z M, TONG X, PENG Y, et al. Multiscale peak detection in wavelet space[J]. The analyst, 2015, 140(23): 7955-7964.

文章导航

/