Water quality heavy metal real-time detection method and system based on multi-source data fusion
Through multi-source data fusion technology, combined with spectral analysis and electrochemical detection, a water quality heavy metal detection model is constructed, which solves the problem of insufficient real-time, accuracy and anti-interference ability of water quality heavy metal detection in the existing technology, and achieves rapid, accurate and efficient water quality heavy metal detection.
Patent Information
- Application Number
- CN202510121107.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing water quality heavy metal detection methods have problems such as insufficient real-time, accuracy and anti-interference ability, and it is difficult to meet the needs of large-scale real-time monitoring and efficient monitoring under complex water quality conditions.
Using a method based on multi-source data fusion, combined with spectral analysis and electrochemical detection technology, we can construct a spectral heavy metal detection model and an electrochemical heavy metal detection model, and perform multi-source data fusion to achieve rapid and accurate detection of water-quality heavy metals.
It improves the accuracy and credibility of the detection results, enhances the anti-interference ability, realizes real-time monitoring of heavy metals in water quality, and meets the needs of efficient monitoring under complex water quality conditions.
Smart Images

Figure CN120044202A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality detection, and particularly to a real-time water quality heavy metal detection method and system based on multi-source data fusion. Background Art
[0002] Traditional water quality heavy metal detection methods include atomic absorption spectrometry (AAS), inductively coupled plasma mass spectrometry (ICP-MS), and electrochemical analysis methods. Although these methods can provide highly accurate analysis results under laboratory conditions, due to the complex equipment, strong operation professionalism, and long analysis cycle, it is difficult to meet the requirements of large-scale real-time monitoring. With the progress of technology, spectral analysis technology and electrochemical sensing technology have gradually become research hotspots in the field of water quality heavy metal detection. Spectral analysis technology, due to its non-contact, fast, and non-destructive characteristics, can obtain relatively accurate detection data in a short time and is widely used in various water quality detections. Electrochemical sensing technology, on the other hand, has the advantages of high sensitivity and good selectivity and can achieve precise detection in complex water quality environments. In recent years, with the application of a number of advanced sensing technologies and algorithms, rapid detection methods based on these two technologies have shown great potential in water quality heavy metal detection.
[0003] However, there are still many deficiencies in existing water quality heavy metal detection methods. First, although traditional laboratory analysis methods have high precision, due to their complex operation and long detection cycle, it is difficult to achieve real-time monitoring of water quality heavy metals and cannot meet the increasing environmental monitoring requirements. Second, in practical applications, single spectral analysis or electrochemical detection methods are often interfered by environmental factors such as water matrix, temperature change, or pH value fluctuation, resulting in a significant reduction in the accuracy and stability of detection results and making it difficult to meet the high-efficiency monitoring requirements under complex water quality conditions. Third, most current detection systems rely on a single data source and fail to make full use of the complementary advantages of multi-source data, resulting in low information utilization efficiency. Therefore, there is still significant room for improvement in the real-time performance, accuracy, and anti-interference ability of existing methods. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is how to provide a real-time water quality heavy metal detection method based on multi-source data fusion, comprehensively utilize the advantages of spectral analysis and electrochemical detection technologies, and realize the rapid and accurate detection of water quality heavy metals by constructing a spectral heavy metal detection model and an electrochemical heavy metal detection model and combining multi-source data fusion technology.
[0006] To solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides a real-time water quality heavy metal detection method based on multi-source data fusion, which includes obtaining spectral data and electrochemical data of a water quality sample, performing feature analysis based on the spectral data, constructing a spectral heavy metal detection model, and obtaining a spectral detection result; performing feature analysis based on the electrochemical data, constructing an electrochemical heavy metal detection model, and obtaining an electrochemical detection result; and performing multi-source data fusion based on the spectral detection result and the electrochemical detection result to obtain a water quality heavy metal detection result.
[0008] As a preferred solution of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: the obtaining of the spectral data and electrochemical data of the water quality sample refers to using an ultraviolet-visible spectrometer to scan to obtain the spectral data of the water quality sample, and using a conductivity sensor and a pH sensor to obtain the electrochemical data of the water quality sample; the spectral data is absorbance spectral data; the electrochemical data includes conductivity data and pH data.
[0009] As a preferred solution of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: performing feature analysis based on the spectral data and constructing a spectral heavy metal detection model includes the following steps: performing normalization processing on the absorbance spectral data to obtain preprocessed spectral data, and the specific formula is as follows:
[0010]
[0011] wherein, X i is the preprocessed spectral data; X′ i is the absorbance spectral data; X max is the maximum value of the absorbance spectral data; X min is the minimum value of the absorbance spectral data; using high-order nonlinear regression to model the nonlinear relationship between the absorbance spectral data and the heavy metal concentration, and the specific formula is as follows:
[0012]
[0013] wherein, C′ s is the initial heavy metal concentration; N is the total number of wavelength points recorded in the preprocessed spectral data; w i is the nonlinear regression coefficient of the absorbance spectral data; introducing the second derivative feature of the absorbance spectral data to obtain the optimized heavy metal concentration, and the specific formula is as follows:
[0014]
[0015] wherein, C″ sC is the optimized heavy metal concentration; λ is the adjustment factor; the principal component analysis (PCA) is used to reduce the dimension of the preprocessed spectral data, extract the features of the spectrum and perform weighted summation to obtain the concentration estimation value after principal component analysis. The specific formula is as follows:
[0016]
[0017] Among them, C 1 is the concentration estimation value after principal component analysis; Z is the normalization factor; M is the dimension of the principal component; T j is the score of the j-th principal component extracted by principal component analysis; is the loading matrix of the j-th principal component extracted by principal component analysis; The optimized heavy metal concentration is subjected to integral transformation and combined with the concentration estimation value after principal component analysis to construct a spectral heavy metal detection model. The specific formula is as follows:
[0018]
[0019] Among them, C s is the spectral detection result; a and b are the effective wavelength ranges of the absorbance spectral data.
[0020] As a preferred solution of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: the calculation formula of the spectral heavy metal detection model is as follows:
[0021]
[0022] Among them, C s is the spectral detection result; a and b are the effective wavelength ranges of the absorbance spectral data; N is the total number of wavelength points recorded in the preprocessed spectral data; w i is the non-linear regression coefficient of the absorbance spectral data; λ is the adjustment factor; Z is the normalization factor; M is the dimension of the principal component; T j is the score of the j-th principal component extracted by principal component analysis; is the loading matrix of the j-th principal component extracted by principal component analysis.
[0023] As a preferred solution of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: the construction of the electrochemical heavy metal detection model includes the following steps: preprocessing based on the conductivity data σ and pH data pH; constructing a relationship model between the preprocessed conductivity data σ and pH data pH and the heavy metal concentration. The specific formula is as follows:
[0024] K(x i ,x)=exp(-γ 1 (σ i-σ) 2 -γ 2 (pH i -pH) 2 )
[0025] where K(x i , x) is the Gaussian kernel function; x i is the training data sample; x is the current input sample; γ 1 and γ 2 are the kernel function parameters; σ i is the conductivity value of the i-th water quality sample in the training dataset; pH i is the pH value of the i-th water quality sample in the training dataset; calculating based on the relationship model to obtain a preliminary electrochemical detection result, and the specific formula is as follows:
[0026]
[0027] where C′ e is the preliminary electrochemical detection result; n is the number of support vectors in the training dataset; α i is the contribution of the i-th support vector to the prediction result; optimizing the preliminary electrochemical detection result by introducing a regularization term to construct an electrochemical heavy metal detection model, and the specific formula of the regularization term is as follows:
[0028] R(σ, pH) = log(1 + σ·pH)
[0029] where R(σ, pH) is the regularization term.
[0030] As a preferred scheme of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: the calculation formula of the electrochemical heavy metal detection model is as follows:
[0031]
[0032] where C e is the electrochemical detection result; n is the number of support vectors in the training dataset; α i is the contribution of the i-th support vector to the prediction result; γ 1 and γ 2 are the kernel function parameters; σ i is the conductivity value of the i-th water quality sample in the training dataset; pH i is the pH value of the i-th water quality sample in the training dataset; β is the regularization coefficient; σ is the conductivity data; pH is the pH data.
[0033] As a preferred solution of the real-time water quality heavy metal detection method based on multi-source data fusion according to the present invention, wherein: the multi-source data fusion based on the spectral detection result and the electrochemical detection result includes the following steps: calculating the spectral detection result C s and the electrochemical detection result C e of the absolute value of the difference C s -C e | and making a judgment. If the absolute value of the difference between the spectral detection result C s and the electrochemical detection result C e is C s -C e | greater than the first threshold and the number of times is less than or equal to N times, it is determined as a minor anomaly, the anomaly handling mechanism is executed, the spectral detection result step and the electrochemical detection result step are re-executed, and an anomaly record is made; if the absolute value of the difference between the spectral detection result C s and the electrochemical detection result C e is |C s -C e | greater than the first threshold for more than N times and less than M times, and it is determined as a moderate anomaly, the anomaly handling mechanism is executed, the absorbance spectral data, conductivity data and pH data are re-obtained, an anomaly alarm is sent to the operation and maintenance personnel and an anomaly record is made; if the absolute value of the difference between the spectral detection result C s and the electrochemical detection result C e is |C s -C e | greater than or equal to M times, and it is determined as a serious anomaly, the anomaly handling mechanism is executed, the real-time water quality heavy metal detection is stopped, a maintenance alarm is sent to the operation and maintenance personnel and an anomaly record is made; if the absolute value of the difference between the spectral detection result C s and the electrochemical detection result C e is |C s -C e | less than or equal to the first threshold, then the spectral detection result C s and the electrochemical detection result C e are judged. If the spectral detection result C s is greater than or equal to the electrochemical detection result C e , it is determined that the water quality heavy metal detection result is equal to the spectral detection result C s ; if the spectral detection result C s is less than the electrochemical detection result C e , it is determined that the water quality heavy metal detection result is equal to the electrochemical detection result C e .
[0034] Second aspect: To further solve the safety problems existing in water quality detection, the embodiments of the present invention provide a real-time water quality heavy metal detection system based on multi-source data fusion, which includes: a spectral detection module for obtaining absorbance spectral data, conductivity data, and pH data of a water quality sample, performing feature analysis based on the absorbance spectral data, constructing a spectral heavy metal detection model, and obtaining a spectral detection result; an electrochemical detection module for performing feature analysis based on the conductivity data and pH data, constructing an electrochemical heavy metal detection model, and obtaining an electrochemical detection result; a heavy metal detection module for performing multi-source data fusion according to the spectral detection result and the electrochemical detection result to obtain a water quality heavy metal detection result.
[0035] Third aspect: The embodiments of the present invention provide a computer device, including a memory and a processor, where the memory stores a computer program, and: when the computer program is executed by the processor, any step of the real-time water quality heavy metal detection method based on multi-source data fusion as described in the first aspect of the present invention is implemented.
[0036] Fourth aspect: The embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, and: when the computer program is executed by the processor, any step of the real-time water quality heavy metal detection method based on multi-source data fusion as described in the first aspect of the present invention is implemented.
[0037] Advantages of the present invention: By simultaneously collecting spectral data and electrochemical data, the present invention realizes multi-dimensional data collection, overcomes the limitations of a single detection method. In particular, the absorbance spectral data obtained by an ultraviolet-visible spectrometer, combined with normalization processing, high-order non-linear regression, and second derivative feature analysis, not only eliminates the interference of the instrument and the environment on the spectral data, but also improves the stability and reliability of the model; by introducing principal component analysis (PCA) for dimensionality reduction processing, the main feature information of the spectrum is effectively extracted, the data redundancy is reduced, and the accuracy and anti-interference ability of spectral detection are improved; by establishing a multi-level anomaly detection and processing mechanism, intelligent judgment and anomaly processing of the detection results are realized, and corresponding processing strategies are formulated for different levels. This hierarchical processing mechanism not only improves the reliability and stability of the detection system, but also realizes the intelligent management of the detection process. At the same time, by comparing the difference between the spectral detection result and the electrochemical detection result and adopting an optimization strategy to determine the final detection result, the accuracy and credibility of the detection result are effectively improved. Description of the Drawings
[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings. Among them:
[0039] Figure 1 It is the overall flowchart of the real-time water quality heavy metal detection method based on multi-source data fusion in Embodiment 1.
[0040] Figure 2 It is the construction flowchart of the spectral heavy metal detection model in Embodiment 1.
[0041] Figure 3 It is the construction flowchart of the electrochemical heavy metal detection model in Embodiment 1.
[0042] Figure 4 It is the structural schematic diagram of the computer device in Embodiment 3. Specific Embodiments
[0043] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings of the specification.
[0044] Many specific details are set forth in the following description to facilitate a thorough understanding of the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0045] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it an independent or selectively exclusive embodiment from other embodiments.
[0046] Embodiment 1
[0047] Refer to Figures 1 to 3 , which is the first embodiment of the present invention. This embodiment provides a real-time water quality heavy metal detection method based on multi-source data fusion.
[0048] The existing water quality heavy metal detection methods mainly have the following problems: First, although the traditional laboratory analysis methods have high precision, due to their complex operation and long detection cycle, it is difficult to achieve real-time monitoring of water quality heavy metals and cannot meet the increasing environmental monitoring requirements; Second, in practical applications, single spectroscopic analysis or electrochemical detection methods are often interfered by environmental factors such as water matrix, temperature change or pH value fluctuation, resulting in a significant reduction in the accuracy and stability of the detection results and making it difficult to meet the efficient monitoring requirements under complex water quality conditions; Third, most of the current detection systems rely on a single data source and fail to make full use of the complementary advantages of multi-source data, resulting in low information utilization efficiency.
[0049] This application provides a solution that can effectively solve the above-mentioned problems. Next, multiple embodiments will be combined to elaborate in detail on how to implement the real-time water quality heavy metal detection method based on multi-source data fusion.
[0050] Figure 1 The overall flowchart of the real-time water quality heavy metal detection method based on multi-source data fusion is shown, including:
[0051] S1: Obtain the spectroscopic data and electrochemical data of the water quality sample, perform feature analysis based on the spectroscopic data, construct a spectroscopic heavy metal detection model, and obtain the spectroscopic detection result.
[0052] Preferably, obtaining the spectroscopic data and electrochemical data of the water quality sample means using an ultraviolet-visible spectrometer to scan to obtain the spectroscopic data of the water quality sample, and using a conductivity sensor and a pH sensor to obtain the electrochemical data of the water quality sample.
[0053] Specifically, the spectroscopic data is absorbance spectroscopic data.
[0054] Specifically, the electrochemical data includes conductivity data and pH data.
[0055] Preferably, as Figure 2 shown is the construction flowchart of the spectroscopic heavy metal detection model. Performing feature analysis based on the spectroscopic data and constructing the spectroscopic heavy metal detection model includes the following steps: To eliminate the influence of the instrument and environment on the spectroscopic data and improve the stability of the model, perform normalization processing on the absorbance spectroscopic data to eliminate the baseline drift and noise between different water quality samples, and obtain the preprocessed spectroscopic data. The specific formula is as follows:
[0056]
[0057] where, X i is the preprocessed spectroscopic data; X′ i is the absorbance spectroscopic data; X max is the maximum value of the absorbance spectroscopic data; Xmin is the minimum value of the absorbance spectral data.
[0058] Use high-order non-linear regression to model the non-linear relationship between absorbance spectral data and heavy metal concentration. The specific formula is as follows:
[0059]
[0060] where C′ s is the initial heavy metal concentration; N is the total number of wavelength points recorded in the pre-processed spectral data; w i is the non-linear regression coefficient of the absorbance spectral data.
[0061] To enhance the resolution ability of spectral features, introduce the second derivative feature of the absorbance spectral data to obtain the optimized heavy metal concentration and make the spectral features more prominent. The specific formula is as follows:
[0062]
[0063] where C” s is the optimized heavy metal concentration; λ is a regulation factor used to balance the weights of the regression term and the second derivative term.
[0064] Use principal component analysis (PCA) to reduce the dimension of the pre-processed spectral data, extract the main features of the spectrum and perform weighted summation to obtain the concentration estimate value after principal component analysis. The specific formula is as follows:
[0065]
[0066] where C 1 is the concentration estimate value after principal component analysis; Z is a normalization factor used to improve the consistency of the results; M is the dimension of the principal component; T j is the score of the j-th principal component extracted by principal component analysis; is the loading matrix of the j-th principal component extracted by principal component analysis.
[0067] Perform integral transformation on the optimized heavy metal concentration and combine it with the concentration estimate value after principal component analysis to construct a spectral heavy metal detection model. The specific formula is as follows:
[0068]
[0069] where C s is the spectral detection result, that is, the heavy metal concentration detected by the spectrum; a and b are the effective wavelength ranges of the absorbance spectral data.
[0070] Specifically, the calculation formula of the spectral heavy metal detection model is as follows:
[0071]
[0072] Among them, C s is the spectral detection result, that is, the heavy metal concentration obtained by spectral detection; a and b are the effective wavelength ranges of the absorbance spectral data; N is the total number of wavelength points recorded in the preprocessed spectral data; w i is the non-linear regression coefficient of the absorbance spectral data; λ is a regularization factor used to balance the weights of the regression term and the second derivative term; Z is a normalization factor used to improve the consistency of the results; M is the dimension of the principal component; T j is the score of the j-th principal component extracted by principal component analysis; is the loading matrix of the j-th principal component extracted by principal component analysis.
[0073] Preferably, by introducing the method combining second derivative features and principal component analysis, not only the resolution ability of spectral features is enhanced, but also feature dimensionality reduction is achieved, reducing the computational complexity while retaining key information; in addition, the normalization process eliminates the baseline drift between different batches of samples, improves the model stability, makes the detection results have better repeatability, and significantly improves the detection accuracy compared with the traditional single feature extraction method, solving the problem of difficult recognition caused by the overlap of spectral signals of multiple heavy metals in water quality samples.
[0074] S2: Perform feature analysis based on electrochemical data, construct an electrochemical heavy metal detection model, and obtain an electrochemical detection result.
[0075] Preferably, as Figure 3 shown in the construction flow chart of the electrochemical heavy metal detection model, constructing the electrochemical heavy metal detection model includes the following steps: preprocess based on the conductivity data σ and pH data pH to eliminate the dimension difference.
[0076] Construct a relationship model between the conductivity data and pH data and the heavy metal concentration based on the preprocessed conductivity data σ and pH data pH. The specific formula is as follows:
[0077] K(x i , x) = exp(-γ 1 (σ i - σ) 2 - γ 2 (pH i - pH) 2 )
[0078] Among them, K(x i , x) is the Gaussian kernel function, representing the relationship between the conductivity data and pH data and the heavy metal concentration; x i is the training data sample; x is the current input sample; γ 1 and γ 2is a kernel function parameter used to control the influence range of conductivity data σ and pH data pH in the Gaussian kernel function. The larger the value, the higher the sensitivity of the kernel function to conductivity differences and pH differences; σ i is the conductivity value of the i-th water quality sample in the training dataset; pH i is the pH value of the i-th water quality sample in the training dataset.
[0079] Based on the relational model, a preliminary electrochemical detection result is calculated. The specific formula is as follows:
[0080]
[0081] where, C' e is the preliminary electrochemical detection result; n is the number of support vectors in the training dataset; α i is the contribution size of the i-th support vector to the prediction result, obtained through the model training of the support vector machine SVR.
[0082] Since there is a non-linear coupling relationship between conductivity data σ and pH data pH, in order to describe the combined influence of conductivity and pH on heavy metal concentration, the preliminary electrochemical detection result is optimized by introducing a regularization term to construct an electrochemical heavy metal detection model. The specific formula of the regularization term is as follows:
[0083] R(σ, pH) = log(1 + σ·pH)
[0084] where, R(σ, pH) is the regularization term, used to represent the combined influence of conductivity and pH on heavy metal concentration.
[0085] Specifically, the calculation formula of the electrochemical heavy metal detection model is as follows:
[0086]
[0087] where, C e is the electrochemical detection result, representing the heavy metal concentration of the water quality obtained through electrochemical detection; n is the number of support vectors in the training dataset; α i is the contribution size of the i-th support vector to the prediction result, obtained through the model training of the support vector machine SVR; γ 1 and γ 2 are kernel function parameters used to control the influence range of conductivity data σ and pH data pH in the Gaussian kernel function. The larger the value, the higher the sensitivity of the kernel function to conductivity differences and pH differences; σ i is the conductivity value of the i-th water quality sample in the training dataset; pH i$pH_i$ is the pH value of the $i$-th water quality sample in the training dataset; $\beta$ is the regularization coefficient, used to control the weight of the regularization term in the overall model; $\sigma$ is the conductivity data; $pH$ is the pH data.
[0088] Preferably, for the problem of unstable conductivity measurement caused by the morphological changes of heavy metal ions in different pH environments, a Gaussian kernel function is used for modeling and a regularization term is introduced. This design not only considers the independent effects of conductivity and pH, but also describes their non-linear coupling relationship through the regularization term. In practical application scenarios with large fluctuations in pH values, it has stronger adaptability than traditional linear models and can maintain stable detection effects.
[0089] S3: Perform multi-source data fusion based on the spectral detection results and electrochemical detection results to obtain the water quality heavy metal detection results.
[0090] Preferably, performing multi-source data fusion based on the spectral detection results and electrochemical detection results includes the following steps: calculating the absolute value of the difference between the spectral detection result $C$ s and the electrochemical detection result $C$ e $|C$ s $-C$ e $|$ and making a judgment. If the absolute value of the difference between the spectral detection result $C$ s and the electrochemical detection result $C$ e $|C$ s $-C$ e $|$ is greater than the first threshold and the number of times is less than or equal to $N$ times, it is determined as a minor anomaly, the anomaly handling mechanism is executed, the spectral detection result step and the electrochemical detection result step are re-executed, and an anomaly record is made.
[0091] If the absolute value of the difference between the spectral detection result $C$ s and the electrochemical detection result $C$ e $|C$ s $-C$ e $|$ is greater than the first threshold for more than $N$ times and less than $M$ times, and it is determined as a moderate anomaly, the anomaly handling mechanism is executed, the absorbance spectral data, conductivity data, and pH data are re-obtained, an anomaly alarm is sent to the operation and maintenance personnel, and an anomaly record is made.
[0092] If the absolute value of the difference between the spectral detection result $C$ s and the electrochemical detection result $C$ e $|C$ s $-C$ e $|$ is greater than or equal to $M$ times the first threshold, and it is determined as a serious anomaly, the anomaly handling mechanism is executed, the real-time detection of water quality heavy metals is stopped, a maintenance alarm is sent to the operation and maintenance personnel, and an anomaly record is made.
[0093] If the spectral detection result $C$ sand the absolute value of the difference from the electrochemical detection result C e |C s - C e | is less than or equal to the first threshold, then the spectral detection result C s and the electrochemical detection result C e are judged. If the spectral detection result C s is greater than or equal to the electrochemical detection result C e , it is determined that the water quality heavy metal detection result is equal to the spectral detection result C s .
[0095] If the spectral detection result C s is less than the electrochemical detection result C e , it is determined that the water quality heavy metal detection result is equal to the electrochemical detection result C e .
[0096] It should be noted that for the first threshold in the above judgment, by collecting a large number of historical monitoring data, including the spectral detection results C s and the electrochemical detection results C e of standard samples with known concentrations and actual water samples, the data is divided into multiple intervals according to the heavy metal concentration level for analysis, and the difference |C s - C e | of the detection results of each group of data is calculated, its statistical distribution characteristics are analyzed, the initial threshold is set while ensuring the actual requirements, and it is optimized during the subsequent experimental process to ensure that it can maintain good detection effects under different working conditions, and finally the best first threshold is obtained.
[0097] Preferably, by designing a three - level abnormal handling mechanism and taking corresponding handling measures according to the degree of difference in detection results, it not only avoids the waste of resources caused by over - sensitivity but also ensures the reliability of the detection results. This mechanism is suitable for the actual application scenarios of water quality monitoring, reduces the maintenance cost while ensuring the detection accuracy, and provides a more perfect abnormal handling strategy compared with simple data fusion methods, solving the problem of insufficient reliability of a single detection method.
[0098] In summary, the present invention realizes multi-dimensional data acquisition by simultaneously collecting spectral data and electrochemical data, overcomes the limitations of single detection methods. In particular, the absorbance spectral data obtained by the ultraviolet-visible spectrometer, combined with normalization processing, high-order non-linear regression, and second derivative feature analysis, not only eliminates the interference of the instrument and environment on the spectral data, but also improves the stability and reliability of the model; by introducing principal component analysis (PCA) for dimensionality reduction, the main characteristic information of the spectrum is effectively extracted, the data redundancy is reduced, and the accuracy and anti-interference ability of spectral detection are improved; by establishing a multi-level anomaly detection and processing mechanism, intelligent judgment and anomaly processing of the detection results are realized, and corresponding processing strategies are formulated for different levels. This hierarchical processing mechanism not only improves the reliability and stability of the detection system, but also realizes the intelligent management of the detection process. At the same time, by comparing the difference between the spectral detection result and the electrochemical detection result, the optimal strategy is used to determine the final detection result, effectively improving the accuracy and credibility of the detection result.
[0099] Embodiment 2 is an embodiment of the present invention, which provides a real-time water quality heavy metal detection system based on multi-source data fusion, including: a spectral detection module, configured to obtain absorbance spectral data, conductivity data, and pH data of a water quality sample, perform feature analysis based on the absorbance spectral data, construct a spectral heavy metal detection model, and obtain a spectral detection result; an electrochemical detection module, configured to perform feature analysis based on the conductivity data and pH data, construct an electrochemical heavy metal detection model, and obtain an electrochemical detection result; a heavy metal detection module, configured to perform multi-source data fusion based on the spectral detection result and the electrochemical detection result to obtain a water quality heavy metal detection result.
[0100] Embodiment 3 is an embodiment of the present invention, which is different from the previous embodiment in that:
[0101] As Figure 4 shown, when the above function is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0102] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered as a definitional sequence of executable instructions for implementing logical functions, which can be embodied specifically in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. As used in this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
[0103] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0104] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0105] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A real-time detection method for heavy metals in water based on multi-source data fusion, characterized in that: include: Acquire spectral data and electrochemical data of water quality samples, perform feature analysis based on the spectral data, construct a spectral heavy metal detection model, and obtain spectral detection results; Performing feature analysis based on the electrochemical data, constructing an electrochemical heavy metal detection model, and obtaining electrochemical detection results; Multi-source data fusion is performed based on the spectral detection results and the electrochemical detection results to obtain water quality heavy metal detection results.
2. The method for real-time detection of heavy metals in water quality based on multi-source data fusion according to claim 1, characterized in that: The obtaining of the spectral data and electrochemical data of the water quality sample refers to scanning with an ultraviolet-visible spectrometer to obtain the spectral data of the water quality sample, and using a conductivity sensor and a pH sensor to obtain the electrochemical data of the water quality sample; The spectral data is absorbance spectral data; The electrochemical data includes conductivity data and pH data.
3. The method for real-time detection of heavy metals in water quality based on multi-source data fusion as claimed in claim 2, characterized in that: Based on the spectral data, feature analysis is performed to construct a spectral heavy metal detection model, which includes the following steps: Based on the absorbance spectrum data, normalization processing is performed to obtain pre-processed spectrum data. The specific formula is as follows: Among them, X i is the spectral data after preprocessing; X′ i is the absorbance spectrum data; X max is the maximum value of the absorbance spectrum data; X min is the minimum value of the absorbance spectrum data; High-order nonlinear regression is used to model the nonlinear relationship between absorbance spectral data and heavy metal concentrations. The specific formula is as follows: Among them, C′ s is the initial heavy metal concentration; N is the total number of wavelength points recorded in the preprocessed spectral data; w i is the nonlinear regression coefficient of absorbance spectrum data; The second-order derivative characteristics of the absorbance spectrum data were introduced to obtain the optimized heavy metal concentration. The specific formula is as follows: Among them, C s is the optimized heavy metal concentration; λ is the adjustment factor; The principal component analysis (PCA) is used to reduce the dimension of the preprocessed spectral data, extract the spectral features and perform weighted summation to obtain the concentration estimate after principal component analysis. The specific formula is as follows: Where C1 is the concentration estimate after principal component analysis; Z is the normalization factor; M is the dimension of the principal component; T j is the jth principal component score extracted by principal component analysis; is the loading matrix of the jth principal component extracted by principal component analysis; The optimized heavy metal concentration is integrated and combined with the concentration estimation value after principal component analysis to construct a spectral heavy metal detection model. The specific formula is as follows: Among them, C s is the spectrum detection result; a and b are the effective wavelength ranges of absorbance spectrum data.
4. The method for real-time detection of heavy metals in water quality based on multi-source data fusion as claimed in claim 3, characterized in that: The calculation formula of the spectral heavy metal detection model is as follows: Among them, C s is the spectrum detection result; a and b are the effective wavelength ranges of the absorbance spectrum data; N is the total number of wavelength points recorded in the preprocessed spectrum data; w i is the nonlinear regression coefficient of absorbance spectrum data; λ is the adjustment factor; Z is the normalization factor; M is the dimension of the principal component; T j is the jth principal component score extracted by principal component analysis; The loading matrix of the jth principal component extracted by principal component analysis.
5. The method for real-time detection of heavy metals in water quality based on multi-source data fusion as claimed in claim 4, characterized in that: The construction of the electrochemical heavy metal detection model comprises the following steps: Performing preprocessing based on the conductivity data σ and the pH data pH; Based on the pre-processed conductivity data σ and pH data pH, a relationship model between conductivity data, pH data and heavy metal concentration is constructed. The specific formula is as follows: K(x i ,x)=exp(-γ1(σ i -s) 2 -γ2(pH i -pH) 2 ) Among them, K(x i ,x) is the Gaussian kernel function; x i is the training data sample; x is the current input sample; γ1 and γ2 are the kernel function parameters; σ i is the conductivity value of the i-th water quality sample in the training data set; pH i is the pH value of the i-th water quality sample in the training data set; Based on the relationship model, the preliminary electrochemical detection results are calculated and obtained. The specific formula is as follows: Among them, C′ e is the preliminary electrochemical detection result; n is the number of support vectors in the training data set; α i is the contribution of the i-th support vector to the prediction result; The preliminary electrochemical detection results are optimized by introducing a regularization term to construct an electrochemical heavy metal detection model. The specific formula of the regularization term is as follows: R(σ,pH)=log(1+σ·pH) Among them, R(σ,pH) is the regularization term.
6. The method for real-time detection of heavy metals in water quality based on multi-source data fusion as claimed in claim 5, characterized in that: The calculation formula of the electrochemical heavy metal detection model is as follows: Among them, C e is the electrochemical detection result; n is the number of support vectors in the training data set; α i is the contribution of the ith support vector to the prediction result; γ1 and γ2 are kernel function parameters; σ i is the conductivity value of the i-th water quality sample in the training data set; pH i is the pH value of the i-th water quality sample in the training data set; β is the regularization coefficient; σ is the conductivity data; pH is the pH data.
7. The method for real-time detection of heavy metals in water quality based on multi-source data fusion according to claim 6, characterized in that: Performing multi-source data fusion according to the spectral detection result and the electrochemical detection result comprises the following steps: Calculate the spectrum detection result C s And electrochemical detection results C e The absolute value of the difference between |C s -C e | And make a judgment, if the spectrum detection result is C s And electrochemical detection results C e The absolute value of the difference between |C s -C e | If the value is greater than the first threshold and the number of times is less than or equal to N times, it is determined to be a slight abnormality, and the abnormality handling mechanism is executed, the spectral detection result step and the electrochemical detection result step are re-executed, and the abnormality is recorded; If the spectrum detection result C s And electrochemical detection results C e The absolute value of the difference between |C s -C e |The number of times greater than the first threshold is greater than N times and less than M times, and it is determined to be a moderate abnormality, the abnormality handling mechanism is executed, the absorbance spectrum data, conductivity data and pH data are re-acquired, an abnormal alarm is sent to the operation and maintenance personnel, and the abnormality is recorded; If the spectrum detection result C s And electrochemical detection results C e The absolute value of the difference between |C s -C e |The number of times greater than the first threshold is greater than or equal to M times, and it is determined to be a serious abnormality, the abnormality handling mechanism is executed, the real-time detection of heavy metals in water quality is stopped, and a maintenance alarm is sent to the operation and maintenance personnel and the abnormality is recorded; If the spectrum detection result C s And electrochemical detection results C e The absolute value of the difference between |C s -C e | is less than or equal to the first threshold, then the spectrum detection result C s And electrochemical detection results C e Make a judgment, if the spectrum detection result C s Greater than or equal to electrochemical test result C e , then the water quality heavy metal test result is equal to the spectrum test result C s ; If the spectrum detection result C s Less than the electrochemical test result C e , then the water quality heavy metal test result is equal to the electrochemical test result C e .
8. A real-time detection system for heavy metals in water quality based on multi-source data fusion, based on the real-time detection method for heavy metals in water quality based on multi-source data fusion according to any one of claims 1 to 7, characterized in that: include, The spectrum detection module is used to obtain the absorbance spectrum data, conductivity data and pH data of the water quality sample, perform feature analysis based on the absorbance spectrum data, build a spectrum heavy metal detection model, and obtain the spectrum detection results; The electrochemical detection module is used to perform feature analysis based on conductivity data and pH data, build an electrochemical heavy metal detection model, and obtain electrochemical detection results; The heavy metal detection module is used to perform multi-source data fusion based on the spectral detection results and electrochemical detection results to obtain the water quality heavy metal detection results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the real-time detection method of heavy metals in water based on multi-source data fusion according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the real-time detection method for heavy metals in water based on multi-source data fusion according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Heparin sodium detection method and system based on deep learning
CN120668747A
A deep learning-based heparin sodium detection method and system
CN120668747B
Quality inspection method and system for metal content in wet tissue based on multi-modal data fusion
CN120932767A
Method for detecting heavy metal residues in medical grade sodium hyaluronate
CN121347638A