Near infrared spectrum calibration processing method and system based on heavy metal nondestructive testing
By constructing the near-infrared spectral data matrix and data link, using SAM algorithm and iterative update mechanism, the problems of prone to failure and difficulty in dynamic tracking of the existing technology winning bid model are solved, and more efficient and stable prediction of heavy metal concentration is achieved.
Patent Information
- Application Number
- CN202510353140.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-27
AI Technical Summary
The existing near-infrared spectral calibration methods are prone to failure when detecting environmental changes or sample matrix fluctuations, making it difficult to dynamically track and adjust the spectral data, resulting in the prediction value of heavy metal concentration gradually deviating from the true value.
By obtaining spectral reflectivity data and building a data matrix, using SAM algorithm to match the standard spectral template, locking the wavelength interval of the target heavy metal element, extracting the corresponding wavelength point data and inputting the correction model to obtain the heavy metal concentration prediction value. Then, the data link is built based on the predicted value of heavy metal concentration, iterative updates are performed, and the data link is dynamically optimized to improve the prediction accuracy and stability of spectral reflectivity data.
Through iterative fusion of multiple spectral scan data, the average value of heavy metal concentration prediction value and spectral reflectivity data is optimized, the possible errors and fluctuations in a single scan are reduced, and the accuracy and stability of the detection results are improved.
Smart Images

Figure CN120213854A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral calibration processing, and specifically to a near-infrared spectral calibration processing method and system based on heavy metal non-destructive testing. Background Technique
[0002] In recent years, due to its characteristics such as rapidity, non-destructiveness, and environmental friendliness, near-infrared spectroscopy (NIRS) has been widely used in the field of heavy metal detection; traditional chemical analysis methods, such as atomic absorption spectrometry, mass spectrometry, etc., although having high detection accuracy, usually require complex pretreatment of samples, which is time-consuming and prone to secondary pollution; in contrast, near-infrared spectral detection can achieve rapid and non-destructive detection by obtaining the absorption and reflection characteristic data of samples to near-infrared light and combining mathematical models to analyze the internal component information of samples; therefore, this technology has broad application prospects in the detection of heavy metals in fields such as food safety, environmental monitoring, and mineral analysis; however, since the absorption characteristics of heavy metals in the near-infrared spectral region are often weak and the signals are easily affected by factors such as sample matrix changes and environmental interference, resulting in complex spectral data and large errors in heavy metal concentration prediction results, how to effectively perform spectral calibration processing has become a hot and difficult point in current research.
[0003] Existing near-infrared spectral calibration methods mainly include modeling methods such as partial least squares regression (PLSR), principal component regression (PCR), and artificial neural network (ANN), and usually rely on the data consistency of training samples and test samples; however, these methods have the following deficiencies: (1) The calibration model is strongly dependent on the initial sample data, and when the detection environment changes or the sample matrix fluctuates, the model is prone to failure; (2) Traditional calibration methods are difficult to dynamically track and adjust spectral data and cannot effectively suppress the influence of cumulative errors in successive detections, resulting in the predicted value of heavy metal concentration gradually deviating from the true value; (3) The changes in spectral reflectance data in different wavelength intervals are not fully considered, and important characteristic information related to heavy metal content may be missed. Summary of the Invention
[0004] The purpose of the present invention is to provide a near-infrared spectral calibration processing method and system based on heavy metal non-destructive testing to solve the problems raised in the above background technique.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] Near-infrared spectroscopy calibration processing method for heavy metal non-destructive testing, this method includes the following steps: Step S1: Use a near-infrared spectroscopy device to obtain spectral reflectance data and construct a spectral reflectance data matrix; based on the spectral reflectance data matrix, obtain the predicted value of heavy metal concentration; Step S2: Based on the predicted value of heavy metal concentration, construct a heavy metal concentration prediction data chain; Step S3: Obtain the nodes of the predicted value of heavy metal concentration and the spectral reflectance data interval nodes in the heavy metal concentration prediction data chain, and perform iterative update based on the number of spectral scans; Step S4: After the iteration is completed, respectively obtain the average value of the predicted value of heavy metal concentration and the spectral reflectance data in the heavy metal concentration prediction data chain corresponding to the completion of the last spectral scan, and calculate the concentration difference and reflectance difference; preset a difference threshold, analyze and perform calibration processing.
[0007] As a preferred scheme of the near-infrared spectroscopy calibration processing method for heavy metal non-destructive testing according to the present invention, use a near-infrared spectroscopy device to perform spectral scanning on the test sample. Among them, one scan covers the entire wavelength range set by the near-infrared spectroscopy device. There are a total of M wavelength points preset in the wavelength range. Among them, the wavelength points are preset before scanning, and one wavelength point corresponds to one spectral reflectance data.
[0008] Based on the spectral reflectance data, construct a spectral reflectance data matrix, specifically as follows:
[0009]
[0010] Among them, SRD N,M represents the spectral reflectance data of the Nth spectral scan at the Mth wavelength point, and N represents the total number of spectral scans.
[0011] Based on the target heavy metal element, match the standard spectral template through the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element.
[0012] Extract the spectral reflectance data corresponding to all wavelength points within the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; based on a calibration model (such as partial least squares method, principal component regression, artificial neural network, etc.), input the spectral reflectance data into the calibration model to obtain the predicted value of heavy metal concentration.
[0013] It should be noted that in near-infrared spectroscopy detection, the wavelength range and wavelength points for each scan are usually the same. This is because when detecting a sample, in order to ensure the consistency and comparability of data, measurements need to be carried out within a fixed wavelength range. This can avoid spectral feature differences caused by changes in the wavelength range, facilitating subsequent data processing and analysis. The wavelength range generally needs to be set manually, and various factors need to be considered during setting, such as the nature of the sample, the detection purpose, and the performance of the instrument, etc. Different heavy metals have different absorption characteristics in the near-infrared spectral region. In order to accurately detect heavy metals in the sample, a wavelength range that can reflect the characteristic absorption of these heavy metals needs to be selected.
[0014] As a preferred embodiment of the near-infrared spectral calibration processing method for heavy metal non-destructive detection according to the present invention, based on the predicted heavy metal concentration value, a heavy metal concentration prediction data chain is constructed as follows:
[0015] Set the nodes of the heavy metal concentration prediction data chain. The nodes of the heavy metal concentration prediction data chain include a heavy metal concentration prediction value node, a wavelength point interval node, and a spectral reflectance data interval node. The wavelength point interval node corresponds to all wavelength points within the wavelength range corresponding to the target heavy metal element, and the spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points within the wavelength point interval node.
[0016] Connect the heavy metal concentration prediction value node, the wavelength point interval node, and the spectral reflectance data interval node in sequence to construct a heavy metal concentration prediction data chain. Moreover, one heavy metal concentration prediction data chain is constructed for each spectral scan.
[0017] As a preferred embodiment of the near-infrared spectral calibration processing method for heavy metal non-destructive detection according to the present invention, the heavy metal concentration prediction data chain corresponding to the completion of the k-th spectral scan is denoted as wherein, PHC k represents the predicted heavy metal concentration value corresponding to the heavy metal concentration prediction value node in the heavy metal concentration prediction data chain IC k , [i, j] represents the wavelength point interval node, i represents the starting wavelength point within the wavelength point interval node, j represents the ending wavelength point within the wavelength point interval node, represents the average value of all spectral reflectance data within the spectral reflectance data interval node when the k-th spectral scan is completed.
[0018] Let k = k + 1, and perform iterative update on the heavy metal concentration prediction data chain as follows:
[0019] The heavy metal concentration prediction data chain IC kUpdate the heavy metal concentration prediction data chain IC constructed when the (k - 1)-th spectral scan is completed as follows: k-1 Specifically:
[0020] Fuse the nodes of the heavy metal concentration prediction values. The fusion formula is as follows:
[0021]
[0022] Where, ΔPHC k represents the predicted value of the heavy metal concentration after fusion and update when the k-th spectral scan is completed. k represents the number of the current spectral scan, η represents a preset influence factor, and ΔPHC k-1 represents the predicted value of the heavy metal concentration after fusion and update when the (k - 1)-th spectral scan is completed, and PHC k represents the predicted value of the heavy metal concentration when the k-th spectral scan is completed.
[0023] Fuse the nodes of the spectral reflectance data intervals. The fusion formula is as follows:
[0024]
[0025] Where, ΔSRD k represents the average value of the spectral reflectance data after fusion and update when the k-th spectral scan is completed. k represents the number of the current spectral scan, SRD k,m represents the spectral reflectance data corresponding to the m-th wavelength point in the wavelength point interval node when the k-th spectral scan is completed, and ΔSRD k-1 represents the spectral reflectance data after fusion and update when the (k - 1)-th spectral scan is completed.
[0026] Take the fused nodes of the heavy metal concentration prediction values and the fused nodes of the spectral reflectance data intervals as the nodes in the updated new heavy metal concentration prediction data chain, and take the updated new heavy metal concentration prediction data chain as the heavy metal concentration prediction data chain corresponding to when the k-th spectral scan is completed.
[0027] When k = N, stop the iteration.
[0028] In the present invention, this step optimizes the predicted value of heavy metal concentration and the average value of spectral reflectance data through iterative fusion of multiple spectral scan data; as the number of scans increases, the fused data can more comprehensively reflect the true characteristics of the sample, reducing the errors and fluctuations that may exist in a single scan, thereby improving the accuracy and stability of the detection results; the fusion formula can effectively reduce the noise and uncertainty of the data, improving the quality and reliability of the data; in practical applications, the formula enables the detection method to better adapt to different sample characteristics and detection environments, providing strong support for accurately predicting the heavy metal concentration. At the same time, the calculation of the formula is relatively simple and will not impose too much burden on the calculation system, ensuring the efficiency of the detection process.
[0029] As a preferred embodiment of the near-infrared spectral calibration processing method for non-destructive heavy metal detection according to the present invention, when the iteration is completed, the predicted value of heavy metal concentration ΔPHC in the heavy metal concentration prediction data chain corresponding to the completion of the Nth spectral scan is obtained N and the average value of spectral reflectance data ΔSRD N .
[0030] Calculate the concentration difference between the predicted value of heavy metal concentration ΔPHC N and the predicted value of heavy metal concentration PHC1 in the heavy metal concentration prediction data chain corresponding to the completion of the first spectral scan.
[0031] Calculate the reflectance difference between the average value of spectral reflectance data ΔSRD N and the average value of spectral reflectance data in the heavy metal concentration prediction data chain corresponding to the completion of the first spectral scan.
[0032] Preset the concentration difference threshold and the reflectance difference threshold. If the concentration difference is less than the concentration difference threshold and the reflectance difference is less than the reflectance difference threshold, it is determined that the stability of the detection process is good and the set wavelength range and wavelength points are effective; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectance difference is greater than or equal to the reflectance difference threshold, it is determined that the stability of the detection process is not good and the set wavelength range and wavelength points are invalid. Adjust the wavelength range and wavelength points for calibration processing and re-iterate the heavy metal concentration prediction data chain.
[0033] In the present invention, this step can objectively evaluate the stability of the detection process and the effectiveness of the set wavelength range and wavelength points by analyzing and comparing the results after iterative processing of multiple scan data; when the detection process is unstable or the set parameters are invalid, timely adjustment and re-iteration help to ensure the reliability and accuracy of the final detection results, avoiding incorrect detection conclusions caused by unreasonable parameter settings or unstable detection processes;
[0034] Near-infrared spectroscopy calibration processing system for non-destructive heavy metal detection, the system includes: a matrix construction and data acquisition module, a data chain construction module, a data chain iterative update module, and a difference calculation and analysis processing module.
[0035] The matrix construction and data acquisition module: uses a near-infrared spectroscopy device to obtain spectral reflectance data and constructs a spectral reflectance data matrix; based on the spectral reflectance data matrix, obtains a heavy metal concentration prediction value.
[0036] The data chain construction module: constructs a heavy metal concentration prediction data chain based on the heavy metal concentration prediction value.
[0037] The data chain iterative update module: obtains the heavy metal concentration prediction value nodes and spectral reflectance data interval nodes in the heavy metal concentration prediction data chain, and performs iterative updates based on the number of spectral scans.
[0038] The difference calculation and analysis processing module: when the iteration is completed, respectively obtains the heavy metal concentration prediction value in the heavy metal concentration prediction data chain corresponding to the completion of the last spectral scan and the average value of the spectral reflectance data, and calculates the concentration difference and the reflectance difference; preset a difference threshold, analyze and perform calibration processing.
[0039] Further, the matrix construction and data acquisition module includes a matrix construction unit and a data acquisition unit.
[0040] The matrix construction unit: uses a near-infrared spectroscopy device to perform spectral scans on the test sample. Among them, one scan covers the entire wavelength range set by the near-infrared spectroscopy device. There are a total of M wavelength points preset in the wavelength range. The wavelength points are preset before the scan, and one wavelength point corresponds to one spectral reflectance data; based on the spectral reflectance data, constructs a spectral reflectance data matrix.
[0041] The data acquisition unit: based on the target heavy metal element, matches the standard spectral template through the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element; extracts the spectral reflectance data corresponding to all wavelength points in the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; based on the calibration model, inputs the spectral reflectance data into the calibration model to obtain the heavy metal concentration prediction value.
[0042] Further, the data chain construction module includes a data chain construction unit.
[0043] The data chain construction unit: Based on the predicted heavy metal concentration value, construct a predicted heavy metal concentration data chain as follows: Set the nodes of the predicted heavy metal concentration data chain. The nodes of the predicted heavy metal concentration data chain include the predicted heavy metal concentration value node, the wavelength point interval node, and the spectral reflectance data interval node. The wavelength point interval node corresponds to all wavelength points within the wavelength interval corresponding to the target heavy metal element. The spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points within the wavelength point interval node. Sequentially connect the predicted heavy metal concentration value node, the wavelength point interval node, and the spectral reflectance data interval node to construct a predicted heavy metal concentration data chain. Moreover, one spectral scan constructs one predicted heavy metal concentration data chain.
[0044] Further, the data chain iterative update module includes a predicted heavy metal concentration value update unit and a spectral reflectance data update unit.
[0045] The predicted heavy metal concentration value update unit: Fuse the predicted heavy metal concentration value node in the predicted heavy metal concentration data chain with the predicted heavy metal concentration value node in the predicted heavy metal concentration data chain constructed when the previous spectral scan was completed.
[0046] The spectral reflectance data update unit: Fuse the spectral reflectance data interval node in the predicted heavy metal concentration data chain with the spectral reflectance data interval node in the predicted heavy metal concentration data chain constructed when the previous spectral scan was completed. Use the fused predicted heavy metal concentration value node and the fused spectral reflectance data interval node as the nodes in the updated new predicted heavy metal concentration data chain, and use the updated new predicted heavy metal concentration data chain as the predicted heavy metal concentration data chain corresponding to the completion of the current spectral scan.
[0047] Further, the difference calculation and analysis processing module includes a difference calculation unit and an analysis processing unit.
[0048] The difference calculation unit: Calculate the concentration difference between the predicted heavy metal concentration value and the predicted heavy metal concentration value in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan. Calculate the reflectance difference between the average value of the spectral reflectance data and the average value of the spectral reflectance data in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan.
[0049] The analysis and processing unit: preset a concentration difference threshold and a reflectance difference threshold. If the concentration difference is less than the concentration difference threshold and the reflectance difference is less than the reflectance difference threshold, it is determined that the detection process has good stability, and the set wavelength range and wavelength points are valid; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectance difference is greater than or equal to the reflectance difference threshold, it is determined that the detection process has poor stability, and the set wavelength range and wavelength points are invalid. Adjust the wavelength range and wavelength points for calibration processing, and re-iterate and update the heavy metal concentration prediction data chain.
[0050] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: In the near-infrared spectroscopy calibration processing method and system based on non-destructive heavy metal detection provided by the present invention, by obtaining spectral reflectance data and constructing a data matrix, using the SAM algorithm to match the standard spectral template, locking the wavelength range corresponding to the target heavy metal element, extracting the data of the corresponding wavelength points and inputting them into the calibration model to obtain the heavy metal concentration prediction value, ensuring the accuracy of the initial data. Then, based on the heavy metal concentration prediction value, a data chain is constructed, connecting the prediction value node, the wavelength point interval node, and the spectral reflectance data interval node, providing structured data support for subsequent analysis. An iterative update mechanism is introduced to gradually fuse the heavy metal concentration prediction value and the spectral reflectance data interval node, dynamically optimize the data chain, and improve the prediction accuracy and the stability of the spectral reflectance data. By calculating the concentration difference and the reflectance difference, combined with the preset threshold to judge the stability of the detection process, ensuring the effectiveness of the wavelength range and wavelength point settings, and automatically adjusting when the detection is unstable, further improving the detection accuracy and reliability. Overall, this method not only realizes the efficient calibration of non-destructive heavy metal detection, but also ensures the dynamic optimization and adaptive adjustment ability of data processing, is applicable to the rapid detection needs of heavy metals in various complex environments, and has important industrial application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification, together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention.
[0052] Figure 1 It is a schematic diagram of the steps of the near-infrared spectroscopy calibration processing method based on non-destructive heavy metal detection of the present invention;
[0053] Figure 2 It is a schematic diagram of the structure of the near-infrared spectroscopy calibration processing system based on non-destructive heavy metal detection of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0055] Please refer to Figure 1 , in the first embodiment: A near-infrared spectrum calibration processing method based on heavy metal non-destructive detection is provided. The method includes the following steps:
[0056] Step S1: Use a near-infrared spectrum device to obtain spectral reflectance data and construct a spectral reflectance data matrix; based on the spectral reflectance data matrix, obtain a predicted heavy metal concentration value.
[0057] Use a near-infrared spectrum device to perform spectral scanning on the test sample. Among them, one scan covers the entire wavelength range set by the near-infrared spectrum device. There are a total of M wavelength points preset in the wavelength range. The wavelength points are preset before scanning, and one wavelength point corresponds to one spectral reflectance data;
[0058] Based on the spectral reflectance data, construct a spectral reflectance data matrix as follows:
[0059]
[0060] Among them, SRD N,M represents the spectral reflectance data of the Nth spectral scan at the Mth wavelength point. N represents the total number of spectral scans;
[0061] Based on the target heavy metal element, match the standard spectral template through the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element;
[0062] Extract the spectral reflectance data corresponding to all wavelength points within the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; based on a calibration model (such as partial least squares method, principal component regression, artificial neural network, etc.), input the spectral reflectance data into the calibration model to obtain a predicted heavy metal concentration value.
[0063] It should be noted that in near-infrared spectroscopy detection, the wavelength range and wavelength points for each scan are usually the same. This is because when detecting a sample, to ensure the consistency and comparability of data, measurements need to be carried out within a fixed wavelength range. This can avoid spectral feature differences caused by changes in the wavelength range and facilitate subsequent data processing and analysis. The wavelength range generally needs to be set manually, and multiple factors need to be considered during the setting, such as the nature of the sample, the detection purpose, and the performance of the instrument. Different heavy metals have different absorption characteristics in the near-infrared spectral region. To accurately detect heavy metals in a sample, a wavelength range that can reflect the characteristic absorption of these heavy metals needs to be selected.
[0064] Step S2: Based on the predicted heavy metal concentration value, construct a predicted heavy metal concentration data chain.
[0065] Based on the predicted heavy metal concentration value, construct a predicted heavy metal concentration data chain as follows:
[0066] Set the nodes of the predicted heavy metal concentration data chain. The nodes of the predicted heavy metal concentration data chain include a predicted heavy metal concentration value node, a wavelength point interval node, and a spectral reflectance data interval node. The wavelength point interval node corresponds to all wavelength points within the wavelength range corresponding to the target heavy metal element, and the spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points within the wavelength point interval node.
[0067] Sequentially connect the predicted heavy metal concentration value node, the wavelength point interval node, and the spectral reflectance data interval node to construct a predicted heavy metal concentration data chain. Moreover, one predicted heavy metal concentration data chain is constructed for each spectral scan.
[0068] Step S3: Obtain the predicted heavy metal concentration value node and the spectral reflectance data interval node in the predicted heavy metal concentration data chain, and perform iterative update based on the number of spectral scans.
[0069] Denote the predicted heavy metal concentration data chain corresponding to the completion of the k-th spectral scan as where PHC k represents the predicted heavy metal concentration value corresponding to the predicted heavy metal concentration value node in the predicted heavy metal concentration data chain IC k [i, j] represents the wavelength point interval node, i represents the starting wavelength point within the wavelength point interval node, j represents the ending wavelength point within the wavelength point interval node, represents the average value of all spectral reflectance data within the spectral reflectance data interval node when the k-th spectral scan is completed;
[0070] Let k = k + 1 and iteratively update the heavy metal concentration prediction data chain as follows:
[0071] Update the heavy metal concentration prediction data chain IC k with the heavy metal concentration prediction data chain IC k-1 constructed when the (k - 1)-th spectral scan is completed as follows:
[0072] Fuse the heavy metal concentration prediction value nodes. The fusion formula is as follows:
[0073]
[0074] where ΔPHC k represents the fused and updated heavy metal concentration prediction value when the k-th spectral scan is completed, k represents the number of the current spectral scan, η represents a preset influence factor, and ΔPHC k-1 represents the fused and updated heavy metal concentration prediction value when the (k - 1)-th spectral scan is completed, and PHC k represents the heavy metal concentration prediction value when the k-th spectral scan is completed;
[0075] Fuse the spectral reflectance data interval nodes. The fusion formula is as follows:
[0076]
[0077] where ΔSRD k represents the average value of the fused and updated spectral reflectance data when the k-th spectral scan is completed, k represents the number of the current spectral scan, SRD k,m represents the spectral reflectance data corresponding to the m-th wavelength point in the wavelength point interval node when the k-th spectral scan is completed, and ΔSRD k-1 represents the fused and updated spectral reflectance data when the (k - 1)-th spectral scan is completed;
[0078] Take the fused heavy metal concentration prediction value nodes and the fused spectral reflectance data interval nodes as the nodes in the updated new heavy metal concentration prediction data chain, and take the updated new heavy metal concentration prediction data chain as the heavy metal concentration prediction data chain corresponding to when the k-th spectral scan is completed;
[0079] When k = N, stop the iteration.
[0080] It should be noted that in this step, based on the data chain, iterative update is performed using multiple spectral scans. After each scan is completed, the fusion formula is used to dynamically adjust the heavy metal concentration prediction value and the spectral reflectance data, so that the new data is fused with the previous data, gradually approaching the true concentration value; each iteration updates the nodes in the data chain, forming a dynamically optimized hierarchical chain.
[0081] Step S4: After the iteration is completed, respectively obtain the predicted heavy metal concentration value and the average value of the spectral reflectivity data corresponding to the completion of the last spectral scan in the predicted heavy metal concentration data chain, and calculate the concentration difference and the reflectivity difference; preset the difference thresholds, and analyze and perform calibration processing.
[0082] After the iteration is completed, obtain the predicted heavy metal concentration value ΔPHC in the predicted heavy metal concentration data chain corresponding to the completion of the Nth spectral scan N and the average value of the spectral reflectivity data ΔSRD N ;
[0083] Calculate the concentration difference between the predicted heavy metal concentration value ΔPHC N and the predicted heavy metal concentration value PHC1 in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan;
[0084] Calculate the average value of the spectral reflectivity data ΔSRD N and the average value of the spectral reflectivity data in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan to obtain the reflectivity difference;
[0085] Preset the concentration difference threshold and the reflectivity difference threshold. If the concentration difference is less than the concentration difference threshold and the reflectivity difference is less than the reflectivity difference threshold, it is determined that the detection process is stable and the set wavelength range and wavelength points are effective; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectivity difference is greater than or equal to the reflectivity difference threshold, it is determined that the detection process is unstable and the set wavelength range and wavelength points are invalid. Adjust the wavelength range and wavelength points for calibration processing, and re-iterate and update the predicted heavy metal concentration data chain.
[0086] It should be noted that this step establishes a complete set of detection process evaluation and feedback adjustment mechanisms; it can automatically identify possible problems in the detection process and perform self-optimization by adjusting parameters and recalculating, making the detection method more adaptable and self-adaptive; this closed-loop detection process can maintain high detection accuracy and reliability in different detection scenarios, reducing the possibility of manual intervention and misjudgment.
[0087] Please refer to Figure 2 , in the second embodiment: Provide a near-infrared spectrum calibration processing system for non-destructive heavy metal detection, which includes: a matrix construction and data acquisition module, a data chain construction module, a data chain iterative update module, and a difference calculation and analysis processing module.
[0088] The matrix construction and data acquisition module: Obtain spectral reflectance data using a near-infrared spectroscopy device and construct a spectral reflectance data matrix; Based on the spectral reflectance data matrix, obtain the predicted heavy metal concentration value.
[0089] The data chain construction module: Based on the predicted heavy metal concentration value, construct a predicted heavy metal concentration data chain.
[0090] The data chain iterative update module: Obtain the predicted heavy metal concentration value nodes and spectral reflectance data interval nodes in the predicted heavy metal concentration data chain, and perform iterative updates based on the number of spectral scans.
[0091] The difference calculation and analysis processing module: After the iteration is completed, respectively obtain the predicted heavy metal concentration value in the predicted heavy metal concentration data chain corresponding to the completion of the last spectral scan and the average value of the spectral reflectance data, and calculate the concentration difference and reflectance difference; Preset a difference threshold, analyze and perform calibration processing.
[0092] Further, the matrix construction and data acquisition module includes a matrix construction unit and a data acquisition unit.
[0093] The matrix construction unit: Use a near-infrared spectroscopy device to perform spectral scans on the test sample. Among them, one scan covers the entire wavelength range set by the near-infrared spectroscopy device. There are a total of M wavelength points preset in the wavelength range. Among them, the wavelength points are preset before the scan, and one wavelength point corresponds to one spectral reflectance data; Based on the spectral reflectance data, construct a spectral reflectance data matrix.
[0094] The data acquisition unit: Based on the target heavy metal element, match the standard spectral template through the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element; Extract the spectral reflectance data corresponding to all wavelength points in the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; Based on the calibration model, input the spectral reflectance data into the calibration model to obtain the predicted heavy metal concentration value.
[0095] Further, the data chain construction module includes a data chain construction unit.
[0096] The data chain construction unit: Based on the predicted heavy metal concentration value, construct a predicted heavy metal concentration data chain as follows: Set the nodes of the predicted heavy metal concentration data chain. The nodes of the predicted heavy metal concentration data chain include a predicted heavy metal concentration value node, a wavelength point interval node, and a spectral reflectance data interval node. The wavelength point interval node corresponds to all wavelength points within the wavelength interval corresponding to the target heavy metal element. The spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points within the wavelength point interval node. Sequentially connect the predicted heavy metal concentration value node, the wavelength point interval node, and the spectral reflectance data interval node to construct a predicted heavy metal concentration data chain. Moreover, one spectral scan constructs one predicted heavy metal concentration data chain.
[0097] Further, the data chain iterative update module includes a predicted heavy metal concentration value update unit and a spectral reflectance data update unit.
[0098] The predicted heavy metal concentration value update unit: Fuse the predicted heavy metal concentration value node in the predicted heavy metal concentration data chain with the predicted heavy metal concentration value node in the predicted heavy metal concentration data chain constructed when the previous spectral scan was completed.
[0099] The spectral reflectance data update unit: Fuse the spectral reflectance data interval node in the predicted heavy metal concentration data chain with the spectral reflectance data interval node in the predicted heavy metal concentration data chain constructed when the previous spectral scan was completed. Use the fused predicted heavy metal concentration value node and the fused spectral reflectance data interval node as the nodes in the updated new predicted heavy metal concentration data chain, and use the updated new predicted heavy metal concentration data chain as the predicted heavy metal concentration data chain corresponding to the completion of the current spectral scan.
[0100] Further, the difference calculation and analysis processing module includes a difference calculation unit and an analysis processing unit.
[0101] The difference calculation unit: Calculate the concentration difference between the predicted heavy metal concentration value and the predicted heavy metal concentration value in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan. Calculate the reflectance difference between the average value of the spectral reflectance data and the average value of the spectral reflectance data in the predicted heavy metal concentration data chain corresponding to the completion of the first spectral scan.
[0102] The analysis and processing unit: preset a concentration difference threshold and a reflectance difference threshold. If the concentration difference is less than the concentration difference threshold and the reflectance difference is less than the reflectance difference threshold, it is determined that the detection process has good stability and the set wavelength range and wavelength points are valid; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectance difference is greater than or equal to the reflectance difference threshold, it is determined that the detection process has poor stability, the set wavelength range and wavelength points are invalid, adjust the wavelength range and wavelength points for calibration processing, and re - perform the iterative update of the heavy metal concentration prediction data chain.
[0103] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non - exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.
[0104] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A near-infrared spectroscopy calibration method based on heavy metal nondestructive testing, characterized in that: The method comprises the following steps: Step S1: using a near-infrared spectroscopy device to obtain spectral reflectance data and construct a spectral reflectance data matrix; based on the spectral reflectance data matrix, obtaining a predicted value of heavy metal concentration; Step S2: constructing a heavy metal concentration prediction data chain based on the heavy metal concentration prediction value; Step S3: obtaining the heavy metal concentration prediction value node and the spectral reflectance data interval node in the heavy metal concentration prediction data chain, and performing iterative updates based on the number of spectral scans; Step S4: When the iteration is completed, the heavy metal concentration prediction value and the average value of the spectral reflectance data in the heavy metal concentration prediction data chain corresponding to the completion of the last spectral scan are obtained respectively, and the concentration difference and the reflectance difference are calculated; the difference threshold is preset, and the analysis and calibration are performed.
2. The near-infrared spectroscopy calibration processing method based on heavy metal nondestructive testing according to claim 1 is characterized in that: The specific implementation process of step S1 includes: Using a near-infrared spectroscopy device, a spectral scan is performed on the test sample, wherein one scan covers the entire wavelength range set by the near-infrared spectroscopy device, and a total of M wavelength points are preset in the wavelength range, wherein the wavelength points are preset before scanning, and one wavelength point corresponds to one spectral reflectance data; Based on the spectral reflectance data, a spectral reflectance data matrix is constructed, as follows: Among them, SRD N,M It represents the spectral reflectance data of the Nth spectral scan at the Mth wavelength, where N represents the total number of spectral scans; Based on the target heavy metal element, the standard spectrum template is matched by the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element; Extract the spectral reflectance data corresponding to all wavelength points in the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; input the spectral reflectance data into the correction model based on the correction model to obtain the predicted value of heavy metal concentration.
3. The near-infrared spectroscopy calibration processing method based on heavy metal nondestructive testing according to claim 2 is characterized in that: The specific implementation process of step S2 includes: Based on the predicted heavy metal concentration values, a heavy metal concentration prediction data chain is constructed, as follows: Setting a heavy metal concentration prediction data chain node, the heavy metal concentration prediction data chain node includes a heavy metal concentration prediction value node, a wavelength point interval node and a spectral reflectance data interval node, the wavelength point interval node corresponds to all wavelength points in the wavelength interval corresponding to the target heavy metal element, and the spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points in the wavelength point interval node; The heavy metal concentration prediction value node, the wavelength point interval node and the spectral reflectance data interval node are sequentially connected to construct a heavy metal concentration prediction data chain, and one spectral scan constructs one heavy metal concentration prediction data chain.
4. The near-infrared spectroscopy calibration processing method based on heavy metal nondestructive testing according to claim 3 is characterized in that: The specific implementation process of step S3 includes: The corresponding heavy metal concentration prediction data chain when the kth spectral scan is completed is recorded as Among them, PHC k Indicates heavy metal concentration prediction data link IC k The predicted heavy metal concentration value corresponding to the predicted heavy metal concentration value node in the wavelength point interval node, [i, j] represents the wavelength point interval node, i represents the starting wavelength point in the wavelength point interval node, j represents the ending wavelength point in the wavelength point interval node, It indicates the average value of all spectral reflectance data in the spectral reflectance data interval node when the kth spectral scan is completed; Let k = k + 1, and iteratively update the heavy metal concentration prediction data chain, as follows: Link heavy metal concentration prediction data to IC k The heavy metal concentration prediction data link IC constructed when the k-1th spectral scan is completed k-1 Update as follows: The heavy metal concentration prediction value nodes are fused, and the fusion formula is as follows: Among them, ΔPHC k It indicates the predicted value of heavy metal concentration after fusion update when the kth spectrum scan is completed, k indicates the number of current spectrum scans, η indicates the preset influencing factor, ΔPHC k-1 Indicates the predicted value of heavy metal concentration after fusion update when the k-1th spectral scan is completed, PHC k represents the predicted value of heavy metal concentration when the kth spectral scan is completed; The spectral reflectance data interval nodes are fused, and the fusion formula is as follows: Among them, ΔSRD k It indicates the average value of the spectral reflectance data after fusion and update when the kth spectral scan is completed. k indicates the number of current spectral scans. SRD k,m Indicates the spectral reflectance data corresponding to the mth wavelength point in the wavelength point interval node when the kth spectrum scan is completed, ΔSRD k-1 Indicates that when the k-1th spectral scan is completed, the updated spectral reflectance data is integrated; The fused heavy metal concentration prediction value node and the fused spectral reflectance data interval node are used as nodes in the updated new heavy metal concentration prediction data chain, and the updated new heavy metal concentration prediction data chain is used as the heavy metal concentration prediction data chain corresponding to the completion of the kth spectral scan; When k=N, the iteration stops.
5. The near-infrared spectroscopy calibration processing method based on heavy metal nondestructive testing according to claim 4 is characterized in that: The specific implementation process of step S4 includes: When the iteration is completed, the predicted heavy metal concentration value ΔPHC in the heavy metal concentration prediction data chain corresponding to the completion of the Nth spectral scan is obtained. N and the average ΔSRD of the spectral reflectance data N ; Calculation of predicted heavy metal concentration ΔPHC N The concentration difference between the predicted heavy metal concentration value PHC1 in the heavy metal concentration prediction data chain corresponding to the completion of the first spectrum scan; Calculate the average ΔSRD of the spectral reflectance data N The average value of the spectral reflectance data in the heavy metal concentration prediction data chain corresponding to the completion of the first spectral scan The reflectivity difference between The concentration difference threshold and the reflectivity difference threshold are preset. If the concentration difference is less than the concentration difference threshold, and the reflectivity difference is less than the reflectivity difference threshold, it is determined that the detection process has good stability and the set wavelength range and wavelength points are valid; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectivity difference is greater than or equal to the reflectivity difference threshold, it is determined that the detection process has poor stability and the set wavelength range and wavelength points are invalid. The wavelength range and wavelength points are adjusted for calibration and the heavy metal concentration prediction data chain is iteratively updated again.
6. A near-infrared spectrum calibration processing system based on heavy metal non-destructive testing, which executes the near-infrared spectrum calibration processing method based on heavy metal non-destructive testing as described in any one of claims 1 to 5, characterized in that: The system comprises: a matrix construction and data acquisition module, a data link construction module, a data link iteration update module and a difference calculation and analysis processing module; The matrix construction and data acquisition module: uses a near-infrared spectroscopy device to obtain spectral reflectance data and constructs a spectral reflectance data matrix; based on the spectral reflectance data matrix, obtains a predicted value of heavy metal concentration; The data chain construction module is used to construct a heavy metal concentration prediction data chain based on the heavy metal concentration prediction value; The data link iterative update module is used to obtain the heavy metal concentration prediction value node and the spectral reflectance data interval node in the heavy metal concentration prediction data link, and perform iterative updates based on the number of spectral scans; The difference calculation and analysis processing module: when the iteration is completed, the heavy metal concentration prediction value and the average value of the spectral reflectance data in the heavy metal concentration prediction data chain corresponding to the completion of the last spectral scan are obtained, and the concentration difference and the reflectance difference are calculated; the difference threshold is preset, and the analysis and calibration processing are performed.
7. The near-infrared spectrum calibration processing system based on heavy metal nondestructive testing according to claim 6 is characterized in that: The matrix construction and data acquisition module includes a matrix construction unit and a data acquisition unit; The matrix construction unit: performs spectral scanning on the test sample by using a near-infrared spectral device, wherein one scan covers the entire wavelength range set by the near-infrared spectral device, and a total of M wavelength points are preset in the wavelength range, wherein the wavelength points are preset before scanning, and one wavelength point corresponds to one spectral reflectance data; constructs a spectral reflectance data matrix based on the spectral reflectance data; The data acquisition unit: based on the target heavy metal element, matches the standard spectrum template through the SAM algorithm to lock the wavelength range corresponding to the target heavy metal element; extracts the spectral reflectance data corresponding to all wavelength points in the wavelength range corresponding to the target heavy metal element from the spectral reflectance data matrix; based on the correction model, inputs the spectral reflectance data into the correction model to obtain the predicted value of heavy metal concentration.
8. The near-infrared spectrum calibration processing system based on heavy metal nondestructive testing according to claim 7 is characterized in that: The data link construction module includes a data link construction unit; The data chain construction unit: constructs a heavy metal concentration prediction data chain based on the heavy metal concentration prediction value, specifically as follows: setting a heavy metal concentration prediction data chain node, the heavy metal concentration prediction data chain node includes a heavy metal concentration prediction value node, a wavelength point interval node and a spectral reflectance data interval node, the wavelength point interval node corresponds to all wavelength points in the wavelength interval corresponding to the target heavy metal element, and the spectral reflectance data interval node corresponds to the average value of all spectral reflectance data corresponding to all wavelength points in the wavelength point interval node; the heavy metal concentration prediction value node, the wavelength point interval node and the spectral reflectance data interval node are sequentially connected to construct a heavy metal concentration prediction data chain, and one spectral scan constructs a heavy metal concentration prediction data chain.
9. The near-infrared spectrum calibration processing system based on heavy metal nondestructive testing according to claim 8, characterized in that: The data link iterative update module includes a heavy metal concentration prediction value update unit and a spectral reflectance data update unit; The heavy metal concentration prediction value updating unit is used to merge the heavy metal concentration prediction value node in the heavy metal concentration prediction data chain with the heavy metal concentration prediction value node in the heavy metal concentration prediction data chain constructed when the last spectrum scan is completed; The spectral reflectance data updating unit: merges the spectral reflectance data interval nodes in the heavy metal concentration prediction data chain with the spectral reflectance data interval nodes in the heavy metal concentration prediction data chain constructed when the last spectral scan is completed; uses the merged heavy metal concentration prediction value nodes and the merged spectral reflectance data interval nodes as nodes in the updated new heavy metal concentration prediction data chain, and uses the updated new heavy metal concentration prediction data chain as the heavy metal concentration prediction data chain corresponding to the current spectral scan is completed.
10. The near-infrared spectrum calibration processing system based on heavy metal nondestructive testing according to claim 9 is characterized in that: The difference calculation and analysis processing module includes a difference calculation unit and an analysis processing unit; The difference calculation unit is used to calculate the concentration difference between the predicted heavy metal concentration value and the predicted heavy metal concentration value in the heavy metal concentration prediction data chain corresponding to the completion of the first spectrum scan; Calculate the reflectivity difference between the average value of the spectral reflectivity data and the average value of the spectral reflectivity data in the heavy metal concentration prediction data chain corresponding to the completion of the first spectral scan; The analysis and processing unit: presets a concentration difference threshold and a reflectivity difference threshold. If the concentration difference is less than the concentration difference threshold, and the reflectivity difference is less than the reflectivity difference threshold, it is determined that the stability of the detection process is good, and the set wavelength range and wavelength point are valid; if the concentration difference is greater than or equal to the concentration difference threshold or the reflectivity difference is greater than or equal to the reflectivity difference threshold, it is determined that the stability of the detection process is not good, and the set wavelength range and wavelength point are invalid, the wavelength range and wavelength point are adjusted for calibration, and the heavy metal concentration prediction data chain is iteratively updated again.