Environment engineering water quality evaluation method combined with image recognition
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]由于上述实现方式将光照与阴影等环境干扰因素同水体固有光学特征耦合,当光照发生突变时,提取的视觉特征会发生偏移与失真,导致水质评估结果波动;且数据驱动的黑盒视觉特征与浊度及溶解性有机碳浓度等水质理化指标之间缺乏物理映射机制,视觉特征无法直接量化反映具体理化指标的变化
1.本发明通过基于物理驱动的水体光学特征解耦网络将原始图像分解为光照分量与水体反射率分量,分离了环境光照干扰与水体固有光学属性,克服了光照突变对特征提取的干扰;基于深度散射特征与水体光学衰减定律构建水下光学衰减场模型,结合基于不同浓度梯度下光子散射截面与浊度及溶解性有机碳浓度的物理响应关系标定的水体理化参量映射矩阵进行对齐计算,通过衰减系数分布特征回归计算输出水质理化指标评估结果,建立了视觉特征与水质理化参量的物理映射机制,实现了从视觉特征到具体理化指标的量化映射,解决了光照突变干扰导致视觉特征提取失真及视觉特征与水质理化指标脱节的技术问题。
Smart Images

Figure CN122524754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, specifically to an environmental engineering water quality assessment method that combines image recognition. Background Technology
[0002] Existing image recognition-based environmental engineering water quality assessment methods typically employ end-to-end convolutional neural networks, directly using raw images of the water body as input. They extract color and texture visual features from the images through data-driven black-box visual models and directly map these features to water quality classification labels or pollution levels. However, these methods fail to distinguish between the water body's inherent optical reflectivity and ambient light during image acquisition and processing, coupling the light component with the water reflectivity component. Consequently, visual feature extraction is highly dependent on the overall pixel distribution of the image.
[0003] Because the aforementioned implementation methods couple environmental interference factors such as light and shadow with the inherent optical characteristics of water bodies, the extracted visual features will shift and become distorted when light intensity changes abruptly, leading to fluctuations in water quality assessment results. Furthermore, the data-driven black-box visual features lack a physical mapping mechanism with water quality physicochemical indicators such as turbidity and dissolved organic carbon concentration, meaning visual features cannot directly quantify changes in specific physicochemical indicators. Therefore, existing technologies suffer from core technical problems such as distortion in visual feature extraction due to sudden light intensity interference and a disconnect between visual features and water quality physicochemical indicators. Summary of the Invention
[0004] The purpose of this invention is to provide an environmental engineering water quality assessment method that combines image recognition, which can effectively solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Environmental engineering water quality assessment methods that combine image recognition include: Acquire raw images of the water body to be evaluated; A physics-driven decoupling network for water body optical features is constructed to decompose the original image into illumination components and water reflectivity components. The depth scattering characteristics of the water reflectivity component are extracted, and an underwater optical attenuation field model is constructed based on the depth scattering characteristics and the optical attenuation law of water. The distribution characteristics of the attenuation coefficient in the underwater optical attenuation field model are aligned with the preset water body physicochemical parameter mapping matrix. The water body physicochemical parameter mapping matrix is calibrated based on the physical response relationship between photon scattering cross section and turbidity and dissolved organic carbon concentration under different concentration gradients. Regression calculations are performed using the aligned attenuation coefficient distribution characteristics to output the water quality physicochemical index evaluation results.
[0006] Preferably, the construction of a physics-driven water optical feature decoupling network, which decomposes the original image into an illumination component and a water reflectance component, includes: The original image is input into the feature encoder to obtain an initial feature map; Based on the physical model of Lambertian reflection, the initial feature map is split into high-frequency illumination features and low-frequency reflectivity features; A directional gradient constraint is introduced to perform spatial smoothing filtering on the high-frequency illumination features, thereby removing local shadow abruptness regions in the high-frequency illumination features. The smoothed high-frequency illumination features and the low-frequency reflectivity features are deconvolved and reconstructed to output the illumination component and the water reflectivity component, respectively.
[0007] Preferably, extracting the depth scattering features from the water reflectance component includes: Multi-scale dilated convolution operation is performed on the water reflectance components to obtain multi-scale reflectance feature maps under different receptive fields. For the multi-scale reflectivity feature map, the differential response between adjacent scale feature maps is calculated, and the feature regions with differential response values greater than a preset threshold are extracted as the internal scattering regions of the water body. Cross-channel attention-weighted fusion is performed on the scattering region inside the water body to remove shallow surface specular reflection features and retain deep scattering features. The weighted fused deep scattering features are then determined as the depth scattering features.
[0008] Preferably, an underwater optical attenuation field model is constructed based on the depth scattering characteristics and the optical attenuation law of water, including: Based on Beer-Lambert's law, an exponential relationship equation is established between the distance a photon travels in the water body to be evaluated and the attenuation of light intensity. The scattering intensity value at each pixel location in the depth scattering feature is used as the boundary constraint condition for the exponential relationship equation. Using the exponential relationship equation and the boundary constraints, the optical attenuation coefficient corresponding to each spatial coordinate point in the water body to be evaluated is solved; Three-dimensional volume data is constructed based on the optical attenuation coefficients at each spatial coordinate point, and the three-dimensional volume data is determined as the underwater optical attenuation field model.
[0009] Preferably, the attenuation coefficient distribution characteristics in the underwater optical attenuation field model are aligned with a preset water physicochemical parameter mapping matrix, including: Extract the attenuation coefficient distribution histograms at different depth levels in the underwater optical attenuation field model; Principal component analysis was performed on the attenuation coefficient distribution histogram to extract the principal component vector characterizing the photon scattering cross section; Calculate the Mahalanobis distance between the principal component vector and each reference parameter vector in the water body physicochemical parameter mapping matrix; A combination of reference parameter vectors whose Mahalanobis distance is less than a preset distance threshold is selected, and the principal component vectors are subjected to spatial projection transformation to complete the alignment calculation of the attenuation coefficient distribution characteristics and the water body physicochemical parameter mapping matrix.
[0010] Preferably, regression calculations are performed using the aligned attenuation coefficient distribution characteristics to output water quality physicochemical index evaluation results, including: The physical response curves corresponding to turbidity and dissolved organic carbon concentration in the water body physicochemical parameter mapping matrix are used as kernel functions and introduced into the support vector regression model. The aligned attenuation coefficient distribution features are input into the support vector regression model configured with the kernel function; The nonlinear mapping output value of the aligned attenuation coefficient distribution characteristics under the constraint of the physical response relationship curve is calculated by the support vector regression model, and the nonlinear mapping output value is determined as the evaluation result of the water quality physicochemical index.
[0011] Preferably, the initial feature map is decomposed into high-frequency illumination features and low-frequency reflectivity features based on the Lambertian reflectance physical model, including: Construct a two-branch feature extraction network based on the physical model of Lambertian reflection; The initial feature map is input into the first branch of the dual-branch feature extraction network, and the high-frequency illumination features with drastic edge gradient changes are extracted through a high-pass filter bank. The initial feature map is input into the second branch of the dual-branch feature extraction network, and the local neighborhood pixels are weighted and averaged by a guided filter to extract the low-frequency reflectance feature that is invariant to color and texture. An orthogonality constraint loss function is injected into the bottleneck layer of the dual-branch feature extraction network to force the high-frequency illumination features and the low-frequency reflectivity features to be independent of each other in the feature space.
[0012] Preferably, performing cross-channel attention-weighted fusion on the scattering region within the water body includes: The distribution of channel scattering energy in the internal scattering region of the water body under the three color channels of red, green and blue is statistically analyzed. Based on the energy distribution of the channels, calculate the energy percentage coefficients corresponding to the red, green, and blue color channels; The energy percentage coefficient is input into the extrusion excitation network to generate adaptive weight coefficients for each color channel. Based on the adaptive weighting coefficients, the feature maps of each color channel in the scattering region inside the water body are scaled and superimposed. The specular reflection channel features that dominate the scattering energy distribution of the channel are downweighted, while the channel features that characterize the scattering of deep suspended matter are upweighted, and the depth scattering features are output.
[0013] Preferably, the optical attenuation coefficient corresponding to each spatial coordinate point in the water body to be evaluated is solved using the exponential relationship equation and the boundary constraints, including: Obtain the depth estimation map corresponding to the original image; The depth value of each pixel in the depth estimation map is substituted into the exponential relationship equation as the photon propagation distance; The scattering intensity value at the corresponding position in the depth scattering feature is substituted into the exponential relationship equation as the light intensity attenuation. By performing a logarithmic transformation and solving the partial derivatives of the exponential relationship equation after substituting the photon propagation distance and the light intensity attenuation, the optical attenuation coefficient at each pixel depth position is calculated. Based on the spatial coordinate mapping relationship of the depth estimation map, the optical attenuation coefficients of each pixel are arranged into a three-dimensional tensor form.
[0014] Preferably, calculating the Mahalanobis distance between the principal component vector and each reference parameter vector in the water body physicochemical parameter mapping matrix includes: Calculate the covariance matrix of all reference parameter vectors in the water body physicochemical parameter mapping matrix; Perform singular value decomposition on the covariance matrix to obtain the inverse covariance matrix; The principal component vector and each of the reference parameter vectors are whitened using the inverse covariance matrix to eliminate the linear correlation between parameters of different dimensions. Calculate the Euclidean distance between the whitened principal component vector and each of the whitened reference parameter vectors, and determine the Euclidean distance as the Mahalanobis distance; The top K reference parameter vectors with the smallest Mahalanobis distance are selected to construct a local linear manifold, and the principal component vectors are projected onto the local linear manifold to complete the alignment.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention decomposes the original image into illumination and water reflectivity components using a physics-driven water optical feature decoupling network, separating ambient light interference from the inherent optical properties of the water body and overcoming the interference of sudden changes in illumination on feature extraction. Based on depth scattering characteristics and the water body optical attenuation law, an underwater optical attenuation field model is constructed. Alignment calculations are performed using a water body physicochemical parameter mapping matrix calibrated based on the physical response relationship between photon scattering cross-section and turbidity and dissolved organic carbon concentration under different concentration gradients. The water quality physicochemical index evaluation results are output through regression calculation of attenuation coefficient distribution characteristics. This establishes a physical mapping mechanism between visual features and water quality physicochemical parameters, realizing a quantitative mapping from visual features to specific physicochemical indicators. This solves the technical problems of visual feature extraction distortion caused by sudden changes in illumination and the disconnect between visual features and water quality physicochemical indicators.
[0016] 2. A spatial smoothing filter is applied to high-frequency illumination features using directional gradient constraints. An orthogonality constraint loss function is injected into the bottleneck layer of the dual-branch feature extraction network to force illumination and reflectivity features to be independent in the feature space, reducing the interference of residual illumination components on reflectivity components. Differential responses are extracted through multi-scale dilated convolution, and adaptive weight coefficients generated by a squeezed excitation network are used to deweight specular reflection channel features and upweight channel features representing scattering from deep suspended matter, improving the purity of depth scattering feature extraction. The depth estimation map is combined with the Beer-Lambert law to solve for the optical attenuation coefficients at each spatial coordinate point and construct 3D volume data. A physical response curve is introduced as the kernel function in conjunction with a support vector regression model. The principal component vectors and baseline parameter vectors are whitened using the inverse covariance matrix, and Mahalanobis distance is calculated for local linear manifold projection alignment, reducing the model's dependence on labeled data and improving its generalization ability and the stability of quantitative assessment under different water environments. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the overall execution of the environmental engineering water quality assessment method combining image recognition according to the present invention. Figure 2 This is a flowchart of the execution process of the physics-driven water optical feature decoupling network of the present invention; Figure 3 This is a flowchart of the water reflectance component depth scattering feature extraction process of the present invention; Figure 4 This is a flowchart illustrating the construction process of the underwater optical attenuation field model of the present invention. Figure 5 This is a flowchart illustrating the calculation process for aligning the attenuation coefficient distribution characteristics with the mapping matrix of water body physicochemical parameters in this invention. Figure 6 This is a flowchart of the regression calculation process for the water quality physicochemical index evaluation results of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please refer to Figure 1 This embodiment provides an environmental engineering water quality assessment method combining image recognition to acquire the original image of the water body to be assessed. The original image is acquired by an image acquisition device under natural lighting conditions, with the device's shooting direction at a 45-degree angle to the water surface to reduce the impact of specular reflection on image quality. The original image is in RGB format, with each color channel having a pixel value range of 0 to 255. After acquiring the original image, preprocessing operations are performed, including image denoising and size normalization. Image denoising uses a Gaussian filtering method with a kernel size of 3×3 and a standard deviation of 1.0. Size normalization adjusts the resolution of the original image to 512×512 pixels to meet the input requirements of subsequent network processing.
[0020] refer to Figure 2 A physics-driven water optical feature decoupling network was constructed to decompose the original image into illumination and water reflectance components. The network employs an encoder-decoder architecture. The encoder consists of multiple convolutional and pooling layers to extract multi-scale features from the original image. The decoder consists of multiple deconvolutional and upsampling layers to reconstruct the feature map into illumination and water reflectance components at the original image size. The preprocessed original image is input to the feature encoder, which progressively reduces the spatial resolution of the feature map while increasing the number of channels through successive convolution and pooling operations, resulting in an initial feature map. The initial feature map has a size of 64×64×256, where 64×64 represents the spatial resolution and 256 represents the number of channels.
[0021] Based on the Lambertian reflectance physical model, the initial feature map is decomposed into high-frequency illumination features and low-frequency reflectivity features. The Lambertian reflectance physical model describes the light reflection characteristics of an ideal diffuse reflective surface, and its mathematical expression is:
[0022] in, Represents coordinates in the image Pixel brightness value at that location, This indicates the light intensity at that location. This represents the surface reflectivity at that location. According to the Lambertian reflection physics model, an image can be decomposed into the product of an illumination component and a reflectivity component. In the feature space, the illumination component mainly corresponds to the low-frequency components in the feature map, manifesting as overall brightness variations in the image; the reflectivity component mainly corresponds to the high-frequency components in the feature map, manifesting as edge and texture details in the image.
[0023] A directional gradient constraint is introduced to perform spatial smoothing filtering on high-frequency illumination features, removing local shadow abrupt changes in these features. Based on the gradient direction information of the image, the directional gradient constraint applies different smoothing intensities to gradient components in different directions. A larger smoothing intensity is applied to gradient components aligned with the illumination direction, while a smaller smoothing intensity is applied to gradient components perpendicular to the illumination direction. The mathematical expression for the directional gradient constraint is:
[0024] in, Represents the illumination feature map in coordinates The gradient vector at that point, A unit vector representing the direction of illumination. This is a preset gradient threshold. By using directional gradient constraints, abrupt changes in illumination caused by local shadows can be effectively removed while maintaining the overall trend of illumination variation.
[0025] The smoothed high-frequency illumination features and low-frequency reflectivity features are deconvolutionally reconstructed to output the illumination component and water reflectivity component, respectively. The deconvolution reconstruction process employs a transposed convolution operation to progressively restore the spatial resolution of the feature maps to the original image size. During deconvolution reconstruction, a skip connection mechanism is introduced to concatenate the feature maps of corresponding layers in the encoder and decoder to retain more image detail. The final outputs are both 512×512×3 RGB images, where the illumination component reflects the distribution of ambient light, and the water reflectivity component reflects the optical reflectivity properties of the water itself.
[0026] refer to Figure 3 This study extracts depth scattering features from the water reflectance component. Multi-scale dilated convolution is performed on the water reflectance component to obtain multi-scale reflectance feature maps under different receptive fields. The multi-scale dilated convolution uses dilated convolution kernels with different dilation rates: 1, 2, 4, and 8, corresponding to receptive field sizes of 3×3, 7×7, 15×15, and 31×31, respectively. Through multi-scale dilated convolution, both local detail features and global contextual features in the water reflectance component can be captured simultaneously.
[0027] For multi-scale reflectance feature maps, the differential response between adjacent scale feature maps is calculated, and feature regions with differential response values greater than a preset threshold are extracted as internal scattering regions of the water body. The method for calculating the differential response between adjacent scale feature maps is as follows: the feature map with a larger receptive field is upsampled to the same size as the feature map with a smaller receptive field, and then the absolute value of the difference between the two feature maps is calculated pixel by pixel. The formula for calculating the differential response value is:
[0028] in, Indicates the first The first scale and the first Each scale feature map in coordinates The difference response value at that point, Indicates the first Feature maps at various scales in coordinates eigenvalues at that location Indicates the first Feature maps at various scales in coordinates The characteristic value at the specified location. The preset threshold is determined based on experimental data and is typically set to 1.5 times the average of all differential response values. The characteristic region where the differential response value is greater than the preset threshold corresponds to the light scattering region caused by suspended matter inside the water body. The characteristics of these regions can effectively reflect the turbidity of the water body.
[0029] A cross-channel attention-weighted fusion process is performed on the internal scattering region of the water body to remove shallow surface specular reflection features and retain deep scattering features. The weighted fused deep scattering features are then identified as the depth scattering features. This cross-channel attention-weighted fusion adaptively weights the feature maps of each channel by learning the importance weights of different color channels. For the internal scattering region of the water body, the features of the red and green channels mainly reflect specular reflection from the water surface, while the features of the blue channel mainly reflect deep scattering within the water body. Therefore, cross-channel attention-weighted fusion can reduce the weight of the features of the red and green channels and increase the weight of the features of the blue channel, thereby improving the purity of the depth scattering features.
[0030] refer to Figure 4 An underwater optical attenuation field model was constructed based on depth scattering characteristics and the optical attenuation law of water. According to the Beer-Lamber law, an exponential relationship equation was established between the propagation distance of photons in the water body under evaluation and the attenuation of light intensity. The Beer-Lamber law describes the attenuation law of light propagating in a homogeneous medium, and its mathematical expression is:
[0031] in, Indicates the distance the photon travels. The intensity of light after that, Indicates the initial light intensity. Indicates the optical attenuation coefficient of water. Indicates the distance a photon travels. Optical attenuation coefficient. It is a comprehensive reflection of the inherent optical properties of water bodies and is closely related to physicochemical indicators such as the concentration of suspended solids and dissolved organic carbon in water bodies.
[0032] The scattering intensity values at each pixel location in the depth scattering feature are used as boundary constraints for the exponential relationship equation. The scattering intensity value at each pixel location in the depth scattering feature is proportional to the light intensity attenuation at that location; the larger the scattering intensity value, the more severe the light intensity attenuation at that location. Using the exponential relationship equation and boundary constraints, the optical attenuation coefficient corresponding to each spatial coordinate point in the water body to be evaluated is solved. For each pixel location, the scattering intensity value in the depth scattering feature is used as... The depth value corresponding to this pixel is used as Substituting into the Beer-Lambert law equation, the optical attenuation coefficient at that location can be obtained by solving. .
[0033] Three-dimensional volumetric data is constructed based on the optical attenuation coefficients at each spatial coordinate point, and this three-dimensional volumetric data is defined as the underwater optical attenuation field model. The dimension of the three-dimensional volumetric data is... ,in and These are the width and height of the original image, respectively. The depth represents the number of layers. The value of each voxel is the optical attenuation coefficient at the corresponding spatial coordinate point. The underwater optical attenuation field model can intuitively reflect the three-dimensional distribution of optical attenuation coefficients in water, providing a basis for subsequent assessment of water quality physicochemical indicators.
[0034] refer to Figure 5 The attenuation coefficient distribution characteristics in the underwater optical attenuation field model are aligned with a pre-defined water physicochemical parameter mapping matrix. This mapping matrix is calibrated based on the physical response relationship between photon scattering cross-section and turbidity and dissolved organic carbon concentration under different concentration gradients. The photon scattering cross-section is a physical quantity describing the probability of photon interaction with suspended matter in water, and is closely related to the concentration, particle size distribution, and refractive index of the suspended matter. Turbidity is an indicator of the degree of turbidity in water and is directly proportional to the concentration of suspended matter. Dissolved organic carbon is the total amount of dissolved organic matter in water, which affects the light absorption characteristics of the water.
[0035] Extract histograms of attenuation coefficient distributions at different depth levels in the underwater optical attenuation field model. For each depth level in the underwater optical attenuation field model, statistically analyze the distribution of optical attenuation coefficient values for all voxels at that level, generating an attenuation coefficient distribution histogram. The x-axis of the attenuation coefficient distribution histogram represents the optical attenuation coefficient value, and the y-axis represents the number of voxels corresponding to that optical attenuation coefficient value. Perform principal component analysis on the attenuation coefficient distribution histogram to extract principal component vectors characterizing the photon scattering cross-section. Principal component analysis transforms a set of potentially correlated variables into a set of linearly uncorrelated variables, i.e., principal components, through orthogonal transformation. The mathematical expression for principal component analysis is:
[0036] in, The original data matrix, It is an orthogonal transformation matrix. The principal component matrix is the matrix of principal components. The principal component vectors are orthogonal transformation matrices. The column vectors are arranged in descending order of their respective variances. The first few principal component vectors contain most of the information from the original data and can effectively characterize the main features of the attenuation coefficient distribution.
[0037] Calculate the Mahalanobis distance between the principal component vectors and the reference parameter vectors in the mapping matrix of water body physicochemical parameters. Mahalanobis distance is a distance metric that considers the correlation between data, effectively eliminating the influence of dimensional differences and correlations between variables of different dimensions. The formula for calculating Mahalanobis distance is:
[0038] in, and Given two vectors, Let covariance matrix be the variance matrix. This is the inverse of the covariance matrix. The similarity between the principal component vectors and each reference parameter vector can be measured by calculating the Mahalanobis distance between them.
[0039] A combination of reference parameter vectors with Mahalanobis distances less than a preset distance threshold is selected. A spatial projection transformation is then performed on the principal component vectors to align the attenuation coefficient distribution characteristics with the water body physicochemical parameter mapping matrix. The preset distance threshold is determined based on experimental data and is typically set to twice the average of all Mahalanobis distances. The spatial projection transformation projects the principal component vectors onto a subspace spanned by the selected reference parameter vectors, ensuring better alignment between the projected vectors and the reference parameter vectors in the water body physicochemical parameter mapping matrix.
[0040] refer to Figure 6The water quality physicochemical index assessment results are output by performing regression calculations based on the aligned attenuation coefficient distribution characteristics. The physical response curves corresponding to turbidity and dissolved organic carbon concentration in the water physicochemical parameter mapping matrix are used as kernel functions and introduced into the support vector regression model. Support vector regression is a machine learning method based on statistical learning theory, which can effectively handle nonlinear regression problems. The kernel function maps nonlinear problems in low-dimensional space to high-dimensional space, making them linear problems in high-dimensional space. The mathematical expression of the physical response curve kernel function is:
[0041] in, and Given two input vectors, This is the bandwidth parameter of the kernel function. and This is a physical response curve function. The physical response curve function is obtained by fitting data from the water body's physicochemical parameter mapping matrix and accurately reflects the physical relationship between the optical attenuation coefficient and turbidity and dissolved organic carbon concentration.
[0042] The aligned attenuation coefficient distribution characteristics are input into a support vector regression model configured with a kernel function. The support vector regression model establishes a nonlinear mapping model between the attenuation coefficient distribution characteristics and water quality physicochemical indicators by learning the input-output mapping relationship in the training data. The nonlinear mapping output value of the aligned attenuation coefficient distribution characteristics under the constraint of the physical response curve is calculated by the support vector regression model, and this nonlinear mapping output value is determined as the water quality physicochemical indicator evaluation result. The water quality physicochemical indicator evaluation result includes turbidity value and dissolved organic carbon concentration value, in NTU and mg / L, respectively.
[0043] Table 1 shows an example of the water body physicochemical parameter mapping matrix, which illustrates the baseline values of the optical attenuation coefficient under different combinations of turbidity and dissolved organic carbon concentrations.
[0044] Table 1. Example of water body physicochemical parameter mapping matrix
[0045] The data in Table 1 were obtained by preparing standard water samples with different concentration gradients under laboratory conditions and measuring their optical attenuation coefficients. For each standard water sample, the light transmittance at different wavelengths was measured using a spectrophotometer, and then the optical attenuation coefficient was calculated according to the Beer-Lambert law. Each reference parameter vector in the water body physicochemical parameter mapping matrix corresponds to a row of data in the table, including three dimensions: turbidity, dissolved organic carbon concentration, and optical attenuation coefficient. In practical applications, the water body physicochemical parameter mapping matrix can be adjusted and updated according to different regions and different types of water bodies to improve the accuracy of water quality assessment.
[0046] In this embodiment, a physical-driven water optical feature decoupling network is used to decompose the original image into an illumination component and a water reflectivity component, separating ambient light interference from the inherent optical properties of the water. An underwater optical attenuation field model is constructed based on depth scattering characteristics and the water optical attenuation law. Alignment calculations are performed using a water physicochemical parameter mapping matrix calibrated based on the physical response relationship between photon scattering cross-section and turbidity and dissolved organic carbon concentration under different concentration gradients. The water quality physicochemical index evaluation results are output through regression calculation of attenuation coefficient distribution characteristics, establishing a physical mapping mechanism between visual features and water quality physicochemical parameters.
[0047] In a preferred embodiment, a two-branch feature extraction network based on the Lambertian reflectance physical model is constructed. The two-branch feature extraction network includes a first branch and a second branch, which share the same initial input feature map but employ different feature extraction methods. The first branch is used to extract high-frequency illumination features, and the second branch is used to extract low-frequency reflectance features. The input to the two-branch feature extraction network is the initial feature map, with a size of 64×64×256.
[0048] The initial feature map is input into the first branch of the dual-branch feature extraction network, where high-frequency illumination features with drastic edge gradient changes are extracted using a high-pass filter bank. The high-pass filter bank consists of multiple high-pass filters in different directions, including horizontal, vertical, and diagonal high-pass filters. Each high-pass filter has a kernel size of 3×3, with specific values as follows: Horizontal high-pass filter:
[0049] Vertical high-pass filter:
[0050] Diagonal high-pass filter:
[0051] A high-pass filter bank is used to convolve the initial feature map to extract edge gradient information in different directions. The high-pass filtering results from different directions are then concatenated to obtain a high-frequency illumination feature map with a size of 64×64×768. The high-frequency illumination feature map contains edge and texture detail information from the initial feature map, which mainly corresponds to the variations in illumination components.
[0052] The initial feature map is input into the second branch of the dual-branch feature extraction network. A guided filter performs a weighted average of local neighborhood pixels to extract low-frequency reflectance features that are invariant to color and texture. The guided filter is an edge-preserving filtering method based on a local linear model, capable of smoothing an image while retaining its edge information. The mathematical expression for the guided filter is:
[0053] in, The filtered output pixel values. To guide the pixel values of the image, It is the position index of the pixel. and For local windows Linear coefficients within, In pixels A local window centered on the input image. In this embodiment, the guiding image is the initial feature map itself. The guiding filter obtains linear coefficients by minimizing the difference between the output image and the input image. and The guided filter has a window size of 15×15 and a regularization parameter of 0.01. After processing by the guided filter, a low-frequency reflectivity feature map with a size of 64×64×256 is obtained. The low-frequency reflectivity feature map contains the overall brightness and color information from the initial feature map, which mainly corresponds to the inherent reflectivity properties of the water body.
[0054] An orthogonality constraint loss function is injected into the bottleneck layer of the dual-branch feature extraction network to force high-frequency illumination features and low-frequency reflectivity features to be independent in the feature space. The orthogonality constraint loss function aims to make the angle between the high-frequency illumination feature vector and the low-frequency reflectivity feature vector as close to 90 degrees as possible, thereby reducing mutual interference between the two feature components. The mathematical expression of the orthogonality constraint loss function is:
[0055] in, This is the high-frequency illumination feature matrix. This is the low-frequency reflectivity characteristic matrix. This is the Frobenius norm. The formula for calculating the Frobenius norm is:
[0056] in, for The matrix, For matrix The Line number Column elements. The smaller the value of the orthogonality constraint loss function, the better the orthogonality and the stronger the independence between the high-frequency illumination characteristics and the low-frequency reflectivity characteristics.
[0057] During the training of the dual-branch feature extraction network, the orthogonality constraint loss function and the reconstruction loss function are combined as the total loss function for optimization. The reconstruction loss function measures the difference between the reconstructed illumination and reflectance components and the original image, and its mathematical expression is:
[0058] in, For the original image, For the reconstructed illumination components, The reconstructed reflectivity components, It is the L2 norm. The mathematical expression for the total loss function is:
[0059] in, The weight coefficients for the orthogonality constraint loss function are typically set to 0.1. By minimizing the total loss function, the bi-branch feature extraction network can simultaneously learn accurate illumination and reflectivity features while ensuring the independence between the two feature components.
[0060] This study statistically analyzes the channel scattering energy distribution within the water body's internal scattering region across the red, green, and blue color channels. Channel scattering energy refers to the sum of the squares of the feature values of all pixels within that color channel. The formula for calculating the channel scattering energy for each color channel within the water body's internal scattering region is as follows:
[0061] in, For the first The scattering energy of each color channel A collection of pixels representing the scattering region within the water body. For the first Each color channel is located at coordinates The eigenvalue at that location. Indicates the red channel. Indicates a green channel. This indicates the blue channel.
[0062] Based on the channel scattering energy distribution, calculate the energy percentage coefficients for the red, green, and blue color channels. The energy percentage coefficient refers to the proportion of the scattered energy of that color channel to the total scattered energy of the three color channels. The formula for calculating the energy percentage coefficient is:
[0063] in, For the first The energy percentage coefficients of each color channel reflect the degree to which different color channels contribute to scattering within the water body. For specular reflection at the water surface, the energy percentage coefficients of the red and green channels are usually larger; for deep scattering within the water body, the energy percentage coefficient of the blue channel is usually larger.
[0064] The energy proportion coefficient is input into the squeeze activation network to generate adaptive weight coefficients for each color channel. The squeeze activation network is a neural network structure used to learn attention weights between channels, consisting of a squeeze layer and an activation layer. The squeeze layer performs global average pooling on the feature map of each channel, compressing the two-dimensional feature map of each channel into a scalar. The mathematical expression for the global average pooling operation is:
[0065] in, For the first The squeezed output value of each channel, and These represent the height and width of the feature map, respectively. The activation layer consists of two fully connected layers. The first fully connected layer maps the squeezed output feature vector to a low-dimensional space, and the second fully connected layer maps the low-dimensional feature vector back to the original dimension, generating adaptive weight coefficients between 0 and 1 using the sigmoid activation function. The mathematical expression for the activation layer is:
[0066] in, The feature vector of the squeezed output, and Here are the weight matrices for the two fully connected layers. It is the ReLU activation function. It is the sigmoid activation function. This is the generated adaptive weight coefficient vector.
[0067] Based on adaptive weighting coefficients, the feature maps of each color channel in the water's internal scattering region are scaled and superimposed. The specular reflection channel features, which dominate the scattering energy distribution, are weighted less, while the channel features representing scattering from deep suspended matter are weighted more, outputting the depth scattering feature. The mathematical expression for the scaling and superimposing operation is:
[0068] in, The depth scattering features of the output in coordinates The value at that location, For the first Adaptive weighting coefficients for each color channel For the first Each color channel is located at coordinates The eigenvalues at the location are obtained. By scaling and superimposing adaptive weight coefficients, the interference of specular reflection from the water surface can be effectively suppressed, and the characteristic representation of deep scattering within the water body can be enhanced.
[0069] Table 2 shows the parameter settings for dilated convolutions at different scales, illustrating the dilation rate, kernel size, receptive field size, and number of output channels for each scale.
[0070] Table 2 Multiscale dilated convolution parameter settings
[0071] The parameter settings in Table 2 are the optimal configurations verified through experiments. Scale 1 dilated convolution is used to extract local detail features in the water reflectance component, such as the scattering characteristics of small suspended particles; scale 2 dilated convolution is used to extract medium-scale features, such as the scattering characteristics of medium-sized suspended particles; scale 3 dilated convolution is used to extract larger-scale features, such as the overall turbidity distribution of the water body; and scale 4 dilated convolution is used to extract global contextual features, such as the contrast between the water body and its surrounding environment. By combining multi-scale dilated convolutions, features at different scales in the water reflectance component can be comprehensively captured, providing a foundation for subsequent differential response calculations and depth scattering feature extraction.
[0072] In this embodiment, a dual-branch feature extraction network based on the Lambertian reflection physical model is used to split the initial feature map into high-frequency illumination features and low-frequency reflectivity features. An orthogonality constraint loss function is injected into the bottleneck layer to force the two feature components to be independent in the feature space, reducing the interference of residual illumination components on the reflectivity components. By statistically analyzing the channel scattering energy distribution of the water's internal scattering region under the red, green, and blue color channels, an adaptive weighting coefficient corresponding to each color channel is generated using a squeeze excitation network. The feature maps of each channel are scaled and superimposed, reducing the weight of specular reflection channel features and increasing the weight of channel features representing deep suspended matter scattering, thus improving the purity of depth scattering feature extraction.
[0073] In a preferred embodiment, a depth estimation map corresponding to the original image is obtained. The depth estimation map is estimated from the original image using a monocular depth estimation network. The monocular depth estimation network employs an encoder-decoder architecture, where the encoder extracts multi-scale features from the original image, and the decoder reconstructs the feature map into a depth estimation map. The input to the monocular depth estimation network is the original image, with dimensions of 512×512×3, and the output is the depth estimation map, with dimensions of 512×512×1. The value of each pixel in the depth estimation map represents the distance from the corresponding scene point to the camera, in meters.
[0074] The depth values of each pixel in the depth estimation image are substituted into the exponential relationship equation as the photon propagation distance. For each pixel in the original image... Its corresponding depth value , representing the distance a photon travels from the water surface to the underwater point corresponding to that pixel. The scattering intensity value at the corresponding location in the depth scattering feature is substituted into the exponential relationship equation as the light intensity attenuation. (Pixel in the depth scattering feature) The scattering intensity value at that location is , representing the distance the photon travels The remaining light intensity afterward.
[0075] By performing a logarithmic transformation and solving for the partial derivatives of the exponential relationship between photon propagation distance and light intensity attenuation in the equation, the optical attenuation coefficient at each pixel depth position is calculated. First, taking the natural logarithm of both sides of the Beer-Lambert law equation, we obtain:
[0076] Then, to Taking the partial derivative, we get:
[0077] Therefore, optical attenuation coefficient It can be represented as:
[0078] In the discrete case, the partial derivatives can be approximated using differences. For each pixel in the depth estimation map... The formula for calculating its optical attenuation coefficient is:
[0079] in, and Pixels The scattering intensity and depth values at a given location are used. Using the formula above, the optical attenuation coefficient for each pixel in the original image can be calculated.
[0080] Based on the spatial coordinate mapping relationship of the depth estimation map, the optical attenuation coefficients of each pixel are arranged into a three-dimensional tensor form. The spatial coordinate mapping relationship of the depth estimation map transforms the two-dimensional image coordinates... Mapping to 3D world coordinates The dimension of a three-dimensional tensor is... ,in , , This refers to the number of layers in the depth direction. The number of layers in the depth direction is determined based on the depth range of the depth estimation map, and is typically set to 64 layers. Each voxel... The value is the optical attenuation coefficient at the corresponding three-dimensional world coordinate point.
[0081] Calculate the covariance matrix of all reference parameter vectors in the water body physicochemical parameter mapping matrix. The reference parameter vectors in the water body physicochemical parameter mapping matrix are: ,in This represents the number of baseline parameter vectors. Each baseline parameter vector... The dimension is In this embodiment This corresponds to three dimensions: turbidity, dissolved organic carbon concentration, and optical attenuation coefficient. Covariance matrix The dimension is Its elements The calculation formula is:
[0082] in, For the first The first reference parameter vector One element, For the first The first reference parameter vector One element, For all reference parameter vectors, the first The average of the elements, For all reference parameter vectors, the first The covariance matrix is the average of the elements. It reflects the correlation between different dimensions of the baseline parameter vector.
[0083] Singular value decomposition (SVD) is performed on the covariance matrix to obtain the inverse covariance matrix. Singular value decomposition is a method that decomposes a matrix into the product of three matrices; its mathematical expression is:
[0084] in, and It is an orthogonal matrix. It is a diagonal matrix, and the elements on the diagonal are the singular values of the covariance matrix. The inverse covariance matrix. It can be calculated from the results of singular value decomposition:
[0085] in, It is a diagonal matrix, and the elements on the diagonal are... The reciprocal of the corresponding singular value.
[0086] The principal component vectors and reference parameter vectors are whitened using the inverse covariance matrix to eliminate the linear correlation between parameters of different dimensions. The mathematical expression for whitening is:
[0087] in, For the original vector, This is the average vector of all reference parameter vectors. The square root of the inverse covariance matrix. This is the whitened vector. The square root of the inverse covariance matrix can be calculated from the results of singular value decomposition:
[0088] in, It is a diagonal matrix, and the elements on the diagonal are... The square root of the corresponding singular value is the reciprocal. Through whitening, the correlation between parameters of different dimensions is eliminated, and the variance of each dimension is normalized to 1.
[0089] Calculate the Euclidean distance between the whitened principal component vectors and the whitened reference parameter vectors, and then define the Euclidean distance as the Mahalanobis distance. The formula for calculating the Euclidean distance is:
[0090] in, and These are two whitened vectors. and They are vectors and The There are 10 elements. Since whitening has eliminated the correlation between different dimensions and normalized the variance, the Euclidean distance between the whitened vectors is equal to the Mahalanobis distance between the original vectors.
[0091] A local linear manifold is constructed by selecting the top K reference parameter vectors with the smallest Mahalanobis distance. The principal component vectors are then projected onto this local linear manifold for alignment. The value of K is typically set between 5 and 10, determined based on experimental data. The local linear manifold is a low-dimensional subspace spanned by the top K reference parameter vectors with the smallest Mahalanobis distance. The projection of the principal component vectors onto the local linear manifold can be obtained using the least squares method. The projected principal component vectors are better aligned with the reference parameter vectors in the water body physicochemical parameter mapping matrix, thereby improving the accuracy of subsequent regression calculations.
[0092] Table 3 shows an example of the Mahalanobis distance calculation results, illustrating the Mahalanobis distance between the principal component vectors and each reference parameter vector.
[0093] Table 3. Examples of Mahalanobis distance calculation results
[0094] As shown in Table 3, the Mahalanobis distance between the principal component vector and the 5th reference parameter vector is the smallest, at 0.87; the Mahalanobis distance between the principal component vector and the 4th reference parameter vector is the second smallest, at 1.23. Therefore, the top 5 reference parameter vectors (numbered 3 to 7) with the smallest Mahalanobis distances are selected to construct a local linear manifold, and the principal component vectors are projected onto this local linear manifold for alignment. The projected principal component vectors can more accurately reflect the physicochemical properties of the water body being evaluated.
[0095] In this embodiment, by acquiring the depth estimation map corresponding to the original image, the depth value of each pixel in the depth estimation map is substituted into the Beer-Lambert law equation as the photon propagation distance. Combined with the scattering intensity value in the depth scattering characteristics, the optical attenuation coefficient of each spatial coordinate point is obtained, and a three-dimensional volumetric underwater optical attenuation field model is constructed. By calculating the covariance matrix of all reference parameter vectors in the water body physicochemical parameter mapping matrix, singular value decomposition is performed on the covariance matrix to obtain the inverse covariance matrix. The principal component vectors and each reference parameter vector are whitened using the inverse covariance matrix, and then the Mahalanobis distance is calculated. The top K reference parameter vectors with the smallest Mahalanobis distance are selected to construct a local linear manifold. The principal component vectors are projected onto the local linear manifold to complete the alignment calculation, which reduces the model's dependence on labeled data and improves the generalization ability and stability of quantitative evaluation under different water environments.
Claims
1. An environmental engineering water quality assessment method combining image recognition, characterized in that, include: Acquire raw images of the water body to be evaluated; A physics-driven decoupling network for water body optical features is constructed to decompose the original image into illumination components and water reflectivity components. The depth scattering characteristics of the water reflectivity component are extracted, and an underwater optical attenuation field model is constructed based on the depth scattering characteristics and the optical attenuation law of water. The distribution characteristics of the attenuation coefficient in the underwater optical attenuation field model are aligned with the preset water body physicochemical parameter mapping matrix. The water body physicochemical parameter mapping matrix is calibrated based on the physical response relationship between photon scattering cross section and turbidity and dissolved organic carbon concentration under different concentration gradients. Regression calculations are performed using the aligned attenuation coefficient distribution characteristics to output the water quality physicochemical index evaluation results.
2. The environmental engineering water quality assessment method combining image recognition according to claim 1, characterized in that, The construction of a physics-driven water optical feature decoupling network decomposes the original image into an illumination component and a water reflectance component, including: The original image is input into the feature encoder to obtain an initial feature map; Based on the physical model of Lambertian reflection, the initial feature map is split into high-frequency illumination features and low-frequency reflectivity features; A directional gradient constraint is introduced to perform spatial smoothing filtering on the high-frequency illumination features, thereby removing local shadow abruptness regions in the high-frequency illumination features. The smoothed high-frequency illumination features and the low-frequency reflectivity features are deconvolved and reconstructed to output the illumination component and the water reflectivity component, respectively.
3. The environmental engineering water quality assessment method combining image recognition according to claim 1, characterized in that, Extracting depth scattering features from the water reflectance components includes: Multi-scale dilated convolution operation is performed on the water reflectance components to obtain multi-scale reflectance feature maps under different receptive fields. For the multi-scale reflectivity feature map, the differential response between adjacent scale feature maps is calculated, and the feature regions with differential response values greater than a preset threshold are extracted as the internal scattering regions of the water body. Cross-channel attention-weighted fusion is performed on the scattering region inside the water body to remove shallow surface specular reflection features and retain deep scattering features. The weighted fused deep scattering features are then determined as the depth scattering features.
4. The environmental engineering water quality assessment method combining image recognition according to claim 1, characterized in that, An underwater optical attenuation field model is constructed based on the aforementioned depth scattering characteristics and the optical attenuation law of water bodies, including: Based on Beer-Lambert's law, an exponential relationship equation is established between the distance a photon travels in the water body to be evaluated and the attenuation of light intensity. The scattering intensity value at each pixel location in the depth scattering feature is used as the boundary constraint condition for the exponential relationship equation. Using the exponential relationship equation and the boundary constraints, the optical attenuation coefficient corresponding to each spatial coordinate point in the water body to be evaluated is solved; Three-dimensional volume data is constructed based on the optical attenuation coefficients at each spatial coordinate point, and the three-dimensional volume data is determined as the underwater optical attenuation field model.
5. The environmental engineering water quality assessment method combining image recognition according to claim 1, characterized in that, The attenuation coefficient distribution characteristics in the underwater optical attenuation field model are aligned with a preset water physicochemical parameter mapping matrix, including: Extract the attenuation coefficient distribution histograms at different depth levels in the underwater optical attenuation field model; Principal component analysis was performed on the attenuation coefficient distribution histogram to extract the principal component vector characterizing the photon scattering cross section; Calculate the Mahalanobis distance between the principal component vector and each reference parameter vector in the water body physicochemical parameter mapping matrix; A combination of reference parameter vectors whose Mahalanobis distance is less than a preset distance threshold is selected, and the principal component vectors are subjected to spatial projection transformation to complete the alignment calculation of the attenuation coefficient distribution characteristics and the water body physicochemical parameter mapping matrix.
6. The environmental engineering water quality assessment method combining image recognition according to claim 1, characterized in that, Regression calculations are performed using the aligned attenuation coefficient distribution characteristics to output water quality physicochemical index assessment results, including: The physical response curves corresponding to turbidity and dissolved organic carbon concentration in the water body physicochemical parameter mapping matrix are used as kernel functions and introduced into the support vector regression model. The aligned attenuation coefficient distribution features are input into the support vector regression model configured with the kernel function; The nonlinear mapping output value of the aligned attenuation coefficient distribution characteristics under the constraint of the physical response relationship curve is calculated by the support vector regression model, and the nonlinear mapping output value is determined as the evaluation result of the water quality physicochemical index.
7. The environmental engineering water quality assessment method combining image recognition according to claim 2, characterized in that, The Lambertian reflection physical model decomposes the initial feature map into high-frequency illumination features and low-frequency reflectivity features, including: Construct a two-branch feature extraction network based on the physical model of Lambertian reflection; The initial feature map is input into the first branch of the dual-branch feature extraction network, and the high-frequency illumination features with drastic edge gradient changes are extracted through a high-pass filter bank. The initial feature map is input into the second branch of the dual-branch feature extraction network, and the local neighborhood pixels are weighted and averaged by a guided filter to extract the low-frequency reflectance feature that is invariant to color and texture. An orthogonality constraint loss function is injected into the bottleneck layer of the dual-branch feature extraction network to force the high-frequency illumination features and the low-frequency reflectivity features to be independent of each other in the feature space.
8. The environmental engineering water quality assessment method combining image recognition according to claim 3, characterized in that, Perform cross-channel attention-weighted fusion on the scattering region within the water body, including: The distribution of channel scattering energy in the internal scattering region of the water body under the three color channels of red, green and blue is statistically analyzed. Based on the energy distribution of the channels, calculate the energy percentage coefficients corresponding to the red, green, and blue color channels; The energy percentage coefficient is input into the extrusion excitation network to generate adaptive weight coefficients for each color channel. Based on the adaptive weighting coefficients, the feature maps of each color channel in the scattering region inside the water body are scaled and superimposed. The specular reflection channel features that dominate the scattering energy distribution of the channel are downweighted, while the channel features that characterize the scattering of deep suspended matter are upweighted, and the depth scattering features are output.
9. The environmental engineering water quality assessment method combining image recognition according to claim 4, characterized in that, Using the exponential relationship equation and the boundary constraints, the optical attenuation coefficient corresponding to each spatial coordinate point in the water body to be evaluated is solved, including: Obtain the depth estimation map corresponding to the original image; The depth value of each pixel in the depth estimation map is substituted into the exponential relationship equation as the photon propagation distance; The scattering intensity value at the corresponding position in the depth scattering feature is substituted into the exponential relationship equation as the light intensity attenuation. By performing a logarithmic transformation and solving the partial derivatives of the exponential relationship equation after substituting the photon propagation distance and the light intensity attenuation, the optical attenuation coefficient at each pixel depth position is calculated. Based on the spatial coordinate mapping relationship of the depth estimation map, the optical attenuation coefficients of each pixel are arranged into a three-dimensional tensor form.
10. The environmental engineering water quality assessment method combining image recognition according to claim 5, characterized in that, Calculating the Mahalanobis distance between the principal component vector and each reference parameter vector in the water body physicochemical parameter mapping matrix includes: Calculate the covariance matrix of all reference parameter vectors in the water body physicochemical parameter mapping matrix; Perform singular value decomposition on the covariance matrix to obtain the inverse covariance matrix; The principal component vector and each of the reference parameter vectors are whitened using the inverse covariance matrix to eliminate the linear correlation between parameters of different dimensions. Calculate the Euclidean distance between the whitened principal component vector and each of the whitened reference parameter vectors, and determine the Euclidean distance as the Mahalanobis distance; The top K reference parameter vectors with the smallest Mahalanobis distance are selected to construct a local linear manifold, and the principal component vectors are projected onto the local linear manifold to complete the alignment.