Shore-based multispectral camera water quality prediction method and device based on integrated learning strategy
The water quality prediction method that combines integrated learning strategies and shore-based multispectral cameras solves the over-fitting and universality problems of the water quality parameter prediction model and achieves high-precision, real-time water quality monitoring, which is suitable for a variety of water areas and meteorological conditions.
Patent Information
- Application Number
- CN202410596740.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-08-27
AI Technical Summary
Existing water quality parameter prediction models are prone to overfitting and lack versatility and generalization, resulting in declining prediction accuracy and difficulty in adapting to different water areas and meteorological conditions.
A shore-based multispectral camera water quality prediction method based on an integrated learning strategy is used to collect water spectral data through a fiber spectrometer, build a water quality spectral library, and use the Stacking model to combine a variety of base learners and meta-learners for data preprocessing and prediction. , improve the diversity and generalization ability of the model.
It improves the accuracy and real-time performance of water quality parameter prediction, realizes high-precision water quality monitoring, is suitable for different water areas and meteorological conditions, provides flexibility and scalability, and supports water environment protection and management.
Smart Images

Figure CN118553334A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water environment monitoring, protection and management, and in particular to a shore-based multi-spectral camera water quality prediction method and device based on an integrated learning strategy. Background Art
[0002] Water quality monitoring plays a key role in environmental protection and resource management. Traditional water quality monitoring methods include sampling and laboratory analysis, which are usually time-consuming, expensive and difficult to achieve real-time monitoring; existing water quality monitoring methods also include: machine learning algorithms achieve in-situ non-contact measurement by constructing the relationship between water body remote sensing reflectance and water quality parameters, effectively exerting its advantages of high measurement accuracy and wide monitoring range, and being able to continuously update the model to make it more accurate as it is measured. However, it currently mainly relies on a single machine learning model for water quality parameter prediction, which is prone to overfitting and lacks versatility and generalization. Different models observe data space and structure from different angles, and the training principles of different models have differences and limitations. How to combine the advantages of different models so that different models can complement each other and improve the generalization of water quality parameter prediction models and avoid a single model from falling into the overfitting problem is a problem that needs further study in water quality parameter prediction methods. Summary of the invention
[0003] The main purpose of the present invention is to solve the problems of overfitting and lack of universality and generalization existing in the single water quality parameter prediction model in the prior art.
[0004] The first aspect of the present invention provides a shore-based multi-spectral camera water quality prediction method based on an integrated learning strategy, comprising: collecting spectral curves of different types of water bodies through a fiber optic spectrometer, and constructing a water quality spectrum library corresponding to the fiber optic spectrometer according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters; performing equivalent spectrum conversion on the water quality spectrum library corresponding to the current fiber optic spectrometer to construct a water quality spectrum library corresponding to the shore-based multi-spectral camera; constructing a training set based on the water quality spectrum library corresponding to the shore-based multi-spectral camera, and training a Stacking model using the training set; collecting water spectral data through a shore-based multi-spectral camera, and preprocessing the current water spectral data; inputting the preprocessed water spectral data into the trained Stacking model to obtain a water quality prediction result; wherein, the Stacking model uses the prediction results of different types of base learners as the input of a meta-learner to achieve water quality prediction.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the spectral curves of different types of water bodies are collected by using a fiber optic spectrometer, and a water quality spectrum library corresponding to the fiber optic spectrometer is constructed according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters, including: collecting dark current spectrum curves, sky light spectrum curves, gray plate spectrum curves and water body spectrum curves of water sampling points by using a fiber optic spectrometer, and calculating the remote sensing reflectance curves of the water sampling points based on the collected dark current spectrum curves, sky light spectrum curves, gray plate spectrum curves and water body spectrum curves of the water sampling points; filtering out data that does not meet the standard water body spectral characteristics according to the remote sensing reflectance curves of the water sampling points, and obtaining the water body spectrum curve of the current water sampling point; obtaining the measured values of water quality parameters of the current water sampling point, including: measured values of permanganate index, ammonia nitrogen and total phosphorus; obtaining the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters; and constructing a water quality spectrum library corresponding to the fiber optic spectrometer according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the remote sensing reflectance curve of the water sample point is calculated based on the collected dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point, including:
[0007] S w =S sw -rS sky
[0008] Among them, S w Indicates the water-leaving radiation brightness of the water body; S sw represents the spectral measurement data of the water body; r represents the wind speed; S sky Represents spectral measurements of sky light;
[0009]
[0010] Among them, R rs Represents the remote sensing reflectivity of water body; ρ p Represents the reflectivity of the gray plate; S p Represents the spectral measurement data of the gray card.
[0011] Optionally, in a third implementation of the first aspect of the present invention, performing equivalent spectral conversion on the water body water quality spectral library corresponding to the current fiber optic spectrometer to construct a water body water quality spectral library corresponding to the shore-based multispectral camera includes: resampling the remote sensing reflectance of the fiber optic spectrometer to the central wavelength of the shore-based multispectral image according to the spectral response function of the shore-based multispectral data to obtain an equivalent remote sensing reflectance applicable to the shore-based multispectral data;
[0012]
[0013] Among them, R rs (band i ) represents the equivalent remote sensing reflectivity of the i-band of the shore-based multispectral camera; λ1 and λ2 are the band ranges of the i-band; R rs (λ) represents the water remote sensing reflectance of the fiber optic spectrometer; SRF(λ) represents the spectral response function at wavelength λ.
[0014] Optionally, in a fourth implementation of the first aspect of the present invention, the training set is constructed based on the water quality spectral library corresponding to the shore-based multi-spectral camera, and the Stacking model is trained using the training set, including: constructing a training set and a test set based on the water quality spectral library corresponding to the shore-based multi-spectral camera; the training set is used to train the Stacking model; the test set is used to evaluate the trained Stacking model; wherein, the training set is constructed based on the water quality spectral library corresponding to the shore-based multi-spectral camera, including: based on the water quality spectral library corresponding to the shore-based multi-spectral camera, using a k-fold cross-validation method to construct k training sets of equal size; when each base learner is trained for k rounds, Each training set of k training sets of equal size is used as a validation set in turn, and the remaining k-1 training sets are used as training sets; wherein, the use of training sets to train the Stacking model includes: performing k rounds of training on each base learner, in each round of training, using the current k-1 training sets to train the current base learner, and using the current validation set to verify the currently trained base learner to obtain a prediction result; after performing k rounds of training on the current base learner, k prediction results are obtained; the prediction results obtained by each base learner correspond to a feature column, and a feature matrix is formed based on the feature columns corresponding to each base learner; the feature matrix is used as a meta-feature matrix, and the meta-feature matrix and the true labels of the training set are used to train the meta-learner.
[0015] Optionally, in a fifth implementation of the first aspect of the present invention, the base learner includes: a decision tree, a random forest, a gradient boosting decision tree or an extreme random tree; the meta learner includes: linear regression or logistic regression.
[0016] Optionally, in a sixth implementation of the first aspect of the present invention, the test set is used to evaluate the trained Stacking model, including: inputting the test set into the trained Stacking model to obtain a prediction result; comparing the current prediction result with the true label of the test set, and calculating an evaluation index; evaluating the performance of the trained Stacking model according to the evaluation index, and judging the generalization ability and prediction accuracy of the current Stacking model according to the Stacking model performance.
[0017] Optionally, in a seventh implementation of the first aspect of the present invention, the water body spectral data is collected by a shore-based multispectral camera, and the current water body spectral data is preprocessed, including: removing background value noise from the original gray plate and water body spectral image to obtain the gray plate and water body spectral image after noise removal; based on the processed gray plate image, a number of regions of interest are selected according to preset requirements, and the light intensity values of the ROI bands of the regions of interest are counted, and the average light intensity of each band is calculated, and the gray plate of the corresponding band is corrected using the average light intensity of each band; band operations are performed on each band of the processed water body image to obtain a single-band water body spectral reflectance image;
[0018]
[0019] Among them, R i Represents a single-band water spectral reflectance image; R wi represents the illumination intensity value of the i-th band of the water body image after noise removal; ρ p Represents the reflectivity of the gray plate; R hi It represents the average light intensity of the i-th band of the gray-board image after noise removal;
[0020] All processed single-band water spectral reflectance images are band synthesized to obtain a full-band water spectral reflectance image.
[0021] Optionally, in the eighth implementation method of the first aspect of the present invention, it also includes: according to the surface water environmental quality standard, based on the water quality parameter prediction results of the monitoring section, the maximum value, minimum value and average value of the current water quality factor in the water quality category with the highest proportion in the single water quality factor are counted; the number and proportion of pixels of water quality factors of different categories are calculated at the same time to obtain the water quality standard and water quality grade of the current water quality factor; according to the calculated number and proportion of pixels of water quality factors of different categories, when the water quality category proportion is greater than or equal to the first preset value, the current category is used as the final water quality category result; when the water quality category proportion is less than the first preset value, the water quality category proportion greater than or equal to the second preset value is selected, and they are sorted from high to low according to their respective proportions, and accumulated in sequence until they exceed the third preset value, and the evaluation result of the single water quality factor is obtained by weighted averaging based on the corresponding water quality factor in the corresponding water quality category in the cumulative sum; the evaluation results of the water quality factors including the permanganate index, ammonia nitrogen and total phosphorus are evaluated, and the worst category of the water quality indicators monitored during the evaluation period is used as the final water quality condition of the monitoring section.
[0022] The second aspect of the present invention provides a shore-based multi-spectral camera water quality prediction device based on an integrated learning strategy, including: a water body water quality spectrum library construction module corresponding to the optical fiber spectrometer, which is used to construct a water body water quality spectrum library corresponding to the optical fiber spectrometer according to the spectral curves of different types of water bodies measured and collected by the optical fiber spectrometer and the corresponding measured values of water quality parameters; a water body water quality spectrum library construction module for the shore-based multi-spectral camera, which is used to perform equivalent spectrum conversion on the water body water quality spectrum library corresponding to the current optical fiber spectrometer, and construct a water body water quality spectrum library corresponding to the shore-based multi-spectral camera; a training model module, which is used to construct a training set based on the water body water quality spectrum library corresponding to the shore-based multi-spectral camera, and use the training set to train a Stacking model; a preprocessing module, which is used to preprocess the water body spectrum data obtained through the shore-based multi-spectral camera; a prediction module, which is used to input the preprocessed water body spectrum data into the trained Stacking model to obtain a water quality prediction result; wherein, the Stacking model uses the prediction results of different types of base learners as the input of the meta-learner to achieve water quality prediction.
[0023] Optionally, in a first implementation manner of the second aspect of the present invention, a water body water quality spectrum library construction module corresponding to the fiber optic spectrometer includes: a remote sensing reflectance curve calculation unit, which is used to calculate the remote sensing reflectance curve of the water sample point based on the dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point collected by the fiber optic spectrometer; a screening unit, which is used to screen out data that does not meet the standard water body spectrum characteristics according to the remote sensing reflectance curve of the water sample point, and obtain the water body spectrum curve of the current water sample point; a water quality parameter measured value acquisition unit, which is used to obtain the measured values of water quality parameters of the current water sample point, including: permanganate index, ammonia nitrogen and total phosphorus measured values; a water body water quality spectrum library construction unit, which is used to construct a water body water quality spectrum library corresponding to the fiber optic spectrometer according to the obtained spectrum curves of different types of water bodies and the corresponding measured values of water quality parameters.
[0024] Optionally, in a second implementation of the second aspect of the present invention, the remote sensing reflectance curve of the water sample point is calculated based on the collected dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point, including:
[0025] S w =S sw -rS sky
[0026] Among them, S w Indicates the water-leaving radiation brightness of the water body; S sw represents the spectral measurement data of the water body; r represents the wind speed; S sky Represents spectral measurements of sky light;
[0027]
[0028] Among them, R rs Represents the remote sensing reflectivity of water body; ρ o Represents the reflectivity of the gray plate; S p Represents the spectral measurement data of the gray card.
[0029] Optionally, in a third implementation of the second aspect of the present invention, the water body water quality spectral library construction module of the shore-based multispectral camera is used to resample the remote sensing reflectance of the fiber optic spectrometer to the central wavelength of the shore-based multispectral image according to the spectral response function of the shore-based multispectral data, so as to obtain an equivalent remote sensing reflectance suitable for the shore-based multispectral data;
[0030]
[0031] Among them, R rs (band i ) represents the equivalent remote sensing reflectivity of the i-band of the shore-based multispectral camera; λ1 and λ2 are the band ranges of the i-band; R rs (λ) represents the water remote sensing reflectance of the fiber optic spectrometer; SRF(λ) represents the spectral response function at wavelength λ.
[0032] Optionally, in a fourth implementation of the second aspect of the present invention, the training model module includes: a training set and a test set construction unit, which is used to construct a training set and a test set based on the water quality spectral library corresponding to the shore-based multi-spectral camera; the training set is used to train the Stacking model; the test set is used to evaluate the trained Stacking model; wherein, the construction of the training set based on the water quality spectral library corresponding to the shore-based multi-spectral camera includes: based on the water quality spectral library corresponding to the shore-based multi-spectral camera, using a k-fold cross-validation method to construct k training sets of equal size; when each base learner is trained for k rounds, each training set of equal size is cross-validated. The first k-1 training sets are used as validation sets in turn, and the remaining k-1 training sets are used as training sets; a Stacking model unit is trained to train the Stacking model using the training sets; each base learner is trained for k rounds, and in each round of training, the current base learner is trained using the current k-1 training sets, and the current trained base learner is verified using the current validation set to obtain a prediction result; after k rounds of training for the current base learner, k prediction results are obtained; the prediction results obtained by each base learner are corresponded to a feature column, and a feature matrix is formed based on the feature columns corresponding to each base learner; the feature matrix is used as a meta-feature matrix, and the meta-feature matrix and the true labels of the training set are used to train the meta-learner.
[0033] Optionally, in a fifth implementation of the second aspect of the present invention, the base learner includes: a decision tree, a random forest, a gradient boosting decision tree or an extreme random tree; the meta learner includes: linear regression or logistic regression.
[0034] Optionally, in a sixth implementation of the second aspect of the present invention, the test set is used to evaluate the trained Stacking model, including: inputting the test set into the trained Stacking model to obtain a prediction result; comparing the current prediction result with the true label of the test set, and calculating an evaluation index; evaluating the performance of the trained Stacking model according to the evaluation index, and judging the generalization ability and prediction accuracy of the current Stacking model according to the Stacking model performance.
[0035] Optionally, in a seventh implementation of the second aspect of the present invention, the preprocessing module includes: a noise removal unit, used to remove background value noise from the original gray plate and water body spectral image to obtain the gray plate and water body spectral image after noise removal; a gray plate correction unit, used to select a number of regions of interest according to preset requirements based on the processed gray plate image, count the light intensity values of the ROI bands of the regions of interest, calculate the average light intensity of each band, and use the average light intensity of each band to correct the gray plate of the corresponding band; perform band operations on each band of the processed water body image to obtain a single-band water body spectral reflectance image;
[0036]
[0037] Among them, R i Represents a single-band water spectral reflectance image; R wi represents the illumination intensity value of the i-th band of the water body image after noise removal; ρ p Represents the reflectivity of the gray plate; R hi Represents the average light intensity of the i-th band of the gray-board image after noise removal
[0038] The band synthesis unit is used to perform band synthesis on all processed single-band water body spectral reflectance images to obtain a full-band water body spectral reflectance image.
[0039] Optionally, in the eighth implementation method of the second aspect of the present invention, it also includes: a water quality evaluation module, which is used to count the maximum value, minimum value and average value of the current water quality factor in the water quality category with the highest proportion in a single water quality factor based on the water quality parameter prediction results of the monitoring section according to the surface water environmental quality standard; at the same time, calculate the number and proportion of pixels of water quality factors of different categories to obtain the water quality standard and water quality grade of the current water quality factor; according to the calculated number and proportion of pixels of water quality factors of different categories, when the water quality category proportion is greater than or equal to a first preset value, the current category is taken as the final water quality category result; when the water quality category proportion is less than the first preset value, the water quality category proportion greater than or equal to the second preset value is selected, and they are sorted from high to low according to their respective proportions, and accumulated in sequence until they exceed the third preset value, and the evaluation result of a single water quality factor is obtained by weighted averaging based on the corresponding water quality factor in the corresponding water quality category in the cumulative sum; the evaluation results of water quality factors including permanganate index, ammonia nitrogen and total phosphorus are evaluated, and the worst category of water quality indicators monitored during the evaluation period is taken as the final water quality condition of the monitoring section.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. The present invention solves the problems of overfitting and lack of versatility and generalization of a single water quality parameter prediction model. The accuracy of a single prediction model generally shows a trend of diminishing marginal utility. It is necessary to select different base learners, hyperparameters and feature subsets to increase the diversity and estimation ability of the model, and compare the estimation ability of different base learner combinations to achieve the best prediction accuracy.
[0042] 2. The present invention improves the prediction accuracy by introducing a water body spectral library and a shore-based multispectral camera, combined with the Stacking integrated learning strategy; the water body spectral library is used as the basic data source, which reduces the dependence on measured data and improves the universality of data. At the same time, the shore-based multispectral camera can provide data with high temporal and spatial resolution; through Stacking integrated learning, a variety of machine learning regression models are deeply integrated, making full use of the advantages of each model, and improving the accuracy and real-time performance of water quality prediction;
[0043] 3. The present invention realizes high-precision real-time monitoring of water quality, providing strong support for water environment protection and management; at the same time, the present invention is also flexible and scalable, suitable for water quality monitoring in different waters and meteorological conditions, and provides users with efficient, reliable and real-time water quality monitoring solutions;
[0044] 4. The present invention provides a shore-based multi-spectral camera water quality prediction method and device based on an integrated learning strategy, which realizes efficient, accurate and real-time monitoring of water quality. By making full use of the advantages of integrated learning and combining multi-source data, including water body spectral library and shore-based multi-spectral camera data, a comprehensive assessment and dynamic monitoring of water quality can be achieved; the research and development of this technology will provide more reliable technical support for water environment monitoring, protection and management, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0046] Figure 1 A first flow chart of a shore-based multi-spectral camera water quality prediction method based on an integrated learning strategy provided in an embodiment of the present invention.
[0047] Figure 2 A second flow chart of the shore-based multi-spectral camera water quality prediction method based on an integrated learning strategy provided in an embodiment of the present invention.
[0048] Figure 3 Flowchart for training the Stacking model using the training set.
[0049] Figure 4 Flowchart for preprocessing water spectral data collected by shore-based multispectral cameras.
[0050] Figure 5 A second flow chart of the shore-based multi-spectral camera water quality prediction method based on an integrated learning strategy provided in an embodiment of the present invention.
[0051] Figure 6 A schematic structural diagram of a shore-based multispectral camera water quality prediction device based on an integrated learning strategy provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0053] The embodiment of the present invention provides a shore-based multi-spectral camera water quality prediction method and device based on an integrated learning strategy, which uses the spectral curves of different types of water bodies collected by the fiber optic spectrometer and the corresponding measured values of water quality parameters to construct a water quality spectrum library corresponding to the fiber optic spectrometer; then performs equivalent spectrum conversion on the water quality spectrum library corresponding to the fiber optic spectrometer to construct a water quality spectrum library corresponding to the shore-based multi-spectral camera; constructs a training set based on the water quality spectrum library corresponding to the shore-based multi-spectral camera to train the Stacking model; pre-processes the water spectral data collected by the shore-based multi-spectral camera; inputs the pre-processed water spectral data into the trained Stacking model to obtain water quality prediction results. The prediction results are evaluated based on the surface water environmental quality standard, and finally the water quality status is obtained. The present invention solves the problems of overfitting and lack of universality and generalization in a single water quality parameter prediction model.
[0054] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1-2 The first embodiment of the shore-based multi-spectral camera water quality prediction method based on the integrated learning strategy in the embodiment of the present invention includes:
[0056] 101. Collect spectral curves of different types of water bodies through a fiber optic spectrometer, and construct a water quality spectrum library corresponding to the fiber optic spectrometer according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters;
[0057] In this embodiment, in order to ensure the uniformity of the water type measured at the sampling point, field sampling is performed in equal proportions for different water quality categories. During the appropriate sampling period, a fiber optic spectrometer is used to measure the dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water spectrum curve of the water sample point.
[0058] Based on the above data, the water-off-water radiation brightness and remote sensing reflectivity of the water body are calculated. The specific calculation formula is as follows:
[0059] Sw =S sw -rS sky
[0060] Where: S w Indicates the water-leaving radiation brightness of the water body; S sw represents the spectral measurement data of the water body; r represents the wind speed; r generally takes a value between 0.021 and 0.05, wherein the calm water surface takes a value of 0.022, the 5m / s wind speed takes a value of 0.025, and the 10m / s wind speed takes a value of 0.026 to 0.028; in the present invention, the spectral sampling is generally for the calm water surface, so the value is 0.022; S sky Represents spectral measurements of sky light;
[0061]
[0062] Where: R rs Represents the remote sensing reflectivity of water body; S w represents the water-leaving radiance of the water body; ρ p represents the reflectivity of the gray plate; in this embodiment, the reflectivity of the gray plate is 0.3; S p Represents the spectral measurement data of the gray card.
[0063] According to the calculated remote sensing reflectance curve of the water sample point, the data that does not meet the standard water body spectral characteristics are screened out.
[0064] In this embodiment, water quality sampling and spectral sampling are carried out simultaneously. Sampling is done at 0.5m or 1 / 3 below the water surface. All water sample bottles are stored at low temperature and away from light. After recording the sampling site data, the water quality test results are sent to an authoritative laboratory to test the water quality parameter results, and the actual measured values of permanganate index, ammonia nitrogen and total phosphorus at the corresponding water sampling points are obtained.
[0065] According to the test results of water quality sampling, the water spectral data are classified into six different water quality categories: Class I, Class II, Class III, Class IV, Class V, and Class V-minus. At the same time, the water quality parameter concentration value corresponding to each spectral curve is recorded, and finally a water quality spectral library corresponding to the fiber optic spectrometer is constructed.
[0066] In this embodiment, the spectral curves and measured water quality parameters of different types of water bodies are collected by the fiber optic spectrometer, and a water quality spectrum library corresponding to the fiber optic spectrometer is established, which can provide benchmark data for subsequent water quality monitoring and improve the precision and accuracy of water quality monitoring.
[0067] 102. Perform equivalent spectrum conversion on the water quality spectrum library corresponding to the current fiber optic spectrometer, and construct a water quality spectrum library corresponding to the shore-based multi-spectral camera;
[0068] In this embodiment, there is an obvious scale effect between the water body remote sensing reflectance calculated by the fiber optic spectrometer and the shore-based multispectral data. Therefore, the remote sensing reflectance of the fiber optic spectrometer is resampled to the central wavelength of the shore-based multispectral image according to the spectral response function of the shore-based multispectral data to obtain an equivalent remote sensing reflectance applicable to the shore-based multispectral data. The specific calculation formula is as follows:
[0069]
[0070] Among them, R rs (band i ) represents the equivalent remote sensing reflectivity of the i-band of the shore-based multispectral camera; λ1 and λ2 are the band ranges of the i-band; R rs (λ) represents the water remote sensing reflectance of the fiber optic spectrometer; SRF(λ) represents the spectral response function at wavelength λ.
[0071] 103. Construct a training set based on the water quality spectral library suitable for shore-based multispectral cameras, and use the training set to train the Stacking model;
[0072] In this embodiment, the water quality spectral library corresponding to the shore-based multispectral camera is divided into a training set and a test set; the training set is used to train the Stacking model; and the test set is used to evaluate the performance of the trained Stacking model;
[0073] In this example, see Figure 3 ,Based on the water quality spectral library suitable for shore-based multispectral cameras, a 5-fold cross-validation method was used to construct five training sets of equal size;
[0074] When each base learner is trained for 5 rounds, each of the 5 training sets of equal size is used as a validation set in turn, and the remaining 4 training sets are used as training sets;
[0075] The step of training the Stacking model using the training set includes:
[0076] Each base learner is trained for 5 rounds. In each round of training, the current base learner is trained using the current 4 training sets, and the current validation set is used to validate the currently trained base learner to obtain the prediction result.
[0077] After 5 rounds of training for the current base learner, 5 prediction results are obtained;
[0078] The prediction result obtained by each base learner corresponds to a feature column, and a feature matrix is formed based on the feature columns corresponding to each base learner;
[0079] The feature matrix is used as the meta-feature matrix, and the meta-learner is trained using the meta-feature matrix and the true labels of the training set.
[0080] In this embodiment, the base learner includes: a decision tree, a random forest, a gradient boosted decision tree or an extreme random tree;
[0081] The decision tree (DT) is a supervised learning algorithm based on a tree structure, which is used for classification and regression problems. It divides the data into different decision paths and finally obtains a tree structure of decision rules. Each node represents a feature, each branch represents a decision, and the leaf node represents an output result. The decision tree is easy to understand and explain, and is suitable for modeling complex relationships.
[0082] The Random Forest (RF) is an ensemble learning algorithm that builds a powerful model based on multiple decision trees. Each tree is built based on a different random subsample and feature subset. By combining the opinions of each tree, the random forest improves the accuracy and robustness of the model, and is particularly effective for large-scale data and high-dimensional features.
[0083] The Gradient Boosting Decision Tree (GBDT) is an iterative ensemble learning algorithm that improves model performance by training multiple decision trees. It gradually improves the model and builds new trees by learning the residuals of the previous iteration. Gradient boosting decision trees can usually achieve higher accuracy and are effective in modeling complex nonlinear relationships.
[0084] The Extremely Randomized Tree (ET) is a variant of the random forest that is more random in the node splitting of the decision tree. Unlike the random forest, it not only randomly selects features, but also randomizes the selection process of the split points. This additional randomness provides greater diversity and can usually achieve better performance on some data sets.
[0085] The meta-learner is usually a simple machine learning model, such as linear regression or logistic regression.
[0086] The test set is used to evaluate the performance of the trained Stacking model, including:
[0087] Input the test set into the trained Stacking model to obtain the prediction results;
[0088] Compare the current prediction results with the true labels of the test set and calculate the evaluation indicators;
[0089] The performance of the trained Stacking model is evaluated according to the evaluation indicators, and the generalization ability and prediction accuracy of the current Stacking model are judged according to the performance of the Stacking model.
[0090] 104. Collect water body spectral data through a shore-based multi-spectral camera, and pre-process the current water body spectral data;
[0091] In this example, see Figure 4 , the preprocessing of the current water body spectral data includes: noise removal processing, gray plate correction processing and band synthesis processing;
[0092] The noise removal process removes background value noise from the original gray plate and water body spectral image through band calculation to obtain the gray plate and water body spectral image after noise removal.
[0093] The gray plate correction process selects several regions of interest on the processed gray plate image, counts the light intensity values of the ROI bands of the regions of interest, and selects the average value of each band for subsequent gray plate correction; performs band calculation on each band of the processed water body image to obtain a single-band water body spectral reflectance image, and the calculation formula is as follows:
[0094]
[0095] Where: R i Represents a single-band water spectral reflectance image; R wi represents the illumination intensity value of the i-th band of the water body image after noise removal; ρ p Represents the reflectivity of the gray plate; R hi It represents the average light intensity of the i-th band of the gray-board image after noise removal;
[0096] The band synthesis processing performs band synthesis on all processed single-band water body spectral reflectance images to obtain a full-band water body spectral reflectance image.
[0097] 105. Input the preprocessed water spectral data into the trained Stacking model to obtain the water quality prediction results.
[0098] See also Figure 5 The second embodiment of the shore-based multi-spectral camera water quality prediction method based on the integrated learning strategy in the embodiment of the present invention includes:
[0099] 201. Collect spectral curves of different types of water bodies through a fiber optic spectrometer, and construct a water quality spectrum library corresponding to the fiber optic spectrometer according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters;
[0100] In this embodiment, the water quality spectrum library corresponding to the constructed fiber optic spectrometer has sufficient and diverse data samples, which can better capture the characteristics of the water body and improve the accuracy of the prediction model. At the same time, the water quality spectrum library corresponding to the constructed fiber optic spectrometer is combined with the remote sensor. According to the data in the water quality spectrum library, the changes in water quality parameters obtained by the remote sensor can be quickly analyzed to achieve remote monitoring. When a water quality emergency (such as a pollution incident) occurs, the established water quality spectrum library can be used to respond quickly, monitor water quality changes, take timely measures, and reduce losses.
[0101] 202. Perform equivalent spectrum conversion on the water quality spectrum library corresponding to the current fiber optic spectrometer, and construct a water quality spectrum library corresponding to the shore-based multi-spectral camera;
[0102] 203. Construct a training set based on the water quality spectral library suitable for shore-based multispectral cameras, and use the training set to train the Stacking model;
[0103] In this embodiment, water quality parameters are often affected by a variety of complex factors, and a single regression model may not be able to capture these complex nonlinear relationships. The Stacking model can better capture the nonlinear relationships in the data by combining the prediction results of multiple base learners, thereby improving the Stacking model's ability to model complex relationships in water quality parameters. This flexibility means that when predicting water quality parameters, the most appropriate model combination can be selected based on the actual problem, thereby better meeting the characteristics of different water quality parameter data.
[0104] 204. Collecting water body spectral data through a shore-based multi-spectral camera, and pre-processing the current water body spectral data;
[0105] 205. Input the preprocessed water spectral data into the trained Stacking model to obtain a water quality prediction result;
[0106] 206. Based on the water quality prediction results, water quality evaluation is carried out according to the surface water environmental quality standards to obtain the water quality status;
[0107] In this embodiment, according to the surface water environmental quality standard and based on the water quality parameter prediction results of the monitoring section, the maximum value, minimum value, and average value of the water quality category with the highest proportion in a single water quality factor are counted, and the number and proportion of pixels of water quality factors of different categories are calculated at the same time, and finally the water quality standard and water quality grade of the water quality factor are obtained;
[0108] In order to obtain the final result of the water quality category of the point, the following two rules are followed: (1) When a water quality category accounts for ≥60%, this category is used as the final water quality category result; (2) When the water quality category accounts for no more than 60%, the categories with a water quality category account for ≥15% are selected, sorted by their respective proportions and added up to 70% in sequence, and the corresponding water quality factors in the water quality category corresponding to the above-mentioned added addends are weighted averaged to obtain the evaluation result of a single water quality factor. Finally, the evaluation results of the three water quality factors are evaluated in total, that is, they are determined according to the worst category of the water quality indicators in the monitoring during the evaluation period, and finally the final water quality status of the monitoring section is obtained.
[0109] According to the requirements for surface water environmental quality evaluation, the three standard limits of permanganate index, ammonia nitrogen and total phosphorus in the surface water quality evaluation indicators are used as reference indicators for water quality standard evaluation, as shown in Table 1. Based on the water quality standard evaluation results, the number and proportion of different types of water quality in the predicted value of a single water quality factor are counted, and the water quality level of the monitoring section is qualitatively evaluated according to the proportion of different water quality categories.
[0110] Table 1 Standard limits of basic items of surface water environmental quality standards (unit: mg / L)
[0111]
[0112] The above describes the shore-based multi-spectral camera water quality prediction method based on the integrated learning strategy in the embodiment of the present invention. The following describes the shore-based multi-spectral camera water quality prediction device based on the integrated learning strategy in the embodiment of the present invention. Figure 6 In one embodiment of the present invention, a shore-based multi-spectral camera water quality prediction device based on an integrated learning strategy includes:
[0113] A water quality spectrum library construction module 301 corresponding to the fiber optic spectrometer is used to construct a water quality spectrum library corresponding to the fiber optic spectrometer according to the spectrum curves of different types of water bodies measured and collected by the fiber optic spectrometer and the corresponding measured values of water quality parameters;
[0114] The water quality spectrum library construction module 302 of the shore-based multi-spectral camera is used to perform equivalent spectrum conversion on the water quality spectrum library corresponding to the current optical fiber spectrometer to construct the water quality spectrum library corresponding to the shore-based multi-spectral camera;
[0115] A training model module 303 is used to construct a training set based on a water quality spectrum library corresponding to the shore-based multi-spectral camera, and use the training set to train the Stacking model;
[0116] A preprocessing module 304 is used to preprocess the water body spectral data obtained by the shore-based multi-spectral camera;
[0117] Prediction module 305, used to input the pre-processed water body spectral data into the trained Stacking model to obtain water quality prediction results;
[0118] The water quality evaluation module 306 is used to evaluate the water quality based on the water quality prediction result according to the surface water environment quality standard to obtain the water quality status.
[0119] The Stacking model uses the prediction results of different types of base learners as the input of the meta-learner to achieve water quality prediction.
[0120] In this embodiment, the water quality spectrum library construction module 301 corresponding to the fiber optic spectrometer includes:
[0121] A remote sensing reflectance curve calculation unit 3011 is used to calculate a remote sensing reflectance curve of a water sample point based on a dark current spectrum curve, a sky light spectrum curve, a gray plate spectrum curve and a water body spectrum curve of the water sample point collected by a fiber optic spectrometer;
[0122] In order to ensure the uniformity of the water types measured at the sampling points, field sampling was carried out in equal proportions for different water quality categories. During the appropriate sampling period, a fiber optic spectrometer was used to measure the dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water spectrum curve of the water sampling points.
[0123] Based on the above data, the water-off-water radiation brightness and remote sensing reflectivity of the water body are calculated. The specific calculation formula is as follows:
[0124] S w =S sw -rS sky
[0125] Where: S w Indicates the water-leaving radiation brightness of the water body; S sw represents the spectral measurement data of the water body; r represents the wind speed; r generally takes a value between 0.021 and 0.05, wherein the calm water surface takes a value of 0.022, the 5m / s wind speed takes a value of 0.025, and the 10m / s wind speed takes a value of 0.026 to 0.028; in the present invention, the spectral sampling is generally for the calm water surface, so the value is 0.022; S sky Represents spectral measurements of sky light;
[0126]
[0127] Where: R rs Represents the remote sensing reflectivity of water body; S w represents the water-leaving radiance of the water body; ρ p represents the reflectivity of the gray plate; in this embodiment, the reflectivity of the gray plate is 0.3; S p Represents the spectral measurement data of the gray card.
[0128] A screening unit 3012 is used to screen out data that does not meet the standard water body spectrum characteristics according to the remote sensing reflectance curve of the water sampling point, and obtain the water body spectrum curve of the current water sampling point;
[0129] The unit 3013 for obtaining the measured values of water quality parameters is used to obtain the measured values of water quality parameters of the current water sampling point, including: the measured values of permanganate index, ammonia nitrogen and total phosphorus;
[0130] Water quality sampling and spectral sampling are carried out simultaneously. Sampling is done at 0.5m or 1 / 3 below the water surface. All water sample bottles are stored at low temperature and away from light. After recording the sampling site data, the water quality test results are sent to an authoritative laboratory to test the water quality parameter results and obtain the actual measured values of permanganate index, ammonia nitrogen and total phosphorus at the corresponding water sampling points.
[0131] The water body water quality spectrum library construction unit 3014 is used to construct a water body water quality spectrum library corresponding to the fiber optic spectrometer according to the obtained spectrum curves of different types of water bodies and the corresponding measured values of water quality parameters.
[0132] According to the test results of water quality sampling, the water spectral data are classified into six different water quality categories: Class I, Class II, Class III, Class IV, Class V, and Class V-minus. At the same time, the water quality parameter concentration value corresponding to each spectral curve is recorded, and finally a water quality spectral library corresponding to the fiber optic spectrometer is constructed.
[0133] In this embodiment, the water quality spectrum library construction module 302 of the shore-based multi-spectral camera includes:
[0134] There is an obvious scale effect between the water body remote sensing reflectance calculated by the fiber optic spectrometer and the shore-based multispectral data. Therefore, the remote sensing reflectance of the fiber optic spectrometer is resampled to the central wavelength of the shore-based multispectral image according to the spectral response function of the shore-based multispectral data to obtain the equivalent remote sensing reflectance applicable to the shore-based multispectral data. The specific calculation formula is as follows:
[0135]
[0136] Among them, R rs (band i ) represents the equivalent remote sensing reflectivity of the i-band of the shore-based multispectral camera; λ1 and λ2 are the band ranges of the i-band; R rs (λ) represents the water remote sensing reflectance of the fiber optic spectrometer; SRF(λ) represents the spectral response function at wavelength λ.
[0137] In this embodiment, the training model module 303 includes:
[0138] The training set and test set construction unit 3031 is used to construct a training set and a test set based on the water quality spectrum library corresponding to the shore-based multi-spectral camera;
[0139] The training set is used to train the Stacking model;
[0140] The test set is used to evaluate the trained Stacking model;
[0141] The training set is constructed based on the water quality spectral library corresponding to the shore-based multispectral camera, including:
[0142] Based on the water quality spectral library corresponding to the shore-based multispectral camera, k training sets of equal size are constructed by using the k-fold cross-validation method; when each base learner is trained for k rounds, each training set of k training sets of equal size is used as a validation set in turn, and the remaining k-1 training sets are used as training sets;
[0143] The training Stacking model unit 3032 is used to train the Stacking model using the training set; each base learner is trained for k rounds, and in each round of training, the current base learner is trained using the current k-1 training sets, and the current trained base learner is verified using the current verification set to obtain a prediction result; after k rounds of training for the current base learner, k prediction results are obtained; the prediction results obtained by each base learner are corresponded to a feature column, and a feature matrix is formed based on the feature columns corresponding to each base learner; the feature matrix is used as a meta-feature matrix, and the meta-feature matrix and the true labels of the training set are used to train the meta-learner.
[0144] Among them, the base learners include: decision tree, random forest, gradient boosted decision tree or extreme random tree;
[0145] The decision tree (DT) is a supervised learning algorithm based on a tree structure, which is used for classification and regression problems. It divides the data into different decision paths and finally obtains a tree structure of decision rules. Each node represents a feature, each branch represents a decision, and the leaf node represents an output result. The decision tree is easy to understand and explain, and is suitable for modeling complex relationships.
[0146] The Random Forest (RF) is an ensemble learning algorithm that builds a powerful model based on multiple decision trees. Each tree is built based on a different random subsample and feature subset. By combining the opinions of each tree, the random forest improves the accuracy and robustness of the model, and is particularly effective for large-scale data and high-dimensional features.
[0147] The Gradient Boosting Decision Tree (GBDT) is an iterative ensemble learning algorithm that improves model performance by training multiple decision trees. It gradually improves the model and builds new trees by learning the residuals of the previous iteration. Gradient boosting decision trees can usually achieve higher accuracy and are effective in modeling complex nonlinear relationships.
[0148] The Extremely Randomized Tree (ET) is a variant of the random forest that is more random in the node splitting of the decision tree. Unlike the random forest, it not only randomly selects features, but also randomizes the selection process of the split points. This additional randomness provides greater diversity and can usually achieve better performance on some data sets.
[0149] The meta-learner includes: linear regression or logistic regression.
[0150] The test set evaluation unit 3033 is used to input the test set into the trained Stacking model to obtain a prediction result; compare the current prediction result with the true label of the test set and calculate the evaluation index; evaluate the performance of the trained Stacking model according to the evaluation index, and judge the generalization ability and prediction accuracy of the current Stacking model according to the Stacking model performance.
[0151] In this embodiment, the preprocessing module 304 includes:
[0152] A noise removal unit 3041 is used to remove background value noise from the original gray plate and water body spectrum image to obtain a gray plate and water body spectrum image after noise removal;
[0153] A gray plate correction unit 3042 is used to select a number of regions of interest according to preset requirements based on the processed gray plate image, count the light intensity values of the ROI bands of the regions of interest, calculate the average light intensity of each band, and use the average light intensity of each band to correct the gray plate of the corresponding band;
[0154] The single-band water body spectral reflectance image calculation unit 3043 is used to perform band operations on each band of the processed water body image to obtain a single-band water body spectral reflectance image;
[0155]
[0156] Among them, R i Represents a single-band water spectral reflectance image; R wi represents the illumination intensity value of the i-th band of the water body image after noise removal; ρ pRepresents the reflectivity of the gray plate; R hi Represents the average light intensity of the i-th band of the gray-board image after noise removal
[0157] The band synthesis unit 3044 is used to perform band synthesis on all processed single-band water body spectral reflectance images to obtain a full-band water body spectral reflectance image.
[0158] In this embodiment, the water quality assessment module 306 includes:
[0159] The qualitative and quantitative evaluation unit 3061 is used to calculate the maximum value, minimum value and average value of the water quality category with the highest proportion in a single water quality factor according to the surface water environmental quality standard and the water quality parameter prediction results of the monitoring section, and calculate the number and proportion of pixels of different categories of water quality factors, and finally obtain the water quality standard and water quality grade of the water quality factor;
[0160] The water quality status evaluation unit 3062 is used to evaluate the evaluation results of the three water quality factors of permanganate index, ammonia nitrogen and total phosphorus, and determine the final water quality status of the monitoring section according to the worst category of the water quality indicators in the evaluation period;
[0161] In order to obtain the final result of the water quality category of the point, the following two rules are followed: (1) When a water quality category accounts for ≥60%, this category is used as the final water quality category result; (2) When the water quality category accounts for less than 60%, the categories with a water quality category account for ≥15% are selected, sorted by their respective proportions and added up to 70% in sequence, and the corresponding water quality factors in the water quality category corresponding to the above-mentioned added addends are weighted averaged to obtain the evaluation result of a single water quality factor. Finally, the evaluation results of the three water quality factors including permanganate index, ammonia nitrogen and total phosphorus are evaluated, that is, the worst category of the water quality indicators in the monitoring during the evaluation period is determined, and the final water quality status of the monitoring section is finally obtained.
[0162] above Figure 6 From the perspective of modular functional entities, a shore-based multi-spectral camera water quality prediction device based on an integrated learning strategy in an embodiment of the present invention is described in detail.
[0163] The present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned shore-based multi-spectral camera water quality prediction method based on an integrated learning strategy are implemented.
[0164] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the artificial intelligence data collection method.
[0165] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0167] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A shore-based multispectral camera water quality prediction method based on an integrated learning strategy, characterized in that: include: The optical fiber spectrometer is used to collect the spectral curves of different types of water bodies, and according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters, a water quality spectral library corresponding to the optical fiber spectrometer is constructed; Perform equivalent spectrum conversion on the water quality spectrum library corresponding to the current fiber optic spectrometer, and build the water quality spectrum library corresponding to the shore-based multi-spectral camera; A training set is built based on the water quality spectral library corresponding to the shore-based multispectral camera, and the Stacking model is trained using the training set. Collect water spectral data through shore-based multispectral cameras and pre-process the current water spectral data; The preprocessed water spectral data is input into the trained Stacking model to obtain the water quality prediction results; The Stacking model uses the prediction results of different types of base learners as the input of the meta-learner to achieve water quality prediction.
2. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: The optical fiber spectrometer is used to collect spectral curves of different types of water bodies, and a water quality spectral library corresponding to the optical fiber spectrometer is constructed according to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters, including: The dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point are collected by the optical fiber spectrometer, and the remote sensing reflectance curve of the water sample point is calculated based on the collected dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point; According to the remote sensing reflectance curve of the water sampling point, the data that does not meet the standard water body spectrum characteristics are screened out to obtain the water body spectrum curve of the current water sampling point; Obtain the measured values of water quality parameters at the current water sampling point, including: measured values of permanganate index, ammonia nitrogen and total phosphorus; Obtain spectral curves of different types of water bodies and corresponding measured values of water quality parameters; According to the spectral curves of different types of water bodies and the corresponding measured values of water quality parameters, a water quality spectral library corresponding to the fiber optic spectrometer is constructed.
3. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 2 is characterized in that: The method of calculating the remote sensing reflectance curve of the water sample point based on the collected dark current spectrum curve, sky light spectrum curve, gray plate spectrum curve and water body spectrum curve of the water sample point includes: S w =S sw -rS sky Among them, S w Indicates the water-leaving radiation brightness of the water body; S sw represents the spectral measurement data of the water body; r represents the wind speed; S sky Represents spectral measurements of sky light; Among them, R rs Represents the remote sensing reflectivity of water body; ρ p Represents the reflectivity of the gray plate; S p Represents the spectral measurement data of the gray card.
4. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: The equivalent spectrum conversion is performed on the water quality spectrum library corresponding to the current optical fiber spectrometer to construct the water quality spectrum library corresponding to the shore-based multi-spectral camera, including: The water body remote sensing reflectance of the fiber optic spectrometer is resampled to the central wavelength of the shore-based multispectral image according to the spectral response function of the shore-based multispectral data, and the equivalent remote sensing reflectance suitable for the shore-based multispectral data is obtained; Among them, R rs (band i ) represents the equivalent remote sensing reflectivity of the i-band of the shore-based multispectral camera; λ1 and λ2 are the band ranges of the i-band; R rs (λ) represents the water remote sensing reflectance of the fiber optic spectrometer; SRF(λ) represents the spectral response function at wavelength λ.
5. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: The method of constructing a training set based on a water quality spectral library corresponding to a shore-based multispectral camera and using the training set to train a Stacking model includes: A training set and a test set are constructed based on the water quality spectral library corresponding to the shore-based multispectral camera; the training set is used to train the Stacking model; and the test set is used to evaluate the trained Stacking model; The training set is constructed based on the water quality spectral library corresponding to the shore-based multispectral camera, including: Based on the water quality spectral library corresponding to the shore-based multispectral camera, k training sets of equal size were constructed using the k-fold cross-validation method; When each base learner is trained for k rounds, each of the k training sets of equal size is used as a validation set in turn, and the remaining k-1 training sets are used as training sets; The step of training the Stacking model using the training set includes: Perform k rounds of training on each base learner. In each round of training, use the current k-1 training sets to train the current base learner, and use the current verification set to verify the currently trained base learner to obtain the prediction result. After k rounds of training for the current base learner, k prediction results are obtained; The prediction result obtained by each base learner corresponds to a feature column, and a feature matrix is formed based on the feature columns corresponding to each base learner; The feature matrix is used as the meta-feature matrix, and the meta-learner is trained using the meta-feature matrix and the true labels of the training set.
6. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: The base learners include: decision tree, random forest, gradient boosting decision tree and extreme random tree; The meta-learner includes: linear regression or logistic regression.
7. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 5 is characterized in that: The test set is used to evaluate the trained Stacking model, including: Input the test set into the trained Stacking model to obtain the prediction results; Compare the current prediction results with the true labels of the test set and calculate the evaluation indicators; The performance of the trained Stacking model is evaluated according to the evaluation indicators, and the generalization ability and prediction accuracy of the current Stacking model are judged according to the performance of the Stacking model.
8. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: The method of collecting water body spectral data by using a shore-based multi-spectral camera and preprocessing the current water body spectral data includes: Remove background value noise from the original gray plate and water body spectral images to obtain gray plate and water body spectral images after noise removal; Based on the processed gray card image, several regions of interest are selected according to preset requirements, the light intensity values of the ROI bands in the regions of interest are counted, the average light intensity of each band is calculated, and the gray card of the corresponding band is calibrated using the average light intensity of each band; Perform band operations on each band of the processed water body image to obtain a single-band water body spectral reflectance image; Among them, R i Represents a single-band water spectral reflectance image; R wi represents the illumination intensity value of the i-th band of the water body image after noise removal; ρ p Represents the reflectivity of the gray plate; R hi It represents the average light intensity of the i-th band of the gray-board image after noise removal; All processed single-band water spectral reflectance images are band synthesized to obtain a full-band water spectral reflectance image.
9. The shore-based multi-spectral camera water quality prediction method based on ensemble learning strategy according to claim 1 is characterized in that: Also includes: According to the surface water environmental quality standards and based on the water quality parameter prediction results of the monitoring section, the maximum, minimum and average values of the current water quality factors in the water quality category with the highest proportion of a single water quality factor are counted; at the same time, the number and proportion of pixels of water quality factors of different categories are calculated to obtain the water quality standard and water quality grade of the current water quality factor; According to the calculated number and proportion of pixels of different categories of water quality factors, when the proportion of water quality categories is greater than or equal to a first preset value, the current category is taken as the final water quality category result; When the proportion of water quality categories is less than the first preset value, water quality categories with a proportion greater than or equal to the second preset value are selected, and are sorted from high to low according to their respective proportions, and are accumulated in sequence until they exceed the third preset value. Based on the corresponding water quality factors in the water quality categories corresponding to the addends in the cumulative sum, the evaluation results of the single water quality factors are obtained by weighted average; An overall evaluation is conducted on the evaluation results of water quality factors including permanganate index, ammonia nitrogen and total phosphorus, and the worst category of water quality indicators monitored during the evaluation period is used as the final water quality status of the monitoring section.
10. A shore-based multispectral camera water quality prediction device based on an integrated learning strategy, characterized in that: include: A water quality spectrum library construction module corresponding to the fiber optic spectrometer is used to construct a water quality spectrum library corresponding to the fiber optic spectrometer based on the spectrum curves of different types of water bodies measured and collected by the fiber optic spectrometer and the corresponding measured values of water quality parameters; The water quality spectrum library construction module of the shore-based multi-spectral camera is used to perform equivalent spectrum conversion on the water quality spectrum library corresponding to the current fiber optic spectrometer to construct the water quality spectrum library corresponding to the shore-based multi-spectral camera; The training model module is used to build a training set based on the water quality spectral library corresponding to the shore-based multispectral camera, and use the training set to train the Stacking model; A preprocessing module, used for preprocessing the water body spectral data obtained by the shore-based multispectral camera; The prediction module is used to input the preprocessed water spectral data into the trained Stacking model to obtain the water quality prediction results; The Stacking model uses the prediction results of different types of base learners as the input of the meta-learner to achieve water quality prediction.
Citation Information
Cited By
Spectral data processing method and system for integrated modeling, medium, product and equipment
CN118780402A
