Detection and correction method of heavy metal content in soil based on X-ray fluorescence spectroscopy

By dynamically adjusting the filter window in X-ray fluorescence spectroscopy, combining EMD decomposition and local window analysis, the detection deviation problem caused by noise in soil heavy metal content detection is solved, achieving higher detection accuracy and robustness.

CN119355025BActive Publication Date: 2025-04-25江苏省南京环境监测中心
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411961605.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

The existing X-ray fluorescence spectroscopy technology has detection deviations caused by noise in soil heavy metal content detection, and the filtering method with fixed windows cannot effectively balance noise removal and signal protection.

Method used

By obtaining the XRF spectral signal of the soil sample, extracting the peak points and analyzing their distribution and absorption intensity, combining EMD decomposition and local window analysis, the filter window size is dynamically adjusted, the noise interference factor and filter adjustment coefficient are quantified, and the adaptive filter smoothing of the original spectral curve is achieved.

Benefits of technology

It improves the accuracy and robustness of soil heavy metal content detection, reduces the impact of noise interference on detection results, and enhances the detection accuracy under XRF technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119355025B_ABST
    Figure CN119355025B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of spectral data processing, and proposes a soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy, including: obtaining a number of XRF spectral signals of a soil sample to be detected and using them as original spectral curves; obtaining the overall similarity of each original spectral curve and the preliminary interference weight of each peak point therein; decomposing and obtaining a number of component signals; constructing a number of local windows of each component signal; obtaining the noise interference factor of each local window in each original spectral curve; obtaining the adjustment reference coefficient of each local window in each original spectral curve; obtaining the filtering adjustment coefficient of each wavelength in each original spectral curve; dynamically filtering and smoothing the original spectral curve to obtain the spectral signal to be measured; and detecting the soil heavy metal content based on the spectral signal to be measured. The present invention aims to solve the problem of deviation in heavy metal content detection caused by noise in X-ray fluorescence spectroscopy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of spectral data processing, and in particular to a soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy. Background Art

[0002] Accurately and quickly detecting the heavy metal content in soil is an important task in current environmental monitoring and governance. As a non-destructive, rapid, and multi-element simultaneous analysis method, X-ray fluorescence spectroscopy (XRF) technology has shown broad application prospects in the detection of heavy metal content in soil; however, due to the complexity and diversity of soil samples, as well as the noise and baseline drift of the XRF spectrum itself, direct use of XRF spectroscopy for heavy metal content detection often has certain errors.

[0003] When conventional mean filtering is used for denoising, the mean is usually calculated with a fixed window size; however, in the conventional detection method of heavy metal content in soil, the heavy metal content is determined by collecting spectral signals from the current sample and comparing them with the spectral curves of soil samples with known heavy metal content; and when the noise signal appears at both the non-absorption wavelength and the actual absorption wavelength, its mixing with the original spectral signal will cause modal confusion, affecting the analysis and detection results of the spectral signal. Therefore, if the filtering degree of the fixed window is too small, it may lead to poor noise filtering effect; and if the filtering degree is too large, the information in the original spectral signal will be damaged, thus affecting the detection accuracy. Summary of the invention

[0004] The present invention provides a soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy to solve the problem that the noise in the existing X-ray fluorescence spectrum causes deviation in heavy metal content detection. The technical solution adopted is as follows:

[0005] The present invention proposes a soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy, which comprises the following steps:

[0006] Acquire several XRF spectrum signals of the soil sample to be tested and use them as original spectrum curves, wherein the abscissa of the XRF spectrum signal is the wavelength and the ordinate is the absorption intensity;

[0007] Obtain several peak points of each original spectral curve; obtain the overall similarity of each original spectral curve and the preliminary interference weight of each peak point according to the distribution of peak points and absorption intensity in different original spectral curves; obtain several component signals by EMD decomposition of the original spectral curve; set local window specifications according to the periodic changes of each component signal, and construct several local windows of each component signal based on the wavelength distribution of each component signal;

[0008] According to the distribution of peak points in the local windows of the component signals and their preliminary interference weights, as well as the changes in the absorption intensity in the local windows, the local fluctuation degree of each local window of each component signal is obtained, and then the noise interference factor of each local window in each original spectral curve is obtained; combined with the overall similarity of the original spectral curves, the adjustment reference coefficient of each local window in each original spectral curve is obtained; based on the distribution of wavelengths in the original spectral curves in each local window, the filter adjustment coefficient of each wavelength in each original spectral curve is obtained according to the adjustment reference coefficient of each local window;

[0009] According to the filter adjustment coefficient of each wavelength in each original spectral curve, the original spectral curve is dynamically filtered and smoothed to obtain the spectral signal to be measured; the heavy metal content in the soil is detected based on the spectral signal to be measured.

[0010] Optionally, the specific method for obtaining the peak points of each original spectrum curve is as follows:

[0011] For any original spectrum curve, a first-order derivative is calculated for each wavelength in the original spectrum curve, a number of wavelengths whose first-order derivative is 0 are obtained, and the corresponding data points in the original spectrum curve are taken as extreme value points;

[0012] A plurality of peak points are obtained from the extreme value points to obtain a plurality of peak points of the original spectrum curve.

[0013] Optionally, the overall similarity of each original spectral curve and the preliminary interference weight of each peak point therein are specifically obtained by:

[0014] For any original spectral curve, with wavelength as the horizontal coordinate and absorption intensity as the vertical coordinate, based on all peak points of the original spectral curve, a wavelength-absorption intensity characteristic curve of the original spectral curve is constructed;

[0015] Perform DTW matching on the wavelength-absorption intensity characteristic curves of any two original spectral curves to obtain the DTW distance between the wavelength-absorption intensity characteristic curves of the two original spectral curves, and use the inverse proportional normalization result of the DTW distance as the characteristic matching similarity between the two original spectral curves;

[0016] The average of the feature matching similarities between any original spectral curve and other original spectral curves is taken as the overall similarity of the original spectral curves;

[0017] According to the DTW matching process of the wavelength-absorption intensity characteristic curve of the original spectral curve, the preliminary interference weight of each peak point in each original spectral curve is obtained.

[0018] Optionally, the preliminary interference weight of each peak point in each original spectrum curve is obtained by:

[0019] For any peak point in any original spectral curve, in the process of DTW matching of wavelength-absorption intensity characteristic curves of two original spectral curves, obtain the matching peak point of the peak point in another original spectral curve, and obtain the matching distance between the peak point and the matching peak point;

[0020] The average of the matching distances between the peak point and all its matching peak points is used as the noise interference degree of the peak point;

[0021] The noise interference degree of all peak points in each original spectral curve is normalized, and the result is used as the preliminary interference weight of each peak point.

[0022] Optionally, the local window specification is set according to the periodic changes of each component signal, including the specific method of:

[0023] For any component signal of any original spectrum curve, obtaining the period length of the component signal;

[0024] The least common multiple of the period lengths of all component signals of each original spectral curve is used as the local window specification.

[0025] Optionally, the obtaining of the local fluctuation degree of each local window of each component signal comprises the following specific methods:

[0026] For any component signal of any original spectral curve, several peak points in the component signal are obtained; for any peak point among them, the peak point in the original spectral curve corresponding to the wavelength with the smallest absolute value of difference between the wavelength of all peak points of the original spectral curve and the wavelength of the peak point is used as the reference peak point of the peak point; Of the component signals The local fluctuation degree of a local window The calculation method is:

[0027]

[0028] in, Indicates the first Of the component signals The number of peak points in a local window, Indicates the first Of the component signals In the local window The initial interference weight of the reference peak point, Indicates the first Of the component signals In the local window The peak point and The standard deviation of the absorption intensity of all wavelengths between the peak points in the original spectrum curve is, Indicates the first Of the component signals In the local window The peak point and The extreme difference in absorption intensity of all wavelengths between the peak points in the original spectrum curve.

[0029] Optionally, the obtaining of the noise interference factor of each local window in each original spectrum curve includes the following specific methods:

[0030] For any group of local windows with the same wavelength range in different component signals obtained from any original spectral curve, obtain the local window corresponding to the wavelength range in the original spectral curve, and take the average of the local fluctuation degrees of the local windows corresponding to the wavelength range in each component signal as the noise interference degree of the local window in the original spectral curve;

[0031] The noise interference degree of all local windows in the original spectrum curve is normalized, and the obtained result is used as the noise interference factor of each local window in the original spectrum curve.

[0032] Optionally, the adjustment reference coefficient of each local window in each original spectral curve is obtained by:

[0033]

[0034] in, Indicates The original spectrum curve The adjustment reference factor of a local window, Indicates The original spectrum curve The noise interference factor of a local window, represents the number of original spectral curves, Indicates The overall similarity of the original spectral curves, Indicates The noise interference factor of the original spectral curve, represents the absolute value function;

[0035] The adjustment reference factor of each local window in each original spectral curve is normalized, and the obtained result is used as the adjustment reference coefficient of each local window in each original spectral curve.

[0036] Optionally, the specific method of obtaining the filtering adjustment coefficient of each wavelength in each original spectrum curve includes:

[0037] For any wavelength in any original spectral curve, the average of the adjustment reference coefficients of the local windows containing the wavelength in all local windows of the original spectral curve is used as the filtering adjustment coefficient of the wavelength in the original spectral curve.

[0038] Optionally, the method of dynamically filtering and smoothing the original spectral curves according to the filter adjustment coefficients of the wavelengths in the original spectral curves to obtain the spectral signal to be measured includes the following specific methods:

[0039]

[0040] in, Indicates the first The adjustment window length of wavelengths, Indicates the window adjustment base. Indicates the first The filter adjustment coefficient for each wavelength is Represents the rounding function;

[0041] The adjustment window length of each wavelength in the original spectral curve is obtained, and a filtering window is constructed by adjusting the window length. The original spectral curve is dynamically smoothed by mean filtering, and the filtering result is used as the spectral signal to be measured of the original spectral curve.

[0042] The beneficial effects of the present invention are as follows: the present invention obtains a number of XRF spectral signals by performing multiple tests on the soil sample to be tested, extracts the peak points in the original spectral curve, performs similarity analysis on different original spectral curves according to the peak point distribution and its absorption intensity, quantifies the overall noise content of each original spectral curve, and quantifies the deviation of the peak point based on the matching process to reflect the initial interference weight of the noise interference; obtains component signals by decomposing the original spectral curve, and constructs a local window in the component signal to provide a basis for the subsequent local independent analysis of noise fluctuations; considers that the EMD decomposition of the original spectral curve is based on the extreme point, and the extreme point If the value point is easily disturbed by noise and the wavelength deviates, the fluctuation of the component signal in the local window is quantified, and the fluctuation of the noise influence is reflected by the local fluctuation degree, so as to determine the noise interference factor of the local window in each original spectral curve; and by comparing the noise interference factors of different original spectral curves, the degree of noise interference within a certain wavelength range is further constrained, and the overall analysis is carried out to quantify the filter adjustment coefficient of each wavelength for subsequent filtering, smoothing and denoising; dynamic smoothing and denoising of the wavelength adaptive filter window size is realized, so as to increase the robustness of the smoothing result and the accuracy of soil heavy metal content detection under XRF technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1 A schematic flow chart of a method for detecting and correcting heavy metal content in soil based on X-ray fluorescence spectroscopy provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] See also Figure 1 , which shows a flow chart of a soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy provided by an embodiment of the present invention, the method comprising the following steps:

[0047] Step S001: Acquire several XRF spectrum signals of the soil sample to be tested and use them as original spectrum curves.

[0048] The purpose of this embodiment is to detect the heavy metal content in soil by X-ray fluorescence spectroscopy (XRF) technology. The noise and baseline drift in the XRF spectrum curve will cause deviations in the detection of heavy metal content. At the same time, filtering with a fixed window size will ignore the characteristics of the spectral signal itself, affecting the detection accuracy. Therefore, in order to process the XRF spectrum curve by adjusting the filter window, it is necessary to first obtain the XRF spectrum curve of the soil sample to be detected and use it as the original spectrum curve for subsequent analysis.

[0049] Specifically, a soil sample to be tested is obtained, ground into powder or made into a block so as to be placed in an XRF instrument for analysis; the soil sample to be tested is placed in an XRF instrument, and the analysis program is started for measurement. The XRF instrument determines the type and content of elements in the sample by irradiating the sample and measuring its fluorescence radiation, wherein the analysis result is displayed in the form of a spectral signal. In this embodiment, the above process is repeated for the soil sample to be tested, and a total of five measurements are performed to obtain five XRF spectral signals, which are all used as original spectral curves.

[0050] It should be noted that in the process of analyzing the soil sample to be tested by the XRF instrument in this embodiment, according to the type and range of elements to be analyzed, the detector of the appropriate X-ray source is set by itself, the analysis parameters of the XRF instrument are set, and the acceleration voltage, current, analysis time and measurement mode, etc. are attempted. The XRF instrument measures and analyzes the fluorescence spectrum signal, which is a prior art and will not be described in detail in this embodiment.

[0051] It should be noted that the crushing effect of soil samples cannot be measured and defined, and the size of soil particles affects the scattering effect of the spectrum, which in turn leads to different noise levels at different wavelengths. Due to the existence of superposition, abnormal fluctuations in the spectral curve will be more complex and difficult to identify; but after repeated testing of the same soil sample, the performance of its internal heavy metal components in the spectral curve will not differ too much, but the noise that appears each time will be different due to randomness, and through EMD decomposition, the difference in the performance of different spectral curves in the same component is usually caused by noise.

[0052] Step S002, obtain several peak points of each original spectral curve; obtain the overall similarity of each original spectral curve and the preliminary interference weight of each peak point therein according to the distribution of peak points in different original spectral curves and their absorption intensities; obtain several component signals by EMD decomposition of the original spectral curve; set local window specifications according to the periodic changes of each component signal, and construct several local windows of each component signal based on the wavelength distribution of each component signal.

[0053] Preferably, in one embodiment of the present invention, a number of peak points of each original spectrum curve are obtained, including the specific method of:

[0054] For any original spectral curve, the first-order derivative of each wavelength in the original spectral curve is calculated to obtain several wavelengths whose first-order derivative is 0, and the corresponding data points in the original spectral curve are taken as extreme points; several peak points are obtained from the extreme points, and several peak points of the original spectral curve are obtained; several peak points of each original spectral curve are obtained according to the above method.

[0055] It should be noted that the distribution of peak points can reflect the main change trend, that is, the main feature of the original spectral curve. A sequence is constructed by distributing the peak points between the original spectral curves, and a similarity analysis is performed. Ideally, if the two original spectral curves are not disturbed by noise, the sequences constructed by the peak points are almost the same. In the process of similarity quantification through DTW matching, the matching distance is close to 0. If there is noise influence, the sequence constructed by the peak points will have a large deviation, and the matching distance will increase. The matching distance is used to reflect the similarity. The higher the similarity between the original spectral curve and other original spectral curves, the weaker the noise interference on its peak point, and the higher the weight of the subsequent reference judgment.

[0056] Preferably, in one embodiment of the present invention, according to the peak point distribution and absorption intensity in different original spectral curves, the overall similarity of each original spectral curve and the preliminary interference weight of each peak point therein are obtained, including the specific method of:

[0057] For any original spectral curve, with wavelength as the horizontal coordinate and absorption intensity as the vertical coordinate, a wavelength-absorption intensity characteristic curve of the original spectral curve is constructed based on all peak points of the original spectral curve; the wavelength-absorption intensity characteristic curve of each original spectral curve is obtained, and the wavelength-absorption intensity characteristic curves of any two original spectral curves are matched by DTW to obtain the DTW distance between the wavelength-absorption intensity characteristic curves of the two original spectral curves, and the inverse proportional normalization result of the DTW distance is used as the feature matching similarity between the two original spectral curves. This embodiment adopts Model to present inverse proportional relationship and normalization, is an exponential function with a natural constant as base, As the input of the model, the implementer can set the inverse proportional function and the normalization function according to the actual situation; the average of the feature matching similarities between any original spectral curve and the other four original spectral curves is taken as the overall similarity of the original spectral curve.

[0058] Furthermore, for any peak point in any original spectral curve, in the process of DTW matching of the wavelength-absorption intensity characteristic curves of the two original spectral curves, the matching peak point of the peak point in the other original spectral curve is obtained, and the matching distance between the peak point and its matching peak point (the distance in the DTW distance matrix) is obtained; the matching distances between the peak point and the matching peak points of the other four original spectral curves are obtained, and the average of all matching distances is used as the noise interference degree of the peak point; the noise interference degree of each peak point in each original spectral curve is obtained, all noise interference degrees are linearly normalized, and the result is used as the preliminary interference weight of each peak point.

[0059] It should be noted that during the peak point matching process, the greater the matching distance with the matching peak point, the greater the deviation from the normal situation, and the greater the possibility of deviation from the normal due to noise interference. The greater the corresponding noise interference degree, the greater the preliminary interference weight.

[0060] Preferably, in one embodiment of the present invention, the original spectrum curve is decomposed by EMD to obtain several component signals, including the specific method of:

[0061] Perform EMD decomposition on any original spectrum curve to obtain several IMF component signals of the original spectrum curve as several component signals of the original spectrum curve, wherein EMD decomposition is a well-known technology and will not be described in detail in this embodiment.

[0062] It should be noted that the overall similarity of the original spectral curve is used to analyze the overall noise content of the original spectral curve, while the preliminary interference weight of the peak point reflects the degree of noise interference. Since the noise interference and the original signal are not simply superimposed, but a modal mixing superposition, there is a stretching of the frequency band and the upper and lower limits of the absorption intensity, which will cause the peak point to deviate in wavelength, and it is impossible to intuitively analyze the individual noise content.

[0063] It should be further explained that the fluctuations in the conventional XRF spectrum curve of soil heavy metals are usually caused by the heavy metal components and scattering problems in the soil samples, but the fluctuations are relatively gentle compared to the noise. When the fluctuations and noise fluctuations appear at the same time in the local position, they will be superimposed and mixed with each other, resulting in an increase in the fluctuation range at the mixed local position. It is necessary to perform independent analysis based on the IMF component signal after modal decomposition of the original spectrum curve, and perform local range fluctuation analysis in each component signal by modally decomposing the two fluctuations, so as to perform early fluctuation analysis by quantifying the local fluctuation situation.

[0064] Preferably, in one embodiment of the present invention, the local window specification is set according to the periodic change of each component signal, and based on the wavelength distribution of each component signal, a plurality of local windows of each component signal are constructed, including the specific method of:

[0065] It should be noted that, since the local window needs to be compared with multiple original spectral curves later, and the local window is divided based on components, it is necessary to ensure that the local window specifications of different original spectral curves are the same. In different component signals, due to differences in their periodic changes, that is, differences in period lengths, it is necessary to ensure that the local window specifications can completely divide each component signal. It is necessary to set the local window specifications according to the periodic changes of each component signal, and then construct a local window for each component signal.

[0066] Specifically, for any component signal of any original spectral curve, the period length of the component signal is obtained by Hilbert transform, and the period length of each component signal of each original spectral curve is obtained. In this embodiment, the least common multiple of the period lengths of all component signals is used as the local window specification; in other embodiments, the local window specification can be adjusted and set according to actual conditions. This embodiment is only described as an example.

[0067] Furthermore, for any component signal, the horizontal axis of the component signal is also the wavelength, and a window with a local window specification is slid on the horizontal axis of the component signal, starting from the first wavelength corresponding to the left boundary of the window, with a step size of one wavelength, until the right boundary of the window slides to the last wavelength of the component signal, and several local windows of the component signal are obtained; according to the above method, several local windows of each component signal of each original spectral curve are obtained.

[0068] So far, by extracting the peak points in the original spectral curve, performing similarity analysis on different original spectral curves based on the peak point distribution and its absorption intensity, quantifying the overall noise content of each original spectral curve, and quantifying the deviation of the peak point based on the matching process can reflect the initial interference weight affected by noise interference; by decomposing the original spectral curve to obtain component signals, and constructing local windows in the component signals, a basis is provided for the subsequent local independent analysis of noise fluctuations.

[0069] Step S003, according to the distribution of peak points in the local windows of the component signals and their preliminary interference weights, as well as the changes in the absorption intensity in the local windows, the local fluctuation degree of each local window of each component signal is obtained, and then the noise interference factor of each local window in each original spectral curve is obtained; in combination with the overall similarity of the original spectral curves, the adjustment reference coefficient of each local window in each original spectral curve is obtained; based on the distribution of wavelengths in the original spectral curves in each local window, the filter adjustment coefficient of each wavelength in each original spectral curve is obtained according to the adjustment reference coefficient of each local window.

[0070] It should be noted that the noise fluctuations in the original spectral curve and the fluctuations caused by heavy metal components and scattering will cause the peak points to deviate after the mode mixing and superposition, and then the actual peak point corresponding wavelength will deviate. In the process of peak point analysis in the local window of the component signal, the analysis is based on the peak points in the component signal; by analyzing the fluctuation changes of the absorption intensity between the peak points in the local window, combined with the preliminary interference weights of the corresponding peak points, the local fluctuation situation is quantified.

[0071] Preferably, in one embodiment of the present invention, the local fluctuation degree of each local window of each component signal is obtained according to the distribution of peak points in the local window of the component signal and its preliminary interference weight, as well as the change of absorption intensity in the local window, and then the noise interference factor of each local window in each original spectrum curve is obtained, including the specific method of:

[0072] For any component signal of any original spectrum curve, several peak points in the component signal are obtained; for any peak point among them, the peak point in the original spectrum curve corresponding to the wavelength with the smallest absolute value of the difference between the wavelength of all the peak points of the original spectrum curve and the wavelength of the peak point is used as the reference peak point of the peak point; then the peak point in the original spectrum curve is Of the component signals The local fluctuation degree of a local window The calculation method is:

[0073]

[0074] in, Indicates the first Of the component signals The number of peak points in a local window, Indicates the first Of the component signals In the local window The initial interference weight of the reference peak point, Indicates the first Of the component signals In the local window The peak point and The standard deviation of the absorption intensity of all wavelengths between the peak points in the original spectrum curve, Indicates the first Of the component signals In the local window The peak point and The extreme difference in absorption intensity of all wavelengths between the peak points in the original spectrum curve.

[0075] It should be noted that the degree of local fluctuation is quantified by the absorption intensity fluctuation between peak points in the local window. The larger the standard deviation, the greater the fluctuation of absorption intensity within the range, and the greater the possibility of fluctuation caused by noise. However, due to the influence of the peak point distribution, the analysis range may be inaccurate, so it is necessary to further constrain the analysis in combination with the degree of noise interference of the peak point, and at the same time constrain it in combination with the range within the range. The larger the preliminary interference weight, the greater the degree of noise interference of the reference peak point of the peak point, and the greater the credibility that the fluctuation within the corresponding range is affected by noise. That is, the credibility of the standard deviation is further determined by the preliminary interference weight of the peak point; and the larger the range, the greater the fluctuation of absorption intensity within the range. Under the premise that the larger the standard deviation is, the greater the credibility of being affected by noise, the larger the fluctuation range, the more likely it is that it is caused by the superposition of noise and other fluctuations, and the more severe the local fluctuation, and the greater the degree of local fluctuation.

[0076] It should be further explained that since the EMD decomposition is based on the extreme points in the original spectral curve, and the peak points in the original spectral curve will deviate from the corresponding wavelength due to the influence of noise, it is impossible to accurately characterize which part of the wavelength in the original spectral curve reflects the fluctuation of the soil sample itself, and it is impossible to determine the frequency at which the fluctuation itself is distributed under modal decomposition. In the analysis process of the local fluctuation degree, through the distribution of peak points in the local window, it can separate the noise fluctuation and the fluctuation itself through modal decomposition. Therefore, the larger the local fluctuation degree, the more likely it is to be affected by the noise. The range of wavelengths, the more accurate the noise analysis based on the local fluctuation degree.

[0077] Furthermore, the local fluctuation degree of each local window of each component signal in the original spectral curve is obtained according to the above method; for any group of local windows with the same wavelength range in different component signals, the local window corresponding to the wavelength range in the original spectral curve is obtained, and the average of the local fluctuation degrees of the local windows corresponding to the wavelength range in each component signal is used as the noise interference degree of the local window in the original spectral curve; the noise interference degree of each local window in the original spectral curve is obtained and linearly normalized, and the normalized result is used as the noise interference factor of each local window in the original spectral curve.

[0078] It should be noted that, since the local windows have the same specifications and the corresponding wavelength ranges are the same, each local window in each component signal can correspond to a local window with the same wavelength range in the original spectral curve according to the wavelength range; and since the overall wavelength range is the same between different original spectral curves, local windows with the same order value correspond to the same wavelength range in different original spectral curves.

[0079] Preferably, in one embodiment of the present invention, the adjustment reference coefficient of each local window in each original spectral curve is obtained in combination with the overall similarity of the original spectral curves, and the specific method includes:

[0080] It should be noted that after quantifying the noise interference factor of the local window in the original spectral curve, if the noise interference factor is small, the difference between it and the noise interference factor of the local window in other original spectral curves should be small, that is, most of them are normal; then the overall similarity of other original spectral curves is used as the weight to quantify this difference, combined with the noise interference factor of the local window itself, to further constrain the adjustment to obtain the adjustment reference coefficient.

[0081] Specifically, The original spectrum curve Adjustment reference factor for a local window The calculation method is:

[0082]

[0083] in, Indicates The original spectrum curve The noise interference factor of a local window, represents the number of original spectral curves, Indicates The overall similarity of the original spectral curves, Indicates The noise interference factor of the original spectral curve, represents the absolute value function.

[0084] Furthermore, the adjustment reference factor of each local window in each original spectral curve is obtained according to the above method, and linear normalization is performed, and the obtained result is used as the adjustment reference coefficient of each local window in each original spectral curve.

[0085] Preferably, in one embodiment of the present invention, based on the distribution of wavelengths in each local window in the original spectrum curve, according to the adjustment reference coefficient of each local window, the filtering adjustment coefficient of each wavelength in each original spectrum curve is obtained, including the specific method of:

[0086] It should be noted that since the local windows of each component signal are obtained by sliding during the division process, there are overlapping parts between the local windows. Therefore, in the original spectral curve, the same wavelength distribution and the multiple local windows corresponding to the original spectral curve need to be analyzed as a whole for the adjustment reference coefficients of the multiple local windows, so as to quantify the noise content of the corresponding wavelength and obtain the filtering adjustment coefficient.

[0087] Specifically, for any wavelength in any original spectral curve, the average of the adjustment reference coefficients of the local windows containing the wavelength in all local windows of the original spectral curve is used as the filtering adjustment coefficient of the wavelength in the original spectral curve.

[0088] So far, considering that the EMD decomposition of the original spectral curve is based on the extreme points, and the extreme points are easily disturbed by noise and cause wavelength deviation, the fluctuation of the component signal within the local window is quantified, and the fluctuation of the noise influence is reflected by the local fluctuation degree, and the noise interference factor of the local window in each original spectral curve is determined; and by comparing the noise interference factors of different original spectral curves, the degree of noise interference within a certain wavelength range is further constrained, and the overall analysis is carried out to quantify the filter adjustment coefficient of each wavelength for subsequent filtering, smoothing and denoising.

[0089] Step S004: dynamically filter and smooth the original spectral curves according to the filter adjustment coefficients of the wavelengths in the original spectral curves to obtain the spectral signals to be measured; and detect the heavy metal content in the soil based on the spectral signals to be measured.

[0090] It should be noted that, in the process of filtering each wavelength in the original spectrum curve, if mean filtering is used for smoothing and denoising, it is necessary to adaptively adjust the filter window for each wavelength according to the filter adjustment coefficient.

[0091] Specifically, the window adjustment base is set. In this embodiment, the window adjustment base is used. wavelengths, then the first The length of the adjustment window is The method to obtain is:

[0092]

[0093] in, Indicates the window adjustment base. Indicates the first The filter adjustment coefficient for each wavelength is represents the rounding function; where due to The value range is , the above calculation will make the window length adjusted to an integer between 5 and 15, plus The purpose is to avoid the filter window being too small.

[0094] Furthermore, the adjustment window length of each wavelength in the original spectral curve is obtained, and a filtering window is constructed by adjusting the window length. The original spectral curve is dynamically smoothed by mean filtering, and the filtering result is used as the spectral signal to be measured of the original spectral curve; the spectral signal to be measured of each original spectral curve is obtained.

[0095] Furthermore, based on a number of spectral signals to be measured, features related to the heavy metal content of the soil sample to be tested are extracted through fluorescence spectroscopy, such as the fluorescence intensity of a specific wavelength and the shape parameters of the spectral curve, and a calibration model is established using soil samples with known heavy metal content (standard samples). The calibration model usually determines the heavy metal content in the standard sample through chemical analysis methods (such as atomic absorption spectroscopy, inductively coupled plasma mass spectrometry, etc.), thereby realizing the detection of the heavy metal content of the soil sample to be tested; wherein X-ray fluorescence spectroscopy analysis and chemical analysis methods of heavy metal content are both existing technologies and will not be repeated in this embodiment.

[0096] So far, several XRF spectral signals have been obtained through multiple tests on the soil samples to be tested, and the overall similarity of the original spectral curves has been obtained based on the distribution of peak points in the original spectral curves, and the noise content of each original spectral curve has been preliminarily evaluated; then the component signals are obtained through EMD decomposition, and the possibility of noise influence in a certain wavelength range in the original spectral curve is quantified based on the local fluctuation degree of the local window in the component signal, thereby realizing dynamic smoothing and denoising of the wavelength adaptive filtering window size, increasing the robustness of the smoothing results and the accuracy of soil heavy metal content detection under XRF technology.

[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy, characterized in that: The method comprises the following steps: Acquire several XRF spectrum signals of the soil sample to be tested and use them as original spectrum curves, wherein the abscissa of the XRF spectrum signal is the wavelength and the ordinate is the absorption intensity; Obtain several peak points of each original spectral curve; obtain the overall similarity of each original spectral curve and the preliminary interference weight of each peak point according to the distribution of peak points and absorption intensity in different original spectral curves; obtain several component signals by EMD decomposition of the original spectral curve; set local window specifications according to the periodic changes of each component signal, and construct several local windows of each component signal based on the wavelength distribution of each component signal; According to the distribution of peak points in the local windows of the component signals and their preliminary interference weights, as well as the changes in the absorption intensity in the local windows, the local fluctuation degree of each local window of each component signal is obtained, and then the noise interference factor of each local window in each original spectral curve is obtained; combined with the overall similarity of the original spectral curves, the adjustment reference coefficient of each local window in each original spectral curve is obtained; based on the distribution of wavelengths in the original spectral curves in each local window, the filter adjustment coefficient of each wavelength in each original spectral curve is obtained according to the adjustment reference coefficient of each local window; According to the filter adjustment coefficient of each wavelength in each original spectral curve, the original spectral curve is dynamically filtered and smoothed to obtain the spectral signal to be measured; the heavy metal content in the soil is detected based on the spectral signal to be measured; The specific method of obtaining the local fluctuation degree of each local window of each component signal includes: For any component signal of any original spectral curve, several peak points in the component signal are obtained; for any peak point among them, the peak point in the original spectral curve corresponding to the wavelength with the smallest absolute value of difference between the wavelength of all peak points of the original spectral curve and the wavelength of the peak point is used as the reference peak point of the peak point; Of the component signals The local fluctuation degree of a local window The calculation method is: ; in, Indicates the first Of the component signals The number of peak points in a local window, Indicates the first Of the component signals In the local window The initial interference weight of the reference peak point, Indicates the first Of the component signals In the local window The peak point and The standard deviation of the absorption intensity of all wavelengths between the peak points in the original spectrum curve is, Indicates the first Of the component signals In the local window The peak point and The range of the absorption intensity of all wavelengths between the peak points in the original spectrum curve; The specific method of obtaining the noise interference factor of each local window in each original spectrum curve includes: For any group of local windows with the same wavelength range in different component signals obtained from any original spectral curve, obtain the local window corresponding to the wavelength range in the original spectral curve, and take the average of the local fluctuation degrees of the local windows corresponding to the wavelength range in each component signal as the noise interference degree of the local window in the original spectral curve; Normalizing the noise interference degree of all local windows in the original spectral curve, and obtaining the result as the noise interference factor of each local window in the original spectral curve; The specific method for obtaining the adjustment reference coefficient of each local window in each original spectral curve is as follows: ; in, Indicates The original spectrum curve The adjustment reference factor of a local window, Indicates The original spectrum curve The noise interference factor of a local window, represents the number of original spectral curves, Indicates The overall similarity of the original spectral curves, Indicates The noise interference factor of the original spectral curve, represents the absolute value function; Normalizing the adjustment reference factor of each local window in each original spectral curve, and obtaining the result as the adjustment reference coefficient of each local window in each original spectral curve; The specific method of obtaining the filtering adjustment coefficient of each wavelength in each original spectrum curve includes: For any wavelength in any original spectral curve, taking the average of the adjustment reference coefficients of the local windows containing the wavelength in all local windows of the original spectral curve as the filtering adjustment coefficient of the wavelength in the original spectral curve; The method of dynamically filtering and smoothing the original spectral curves according to the filter adjustment coefficients of the wavelengths in the original spectral curves to obtain the spectral signal to be measured includes the following specific methods: ; in, Indicates the first The adjustment window length of wavelengths, Indicates the window adjustment base. Indicates the first The filter adjustment coefficient for each wavelength is Represents the rounding function; The adjustment window length of each wavelength in the original spectral curve is obtained, and a filtering window is constructed by adjusting the window length. The original spectral curve is dynamically smoothed by mean filtering, and the filtering result is used as the spectral signal to be measured of the original spectral curve.

2. The soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy according to claim 1 is characterized in that: The specific method for obtaining the peak points of each original spectrum curve is as follows: For any original spectrum curve, a first-order derivative is calculated for each wavelength in the original spectrum curve, a number of wavelengths whose first-order derivative is 0 are obtained, and the corresponding data points in the original spectrum curve are taken as extreme value points; A plurality of peak points are obtained from the extreme value points to obtain a plurality of peak points of the original spectrum curve.

3. The method for detecting and correcting soil heavy metal content based on X-ray fluorescence spectroscopy according to claim 1, characterized in that: The overall similarity of each original spectral curve and the preliminary interference weight of each peak point therein are specifically obtained by: For any original spectral curve, with wavelength as the horizontal coordinate and absorption intensity as the vertical coordinate, based on all peak points of the original spectral curve, a wavelength-absorption intensity characteristic curve of the original spectral curve is constructed; Perform DTW matching on the wavelength-absorption intensity characteristic curves of any two original spectral curves to obtain the DTW distance between the wavelength-absorption intensity characteristic curves of the two original spectral curves, and use the inverse proportional normalization result of the DTW distance as the characteristic matching similarity between the two original spectral curves; The average of the feature matching similarities between any original spectral curve and other original spectral curves is taken as the overall similarity of the original spectral curves; According to the DTW matching process of the wavelength-absorption intensity characteristic curve of the original spectral curve, the preliminary interference weight of each peak point in each original spectral curve is obtained.

4. The soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy according to claim 3 is characterized in that: The specific method for obtaining the preliminary interference weight of each peak point in each original spectrum curve is as follows: For any peak point in any original spectral curve, in the process of DTW matching of wavelength-absorption intensity characteristic curves of two original spectral curves, obtain the matching peak point of the peak point in another original spectral curve, and obtain the matching distance between the peak point and the matching peak point; The average of the matching distances between the peak point and all its matching peak points is used as the noise interference degree of the peak point; The noise interference degree of all peak points in each original spectral curve is normalized, and the result is used as the preliminary interference weight of each peak point.

5. The soil heavy metal content detection and correction method based on X-ray fluorescence spectroscopy according to claim 1 is characterized in that: The specific method of setting the local window specification according to the periodic changes of each component signal includes: For any component signal of any original spectrum curve, obtaining the period length of the component signal; The least common multiple of the period lengths of all component signals of each original spectral curve is used as the local window specification.

Citation Information

Patent Citations

  • Unmanned-aerial-vehicle hyperspectral inversion based monitoring method of heavy metal pollution in soil

    CN107421894A

  • Intelligent detection method for oil quality of intelligent internet-of-things fan based on optical analysis

    CN118260556A