A method and system for automatic on-site detection of water color using three-feature band grayscale fusion

By using a three-feature band grayscale fusion method, combined with the ETA evolution model and external environmental parameters, the grayscale value distribution field of water samples is corrected, which solves the shortcomings of water color remote sensing technology in high-precision detection and pollutant boundary prediction, and realizes efficient and accurate water pollution detection.

CN121476087BActive Publication Date: 2026-03-13XIAMEN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing water color remote sensing technologies have shortcomings in high-precision detection and identification of complex water bodies. They are difficult to accurately obtain water color information, and the boundaries of pollutants are difficult to predict. Existing methods require a large number of samples to obtain distribution maps with insufficient accuracy.

Method used

A three-feature band grayscale fusion method is adopted. By training the ETA evolution model and combining external environmental and hydrodynamic parameters, the spatiotemporal diffusion paths and contributions of algae, sediment, and CDOM state data are obtained. The grayscale distribution field of the water sample is corrected and converted into an RGB distribution field to determine water pollution and output the pollution boundary.

Benefits of technology

It achieves high-precision water pollution detection, accurately determines pollution boundaries, reduces the number of samples collected, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121476087B_ABST
    Figure CN121476087B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for automatic on-site detection of water color using three-feature band grayscale fusion, comprising the following steps: S1, training an ETA evolution model to obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, as well as the contribution of various external environmental and hydrodynamic condition parameters to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path; S2, setting discrete and lattice-like sampling points in the water area to be tested, and fitting to generate initial water sample grayscale value distribution fields corresponding to 440nm, 550nm, and 680nm; fitting to generate distribution fields of various external environmental and hydrodynamic condition parameters; S3, based on the distribution fields of various external environmental and hydrodynamic condition parameters, combined with the spatiotemporal diffusion paths, the contribution, and the probability of occurrence, respectively guiding the initial water sample grayscale value distribution fields to obtain a corrected water sample grayscale value distribution field; S4, combining and converting the corrected water sample grayscale value distribution fields into a water sample RGB distribution field, and outputting the pollution boundary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water pollution detection, specifically to a method and system for automatic on-site detection of water color using three-characteristic band grayscale fusion. Background Technology

[0002] Water color, as a direct representation of the optical properties of water bodies, is formed primarily by the combined effects of absorption and scattering of incident light by dissolved organic matter and particulate matter. Therefore, it not only reflects the optical properties of water bodies but also reveals their material composition to a certain extent. This indicator has important reference value in water quality monitoring and in monitoring the flow paths and boundaries of pollutants after their formation.

[0003] Existing technologies face significant challenges in accurately acquiring water color. Pollutant detection typically employs methods such as visual colorimetry using a Seidl disk, water colorimeters, and remote water color sensing. These methods generally obtain the color information directly from the water body and then compare it with standard color levels or perform spectral information analysis to arrive at the water color. However, these existing remote water color images are essentially multispectral data, and the "color" presented is often a pseudo-color synthesis based on spectral inversion or feature enhancement. When the color difference in the water body approaches the human eye's color perception threshold (e.g., a mixture of cyanobacteria and green algae), color reproduction errors can lead to misclassification. Therefore, while remote water color sensing has irreplaceable advantages in macroscopic monitoring, it still has significant shortcomings in terms of high precision, atmospheric correction, and the identification of complex water bodies.

[0004] In addition, due to the complexity of pollutant composition and the fact that its flow path, diffusion direction, and settling velocity are related to various environmental factors, the boundaries of pollutants are difficult to predict. In order to detect the boundaries of pollutants, a large number of samples need to be collected on the water body to obtain the boundaries. However, the distribution maps obtained by collecting a small number of samples and using fitting algorithms have problems such as insufficient accuracy.

[0005] The purpose of this invention is to design an automatic on-site detection method and system for water color by three-feature band grayscale fusion, which addresses the problems existing in the prior art. Summary of the Invention

[0006] To address the problems existing in the prior art, the present invention provides a method and system for automatic on-site detection of water color by three-feature band grayscale fusion, which can effectively solve at least one of the problems existing in the prior art.

[0007] The technical solution of this invention is:

[0008] An automatic on-site detection method for water color using three-feature band grayscale fusion includes the following steps:

[0009] S1. Set up discrete and lattice-like sampling points in the water area to be tested. Collect historical external environment and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point. Train the ETA evolution model to obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, the contribution of each external environment and hydrodynamic condition parameter to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path.

[0010] S2. Discrete and arrayed sampling points are set up in the water area to be tested. At each sampling point, the gray value of the water sample under each band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm is fitted to generate the initial gray value distribution field of the water sample at 440nm, 550nm, and 680nm. The set of external environmental and hydrodynamic condition parameters of each sampling point is collected and fitted to generate the distribution field of each external environmental and hydrodynamic condition parameter.

[0011] S3. Based on the distribution fields of various external environment and hydrodynamic conditions parameters, combined with the spatiotemporal diffusion path, the contribution degree, and the occurrence probability, the initial water sample gray value distribution field is guided to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm.

[0012] S4, combine the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm to convert them into the RGB distribution field of the water sample, and use the RGB distribution field of the water sample to determine water pollution and output the pollution boundary.

[0013] Furthermore, the set of external environmental and hydrodynamic condition parameters includes air temperature, water temperature, light intensity, wind speed, flow velocity, flow direction, and turbulence intensity.

[0014] Further, in step S1, training the ETA evolution model includes:

[0015] The ETA evolution model takes historical external environmental and hydrodynamic condition parameters as input features. By learning the correspondence between changes in historical external environmental and hydrodynamic condition parameters and changes in algae, sediment, and CDOM state data, it establishes an environment-driven spatiotemporal diffusion mapping relationship for algae, sediment, and CDOM.

[0016] The ETA evolution model is used to quantify the role of various external environmental and hydrodynamic parameters in the diffusion prediction process, thereby obtaining the influence weights of different external environmental and hydrodynamic parameters on the diffusion behavior of algae, sediment and CDOM, and the contribution is obtained after normalization.

[0017] Further, S3, based on the distribution fields of various external environmental and hydrodynamic condition parameters, combined with the spatiotemporal diffusion path, the contribution rate, and the occurrence probability, the initial water sample gray value distribution field is guided to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm, including:

[0018] S3.1, the occurrence probability includes the probability of enhanced diffusion, the probability of weakened diffusion, and the probability of stable diffusion. The gray value distribution field of the initial water sample is determined according to the dominant probability in the occurrence probability to determine the gray value correction direction.

[0019] S3.2, The initial water sample gray value distribution field is adjusted by using the contribution degree as a weight to obtain a weighted corrected gray value distribution field;

[0020] S3.3, in the weighted correction gray distribution field, neighborhood points are selected according to the spatiotemporal diffusion path direction, and the gray values ​​of the neighborhood points are adjusted according to the distance attenuation weight to obtain the corrected gray value distribution field of the water sample.

[0021] Further, step S3.2, adjusting the initial water sample grayscale value distribution field using the contribution degree as a weight, includes defining a correction coefficient. ,in , where i represents the correction factor number.

[0022] Adjust according to the following formula.

[0023] ,in, This represents the gray value at a specific point in the initial water sample gray value distribution field. This represents the gray value at a specific point in the adjusted initial water sample gray value distribution field. This represents the contribution of external environmental and hydrodynamic parameters. If the dominant probability is the enhancing probability, then... If the value is positive, and the dominant probability is the diminishing probability, then... If the value is negative, and the dominant probability is a stable probability, then... =0, It is a fixed value.

[0024] Further, S3.3, in the process of selecting neighboring points in the weighted grayscale distribution field according to the spatiotemporal diffusion path direction, and adjusting the grayscale of the neighboring points according to the distance attenuation weight, includes:

[0025] Extract the points within a radius r centered on each point along the spatiotemporal diffusion path;

[0026] Establish the decay function d represents the distance between the point and the direction of the spatiotemporal diffusion path, which is adjusted according to the following formula.

[0027] ,in Indicates the attenuation coefficient. This is the corrected grayscale value of the water sample.

[0028] Further, in step S4, the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm are combined and converted into an RGB distribution field of the water sample. The water pollution is determined and the pollution boundary is output through the RGB distribution field of the water sample, including:

[0029] S4.1, the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm are combined and converted into the RGB distribution field of the water sample using the following formula.

[0030] ,

[0031] ,

[0032] in, , , These are the corrected grayscale values ​​of the water samples at 440nm, 550nm, and 680nm, respectively. These are the color matching function values ​​for the corresponding wavelengths. These represent the corresponding intermediate parameters. These represent the corresponding RGB values;

[0033] S4.2, the water sample chromaticity distribution field is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field of the water sample, and the area in the water sample chromaticity distribution field that is greater than a preset threshold is extracted as the pollution area, and the boundary of the pollution area is extracted to obtain the pollution boundary.

[0034] Furthermore, the color distribution field of the water sample is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field, including:

[0035] Using standard grayscale and standard RGB values ​​corresponding to 440nm, 550nm, and 680nm as inputs, and standard chromaticity values ​​as outputs, a partial least squares regression algorithm is used to extract latent variables between the inputs and outputs, establishing a linear mapping relationship.

[0036] ,

[0037] Where C represents the standard chromaticity value, These represent the standard grayscale values ​​corresponding to 440nm, 550nm, and 680nm, respectively. These represent standard RGB values. These represent the corresponding model coefficients.

[0038] Furthermore, a three-feature band grayscale fusion automatic water color detection system is provided, comprising the following modules:

[0039] The ETA evolution model generation module is used to set discrete and lattice-like sampling points in the water area to be tested, collect historical external environmental and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point, train the ETA evolution model, obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, as well as the contribution of each external environmental and hydrodynamic condition parameter to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path;

[0040] The distribution field generation module is used to set discrete and arrayed sampling points in the water area to be tested. At each sampling point, the gray value of the water sample under each wavelength band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The module is then fitted to generate the initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm. The module also collects the set of external environmental and hydrodynamic condition parameters for each sampling point and fits to generate the distribution field of each external environmental and hydrodynamic condition parameter.

[0041] The guidance correction module is used to guide the initial water sample gray value distribution field based on the distribution fields of various external environment and hydrodynamic conditions parameters, combined with the spatiotemporal diffusion path, the contribution degree, and the occurrence probability, to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm.

[0042] The judgment module is used to combine the corrected gray value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm and convert them into the RGB distribution field of the water sample. The water sample RGB distribution field is used to judge water pollution and output the pollution boundary.

[0043] Therefore, the present invention provides the following effects and / or advantages:

[0044] This application obtains the spatiotemporal diffusion paths of algae, sediment, and CDOM state data by training an ETA evolution model, as well as the contribution of various external environmental and hydrodynamic parameters to each spatiotemporal diffusion path and the probability of occurrence of each spatiotemporal diffusion path. Then, based on this information, the initial water sample gray value distribution field is corrected to obtain a more accurate corrected water sample gray value distribution field corresponding to 440nm, 550nm, and 680nm. By combining the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm, the corresponding water pollution status can be calculated.

[0045] This application uses the ETA model to learn the correspondence between changes in historical external environmental and hydrodynamic parameters and changes in algae, sediment, and CDOM state data. This allows us to obtain the influence and contribution of various external environmental and hydrodynamic parameters on the diffusion of algae, sediment, and CDOM, which can then be used to accurately correct the initial grayscale distribution field.

[0046] This application combines the specific methods of the spatiotemporal diffusion path, the contribution degree, and the occurrence probability to provide step-by-step guidance for the initial water sample gray value distribution field, thereby obtaining the corrected water sample gray value distribution field and providing a new approach for correcting the water sample gray value distribution field.

[0047] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0048] It should be understood that the above summary and the following detailed description of the invention are exemplary and explanatory, and are intended to provide further explanation of the invention as claimed. Attached Figure Description

[0049] Figure 1 This is a flowchart illustrating one embodiment of the present invention. Detailed Implementation

[0050] To facilitate understanding by those skilled in the art, the present invention will now be described in further detail with reference to the embodiments:

[0051] refer to Figure 1 A method for automatic on-site detection of water color using three-feature band grayscale fusion, characterized by the following steps:

[0052] S1. Set up discrete and lattice-like sampling points in the water area to be tested. Collect historical external environment and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point. Train the ETA evolution model to obtain the evolution paths of algae, sediment, and CDOM and the contribution of each external environment and hydrodynamic condition parameter to each evolution path.

[0053] In this step, the discrete sampling points can be arranged in a square matrix with fixed spacing. By setting sampling points at each location, the sampling results of the matrix can be obtained. Among them, algae, sediment, and CDOM state data are important underlying causes of water pollution. The presence of algae, sediment, and CDOM can cause water to turn green, yellow, or blurry. Therefore, monitoring these data can determine the degree of water pollution and thus determine whether the water is polluted.

[0054] External environmental and hydrodynamic parameters can affect algae, sediment, and CDOM. For example, strong sunlight can cause algae to grow rapidly, or high water flow can easily disperse and tumble sediment, bringing it closer to the water surface and thus making it appear colored.

[0055] Therefore, by training the ETA model to output the spatiotemporal diffusion paths and corresponding contributions of algae, sediment, and CDOM state data, this step can infer the evolution paths of algae, sediment, and CDOM state data, as well as the contributions of specific external environmental and hydrodynamic parameters to each evolution path. This allows us to obtain the response patterns of the spatiotemporal changes of algae, sediment, and CDOM in water bodies to external environmental and hydrodynamic conditions.

[0056] S2. Discrete and arrayed sampling points are set up in the water area to be tested. At each sampling point, the gray value of the water sample under each band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm is fitted to generate the initial gray value distribution field of the water sample at 440nm, 550nm, and 680nm. The set of external environmental and hydrodynamic condition parameters of each sampling point is collected and fitted to generate the distribution field of each external environmental and hydrodynamic condition parameter.

[0057] In this step, the method of directly acquiring color images of sampled water quality in existing technologies is changed. Instead, the grayscale values ​​of the sampled water quality at the 440nm, 550nm, and 680nm wavelengths are obtained. The 440nm, 550nm, and 680nm wavelengths are the wavelengths where the absorption / scattering peaks of algae (chlorophyll), suspended sediment, and CDOM in the visible light region fall. Chlorophyll has a significant absorption peak near 680nm, suspended sediment mainly scatters, and its reflection enhancement is most obvious near 550nm in the green light region. CDOM has the strongest absorption characteristics in the blue light region near 440nm. Therefore, the grayscale values ​​of the water samples corresponding to these three wavelengths can best reflect the influence of algae, sediment, and CDOM on water quality.

[0058] By using a fitting algorithm, a rough distribution field of the initial water sample gray values ​​for each band, as well as the distribution fields of various external environmental and hydrodynamic parameters, can be obtained. These distribution fields can include, for example, the water temperature distribution field and the water flow velocity distribution field.

[0059] S3. Based on the distribution fields of the external environment and hydrodynamic conditions parameters, combined with the evolution path and the contribution, the distribution fields of the initial water sample gray values ​​are corrected respectively to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm and 680nm.

[0060] In step S2, the distribution fields of various external environmental and hydrodynamic condition parameters were obtained. By combining the parameter distributions in these fields with the spatiotemporal diffusion paths and contributions of algae, sediment, and CDOM state data obtained in step S1, the generation paths and probabilities of algae, sediment, and CDOM at various locations in the tested water area can be obtained, resulting in a probability distribution map that can guide the identification of algae, sediment, and CDOM pollution boundaries. Then, by combining this with the initial water sample grayscale value distribution field, a more accurate corrected water sample grayscale value distribution field can be obtained.

[0061] S4, combine the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm to convert them into the RGB distribution field of the water sample, and use the RGB distribution field of the water sample to determine water pollution and output the pollution boundary.

[0062] In this step, the grayscale value of the water sample is converted into RGB color, and then the RGB color is used to determine whether the water body is polluted and output the boundary.

[0063] Furthermore, the set of external environmental and hydrodynamic condition parameters includes air temperature, water temperature, light intensity, wind speed, flow velocity, flow direction, and turbulence intensity.

[0064] Furthermore, algae, sediment, and CDOM state data are highly sensitive to external environmental and hydrodynamic parameters. Specifically, in water flows with directional and wind-driven conditions, algae tend to shift along the mainstream or wind direction. The greater the water flow velocity and the greater the angle of the flow turn, the more easily algae are dispersed, resulting in a decrease in concentration. Algae also grow vigorously in environments with ample sunlight and warm temperatures, and in turbulent flows, they tend to tumble and accumulate on the surface. Sediment does not exhibit the same growth characteristics as algae, therefore it has a low correlation with light intensity. When flow velocity or shear force exceeds a threshold, bottom sediment is rapidly stirred up, causing the water to become cloudy. Sediment concentration changes relatively synchronously with flow velocity and turbulence; for example, an increase in flow velocity immediately raises sediment concentration. Sediment typically forms a large-scale continuous distribution, making isolated extreme points less likely. Additionally, in warmer air and water temperatures, sediment is more easily dispersed. CDOM state data tends to accumulate in the water body over time, and changes in wind, waves, and instantaneous flow velocity significantly affect CDOM. The impact is relatively small. CDOM state data is mainly transported via convection-diffusion and lacks the mechanism of algal up-and-down movement. It requires a long time and strong light to show significant changes, thus its correlation with light intensity is low. Therefore, algae, sediment, and CDOM state data respond completely differently to various external environmental and hydrodynamic parameters, and their diffusion mechanisms are also completely different.

[0065] Further, in step S1, training the ETA evolution model includes:

[0066] The ETA evolution model takes historical external environmental and hydrodynamic condition parameters as input features. By learning the correspondence between changes in historical external environmental and hydrodynamic condition parameters and changes in algae, sediment, and CDOM state data, it establishes an environment-driven spatiotemporal diffusion mapping relationship for algae, sediment, and CDOM.

[0067] The ETA evolution model is used to quantify the role of various external environmental and hydrodynamic parameters in the diffusion prediction process, thereby obtaining the influence weights of different external environmental and hydrodynamic parameters on the diffusion behavior of algae, sediment and CDOM, and the contribution is obtained after normalization.

[0068] In this step, the ETA evolutionary model uses the state change labels of algae, sediment, and CDOM as supervision signals. The model parameters are iteratively optimized by minimizing the prediction error of change probability and the spatial consistency constraint error. To ensure the physical rationality and spatial continuity of the model output, propagation constraints between adjacent sampling points are introduced during training, enabling the model to learn the evolutionary patterns of pollution elements spreading or migrating along the water flow direction. Simultaneously, the roles of various external environmental and hydrodynamic parameters in the model prediction process are quantified through feature importance analysis, sensitivity analysis, or interpretable attribution methods. This yields the influence weights of different environmental parameters on the evolutionary behavior of algae, sediment, and CDOM. These influence weights are then normalized to obtain their contribution values.

[0069] Specifically, the ETA evolution model can ultimately determine the diffusion paths and probabilities of algae, sediment, and CDOM based on actual external environmental and hydrodynamic parameters. For example, under conditions of high water temperature, sufficient light, and stable wind direction and flow regime, the ETA evolution model outputs the diffusion path of algae along the mainstream direction and provides the contribution of water temperature, light, and wind direction as the dominant driving factors, with the corresponding algae enhancement probability reaching over 0.7. Under conditions of significantly increased flow velocity and turbulence intensity, the model outputs a continuous diffusion path of sediment along the river channel, with an enhancement probability exceeding 0.8. In slow-flowing environments, the model outputs a smooth diffusion path of CDOM, with its evolution probability showing a moderate enhancement trend.

[0070] For example, under the current environmental conditions: water flow velocity: 0.45 m / s (significantly increased); turbulence intensity: high; wind speed: 1.2 m / s (minor impact); changes in light and water temperature are not significant. The contribution values ​​output by the ETA evolution model are as follows (parameters not shown indicate a contribution of 0):

[0071]

[0072] It can be seen that under these external environmental and hydrodynamic conditions, sediment diffusion is almost entirely driven by hydrodynamics. The probability of occurrence of the spatiotemporal diffusion path is as follows: sediment enhancement probability: 0.83, sediment weakening probability: 0.07, and stability probability: 0.10. Ultimately, it is determined that the probability of sediment in the river channel undergoing significant resuspension and diffusing along the main flow direction under the current flow conditions is 83%. The spatiotemporal diffusion path of sediment is along the main flow direction of the river channel, characterized by continuous diffusion, blurred boundaries, and a banded distribution.

[0073] Further, S3, based on the distribution fields of various external environmental and hydrodynamic condition parameters, combined with the spatiotemporal diffusion path, the contribution rate, and the occurrence probability, the initial water sample gray value distribution field is guided to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm, including:

[0074] S3.1, the occurrence probability includes the probability of enhanced diffusion, the probability of weakened diffusion, and the probability of stable diffusion. The gray value distribution field of the initial water sample is determined according to the dominant probability in the occurrence probability to determine the gray value correction direction.

[0075] In this step, the occurrence probability of each point output by the ETA evolution model is calculated as follows: for the enhancement probability, it indicates that the grayscale tends to increase; for the weakening probability, it indicates that the grayscale tends to decrease; and for the stable probability, it indicates that the grayscale tends to remain unchanged. This establishes the direction of change for each pixel in the initial water sample grayscale value distribution field. Furthermore, the highest probability among the enhancement, weakening, and stable probabilities can be selected as the dominant probability.

[0076] S3.2, The initial water sample gray value distribution field is adjusted by using the contribution degree as a weight to obtain a weighted corrected gray value distribution field;

[0077] In step S3.1, the direction of grayscale adjustment for each point was established. This step further confirms the amount of adjustment. Further, step S3.2, adjusting the initial water sample grayscale value distribution field using the contribution degree as a weight, includes defining a correction coefficient. ,in , where i represents the correction factor number.

[0078] Adjust according to the following formula.

[0079] ,in, This represents the gray value at a specific point in the initial water sample gray value distribution field. This represents the gray value at a specific point in the initial water sample gray value distribution field after weight adjustment. This represents the contribution of external environmental and hydrodynamic parameters. If the dominant probability is the enhancing probability, then... If the value is positive, and the dominant probability is the diminishing probability, then... If the value is negative, and the dominant probability is a stable probability, then... =0, It is a fixed value.

[0080] Specifically, in this embodiment, It can be obtained empirically, or it can be a value between 0.01 and 0.05, such as a correction factor for light intensity. It can be set to 0.03. For example, the gray value of a certain point in the initial water sample gray value distribution field. In this spatiotemporal diffusion path, temperature and illumination are strongly correlated, with the dominant probability being the enhancement probability, and illumination contributing the most. Temperature contribution Illumination correction factor Temperature correction factor ,but .

[0081] S3.3, in the weighted correction grayscale distribution field, neighborhood points are selected according to the spatiotemporal diffusion path direction, and the grayscale of the neighborhood points is weighted and adjusted according to the distance attenuation weight to obtain the corrected grayscale value distribution field of the water sample.

[0082] Further, S3.3, in the process of selecting neighboring points in the weighted grayscale distribution field according to the spatiotemporal diffusion path direction, and adjusting the grayscale of the neighboring points according to the distance attenuation weight, includes:

[0083] Extract the points within a radius r centered on each point along the spatiotemporal diffusion path;

[0084] Establish the decay function d represents the distance between the point and the direction of the spatiotemporal diffusion path, which is adjusted according to the following formula.

[0085] ,in Indicates the attenuation coefficient. This is the corrected grayscale value of the water sample.

[0086] In this step, by extracting points within a radius *r* centered on each point along the spatiotemporal diffusion path, the expanded region of the path can be obtained. This can be understood as follows: after pollutants are dispersed at the source, their primary propagation path is the spatiotemporal diffusion path, for example, diffusing along the direction of water flow, while also diffusing in the direction perpendicular to the water flow. Furthermore, the closer to the spatiotemporal diffusion path, the higher the concentration of pollutants. Therefore, a system is established... This allows the gray values ​​of the weighted gray distribution field to be smoothly adjusted along the diffusion direction, simulating the physical laws of pollutant diffusion along the path. It can be a value set based on practical experience. The larger the value, the faster the decay rate. The decay function... It can be a linear decay function.

[0087] Further, in step S4, the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm are combined and converted into an RGB distribution field of the water sample. The water pollution is determined and the pollution boundary is output through the RGB distribution field of the water sample, including:

[0088] S4.1, the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm are combined and converted into the RGB distribution field of the water sample using the following formula.

[0089] ,

[0090] ,

[0091] in, , , These are the corrected grayscale values ​​of the water samples at 440nm, 550nm, and 680nm, respectively. These are the color matching function values ​​for the corresponding wavelengths. These represent the corresponding intermediate parameters. These represent the corresponding RGB values;

[0092] S4.2, the water sample chromaticity distribution field is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field of the water sample, and the area in the water sample chromaticity distribution field that is greater than a preset threshold is extracted as the pollution area, and the boundary of the pollution area is extracted to obtain the pollution boundary.

[0093] In this step, the conversion of the water sample grayscale value distribution field in S4.1 into the water sample RGB distribution field is a direct adoption of existing technology, and its specific principles and steps will not be elaborated here. In S4.2, water color (such as CIE chromaticity, Forel-Ule index, platinum-cobalt chromaticity) is a physically standardized optical indicator that can describe the absorption, scattering, and color composition of light by water, directly corresponding to the concentration of algae, CDOM, and sediment in the water. As a detection standard, chromaticity can be directly correlated with the pollutant concentration threshold, making it easy to define the threshold of the "polluted area," therefore water color is used.

[0094] Furthermore, the color distribution field of the water sample is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field, including:

[0095] Using standard grayscale and standard RGB values ​​corresponding to 440nm, 550nm, and 680nm as inputs, and standard chromaticity values ​​as outputs, a partial least squares regression algorithm is used to extract latent variables between the inputs and outputs, establishing a linear mapping relationship.

[0096] ,

[0097] Where C represents the standard chromaticity value, These represent the standard grayscale values ​​corresponding to 440nm, 550nm, and 680nm, respectively. These represent standard RGB values. These represent the corresponding model coefficients.

[0098] In this step, a training set is constructed using the "grayscale value - RGB value - standard chromaticity value" of a 22-color meter. A model is then built using the PLSR algorithm to achieve accurate calculation of "water body grayscale value → RGB value → chromaticity value" during real-time monitoring. The training set construction converts FUI to platinum-cobalt chromaticity (Pt-Co). The input features are the standard grayscale and standard RGB values ​​of the 22 color numbers, and the output label is the corresponding standard chromaticity value C. Eighteen color numbers are selected as the training set, and four color numbers as the validation set. The PLSR model training uses a partial least squares regression algorithm implemented using Python's scikit-learn library. The core of this algorithm is to extract the latent variables between the input features and the output labels and establish a linear relationship.

[0099] Furthermore, a three-feature band grayscale fusion automatic water color detection system is provided, comprising the following modules:

[0100] The ETA evolution model generation module is used to set discrete and lattice-like sampling points in the water area to be tested, collect historical external environmental and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point, train the ETA evolution model, obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, as well as the contribution of each external environmental and hydrodynamic condition parameter to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path;

[0101] The distribution field generation module is used to set discrete and arrayed sampling points in the water area to be tested. At each sampling point, the gray value of the water sample under each wavelength band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The module is then fitted to generate the initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm. The module also collects the set of external environmental and hydrodynamic condition parameters for each sampling point and fits to generate the distribution field of each external environmental and hydrodynamic condition parameter.

[0102] The guidance and correction module is used to guide the initial water sample gray value distribution field based on the distribution fields of various external environmental and hydrodynamic conditions parameters, combined with the spatiotemporal diffusion path, the contribution degree, and the occurrence probability, to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm.

[0103] The judgment module is used to combine the corrected gray value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm and convert them into the RGB distribution field of the water sample. The water sample RGB distribution field is used to judge water pollution and output the pollution boundary.

[0104] The working principle of this embodiment is the same as the method described above.

[0105] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0108] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0109] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

Claims

1. A method for automatic on-site detection of water color using three-feature band grayscale fusion, characterized in that: Includes the following steps: S1. Set up discrete and lattice-like sampling points in the water area to be tested. Collect historical external environment and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point. Train the ETA evolution model to obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, the contribution of each external environment and hydrodynamic condition parameter to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path. S2. Discrete and arrayed sampling points are set up in the water area to be tested. At each sampling point, the gray value of the water sample under each band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm is fitted to generate the initial gray value distribution field of the water sample at 440nm, 550nm, and 680nm. The set of external environmental and hydrodynamic condition parameters of each sampling point is collected and fitted to generate the distribution field of each external environmental and hydrodynamic condition parameter. S3, based on the distribution fields of various external environmental and hydrodynamic condition parameters, combined with the spatiotemporal diffusion path, the contribution rate, and the occurrence probability, guide the initial water sample gray value distribution field to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm; including: S3.1, the occurrence probability includes the probability of enhanced diffusion, the probability of weakened diffusion, and the probability of stable diffusion. The gray value distribution field of the initial water sample is determined according to the dominant probability in the occurrence probability to determine the gray value correction direction. S3.2, The initial water sample gray value distribution field is adjusted by using the contribution degree as a weight to obtain a weighted corrected gray value distribution field; S3.3, in the weighted correction gray distribution field, neighborhood points are selected according to the spatiotemporal diffusion path direction, and the gray values ​​of the neighborhood points are adjusted according to the distance attenuation weight to obtain the corrected gray value distribution field of the water sample. S4, combine the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm to convert them into the RGB distribution field of the water sample, and use the RGB distribution field of the water sample to determine water pollution and output the pollution boundary.

2. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 1, characterized in that: The set of external environmental and hydrodynamic parameters includes air temperature, water temperature, light intensity, wind speed, flow velocity, flow direction, and turbulence intensity.

3. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 1, characterized in that: In step S1, training the ETA evolution model includes: The ETA evolution model takes historical external environmental and hydrodynamic condition parameters as input features. By learning the correspondence between changes in historical external environmental and hydrodynamic condition parameters and changes in algae, sediment, and CDOM state data, it establishes an environment-driven spatiotemporal diffusion mapping relationship for algae, sediment, and CDOM. The ETA evolution model is used to quantify the role of various external environmental and hydrodynamic parameters in the diffusion prediction process, thereby obtaining the influence weights of different external environmental and hydrodynamic parameters on the diffusion behavior of algae, sediment and CDOM, and the contribution is obtained after normalization.

4. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 3, characterized in that: Step S3.2, adjusting the initial water sample grayscale value distribution field using the contribution degree as a weight, includes defining a correction coefficient. ,in , where i represents the correction factor number. Adjust according to the following formula. ,in, This represents the gray value at a specific point in the initial water sample gray value distribution field. This represents the gray value at a specific point in the adjusted initial water sample gray value distribution field. This represents the contribution of external environmental and hydrodynamic parameters. If the dominant probability is the enhancing probability, then... If the value is positive, and the dominant probability is the diminishing probability, then... If the value is negative, and the dominant probability is a stable probability, then... =0, It is a fixed value.

5. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 4, characterized in that: S3.3, in the weighted correction grayscale distribution field, selecting neighboring points according to the spatiotemporal diffusion path direction, and adjusting the grayscale of the neighboring points according to the distance attenuation weight, includes: Extract the points within a radius r centered on each point along the spatiotemporal diffusion path; Establish the decay function d represents the distance between the point and the direction of the spatiotemporal diffusion path, which is adjusted according to the following formula. ,in Indicates the attenuation coefficient. This is the corrected grayscale value of the water sample.

6. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 1, characterized in that: S4, combine the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm to convert them into an RGB distribution field of the water sample. The water pollution is determined and the pollution boundary is output based on the RGB distribution field of the water sample, including: S4.1, the corrected grayscale value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm are combined and converted into the RGB distribution field of the water sample using the following formula. , , in, , , These are the corrected grayscale values ​​of the water samples at 440nm, 550nm, and 680nm, respectively. These are the color matching function values ​​for the corresponding wavelengths. These represent the corresponding intermediate parameters. These represent the corresponding RGB values; S4.2, the water sample chromaticity distribution field is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field of the water sample, and the area in the water sample chromaticity distribution field that is greater than a preset threshold is extracted as the pollution area, and the boundary of the pollution area is extracted to obtain the pollution boundary.

7. The automatic on-site detection method for water color using three-feature band grayscale fusion as described in claim 6, characterized in that: The color distribution field of the water sample is obtained by inverting the RGB distribution field of the water sample with the corrected gray value distribution field of the water sample, including: Using standard grayscale and standard RGB values ​​corresponding to 440nm, 550nm, and 680nm as inputs, and standard chromaticity values ​​as outputs, a partial least squares regression algorithm is used to extract latent variables between the inputs and outputs, establishing a linear mapping relationship. , Where C represents the standard chromaticity value, These represent the standard grayscale values ​​corresponding to 440nm, 550nm, and 680nm, respectively. These represent standard RGB values. These represent the corresponding model coefficients.

8. A three-feature band grayscale fusion automatic on-site water color detection system, characterized in that: The method for automatic on-site detection of water color using three-feature band grayscale fusion as described in any one of claims 1-7 includes the following modules: The ETA evolution model generation module is used to set discrete and lattice-like sampling points in the water area to be tested, collect historical external environmental and hydrodynamic condition parameter sets at each sampling point, as well as algae, sediment, and CDOM state data at each sampling point, train the ETA evolution model, obtain the spatiotemporal diffusion paths of algae, sediment, and CDOM state data, as well as the contribution of each external environmental and hydrodynamic condition parameter to each spatiotemporal diffusion path, and the probability of occurrence of each spatiotemporal diffusion path; The distribution field generation module is used to set discrete and arrayed sampling points in the water area to be tested. At each sampling point, the gray value of the water sample under each wavelength band is collected through filters with center wavelengths of 440nm, 550nm, and 680nm. The module is then fitted to generate the initial gray value distribution field of the water sample corresponding to 440nm, 550nm, and 680nm. The module also collects the set of external environmental and hydrodynamic condition parameters for each sampling point and fits to generate the distribution field of each external environmental and hydrodynamic condition parameter. The guidance correction module is used to guide the initial water sample gray value distribution field based on the distribution fields of various external environment and hydrodynamic conditions parameters, combined with the spatiotemporal diffusion path, the contribution degree, and the occurrence probability, to obtain the corrected water sample gray value distribution fields corresponding to 440nm, 550nm, and 680nm. The judgment module is used to combine the corrected gray value distribution fields of the water sample corresponding to 440nm, 550nm, and 680nm and convert them into the RGB distribution field of the water sample. The water sample RGB distribution field is used to judge water pollution and output the pollution boundary.

Citation Information

Patent Citations

  • Sea surface oil spill detection method based on multi-kernel classification model decision fusion

    CN113920445A

  • Animal husbandry water pollution detection method based on machine vision

    CN118570242A