Rapid soil pollution detection method, equipment and system

By collecting various physical characteristic data of soil samples and processing spectral data in combination with neural network models, the problem of overfitting traditional models in soil pollution detection is solved, and the accuracy and reliability of detection is improved.

CN120121652AActive Publication Date: 2025-06-10陕西恒信检测有限公司

Patent Information

Application Number
CN202510616480.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-06-10
Estimated Expiration
2045-05-14

AI Technical Summary

Technical Problem

Traditional deep learning models directly process the original spectral data in soil pollution detection, without considering the coupling relationship between spectral and soil factors, resulting in reduced overfitting and detection accuracy.

Method used

By collecting various physical characteristic data of soil samples, such as particle size, structural factors and equivalent porosity, the spectral data are processed in combination with neural network models, the spectral processing is adaptively adjusted, and the spectral compensation coefficient is obtained to correct the spectral intensity.

Benefits of technology

It improves the accuracy and reliability of soil pollution detection, identify and eliminate spectral measurement errors caused by soil agglomeration and particle size differences, and achieves accurate determination of heavy metal concentration in soil.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120121652A_ABST
    Figure CN120121652A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of soil pollution detection, in particular to a rapid soil pollution detection method, equipment and system.The method comprises the steps that the difference between each wavelength in a spectrogram of to-be-detected heavy metal in each sample and the preset characteristic wavelength of the to-be-detected heavy metal is compared; determining the weight of each wavelength according to the soil structure factor and the equivalent porosity and the difference between each wavelength and a preset wavelength, and determining an enhanced spectrogram according to the spectrogram of the to-be-detected heavy metal in each sample and a reference spectrum so as to obtain a spectrum compensation coefficient; and determining the concentration of the to-be-detected heavy metal in each sample based on the enhanced spectrogram and the spectrum compensation coefficient of the to-be-detected heavy metal in each sample in combination with the reference spectrum and the concentration. The problem that the spectrum compensation effect is poor is solved, and the accuracy of soil pollution detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of soil pollution detection, and particularly to a rapid soil pollution detection method, device, and system. Background Art

[0002] Through soil detection, the content and distribution of harmful substances such as heavy metals, organic pollutants, and pesticide residues in the soil can be accurately grasped, providing a strong basis for scientifically formulating soil pollution prevention and control and remediation plans. This can not only ensure the quality and safety of agricultural products, prevent harmful substances from entering the human body through the food chain and damaging human health, but also protect the ecological environment, prevent soil pollution from spreading to other environmental media such as water bodies and the atmosphere, and cause more serious environmental problems.

[0003] In summary, when using a portable X-ray fluorescence spectrometer (XPF) for rapid soil pollution detection, machine learning technology can be used to compensate for errors caused by soil factors. However, traditional deep learning models usually directly process the original spectra without considering the coupling relationship between the spectra and soil factors, resulting in easy overfitting, only being able to learn the surface features of the data, poor spectral compensation effect, and reducing the accuracy of soil pollution detection. Summary of the Invention

[0004] In a first aspect, an embodiment of this application provides a rapid soil pollution detection method, which includes the following steps: Collect multiple soil samples in the soil to be detected, denoted as samples, and obtain the moisture content, temperature, humidity, particle size, spectral diagrams of heavy metals to be detected in each sample, dry soil porosity, equivalent circular diameter of each particle in each sample, spectral diagrams and concentrations of heavy metals to be detected in the standard soil samples of each sample. Denote the spectral diagram of the heavy metal to be detected in the standard soil sample as the reference spectrum; Compare the difference between the particle size of each sample and the preset standard particle size to determine the particle size-related value of each sample, and combine the difference between the square equivalent circular diameter and the equivalent circular diameter of all particles in each sample to determine the soil structure factor of each sample; measure the difference between the moisture content of each sample and the preset standard moisture content, and combine the dry soil porosity to determine the equivalent porosity of each sample; By comparing the difference between each wavelength in the spectral diagram of the heavy metal to be detected in each sample and the preset characteristic wavelength of the heavy metal to be detected, as well as the difference between each wavelength and the preset wavelength, and combining the soil structure factor and the equivalent porosity, determine the weight of each wavelength in the spectral diagram of the heavy metal to be detected in each sample; Multiply the spectral intensity, weight at each wavelength in the spectral map of the heavy metal to be measured in each sample, and the spectral intensity at the corresponding wavelength in the reference spectrum, and use the product as the enhanced spectral intensity at each wavelength in the spectral map of the heavy metal to be measured in each sample; replace the preset characteristic wavelength of the spectral intensity at each wavelength in the spectral map of the heavy metal to be measured in each sample with the enhanced spectral intensity to obtain the enhanced spectral map of the heavy metal to be measured in each sample; use the enhanced spectral map of the heavy metal to be measured in each sample, the moisture content, the temperature, the humidity, the soil structure factor, the equivalent porosity and the concentration as the input of the neural network, and output the spectral compensation coefficient of the enhanced spectral map of the heavy metal to be measured in each sample. Based on the enhanced spectral map and spectral compensation coefficient of the heavy metal to be measured in each sample, and combined with the reference spectrum and the concentration, determine the concentration of the heavy metal to be measured in each sample.

[0005] Preferably, the expression of the particle size related value of each sample is: ; In the formula, represents the particle size related value of sample i; represents the particle size of sample i; represents a preset first value; represents a preset standard particle size; represents the logarithmic function with the natural constant as the base.

[0006] Preferably, the expression of the soil structure factor of each sample is: ; In the formula, represents the soil structure factor of sample i; represents the particle size related value of sample i; represents the result of the sum of the squared equivalent circle diameters of all particles in sample i divided by the sum of the equivalent circle diameters of all particles; represents a preset second value.

[0007] Preferably, the expression of the equivalent porosity of each sample is: ; In the formula, represents the equivalent porosity of sample i; represents the dry soil porosity of sample i; represents the moisture content of sample i; represents a preset moisture content sensitivity coefficient; represents a preset standard moisture content; represents the logarithmic function with the natural constant as the base.

[0008] Preferably, the method for determining the weight at each wavelength in the spectral map of the heavy metal to be measured in each sample is: The ratio between the preset characteristic wavelength of the heavy metal to be measured and each wavelength in the spectrogram of the heavy metal to be measured in each sample is used as the first weight of each wavelength in the spectrogram of the heavy metal to be measured in each sample; Take the opposite of the ratio between each wavelength in the spectrogram of the heavy metal to be measured in each sample and the preset wavelength, and use the opposite number as the independent variable of the exponential function with the natural constant as the base, and the obtained result is used as the second weight of each wavelength in the spectrogram of the heavy metal to be measured in each sample; The weight of the preset characteristic wavelength j in the spectrogram of the heavy metal to be measured in sample i The expression is: ; In the formula, 、 respectively represent the first weight and the second weight of wavelength j preset characteristic wavelength in the spectrogram of the heavy metal to be measured in sample i; represents the soil structure factor of sample i; represents the equivalent porosity of sample i; exp( ) represents the exponential function with the natural constant as the base.

[0009] Preferably, the expression of the concentration of the heavy metal to be measured in each sample is: ; In the formula, represents the concentration of the heavy metal to be measured in sample i; represents the spectral intensity at the preset characteristic wavelength in the enhanced spectrogram of the heavy metal to be measured in sample i; represents the spectral compensation coefficient of the heavy metal to be measured in sample i; represents the ratio of the spectral intensity at the preset characteristic wavelength in the reference spectrogram to the concentration of the heavy metal to be measured in the standard soil sample.

[0010] In a second aspect, an embodiment of the present application further provides a rapid soil pollution detection device, in which a computer program is stored, and when the computer program is executed by a processor, it implements the rapid soil pollution detection method described in any one of the above.

[0011] In a third aspect, an embodiment of the present application provides a rapid soil pollution detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the rapid soil pollution detection method described in any one of the above.

[0012] As can be seen from the above embodiments, the rapid soil pollution detection method provided by the embodiments of the present application has at least the following beneficial effects: This application constructs a soil structure factor by comparing the differences in particle sizes of each sample with a preset standard particle size and combining the differences between the squared equivalent circle diameters and the equivalent circle diameters of all particles within each sample, quantifies the effects of the degree of soil particle aggregation and particle size on the detection results of X-ray fluorescence spectrometers, helps to identify and eliminate spectral measurement errors caused by soil aggregation and particle size differences, and thus improves the accuracy of spectral detection. Further, by measuring the differences in the moisture content of each sample from a preset standard moisture content and combining the dry soil porosity, an equivalent porosity is determined, which can compensate for the dual attenuation effect of moisture on X-ray signals and improve the accuracy of spectral detection. Further, by comparing the differences between each wavelength in the spectrograms of heavy metals to be measured within each sample and preset characteristic wavelengths and combining the soil structure factor and the equivalent porosity, the weights of each wavelength in the spectrograms of heavy metals to be measured in each sample are determined, which helps to adaptively adjust spectral processing, effectively remove noise, and improve the accuracy and reliability of heavy metal detection in soil. Further, based on the spectrograms of heavy metals to be measured within each sample and the weights of all wavelengths therein, as well as a reference spectrogram, a neural network is trained to obtain a spectral compensation coefficient, which helps to correct the spectral intensities in the spectrograms of heavy metals to be measured in each sample and improve the accuracy of soil pollution detection. By analyzing physical properties such as soil particle size, structure factor, and equivalent porosity and using a deep learning network model to process spectral data, this application obtains a spectral compensation coefficient and finally achieves accurate determination of the concentrations of heavy metals to be measured in soil, improving the accuracy of soil pollution detection. Description of the Drawings

[0013] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following-described drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0014] Figure 1 It is a flowchart of the steps of a rapid soil pollution detection method provided by an embodiment of this application; Figure 2 It is a network structure diagram provided by an embodiment of this application. Detailed Embodiments

[0015] In order to further elaborate on the technical means and effects adopted by the present application to achieve the intended invention purpose, the following specifically describes, in conjunction with the accompanying drawings and preferred embodiments, a rapid soil pollution detection method, device, and system proposed according to the present application, including their specific implementation manners, structures, features, and effects, as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0016] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.

[0017] The following specifically describes the specific solutions of a rapid soil pollution detection method, device, and system provided by the present application in conjunction with the accompanying drawings.

[0018] Please refer to Figure 1 , which shows a flowchart of the steps of a rapid soil pollution detection method provided by an embodiment of the present application. The method includes the following steps: S1: Collect multiple soil samples in the soil to be detected, denoted as samples, and obtain the moisture content, temperature, humidity, particle size, spectrograms of heavy metals to be detected in each sample, dry soil porosity, equivalent circular diameter of each particle in each sample, spectrograms and concentrations of heavy metals to be detected in the standard soil samples of each sample. Denote the spectrogram of the heavy metal to be detected in the standard soil sample as the reference spectrogram.

[0019] In this embodiment, according to the HJ / T 166-200 standard, the grid method (100m×100m, spacing of 1m) is used to arrange soil sampling points. For each sampling point, the surface soil of 0-20 cm is taken, and 5 sub-samples are mixed to form a soil sample, with a total of 2000 soil samples. For the sake of simplicity of expression, the following content uses "sample" to replace "soil sample" for description.

[0020] Collect the moisture content, temperature, and humidity at each sub-sample. Take the average value of the moisture content, temperature average value, and humidity average value at the sampling points of all sub-samples of each soil sample as the moisture content, temperature, and humidity of each soil sample, respectively; and use an X-ray fluorescence spectrometer to collect the spectrograms and particle sizes of each sample.

[0021] Take 2 g of air-dried soil from each sample, pass it through a 2-mm sieve, place it on a glass slide, collect soil particle size images using a microscope, perform gray-scale conversion and binarization, and then use the watershed algorithm to segment the adhering particles, and calculate the equivalent circular diameter of each particle. Take 2 g of air-dried soil from each sample to calculate the dry soil porosity of each sample, and make the 2-g soil into a standard soil sample. To ensure that the standard soil sample is consistent with the heavy metal types contained in its sample, the samples are usually mixed evenly before sampling. Through a series of processes for making standard soil samples, standard soil samples are obtained. Further, obtain the concentrations of various heavy metals in the standard soil samples, and use an X-ray fluorescence spectrometer to obtain the spectrogram of the standard soil samples. Denote the spectrogram of the standard soil sample as the reference spectrum. Different heavy metals in the spectrogram are located in different wavelength ranges.

[0022] Among them, the calculation methods of gray-scale conversion, binarization processing, watershed algorithm, equivalent circular diameter, and dry soil porosity, as well as the preparation process of the standard soil sample, are all well-known technologies, and their specific principles will not be elaborated here.

[0023] S2: Compare the particle sizes of each sample with the preset standard particle size to determine the particle size-related values of each sample, and combine the differences between the squared equivalent circular diameters and the equivalent circular diameters of all particles in each sample to determine the soil structure factor of each sample; measure the differences between the moisture contents of each sample and the preset standard moisture content, and combine the dry soil porosity to determine the equivalent porosity of each sample.

[0024] The X-ray fluorescence spectrometer bombards the soil sample by emitting a high-energy X-ray beam, causing the inner-layer electrons of the atoms to transition and generate holes. When the outer-layer electrons fill the holes, characteristic X-rays are released, and their energy corresponds to the element type. The detector measures the energy and intensity of the fluorescent X-rays, and the element concentration is inversely calculated through an algorithm. However, the X-ray fluorescence spectrometer ignores the influence of soil particle size and soil moisture on X-rays, resulting in deviations in the measured pollutant concentrations. In traditional soil pollutant detection based on machine learning, the collected original spectral data is directly used for training, without utilizing the high heterogeneity of soil samples, resulting in the pollution signal in the original spectral data being submerged by noise. When traditional deep learning models directly process the original spectrum, they are prone to overfitting and can only learn the surface features of the data, rather than the real pollution law.

[0025] In soil pollution detection, both the size and aggregation state of soil particles can have a significant impact on the detection results of XRF. Soil is not in an ideal homogeneous state, with differences in particle size, and aggregation may occur between particles. Soil particles of different sizes have different absorption and scattering abilities for X-rays. Large soil particles will make the penetration path of X-rays in them longer, resulting in more X-rays being absorbed or scattered, thus weakening the detected spectral intensity and affecting the accurate judgment of the concentration of polluting elements. Moreover, the aggregation of soil particles will also change the propagation path of X-rays. Multiple scattering inside the aggregates will make the spectral signal complex and cause deviation in the detection results.

[0026] Therefore, in order to eliminate the interference of particle size and aggregation state on the detection results, compare the differences between the particle sizes of each sample and the preset standard particle size, determine the particle size-related values of each sample, and combine the differences between the square equivalent circle diameter and the equivalent circle diameter of all particles in each sample to determine the soil structure factor of each sample. The specific process is as follows: (1)Compare the differences between the particle sizes of each sample and the preset standard particle size, and determine the particle size-related values of each sample, specifically: The particle size-related value of sample i The expression is: ; In the formula, represents the particle size of sample i; represents a preset first value, which is the particle size weight coefficient and is used to quantify the influence degree of particle size change on X-ray signal attenuation; represents the preset standard particle size; represents the logarithmic function with the natural constant as the base.

[0027] It should be noted that the values of the preset first value and the preset standard particle size are both artificially set. In this embodiment, the value of the preset first value is 0.8, and the value of the preset standard particle size is 75 , and the implementer can also set them according to specific situations by himself / herself. This embodiment does not make special restrictions.

[0028] From the particle size-related values of each sample, it can be understood that the particle size-related value reflects the influence degree of particle size on spectral intensity. Because the propagation of X-rays in substances follows the exponential attenuation law, the size of soil particles will affect the penetration depth and scattering degree of X-rays. When the particle size d is greater than the preset standard particle size, the absorption and scattering of X-rays in large-particle soil increase, resulting in a weakening of spectral intensity. The logarithmic function is used because it can better describe this non-linear relationship. As the particle size increases, the value of the logarithmic function also increases, that is, the particle size-related value increases, but the growth rate gradually slows down, which conforms to the changing trend of the influence of particle size on spectral intensity in reality.

[0029] (2)Furthermore, based on the particle size related values of each sample and in combination with the difference between the squared equivalent circle diameter and the equivalent circle diameter of all particles within each sample, the soil structure factor of each sample is determined as follows: The soil structure factor of sample i is expressed as: ; where, represents the particle size related value of sample i; represents the result of the sum of the squared equivalent circle diameters of all particles within sample i divided by the total sum of the equivalent circle diameters of all particles; represents a preset second value.

[0030] It should be noted that the value of the preset second value is set artificially. To ensure that is greater than 0, it is necessary to satisfy , where represents, determined by the soil type, generally with a value range of In this embodiment takes a value of 0.28. Implementers can also set it according to specific circumstances. This embodiment does not make special restrictions.

[0031] Based on the soil structure factors of each sample, it can be understood that quantifies the degree of aggregation of soil particles. When the soil particles aggregate, that is, when is larger, larger aggregates will be formed. The pores inside these aggregates will cause the X-ray to scatter multiple times, so that the X-ray that should originally reach the detector directly is scattered and enters the detector multiple times, resulting in an increase in the detected spectral intensity. However, this increase is not due to the actual increase in the concentration of the contaminant element. Therefore, is used to suppress this scattering enhancement effect caused by aggregation; When the particle size increases, that is, the particle size related value increases, it reflects that the larger the particle size, the longer the scattering path and the more significant the signal attenuation; conversely, the smaller the particle size, the closer the particle size related value approaches 1; and the higher the degree of aggregation, the fewer the pores between particles, the increase in effective density, and the weakening of X-ray scattering. Therefore, decreases as increases, and conversely, increases as decreases. The soil structure factor represents the coupling relationship between the two and their opposite effects on the X-ray through their product, thus more truly reflecting the comprehensive influence of the soil structure on the detection signal.

[0032] The degree of soil aggregation is quantified by the equivalent circle diameter of soil particles, so as to obtain the influence of pores in aggregates on X-ray scattering. However, only the influence of aggregate pores is considered, and the influence of soil moisture on pores is not taken into account. The porosity in soil is closely related to the water content because water fills the pores in soil. During the detection process, water will have a significant impact on the propagation of X-rays. The presence of water increases the scattering path of X-rays in soil, causing more X-rays to be scattered and absorbed during propagation, resulting in a decrease in the detected spectral intensity. Different soil porosities mean different water contents, and thus different degrees of X-ray scattering and absorption. In order to eliminate the influence of water on the detection results through porosity, porosity correction is required.

[0033] Therefore, by measuring the difference between the water content of each sample and the preset standard water content, and combining with the dry soil porosity of the sample, the equivalent porosity of each sample is determined. The specific process is as follows: The equivalent porosity of sample i is expressed as: ; In the formula, represents the equivalent porosity of sample i; represents the dry soil porosity of sample i; represents the water content of sample i; represents the preset water content sensitivity coefficient, which is used to quantify the non-linear influence degree of soil water content change on the equivalent porosity, and reflects the sensitivity degree of soil porosity change with water content when water fills the pores; represents the preset standard water content; represents the logarithmic function with the natural constant as the base.

[0034] It should be noted that the values of the preset water content sensitivity coefficient and the preset standard water content are both set artificially. The value range of the preset water content sensitivity coefficient is generally , in this embodiment, the value of the preset water content sensitivity coefficient is 0.2, and the value of the preset standard water content is 10%. Implementers can also set them according to specific situations, and this embodiment does not make special restrictions.

[0035] From the equivalent porosity of each sample, it can be understood that the equivalent porosity reflects the volume ratio of pores in soil, that is, the space proportion filled with water. As the equivalent porosity increases, the scattering path of X-rays in soil becomes longer, and the spectral intensity attenuation intensifies. The logarithmic transformation is used to convert the exponential influence of water content into a linear relationship to compensate for the double attenuation effect of density change and pore structure change caused by water on X-ray signals.

[0036] So far, by analyzing the difference between the particle size of each sample and the preset standard particle size, and combining the difference between the square equivalent circle diameter and the equivalent circle diameter of all particles in each sample, the soil structure factor has been obtained; by measuring the difference between the moisture content of each sample and the preset standard moisture content, and combining the dry soil porosity, the equivalent porosity has been obtained, thereby reducing the measurement deviation and improving the accuracy of detecting pollution by the X-ray fluorescence spectrometer.

[0037] S3: By comparing the differences between each wavelength in the spectrogram of the heavy metal to be measured in each sample and the preset characteristic wavelength of the heavy metal to be measured, and the differences between each wavelength and the preset wavelength, and combining the soil structure factor and the equivalent porosity, determine the weights of each wavelength in the spectrogram of the heavy metal to be measured in each sample.

[0038] The soil structure factor and the equivalent porosity take into account the influence of soil physical factors on the spectrum. However, the spectral data itself may still contain noise and interference. By directly using these physical parameters to filter the spectrum in the preprocessing stage, this embodiment introduces dynamic weights, enabling the spectral processing to be adaptively adjusted according to specific soil conditions, and can more effectively remove the noise related to soil structure and moisture, thereby improving the accuracy and reliability of the subsequent model.

[0039] The heavy metal element to be measured will have unique absorption or emission spectral characteristics at the characteristic wavelength, and these characteristics can be obtained through spectral analysis of standard soil samples. Among them, the characteristic wavelength is a well-known technology, and its specific concept will not be elaborated here.

[0040] Based on the above analysis, by comparing the differences between each wavelength in the spectrogram of the heavy metal to be measured in each sample and the preset characteristic wavelength of the heavy metal to be measured, and the differences between each wavelength and the preset wavelength, and combining the soil structure factor and the equivalent porosity, determine the weights of each wavelength in the spectrogram of the heavy metal to be measured in each sample, specifically: Take the ratio between the preset characteristic wavelength of the heavy metal to be measured and each wavelength in the spectrogram of the heavy metal to be measured in each sample as the first weight of each wavelength in the spectrogram of the heavy metal to be measured in each sample; It should be noted that the value of the preset characteristic wavelength is set artificially. In this embodiment, taking the heavy metal lead as an example, the value of the corresponding preset characteristic wavelength is 283.3 nm. The heavy metal type can be identified through the characteristic wavelength. The selection of this preset characteristic wavelength is set based on the spectrogram of the heavy metal to be measured in the sample, that is, the spectrogram contains this preset characteristic wavelength. The implementer can also set it according to the specific situation by himself / herself, and this embodiment does not make special restrictions.

[0041] Further, take the negative value of the ratio between each wavelength and the preset wavelength in the spectrogram of the heavy metal to be measured in each sample, and use the negative value as the independent variable of the exponential function with the natural constant as the base. The result obtained is used as the second weight of each wavelength in the spectrogram of the heavy metal to be measured in each sample.

[0042] The weight of wavelength j in the spectrogram of the heavy metal to be measured in sample i The expression of is: ; In the formula, 、 respectively represent the first weight and the second weight of wavelength j in the spectrogram of the heavy metal to be measured in sample i; represents the soil structure factor of sample i; represents the equivalent porosity of sample i; exp( ) represents the exponential function with the natural constant as the base.

[0043] It can be understood from the weights of each wavelength in the spectrogram of the heavy metal to be measured in each sample that is the first weight of the preset characteristic wavelength j in the spectrogram of the heavy metal to be measured in sample i, which is used to characterize the weighting of the soil structure factor. According to the scattering efficiency formula in the Rayleigh scattering region, the scattering efficiency of short-wavelength X-rays is higher, resulting in a more significant attenuation effect of the soil structure on it. Therefore, the weight of the soil structure factor should decay with the increase of wavelength, making the value larger at the preset characteristic wavelength j of the heavy metal element to be measured, strengthening the compensation for soil structure interference, and reducing the compensation intensity at non-preset characteristic wavelengths j, so as to achieve wavelength-specific physical interference suppression; represents the second weight of the preset characteristic wavelength j in the spectrogram of the heavy metal to be measured in sample i, which is used as the weighting of the equivalent porosity. Since the attenuation degrees of X-rays with different wavelengths by moisture are different, long-wavelength X-rays are more easily absorbed and scattered by moisture. Therefore, the weight of the equivalent porosity should decay with the increase of wavelength, making the attenuation compensation effect of moisture on the spectrum stronger in the long-wavelength region. This design can effectively compensate for the significant interference of moisture on low-energy X-rays, while reducing the over-correction of high-energy X-rays, thereby improving the signal quality at the preset characteristic wavelength of the target element and ensuring the accuracy of the detection result; When the soil structure factor is large, it indicates that the soil structure is relatively compact, and the scattering and absorption effects on the spectral signal are strong. At this time, the weight will become smaller, meaning that the weight of the spectral signal at this wavelength is reduced, thus suppressing the noise signal generated by soil structure interference. Similarly, when the equivalent porosity is large, the propagation path of the spectral signal is affected, and the weight will also become smaller, reducing the influence of this interference on the target spectral characteristics.

[0044] So far, by comparing the differences between the wavelengths in the soil sample spectrogram and the characteristic wavelengths of heavy metals, and combining the soil structure factor and the equivalent porosity, the weights of the wavelengths in the spectrogram have been determined to adaptively adjust the spectrum, effectively remove noise, and improve the accuracy and reliability of heavy metal detection in soil.

[0045] S4: Based on the spectrogram of the heavy metal to be measured in each sample and the weights of all wavelengths therein, as well as the reference spectrogram, determine the enhanced spectrogram of the heavy metal to be measured in each sample, and combine the moisture content, the temperature, the humidity, the soil structure factor, the equivalent porosity, and the concentration to train the neural network to obtain the spectral compensation coefficient of the heavy metal to be measured in each sample.

[0046] First, take the product of the spectral intensity at each wavelength in the spectrogram of the heavy metal to be measured in each sample, the weight, and the spectral intensity at the corresponding wavelength in the reference spectrogram as the enhanced spectral intensity at each wavelength in the spectrogram of the heavy metal to be measured in each sample. Replace the spectral intensity at each wavelength in the spectrogram of the heavy metal to be measured in each sample with the enhanced spectral intensity to obtain the enhanced spectrogram of the heavy metal to be measured in each sample.

[0047] Furthermore, in this embodiment, a dual-branch fusion deep learning network model is used for training to finally obtain the spectral compensation coefficient. Specifically: The input layer of the dual-branch fusion deep learning network model includes a spectral feature extraction layer. Its input is the spectrogram of the heavy metal to be measured in the sample extracted by portable XRF. A window of 5 consecutive wavelength points is used to extract local spectral patterns; non-linearity is introduced through ReLU activation to enhance the learning ability for the complex attenuation law of spectral signals; dimensionality reduction is performed through max pooling to retain the main spectral features and reduce the computational amount; a window of 3 wavelength points is used again to extract finer spectral details, and the output is a 256-dimensional spectral feature vector, representing the core pattern of the original spectrum.

[0048] It also includes a physical feature processing layer. Its input is 5-dimensional soil physical features, namely the concentration of lead in the standard soil sample, the soil structure factor, the equivalent porosity, and the temperature and humidity of the sample. First, map the 5-dimensional features to a 64-dimensional space to initially expand the feature expression; then eliminate the scale differences of different features through LayerNorm; then use the GELU function to adaptively adjust the activation threshold to enhance the modeling ability for non-linear physical parameters; finally, further map to a 128-dimensional space to highlight the synergistic effect of soil structure and environmental factors.

[0049] The input of the fusion prediction layer is the spectral feature (256 - dimensional) and the physical feature (128 - dimensional). First, the spectral and physical features are merged into a 384 - dimensional multimodal feature vector. 30% of the neurons are randomly deactivated by Dropout to prevent overfitting. LayerNorm is used again to stabilize the training process, and then the GELU activation function is used to learn the high - order interactions between features. Finally, the spectral compensation coefficients of the heavy metals to be measured in each sample are output through a linear layer, which is used to correct the spectral intensity in the spectral maps of the heavy metals to be measured in each sample.

[0050] Among them, the above content is a brief process of training the double - branch fusion deep - learning network model. Since the double - branch fusion deep - learning network model is a well - known technology, its specific principle steps will not be elaborated here.

[0051] So far, in this embodiment, the high - dimensional spectral data and the low - dimensional physical features are fused to form a multimodal input space, enabling the model to capture both spectral fingerprints and soil structure features simultaneously, enhancing the adaptability to complex pollution scenarios, and reducing the overfitting risk of the model to the training data. The network structure diagram of this embodiment is as Figure 2 shown.

[0052] Step S5: Based on the enhanced spectral maps and spectral compensation coefficients of the heavy metals to be measured in each sample, and combined with the reference spectrum and the concentration, determine the concentration of the heavy metals to be measured in each sample.

[0053] Based on the spectral compensation coefficients obtained in step S4, further, based on the enhanced spectral maps and spectral compensation coefficients of the heavy metals to be measured in each sample, and combined with the reference spectrum and the concentration, determine the concentration of the heavy metals to be measured in each sample. Specifically: The expression for the concentration of the heavy metal to be measured in sample i is: ; where represents the concentration of the heavy metal to be measured in sample i; represents the spectral intensity at the preset characteristic wavelength in the enhanced spectral map of the heavy metal to be measured in sample i; represents the spectral compensation coefficient of the heavy metal to be measured in sample i; represents the ratio of the spectral intensity at the preset characteristic wavelength in the reference spectrum to the concentration of the heavy metal to be measured in the standard soil sample.

[0054] It should be noted that the preset characteristic wavelength is selected based on the spectral map of the heavy metal to be measured, that is, the enhanced spectral map and the reference spectrum of the heavy metal to be measured contain the spectral intensity at this preset characteristic wavelength, and the spectral intensity at the characteristic wavelength is more reference - worthy. Therefore, the spectral intensity at the characteristic wavelength is selected for calculating the heavy metal concentration.

[0055] So far, in this embodiment, the physical properties such as soil particle size, structure factor, and equivalent porosity are first analyzed, and then the spectral data is processed using a dual-branch fusion deep learning network model to obtain the spectral compensation coefficient. Finally, the accurate determination of the concentration of the heavy metal to be measured in the soil is realized, improving the accuracy and adaptability of the detection, and providing reliable technical support for soil pollution monitoring.

[0056] Based on the same inventive concept as the above method, an embodiment of the present application also provides a rapid soil pollution detection device, in which a computer program is stored, and when the computer program is executed by a processor, it implements the rapid soil pollution detection method described in any one of the above.

[0057] Based on the same inventive concept as the above method, an embodiment of the present application also provides a rapid soil pollution detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the rapid soil pollution detection method described in any one of the above.

[0058] It should be noted that the above sequence of embodiments of the present application is only for description and does not represent the superiority or inferiority of the embodiments. And the above describes specific embodiments of this specification. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0059] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments.

[0060] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for rapid detection of soil contamination, characterized in that: The method comprises the following steps: Collect multiple soil samples from the soil to be tested and record them as samples, obtain the moisture content, temperature, humidity, particle size, spectrum of the heavy metal to be tested in each sample, dry soil porosity, equivalent circle diameter of each particle in each sample, spectrum and concentration of the heavy metal to be tested in the standard soil sample of each sample, and record the spectrum of the heavy metal to be tested in the standard soil sample as the reference spectrum; Compare the difference between the particle size of each sample and the preset standard particle size, determine the particle size related value of each sample, and determine the soil structure factor of each sample by combining the difference between the square equivalent circle diameter of all particles in each sample and the equivalent circle diameter; measure the difference between the moisture content of each sample and the preset standard moisture content, and determine the equivalent porosity of each sample by combining the porosity of the dry soil; Determine the weight of each wavelength in the spectrum of the heavy metal to be measured in each sample by comparing the difference between each wavelength in the spectrum of the heavy metal to be measured in each sample and the preset characteristic wavelength of the heavy metal to be measured, as well as the difference between each wavelength and the preset wavelength, and combining the soil structure factor and the equivalent porosity; The product of the spectral intensity at each wavelength in the spectrum of the heavy metal to be tested in each sample, the weight and the spectral intensity at the corresponding wavelength in the reference spectrum is used as the enhanced spectral intensity at each wavelength in the spectrum of the heavy metal to be tested in each sample; the preset characteristic wavelength of the spectral intensity at each wavelength in the spectrum of the heavy metal to be tested in each sample is replaced with the enhanced spectral intensity to obtain the enhanced spectrum of the heavy metal to be tested in each sample; the enhanced spectrum of the heavy metal to be tested in each sample, the moisture content, the temperature and the humidity, the soil structure factor, the equivalent porosity and the concentration are used as inputs of the neural network to output the spectral compensation coefficient of the enhanced spectrum of the heavy metal to be tested in each sample; Based on the enhanced spectrum of the heavy metal to be detected in each sample and the spectrum compensation coefficient, and in combination with the reference spectrum and the concentration, the concentration of the heavy metal to be detected in each sample is determined.

2. A soil contamination rapid detection method as claimed in claim 1, characterized in that: The expression of the particle size correlation value of each sample is: ; In the formula, represents the particle size correlation value of sample i; represents the particle size of sample i; Indicates a preset first value; Indicates the preset standard particle size; Represents a logarithmic function with a natural constant as base.

3. A soil contamination rapid detection method as claimed in claim 1, characterized in that: The expression of the soil structure factor of each sample is: ; In the formula, represents the soil structure factor of sample i; represents the particle size correlation value of sample i; It represents the result of the sum of the square equivalent circle diameters of all particles in sample i divided by the sum of the equivalent circle diameters of all particles; Indicates the preset second value.

4. A soil contamination rapid detection method as claimed in claim 1, characterized in that: The expression of the equivalent porosity of each sample is: ; In the formula, represents the equivalent porosity of sample i; represents the dry soil porosity of sample i; represents the moisture content of sample i; Indicates the preset moisture content sensitivity coefficient; Indicates the preset standard moisture content; Represents a logarithmic function with a natural constant as base.

5. A soil contamination rapid detection method as claimed in claim 1, characterized in that: The weight of each wavelength in the spectrum of the heavy metal to be measured in each sample is determined by: The ratio between the preset characteristic wavelength of the heavy metal to be measured and each wavelength in the spectrum of the heavy metal to be measured in each sample is used as the first weight of each wavelength in the spectrum of the heavy metal to be measured in each sample; The inverse of the ratio between each wavelength in the spectrum of the heavy metal to be measured in each sample and the preset wavelength is taken, and the inverse is used as the independent variable of the exponential function with the natural constant as the base, and the obtained result is used as the second weight of each wavelength in the spectrum of the heavy metal to be measured in each sample; The weight of the preset characteristic wavelength j in the spectrum of the heavy metal to be tested in sample i The expression is: ; In the formula, , Respectively represent the first weight and the second weight of the preset characteristic wavelength of wavelength j in the spectrum of the heavy metal to be measured in sample i; represents the soil structure factor of sample i; represents the equivalent porosity of sample i; exp( ) represents an exponential function with a natural constant as the base.

6. A soil contamination rapid detection method as claimed in claim 1, characterized in that: The expression for the concentration of the heavy metal to be measured in each sample is: ; In the formula, represents the concentration of heavy metals to be tested in sample i; Represents the spectral intensity at the preset characteristic wavelength in the enhanced spectrum of the heavy metal to be tested in sample i; represents the spectrum compensation coefficient of the heavy metal to be measured in sample i; It represents the ratio of the spectral intensity at the preset characteristic wavelength in the reference spectrum to the concentration of the heavy metal to be measured in the standard soil sample.

7. A soil pollution rapid detection device, wherein a computer program is stored in the device, characterized in that: When the computer program is executed by a processor, a method for rapid detection of soil contamination as described in any one of claims 1 to 6 is implemented.

8. A soil pollution rapid detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, a method for rapid detection of soil contamination as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Rapid prediction method for physical property indexes of classic famous formula extract powder

    CN115963078A

  • Soil heavy metal detection system and method

    CN118671303A

  • Soil heavy metal content detection and correction method based on X-ray fluorescence spectrum

    CN119355025A

  • Progression method of aerial hyperspectral images for detection of hotspots in soil containing heavy metals

    KR101760474B1

  • Method of developing libraries for heavy metals in soil samples using hyperspectral sensor

    KR101780058B1

Cited By

  • Pollutant detection method and system in sludge treatment process

    CN121521764A