Water visibility prediction method and system based on SVR algorithm

Through the combination of SVR algorithm and multi-sensors, a mapping model from water parameters to visibility distance is constructed, which solves the problems of low efficiency and poor accuracy of water visibility measurement in the existing technology, and achieves efficient and accurate prediction of water visibility, which is suitable for oceans, rivers, lakes, reservoirs and fish ponds.

CN120354703APending Publication Date: 2025-07-22SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510317876.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing water visibility measurement methods rely on manual observations, are inefficient and are susceptible to subjective and environmental factors, resulting in large measurement errors and making it difficult to achieve high-precision and efficient water visibility prediction.

Method used

The support vector regression (SVR) algorithm is used and a variety of sensor devices, and the mapping relationship model from the water parameter to the visible distance is constructed, and the visual critical threshold T and Kalman filtering technology are used to optimize the model parameters and realize automated prediction.

Benefits of technology

It improves the accuracy and efficiency of water visibility prediction, reduces manual operation steps and subjective errors, is suitable for a variety of water environments, and provides an efficient and accurate water visibility prediction system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354703A_ABST
    Figure CN120354703A_ABST
Patent Text Reader

Abstract

The invention discloses a water body visibility prediction method and system based on an SVR algorithm, and the method comprises the steps: determining a visual critical threshold value T which can quantify the visual features of a Saikowski disk when the Saikowski disk is just invisible underwater; collecting water body visible distance data in different water body environments, and collecting water body parameter data by using various sensor devices; using a support vector regression (SVR) algorithm to construct an SVR mapping relation model from the water body parameters to the water body visible distance; an underwater sensing device is adopted to collect water body parameter data, and the water body visible distance is predicted through the constructed mapping relation model. The method has relatively high data acquisition efficiency and prediction precision, and can be suitable for various water area environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water body detection, and particularly relates to a water visibility prediction method and system based on the SVR algorithm. Background Art

[0002] As an important indicator for water quality assessment, water visibility can not only reflect the distribution of suspended substances in water, but also directly affect the safety of underwater operations. Since the decrease in visibility is often a signal of water quality deterioration and increased ecological risk, this not only threatens the living environment of aquatic organisms, but also affects the sustainable utilization of fishery resources, ecological protection, and public health. Therefore, accurately measuring water visibility is of extremely important significance for early identification of pollutants, optimization of water quality management, protection of aquatic ecosystems, and improvement of the efficiency and safety of diving operations, etc.

[0003] Existing water visibility estimation methods mainly rely on manual measurement. Observers usually need to spend several minutes to distinguish the position where the Secchi disk is just invisible, and measure multiple times to ensure the accuracy of the data, which is not only time-consuming but also inefficient. In addition, the measurement results may be affected by various factors, including the subjective conditions of the observer (such as eyesight, operation proficiency) and external environmental factors (such as water surface stability, wind speed, etc.), and these factors are likely to cause measurement errors. Although some patents, such as CN202211194477.9, have realized driving the Secchi disk to descend by a motor, the determination of the invisible position of the Secchi disk still depends on manual observation. There are also some patents, such as CN202210485408.7, which attempt to replace manual naked-eye judgment through image processing technology, but the definition of the Secchi disk being just invisible is still too subjective. Therefore, in order to improve the accuracy and efficiency of water visibility prediction, it is urgent to develop a water visibility prediction system and method with high prediction accuracy, simple operation, and low cost. Summary of the Invention

[0004] The purpose of the present invention is to overcome the deficiencies existing in the prior art and provide a water visibility prediction method and system based on the SVR algorithm. This method has high data acquisition efficiency and prediction accuracy and can be applied to various water environments.

[0005] The purpose of the present invention is achieved by the following technical solutions:

[0006] A water visibility prediction method based on the SVR algorithm includes the following steps:

[0007] (1) Threshold setting: Determine a visual critical threshold T, which can quantify the visual characteristics when the Secchi disk is just invisible underwater;

[0008] (2) Data collection: According to the threshold value set in step (1), collect the water visibility distance data in different water environments, and at the same time collect the water parameter data using a variety of sensor devices;

[0009] (3) Model construction: Use the support vector regression (SVR) algorithm to construct an SVR mapping relationship model from water parameters to water visibility distance based on the data obtained in step (2);

[0010] (4) Prediction application: Adopt an underwater sensing device to collect water parameter data, and predict the water visibility distance through the constructed mapping relationship model.

[0011] In step (1), the determination of a visual critical threshold T includes the following steps:

[0012] (1-1) Set up an experimental environment, set the experimental turbidity according to the turbidity of the ocean, river, lake, reservoir and fish pond; determine the experimental water depth according to natural water bodies and fishery activities (fishing, catching, feeding); simulate the changes in sunlight color temperature, brightness and irradiance from early morning to sunset, and select representative moments to set the lighting conditions; design more than 10 sets of orthogonal experiments on turbidity, water depth and lighting;

[0013] (1-2) Adjust the lighting and water turbidity according to the orthogonal experiment designed in step (1-1), fix the camera in the water at the specified depth, place the Secchi disk directly in front of the camera, and gradually move it away from the camera until multiple experimenters simultaneously determine that the Secchi disk is just invisible. Save the picture of the Secchi disk at this time and record the distance data between it and the camera; repeat the experiment for the same experimental environment to obtain multiple pictures of the Secchi disk and the corresponding distance data;

[0014] (1-3) Shuffle the order of the pictures obtained in step (1-2), and let multiple experimenters judge whether the Secchi disk is visible. Statistically calculate the visibility rate of each picture. The calculation formula of the visibility rate is as follows:

[0015]

[0016] where, V is the visibility rate; M is the total number of experimenters participating in the judgment; I i is an indicator function. When the i-th experimenter judges that the Secchi disk is visible, I i =1, otherwise I i =0; represents the number of experimenters who judge that the Secchi disk is visible among all the experimenters participating in the judgment;

[0017] The images collected in the same experimental environment are sorted according to the visible distance to observe whether the visibility rate decreases as the distance from the camera to the Secchi disk increases; any abnormal data points whose visibility rate increases as the distance increases will be removed to ensure the consistency and rationality of the data set;

[0018] (1-4) Select a picture with a visibility rate between 40% and 60%, use the perceived brightness method to simulate the observation characteristics of the human eye, calculate the contrast of black and white blocks, and reduce the pixel selection error by the neighborhood average method; arrange the calculated contrast in ascending order, select two sets of data with more obvious contrast changes before and after, record them as Ai and Bi, as the pre-selected data of the visual critical threshold T;

[0019] (1-5) Construct the loss function of the visual critical threshold T: For the Secchi disk image obtained in step (1-2), if the visibility rate is greater than 50%, the theoretically calculated black and white area contrast of the Secchi disk should be greater than the currently set threshold T; conversely, if the visibility rate is less than 50%, the contrast should be less than the threshold T, which verifies the rationality of the threshold T; if the visibility rate is greater than 50% but the contrast is less than the threshold T, it means that the threshold T is set unreasonably; the loss function formula is as follows, where N expected Indicates the number of times it meets expectations, and N indicates the total number of experiments:

[0020]

[0021] (1-6) For Ai and Bi obtained in step (1-4), calculate the loss function value when they are used as the visual critical threshold; use the binary search method to search between Ai and Bi to find the value that minimizes the loss function and determine it as the visual critical threshold T.

[0022] In step (2), the collection of water body parameter data and water body visibility distance data includes the following steps:

[0023] (2-1) Introducing Kalman filtering to improve data acquisition efficiency: fix the Secchi disk at a certain position, keep it relatively still with the camera, and control the environmental variables to remain unchanged; count and analyze the fluctuation of the contrast between the black and white areas of the Secchi disk, and calculate the adaptive Kalman filter process noise covariance matrix and the observation noise covariance matrix according to the fluctuation size;

[0024] (2-2) Place the Secchi disk directly in front of the camera, use Kalman filtering and the perceived brightness method to calculate the contrast of the black and white areas of the Secchi disk in real time, and reduce the pixel selection error through the neighborhood averaging method; gradually move the Secchi disk away from the camera until the contrast drops to the visual critical threshold T; record the distance from the camera to the Secchi disk as the underwater visibility distance of the current water body; then, use turbidity, illuminance, irradiance, and water depth sensors to measure the water body parameter data at the location of the Secchi disk; obtain a set of mapping data groups from water body parameters to water body visibility distance.

[0025] (2-3) Adjust the turbidity, illuminance, irradiance of the water body and the depth of the Secchi disk underwater, and repeat step (2-2); obtain more than 200 sets of mapping data groups from water body parameters to water body visibility distance.

[0026] In step (3), the construction of the mapping relationship model from water body parameters to water body visibility distance includes the following steps:

[0027] (3-1) Perform data cleaning on the collected data, remove outliers, and perform Z-score normalization processing according to Equation (3);

[0028]

[0029] In the formula: x is the original data point, μ is the mean of the original data, σ is the standard deviation of the original data, and Z is the normalized value;

[0030] (3-2) Divide the processed data into a training set and a validation set according to a ratio of 8:2;

[0031] (3-3) Assume that the data set is an n-dimensional training set X = {(x i , y i ) | i = 1, 2,..., n}, and there exists a model:

[0032] f(x) = ω T x + b (4)

[0033] This model can fit the training data (x i , y i ) as much as possible; where f(x) is the predicted value of the output variable, x is the input variable, ω is the weight vector, and b is the bias;

[0034] (3-4) The goal of the SVR model is to find a hyperplane such that most data points are within the range of the interval band (ε-band) of this hyperplane, while minimizing the deviation of the data points outside the interval band; to allow some data points to be outside the interval band and control their deviation, introduce slack variables ξ i , In addition, SVR also controls the complexity of the model through regularization, thus ensuring that the model has good generalization ability. Therefore, the objective function of the SVR model is transformed into:

[0035]

[0036] Among them, is the regularization term, representing the complexity of the model; C is the penalty parameter, representing the tolerance control of the error; ξ i , are slack variables, representing the degree to which the error between the predicted value and the true value exceeds ε; m represents the number of data in the training set;

[0037] (3-5) Introduce Lagrange multipliers to transform the constrained problem into an unconstrained problem, and obtain the corresponding Lagrangian function:

[0038]

[0039] Among them, α, η, are all Lagrange multipliers. The first two correspond to the inequality constraints, and the last two correspond to the non-negativity constraints;

[0040] Finally, the problem is transformed into:

[0041]

[0042] Finally, by taking the derivative, simplifying and substituting into the Lagrangian dual problem, the final model of SVR is obtained as:

[0043]

[0044] Among them, is the Lagrange multiplier obtained from the dual problem; φ(x i ) T φ(x i ) represents the inner product after mapping the input variable to a high-dimensional space; in this model, the radial basis function (RBF) is used as the kernel function, and its calculation formula is as follows:

[0045] K(x i ,x j )=exp(-γ||x i -x j || 2 ) (9)

[0046] In the formula, γ is the parameter of the RBF kernel function, controlling the smoothness of the function; ||x i -x j || 2 is the Euclidean distance between the input variables;

[0047] (3 - 6) The particle swarm optimization (PSO) algorithm is adopted, with the mean square error (MSE) as the fitness index of the particles, to search for the best combination of the penalty parameter C and the hyperparameter γ of the RBF kernel function that minimizes the MSE, and it is applied to the SVR model.

[0048] In step (3 - 6), the adoption of the particle swarm optimization algorithm to find the optimal model parameters includes the following steps:

[0049] (3 - 6 - 1) A group of particles is randomly generated. Each particle represents a combination of hyperparameters of the SVR, including the penalty parameter C and the hyperparameter γ of the RBF kernel function; the current position of each particle represents a set of hyperparameters, and the velocity of the particle determines the direction and amplitude of the next parameter adjustment; the position and velocity of each particle are randomly initialized, and these positions and velocities are randomly distributed within a predetermined parameter space.

[0050] (3 - 6 - 2) With the mean square error (MSE) as the objective function, the position of each particle (i.e., the combination of hyperparameters) is applied to the SVR model; after running the model, the predicted water body visibility value is calculated. And the true water body visibility value y i The mean square error value between them is used as the fitness of the particle, reflecting the quality of the current combination of hyperparameters; the lower the fitness value of the particle, the better the performance of the combination of hyperparameters; each particle records the position of the hyperparameters with the lowest fitness in its own history as the individual best position (pBest) of the particle.

[0051]

[0052] Among them, y i is the true water body visibility value, is the water body visibility value predicted by the SVR model;

[0053] (3 - 6 - 3) According to the fitness of the particle and the position of the global optimal particle (i.e., the position of the particle with the lowest fitness in the history of the entire particle swarm), the velocity and position of each particle are updated; the velocity update formula is as follows:

[0054] v i (t + 1) = ωv i (t) + c1r1(pBest i -x i (t)) + c2r2(gBest - x i (t)) (11)

[0055] Among them, ν i (t) is the velocity of particle i at time t, x i (t) is the position of particle i, pBest i$pBest$ is the individual best position of the particle, and $gBest$ is the position of the globally optimal particle; $c1$ is the cognitive factor, which is used to control the degree of movement of the particle towards its own historical optimal solution $pBest$. i $c2$ is the social factor, which is used to control the degree of movement of the particle towards the globally optimal solution $gBest$; $r1$ and $r2$ are random numbers between $[0,1]$, which are used to increase the diversity of the search; the particle velocity is updated through this formula, and the position of the particle is updated through the updated velocity.

[0056] (3-6-4) Repeatedly calculate the fitness of the particle and update the position and velocity of the iterated particle, so that the particle continues to search in the hyperparameter space; in each iteration, the particle will update its position and velocity according to the current fitness and the position of the globally optimal particle until there is no significant change in the fitness in the particle swarm.

[0057] (3-6-5) When the search process of the particle swarm converges, the parameter position of the globally optimal particle is the optimal SVR hyperparameter (i.e., the optimal penalty parameter $C$ and the RBF kernel function parameter $\gamma$); these optimal parameters are selected as the optimal hyperparameters of the SVR model, and the SVR model is retrained and predicted.

[0058] In step (4), the prediction application is to input the collected water body parameter data $x$ into the SVR mapping relationship model to obtain the prediction result $f(x)$, and this value is the required water body visibility.

[0059] The present invention also provides a water body visibility prediction system based on the SVR algorithm, including:

[0060] (1) A water body parameter acquisition module, which is used to acquire water body parameter data; the water body parameter acquisition module includes a turbidity sensor, an illuminance sensor, an irradiance sensor, and a water depth sensor; the water body parameter data includes turbidity, illuminance, irradiance, and water depth data.

[0061] (2) A processing module, which is used to screen the data acquired by the water body parameter acquisition module, perform standardization processing on the data that meets the requirements, and input it into the trained SVR mapping relationship model to obtain the predicted water body visibility.

[0062] (3) A power supply module, which is used to provide stable power for the water body parameter acquisition module, the processing module, and the visibility visualization module.

[0063] (4) A visibility visualization module, which is used to display the horizontal visibility value predicted by the processing module.

[0064] (5) A control module, which is used to send a detection instruction to trigger the data acquisition and processing process.

[0065] The power supply module is electrically connected to the water body parameter acquisition module, the processing module, and the visibility visualization module respectively; the water body parameter acquisition module is connected to the processing module through serial communication; the processing module is connected to the visibility visualization module through serial communication; the control module is connected to the processing module through serial communication.

[0066] Compared with the prior art, the present invention has the following advantages and effects:

[0067] (1) In the process of determining the visual critical threshold T of the Secchi disk in the present invention, multiple professionally trained staff members make judgments and select the image when the Secchi disk is just invisible, avoiding the error caused by single subjective evaluation.

[0068] (2) The present invention uses the perceived brightness method to calculate the contrast of the black and white areas of the Secchi disk, and reduces the error caused by pixel point selection through the neighborhood averaging method. The perceived brightness method is based on the linearized brightness calculation of the sRGB standard, converts the RGB value into the perceived brightness through a non-linear function, and then calculates the contrast. This method comprehensively considers the different sensitivities of the human eye to the three RGB channels, and the calculation result is closer to the visual perception of the human eye.

[0069] (3) The present invention constructs a loss function for the visual critical threshold T, which can effectively find the optimal visual critical threshold and verify the rationality of its setting.

[0070] (4) The present invention introduces Kalman filtering in the process of experimental data acquisition, effectively reducing the influence of underwater environmental interference on the contrast fluctuation, accelerating data convergence, and ensuring the effectiveness and accuracy of data collection.

[0071] (5) The present invention adopts the SVR algorithm suitable for small sample data, and maps the data to a high-dimensional space through the RBF kernel function to process the complex non-linear relationship between the four water body parameters. Subsequently, the particle swarm optimization algorithm (PSO) is used to efficiently search for the optimal parameters, thereby improving the operation efficiency of the model and the accuracy of the algorithm.

[0072] (6) The present invention provides a method for predicting water body visibility, collects water body parameter data through a variety of sensor devices, and inputs the data into the model to achieve accurate prediction of water body visibility, significantly improving the prediction effect, eliminating the cumbersome steps in manual observation, and also avoiding the error caused by manual judgment.

[0073] (7) The present invention has a wide range of applications and can be used in many water body environments such as the ocean, rivers, lakes, reservoirs, and fish ponds. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a schematic structural connection diagram of the water body visibility prediction system.

[0075] Figure 2 It is a step flow chart of a water body visibility prediction system.

[0076] Figure 3 It is a flow chart of a water body visibility prediction method. Detailed implementation manners

[0077] For the convenience of understanding the present invention, the present invention will be 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. However, the present invention is not limited in any form. It should be noted that for those skilled in the art, without departing from the concept of the present invention, the present invention can be made with several deformations and improvements, and these all belong to the protection scope of the present invention.

[0078] Embodiment 1

[0079] As Figure 1 shown, the present invention provides a water body visibility prediction system based on the SVR algorithm. The system includes a water body parameter acquisition module, a processing module, a power supply module, a visibility visualization module, and a control module.

[0080] The water body parameter acquisition module is communicatively connected to the processing module through a serial port. The power supply module is electrically connected to the water body parameter acquisition module. The power supply module is electrically connected to the processing module. The power supply module is electrically connected to the visibility visualization module. The processing module is communicatively connected to the visibility visualization module through a serial port. The control module is communicatively connected to the processing module through a serial port.

[0081] As Figure 2 shown is the working flow chart of the water body visibility prediction system based on the SVR algorithm of the present invention:

[0082] Step 1: The control module sends a "detection" instruction to the processing module through serial communication.

[0083] Step 2: The processing module sends an instruction to the water body parameter acquisition module through serial communication. The water body parameter acquisition module simultaneously drives the turbidity, illuminance, irradiance, and depth sensors to synchronously collect water body parameter data.

[0084] Step 3: The water body parameter acquisition module transmits the collected data to the processing module through serial communication. The processing module determines whether the data is within a preset range. If it meets the requirements, the data is input into the trained SVR model to predict the water body visibility; if it does not meet the requirements, steps 1 and 2 are repeated until the data meets the preset standard.

[0085] Step 4: The processing module sends the water body visibility data to the visibility visualization module through serial communication, and the visibility visualization module displays the value.

[0086] As shown Figure 3 in the following figure is the flowchart of the water visibility prediction method based on the SVR algorithm of the present invention:

[0087] Step 1, data collection and preprocessing: Determine the visual critical threshold T. Use the perceived brightness method and Kalman filter to calculate the contrast between the black and white areas of the Secchi disk in real time until the contrast drops to the visual critical threshold T. At this time, measure the horizontal distance from the camera to the Secchi disk as the water visibility distance. Subsequently, use a variety of sensor devices to measure the water parameter data at the Secchi disk, including turbidity, illuminance, irradiance, water depth, etc. Clean the collected data of outliers and perform standardization processing using the Z-score normalization method. Finally, divide the data set into a training set and a test set according to a ratio of 8:2.

[0088] Step 2, SVR model training and hyperparameter optimization: Initialize the hyperparameters of the SVR model, including the penalty coefficient C and the kernel function parameter γ, etc. Use the initial hyperparameters to train the SVR model on the training set and verify it on the test set to evaluate the fitness of the current hyperparameters. Continuously search the parameter space through the particle swarm optimization algorithm (PSO) to optimize the model parameters until the particle fitness no longer changes significantly, so as to obtain the best hyperparameter combination and finally obtain the water visibility prediction model.

[0089] Step 3, water visibility prediction: Use sensor devices to obtain water parameter data and input the data into the trained SVR model for prediction, so as to obtain the water visibility.

[0090] Combined with the training results, the effect of the SVR algorithm model is further described in detail. The present invention uses the coefficient of determination R 2 , root mean square error RMSE, and mean absolute error MAE three indicators to evaluate the performance of the model.

[0091] Among them, the closer the R 2 value is to 1, the better the model fitting effect; when RMSE and MAE are closer to 0, it means that the prediction accuracy of the model is higher and the fitting effect is better. The formula definitions of the three evaluation indicators are as follows:

[0092]

[0093] Among them, y i is the true water visibility value, is the water visibility value predicted by the SVR model, is the average value of the true water visibility values, and N is the number of samples.

[0094] The present invention trained the SVR model with 150 groups of water parameter data obtained from experiments. Among them, R 2= 0.894, RMSE = 0.061, MAE = 0.043, indicating that the constructed model has strong fitting ability and good prediction accuracy.

[0095] It can be understood that the above specific description of the present invention is only for explaining the present invention and is not limited to the technical solutions described in the embodiments of the present invention. Those of ordinary skill in the art should understand that local modifications or equivalent replacements can still be made to the present invention to achieve the same technical effects; as long as the use requirements are met, they are all within the protection scope of the present invention.

Claims

1. A method for predicting water visibility based on the SVR algorithm, characterized in that The steps include: (1) Threshold setting: Determine a visual critical threshold T, which can quantify the visual characteristics of the Secchi disk when it is just invisible underwater; (2) Data collection: According to the threshold value set in step (1), water visibility distance data is collected in different water environments, and water parameter data is collected using a variety of sensor devices; (3) Model construction: Using the support vector regression (SVR) algorithm, based on the data obtained in step (2), a SVR mapping relationship model from water body parameters to water body visibility distance is constructed; (4) Prediction application: Underwater sensing devices are used to collect water parameter data, and the visibility distance of the water body is predicted through the constructed mapping relationship model.

2. The method for predicting water body visibility according to claim 1, characterized in that: In step (1), determining a visual critical threshold T comprises the following steps: (1-1) Build the experimental environment and design more than 10 orthogonal experiments on turbidity, water depth and light intensity; (1-2) Adjust the illumination and water turbidity according to the orthogonal experiment designed in step (1-1), fix the camera in the water at a specified depth, place the Secchi disk in front of the camera, and gradually move it away from the camera until multiple experimenters simultaneously determine that the Secchi disk is just invisible, save the image of the Secchi disk at this time and record the distance data between the Secchi disk and the camera; repeat the experiment for the same set of experimental environments to obtain multiple Secchi disk images and corresponding distance data; (1-3) The order of the images obtained in step (1-2) is disrupted, and multiple experimenters are asked to judge whether the Secchi disk is visible. The visibility rate of each image is counted. The calculation formula of the visibility rate is as follows: Wherein, V is the visibility rate; M is the total number of experimenters participating in the judgment; I i is an indicator function. When the i-th experimenter judges that the Secchi disk is visible, I i = 1; otherwise, I i = 0; represents the number of experimenters who judge that the Secchi disk is visible among all the experimenters participating in the judgment; The images collected in the same experimental environment are sorted according to the visible distance to observe whether the visibility rate decreases as the distance from the camera to the Secchi disk increases; any abnormal data points whose visibility rate increases as the distance increases will be removed to ensure the consistency and rationality of the data set; (1-4) Select a picture with a visibility rate between 40% and 60%, use the perceived brightness method to simulate the observation characteristics of the human eye, calculate the contrast of black and white blocks, and reduce the pixel selection error by the neighborhood average method; arrange the calculated contrast in ascending order, select two sets of data with more obvious contrast changes before and after, record them as Ai and Bi, as the pre-selected data of the visual critical threshold T; (1-5)Construct the loss function of the visual critical threshold T: For the Secchi disk pictures obtained in step (1-2), if the visibility rate is greater than 50%, the calculated contrast between the black and white areas of the Secchi disk should be greater than the currently set threshold T in theory; conversely, if the visibility rate is less than 50%, the contrast should be less than the threshold T, which verifies the rationality of the threshold T; if there is a situation where the visibility rate is greater than 50% but the contrast is less than the threshold T, it indicates that the setting of the threshold T is unreasonable; the loss function formula is as follows, where N expected represents the number of times meeting the expectation, and N represents the total number of experiments: (1-6) For Ai and Bi obtained in step (1-4), calculate the loss function value when they are used as the visual critical threshold; use the binary search method to search between Ai and Bi to find the value that minimizes the loss function and determine it as the visual critical threshold T.

3. The method for predicting water body visibility according to claim 1, wherein: In step (2), the collection of water body parameter data and water body visibility distance data includes the following steps: (2-1) Introducing Kalman filtering to improve data acquisition efficiency: fix the Secchi disk at a certain position, keep it relatively still with the camera, and control the environmental variables to remain unchanged; Statistics and analysis of the fluctuation of the contrast between black and white areas of the Secchi disk are performed, and the adaptive Kalman filter process noise covariance matrix and the observation noise covariance matrix are calculated according to the fluctuation size; (2-2) Place the Secchi disk directly in front of the camera, and use the Kalman filter and the perceived brightness method to calculate the contrast of the black and white areas of the Secchi disk in real time, and reduce the pixel selection error by the neighborhood averaging method; gradually move the Secchi disk away from the camera until the contrast drops to the visual critical threshold T; record the distance from the camera to the Secchi disk as the underwater visibility distance of the current water body; then, use the turbidity, illuminance, irradiance, and water depth sensors to measure the water body parameter data at the location of the Secchi disk; obtain a set of mapping data groups from water body parameters to water body visibility distance. (2-3) Adjust the turbidity, illuminance, irradiance of the water body and the depth of the Secchi disk underwater, and repeat step (2-2); obtain more than 200 sets of mapping data groups from water body parameters to water body visibility distance.

4. The method for predicting water body visibility according to claim 1, wherein: In step (3), the construction of the mapping relationship model from water body parameters to water body visibility distance includes the following steps: (3-1) Perform data cleaning on the collected data, remove outliers, and perform Z-score normalization processing according to Equation (3); In the formula: x is the original data point, μ is the mean of the original data, σ is the standard deviation of the original data, and Z is the normalized value; (3-2) Divide the processed data into a training set and a validation set according to a ratio of 8:2; (3-3) Suppose the dataset is an n-dimensional training set X = {(x i , y i ) | i = 1, 2,..., n}, and there exists a model: f(x) = ω T x + b (4) The model can fit the training data (x i , y i ) as well as possible; where f(x) is the predicted value of the output variable, x is the input variable, ω is the weight vector, and b is the bias; (3-4) The goal of the SVR model is to find a hyperplane such that most data points lie within the margin band (ε-band) of the hyperplane, while minimizing the deviation of data points outside the margin band; to allow some data points to be outside the margin band and control their deviation, slack variables ξ are introduced i , In addition, SVR also controls the complexity of the model through regularization, thus ensuring that the model has good generalization ability. Therefore, the objective function of the SVR model is transformed into: Among them, is a regularization term, representing the complexity of the model; C is a penalty parameter, representing the tolerance control of errors; ξ i , is a slack variable, representing the degree to which the error between the predicted value and the true value exceeds ε; m represents the number of data in the training set; (3-5) Introduce the Lagrange multiplier to transform the constrained problem into an unconstrained problem, and obtain the corresponding Lagrangian function: where α, η, are all Lagrange multipliers, the first two corresponding to inequality constraints and the last two corresponding to non-negativity constraints; The final problem is transformed into: Finally, by taking the derivative, simplifying and substituting into the Lagrangian dual problem, the final model of SVR is obtained as: Among them, is the Lagrange multiplier obtained in the dual problem; φ(x i ) T φ(x i ) represents the inner product after mapping the input variables to a high-dimensional space; in this model, the radial basis function (RBF) is used as the kernel function, and its calculation formula is as follows: K(x i ,x j ) = exp(-γ||x i -x j || 2 ) (9) where γ is the parameter of the RBF kernel function, controlling the smoothness of the function; ||x i -x j || 2 is the Euclidean distance between the input variables; (3-6) Adopt the particle swarm optimization (PSO) algorithm, use the mean square error (MSE) as the fitness index of the particle, search for the best combination of the penalty parameter C and the RBF kernel function hyperparameter γ that minimizes the MSE, and apply it to the SVR model.

5. The method for predicting water body visibility according to claim 4, wherein: In step (3-6), the particle swarm optimization (PSO) algorithm includes the following steps: (3-6-1) Randomly generate a group of particles, each particle represents a set of hyperparameter combinations of SVR, including the penalty parameter C and the RBF kernel function hyperparameter γ; the current position of each particle represents a set of hyperparameters, and the velocity of the particle determines the direction and amplitude of the next parameter adjustment; randomly initialize the position and velocity for each particle, and these positions and velocities are randomly distributed within the predetermined parameter space; (3-6-2) Using the mean squared error (MSE) as the objective function, apply the position of each particle (i.e., the hyperparameter combination) to the SVR model; after running the model, calculate the water visibility value predicted by the model and the true water visibility value y i The mean squared error value between them is used as the fitness of the particle, reflecting the quality of the current hyperparameter combination; the lower the fitness value of the particle, the better the performance of the hyperparameter combination; each particle records the hyperparameter position with the lowest fitness in its history as the individual best position (pBest) of the particle. Among them, y i is the true water body visibility value, and is the water body visibility value predicted by the SVR model; (3-6-3) Update the velocity and position of each particle according to the fitness of the particle and the position of the global optimal particle (i.e., the position of the particle with the lowest fitness in the history of the entire particle swarm); the velocity update formula is as follows: v i (t + 1) = ωv i (t) + c1r1(pBest i -x i (t)) + c2r2(gBest - x i (t)) (11) where, ν i (t) is the velocity of particle i at time t, x i (t) is the position of particle i, pBest i is the individual best position of the particle, and gBest is the position of the globally optimal particle; c1 is the cognitive factor, which is used to control the degree of movement of the particle towards its own historical best solution pBest i direction; c2 is the social factor, which is used to control the degree of movement of the particle towards the globally optimal solution gBest direction; r1, r2 are random numbers between [0,1], which are used to increase the diversity of the search; the particle velocity is updated through this formula, and the position of the particle is updated through the updated velocity; (3-6-4) Repeatedly calculate the fitness of the particle and update the position and velocity of the iterative particle, so that the particle continues to search in the hyperparameter space; in each iteration, the particle updates its position and velocity according to the current fitness and the position of the global optimal particle until there is no significant change in the fitness in the particle swarm; (3-6-5) When the particle swarm search process converges, the parameter position of the global optimal particle is the optimal SVR hyperparameter (i.e., the optimal penalty parameter C and the RBF kernel function parameter γ); these optimal parameters are selected as the optimal hyperparameters of the SVR model, and the SVR model is retrained and predicted.

6. The method for predicting water body visibility according to claim 1, characterized in that: In step (4), the prediction application is to input the collected water body parameter data x into the SVR mapping relationship model to obtain the prediction result f(x), and this value is the required water body visibility.

7. A water visibility prediction system based on the SVR algorithm, characterized in that: The water body visibility prediction method according to any one of claims 1-6, comprising: (1) A water body parameter acquisition module for acquiring water body parameter data; the water body parameter acquisition module includes a turbidity sensor, an illuminance sensor, an irradiance sensor, and a water depth sensor; the water body parameter data includes turbidity, illuminance, irradiance, and water depth data; (2) A processing module for screening the data collected by the water body parameter acquisition module, performing normalization processing on the data that meets the requirements, and inputting it into the trained SVR mapping relationship model to obtain the predicted water body visibility; (3) A power supply module for providing stable power to the water body parameter acquisition module, the processing module, and the visibility visualization module; (4) A visibility visualization module for displaying the horizontal visibility value predicted by the processing module; (5) A control module for sending a detection instruction to trigger the data acquisition and processing process.

8. The water visibility prediction system according to claim 7, wherein: The power supply module is electrically connected to the water body parameter acquisition module, the processing module, and the visibility visualization module respectively; the water body parameter acquisition module is connected to the processing module through serial communication; the processing module is connected to the visibility visualization module through serial communication; the control module is connected to the processing module through serial communication.

Citation Information

Patent Citations

  • Water transparency detection system and detection method based on image processing

    CN114923881A

  • Buoy for monitoring visibility of seawater

    CN115303419A