Data processing method, device and equipment for water quality index of water body and medium
Through the combination of convolutional neural network and chemical method, the data of water body samples and distilled water are used for correction, which solves the problem of insufficient accuracy of spectral water quality detection in complex water environments, and improves the reliability and accuracy of measurement results.
Patent Information
- Application Number
- CN202411203516.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing spectral water quality detection technology has insufficient measurement accuracy in complex water environments, and conventional turbidity compensation algorithms cannot meet the needs of complex water quality detection, resulting in inaccurate measurement results.
A convolutional neural network is used to combine historical water sample measurement data and distilled water reference spectral data for training to generate a water quality index prediction model, and the spectral data is corrected by chemical measurement data to improve measurement accuracy.
Through multi-source data correction, the accuracy and reliability of spectral measurements are improved, ensuring that the measurement results are consistent with the chemical measurement results, and enhancing the credibility of water quality detection.
Smart Images

Figure CN119164891A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water quality detection, and more specifically, to a method, device, equipment and medium for data processing of water quality indicators of a water body. Background Art
[0002] Water quality detection technology based on UV-visible spectroscopy has the characteristics of fast speed, strong real-time performance, small size, low cost, no sample processing, and no secondary pollution. It has achieved high practical application value in the field of water quality detection. A large number of studies have achieved the monitoring of water quality indicators through continuous spectroscopy, combined with automation technology and the application of electronic computers. In order to further improve the accuracy and reliability of measurement results, compensation technology and the establishment of special scenarios have become research hotspots in the industry. However, compensation technology is often designed and optimized according to a certain type of water body or a specific scenario, and it is still not universal for different water environments. In addition, water quality detection not only involves the characteristics of the water body itself, but also includes the combined influence of multiple factors such as water flow, water temperature, water quality, and biological activity. The interaction between these factors makes water body detection more complicated.
[0003] Existing spectral water quality detection combined with automation technology and computer algorithms has done some research on water quality parameters in special scenarios, but the precise measurement research on a wide range of complex water bodies is still insufficient, and conventional computer algorithms such as turbidity compensation cannot meet the requirements of complex water quality detection, which leads to insufficient accuracy of spectral measurements. Summary of the invention
[0004] The purpose of the present application is to provide a data processing method, device, equipment and medium for water quality indicators of water bodies. The present application uses historical measurement data of water samples and reference spectral data of distilled water as training data of a convolutional neural network, and can obtain a water quality indicator prediction model for predicting the predicted values of water quality indicators of water bodies. On the basis of the predicted values output by this model, the predicted values are compared and analyzed in combination with the water quality indicator data obtained by chemical measurement, and the spectral data to be processed are corrected based on the results of the comparative analysis, and the spectral measurement is adjusted based on the correction results, thereby improving the accuracy of the spectral measurement.
[0005] In a first aspect of the present application, a method for processing water quality indicators of a water body is provided, the method comprising:
[0006] Acquire spectral data of water body to be processed;
[0007] Input the spectral data to be processed into a water quality index prediction model to obtain a predicted value of the water quality index; wherein the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectral data of distilled water as training data, wherein the historical measurement data includes sample spectral data of water samples and water quality index data;
[0008] The predicted values of water quality indicators are compared with the water quality indicator data of water samples, and the spectral data to be processed are corrected based on the comparison results.
[0009] In one implementation, the convolutional neural network is a ResNet neural network that introduces a residual module.
[0010] In one implementation, the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectrum data of distilled water as training data, specifically including:
[0011] Normalizing the reference spectral data and the sample spectral data respectively to obtain characteristic values of the reference spectral data and the sample spectral data, and selecting data in a wavelength range that meets the preset linear characteristics from the characteristic values of the reference spectral data and the sample spectral data as sub-training data;
[0012] The sub-training data and water quality index data are processed into the dimensions required for the convolutional neural network input, and the loss function and optimizer used for training are preset. When the convolutional neural network reaches the iteration conditions for training, the water quality index prediction model is obtained.
[0013] In one implementation, the method further includes: feeding back the corrected sample spectral data to the trained water quality index prediction model for relearning and training to adjust the weight of the water quality index prediction model.
[0014] In one implementation, the process of measuring the sample spectral data of the water sample is: quantifying the water sample once, diluting the once quantified water sample to obtain a diluted water sample, and performing spectral measurement on the diluted water sample to obtain the sample spectral data of the water sample;
[0015] The process of measuring the water quality index data of the water body sample is: performing secondary quantification on the diluted water body sample, performing chemical measurement on the secondary quantified and diluted water body sample, and obtaining the water quality index data of the water body sample;
[0016] After completing the spectral measurement and chemical measurement corresponding to each dilution operation, adjust the dilution factor of the quantitative water sample, repeat the spectral measurement and chemical measurement until the corresponding number of measurements is reached, and summarize the sample spectral data and water quality index data obtained from each spectral measurement and chemical measurement to obtain the historical measurement data of the water sample.
[0017] In one implementation, one test number corresponds to 12 dilution operations performed on a quantitative water sample;
[0018] The dilution multiples of the 12 dilution operations increase sequentially; wherein, the dilution multiples of the 12 dilution operations are 0, 2 times, 3 times, 4 times, 5 times, 6 times, 7 times, 8 times, 9 times, 12 times, 18 times, and 36 times respectively.
[0019] In one implementation, the measurement process of the reference spectral data of distilled water is: quantifying the distilled water, performing spectral measurement on the quantified distilled water, and obtaining the reference spectral data of the distilled water; wherein the measurement range for quantifying the distilled water is consistent with the measurement range for a single quantification of a water sample.
[0020] In a second aspect of the present application, a data processing device for water samples is provided, the device comprising:
[0021] A data acquisition module, used for acquiring spectral data to be processed of a water body;
[0022] A water quality index prediction module, used for inputting the spectral data to be processed into a water quality index prediction model to obtain a predicted value of the water quality index; wherein the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectral data of distilled water as training data, wherein the historical measurement data includes sample spectral data of water samples and water quality index data;
[0023] The data processing module is used to compare the predicted value of the water quality index with the water quality index data of the water sample, and to correct the spectral data to be processed based on the comparison result.
[0024] The third aspect of the present application provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of a data processing method for water quality indicators of a water body as provided in the present application are implemented.
[0025] The fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a data processing method for water quality indicators of a water body as provided in the present application are implemented.
[0026] Compared with the prior art, this application has the following beneficial effects:
[0027] 1. This application uses historical measurement data of water samples and reference spectral data of distilled water as training data for a convolutional neural network, and can obtain a water quality index prediction model for predicting the predicted values of water quality indicators of water bodies. On the basis of the predicted values output by this model, the predicted values are compared and analyzed in combination with the water quality index data obtained by chemical measurement. Based on the results of the comparative analysis, the spectral data to be processed is corrected, and based on the correction results, the spectral measurement is adjusted to improve the accuracy of the spectral measurement.
[0028] 2. The present application combines the traditional chemical measurement method and the spectral measurement method to realize the homologous measurement of sample spectral measurement and chemical measurement method of water quality indicators. Multi-source measurement data of water samples are obtained based on the measurement results of the two methods. This data ensures that the measured spectral data has corresponding water quality indicators measured by the chemical measurement method. Therefore, the multi-source data obtained by the measurement of the present application is more reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings described herein are used to provide a further understanding of the embodiments of the present application, constitute a part of the present application, and do not constitute a limitation on the embodiments of the present application. In the drawings:
[0030] Figure 1 A schematic diagram of a flow chart of a method for processing water quality indicators of a water body provided in an embodiment of the present application;
[0031] Figure 2 A principle block diagram of a data processing device for water quality indicators of a water body provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0033] Marks and corresponding parts names in the attached drawings:
[0034] 210, data acquisition module; 220, water quality index prediction module; 230, data processing module; 300, electronic device; 310, processor; 320, memory; 330, communication interface; 321, one or more programs. DETAILED DESCRIPTION
[0035] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with examples and drawings. The illustrative implementation scheme of the present application and its description are only used to explain the present application and are not intended to limit the present application.
[0036] It should be noted that the terms "include" or "may include" used in various embodiments of the present application indicate the presence of the function, operation or element applied for, and do not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present application, the terms "include", "have" and their cognates are only intended to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items.
[0037] Please refer to Figure 1 , Figure 1 A flow chart of a method for processing water quality indicators provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0038] S101, obtaining spectral data of water body to be processed.
[0039] In this embodiment, the execution conditions of spectral measurement are first described, specifically: after the water sample to be measured enters the spectral chamber, the spectrometer is started to perform spectral measurement, wherein the measurement parameters of the spectrometer during the spectral measurement are specifically set as follows: (1) the integration time is set to 10ms; (2) dark background subtraction is selected; (3) the average number of scans is set to 30. The above specific parameter setting values are the optimal conditions obtained after multiple experiments, and the spectral data measured under the execution conditions are obtained. The spectral data of the water body obtained is measured by the current more conventional spectral measurement technology, which mainly includes the following measurement methods: UV-Vis spectroscopy: This method uses ultraviolet light and visible light of specific wavelengths to irradiate the water sample, and determines the concentration of a specific substance therein by analyzing the absorption degree of the water sample to light of different wavelengths. UV-Vis spectroscopy is often used to detect organic matter and some inorganic matter in water. Infrared spectroscopy: Infrared spectroscopy uses the absorption characteristics of substances to infrared light for analysis. Since different substances have different absorption characteristics to infrared light, different substances in the water sample can be identified by analyzing the infrared spectrum. Infrared spectroscopy is often used to detect organic compounds in water in water quality monitoring. Fluorescence spectroscopy: Certain substances will emit fluorescence after being excited by light of a specific wavelength. Fluorescence spectroscopy uses this property to analyze water quality. Fluorescence spectroscopy is highly sensitive and selective, and can detect trace amounts of harmful substances in water samples. Hyperspectral scanning imaging: This is a water quality monitoring method that combines spectral analysis and imaging technology. It uses hyperspectral imaging equipment to obtain spectral information of water bodies and calculates water quality parameters through inversion models. This method can invert a variety of water quality parameters, such as chemical oxygen demand, ammonia nitrogen, total phosphorus, etc., and has the advantages of high spatial resolution and large amount of information.
[0040] S102, inputting the spectral data to be processed into a water quality index prediction model to obtain a predicted value of the water quality index; wherein the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectral data of distilled water as training data, and the historical measurement data includes sample spectral data of water samples and water quality index data.
[0041] In this embodiment, the water quality index data include chemical oxygen demand, ammonia nitrogen, total nitrogen, total phosphorus and turbidity.
[0042] The measurement process of the sample spectral data of the water sample is: quantifying the water sample once, diluting the once quantified water sample to obtain the diluted water sample, performing spectral measurement on the diluted water sample, and obtaining the sample spectral data of the water sample; the measurement process of the water quality index data of the water sample is: quantifying the diluted water sample twice, performing chemical measurement on the secondary quantified and diluted water sample, and obtaining the water quality index data of the water sample; after completing the spectral measurement and chemical measurement corresponding to each dilution operation, adjusting the dilution multiple of the once quantified water sample, repeating the spectral measurement and chemical measurement until the corresponding number of measurements is reached, summarizing the sample spectral data and water quality index data obtained by each spectral measurement and chemical measurement to obtain the historical measurement data of the water sample.
[0043] Specifically, before the water sample is quantified once, a water sample of any volume is drawn into a measuring container for quantification. The quantified value can be 6 ml or 5 ml. This embodiment does not make specific limitations. This is a conventional technical means of technicians in this technical field, and no unnecessary details are given here. Then the water sample after the quantification is diluted once, for example, the digestion chamber is used as an operating container for sample dilution. At this time, the digestion chamber acts as a container and is only used for sample pretreatment, mainly referring to dilution quantification. The water sample diluted by the digestion chamber is injected into the spectral chamber (for example, the injection volume is 6 ml) for spectral measurement, and the spectral data is collected.
[0044] Correspondingly, the diluted water samples left in the spectral chamber are not discharged, but injected into the metering chamber for secondary quantification (2.5 ml). Based on the secondary quantification, they are injected into the digestion chamber for water quality index testing for chemical testing. The samples remaining in the spectral chamber are directly discharged into the waste water bucket, thus realizing homologous samples measured by spectral measurement and chemical measurement methods. Homologous samples refer to samples that absolutely come from the same dilution.
[0045] Correspondingly, both spectral measurement and chemical measurement use the water sample after the corresponding dilution factor under a dilution operation as the test object. However, what this application needs to complete is the multi-source measurement of water quality data of the water body. Therefore, after completing the spectral measurement and chemical measurement corresponding to each dilution operation, the dilution factor of a quantitative water sample is adjusted once, so that the spectral data and water quality indicators of the water sample under different dilution factors can be collected.
[0046] It should be noted that in the dilution process of water samples, generally 12 dilution operations are performed and no more dilution is performed, that is, one measurement corresponds to 12 dilution operations for a quantitative water sample. After one measurement round is completed, the next measurement is carried out. The measurement process is uninterrupted, which can accumulate data to the greatest extent and ensure the richness of the water quality data of the water body.
[0047] S103, comparing the predicted value of the water quality index with the water quality index data of the water sample, and correcting the spectral data to be processed based on the comparison result.
[0048] Specifically, the comparison refers to the numerical comparison of the water quality indexes between the predicted values and the actual values measured by chemical methods.
[0049] Model correction: By comparing and analyzing the predicted results with the actual values measured by chemical methods, if the numerical comparison results are significantly different and the error is greater than 5%, the real information measured by the chemical method (the actual water quality index value and the corresponding spectral data to be processed) is fed back to the model for re-learning and training. The above steps are repeated to iteratively update the model weights to obtain the best results.
[0050] Based on the contents described in the above embodiments, it can be seen that the present embodiment provides a method for processing water quality index data of a water body. The method uses historical measurement data of water body samples and reference spectral data of distilled water as training data of a convolutional neural network, and can obtain a water quality index prediction model for predicting the predicted values of water quality indexes of a water body. On the basis of the predicted values output by the model, the predicted values are compared and analyzed in combination with the water quality index data obtained by chemical measurement. Based on the results of the comparative analysis, the spectral data to be processed is corrected, and based on the correction results, the spectral measurement is adjusted, thereby improving the accuracy of the spectral measurement.
[0051] In some embodiments, the convolutional neural network is a ResNet neural network that introduces a residual module.
[0052] Specifically, traditional convolutional neural networks or fully connected networks will have more or less information loss and loss problems when transmitting information, and will also cause gradient vanishing or gradient explosion, making it impossible to train very deep networks. Therefore, based on a single convolutional neural network, it may lead to insufficient training efficiency and affect the prediction performance of the obtained model. Therefore, this embodiment provides a ResNet neural network that introduces a residual module. Using the ResNet neural network, the residual module is introduced into the network to solve the problems of gradient vanishing and model degradation, and the residual module protects the integrity of the information by "bypassing" the input information to the output. The entire network only needs to learn the input, output and residual parts, which can simplify the learning objectives and difficulty.
[0053] In some embodiments, the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectrum data of distilled water as training data, specifically including:
[0054] Normalizing the reference spectral data and the sample spectral data respectively to obtain characteristic values of the reference spectral data and the sample spectral data, and selecting data in a wavelength range that meets the preset linear characteristics from the characteristic values of the reference spectral data and the sample spectral data as sub-training data;
[0055] The sub-training data and water quality index data are processed into the dimensions required for the convolutional neural network input, and the loss function and optimizer used for training are preset. When the convolutional neural network reaches the iteration conditions for training, the water quality index prediction model is obtained.
[0056] In this embodiment, during the training stage, spectral data of a wavelength range with obvious linear characteristics (wavelength of about 220nm-320nm) is selected for training. Obvious linear characteristics refer to the part that meets the preset linear characteristics. The advantage of discarding data with no obvious difference in linear characteristics is that it can avoid a large amount of redundant data from being input into the convolutional neural network, resulting in a decrease in the training speed, and also avoid a decrease in the prediction performance of the final prediction model due to redundant data.
[0057] Then the selected data is normalized. Since some eigenvalues in the input training data are very large, while other eigenvalues are very small, it is difficult for the network to learn the correct weights for eigenvalues with very different magnitudes. This will cause the gradient descent algorithm to converge very slowly, and may even fall into a local optimal solution. Therefore, the input data needs to be normalized to convert all eigenvalues into a similar numerical range, so that the training can converge faster and obtain the desired results.
[0058] The normalized feature data is then processed into the dimensions and format required for the convolutional neural network input, and the loss function and optimizer applicable to the data are defined. When the corresponding iteration conditions are met, the training of the convolutional neural network can be completed, that is, the water quality index prediction model is obtained, and the water quality index prediction model is saved for later prediction of the predicted value of the water quality index.
[0059] In the prediction stage of using the water quality index prediction model for prediction, this embodiment provides a method of defining an app instance using the FastAPI framework and loading it. At the same time, the global exception information processing is configured, and the returned exception information format and service status are set. That is, the spectral data to be processed is received through the network interface, wherein the received spectral data to be processed is four data lists, namely the wavelength of the reference spectral data and the wavelength of the sample spectral data, the light intensity of the reference spectral data and the light intensity of the sample spectral data. Then the service layer function is called, including specific service functions, such as a service function that can preliminarily check the data format, whether the data is sufficient, the format is wrong or the data is insufficient, and then the error processing is aroused. If the data is normal, it is processed into the dimension and format of the water quality index prediction model input, and the trained water quality index prediction model is used for prediction, and the predicted value of the water quality index is returned. Otherwise, the exception information is returned, and the exception information includes information such as the data format, whether the data is sufficient, the format is wrong or the data is insufficient.
[0060] In some embodiments, the method further includes: feeding back the corrected sample spectral data to the trained water quality index prediction model for relearning and training to adjust the weight of the water quality index prediction model.
[0061] In this embodiment, the prediction results are compared and analyzed with the actual values of the water quality indicators measured by chemical methods, and the information is fed back to the model for re-learning and training. The above steps are repeated, and the weights of the water quality indicator prediction model are iteratively updated. In this way, in subsequent prediction operations, the water quality indicator prediction model with updated weights can obtain the best prediction results.
[0062] In some embodiments, one test number corresponds to 12 dilution operations performed on a quantitative water sample; the dilution multiples of the 12 dilution operations increase successively; wherein the dilution multiples of the 12 dilution operations are 0, 2 times, 3 times, 4 times, 5 times, 6 times, 7 times, 8 times, 9 times, 12 times, 18 times, and 36 times respectively.
[0063] In this embodiment, the processes of spectral measurement and chemical measurement are conventional technical processes of those skilled in the art, and therefore, no unnecessary elaboration is made in this embodiment.
[0064] It is understandable that each dilution operation corresponds to a dilution multiple, and the 12 dilution operations will be described below in conjunction with specific implementation methods.
[0065] Specifically, (1) A range: when the dilution factor is 0, a spectral measurement is performed on a quantitative water sample to obtain spectral data of a quantitative water sample.
[0066] (2) Range B: Dilute by 2 times, inject 3.5 ml of sample and distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectroscopic chamber and drain the rest.
[0067] (3) C range: dilute 3 times, inject 2.5 ml of sample and 5 ml of distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectrometer chamber and drain the rest.
[0068] (4) D range: dilute 4 times, inject 2 ml of sample and 6 ml of distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectrometer chamber and drain the rest.
[0069] (5) E range: dilute 5 times, inject 1.5 ml of sample and 6 ml of distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectrometer chamber and drain the rest.
[0070] (6) F range: dilute 6 times, inject 2.5 ml of sample and distilled water into the digestion chamber respectively, stir and mix, then drain 2.5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, extract 6 ml into the spectrum chamber, and drain the rest.
[0071] (7) G range: dilute 7 times, inject 1 ml of sample and 6 ml of distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectroscopic chamber and drain the rest.
[0072] (8) H range: dilute 8 times, inject 1 ml of sample and 7 ml of distilled water into the digestion chamber respectively, stir and mix, then draw 6 ml into the spectroscopic chamber and drain the rest.
[0073] (9) I range: dilute 9 times, inject 2.5 ml of sample and 5 ml of distilled water into the digestion chamber respectively, stir and mix, then drain 5 ml, retain 2.5 ml, inject 5 ml of distilled water again, stir and mix, extract 6 ml into the spectrum chamber, and drain the rest.
[0074] (10) J range: dilute 12 times, inject 2.5 ml of sample and distilled water into the digestion chamber respectively, stir and mix, remove 2.5 ml, retain 2.5 ml, inject 2.5 ml of distilled water, stir and mix, remove 2.5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, extract 6 ml into the spectrum chamber, and drain the rest.
[0075] (11) k range: dilute 18 times, inject 2.5 ml of sample and distilled water into the digestion chamber respectively, stir and mix, remove 2.5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, remove 5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, extract 6 ml into the spectrum chamber, and drain the rest.
[0076] (12) L range: dilute 36 times, inject 2.5 ml of sample and distilled water respectively into the digestion chamber, stir and mix, remove 2.5 ml, retain 2.5 ml, inject 2.5 ml of distilled water, stir and mix, remove 2.5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, remove 5 ml, retain 2.5 ml, inject 5 ml of distilled water, stir and mix, extract 6 ml into the spectrum chamber, and drain the rest.
[0077] In some embodiments, the measurement process of the reference spectral data of the distilled water is: quantifying the distilled water, performing spectral measurement on the quantified distilled water, and obtaining the reference spectral data of the distilled water; wherein the measurement range for quantifying the distilled water is consistent with the measurement range for a single quantification of a water sample.
[0078] Specifically, the purpose of adding reference spectral data of distilled water to the training data of the convolutional neural network is to provide a reference standard for the spectrum. The reason is that when performing spectral measurement on water samples obtained in an actual environment, they are easily disturbed by the external environment, which causes the measured sample spectral data to easily deviate. Therefore, this embodiment adds reference spectral data of distilled water with the same content as the water sample as data for training the convolutional neural network to ensure the learning accuracy of the convolutional neural network on the sample spectral data.
[0079] Please refer to Figure 2 , Figure 2 A principle block diagram of a data processing device for water quality indicators provided in an embodiment of the present application, such as Figure 2 As shown, the device comprises:
[0080] A data acquisition module 210 is used to acquire spectral data to be processed of a water body;
[0081] The water quality index prediction module 220 is used to input the spectral data to be processed into the water quality index prediction model to obtain the predicted value of the water quality index; wherein the water quality index prediction model is obtained by training the convolutional neural network with the historical measurement data of the water sample and the reference spectral data of the distilled water as training data, and the historical measurement data includes the sample spectral data of the water sample and the water quality index data;
[0082] The data processing module 230 is used to compare the predicted value of the water quality index with the water quality index data of the water sample, and to correct the spectral data to be processed based on the comparison result.
[0083] It can be seen that in the present embodiment, a method of the present invention uses the historical measurement data of water samples and the reference spectral data of distilled water as training data of the convolutional neural network, and a water quality index prediction model for predicting the predicted values of water quality indicators of water bodies can be obtained. On the basis of the predicted values output by this model, the predicted values are compared and analyzed in combination with the water quality index data obtained by chemical measurement, and the spectral data to be processed is corrected based on the results of the comparative analysis, and the spectral measurement is adjusted based on the correction results, thereby improving the accuracy of the spectral measurement.
[0084] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and at least one communication bus for connecting the processor 310, the memory 320, and the communication interface 330. The memory 320 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (PROM), or a portable CD-ROM, and the memory 320 is used for related instructions and data.
[0085] The communication interface 330 is used to receive and send data. The processor 310 can be one or more CPUs. When the processor 310 is a CPU, the CPU can be a single-core CPU or a multi-core CPU. The processor 310 in the electronic device 400 is used to read one or more programs 321 stored in the memory 320, and perform the following operations: obtaining the spectral data to be processed of the water body; inputting the spectral data to be processed into the water quality index prediction model to obtain the predicted value of the water quality index; wherein the water quality index prediction model is obtained by training the convolutional neural network with the historical measurement data of the water body sample and the reference spectral data of the distilled water as training data, and the historical measurement data includes the sample spectral data and water quality index data of the water body sample; comparing the predicted value of the water quality index with the water quality index data of the water body sample, and correcting the spectral data to be processed based on the comparison result.
[0086] It should be noted that the specific implementation of each operation can be Figure 1 According to the corresponding description of the method embodiment shown, the electronic device 300 can be used to execute a data processing method for water quality indicators of the above method embodiment of the present application, which will not be described in detail here.
[0087] The embodiment of the present application also provides a computer-readable storage medium, which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the data processing method for a water quality indicator in the above embodiment. It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0088] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A data processing method for water quality indicators of water bodies, It is characterized in that Methods include: Acquire spectral data of water body to be processed; Input the spectral data to be processed into a water quality index prediction model to obtain a predicted value of the water quality index; wherein the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectral data of distilled water as training data, wherein the historical measurement data includes sample spectral data of water samples and water quality index data; The predicted values of water quality indicators are compared with the water quality indicator data of water samples, and the spectral data to be processed are corrected based on the comparison results.
2. A method for processing water quality indicators according to claim 1, It is characterized in that The convolutional neural network is a ResNet neural network that introduces a residual module.
3. The data processing method for water quality indicators of a water body according to claim 1, It is characterized in that The water quality index prediction model is obtained by training the convolutional neural network using the historical measurement data of water samples and the reference spectrum data of distilled water as training data, which specifically includes: Normalizing the reference spectral data and the sample spectral data respectively to obtain characteristic values of the reference spectral data and the sample spectral data, and selecting data in a wavelength range that meets the preset linear characteristics from the characteristic values of the reference spectral data and the sample spectral data as sub-training data; The sub-training data and water quality index data are processed into the dimensions required for the convolutional neural network input, and the loss function and optimizer used for training are preset. When the convolutional neural network reaches the iteration conditions for training, the water quality index prediction model is obtained.
4. The data processing method for water quality indicators of a water body according to claim 1, It is characterized in that The method further includes: feeding back the corrected sample spectral data to the trained water quality index prediction model for relearning and training to adjust the weight of the water quality index prediction model.
5. The data processing method for water quality indicators of a water body according to claim 1, It is characterized in that The measurement process of the sample spectrum data of the water sample is: quantifying the water sample once, diluting the once quantified water sample to obtain a diluted water sample, and performing spectrum measurement on the diluted water sample to obtain the sample spectrum data of the water sample; The process of measuring the water quality index data of the water body sample is: performing secondary quantification on the diluted water body sample, performing chemical measurement on the secondary quantified and diluted water body sample, and obtaining the water quality index data of the water body sample; After completing the spectral measurement and chemical measurement corresponding to each dilution operation, adjust the dilution factor of the quantitative water sample, repeat the spectral measurement and chemical measurement until the corresponding number of measurements is reached, and summarize the sample spectral data and water quality index data obtained from each spectral measurement and chemical measurement to obtain the historical measurement data of the water sample.
6. A method for processing water quality indicators according to claim 5, It is characterized in that One test number corresponds to 12 dilution operations performed on a quantitative water sample; The dilution multiples of the 12 dilution operations increase sequentially; wherein, the dilution multiples of the 12 dilution operations are 0, 2 times, 3 times, 4 times, 5 times, 6 times, 7 times, 8 times, 9 times, 12 times, 18 times, and 36 times respectively.
7. The data processing method for water quality index of a water body according to claim 5, It is characterized in that The measurement process of the reference spectral data of distilled water is: quantifying the distilled water, performing spectral measurement on the quantified distilled water, and obtaining the reference spectral data of the distilled water; wherein the measurement range of the quantification of the distilled water is consistent with the measurement range of the one-time quantification of the water sample.
8. A data processing device for water samples, It is characterized in that The device includes: A data acquisition module, used for acquiring spectral data to be processed of a water body; A water quality index prediction module, used for inputting the spectral data to be processed into a water quality index prediction model to obtain a predicted value of the water quality index; wherein the water quality index prediction model is obtained by training a convolutional neural network using historical measurement data of water samples and reference spectral data of distilled water as training data, wherein the historical measurement data includes sample spectral data of water samples and water quality index data; The data processing module is used to compare the predicted value of the water quality index with the water quality index data of the water sample, and to correct the spectral data to be processed based on the comparison result.
9. An electronic device, It is characterized in that The electronic device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of a data processing method for water quality indicators of a water body as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of a method for processing water quality indicators of a water body according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Changed optical path measuring device for component concentration of water and measuring method thereof
CN103185700A
Water quality index prediction model construction method and water quality index monitoring method
CN109709057A
Sewage near infrared spectrum chemical oxygen demand assessment method and system
CN115420707A
Method for measuring chemical oxygen demand in water body
CN115753651A
Intelligent detection method for urban inland river sewage
CN116625972A
