Full-spectrum water quality analysis system and method based on SSGP-MLP synergistic interaction
By adopting SSGP-MLP synergistic efficiency technology in the full spectrum water quality analysis system, the problems of low accuracy in water quality prediction and high cost and high pollution in the existing technology are solved, and efficient and accurate water quality monitoring and prediction are achieved.
Patent Information
- Application Number
- CN202510431525.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art performs poorly in terms of water quality prediction accuracy, and traditional chemical monitoring has problems such as high costs, pollution risk and inability to reflect water quality changes in real time.
The full-spectral water quality analysis system based on SSGP-MLP synergistic efficiency is adopted to predict the concentration of water quality index through full-spectral data acquisition, pretreatment of SSGP framework and multi-layer perceptron algorithm.
It improves the accuracy and generalization ability of water quality prediction, reduces monitoring costs and pollution risks, and realizes real-time water quality monitoring and high-frequency data collection.
Smart Images

Figure CN119935930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water environment monitoring, and in particular to a full-spectrum water quality analysis system and method based on SSGP-MLP synergy enhancement. Background Art
[0002] Although remarkable achievements have been made in water pollution control in recent years and the quality of surface water ecological environment has been significantly improved, it cannot be ignored that water ecological environment protection still faces many severe challenges. As an important part of water resources, the water quality of surface water is directly related to the stability of the ecosystem. Online monitoring of surface water quality, as a key link in water environment management and pollution control, provides an indispensable data basis for relevant decision-making and plays a vital role in continuously improving the quality of water environment.
[0003] Traditional online surface water quality monitoring technology mainly relies on chemical methods and strictly follows the laboratory water quality standard testing process. Although this method can ensure high detection accuracy, its disadvantages are also very obvious. The use of a large number of chemical reagents not only increases the monitoring cost, but may also cause secondary pollution to the water environment during operation; a single test takes a long time and cannot reflect the dynamic changes of water quality in a timely manner; the equipment maintenance cycle is short, and frequent maintenance work further increases the application cost, making it difficult to meet actual monitoring needs.
[0004] In view of this, full-spectrum online water quality monitoring technology based on UV-Vis spectroscopy came into being. With outstanding advantages such as zero reagents, real-time monitoring, and low-frequency maintenance, this technology provides a green, low-cost and high-frequency solution for online surface water quality monitoring, and has attracted more and more attention. However, the technology is still in its infancy and trial stage, and its performance in water quality prediction accuracy is poor, which seriously restricts its large-scale promotion and application.
[0005] At the same time, despite its many shortcomings, the online surface water quality monitoring technology based on chemical methods still occupies a dominant position in the current market due to its long-term accumulated technical experience and market inertia. However, from a long-term development perspective, its technical principles determine that this method is difficult to meet the requirements of the era of low-carbon environmental protection, economic efficiency, and cannot adapt to the trend of sustainable development.
[0006] In summary, in order to break through the limitations of the prior art, the present invention proposes a system and method for full-spectrum water quality analysis based on SSGP-MLP synergistic enhancement. Summary of the invention
[0007] The purpose of the present invention is to provide a full-spectrum water quality analysis system and method based on SSGP-MLP synergy to solve the above technical problems.
[0008] The purpose of the present invention can be achieved through the following technical solutions:
[0009] A full-spectrum water quality analysis system based on SSGP-MLP synergy enhancement, comprising:
[0010] Monitoring module, multiple important control points are set up at the natural water body to be tested, and each control point is equipped with full-spectrum water quality online monitoring equipment;
[0011] The full spectrum data acquisition module is used to receive the full spectrum light intensity data of surface water uploaded in real time by the full spectrum water quality online monitoring equipment; the full spectrum light intensity data of surface water and pure water are matched one by one according to the generation time; the full spectrum absorbance of surface water is calculated according to the full spectrum light intensity data of surface water and pure water; the normal full spectrum light intensity data of pure water and surface water and the full spectrum absorbance data of surface water are saved in the database;
[0012] Full spectrum preprocessing module: The full spectrum absorbance data of surface water is preprocessed through the SSGP framework, including using the Savitzky-Golay filtering algorithm to remove noise, performing cross-wavelength normalization on the spectrum after noise removal, quantifying the relationship between absorbance and water quality index concentration through the grey correlation analysis method and retaining the absorbance at the wavelength with high correlation to obtain the full spectrum with high correlation to water quality, and then reducing the dimension of the full spectrum with high correlation to water quality with the help of the principal component analysis method;
[0013] Water quality intelligent analysis module: using the full-spectrum surface water quality analysis model to predict the concentration of water quality indicators based on the pre-processed full-spectrum absorbance data of surface water;
[0014] The full-spectrum surface water quality analysis model is composed of multiple sub-models based on the multi-layer perceptron algorithm. The full-spectrum surface water quality analysis sub-model is a neural network including an input layer, two hidden layers and an output layer, and uses the ReLU function as an activation function.
[0015] As a further technical solution, the number of input layer neurons in the full-spectrum surface water quality analysis sub-model is set according to the scale of the full-spectrum absorbance data after preprocessing, the number of output layer neurons is 1, the number of neurons in the first hidden layer is 16, and the number of neurons in the second hidden layer is 8.
[0016] As a further technical solution, the training process of the full-spectrum surface water quality analysis model includes:
[0017] Using the full-spectrum absorbance data of surface water and the corresponding concentration data of water quality indicators, the weight and bias parameters of the neural network were adjusted based on the back-propagation algorithm and Adam optimizer with the mean square error as the loss function, and the result was obtained after 300 rounds of iterative training.
[0018] As a further technical solution, the calculation formula for the full spectrum absorbance of surface water is: ;
[0019] in, Indicates the wavelength of the surface water sample The absorbance at Represents the wavelength passing through the surface water sample The light intensity at Represents the wavelength passing through the pure water sample The light intensity at the place.
[0020] As a further technical solution, the specific steps of the grey relational analysis are as follows:
[0021] S1. Arrange the surface water sample data in ascending order according to the concentration of surface water quality indicators; take the concentration of water quality indicators as the reference sequence, denoted as ; The full spectrum of filtered surface water is The absorbance at the wavelength is used as the comparison sequence and recorded as ;in, represents the surface water sample volume, The number of wavelengths representing the full spectrum of surface water;
[0022] S2. Standardize the concentration sequence of water quality indicators and the absorbance sequence of the filtered surface water full spectrum at all wavelengths: ;in ;
[0023] S3. Calculate the The grey correlation coefficient between the water quality index concentration of a surface water sample and the absorbance of the filtered surface water full spectrum at the i-th wavelength is:
[0024] ;in, is the resolution coefficient, and ;
[0025] S4. Calculate the grey correlation between the water quality index concentration of surface water and the absorbance of the filtered full spectrum at the i-th wavelength: .
[0026] As a further technical solution, the specific steps of the principal component analysis are as follows:
[0027] S1. Record the water quality high-correlation full-spectrum data of all surface water samples as a matrix , data centering by column: , ;
[0028] S2. Perform singular value decomposition on the water quality high-correlation full-spectrum data matrix of all surface water samples after centralization: ;
[0029] in, represents singular values, , Represented by the left singular vector The matrix composed of Indicates left singular vectors, Represented by the right singular vector The matrix composed of Indicates The transpose of the right singular vectors, , is a matrix rank;
[0030] Pick Right front The term can obtain the approximate value of X to achieve dimensionality reduction. .
[0031] As a further technical solution, the construction process of the full-spectrum surface water quality analysis sub-model is as follows:
[0032] S1. Forward propagation: A 4-layer neural network, Layer Total neuron, then for the Layer The linear value of neurons , the expression is:
[0033] ;
[0034] in, For the Tier The activation value of a neuron, The input layer The value of a neuron; For the Layer Neuron to Tier The linear coefficient of the neuron; Layer The activation value of a neuron , the calculation formula is: ;in, is the activation function, For the Tier The linear value of each neuron;
[0035] S2, the loss function is: ;
[0036] in, is the predicted concentration of water quality indicators for surface water samples, is the true value of the water quality index concentration of the surface water sample;
[0037] S3. Backward propagation: The loss function is used for the Layer The linear value of neurons The partial derivative of is:
[0038] ; in, is the total number of layers in the neural network, For the The number of neurons in the layer, To connect Layer neurons and Layer The weight of a neuron, is the loss function for Layer The partial derivative of the linear value of the neuron, is the activation function exist The derivative at ; Loss function vs. parameter The partial derivative of That is, the gradient, calculated as ; is the loss function for Layer The linear value of neurons The partial derivative of For the Layer The activation value of a neuron;
[0039] S4, parameter update: record the current gradient as , the first-order square moment and the second-order moment are respectively and , the expression is:
[0040] ; ;in, ;
[0041] The parameter update rule is: ;in, is the initial learning rate, , , , For the The weight parameters of the neural network during the training iteration
[0042] As a further technical solution, the process of determining whether the collected data is normal data is as follows:
[0043] When the calculated absorbance or ,in If it is the theoretical maximum absorbance, the corresponding light intensity data and absorbance data are judged to be abnormal and are eliminated;
[0044] like and ,in , is the surface water light intensity at different times, , If it is the absorbance at the corresponding moment, the data is considered abnormal and will be eliminated.
[0045] A full-spectrum water quality analysis method based on SSGP-MLP synergy enhancement comprises the following steps:
[0046] S100, collecting, processing and saving full spectrum light intensity data and absorbance data of surface water through a full spectrum data collection module;
[0047] The full spectrum preprocessing module is used to preprocess the full spectrum absorbance data of surface water;
[0048] S300, using the full spectrum surface water quality analysis model in the water quality intelligent analysis module to predict the concentration of water quality indicators.
[0049] Beneficial effects of the present invention:
[0050] (1) By correctly matching the full-spectrum light intensity data of pure water and surface water, the accurate calculation of the full-spectrum absorbance of surface water is ensured; by monitoring the equipment operation status and cleaning the full-spectrum light intensity data of surface water, the misjudgment of water quality caused by the failure of the full-spectrum water quality online monitoring equipment is avoided;
[0051] (2) The full-spectrum absorbance data of surface water are preprocessed through the SSGP framework. On the one hand, the reliability, standardization and high information value of the full-spectrum absorbance data of surface water are guaranteed. On the other hand, the structure and training complexity of the surface water quality prediction model trained by the full-spectrum absorbance data of surface water are reduced, while its prediction accuracy and generalization ability are improved.
[0052] (3) Based on the MLP algorithm, a double hidden layer neural network structure with 16+8 neurons was used to construct a full-spectrum surface water quality analysis model. This not only ensured the model's ability to recognize patterns between the full spectrum of surface water and the concentration of water quality indicators, but also prevented the surge in training data demand and the risk of overfitting caused by the overly complex model structure, thereby saving the cost of training data collection and improving the accuracy of surface water quality prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention will be further described below in conjunction with the accompanying drawings.
[0054] Figure 1 This is a structural diagram of the full-spectrum surface water quality analysis sub-model in the present invention;
[0055] Figure 2 It is a system structure block diagram of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] See also Figure 1-Figure 2 As shown, the present invention is a full-spectrum water quality analysis system based on SSGP-MLP synergy, comprising:
[0058] Monitoring module, multiple important control points are set up at the natural water body to be tested, and each control point is equipped with full-spectrum water quality online monitoring equipment;
[0059] The full spectrum data acquisition module is used to receive the full spectrum light intensity data of surface water uploaded in real time by the full spectrum water quality online monitoring equipment; the full spectrum light intensity data of surface water and pure water are matched one by one according to the generation time; the full spectrum absorbance of surface water is calculated according to the full spectrum light intensity data of surface water and pure water; the normal full spectrum light intensity data of pure water and surface water and the full spectrum absorbance data of surface water are saved in the database;
[0060] Full spectrum preprocessing module: The full spectrum absorbance data of surface water is preprocessed through the SSGP framework, including using the Savitzky-Golay filtering algorithm to remove noise, performing cross-wavelength normalization on the spectrum after noise removal, quantifying the relationship between absorbance and water quality index concentration through the grey correlation analysis method and retaining the absorbance at the wavelength with high correlation to obtain the full spectrum with high correlation to water quality, and then reducing the dimension of the full spectrum with high correlation to water quality with the help of the principal component analysis method;
[0061] Water quality intelligent analysis module: using the full-spectrum surface water quality analysis model to predict the concentration of water quality indicators based on the pre-processed full-spectrum absorbance data of surface water;
[0062] The full-spectrum surface water quality analysis model is composed of multiple sub-models based on the multi-layer perceptron algorithm. The full-spectrum surface water quality analysis sub-model is a neural network including an input layer, two hidden layers and an output layer, and uses the ReLU function as an activation function.
[0063] In this embodiment, a plurality of control points and monitoring equipment are set in the natural water body to be detected through the monitoring module to realize the monitoring of water bodies in different areas; the full-spectrum data acquisition module receives the light intensity data, corresponds to the surface water and pure water light intensity data, calculates the absorbance and saves it, so as to provide an accurate data basis for subsequent analysis; the full-spectrum preprocessing module uses the SSGP framework to organically combine the characteristics and advantages of the four methods of SG filter, SNV, GRA and PCA to perform in-depth processing on the full-spectrum absorbance data of surface water, thereby ensuring the reliability, standardization and high value of information of the full-spectrum absorbance data of surface water, and uses a variety of algorithms to process the absorbance data to improve the data quality; the water quality intelligent analysis module adopts a model based on the MLP algorithm to predict the concentration of water quality indicators, and improves the automation and intelligence level of water quality monitoring by integrating multiple modules to work together, which is more efficient and accurate than traditional monitoring methods.
[0064] The number of input layer neurons in the full-spectrum surface water quality analysis sub-model is set according to the scale of the full-spectrum absorbance data after preprocessing, the number of output layer neurons is 1, the number of neurons in the first hidden layer is 16, and the number of neurons in the second hidden layer is 8.
[0065] In this embodiment, through the above-mentioned neuron setting, the model can adaptively adjust the input according to the characteristics of the data. Based on the MLP algorithm, a full-spectrum surface water quality analysis model with a double hidden layer neural network structure of 16+8 neurons is constructed. This not only ensures the model's pattern recognition ability between the full spectrum of surface water and the concentration of water quality indicators, but also prevents the surge in training data demand and the risk of overfitting caused by the overly complex model structure, thereby saving the cost of training data collection and improving the accuracy of surface water quality prediction.
[0066] The training process of the full-spectrum surface water quality analysis model includes:
[0067] Using the full-spectrum absorbance data of surface water and the corresponding water quality index concentration data, the mean square error is used as the loss function, and the weight and bias parameters of the neural network are adjusted based on the back propagation algorithm and the Adam optimizer, and obtained after 300 rounds of iterative training. Through the above technical solution, the model can continuously learn data features and optimize parameters, making the model more accurate in predicting water quality index concentrations, improving the generalization ability of the model, and adapting to water quality monitoring needs in different water environments.
[0068] As a further technical solution, the calculation formula for the full spectrum absorbance of surface water is: ;
[0069] in, Indicates the wavelength of the surface water sample The absorbance at Represents the wavelength passing through the surface water sample The light intensity at Represents the wavelength passing through the pure water sample The light intensity at the place.
[0070] In this embodiment, the formula Based on the Lambert-Beer theorem, it ensures the scientificity and accuracy of absorbance calculation, provides a reliable data basis for subsequent water quality analysis, and is the key calculation link in the entire water quality analysis.
[0071] The specific steps of the grey relational analysis are as follows:
[0072] S1. Arrange the surface water sample data in ascending order according to the concentration of surface water quality indicators; take the concentration of water quality indicators as the reference sequence, denoted as ; The full spectrum of filtered surface water is The absorbance at the wavelength is used as the comparison sequence and recorded as ;in, represents the surface water sample volume, Represents the number of wavelengths of the full spectrum of surface water; clarifies the data sequence used in the analysis in preparation for subsequent calculations.
[0073] S2. Standardize the concentration sequence of water quality indicators and the absorbance sequence of the filtered surface water full spectrum at all wavelengths: ;in, ; Through standardization, the impact of different data dimensions is eliminated, making different sequence data comparable.
[0074] S3. Calculate the The grey correlation coefficient between the water quality index concentration of a surface water sample and the absorbance of the filtered surface water full spectrum at the i-th wavelength is:
[0075] ;in, is the resolution coefficient, and ; The grey correlation coefficient reflects the degree of correlation between two sequences at a certain moment.
[0076] S4. Calculate the grey correlation between the water quality index concentration of surface water and the absorbance of the filtered full spectrum at the i-th wavelength: The grey correlation degree comprehensively reflects the overall correlation degree of the two sequences; by comparing the grey correlation degrees at different wavelengths, the absorbance at the wavelength with higher grey correlation degree is retained, thereby obtaining the full spectrum of water quality with high correlation, and retaining the absorbance at the wavelength with high correlation degree.
[0077] In this embodiment, through the above steps, the relationship between absorbance and water quality index concentration can be accurately quantified, the absorbance at highly correlated wavelengths can be retained, and the full spectrum of highly correlated water quality can be obtained, providing more valuable data for subsequent principal component analysis and model prediction, improving the pertinence and effectiveness of the data, and enhancing the accuracy of the model in predicting water quality.
[0078] The specific steps of the principal component analysis are as follows:
[0079] S1. Record the water quality high-correlation full-spectrum data of all surface water samples as a matrix , data centering by column: , ; In the original water quality high correlation full spectrum data, each variable may have a different mean. The purpose of data centering is to adjust the mean of each variable to 0. By subtracting the mean of each variable, the data is distributed around the origin;
[0080] This step can eliminate data offset, making subsequent operations such as singular value decomposition more stable and accurate. When performing principal component analysis, the mean of the data will affect the calculation of the covariance matrix. If it is not centered, the calculation result of the covariance matrix will be disturbed by the mean, thereby affecting the extraction of principal components. After centering, the covariance matrix can more accurately reflect the correlation between variables, which helps to extract more meaningful principal components.
[0081] S2. Perform singular value decomposition on the water quality high-correlation full-spectrum data matrix of all surface water samples after centralization: ;
[0082] In the context of principal component analysis, singular value decomposition can help find the principal components of the data; singular values The elements in are arranged in descending order. Each singular value corresponds to the importance measure of a principal component. A larger singular value indicates that the corresponding principal component contains more data variance, that is, more information.
[0083] Through singular value decomposition, we can clearly understand the degree of change of data in different directions, so as to determine in which directions the data changes most significantly, and these directions are the main components to be found. For example, in water quality spectrum data, singular value decomposition can find out which wavelength combination has the greatest impact on water quality under the change of absorbance;
[0084] in, represents singular values, , Represented by the left singular vector The matrix composed of Indicates left singular vectors, Represented by the right singular vector The matrix composed of Indicates The transpose of the right singular vectors, , is a matrix rank;
[0085] Pick Right front The term can obtain the approximate value of X to achieve dimensionality reduction. In the results of singular value decomposition, usually only the first few singular values and their corresponding singular vectors contain the main information of the data, while the information corresponding to the following singular values is often noise or redundant information; therefore, the first few singular values and their corresponding singular vectors contain the main information of the data, while the information corresponding to the following singular values is often noise or redundant information. The term can achieve data dimensionality reduction, thereby reducing the data dimension, reducing the amount of calculation and storage requirements. In water quality analysis, the original full spectrum data may contain a large amount of wavelength information, which may be highly correlated, resulting in data redundancy. The principal component reduces the dimension of the data from the original high dimension to dimension;
[0086] At the same time, dimensionality reduction can also reduce the impact of noise and improve the generalization ability of the model. Because in low-dimensional space, the distribution of data is simpler, and the model is more likely to learn the essential characteristics of the data, thereby improving the accuracy and efficiency of water quality index prediction. For example, reducing the spectral data of hundreds of wavelengths to a dozen principal components not only retains key information, but also simplifies the subsequent analysis process.
[0087] In this embodiment, by data centering and singular value decomposition, the decomposition result is taken The item realizes dimensionality reduction, thereby effectively eliminating redundant information in the high-correlation full spectrum of water quality, reducing data dimensions, reducing the amount of calculation, and improving data processing efficiency. At the same time, it retains key information and improves the operating efficiency and prediction performance of subsequent models.
[0088] The construction process of the full-spectrum surface water quality analysis sub-model is as follows:
[0089] S1. Forward propagation: A 4-layer neural network, Layer Total neuron, then for the Layer The linear value of neurons , the expression is: ;
[0090] in, For the Tier The activation value of a neuron, The input layer The value of a neuron; For the Layer Neuron to Tier The linear coefficient of the neuron; Layer The activation value of a neuron , the calculation formula is: ;in, is the activation function, For the Tier The linear value of each neuron;
[0091] S2, the loss function is: ;
[0092] in, is the predicted concentration of water quality indicators for surface water samples, is the true value of the water quality index concentration of the surface water sample;
[0093] S3. Backward propagation: The loss function is used for the Layer The linear value of neurons The partial derivative of is:
[0094] ;
[0095] in, is the total number of layers in the neural network, For the The number of neurons in the layer, To connect Layer neurons and Layer The weight of a neuron, is the loss function for Layer The partial derivative of the linear value of the neuron, is the activation function exist The derivative at ; Loss function vs. parameter The partial derivative of That is, the gradient, calculated as ; is the loss function for Layer The linear value of neurons The partial derivative of For the Layer The activation value of a neuron;
[0096] S4, parameter update: record the current gradient as , the first-order square moment and the second-order moment are respectively and , the expression is:
[0097] ; ;in, ;
[0098] The parameter update rule is: ;in, is the initial learning rate, , , , For the The weight parameters in the neural network during the training iteration.
[0099] In this embodiment, the model construction principle and optimization process are explained through forward propagation, loss function calculation, backward propagation and parameter updating steps, so that the model can continuously adjust its own parameters according to the input data, improve the accuracy and reliability of the prediction of water quality index concentration, and is the core technical process for achieving high-precision water quality prediction.
[0100] The process of judging whether the collected data is normal data is as follows:
[0101] When the calculated absorbance or ,in If it is the theoretical maximum absorbance, the corresponding light intensity data and absorbance data are judged to be abnormal and shall be eliminated; absorbance is an indicator to measure the degree of absorption of light when passing through a solution, and its value should theoretically be within a certain reasonable range; under normal circumstances, the absorbance will not be less than 0, because this means that the intensity of light increases after passing through the sample, which does not conform to the physical law of light absorption; at the same time, the absorbance will not exceed the theoretical maximum absorbance, which is determined by the light absorption characteristics of the substance and the detection range of the instrument.
[0102] If the absorbance is less than 0 or greater than the theoretical maximum value, it indicates that there may be serious errors in the measurement process, such as instrument failure, sample contamination, or abnormal measurement environment. Timely elimination of such abnormal data can avoid misleading subsequent water quality analysis and ensure the reliability of the data. In actual monitoring, if the calculated absorbance value at a certain wavelength is negative, it may be due to a detector failure that causes an error in the light intensity measurement. If it is not eliminated, the prediction of water quality indicators based on the data will be biased.
[0103] like and ,in , is the surface water light intensity at different times, , If the light intensity is greater than 1, the absorbance at the corresponding moment is less than 1, the data is considered abnormal and is eliminated. According to the Lambert-Beer law, when other conditions remain unchanged, there is a specific negative correlation between the light intensity and the absorbance of surface water; when the light intensity increases, the absorbance should decrease accordingly, and the amplitude of the change should conform to a certain rule; if the light intensity ratio is greater than 1, that is, the light intensity at the next moment is significantly enhanced, but the absorbance difference is less than 1, and the amplitude of the change does not meet expectations, it means that the internal logical relationship between light intensity and absorbance is abnormal; it may be due to abnormal changes in water composition, interference in the measurement process, or problems with the instrument; eliminating such abnormal data can ensure the rationality of the logical relationship between data and improve the accuracy of water quality analysis results. For example, under normal circumstances, as the concentration of pollutants in the water increases, the light intensity will weaken and the absorbance should increase; if the light intensity is enhanced but the absorbance does not change much, it may be that there are special interference factors in the monitoring area. At this time, the data is unreliable and needs to be eliminated.
[0104] In this embodiment, the above-mentioned judgment method can effectively identify and remove abnormal data, ensure data quality, avoid interference of abnormal data on water quality analysis results, and improve the reliability and accuracy of water quality monitoring results.
[0105] A full-spectrum water quality analysis method based on SSGP-MLP synergy enhancement comprises the following steps:
[0106] S100, collecting, processing and saving full spectrum light intensity data and absorbance data of surface water through a full spectrum data collection module;
[0107] The full spectrum preprocessing module is used to preprocess the full spectrum absorbance data of surface water;
[0108] S300, using the full spectrum surface water quality analysis model in the water quality intelligent analysis module to predict the concentration of water quality indicators.
[0109] It should be noted that the calculation formulas and various parameters involved in the calculation in the present invention have been dimensionally processed in advance, and the process of dimensionless processing is well known in the industry and will not be described here.
[0110] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A full-spectrum water quality analysis system based on SSGP-MLP synergy enhancement, characterized in that: include: Monitoring module, multiple important control points are set up at the natural water body to be tested, and each control point is equipped with full-spectrum water quality online monitoring equipment; Full spectrum data acquisition module, used to receive full spectrum light intensity data of surface water uploaded in real time by full spectrum water quality online monitoring equipment; According to the generation time, the full spectrum light intensity data of surface water and pure water are matched one by one; the full spectrum absorbance of surface water is calculated according to the full spectrum light intensity data of surface water and pure water; the normal full spectrum light intensity data of pure water and surface water, and the full spectrum absorbance data of surface water are saved in the database; Full spectrum preprocessing module: The full spectrum absorbance data of surface water is preprocessed through the SSGP framework, including using the Savitzky-Golay filtering algorithm to remove noise, performing cross-wavelength normalization on the spectrum after noise removal, quantifying the relationship between absorbance and water quality index concentration through the grey correlation analysis method and retaining the absorbance at the wavelength with high correlation to obtain the full spectrum with high correlation to water quality, and then reducing the dimension of the full spectrum with high correlation to water quality with the help of the principal component analysis method; Water quality intelligent analysis module: using the full-spectrum surface water quality analysis model to predict the concentration of water quality indicators based on the pre-processed full-spectrum absorbance data of surface water; The full-spectrum surface water quality analysis model is composed of multiple sub-models based on the multi-layer perceptron algorithm. The full-spectrum surface water quality analysis sub-model is a neural network including an input layer, two hidden layers and an output layer, and uses the ReLU function as an activation function.
2. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 1 is characterized in that: The number of input layer neurons in the full-spectrum surface water quality analysis sub-model is set according to the scale of the full-spectrum absorbance data after preprocessing, the number of output layer neurons is 1, the number of neurons in the first hidden layer is 16, and the number of neurons in the second hidden layer is 8.
3. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 2 is characterized in that: The training process of the full-spectrum surface water quality analysis model includes: Using the full-spectrum absorbance data of surface water and the corresponding water quality index concentration data, the mean square error was used as the loss function, and the weights and bias parameters of the neural network were adjusted based on the back propagation algorithm and Adam optimizer, and obtained through multiple rounds of iterative training.
4. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 3 is characterized in that: The calculation formula of the full spectrum absorbance of surface water is: ; in, Indicates the wavelength of the surface water sample The absorbance at Represents the wavelength passing through the surface water sample The light intensity at Represents the wavelength passing through the pure water sample The light intensity at the place.
5. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 4 is characterized in that: The specific steps of the grey relational analysis are as follows: S1. Arrange the surface water sample data in ascending order according to the concentration of surface water quality indicators; take the concentration of water quality indicators as the reference sequence, denoted as ; The full spectrum of filtered surface water is The absorbance at the wavelength is used as the comparison sequence and recorded as ;in, represents the surface water sample volume, The number of wavelengths representing the full spectrum of surface water; S2. Standardize the concentration sequence of water quality indicators and the absorbance sequence of the filtered surface water full spectrum at all wavelengths: ;in, , , ; S3. Calculate the The grey correlation coefficient between the water quality index concentration of a surface water sample and the absorbance of the filtered surface water full spectrum at the i-th wavelength is: ;in, is the resolution coefficient, and ; S4. Calculate the grey correlation between the water quality index concentration of surface water and the absorbance of the filtered full spectrum at the i-th wavelength: .
6. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 4 is characterized in that: The specific steps of the principal component analysis are as follows: S1. Record the water quality high-correlation full-spectrum data of all surface water samples as a matrix , data centering by column: , ; S2. Perform singular value decomposition on the water quality high-correlation full-spectrum data matrix of all surface water samples after centralization: ; in, represents singular values, , Represented by the left singular vector The matrix composed of Indicates left singular vectors, Represented by the right singular vector The matrix composed of Indicates The transpose of the right singular vectors, , is a matrix rank; Pick Right front The term can obtain the approximate value of X to achieve dimensionality reduction. .
7. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 4 is characterized in that: The construction process of the full-spectrum surface water quality analysis sub-model is as follows: S1. Forward propagation: A 4-layer neural network, Layer Total neuron, then for the Layer The linear value of neurons , the expression is: ; in, For the Tier The activation value of a neuron, The input layer The value of a neuron; For the Layer Neuron to Tier The linear coefficient of the neuron; Layer The activation value of a neuron , the calculation formula is: ;in, is the activation function; For the Tier The linear value of each neuron; S2, the loss function is: ; in, is the predicted concentration of water quality indicators for surface water samples, is the actual value of the water quality index concentration of the surface water sample; S3, back propagation: loss function for the first Layer The linear value of neurons The partial derivative of is: ; in, is the total number of layers in the neural network, For the The number of neurons in the layer, To connect Layer neurons and Layer The weight of the neuron, is the loss function for Layer The partial derivative of the linear value of the neuron, is the activation function exist The derivative at ; Loss function vs. parameter The partial derivative of That is, the gradient, calculated as ; is the loss function for Layer The linear value of neurons The partial derivative of For the Layer The activation value of a neuron; S4, parameter update: record the current gradient as , the first-order square moment and the second-order moment are denoted as and , the expression is: ; ;in, ; The parameter update rule is: ;in, is the initial learning rate, , , , For the The weight parameters in the neural network during the training iteration.
8. The full-spectrum water quality analysis system based on SSGP-MLP synergy according to claim 4 is characterized in that: The process of judging whether the collected data is normal data is as follows: When the calculated absorbance or ,in If it is the theoretical maximum absorbance, the corresponding light intensity data and absorbance data are judged to be abnormal and are eliminated; like and ,in , is the surface water light intensity at different times, , If it is the absorbance at the corresponding moment, the data is considered abnormal and will be eliminated.
9. A full-spectrum water quality analysis method based on SSGP-MLP synergy, characterized in that: The method is implemented based on the full-spectrum water quality analysis system based on SSGP-MLP synergy enhancement of claim 1, and comprises the following steps: S100, collecting, processing and saving full spectrum light intensity data and absorbance data of surface water through a full spectrum data collection module; The full spectrum preprocessing module is used to preprocess the full spectrum absorbance data of surface water; S300, using the full spectrum surface water quality analysis model in the water quality intelligent analysis module to predict the concentration of water quality indicators.
Citation Information
Patent Citations
Full-spectrum water quality monitoring system and method
CN112924404A
Atmospheric particulate source analysis method and system based on single-particle aerosol mass spectrometry
CN117216659A
Intelligent sewage detection method and system for municipal construction
CN119643485A
Intelligent water source identification spectrum sensor and intelligent water source identification method
CN119688630A
Cited By
Water quality evaluation method and device, electronic equipment, storage medium and program product
CN120177387A