Soil detection, analysis and determination method and system for heavy metal detection
By collecting and correcting hyperspectral data, combining conductivity data, and using multi-layer perceptrons and convolutional neural network models to determine the deep heavy metal content in soil, the problem of large-area real-time measurement in the existing technology is solved, and high-precision deep heavy metal detection in soil is achieved.
Patent Information
- Application Number
- CN202510662906.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-07-08
AI Technical Summary
The prior art is difficult to achieve large-area, real-time and high-precision deep-heavy metal content measurement in soil, especially affected by factors such as soil surface spectral reflectivity and vegetation coverage, and the detection process is cumbersome and time-consuming.
By collecting hyperspectral data, conductivity data, soil moisture content and vegetation coverage coefficients, the interference factor is calculated for correction, the characteristic band is extracted and the conductivity data is combined, the deep heavy metal content in the soil is measured using the first and second measurement models, and the measurement results are optimized through the error control strategy.
Real-time, large-area soil deep heavy metal content measurement is achieved, the measurement accuracy is improved, the influence of soil surface interference factors is overcome, and the needs of real-time measurement are met.
Smart Images

Figure CN120275337A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of heavy metal detection, and more specifically, it relates to a soil detection and analysis method and system for heavy metal detection. Background Art
[0002] With the impacts of industrial pollutant emissions, mining, chemical fertilizer and pesticide spraying, and waste accumulation, the problem of soil heavy metal pollution has become increasingly serious. Heavy metal elements such as lead (Pb), cadmium (Cd), arsenic (As), copper (Cu), zinc (Zn), chromium (Cr), etc. are difficult to degrade in the soil, and after long-term accumulation, they will pose potential threats to the ecosystem and human health through plant absorption, groundwater penetration, and other channels. Currently, soil heavy metal detection mainly relies on laboratory chemical analysis methods, such as atomic absorption spectrometry (AAS), inductively coupled plasma mass spectrometry (ICP-MS), X-ray fluorescence spectrometry (XRF), etc. Their detection processes are cumbersome and time-consuming. Soil samples need to be first dried, wet acid digested, filtered and diluted, etc., and then measured by relevant instruments, which is difficult to meet the needs of real-time measurement. Moreover, the sampling points are sparse and the spatial resolution is low, making it difficult to achieve large-area soil heavy metal determination.
[0003] With the development of remote sensing mapping technology, currently, a hyperspectral camera is carried by an unmanned aerial vehicle to collect spectral reflectance information of the soil in multiple bands, and the characteristic bands highly correlated with heavy metal elements are screened out through the Pearson correlation coefficient. Then, through a non-linear regression model, the mapping relationship between the characteristic bands and the measured values of heavy metal contents is fitted, so as to achieve large-area determination of soil heavy metal contents. However, hyperspectral data usually can only reflect the spectral reflectance of the soil surface layer, it is difficult to reflect the heavy metal pollution situation in the deep soil layer, and it is easily interfered by factors such as soil moisture and vegetation coverage, resulting in difficulty in achieving large-area determination of heavy metal contents in the deep soil layer. Summary of the Invention
[0004] The present invention provides a soil detection and analysis method and system for heavy metal detection to solve the technical problems in the above background art.
[0005] The present invention provides a soil detection and analysis method for heavy metal detection, including the following steps: Step S101, collecting hyperspectral data, conductivity data, soil moisture content, vegetation coverage coefficient, and measured values of deep soil heavy metal contents in the area to be measured; The hyperspectral data is represented by spectral reflectances corresponding to A wavelengths; The conductivity data is represented by the conductivity value at a soil depth of 50 cm; Step S102: Calculate the interference factor based on the soil moisture content and the vegetation coverage coefficient, and correct the hyperspectral data according to the interference factor to obtain the standby hyperspectral data; The standby hyperspectral data is represented by the spectral reflectance after correction corresponding to A wavelengths; Step S103: Extract the characteristic bands from the standby hyperspectral data, and splice them with the conductivity data to obtain the eigenvector; The dimension number of the eigenvector is C = B + 1, where B represents the number of the spectral reflectance after normalization corresponding to the characteristic bands; Step S104: Use the eigenvector and the measured value of the deep soil heavy metal content as the sample data and sample label of the training samples for training the first determination model and the second determination model respectively; Step S105: Obtain the first determination value and the second determination value through the trained first determination model and the second determination model respectively, and obtain the determination value of the deep soil heavy metal content in the area to be determined through the error control strategy.
[0006] Furthermore, both the number A of the spectral reflectance of the hyperspectral data and the number B of the spectral reflectance of the standby hyperspectral data are user-defined parameters.
[0007] Furthermore, the interference factor The calculation formula includes: ; ; ; Where represents the moisture interference factor, represents the moisture interference weight coefficient, represents the moisture influence coefficient, SM represents the soil moisture content, represents the minimum value of the soil moisture content, represents the vegetation interference factor, represents the vegetation interference weight coefficient, represents the vegetation influence coefficient, VC represents the vegetation coverage coefficient, represents the minimum value of the vegetation coverage coefficient, and are both user-defined parameters and the sum value is 1, is a user-defined parameter with a value range between 0.01 and 0.1, is a user-defined parameter with a value range between 0.05 and 0.2. The calculation formula for correcting the hyperspectral data according to the interference factor is as follows: , and represent the spectral reflectance after correction and before correction respectively.
[0008] Further, extracting the characteristic bands from the backup hyperspectral data includes the following steps: Step S201, calculating the Pearson correlation coefficient of the spectral reflectance corresponding to A wavelengths in the backup hyperspectral data after correction; Step S202, screening out the spectral reflectance corresponding to D wavelengths with the Pearson correlation coefficient greater than or equal to the preset threshold; If the number of wavelengths is less than D, then reduce the preset threshold until the number of wavelengths is D; If the number of wavelengths exceeds D, then sort the Pearson correlation coefficients in descending order to obtain the spectral reflectance corresponding to the first D wavelengths; Wherein both the preset threshold and D are user-defined parameters, and D is a positive even number greater than or equal to B; Step S203, dividing the spectral reflectance corresponding to D wavelengths into B equal parts, and performing normalization processing on the B equal parts by the Z-Score method to obtain the characteristic bands.
[0009] Further, the first determination model includes: a vector conversion layer, a first convolutional layer, a second convolutional layer, a feature fusion layer, a feature expansion layer, and a classifier; The calculation formula of the vector conversion layer is as follows: ; Where Matrix represents the feature matrix output by the vector conversion layer, Vector represents the feature vector input to the first determination model, the size of the feature matrix is C×C, W represents the weight vector, then the number of dimensions of W is C, and T represents the transpose operation; The first convolutional layer inputs the feature matrix and outputs the first feature map, the size of the first feature map is E×E, where E = (C - pool) / step + 1, pool represents the size of the pooling window, and step represents the step size of the pooling window; The second convolutional layer inputs the feature matrix and outputs the second feature map, and the size of the second feature map is the same as the size of the first feature map; The calculation formula of the feature fusion layer includes: ; ; ; Where represents the fused feature map output by the feature fusion layer, and the size of the fused feature map is the same as the size of the first feature map, represents the first feature map, represents the first weight parameter, represents the second feature map, represents the second weight parameter, and MLP represents the multi-layer perceptron; The feature expansion layer is used to expand the fused feature map output by the feature fusion layer into a vector representation and output it to the classifier, and the classifier outputs a first measurement value.
[0010] Further, the first convolutional layer consists of 3 convolutional kernels with different scales and 1 pooling layer; the sizes of the 3 convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the stride of each is 1, and the padding method is SAME; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2; The second convolutional layer consists of 3 dilated convolutional kernels with different sizes and 1 pooling layer; the sizes of the 3 dilated convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the dilation rates are 2, 4, and 6 respectively, and the padding method is SAME; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2.
[0011] Further, the calculation formula of the second measurement model is as follows: ; where represents the second measurement value output by the second measurement model, represents the b-th normalized spectral reflectance corresponding to the feature band, represents the corresponding weight coefficient, Elec represents the conductivity data in the feature vector, represents the weight coefficient corresponding to Elec.
[0012] Further, define the mean square error between the second measurement value and the measured value of the heavy metal content in the deep soil as the loss function, and minimize this loss function by the least squares method to obtain the weight coefficients in the second measurement model.
[0013] Further, the measured value of the heavy metal content in the deep soil of the area to be measured is obtained through an error control strategy, including the following steps: Step S301, calculate the difference between the first measurement value and the second measurement value, and initialize the measurement times to 1; Step S302, if the difference is greater than or equal to the first threshold, return to step S105, and the measurement times are incremented by 1. If the measurement times exceed the maximum measurement times, take the minimum value of the first measurement value and the second measurement value obtained in the last measurement as the measured value of the heavy metal content in the deep soil; where the maximum measurement times is a user-defined parameter; Step S303, if the difference is greater than or equal to the second threshold and less than the first threshold, perform a weighted sum of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil; The weight coefficients corresponding to the first measurement value and the second measurement value are 0.6 and 0.4 respectively; In step S304, if it is determined that the difference is less than the second threshold, directly take the maximum value of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil; The first threshold, the second threshold, and the third threshold are all user-defined parameters.
[0014] The present invention provides a soil detection and analysis measurement system for heavy metal detection, including: A data acquisition module, which is used to acquire hyperspectral data, conductivity data, soil moisture content, vegetation coverage coefficient, and measured values of heavy metal content in the deep soil of the area to be measured; A data correction module, which is used to calculate the interference factor according to the soil moisture content and the vegetation coverage coefficient, and correct the hyperspectral data according to the interference factor to obtain the standby hyperspectral data; A feature extraction module, which is used to extract the characteristic bands in the standby hyperspectral data, and splice them with the conductivity data to obtain a feature vector; A model training module, which is used to use the feature vector and the measured value of the heavy metal content in the deep soil as the sample data and sample labels of the training samples for training the first measurement model and the second measurement model respectively; A heavy metal content measurement module, which is used to obtain the first measurement value and the second measurement value through the trained first measurement model and the second measurement model respectively, and obtain the measured value of the heavy metal content in the deep soil of the area to be measured through an error control strategy.
[0015] The beneficial effects of the present invention are as follows: The present invention first corrects the hyperspectral data according to the soil moisture content and the vegetation coverage coefficient, then combines the conductivity data and the corrected hyperspectral data to measure the heavy metal content in the deep soil through the first measurement model and the second measurement model respectively, and uses the error control strategy for optimization, so as to improve the measurement accuracy and realize the measurement of the heavy metal content in the deep soil in real time and on a large scale. Description of the Drawings
[0016] Figure 1 is a flowchart of a soil detection and analysis measurement method for heavy metal detection according to the present invention; Figure 2 is a flowchart of extracting the characteristic bands in the standby hyperspectral data according to the present invention; Figure 3 is a flowchart of the error control strategy according to the present invention; Figure 4 is a schematic diagram of a soil detection and analysis measurement system for heavy metal detection according to the present invention.
[0017] In the figure: data acquisition module 401, data correction module 402, feature extraction module 403, model training module 404, heavy metal content determination module 405. DETAILED DESCRIPTION
[0018] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the contents of this specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.
[0019] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] like Figures 1 to 4 As shown, a soil detection and analysis method for heavy metal detection includes the following steps: Step S101, collecting hyperspectral data, conductivity data, soil moisture content, vegetation coverage factor and measured values of heavy metal content in deep soil of the area to be measured; Hyperspectral data is represented by the spectral reflectance corresponding to A wavelengths; The conductivity data are expressed by the conductivity value at a soil depth of 50 cm; Step S102, calculating an interference factor according to soil moisture content and vegetation coverage coefficient, and correcting the hyperspectral data according to the interference factor to obtain standby hyperspectral data; The spare hyperspectral data is represented by the corrected spectral reflectance corresponding to A wavelengths; Step S103, extracting characteristic bands from the standby hyperspectral data, and concatenating them with the conductivity data to obtain a characteristic vector; The dimensionality of the eigenvector is C = B + 1, where B represents the number of normalized spectral reflectances corresponding to the characteristic bands; Step S104: Use the eigenvector and the measured values of the deep soil heavy metal content as the sample data and sample labels for training the first determination model and the second determination model, respectively; Step S105: Obtain the first determination value and the second determination value through the trained first determination model and the second determination model, respectively, and obtain the determination value of the deep soil heavy metal content in the area to be measured through an error control strategy.
[0021] It should be noted that the hyperspectral data, conductivity data, soil moisture content, and vegetation coverage coefficient of the area to be measured are collected by a drone equipped with a hyperspectral camera, an electromagnetic induction sensor, a thermal imaging camera, and a multispectral camera. The calculation formula for the vegetation coverage coefficient NDVI is as follows: NDVI = (NIR - Red) / (NIR + Red), where NIR represents the reflectance in the near-infrared band (wavelength from 750 nm to 900 nm), and Red represents the reflectance in the red band (wavelength from 600 nm to 700 nm). Specifically, NIR takes the peak reflectance in the near-infrared band (for example, 850 nm), and similarly, Red takes the peak reflectance in the red band (for example, 665 nm). In addition, the vegetation coverage coefficient can also be expressed by the EVI enhanced vegetation index, which will not be elaborated here.
[0022] It should be noted that hyperspectral data usually can only reflect the heavy metal pollution situation within a soil depth of 5 cm. By emitting an alternating electromagnetic field underground through an electromagnetic induction sensor, the conductivity of the soil at a depth of about 1 m can be measured. The soil conductivity is affected by various factors, such as moisture, salt, minerals, etc. However, heavy metal pollution will significantly affect the soil conductivity. Heavy metals usually exist in the form of soluble ions or complexes, increasing the ion concentration in the soil and enhancing the charge conduction ability, resulting in an increase in conductivity. Therefore, in the present invention, the determination of the deep soil heavy metal content is achieved by combining hyperspectral data with conductivity data. In addition, the area to be measured can be divided into multiple sub-areas, and then the deep soil heavy metal content of each sub-area is determined in parallel, so as to achieve large-area determination.
[0023] It should be noted that the measured values of the deep soil heavy metal content in the area to be measured in the present invention refer to individual heavy metal elements, including heavy metal elements such as lead (Pb), cadmium (Cd), arsenic (As), copper (Cu), zinc (Zn), chromium (Cr), etc., that is, one heavy metal element corresponds to one first determination model and one second determination model.
[0024] In one embodiment of the present invention, the number A of spectral reflectances of hyperspectral data and the spectral reflectance B of the spare hyperspectral data are both custom parameters. Preferably, A is set to 2000 and B is set to 20, then the dimension number C of the eigenvector is 21.
[0025] It should be noted that the wavelengths of heavy metal elements in the hyperspectral data are mainly concentrated between 400 nm and 2400 nm. Therefore, A is set to 2000. In order to reduce the computational complexity of the first determination model and the second determination model, the data dimension can be reduced by extracting the characteristic bands.
[0026] In one embodiment of the present invention, the interference factor The calculation formula includes: ; ; ; where represents the moisture interference factor, represents the moisture interference weight coefficient, represents the moisture influence coefficient, SM represents the soil moisture content, represents the minimum value of the soil moisture content, represents the vegetation interference factor, represents the vegetation interference weight coefficient, represents the vegetation influence coefficient, VC represents the vegetation cover coefficient, represents the minimum value of the vegetation cover coefficient, and are both custom parameters and the sum value is 1. Preferably, and are respectively set to 0.4 and 0.6, is a custom parameter with a value range between 0.01 and 0.1. Preferably, is set to 0.05, is a custom parameter with a value range between 0.05 and 0.2. Preferably, is set to 0.1. The calculation formula for correcting the hyperspectral data according to the interference factor is as follows: , and respectively represent the spectral reflectance after and before correction.
[0027] In one embodiment of the present invention, as Figure 2 shown, extracting the characteristic bands from the spare hyperspectral data includes the following steps: Step S201, calculating the Pearson correlation coefficient of the corrected spectral reflectances corresponding to A wavelengths in the spare hyperspectral data; Step S202: Screen out the spectral reflectances corresponding to D wavelengths whose Pearson correlation coefficients are greater than or equal to a preset threshold; If the number of wavelengths is less than D, reduce the preset threshold until the number of wavelengths is D; If the number of wavelengths exceeds D, sort the Pearson correlation coefficients in descending order to obtain the spectral reflectances corresponding to the first D wavelengths; Wherein the preset threshold and D are both user-defined parameters, and D is a positive even number greater than or equal to B. Preferably, the preset threshold is set to 0.5 and D is set to 100; Step S203: Divide the spectral reflectances corresponding to D wavelengths into B equal parts, and perform normalization processing on the B equal parts by the Z-Score method to obtain characteristic bands.
[0028] In an embodiment of the present invention, the first determination model includes: a vector conversion layer, a first convolutional layer, a second convolutional layer, a feature fusion layer, a feature expansion layer, and a classifier; The calculation formula of the vector conversion layer is as follows: ; Where Matrix represents the feature matrix output by the vector conversion layer, Vector represents the feature vector input to the first determination model, the size of the feature matrix is C×C, W represents the weight vector, then the number of dimensions of W is C, and T represents the transpose operation; The first convolutional layer inputs the feature matrix and outputs a first feature map, the size of the first feature map is E×E, where E = (C - pool) / step + 1, pool represents the size of the pooling window, and step represents the step of the pooling window; The second convolutional layer inputs the feature matrix and outputs a second feature map, the size of the second feature map is the same as that of the first feature map; The calculation formula of the feature fusion layer includes: ; ; ; Where represents the fused feature map output by the feature fusion layer, the size of the fused feature map is the same as that of the first feature map, represents the first feature map, represents the first weight parameter, represents the second feature map, represents the second weight parameter, and MLP represents a multi-layer perceptron; The feature expansion layer is used to expand the fused feature map output by the feature fusion layer into a vector representation and output it to the classifier, and the classifier outputs a first determination value.
[0029] In one embodiment of the present invention, the first convolutional layer consists of 3 convolutional kernels with different scales and 1 pooling layer; the sizes of the 3 convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the stride of each is 1, and the padding method is SAME for all; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2; The second convolutional layer consists of 3 dilated convolutional kernels with different sizes and 1 pooling layer; the sizes of the 3 dilated convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the dilation rates are 2, 4, and 6 respectively, and the padding method is SAME for all; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2.
[0030] It should be noted that the first determination model can better extract features through multi-scale convolutional kernels, and an MLP is added to calculate the weights of the first feature map and the second feature map in the fused feature map. The activation function of the classifier is softmax, which maps the vector representation of the fused feature map to the specific soil deep heavy metal content.
[0031] It should be noted that assuming the number of dimensions C of the feature vector is 21, the sizes of the first feature map, the second feature map, and the fused feature map are 10×10, that is, (21 - 3) / 2 + 1 = 10, and the parameters in the convolutional kernel, dilated convolutional kernel, pooling layer, multi-layer perceptron, and classifier in the first determination model are all learnable hyperparameters. These parameters are updated backward through the chain rule combined with the gradient descent algorithm to minimize the loss. The training of the neural network model is a conventional technical means and will not be elaborated here.
[0032] In one embodiment of the present invention, the calculation formula of the second determination model is as follows: ; where represents the second determination value output by the second determination model, represents the b-th normalized spectral reflectance corresponding to the characteristic band, represents the corresponding weight coefficient, Elec represents the conductivity data in the feature vector, represents the weight coefficient corresponding to Elec.
[0033] In one embodiment of the present invention, the mean square error between the second determination value and the measured value of the soil deep heavy metal content is defined as the loss function, and the least squares method is used to minimize this loss function to obtain the weight coefficients in the second determination model.
[0034] In one embodiment of the present invention, as Figure 3 shown, the measured value of the soil deep heavy metal content in the area to be measured is obtained through an error control strategy, including the following steps: Step S301, calculate the difference between the first measurement value and the second measurement value, and initialize the measurement times to 1; Step S302, determine if the difference is greater than or equal to the first threshold. If so, return to step S105 and increment the measurement times by 1. If the measurement times exceed the maximum measurement times, take the minimum value of the first measurement value and the second measurement value obtained in the last measurement as the measured value of the heavy metal content in the deep soil layer; Where the maximum measurement times is a user-defined parameter. Preferably, the maximum measurement times is 3; Step S303, determine if the difference is greater than or equal to the second threshold and less than the first threshold. If so, perform a weighted sum of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil layer; The weight coefficients corresponding to the first measurement value and the second measurement value are 0.6 and 0.4 respectively; Step S304, determine if the difference is less than the second threshold. If so, directly take the maximum value of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil layer; The first threshold, the second threshold, and the third threshold are all user-defined parameters. Preferably, the first threshold, the second threshold, and the third threshold are set to 30%, 10%, and 5% of the maximum value of the measured values of the heavy metal content in the deep soil layer in history respectively.
[0035] It should be noted that if the difference between the first measurement value and the second measurement value is greater than or equal to the first threshold, it indicates that there may be errors in the measurement results, and it is necessary to re-measure and re-judge through the first measurement model and the second measurement model to reduce the errors.
[0036] In an embodiment of the present invention, as Figure 4 shown, a soil detection and analysis measurement system for heavy metal detection includes: A data acquisition module 401, which is used to acquire hyperspectral data, conductivity data, soil moisture content, vegetation coverage coefficient, and measured value of the heavy metal content in the deep soil layer of the area to be measured; A data correction module 402, which is used to calculate the interference factor according to the soil moisture content and the vegetation coverage coefficient, and correct the hyperspectral data according to the interference factor to obtain the standby hyperspectral data; A feature extraction module 403, which is used to extract the characteristic bands from the standby hyperspectral data and splice them with the conductivity data to obtain a feature vector; A model training module 404, which is used to use the feature vector and the measured value of the heavy metal content in the deep soil layer as the sample data and sample labels of the training samples for training the first measurement model and the second measurement model respectively; The heavy metal content determination module 405 is used to obtain a first determination value and a second determination value through the first determination model and the second determination model after training is completed, and obtain the soil deep heavy metal content determination value of the area to be determined through an error control strategy.
[0037] The above describes the embodiments of this embodiment, but this embodiment is not limited to the above specific implementation manners. The above specific implementation manners are only illustrative rather than restrictive. Under the inspiration of this embodiment, those of ordinary skill in the art can also make many forms, all of which fall within the protection scope of this embodiment.
Claims
1. A soil detection and analysis method for heavy metal detection, characterized in that, It includes the following steps: Step S101, collect the hyperspectral data, conductivity data, soil moisture content, vegetation coverage coefficient, and measured values of deep soil heavy metal content in the area to be measured; The hyperspectral data is represented by the spectral reflectance corresponding to A wavelengths; The conductivity data is represented by the conductivity value at a soil depth of 50 cm; Step S102, calculate the interference factor based on the soil moisture content and vegetation coverage coefficient, and correct the hyperspectral data according to the interference factor to obtain the standby hyperspectral data; The standby hyperspectral data is represented by the corrected spectral reflectance corresponding to A wavelengths; Step S103, extract the characteristic bands from the standby hyperspectral data, and splice them with the conductivity data to obtain the feature vector; The dimension number of the feature vector is C = B + 1, where B represents the number of normalized spectral reflectances corresponding to the characteristic bands; Step S104, use the feature vector and the measured value of the deep soil heavy metal content as the sample data and sample labels of the training samples for training the first determination model and the second determination model respectively; Step S105, obtain the first determination value and the second determination value through the trained first determination model and the second determination model respectively, and obtain the measured value of the deep soil heavy metal content in the area to be measured through the error control strategy.
2. The soil detection and analysis method for heavy metal detection according to claim 1, wherein, The number of spectral reflectances A of the hyperspectral data and the number of spectral reflectances B of the standby hyperspectral data are both user-defined parameters.
3. A soil detection and analysis method for heavy metal detection according to claim 1, characterized in that, Interference factor The calculation formula includes: ; ; ; Among them represents the moisture interference factor represents the moisture interference weight coefficient represents the moisture influence coefficient, where SM represents the soil moisture content represents the minimum value of the soil moisture content represents the vegetation interference factor represents the vegetation interference weight coefficient represents the vegetation influence coefficient, where VC represents the vegetation coverage coefficient represents the minimum value of the vegetation coverage coefficient and are both user-defined parameters and their total value is 1 is a user-defined parameter with a value range between 0.01 and 0.1 is a user-defined parameter with a value range between 0.05 and 0.
2. The calculation formula for correcting hyperspectral data according to the interference factor is as follows , and represent the spectral reflectance after and before correction, respectively 4. A soil detection and analysis method for heavy metal detection according to claim 1, characterized in that, Extracting the characteristic bands from the standby hyperspectral data includes the following steps: Step S201, calculate the Pearson correlation coefficient of the corrected spectral reflectances corresponding to A wavelengths in the standby hyperspectral data; Step S202, screen out the spectral reflectances corresponding to D wavelengths with Pearson correlation coefficients greater than or equal to the preset threshold; If the number of wavelengths is less than D, reduce the preset threshold until the number of wavelengths is D; If the number of wavelengths exceeds D, sort the Pearson correlation coefficients in descending order to obtain the spectral reflectances corresponding to the first D wavelengths; Where the preset threshold and D are both user-defined parameters, and D is a positive even number greater than or equal to B; Step S203, divide the spectral reflectances corresponding to D wavelengths into B equal parts, and normalize the B equal parts through the Z-Score method to obtain the characteristic bands.
5. A soil detection and analysis method for heavy metal detection according to claim 1, characterized in that, The first determination model includes: a vector conversion layer, a first convolutional layer, a second convolutional layer, a feature fusion layer, a feature expansion layer, and a classifier; The calculation formula of the vector conversion layer is as follows: ; Where Matrix represents the feature matrix output by the vector conversion layer, Vector represents the feature vector input to the first determination model, the size of the feature matrix is C×C, W represents the weight vector, then the dimension number of W is C, and T represents the transpose operation; The first convolutional layer inputs the feature matrix and outputs the first feature map, the size of the first feature map is E×E, where E = (C - pool) / step + 1, pool represents the size of the pooling window, and step represents the step size of the pooling window; The second convolutional layer inputs the feature matrix and outputs the second feature map, and the size of the second feature map is the same as that of the first feature map; The calculation formula of the feature fusion layer includes: ; ; ; wherein represents the fused feature map output by the feature fusion layer, and the size of the fused feature map is the same as that of the first feature map, represents the first feature map, represents the first weight parameter, represents the second feature map, represents the second weight parameter, and MLP represents a multi-layer perceptron; The feature expansion layer is used to expand the fused feature map output by the feature fusion layer into a vector representation and output it to the classifier, and the classifier outputs a first measurement value.
6. The soil detection and analysis method for heavy metal detection according to claim 5, wherein The first convolutional layer consists of 3 convolutional kernels with different scales and 1 pooling layer; the sizes of the 3 convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the stride of each is 1, and the padding method is SAME; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2; The second convolutional layer consists of 3 dilated convolutional kernels with different sizes and 1 pooling layer; the sizes of the 3 dilated convolutional kernels with different scales are 3×3, 5×5, and 7×7 respectively, and the dilation rates are 2, 4, and 6 respectively, and the padding method is SAME; the size of the pooling window corresponding to the pooling layer is 3×3, and the stride is 2.
7. The soil detection and analysis method for heavy metal detection according to claim 1, wherein, The calculation formula of the second measurement model is as follows: ; wherein represents the second measurement value output by the second measurement model, represents the b-th normalized spectral reflectance corresponding to the characteristic band, represents the corresponding weight coefficient, Elec represents the conductivity data in the eigenvector, represents the weight coefficient corresponding to Elec.
8. A soil detection and analysis method for heavy metal detection according to claim 7, characterized in that, Define the mean square error between the second measurement value and the measured value of the heavy metal content in the deep soil as the loss function, and minimize this loss function by the least squares method to obtain the weight coefficients in the second measurement model.
9. The soil detection and analysis method for heavy metal detection according to claim 1, characterized in that, Obtain the measured value of the heavy metal content in the deep soil of the area to be measured through an error control strategy, including the following steps: Step S301, calculate the difference between the first measurement value and the second measurement value, and initialize the measurement times to 1; Step S302, determine whether the difference is greater than or equal to the first threshold. If so, return to step S105, and the measurement times are incremented by 1. If the measurement times exceed the maximum measurement times, take the minimum value of the first measurement value and the second measurement value obtained in the last measurement as the measured value of the heavy metal content in the deep soil; Where the maximum measurement times is a user-defined parameter; Step S303, determine that the difference is greater than or equal to the second threshold and less than the first threshold, then perform a weighted sum of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil; The weight coefficients corresponding to the first measurement value and the second measurement value are 0.6 and 0.4 respectively; Step S304, determine that the difference is less than the second threshold, then directly take the maximum value of the first measurement value and the second measurement value as the measured value of the heavy metal content in the deep soil; The first threshold, the second threshold, and the third threshold are all user-defined parameters.
10. A soil detection and analysis determination system for heavy metal detection, characterized in that, Implement a soil detection and analysis measurement method for heavy metal detection as described in any one of claims 1 to 9, including: A data acquisition module, which is used to acquire hyperspectral data, conductivity data, soil moisture content, vegetation coverage coefficient, and measured value of heavy metal content in the deep soil of the area to be measured; A data correction module, which is used to calculate the interference factor according to the soil moisture content and the vegetation coverage coefficient, and correct the hyperspectral data according to the interference factor to obtain the standby hyperspectral data; A feature extraction module, which is used to extract the feature bands in the standby hyperspectral data and splice them with the conductivity data to obtain a feature vector; A model training module, which is used to use the feature vector and the measured value of the heavy metal content in the deep soil as the sample data and sample labels of the training samples for training the first measurement model and the second measurement model respectively; Heavy metal content measurement module, which is used to obtain a first measurement value and a second measurement value through the first measurement model and the second measurement model after training respectively, and obtain the measurement value of the heavy metal content in the deep soil of the area to be measured through an error control strategy.
Citation Information
Cited By
Method and system for detecting moisture ratio of date palm
CN121113933A
A method and system for detecting the moisture content of dates
CN121113933B