Multi-strategy improved sparrow search optimization machine learning water quality inversion method
By improving the sparrow search optimization machine learning method through multiple strategies and combining Sentinel-2 image data and measured water quality data, the problem of time-consuming and labor-intensive traditional water quality monitoring has been solved, and high-precision water quality parameter inversion and large-scale monitoring have been achieved.
Patent Information
- Application Number
- CN202511338556.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-12-19
Smart Images

Figure CN121168261A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of sparrow search algorithm fusion machine learning technology, and particularly relates to a water quality inversion method based on multi-strategy improved sparrow search optimization machine learning. BACKGROUND
[0002] Traditional water quality monitoring relies on on-site sampling and laboratory analysis, which ensures high precision but is time-consuming and expensive, requires a large number of human resources, and cannot determine the overall spatial distribution of water quality. Setting up an automated water quality monitoring station is another common way of water quality monitoring, but this way of water quality monitoring station is usually only set near some drinking water plants and other primary water sources, and the construction and maintenance of the monitoring station requires a large amount of cost and can only provide water quality data in a limited area.
[0003] Therefore, the prediction of lake water quality parameters is limited by the lack of data availability and accuracy, the difficulty in modeling complex water body processes, the influence of external factors such as climate change, and the high demand for computing resources, and the generalization ability of the model is limited. For example, TSM and Chla, whose concentration spatial distribution is easily affected by wind speed, precipitation and human factors. In order to realize large-scale and real-time water quality monitoring, Sentinel-2 hyperspectral image data can be used, combined with measured water quality data and machine learning models to invert the TSM and Chla concentration of Changdang Lake. SUMMARY
[0004] The application provides a water quality inversion method based on multi-strategy improved sparrow search optimization machine learning, which can avoid falling into local optimum and invert TSM, Chla and other water quality parameters based on optical images.
[0005] To achieve the purpose of the application, the application provides a water quality inversion method based on multi-strategy improved sparrow search optimization machine learning, which inverts the spatiotemporal sequence of water quality parameters TSM and Chla. The method comprises the following steps:
[0006] S1. Using a spectrometer to collect the reflectivity of the water sample and converting the collected reflectivity into equivalent albedo of the corresponding band of the Sentinel-2 satellite through a spectral response function; collecting water samples in the field and measuring the TSM concentration and Chla concentration of the water samples;
[0007] S2. Constructing the equivalent albedo obtained in step S1 into a combination feature in the form of single-band and multi-band, fitting the combination feature with the TSM concentration and Chla concentration by using the least squares method, comparing and evaluating the fitting results, and selecting the top four combination features with the highest correlation as the feature input;
[0008] S3. For the TSM concentration and Chla concentration of the water sample collected in step S1, input the features selected in step 2, adopt , RMSE as the measurement index, compare and analyze the performance of various machine learning models in inverting TSM concentration and Chla concentration, and determine the optimal machine learning model;
[0009] S4. On the basis of the sparrow search algorithm technology, introduce chaos theory and opposite learning strategy to generate initial sparrow population, introduce transfer probability to update the position of the predator, and then update the population by using differential mutation strategy, so as to obtain the multi-strategy optimized sparrow search algorithm;
[0010] S5. The multi-strategy optimized sparrow search algorithm obtained in step S4 is used to optimize the optimal machine learning model obtained in step S3, and water quality inversion is carried out for Sentinel-2 image, and 3 The principle is used to filter out abnormal values and interpolate blank values, so as to obtain the inversion sequence of TSM concentration and Chla spatial and temporal concentration.
[0011] Further, the reflectivity of the water sample collected in step S1 by using the spectrometer is collected at an interval of 1 nm;
[0012] The equivalent albedo of the corresponding band of the Sentinel-2 satellite in step S1 is the equivalent albedo of B1, B2, B3, B4, B5, B6, B7, B8 and B8A bands;
[0013] The collected reflectivity is converted into the equivalent albedo corresponding to the satellite band, and the conversion formula is: In the formula, is the equivalent remote sensing albedo of the satellite band, , , is the lower limit and upper limit of the band range of the satellite band, is the reflectivity measured by the spectrometer, is the spectral response rate at the wavelength;
[0014] During the sampling process of the lake surface, the coordinates of each sampling point are recorded, the TSM concentration is measured by the calcined filter membrane weighing method, and the Chl-a concentration is measured by the spectrophotometric method based on hot ethanol extraction.
[0015] Furthermore, the combined features mentioned in step S2 are formed by combining the equivalent albedo obtained in step S1 through normalization, power function transformation, ratio, difference, and water index calculation. These combined features are divided into two categories: one category involves normalizing and power function transforming a single equivalent albedo; the other category involves calculating the ratio, difference, and water index of two equivalent albedoes. Each combined feature is fitted to TSM concentration and Chla concentration using the least squares method, and the correlation coefficient is used. Coefficient of determination Root mean square error The top four most relevant feature combinations are selected as the feature inputs for the model. , , The calculation formulas are as follows: Wherein, the total number of samples is used The t-th data set is represented by the symbol. Identifier; the model estimate for the nth data set is used Indicates; the actual concentration of the data in group X is represented by Statement; the first The actual average concentration of the group data is used To express.
[0016] Furthermore, the various machine learning models used in step S3 include K-nearest neighbors algorithm, decision tree, extreme random tree, random forest, adaptive reinforcement, XGBoost decision tree, support vector machine, XGBoost regression, gradient boosting, bagging ensemble, and multilayer perceptron.
[0017] Furthermore, the specific steps for constructing the Multi-strategy Improved Sparrow Search Algorithm (MISSA) in step S4 are as follows:
[0018] S4.1 introduces Sine chaotic mapping and population initialization for opposition learning:
[0019] The Sparrow Search Algorithm (SSA) is constructed. When performing population optimization, SSA introduces a Sine mapping to increase the coverage search range, as shown in the following expression: The sequence value represents the value generated randomly within the interval (0,1) during the iteration process. express Iterated sequence value system parameters The behavior pattern is determined; based on the above expression, the sequence is mapped to the target search space to generate the initial population, as shown in the following equation: This indicates that in generation T, the th The position information of the sparrow in the j-th dimension. and It is the first The upper and lower bounds of the dimensional search space; The chaotic sequence represents values in the interval [0,1]. Then, the sparrows ranked in the top half are selected as the new initial population using the fitness evaluation formula. After forming the initial sparrow population, an opposition learning strategy is applied to create an opposition version of the current population. This opposition population is merged with the initial population generated by the chaotic mapping. In the merged population, the sparrows ranked in the top half are selected as the new initial population.
[0020] S4.2 Update predator position based on transfer probability:
[0021] Within the standard SSA algorithm framework, boundary point information is introduced to guide the predator's exploration towards the search space boundary. During position updates, the movement amplitude is adjusted by referring to the optimal position from the previous iteration. The predator's position update is then defined as follows: In the formula, For a sparrow individual, for a predator individual in generation T+1, its position in the... Dimensional position It was obtained through calculation. The sparrow representing the best performance in the nth generation is in the 1st generation. The position of the dimension The formula represents a random number within the interval (0,1). While this formula expands the predation zone, it may weaken the efficiency of the algorithm's convergence. Therefore, a transition probability strategy is used for optimization, as shown in the following formula. In the formula: Indicates the next round of individual sparrows. Represents the transition probability. Updated regulations for predators under the Standard SSA; The warning value for the population is a uniformly random number in the interval [0,1]; ST is the set population safety threshold, which is set to 0.8. It is a random number that follows a standard normal distribution;
[0022] S4.3 Differential Mutation Strategy for Population Update:
[0023] In the later stage of the SSA algorithm, the strategy of differential evolution is introduced to improve the ability of the algorithm to jump out of the local optimal state in the late iteration, and the newly generated sparrow individual is represented as: In the formula, the mutation factor , and are random numbers in the interval (0, 1); in the T generation, the sparrow individual and refer to two position information randomly selected in dimension.
[0024] Further, the specific steps of step S5 are as follows:
[0025] The MISSA optimization step in step S4 optimizes the model with the best performance in step S3, and the MISSA-GB model is constructed for TSM, and the MISSA-KNN model is constructed for Chla; the following specifications are adopted in the parameter configuration of the MISSA: the total number of sparrow populations is 20, and the maximum number of iterations of the entire population is set to 100; in the population, the predators and the early warners each account for 20% of the total number; the MISSA-GB optimizes two types of parameters: the first type is the maximum number of iterations n_estimators of the weak learner in the Boosting framework parameter and the weight reduction coefficient learning_rate of each weak learner, and the second type is the minimum number of samples min_samples_split required for internal node partitioning and the maximum depth max_depth of the decision tree in the parameters of the weak learner, i.e., the CART regression tree; the MISSA-KNN model mainly optimizes two parameters: the K value and the distance measurement method; the MISSA-GB and the MISSA-KNN are trained by using the field sampling data in step S1, and finally the TSM and Chla concentration distribution of the entire lake surface are inverted by the Sentinel-2 image.
[0026] Advantages: Compared with the prior art, the present application has the following remarkable effects:
[0027] (1) The measured remote sensing reflectance is converted into equivalent remote sensing reflectance corresponding to the satellite band by the spectral response function, so that the radiance / reflectance at the center wavelength displayed by the satellite image can be directly compared with the measured spectral data.
[0028] (2) The use of machine learning method improves the prediction accuracy of the model. By combining multiple variables to construct a complex and accurate model, the complex relationship between band combination and water quality parameters can be better captured, and the regression performance of the model can be improved.
[0029] (3) The water quality parameter concentration training sample fuses a plurality of feature bands most relevant to water quality concentration, and then a machine learning regression model is constructed, so that the feature bands can be fully utilized and the regression accuracy is improved.
[0030] (4) The machine learning model is optimized by using the multi-strategy improved sparrow search algorithm, the initial diversity of the population is improved and the search range is expanded, the ability of the algorithm to jump out of the local optimum is enhanced, and the inversion accuracy of the model is improved. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a flowchart of the method described in the present application;
[0032] Figure 2 is a correlation coefficient distribution diagram of the TSM, Chla concentration and wave band combination model;
[0033] Figure 3 is a MISSA optimized machine learning flowchart;
[0034] Figure 4 is a comparison diagram of the baseline model and the optimized model on the validation set; Figure 4 (a) is the result of the improved SSA optimized TSM concentration inversion model in the validation set, (b) is the result of the improved SSA optimized Chla concentration inversion model in the validation set;
[0035] Figure 5 is a TSM and Chla concentration inversion spatial distribution diagram, Figure 5 (a) is a TSM concentration inversion spatial distribution diagram, (b) is a Chla concentration inversion spatial distribution diagram. DETAILED DESCRIPTION
[0036] In order to elaborate the technical scheme disclosed in the present application, the present application will be further described in detail below with reference to the drawings.
[0037] As shown in Figure 1 , the water quality parameter inversion method of the multi-strategy improved sparrow search algorithm optimized machine learning model of the present application comprises the following steps:
[0038] S1. Obtain the water sample spectrum and convert it into the equivalent albedo corresponding to the Sentinel-2 satellite wave band. Collect water samples, measure TSM and Chla and constitute training samples. At present, Changdang Lake is taken as an example, specifically:
[0039] S1-1. Data acquisition: FieldSpec 4 Hi-Res ground spectrometer produced by Analytical Spectral Devices (ASD) was used to sample Changang Lake with 1 nm interval. Then the measured spectrum was processed to eliminate the influence of the specular reflection component of light, and the reflectivity calculation formula is as follows: R(λ) represents the reflectivity measured by the spectrometer, is the upward radiation brightness of the water body; Rsky(λ) represents the sky reflectivity, is the downward radiation brightness of the sky, which can be directly measured by the ASD spectrometer. Rpanel(λ) represents the emission characteristics of the reference panel radiation brightness, Rpanel(λ) represents the standard reference panel reflectivity obtained by calibration.
[0040] S1-2. Remote sensing reflectivity conversion: Due to the hardware configuration of the sensor, the spectral response rate is not 1 at different wavelength positions, which leads to the difference between the brightness / reflectivity displayed at the center wavelength of the satellite image after atmospheric correction and the actual brightness / reflectivity at the wavelength, so it cannot be directly compared with the measured spectral data. To solve this problem, the measured remote sensing reflectivity is converted into the equivalent albedo corresponding to the satellite band through the spectral response function, and the conversion formula is: wherein, is the equivalent remote sensing albedo of the satellite band, . ~ The center wavelengths of the 443 nm, 490 nm, 560 nm, 665 nm, 705 nm, 740 nm, 783 nm, 842 nm, and 865 nm bands are 443 nm, 490 nm, 560 nm, 665 nm, 705 nm, 740 nm, 783 nm, 842 nm, and 865 nm, respectively. , is the lower limit and upper limit of the band range of the satellite band, R(λ) is the reflectivity measured by the spectrometer, is the spectral response rate at wavelength.
[0041] S.1-3. Training sample construction: Field experiments were carried out on the surface of Changang Lake, and water samples were collected for water quality measurement, including 20 sampling points. The water samples were stored in a refrigerator and then taken back to the laboratory for TSM concentration measurement by weighing the calcined filter membrane, and Chla extraction by spectrophotometry based on hot ethanol extraction. The concentrations of TSM and Chla in the samples were calculated to constitute the training sample. The 20 sets of effective data were divided into two parts: 15 sets were used for training set, and the remaining 5 sets were used as validation set.
[0042] S2. The equivalent albedo obtained in step S1 is combined into a combination feature in the form of single-band and multi-band. The combination feature is fitted with TSM concentration and Chla concentration by least squares method, and the fitting results are compared and evaluated. The top four combination features with correlation are selected as feature input. The combination feature is a combination feature formed by normalizing, power function conversion, ratio, difference, and water body index calculation of the equivalent albedo obtained in step S1. The combination feature is divided into two categories: one is to normalize and power function convert a single equivalent albedo; the other is to calculate the ratio, difference, and water body index of two equivalent albedos. Each combination feature is fitted with TSM concentration and Chla concentration by least squares method, and the correlation coefficient , determination coefficient , and root mean square error are used to select the top four combination features with correlation as feature input of the model,
[0043] S2-1. Best band combination screening of TSM and Chla
[0044] The normalization formula is as follows: is the normalized reflectance at is the reflectance at is the reflectance at is the total number of bands. The band ratio formula is as follows:
[0045] , is the reflectance at , ,
[0046] The band difference formula is as follows: and are the adjacent wavelength spectral reflectance; is The reflectivity difference value of the first and second bands.
[0047] The remote sensing index formula is as follows: is the near-infrared band reflectivity; is the visible band reflectivity. Using the above formula, and using three different band combination methods of ratio, difference, and water body index, the correlation with TSM and Chla concentration is analyzed, Figure 2 is a correlation heat map, and the dark part represents a stronger negative correlation, and the light part represents a stronger positive correlation. After comprehensive consideration, for TSM, the top four correlation combination features are B8, B8 / B5, B7-B8a, and (B8-B5) / (B8+B5); for Chla, the top four correlation combination features are B1, B8 / B8a, B5-B4, and (B8-B8a) / (B8+B8a); for TSM concentration, single-band models in the range of 700-800 nm and band combination models between B5 (705 nm), B7 (783 nm), B8 (842 nm), and B8a (865 nm) are mainly selected for regression modeling. For Chla concentration, single-band models in the range of 675 nm and band combination models between B4 (665 nm), B5 (705 nm), B8 (842 nm), and B8a (865 nm) are mainly selected for regression modeling.
[0048] S2-2. Statistical regression model input
[0049] Table 1 summarizes the feature bands with the highest correlation with TSM and Chla in single-band and combined-band, and constructs various statistical regression models, including least squares, power function, and exponential model.
[0050] Table 1:
[0051] In the validation set, the accuracy indicators of the power function, exponential model, and high-order polynomial model did not reach the level of the least squares model. Therefore, the best fitting model in Table 1 mainly lists the least squares model.
[0052] S3. Combine the TSM and Chla concentration training samples obtained in step S1 with the TSM and Chla concentration most relevant feature bands obtained in step S2 to construct 11 kinds of machine learning regression models, and select the most suitable machine learning model for inverting TSM and Chla concentration.
[0053] In view of the limitations of the measured data of water quality parameters in Changlang Lake, only three band combinations and single band were selected as four-dimensional variables. According to the most relevant characteristic bands of TSM and Chla concentration obtained in the second step, they were input into 11 classical machine learning regression models, including K-Nearest Neighbors (KNN), Decision Tree (DT), Extremely Randomized Trees (ExtraTree), Random Forest (RF), Adaptive Boosting (AdaBoost), XGBoost Decision Tree (XGB-DT), Support Vector Machine (SVM), XGBoost Regression (XGB-R), Gradient Boosting (GB), Bootstrap Aggregating (Bagging), and Multi-Layer Perceptron (MLP) for training. The best inversion model was determined by testing these models on the validation set with RMSE as the measurement standard.
[0054] Table 2 shows the TSM and Chla concentration machine learning regression model RMSE:
[0055] Taking the Changlang Lake area as an example, for TSM concentration, the regression model based on GB is the highest, and the lowest; for Chla concentration, the KNN regression model is the highest, and the lowest. Therefore, the GB regression model is selected for TSM concentration inversion modeling, and the KNN regression model is selected for Chla concentration inversion modeling.
[0056] S4. Introduce multi-strategies such as chaotic mapping, opposite learning, transition probability, and differential mutation to optimize the sparrow search algorithm.
[0057] S4.1. Population initialization based on Sine chaotic mapping and opposite learning
[0058] To enlarge the search range and improve the diversity of the population, chaos theory and opposition-based learning strategy are introduced to generate the initial sparrow population. Sine mapping, as a widely used unimodal chaotic mapping, has the main advantage of simplicity in structure and efficiency in computation. In the boundary region of the search space, the algorithm can generate a large number of numerical values to ensure comprehensive coverage of the search range. The specific expression is as follows: represents the sequence value in the iteration process, is the ratio of the circumference of a circle to its diameter. represents the sequence value after iteration system parameters determine the behavior pattern, and the value of determines the behavior pattern, especially when is in the range of (0.87, 0.93) or (0.95, 1), the system will exhibit chaotic characteristics. represents the jth sparrow in the Tth generation, only the position information of the sparrow in the jth dimension, and are the upper and lower limits of the jth dimension search space. The chaotic sequence represented by is in the interval [0, 1]. After forming the initial sparrow population, the opposition-based learning strategy is applied to create an opposite version of the current population. The opposite population will be merged with the initial population generated by the chaotic mapping. Then, the sparrow individuals with the top half of the fitness ranking are selected from the merged population as the new initial population. (2) Introducing transition probability to update the position of the predator
[0059] Under the standard SSA algorithm framework, the position update of the predator usually follows the following formula:
[0060] In the T+1th generation of the SSA algorithm, the position of the predator individual in the jth dimension, is obtained according to the opposite solution of the sparrow individual . Here, is a random value uniformly distributed in the interval [0, 1]; the maximum number of iterations is ; The warning value for the population is represented by a uniformly random number in the interval [0,1]; ST is the set population safety threshold, usually set to 0.8. It is a random number that follows a standard normal distribution; It is a 1×d matrix where all elements are 1. The position control factor in the formula... Its value always remains within the (0,1) range. However, as the number of iterations increases, this control factor rapidly approaches 0, causing predator individuals to gradually concentrate towards the origin, thus increasing the risk of the algorithm getting trapped in a local optimum. To avoid the control factor rapidly reaching zero and causing the loss of the global optimum, boundary point information needs to be introduced to guide the predators to explore the boundaries of the search space. During position updates, the movement magnitude is adjusted by referring to the optimal position in the previous iteration. This strategy helps the algorithm adjust the predator positions according to the following formula while maintaining a safe threshold, thereby optimizing the search effect: In the formula, for a predator individual in generation T+1, its value in generation T... Dimensional position It was obtained through calculation. The sparrow representing the best performance in generation T is in the... The position is defined by dimensionality, and rand is a random number within the interval (0,1). This formula drives sparrow individuals to spread towards the search boundary, expanding the predation area but potentially reducing the algorithm's convergence efficiency. To resolve this contradiction, a transition probability strategy is adopted. This strategy randomly combines sparrow individuals obtained through the above formula with those obtained through other generation methods, and determines the new position of the sparrow predator by comparing their quality, as shown below: In the formula: Indicates the next round of individual sparrows. Represents the transition probability. Updated regulations for predators under the Standard SSA; The warning value for the population is a uniformly random number in the interval [0,1]; ST is the set population safety threshold, which is set to 0.8. It is a random number that follows a standard normal distribution; where The transition probability is expressed by the following formula:
[0061] In the calculation formula, the fitness value of a sparrow individual is updated using the predator position adjustment formula and the predator position update formula. Based on the p calculation formula, the newly generated sparrow individual... The fitness value determines the transition probability. Size: When fitness is low, The value is correspondingly reduced. This leads to the position update of the Sparrow individual in the T+1 generation being more inclined to adopt the rule of the predator position adjustment formula. Conversely, if the fitness is higher, the probability of position update using the predator position update formula is increased.
[0062] (3) Differential mutation strategy updates the population
[0063] In the later stage of the SSA algorithm, the Sparrow population tends to quickly concentrate around the current optimal solution, increasing the risk of falling into a local optimum. To overcome this, the algorithm introduces a differential evolution strategy to improve the algorithm's ability to escape from a local optimum in the late iteration stage. By applying a differential mutation operation to the lower half of the Sparrow individuals in the parent population and making them search in the direction of the optimal solution, the algorithm strengthens the convergence process. The newly generated Sparrow individuals are as follows:
[0064] The mutation factor , and are random numbers in the interval (0, 1). The Sparrow individuals and refer to the two position information randomly selected in the dimension of the T generation.
[0065] S5. Using the multi-strategy optimized Sparrow search algorithm, the optimal machine learning model obtained in the fourth step is optimized, and water quality inversion is performed on Sentinel-2 images. Finally, the TSM and Chla spatiotemporal inversion sequences are obtained.
[0066] S5.1. Sparrow search algorithm optimizes optimal machine learning model
[0067] Using the MISSA algorithm combined with the machine learning model to invert the water quality parameters of Changdang Lake, taking the GB regression model of TSM concentration as an example, first according to the given initial population individual position information[ , , , i.e. the number of weak learners, the weight reduction coefficient of weak learners, the minimum sample size, and the maximum depth of decision tree), and the objective function is to minimize the error. The GB model is optimized to calculate the water quality parameters. When the MISSA algorithm is used to calculate the water quality parameters, the results calculated by the model are compared with the actual observation values to evaluate the fitness of each result and sort them. Through the implementation of predation, counter predation, transfer probability, and differential variation strategies, the spatial position of the sparrow individuals is adjusted. This series of operations aims to guide the population to evolve towards lower fitness values and find the optimal parameter combination. Finally, the individual with the minimum fitness value is considered as the best solution, which is used to improve the ensemble learning model. In the parameter configuration of the MISSA algorithm, the following specifications are set: the total number of sparrows is set to 20, and the maximum number of iterations of the entire population is set to 100. In the population, the predators and the early warners each account for 20% of the total number. Figure 3 The basic flowchart of the water quality parameter inversion model based on the MISSA algorithm combined with the machine learning model in Changdang Lake is shown in FIG. 1.
[0068] The MISSA algorithm is used to optimize the parameters of the two types of machine learning models GB and KNN with the best effect in the fourth step. Among them, the GB model mainly optimizes two important parameters: the first type is the maximum number of iterations n_estimators of weak learners in the Boosting framework parameters and the weight reduction coefficient learning_rate of each weak learner, and the second type is the minimum sample size min_samples_split and the maximum depth max_depth of the decision tree in the parameters of the weak learner CART regression tree. The KNN model mainly optimizes two parameters: the K value and the distance measurement method. The benchmark parameter settings, parameter variable ranges, and optimal values of each parameter obtained by training iteration are shown in Table 3.
[0069] Table 3:
[0070] In Table 3, n_neighbors: the value of "k" in the KNN model, i.e. the number of neighbors. Specifically, the indicators used to calculate the distance in the KNN model use Manhattan distance when p = 1, Euclidean distance when p = 2, and Minkowski distance when p is other values. The GB and KNN model parameters are set to the optimal values in Table 3, and the benchmark model and the models optimized by SSA and MISSA are obtained. The best machine learning regression model and the regression comparison results of the best machine learning model optimized by SSA and MISSA on the validation set are shown in Table 4. Figure 3
[0071] Table 4:
[0072] From Table 4, it can be seen that the indicators of the GB regression model and the KNN model optimized based on the MISSA algorithm can reach the optimal. respectively, 0.8198, The minimum value is 11.53, 2.6472. The regression comparison results of the optimal machine learning regression model and the optimal machine learning model optimized by SSA and MISSA on the validation set are shown in Figure 4 . From Figure 4 , it can be seen that the prediction value of the improved SSA optimized GB regression model is closer to the 1:1 line in the low concentration interval, but for high concentration TSM concentration, the prediction values of the three models are consistent, and there is a certain error with the true concentration. In summary, the multi-strategy improved sparrow search algorithm optimized GB model has the highest inversion accuracy. From Figure 4 (b) of FIG. 13, it can be seen that the prediction value of the KNN model is closer to the 1:1 line in the low concentration interval, but for high concentration Chla concentration, the prediction value of the KNN regression model has a certain error with the true concentration, but the error of the optimized KNN model is smaller than that of the benchmark KNN fitting model. In summary, the fitting error of the linear fitting model of the two water quality parameters is greater than that of the benchmark machine learning model, and the fitting error of the MISSA optimized machine learning model is smaller than that of the benchmark machine learning model.
[0073] S5.2. Inversion of TSM and Chla spatiotemporal sequence
[0074] The MISSA algorithm optimized GB model and KNN model are applied to the water body of Changdang Lake through the GEE platform to obtain the spatial distribution of TSM and Chla concentration, as shown in Figure 5 . Figure 5Fig. (a) is the inversion of the spatial and temporal distribution of TSM concentration, Fig. (b) is the inversion of the spatial and temporal distribution of Chla concentration. In Fig. (a), the bluer the water area, the lower the TSM concentration, the redder the color, the higher the TSM concentration, the TSM concentration in the western and southern regions is higher, the threshold concentration value is about 100~110mg / L, the concentration in the eastern and northern regions of Changdang Lake is slightly lower, the threshold is about 70~80mg / L. Overall, the TSM concentration in Changdang Lake on this day is relatively high, which is consistent with the data of the sample monitoring section, and the TSM concentration in the lake area ranges from about 40~120mg / L. In Fig. (b), the greener the water area, the lower the Chla concentration, the redder the color, the higher the Chla concentration, the Chla concentration in the western and southern regions is higher, the concentration value ranges from about 20~25ug / L, the concentration in the eastern and northern regions of Changdang Lake is slightly lower, the concentration ranges from about 10~15ug / L. Overall, the Chla concentration in Changdang Lake on this day is relatively high, which is also consistent with the data of the sample monitoring section, and the Chla concentration ranges from about 10~25ug / L. The inversion results clearly reveal the spatial and temporal distribution of the concentration of two water quality parameters in Changdang Lake, and the distribution of the two water quality parameters is similar, both the TSM and Chla concentration in the southwestern water area is higher, and the concentration in the northeastern water area is slightly lower. In summary, the spatial distribution of the two water quality parameters shows that there is a high concentration of TSM and Chla in Changdang Lake on this day.
Claims
1. A multi-strategy improved sparrow search optimization machine learning method for water quality inversion, characterized in that, The method includes the following steps: S1. Use a spectrometer to collect the reflectance of water samples and convert the collected reflectance into the equivalent albedo of the corresponding band of the Sentinel-2 satellite using the spectral response function; collect water samples in the field and measure the TSM concentration and Chla concentration of the water samples. S2. Construct a combined feature from the equivalent albedo obtained in step S1 in the form of single-band and multi-band. Use the least squares method to fit the combined feature with the TSM concentration and Chla concentration, compare and evaluate the fitting results, and select the four combined features with the highest correlation as feature input. S3. For the TSM and Chla concentrations of the water samples collected in step S1, input the features selected in step 2 and use... Using RMSE as a metric, we compared and analyzed the performance of various machine learning models in retrieving TSM concentration and Chla concentration to determine the optimal machine learning model. S4. In the sparrow search algorithm, chaos theory and opposition learning strategy are introduced to generate an initial sparrow population, and the predator position is updated by introducing the transition probability. Then, the population is updated by the differential mutation strategy, thus obtaining a multi-strategy optimized sparrow search algorithm. S5. Optimize the optimal machine learning model obtained in step S3 using the multi-strategy optimized sparrow search algorithm obtained in step S4, perform water quality inversion on Sentinel-2 imagery, and utilize 3 Outliers are filtered out and blank values are interpolated to obtain the inversion sequences of TSM concentration and Chla spatiotemporal concentration.
2. The water quality inversion method based on multi-strategy improved sparrow search optimization machine learning according to claim 1, characterized in that, In step S1, the reflectance of the water sample is collected using a spectrometer at 1 nm intervals. The equivalent albedo of the Sentinel-2 satellite in step S1 is the equivalent albedo of bands B1, B2, B3, B4, B5, B6, B7, B8, and B8A. The collected reflectance is converted into equivalent albedo corresponding to the satellite band using the following formula: In the formula, For satellites Equivalent remote sensing albedo of the band, , , For satellites The lower and upper limits of the band's range. The reflectance is the actual value measured by the spectrometer. for Spectral responsivity at wavelength; During the lake surface sampling process, the coordinates of each sampling point were recorded. The TSM concentration was determined by the calcined filter membrane weighing method, and the Chl-a concentration was determined by the spectrophotometric method based on hot ethanol extraction.
3. The water quality inversion method based on multi-strategy improved sparrow search optimization machine learning according to claim 1, characterized in that, The combined features mentioned in step S2 are formed by combining the equivalent albedo obtained in step S1 through normalization, power function transformation, ratio, difference, and water index calculation. These combined features are divided into two categories: one category involves normalizing and power function transforming a single equivalent albedo; the other category involves calculating the ratio, difference, and water index of two equivalent albedoes. Each combined feature is fitted to TSM concentration and Chla concentration using the least squares method, and the correlation coefficient is used. Coefficient of determination Root mean square error The top four most relevant feature combinations are selected as the feature inputs for the model. , , The calculation formulas are as follows: Wherein, the total number of samples is used The t-th data set is represented by the symbol. Identifier; the model estimate for the nth data set is used Indicates; the actual concentration of the data in group X is represented by Statement; the first The actual average concentration of the group data is used To express.
4. The water quality inversion method based on multi-strategy improved sparrow search optimization machine learning according to claim 1, characterized in that, The various machine learning models used in step S3 include K-nearest neighbors algorithm, decision tree, extreme random tree, random forest, adaptive reinforcement, XGBoost decision tree, support vector machine, XGBoost regression, gradient boosting, bagging ensemble, and multilayer perceptron.
5. The water quality inversion method based on multi-strategy improved sparrow search optimization machine learning according to claim 1, characterized in that, The specific steps for constructing the multi-strategy improved sparrow search algorithm MISSA in step S4 are as follows: S4.1 introduces Sine chaotic mapping and population initialization for opposition learning: The Sparrow Search Algorithm (SSA) is constructed. When performing population optimization, SSA introduces a Sine mapping to increase the coverage search range, as shown in the following expression: The sequence value represents the value generated randomly within the interval (0,1) during the iteration process. express Iterated sequence value system parameters The behavior pattern is determined; based on the above expression, the sequence is mapped to the target search space to generate the initial population, as shown in the following equation: This indicates that in generation T, the th The position information of the sparrow in the j-th dimension. and It is the first The upper and lower bounds of the dimensional search space; The chaotic sequence represents values in the interval [0,1]. Then, the sparrows ranked in the top half are selected as the new initial population using the fitness evaluation formula. After forming the initial sparrow population, an opposition learning strategy is applied to create an opposition version of the current population. This opposition population is merged with the initial population generated by the chaotic mapping. In the merged population, the sparrows ranked in the top half are selected as the new initial population. 6.S4.2 Update predator position based on transfer probability: Within the standard SSA algorithm framework, boundary point information is introduced to guide the predator's exploration towards the search space boundary. During position updates, the movement amplitude is adjusted by referring to the optimal position from the previous iteration. The predator's position update is then defined as follows: In the formula, For a sparrow individual, for a predator individual in generation T+1, its position in the... Dimensional position It was obtained through calculation. The sparrow representing the best performing sparrow in the nth generation is in the... The position of the dimension The formula represents a random number within the interval (0,1). While this formula expands the predation zone, it may weaken the efficiency of the algorithm's convergence. Therefore, a transition probability strategy is used for optimization, as shown in the following formula. In the formula: Indicates the next round of individual sparrows. Represents the transition probability. Updated regulations for predators under the Standard SSA; The warning value for the population is a uniformly random number in the interval [0,1]; ST is the set population safety threshold, which is set to 0.
8. It is a random number that follows a standard normal distribution; S4.3 Differential Mutation Strategy for Population Update: In the later stages of the SSA algorithm, a differential evolution strategy is introduced to improve the algorithm's ability to escape local optima in the late iteration phase. The newly generated sparrow individuals are represented as follows: In the formula, the variation factor , and It is a random number within the interval (0,1); in the Tth generation, the sparrow individuals and It refers to Information on two randomly selected locations in a given dimension.
7. The water quality inversion method based on multi-strategy improved sparrow search optimization machine learning according to claim 5, characterized in that, The specific steps of step S5 are as follows: The best-performing model from step S3, optimized by MISSA in step S4, is constructed as the MISSA-GB model for TSM concentration and the MISSA-KNN model for Chla concentration. The MISSA parameter configuration follows these specifications: the total sparrow population is set to 20, and the maximum number of iterations for the entire population is set to 100; predators and early warning birds each comprise 20% of the population. MISSA-GB optimizes two types of parameters: first, the maximum number of iterations n_estimators and the weight reduction coefficient learning_rate for each weak learner in the Boosting framework; second, the minimum number of samples required for splitting internal nodes in the CART regression tree (min_samples_split) and the maximum depth max_depth of the decision tree. The K-value and distance metric are optimized for the MISSA-KNN model. MISSA-GB and MISSA-KNN are trained using the field sampling data from step S1, and finally, the TSM and Chla concentration distributions of the entire lake surface are retrieved using Sentinel-2 imagery.
Citation Information
Patent Citations
Hyperspectral remote sensing water quality parameter inversion method and device, electronic equipment and storage medium
CN117407710A
Water quality multi-source remote sensing data rapid inversion method based on spectrum library
CN117434034A
Hyperspectral remote sensing water quality chlorophyll inversion method based on SSA-XGBOOST algorithm
CN117470776A
Surface Water Quality Monitoring Method Based on High Spatial Resolution Satellite
US20240151703A1
