A water quality parameter detection method based on RGB hyperspectral reconstruction

Through the hyperspectral reconstruction algorithm and deep learning technology based on RGB color cameras, the complexity and high cost of existing hyperspectral remote sensing equipment are solved, portable water quality parameter detection is realized, operation time is reduced, and application scenarios are expanded.

CN115753691BActive Publication Date: 2024-10-29HEFEI UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211012942.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2024-10-29
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

Existing hyperspectral remote sensing technology equipment has long operation time, complex hardware and high cost, which limits its popularization and application in portable platforms and remote sensing scenarios.

Method used

Using a low-cost, portable water quality parameter detection method based on RGB color cameras, through hyperspectral reconstruction algorithm and deep learning neural network, combined with PixelShuffle module, attention module and multi-layer neural network, the restoration of water body hyperspectral images is achieved, and PLSR is used The model performs concentration inversion of water quality parameters.

Benefits of technology

It reduces hardware costs and operation time, expands the application of RGB cameras in portable platforms and remote sensing scenarios, and enables effective research on multi-parameter water quality detection and remote sensing monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115753691B_ABST
    Figure CN115753691B_ABST
Patent Text Reader

Abstract

The present invention discloses a water quality parameter detection method based on RGB reconstruction hyperspectral, comprising the following steps: S1, simultaneously collecting the RGB image of the water body and the image of the standard whiteboard placed next to it; S2, processing the RGB image using a hyperspectral reconstruction algorithm to obtain the hyperspectral curves of the standard whiteboard and the pixel points at the center of the water body; S3, generating a corrected hyperspectral data curve according to the reflectivity curve of the standard whiteboard; S4, selecting bands according to different reflectivity response characteristic peaks of the water quality parameters to be measured, taking the reflectivity at different bands as the independent variable X and the corresponding water quality parameter concentration as Y, establishing a PLSR model and completing the concentration inversion of the water body parameters. The present invention applies RGB cameras combined with hyperspectral restoration algorithms to water quality detection, reduces hardware costs, reduces operation time, solves problems such as the complexity of traditional equipment, and expands the popularization and application of RGB cameras in portable platforms and remote sensing scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a water quality parameter detection method, and in particular to a water quality parameter detection method based on RGB reconstruction hyperspectral. Background Art

[0002] Traditional hyperspectral remote sensing combines imaging technology with spectral technology to detect the two-dimensional geometric space and one-dimensional spectral information of the target, thereby obtaining continuous, narrow-band images with high spectral resolution. Since it can quickly obtain reflectance data of large-scale water bodies and effectively calculate the concentration of water quality parameters, it has the advantages of real-time, large-area, and repeatability, and is increasingly widely used in water quality monitoring.

[0003] Existing hyperspectral cameras have long operation times and expensive and complex hardware, which limits their popular application in portable platforms and remote sensing scenarios. Summary of the invention

[0004] Purpose of the invention: The purpose of the present invention is to provide a low-cost, portable water quality parameter detection method based on RGB color camera and RGB reconstructed hyperspectral water quality parameter detection.

[0005] Technical solution: The water quality parameter detection method of the present invention comprises the following steps:

[0006] S1, collects the RGB image of the water body and the standard whiteboard image placed next to it;

[0007] S2, the RGB image is processed using a hyperspectral reconstruction algorithm to obtain the hyperspectral curves of the pixel points at the center of the standard white plate and the water body;

[0008] S3, generating a calibrated hyperspectral curve according to a standard white plate reflectance curve;

[0009] S4, select bands according to the reflectivity response characteristic peaks of different water quality parameters to be measured, take the reflectivity at different bands as the independent variable X, and the corresponding water quality parameter concentration as the dependent variable Y, establish a PLSR model, and complete the concentration inversion of water body parameters.

[0010] Furthermore, in step S1, the standard whiteboard and the water solution dish are fixed in an international standard D65 light box, the RGB camera angle is adjusted and the incident angle of the light source is adjusted at the same time; 5 spectral data are continuously collected for the water sample with the same concentration, and the average value of the 5 spectral data is used as the reflectance spectrum at the concentration.

[0011] Furthermore, in step S2, the hyperspectral reconstruction algorithm adopts a deep learning neural network, and each level of the network is connected using a PixelShuffle module, and finally a 3×3 convolution layer unifies the number of channels;

[0012] The attention module is used to learn the spectral weights; the feature fusion module is a residual global block with input shortcut connections, which connects multiple parallel layers through the MLP layer to extract and fuse detailed features of different sizes.

[0013] Furthermore, in step S2, grids with multiple different parameters are used for training respectively, and the absolute average value of the difference between the spectral image generated each time and each band is recorded.

[0014] Further, in step S2, the mean absolute value MRAE of the pixel-level disparity between the generated spectral image G(x) and the ground truth y and the root mean square error RMSE of the spectral image are calculated:

[0015]

[0016]

[0017] Where N represents the total pixels and i represents the currently selected pixel.

[0018] Further, in step S4, after the first principal component u1 is extracted, the partial least squares method is used to implement regression of the independent variable X on u1;

[0019] If the conditions are met, the calculation is terminated; otherwise, the residual information after the independent variable X is interpreted by u1 is used to extract the second round of components; this process is repeated until the conditions are met.

[0020] Further, in step S4, when performing model inversion analysis, precision analysis is used to study the information extraction ratio of the principal component to the analysis item; the projection importance index is used to indicate the explanatory importance of X to Y when the number of components is different, and is also used to assist in the judgment of the number of principal components; cross validity is used to analyze the optimal number of components;

[0021] At the final evaluation of the model, R 2 The value represents the explanatory power of all independent variables X on the dependent variable Y; the root mean square of the prediction error RMSEP is used to measure the relative size of the residual.

[0022] Compared with the prior art, the present invention has the following significant effects:

[0023] 1. This invention applies RGB camera combined with hyperspectral restoration algorithm to the blank field of water quality detection, and further explores the application research of RGB camera in related fields such as multi-parameter detection of water quality and remote sensing monitoring of water quality;

[0024] 2. The market price of traditional hyperspectral cameras ranges from hundreds of thousands to millions, while RGB cameras only cost a few thousand yuan. Therefore, it can reduce hardware costs, reduce operation time, solve problems such as the complexity of traditional equipment, and expand the popularization and application of RGB cameras in portable platforms and remote sensing scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic diagram of the overall process of the present invention;

[0026] Figure 2 This is a schematic diagram of the hyperspectral reconstruction algorithm of the present invention;

[0027] Figure 3(a) is a schematic diagram of the original RGB image of the water sample to be tested;

[0028] Figure 3(b) is a schematic diagram of the original RGB image of the water sample to be tested and the 300nm portion of the hyperspectral image after restoration by the algorithm;

[0029] Figure 3(c) is a schematic diagram of the original RGB image of the water sample to be tested and the 400nm portion of the hyperspectral image after restoration by the algorithm;

[0030] Figure 3(d) is a schematic diagram of the original RGB image of the water sample to be tested and the 500nm portion of the hyperspectral image after restoration by the algorithm;

[0031] Figure 3(e) is a schematic diagram of the original RGB image of the water sample to be tested and the 600nm portion of the hyperspectral image after restoration by the algorithm;

[0032] Figure 4 This is a graph showing the changes in the RMSE value of the model in the water body COD parameter experimental data. DETAILED DESCRIPTION

[0033] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0034] like Figure 1 As shown, the present invention restores the hyperspectral image based on the RGB color camera combined with the hyperspectral reconstruction algorithm, and the steps of restoring the hyperspectral image are as follows:

[0035] Step 1: Collect the RGB image of the water body and the standard whiteboard image at the same time

[0036] Before the collection process, the RGB camera angle should be adjusted, and the standard whiteboard and water solution dish (for example, standard COD solution with different concentration gradients of 10-100 mg / L prepared with deionized water as solvent) should be fixed in the international standard D65 light box with black shading cloth inside, and the incident angle of the light source should be about 50°. Five spectra of the same concentration water sample should be collected continuously and averaged as the reflectance spectrum at that concentration. There is no limit on the concentration selection range, but the concentration gradient interval should be kept at least above 10 mg / L;

[0037] Step 2: The RGB image is processed using a hyperspectral reconstruction algorithm. By selecting a pixel point in MATLAB according to the spatial coordinates, the reflectance values ​​of each channel in the range of 300-700 nm at that point can be obtained, thereby constructing the hyperspectral curves of the standard white board and the center point of the water body.

[0038] like Figure 2 As shown in the figure, a deep learning neural network is used in the hyperspectral reconstruction algorithm, and it is trained on the hyperspectral dataset provided by NTIRE Challenge2020. Each level is connected by the PixelShuffle module, and the output features of the lower level are pixel-shuffled without introducing redundant information, and then connected to the current layer, and finally an additional 3×3 convolution layer unifies the number of channels; its residual dense module contains 5 densely connected 1×1 convolution layers and a residual block. Each convolution layer can access all subsequent layers and pass the information that needs to be saved, which can broaden the network's receptive field and enhance the transmission of features, thereby obtaining better spectral correlation and effectively reducing artifacts; the attention module is used to learn spatial or spectral weights to help the network focus on the useful information part of the spectral image; the feature fusion module is a residual global block with input shortcut connections, which connects multiple parallel layers through the MLP (multi-layer neural network) layer to extract and fuse detailed features of different sizes. Since the features of the bottom layer are the most compact, a 1×1 convolution layer is attached to the last layer of the bottom layer to enhance the tone mapping by weighting all channels. The two middle layers process features of different scales. In addition, the top layer uses the most blocks to effectively integrate features and reduce artifacts, thereby producing high-quality spectral images. Since a single network may fall into a local minimum, resulting in poor generalization performance, eight grids with different parameters are trained separately and then averaged by the ensemble function, which greatly improves the generalization performance.

[0039] Among them, the entire HRNet (High-Resoultion Net) was trained for a total of 10,000 epochs. The initial learning rate was 1×10 -4, halved every 3000 epochs. The Adam optimizer with β1=0.5, β2=0.999 and batch size equal to 8 was selected. The image was randomly cropped to 256×256 area and normalized to the range [0,1]. A total of 8 grids were used, and the absolute average of the difference between the generated spectral image and each band was recorded once every 1000 epochs. This was recorded ten times and the best one was taken.

[0040] Among them, a total of 31 channels are generated. The hyperspectral images of some channels can be seen from Figure 3 (a)-(e). The mean absolute value (MRAE) of the pixel-level disparity between the generated spectral image G(x) and the ground truth y, and the root mean square error (RMSE) of the 31 bands of the generated and ground truth spectral images are calculated to evaluate the accuracy and stability of the restored hyperspectral image, that is, the construction quality of the network:

[0041]

[0042]

[0043] Where N represents the total pixels and i represents the currently selected pixel.

[0044] Step 3, based on the standard whiteboard reflectance curve, using the high reflectance (above 97%) characteristic of the standard whiteboard as a standard reference, the fluctuation of the water body reflectance curve caused by the ambient light intensity is corrected in the MATLAB software to generate a corrected hyperspectral curve.

[0045] Step 4, the water solution in this embodiment can be prepared by mixing deionized water and COD, NO3 or total phosphorus with different concentration gradients according to the parameters to be measured (Chemical Oxygen Demand, NO3, total phosphorus, etc.). Different specific bands can be selected according to the reflectivity response characteristic peak of the water quality parameter to be measured. For example, COD has an obvious characteristic peak at 460-500nm. The reflectivity at different bands is taken as the independent variable X, and the corresponding water quality parameter (such as COD (Chemical Oxygen Demand), NO3, total phosphorus, etc.) concentration is taken as the dependent variable Y, and the PLSR model is established to complete the concentration inversion of the water body parameters.

[0046] Since traditional multivariate linear regression methods such as the least squares method have serious multicollinearity problems (VIF value is too large) when processing the hyperspectral data of the aqueous solution in this embodiment, the partial least squares regression method is selected.

[0047] Partial least squares regression (PLSR) can be seen as a combination of traditional least squares (LS), principal component analysis (PCA) and canonical correlation analysis (CCA). The PLSR algorithm improves the problem that traditional least squares is not effective when there is a serious linear correlation between independent variables, and its main idea is:

[0048] (1) The first selected principal component u1 should carry as much variation information as possible in their respective data tables.

[0049] (2) The correlation between u1 and Y can reach the maximum.

[0050] After the first component u1 is extracted, partial least squares is used to regress X on u1. If the regression has achieved satisfactory accuracy, the algorithm terminates; otherwise, the residual information after X is explained by u1 is used to extract the second round of components. This is repeated until the accuracy can be achieved to distinguish the water quality to be tested according to relevant national indicators (for example, my country's "Surface Water Environmental Quality Standard" stipulates that the COD concentration of general landscape water should be less than 40mg / L, the COD concentration of effluent that basically meets the standard after treatment is about 30mg / L, and the COD concentration of drinking water sources should be less than 15mg / L.)

[0051] Among them, the high reflectivity of the standard whiteboard in the whole band is used as a reference to calibrate the water body reflectivity curve. In the subsequent model inversion analysis, the precision analysis is used to study the information extraction ratio of the principal component to the analysis item. For example, 0.5 means that the principal component can extract 50% of the information of the item.

[0052] The projection importance index VIP is used to indicate the importance of X in explaining Y when the number of components is different. It can also be used to assist in judging the number of principal components.

[0053] Cross-validation analysis Qh 2 The value is an auxiliary indicator used to analyze the optimal number of components. The specific calculation method is:

[0054]

[0055] Among them, the error sum of squares is recorded as SS, the prediction error sum of squares is recorded as PRESS, and the number of principal components is recorded as h;

[0056] If Qh 2 If the value is less than or equal to 0.0975, it means that it is meaningless to continue to increase the number of principal components, that is, the number of components corresponding to this point (or the previous point) is the optimal number of principal components;

[0057] Among them, in the final evaluation of the model, as shown in Table 1, R 2 The value is an indicator of the degree of model fit, which can represent the explanatory power of all X for Y; Figure 4As shown, RMSEP (root mean square prediction error) can be used to measure the relative size of the residuals.

[0058] Table 1 R of the model under different principal components in the experimental data of water COD parameters 2 value

[0059] Dependent Variable When there is 1 principal component When there are 2 principal components When there are 3 principal components When there are 4 principal components When there are 5 principal components C 0.907 0.913 0.919 0.962 0.999

[0060] Among them, as shown in Table 2, the comparison between the actual concentration of COD solution (10-90 mg / L) in the experimental data and the inverted concentration shows that the accuracy of the COD concentration inversion result has met the requirements of my country's "Surface Water Environmental Quality Standards".

[0061] Table 2 Comparison of the actual concentration and inversion concentration of COD solution (10-90 mg / L) in the experimental data

[0062] Actual concentration 10 20 30 40 50 60 80 90 Inversion concentration 9.22 21.58 29.12 40.04 50.43 59.59 80.29 89.74

[0063] (Note: The data units in Table 2 are all mg / L)

[0064] The above descriptions are merely embodiments of the present invention and do not limit the patent protection scope of the present invention. Any equivalent structures or equivalent process changes made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, should be included in the patent protection scope of the present invention.

Claims

1. A water quality parameter detection method based on RGB reconstruction hyperspectral, characterized in that: The following steps are involved: S1, collects the RGB image of the water body and the standard whiteboard image placed next to it at the same time; S2, the RGB image is processed using a hyperspectral reconstruction algorithm to obtain the hyperspectral curves of the pixel points at the center of the standard white plate and the water body; S3, generating a calibrated hyperspectral curve according to a standard white plate reflectance curve; S4, select bands according to the reflectivity response characteristic peaks of different water quality parameters to be measured, take the reflectivity at different bands as the independent variable X, and the corresponding water quality parameter concentration as the dependent variable Y, establish a PLSR model, and complete the concentration inversion of water body parameters; In step S2, the hyperspectral reconstruction algorithm adopts a deep learning neural network, and each level of the network is connected by a PixelShuffle module, and finally a 3×3 convolution layer unifies the number of channels; The attention module is used to learn the spectral weights; the feature fusion module is a residual global block with input shortcut connections, which connects multiple parallel layers through the MLP layer to extract and fuse detailed features of different sizes; A variety of grids with different parameters were used for training, and the absolute average value of the difference between the generated spectral image and each band was recorded; Calculate the mean absolute value MRAE of the pixel-level disparity between the generated spectral image G(x) and the ground truth y and the root mean square error RMSE of the spectral image: Where N represents the total pixels, and i represents the currently selected pixel; In step S4, after the first principal component u1 is extracted, the partial least squares method is used to implement regression of the independent variable X on u1; If the condition is met, the calculation is terminated; otherwise, the residual information after the independent variable X is interpreted by u1 is used to extract the second round of components; this process is repeated until the condition is met; When conducting model inversion analysis, precision analysis is used to study the information extraction ratio of the principal component to the analysis item; The projection importance index is used to indicate the importance of X in explaining Y when the number of components is different, and is also used to assist in judging the number of principal components. Cross-validation was used to analyze the optimal number of components; At the final evaluation of the model, R 2 The value represents the explanatory power of all independent variables X on the dependent variable Y; the root mean square of the prediction error RMSEP is used to measure the relative size of the residual.

2. The water quality parameter detection method based on RGB reconstruction hyperspectral according to claim 1 is characterized in that: In step S1, a standard white plate and a water solution dish are fixed in an international standard D65 light box, the RGB camera angle is adjusted and the incident angle of the light source is adjusted at the same time; 5 spectral data are continuously collected for the water sample with the same concentration, and the average value of the 5 spectral data is taken as the reflectance spectrum at the concentration.

Citation Information

Patent Citations

  • Method and device for reconstructing RGB image into hyperspectral image, equipment and storage medium

    CN113947643A

  • Unmanned aerial vehicle water chlorophyll remote sensing detection system

    CN114397277A