Intelligent water quality treatment method and apparatus

By acquiring water quality images and data, extracting features using a pre-set model, and combining this with nitrous oxide emissions, the timeliness and accuracy issues in water quality management were resolved, achieving a systematic and sustainable improvement in water quality management.

CN121147677BActive Publication Date: 2026-07-10HOHAI UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HOHAI UNIV
Filing Date
2025-08-01
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In current water pollution control efforts, the correlation mechanism between nitrous oxide emissions and water quality parameters has not been fully utilized, resulting in the inability to monitor dynamic changes in water quality in real time, inaccurate emission estimates, a lack of precision in treatment measures, and serious waste of resources.

Method used

By acquiring water quality images and data, extracting spatial and textural features using a pre-set model, and combining this with nitrous oxide emissions, treatment measures can be determined, achieving timeliness and precision in water quality management.

Benefits of technology

It has improved the timeliness and precision of water quality management, ensuring that treatment measures not only improve water quality but also reduce environmental hazards, promoting a shift from passive response to proactive prevention, and enhancing the systematicness and sustainability of management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121147677B_ABST
    Figure CN121147677B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of water quality treatment, in particular to an intelligent water quality treatment method and device. A target water quality image corresponding to a target sampling point in target water quality is acquired; the target water quality image is input into a preset water quality data determination model, and target water quality data corresponding to the target water quality is output; the target water quality image and the target water quality data are input into a preset nitrous oxide emission amount determination model, and the nitrous oxide emission amount corresponding to the target water quality is output; and based on the target water quality data and the nitrous oxide emission amount, a preset treatment measure corresponding to the target water quality is determined. The timeliness and accuracy of water quality treatment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water treatment technology, and more specifically to intelligent water treatment methods and devices. Background Technology

[0002] In current water pollution control, nitrous oxide (N2O), as a strong greenhouse gas and a potential indicator of water quality deterioration, has not had its correlation mechanism with water quality parameters (such as nitrogen concentration and algal density) fully utilized. Existing technologies have the following limitations:

[0003] Traditional water quality data (such as nitrogen concentration and dissolved oxygen) are mainly obtained through on-site manual sampling combined with laboratory testing. This has problems such as insufficient spatiotemporal coverage (such as difficulty in real-time monitoring of all points in the watershed) and strong lag (the testing cycle is as long as 24-48 hours), which makes it impossible to capture dynamic changes in water quality in a timely manner (such as sudden pollution spread).

[0004] Current emission estimates largely rely on empirical formulas (such as conversions based on nitrogen input) or single-point sensor monitoring, lacking a correlation with the spatial distribution of water quality. For example, they cannot distinguish between areas with "high nitrogen concentration but low algae" and areas with "high nitrogen + high algae," resulting in low matching between emission figures and actual pollution scenarios, making it difficult to support precise treatment. Existing water treatment measures (such as chemical dosing and ecological interception) are mostly based on single water quality indicators (such as nitrogen concentration) without considering the characteristics of nitrous oxide emissions. For example, applying the same measures to areas with "high nitrogen but low emissions" and areas with "high nitrogen and high emissions" leads to wasted treatment resources or poor results.

[0005] Therefore, there is an urgent need for a water treatment method that can integrate water quality images, water quality data, and nitrous oxide emission characteristics to improve the timeliness and accuracy of water quality management. Summary of the Invention

[0006] In view of this, the present invention provides an intelligent water treatment method and apparatus to improve the timeliness and accuracy of water treatment.

[0007] In a first aspect, the present invention provides an intelligent water treatment method, the method comprising:

[0008] Obtain the target water quality image corresponding to the target sampling point in the target water quality;

[0009] Input the target water quality image into the preset water quality data determination model, and output the target water quality data corresponding to the target water quality.

[0010] Input the target water quality image and target water quality data into the preset nitrous oxide emission determination model, and output the nitrous oxide emission corresponding to the target water quality;

[0011] Based on the target water quality data and nitrous oxide emissions, the pre-set treatment measures corresponding to the target water quality are determined.

[0012] In one optional implementation, the target water quality image is a time-series image. The process involves inputting the target water quality image into a preset water quality data determination model and outputting the target water quality data. This includes: the preset water quality data determination model identifying the target water quality image, determining the RGB values ​​and infrared simulated bands corresponding to the target water quality image, and constructing four-channel image data; inputting the four-channel image data into the spectral-spatial feature extraction branch of the preset water quality data determination model to extract the spatial features corresponding to the four-channel image data; inputting the target water quality image sequence into the spatiotemporal texture feature extraction branch of the preset water quality data determination model to extract the texture features corresponding to each target water quality image; fusing the spatial features and texture features to generate target features; and outputting the target water quality data based on the target features.

[0013] In one optional implementation, the four-channel image data is input into the spectral-spatial feature extraction branch of a preset water quality data determination model to extract the spatial features corresponding to the four-channel image data. This includes: performing single-channel spectral feature analysis on each channel of the four-channel image data to obtain the single-channel features corresponding to each channel; constructing inter-channel interaction features based on the synergistic effect of water quality parameters; the interaction features include ratio features and difference features; using a sliding window method to slide across the four-channel image data to construct gray-level co-occurrence matrices corresponding to each dimension; converting each gray-level co-occurrence matrix into a feature vector and fusing the feature vectors to generate a target vector; calculating the horizontal and vertical gradients corresponding to the four-channel image data using the Sobel operator to obtain gradient features; calculating the spatial distribution entropy corresponding to the four-channel image data; and fusing the single-channel features, inter-channel interaction features, target vector, gradient features, and spatial distribution entropy to generate spatial features.

[0014] In one optional implementation, the target water quality image sequence is input into the spatiotemporal texture feature extraction branch of a preset water quality data determination model to extract the texture features corresponding to each target water quality image, including:

[0015] The spatiotemporal texture feature extraction branch slides a pre-defined convolutional kernel across the target water quality image sequence to generate feature response values ​​at each location, and generates an original feature map based on these response values. The pre-defined convolutional kernel includes both temporal and spatial dimensions. The original feature map is then subjected to global average pooling to compress it into a spatial weight map, which is then normalized to obtain a normalized feature map. The original feature map is multiplied by the normalized feature map to obtain the target feature map. Each channel of the target feature map is then subjected to global average pooling to obtain a pre-defined feature vector. The pre-defined feature vector corresponding to each time step is input into a bidirectional LSTM to extract temporally dependent feature vectors. The target feature map is then convolved to obtain convolutional feature vectors. Finally, the temporally dependent feature vectors are concatenated with the convolutional feature vectors to obtain the texture features.

[0016] In one optional implementation, spatial features and texture features are fused to generate target features, including: performing numerical analysis on spatial features to extract the original spatial values ​​at each location; dividing high-value core regions and non-core regions based on the distribution patterns of the original spatial values ​​to obtain a spatial intensity matrix; performing texture saliency analysis on texture features to divide dominant texture coverage regions and non-dominant texture coverage regions to obtain a texture response matrix; calculating the angle between the high-value core region and the dominant texture coverage region; generating a direction consistency matrix based on the angles corresponding to each location; generating a coupling kernel matrix based on the spatial intensity matrix, texture response matrix, and direction consistency matrix; and fusing spatial features and texture features based on the coupling kernel matrix to generate target features.

[0017] In one optional implementation, the target water quality image and target water quality data are input into a preset nitrous oxide emission determination model, and the nitrous oxide emission corresponding to the target water quality is output. This includes: inputting the target water quality image into the visual feature encoding branch of the preset nitrous oxide emission determination model and outputting image-gas correlation features; inputting the target water quality data into the parameter feature encoding branch of the preset nitrous oxide emission determination model and outputting parameter-gas correlation features; performing weighted fusion of the image-gas correlation features and the parameter-gas correlation features to generate cross-modal features; correcting the cross-modal features to obtain target modal features; and predicting the nitrous oxide emission corresponding to the target water quality based on the target modal features.

[0018] In one optional implementation, the target water quality image is input into the visual feature encoding branch of a preset nitrous oxide emission determination model, and the image-gas correlation features are output. This includes: identifying the target water quality image, determining the corresponding RGB values ​​and infrared analog bands, and constructing four-channel image data; identifying the target water quality data and determining the pollution type; determining the weights of each channel in the four-channel image data according to the pollution type, and generating a weighted channel image; performing a convolution operation on the weighted channel image using a preset-size convolution kernel according to the pollution type to generate preliminary spatial features; performing a convolution operation on the four-channel image data using depthwise separable convolution to extract spectral features; performing a convolution operation on the four-channel image data using direction-selective convolution to extract texture features; fusing the preliminary spatial features, spectral features, and texture features to generate spectral-texture features; mapping the spectral-texture features to a preset nitrous oxide emission template in a predefined nitrous oxide emission pattern library; and outputting image-gas correlation features based on the spectral-texture features and the preset nitrous oxide emission template.

[0019] In one optional implementation, the target water quality data is input into the parameter feature encoding branch of a preset nitrous oxide emission determination model, and the output parameter-gas correlation features are generated. This includes: the parameter feature encoding branch identifies the target water quality data; based on the nonlinear relationship between various data points in the target water quality data and nitrous oxide emissions, it divides dynamic intervals and assigns values ​​to obtain the basic features corresponding to each data point, and extracts the rate of change features corresponding to each data point; based on the correlation between various data points, it establishes coupling features between various data points; it performs nonlinear activation on each basic feature, sets dynamic gating on the rate of change features and coupling features, and obtains the parameter-gas correlation features.

[0020] In one optional implementation, weighted fusion of image-gas correlation features and parameter-gas correlation features is performed to generate cross-modal features, including: performing reliability assessment on image-gas correlation features and parameter-gas correlation features to obtain assessment scores corresponding to image-gas correlation features and parameter-gas correlation features respectively; calculating feature mutual information between each sub-feature in image-gas correlation features and each sub-feature in parameter-gas correlation features; determining global weights corresponding to image-gas correlation features and parameter-gas correlation features based on the assessment scores corresponding to image-gas correlation features and parameter-gas correlation features respectively; calculating local weight matrices between pairs of sub-features based on global weights and feature mutual information; performing outer product calculation on image-gas correlation features and parameter-gas correlation features to generate an initial feature matrix; weighting the elements in the initial feature matrix based on the local weight matrix, and then summing and compressing them by row to obtain cross-modal features.

[0021] Secondly, the present invention provides an intelligent water treatment device, the device comprising:

[0022] The acquisition module is used to acquire the target water quality image corresponding to the target sampling point in the target water quality;

[0023] The first output module is used to input the target water quality image into the preset water quality data determination model and output the target water quality data corresponding to the target water quality.

[0024] The second output module is used to input the target water quality image and target water quality data into the preset nitrous oxide emission determination model and output the nitrous oxide emission corresponding to the target water quality.

[0025] The determination module is used to determine the preset treatment measures corresponding to the target water quality based on the target water quality data and nitrous oxide emissions.

[0026] The intelligent water quality treatment method and apparatus provided in this application acquire target water quality images corresponding to target sampling points in the target water quality. The target water quality image contains spatial distribution features around the sampling point, such as the gradient of pollutant diffusion and the distribution of floating debris on the water surface. This spatial information is directly related to the water quality state of the sampling point. Retaining this information helps subsequent models to more comprehensively understand the environmental background of water quality formation and improves the accuracy of the analysis. The target water quality image is input into a preset water quality data determination model, which outputs target water quality data, ensuring the accuracy of the output target water quality data. The target water quality image contains rich visual features, which are intrinsically related to the physical and chemical properties of the water. The preset water quality data determination model, through the extraction and analysis of the target water quality image features, can convert visual information into quantified water quality data, compensating for implicit features that may be missed in traditional single sampling detection, making the output target water quality data more comprehensive. The target water quality image and target water quality data are input into a preset nitrous oxide emission determination model, which outputs the nitrous oxide emission corresponding to the target water quality. The spatial features of the target water quality image and the quantitative indicators of the target water quality data reflect the ecological state of the water body from different dimensions, while nitrous oxide emissions are closely related to the nitrogen cycle and chemical environment in the water body. Combining the two can provide more comprehensive input information for the pre-set nitrous oxide emission determination model. By integrating the two, the pre-set nitrous oxide emission determination model can more deeply capture the inherent logic of the emission process, improving the scientificity and reliability of emission estimation. Based on the target water quality data and nitrous oxide emissions, the pre-set treatment measures corresponding to the target water quality are determined. The target water quality data reflects the core pollution indicators of the water body, while nitrous oxide emissions reflect the ecological and environmental impact of the water body. Combining the two can clarify the dual objectives of governance: to improve the water quality itself and to reduce environmental hazards (such as controlling nitrous oxide emissions). This process directly links the current status monitoring of water quality, potential environmental impacts (nitrous oxide emissions), and governance measures, ensuring that the treatment measures not only solve the current water quality problems but also take into account long-term ecological and environmental benefits, promoting the transformation of water quality governance from "passive response" to "proactive prevention," and improving the systematicness and sustainability of governance. Attached Figure Description

[0027] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0028] Figure 1 This is a schematic flowchart of an intelligent water treatment method according to an embodiment of the present invention;

[0029] Figure 2 This is a schematic flowchart of another intelligent water treatment method according to an embodiment of the present invention;

[0030] Figure 3 This is a schematic flowchart of another intelligent water treatment method according to an embodiment of the present invention;

[0031] Figure 4 This is a structural block diagram of an intelligent water treatment device according to an embodiment of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 embodiments of the present invention, not all embodiments. 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.

[0033] According to an embodiment of the present invention, an embodiment of an intelligent water treatment method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] This embodiment provides an intelligent water treatment method that can be used in the aforementioned electronic device. Figure 1 This is a flowchart of an intelligent water treatment method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0035] Step S101: Obtain the target water quality image corresponding to the target sampling point in the target water quality.

[0036] Specifically, electronic devices can acquire initial water quality images corresponding to target sampling points in the target water quality based on a connection with a drone or portable camera equipped with a high-resolution camera (such as 20 megapixels or higher) or a multispectral lens.

[0037] Then, the electronic device can use image recognition algorithms (such as object detection models) to locate the core region of the target sampling point in the initial water quality image (e.g., a 100×100 pixel area centered on the sampling point). This region must contain typical water quality features (e.g., areas of color anomaly and texture variation). Then, non-target areas (e.g., land, vegetation, sky, etc.) at the edges of the initial water quality image are cropped, retaining only the pure water area. For example, if the initial water quality image contains "land + water surface," only the water surface portion is retained after cropping; if the initial water quality image has lens edge distortion (e.g., blurred edge pixels), the distorted area (usually 5%-10% of the image edge) is simultaneously cropped.

[0038] Using known "standard white areas" (such as reflective points on a pure water surface or a calibration plate) in the initial water quality image as a benchmark, the gains of the red, green, and blue channels are adjusted to eliminate color cast. For example, if the overall image is bluish, the gain of the blue channel is reduced, while the gains of the red and green channels are increased. Histogram equalization or gamma correction is used to optimize the brightness and contrast of the image, making the water color closer to the true state observed by the human eye (e.g., brightening overly dark water images to avoid loss of detail; darkening overexposed water surface areas to restore texture). If multiple sets of images are acquired, the same correction parameters (such as correction coefficients based on the first standard image) are used to ensure color consistency in images taken at different times and angles, facilitating subsequent time-dependent feature vector analysis.

[0039] Finally, after cropping and color correction, the target water quality image is obtained. This target water quality image contains only the water area of ​​the target sampling point, without edge interference; the color is consistent with the actual water quality (e.g., clear water is light blue, eutrophic water is green); and the resolution is moderate (e.g., 512×512 pixels), preserving details (e.g., tiny algal patches) while avoiding excessive data volume that could affect model efficiency.

[0040] Step S102: Input the target water quality image into the preset water quality data determination model and output the target water quality data corresponding to the target water quality.

[0041] Specifically, the electronic device can input a target water quality image into a preset water quality data determination model. The preset water quality data determination model extracts features from the target water quality image and outputs the target water quality data corresponding to the target water quality. The preset water quality data determination model is generated by annotating historical water quality images and then training on this training water quality image set.

[0042] This step will be explained in detail below.

[0043] Step S103: Input the target water quality image and target water quality data into the preset nitrous oxide emission determination model, and output the nitrous oxide emission corresponding to the target water quality.

[0044] Specifically, the electronic device can input the target water quality image and target water quality data into a preset nitrous oxide emission determination model. The preset nitrous oxide emission determination model can extract features from the target water quality image and target water quality data and output the nitrous oxide emission corresponding to the target water quality.

[0045] The preset nitrous oxide emission determination model is trained based on a preset training dataset.

[0046] Step S104: Based on the target water quality data and nitrous oxide emissions, determine the preset treatment measures corresponding to the target water quality.

[0047] Specifically, electronic devices can identify target water quality data and nitrous oxide emissions, and perform correlation analysis between target water quality data (such as pH, dissolved oxygen, ammonia nitrogen concentration, total nitrogen, total phosphorus, organic matter content, water temperature, etc.) and nitrous oxide emissions to clarify the intrinsic relationship between the two. For example, if the target water quality data shows a high concentration of nitrogen (such as ammonia nitrogen and nitrate nitrogen) and a significantly high nitrous oxide emission, it indicates that the water body may have a nitrogen-dominated emission problem, and measures should be developed focusing on the nitrogen cycle process; if the target water quality data shows low dissolved oxygen (anaerobic environment) and abnormal nitrous oxide emissions, it may be related to denitrification by anaerobic microorganisms, and the dissolved oxygen status of the water body needs to be improved; if the target water quality data shows high organic matter content (such as high COD value) and nitrous oxide emissions fluctuate with organic matter decomposition, the coordinated control of organic matter degradation and gas emissions should be considered simultaneously.

[0048] Then, based on the preset assessment standards, the target water quality data and nitrous oxide emissions are classified into water quality and emission levels (e.g., mild, moderate, severe) to clarify the urgency of the problem and the priority of treatment. Water quality classification: Based on national or industry water quality standards (e.g., the Surface Water Environmental Quality Standard GB3838-2002), the water quality is determined to be Class I-V or worse than Class V, thus determining the severity of pollution; Emission classification: Based on the matching degree between nitrous oxide emissions and the carrying capacity of the water body environment (e.g., whether it exceeds the regional greenhouse gas control threshold, whether it has an impact on the surrounding ecology), the emission risk level is classified into low, medium, and high.

[0049] Based on water quality and discharge classification, targeted solutions are matched from a pre-set treatment measure library. This library typically covers the following categories, which can be combined as needed: measures for nitrogen pollution and high nitrous oxide emissions; measures addressing the correlation between abnormal dissolved oxygen and emissions; measures for organic matter and compound pollution; and long-term monitoring and dynamic adjustment measures.

[0050] The intelligent water quality treatment method provided in this application acquires a target water quality image corresponding to a target sampling point in the target water quality. The target water quality image contains spatial distribution features around the sampling point, and this spatial information is directly related to the water quality state of the sampling point. Retaining this information helps subsequent models to more comprehensively understand the environmental background of water quality formation and improves the accuracy of the analysis. The target water quality image is input into a preset water quality data determination model, which outputs the target water quality data, ensuring the accuracy of the output target water quality data. The target water quality image contains rich visual features, which are intrinsically related to the physical and chemical properties of the water. The preset water quality data determination model, through the extraction and analysis of the target water quality image features, can convert visual information into quantified water quality data, compensating for implicit features that may be missed in traditional single sampling detection, making the output target water quality data more comprehensive. The target water quality image and target water quality data are input into a preset nitrous oxide emission determination model, which outputs the nitrous oxide emission corresponding to the target water quality. The spatial features of the target water quality image and the quantitative indicators of the target water quality data reflect the ecological state of the water body from different dimensions, while nitrous oxide emissions are closely related to the nitrogen cycle and chemical environment in the water body. Combining the two can provide more comprehensive input information for the pre-set nitrous oxide emission determination model, reducing estimation bias caused by a single data source. By integrating the two, the pre-set nitrous oxide emission determination model can more deeply capture the inherent logic of the emission process, improving the scientificity and reliability of emission estimation. Based on the target water quality data and nitrous oxide emissions, the pre-set treatment measures corresponding to the target water quality are determined. The target water quality data reflects the core pollution indicators of the water body, while nitrous oxide emissions reflect the ecological and environmental impact of the water body. Combining the two can clarify the dual objectives of governance: to improve the water quality itself and to reduce environmental harm. This process directly links the current status monitoring of water quality, potential environmental impacts, and governance measures, ensuring that the treatment measures not only solve the current water quality problems but also take into account long-term ecological and environmental benefits, promoting the transformation of water quality governance from "passive response" to "proactive prevention," and improving the systematicness and sustainability of governance.

[0051] This embodiment provides an intelligent water treatment method that can be used in the aforementioned electronic device. Figure 1 This is a flowchart of an intelligent water treatment method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0052] Step S201: Obtain the target water quality image corresponding to the target sampling point in the target water quality.

[0053] Please refer to the above description of step S101 for details on this step, which will not be repeated here.

[0054] Step S202: Input the target water quality image into the preset water quality data determination model and output the target water quality data corresponding to the target water quality.

[0055] Specifically, the target water quality image is a time series image, and step S202 above may include the following steps:

[0056] Step S2021: The preset water quality data determination model identifies the target water quality image, determines the RGB value and infrared simulated band corresponding to the target water quality image, and constructs four-channel image data.

[0057] Specifically, the preset water quality data determination model can separate and extract the red (R), green (G), and blue (B) channel features of the target water quality image through pixel-level analysis. Then, local contrast enhancement is performed on each channel to amplify the feature differences in areas of abnormal water quality (such as a sudden drop in the R channel value near the sewage outlet and a sudden increase in the G channel value in the algae area), providing clearer basic features for subsequent infrared simulation.

[0058] The preset water quality data determination model is based on the inherent correlation between RGB channel features and water quality parameters. It generates simulated infrared (NIR) bands through algorithms to supplement invisible spectral information. Specifically, the preset water quality data determination model can utilize a preset "RGB-NIR correlation database" (trained based on a large amount of measured data) to establish a mapping relationship: for example, NIR simulated value = 0.3×R + 0.2×G - 0.1×B + correction term (the weight of G value for algae is increased to 0.3); the correction term is dynamically adjusted according to the water quality scenario: if the G channel value > 150 (high algae), the correction term + 0.1×G (enhancing the infrared reflectivity of algae); if the B channel value < 50 (high suspended matter), the correction term + 0.2×(255-B) (enhancing the infrared reflectivity of suspended matter).

[0059] The preset water quality data determination model can integrate the extracted R, G, and B channels with the simulated infrared band to form "RGB+NIR" four-channel image data.

[0060] Step S2022: Input the four-channel image data into the spectral-spatial feature extraction branch in the preset water quality data determination model to extract the spatial features corresponding to the four-channel image data.

[0061] Specifically, step S2022 above may include the following steps:

[0062] Step a1: Perform single-channel spectral feature analysis on each channel of the four-channel image data to obtain the single-channel features corresponding to each channel.

[0063] Specifically, the spectral-spatial feature extraction branch can perform single-channel spectral feature analysis on each channel of the four-channel image data to obtain the single-channel features corresponding to each channel. For example, the red (R) channel calculates the mean (reflecting total nitrogen concentration; the higher the total nitrogen, the larger the mean R) and standard deviation (reflecting the uniformity of nitrogen distribution); the green (G) channel extracts the peak wavelength position (when chlorophyll a concentration increases, the peak shifts towards longer wavelengths) and band width (when algae are dense, the width increases); the blue (B) channel calculates the reflectance ratio (B / R, reflecting the dissolved organic matter content, corresponding to the "dissolved organic matter" monitoring index); and the NIR channel extracts the absorption depth (positively correlated with total phosphorus and suspended matter concentration; the more suspended matter, the stronger the NIR absorption).

[0064] Step a2: Based on the synergistic effect of water quality parameters, construct the interaction characteristics between channels.

[0065] Interactive features include ratio features and difference features.

[0066] Specifically, the spectral-spatial feature extraction branch can predefine the synergistic effects of typical water quality parameters (e.g., "↑ nitrogen concentration + ↑ chlorophyll a → eutrophication"; "↓ dissolved oxygen + ↑ temperature → enhanced anaerobic metabolism"), and map them to the spectral response patterns of the four channels (e.g., ↑ nitrogen concentration corresponds to ↓ R channel value, ↑ chlorophyll a corresponds to ↑ G channel value). The channel assignments are as follows: R channel → nitrogen parameters (total nitrogen, ammonia nitrogen); G channel → chlorophyll a, algal activity; B channel → dissolved oxygen, transparency; infrared simulation band → water temperature, organic matter concentration.

[0067] Then, the spectral-spatial feature extraction branch can be based on the "nonlinear correlation between spectral ratios and the synergistic effect of parameters" to set ratio features with clear physical meaning, as follows:

[0068] Eutrophication identification ratio (G / R): G channel mean ÷ R channel mean (dynamic threshold: >2.5 is marked as "high-risk eutrophication"). Synergistic significance: directly maps the synergistic effect of "chlorophyll a↑ + nitrogen concentration↑"—algal reproduction (G↑) depends on nitrogen nutrition (R↓). The higher the ratio, the more severe the eutrophication (e.g., when the ratio = 3.2, it corresponds to chlorophyll a > 30 μg / L + total nitrogen > 2 mg / L). Optionally, the ratio of the water edge area (where the R value fluctuates greatly) is multiplied by a first preset weight to avoid edge noise interference. The first preset weight can be 0.8 or 0.7, and this application embodiment does not specifically limit the first preset weight.

[0069] Anaerobic environment judgment ratio (infrared / B): average value of infrared simulated band ÷ average value of B channel (threshold: >1.8 is judged as "strong anaerobic zone"). Synergistic significance: reflects the synergistic effect of "water temperature ↑ + dissolved oxygen ↓"—infrared value ↑ corresponds to water temperature ↑, B channel value ↓ corresponds to dissolved oxygen ↓, and a high ratio of the two indicates active anaerobic microorganisms (such as enhanced denitrification, which easily produces nitrous oxide). Optionally, if the water depth corresponding to the target sampling point is greater than a preset water depth threshold, the anaerobic environment judgment ratio is multiplied by a second preset weight. The second preset weight can be 1.2 or 1.3; this application embodiment does not specifically limit the second preset weight. This is because anaerobic environments are more likely to form in deep water areas, enhancing the specificity of the feature.

[0070] Pollutant source differentiation ratio (R / infrared): R channel mean ÷ infrared simulated band mean. Synergistic significance: Agricultural non-point source pollution is mainly nitrogen (a decrease in R value is more significant), while industrial wastewater contains high-temperature organic matter (an increase in infrared value is more significant). The difference in the ratio can quickly distinguish the pollution source.

[0071] Next, the spectral-spatial feature extraction branch is configured to capture the differential features of "parameter co-suppression" and quantify the inverse correlation between spectral channels, as follows:

[0072] Algal Competition Inhibition Difference (GB): Mean of G channel - Mean of B channel (negative values ​​are marked as "limited algal growth"). Synergistic Significance: Reflects the synergistic effect of "chlorophyll a↑ being inhibited by dissolved oxygen↓"—algal photosynthesis requires sufficient dissolved oxygen (high B value). If the B value is too low (e.g., <40), even if the G value is high (initial algal reproduction), this difference will be negative, indicating that "algal growth will be limited due to hypoxia".

[0073] Nitrogen cycle equilibrium difference (R-infrared): R channel mean - infrared simulated band mean (threshold: <-50 indicates "denitrification dominates nitrogen cycle"). Synergistic significance: Maps the "inverse balance between nitrogen concentration ↑ and temperature ↑" - the denitrification process (nitrogen to gas) requires a suitable temperature (infrared value ↑). If the R value is low (nitrogen concentration is high) and the infrared value is high (temperature is suitable), the larger the negative difference value, the stronger the denitrification effect (e.g., when the difference = -80, the corresponding denitrification rate is >0.5mg / (L•d)).

[0074] Step a3: The sliding window method is used to slide across the four-channel image data to construct the gray-level co-occurrence matrix corresponding to each dimension.

[0075] Specifically, the spectral-spatial feature extraction branch can perform single-channel dynamic grayscale layering on four-channel image data. For example, the R channel (nitrogen pollution sensitive): divided into 5 levels according to "0-50-100-150-200-255" (the higher the nitrogen concentration, the lower the grayscale level), highlighting the texture differences in low grayscale levels (high nitrogen areas); the G channel (algae sensitive): divided into 4 levels according to "0-80-160-240-255", enhancing the continuity of medium and high grayscale levels (dense algae areas); the B channel (dissolved oxygen sensitive): divided into 5 levels according to "0-60-120-180-240-255", focusing on the distribution patterns of low grayscale levels (low oxygen areas); the infrared simulated band (temperature / organic matter sensitive): divided into 3 levels according to "0-100-200-255", highlighting the aggregation characteristics of high grayscale levels (high temperature / high organic matter areas).

[0076] Then, the spectral-spatial feature extraction branch slides the four-channel image data after single-channel dynamic grayscale layering based on a preset base window (e.g., a 5×5 window). If there is continuous texture larger than a first preset scale in the four-channel image data (e.g., large-area algal coverage), the preset base window is enlarged; if there is continuous texture smaller than a second preset scale in the four-channel image data (e.g., suspended particle distribution), the preset base window is reduced (e.g., reduced to a 3×3 window). The first preset scale is larger than the second preset scale.

[0077] The step size for each window can be set according to the size of each window. For example, it can be set to half the side length of the window (e.g., a step size of 2-3 pixels for a 5×5 window) to ensure overlapping areas between windows and avoid texture information breakage. For edge areas (e.g., image boundaries), the step size can be reduced to 1 pixel to preserve complete edge texture. The spectral-spatial feature extraction branch can also adjust the window orientation to rotate with the main texture direction (0° / 45° / 90° / 135°) for directional textures (e.g., pollutant diffusion texture driven by water flow), ensuring that GLCM can capture gray-level co-occurrence relationships in the "flow direction" (e.g., increasing the proportion of gray-level pairs along the 45° water flow direction by 20%).

[0078] Then, based on the number of gray levels in each channel, a gray-level co-occurrence matrix of the corresponding dimension is generated (such as a 4×4 (G channel), 5×5 (R / B channel), and 3×3 (infrared band) gray-level co-occurrence matrix).

[0079] Step a4: Convert each gray-level co-occurrence matrix into a feature vector, and then fuse the feature vectors to generate the target vector.

[0080] Specifically, water quality-related texture features are extracted from each gray-level co-occurrence matrix:

[0081] Contrast ratio: Reflects the difference in brightness between areas where suspended matter accumulates in water. The formula is:

[0082] ;

[0083] Wherein, (P(i,j) is the joint probability of gray levels i and j in GLCM, and the larger the value, the more uneven the distribution of suspended matter).

[0084] Correlation: Reflects the continuity of algal distribution; the formula is:

[0085] ;

[0086] Where μ is the mean gray level and σ is the standard deviation. The closer the value is to 1, the more continuous the algae distribution is in a certain direction, such as the blue-green algae belt in the river outside the dike.

[0087] Energy: The formula is: Significance: Reflects the complexity of the texture (the higher the entropy, the more chaotic the texture). Application: High entropy in channel B → low-oxygen zone intersects with normal water zone, resulting in complex pollution boundaries.

[0088] Entropy: Formula: .

[0089] The contrast, correlation, energy, and entropy of each gray-level co-occurrence matrix are concatenated to generate various feature vectors.

[0090] Then, based on the cross-channel texture consistency check results, dynamic weights are assigned to the features of each channel:

[0091] Case 1: Synergistic Effective Features: If the infrared channel displays "high grayscale aggregation (high temperature)" and the B channel displays "low grayscale aggregation (low oxygen)" (judged as "synergistic anaerobic texture"), then increase the feature weights of these two channels (e.g., weight × 1.5) to enhance their proportion in the fusion result.

[0092] Case 2: Potential anomalous features: If the R channel shows "low grayscale aggregation (high nitrogen)" but the G channel does not show "medium-high grayscale continuity (no algae)" (marked as "potential anomalous texture"), then reduce the feature weight of the R channel (e.g., weight × 0.5) to reduce its impact on the overall features.

[0093] Case 3: No obvious correlation: If there is no conflict or coordination among the features of each channel, then the default weight is used (e.g., the weights of each channel are equal).

[0094] The feature vectors of each channel are scaled according to their dynamic weights and then concatenated into a single overall target vector. For example: let the feature vector of channel R be [R_pair, R_phase, R_energy, R_entropy], with a weight of 0.5; the feature vector of channel G be [G_pair, G_phase, G_energy, G_entropy], with a weight of 1.0; the feature vector of channel B be [B_B_pair, B_energy, B_entropy], with a weight of 1.5; and the feature vector of infrared channel be [I_pair, I_phase, I_energy, I_entropy], with a weight of 1.5; the total feature vector after fusion is: [0.5×R_pair, 0.5×R_phase, ..., 1.0×G_pair, ..., 1.5×B_pair, ..., 1.5×I_entropy].

[0095] If the total dimensionality of the fused features is high (e.g., 4 channels × 4 features = 16 dimensions, which may be even higher after weight adjustment), further dimensionality reduction can be performed to reduce redundancy. PCA dimensionality reduction is applied to the fused high-dimensional feature vectors, retaining principal components with a cumulative contribution rate > 95%, resulting in the final low-dimensional spectral-spatial fusion features. The dimensionality-reduced features retain the core texture information of each channel while eliminating redundancy, facilitating subsequent classification or regression tasks (such as water quality parameter inversion).

[0096] Step a5: Calculate the horizontal and vertical gradients corresponding to the four-channel image data using the Sobel operator to obtain the gradient features.

[0097] Specifically, horizontal (Gx) and vertical (Gy) Sobel convolution kernels (3×3) are applied to the four-channel image data respectively: ; .

[0098] For each pixel (i,j) in the image, its horizontal gradient Gx(i,j) and vertical gradient Gy(i,j) are calculated as follows:

[0099] ;

[0100] .

[0101] When calculating the horizontal gradient of pixel (i,j), the Gx convolution kernel is covered on the 3×3 neighborhood centered at (i,j), and the elements are multiplied one by one and then summed.

[0102] Gradient magnitude: ;

[0103] Gradient direction (orientation): .

[0104] Step a6: Calculate the spatial distribution entropy corresponding to the four-channel image data.

[0105] Specifically, the electronic device performs grayscale normalization on the four-channel image data to ensure a uniform grayscale value range (0-255) for all four channels. Specifically: R channel (nitrogen pollution): lower grayscale value → higher nitrogen concentration; G channel (algae): higher grayscale value → higher algae density; B channel (dissolved oxygen): lower grayscale value → lower dissolved oxygen content; Infrared band (temperature / organic matter): higher grayscale value → higher temperature / organic matter concentration. The grayscale normalized image is then uniformly divided into N×N non-overlapping sub-regions (e.g., 10×10=100 grids), with each grid containing M×M pixels (M = image height / N). For each grid k, the probability distribution p of its internal grayscale values ​​is statistically analyzed. k : ;

[0106] Where, n i Let $k$ be the number of times grayscale value $i$ appears in grid $k$; $M$ is the total number of pixels in the grid. Example: If a grid has 100 pixels and a pixel with a grayscale value of $120$ appears 20 times, then the probability of having a grayscale value of $120$ in the grid is 20 / 100 = 0.2.

[0107] Then, based on the probability distribution p of the internal gray values k Calculate the spatial distribution entropy.

[0108] Global distribution entropy formula .

[0109] Physical meaning: The higher the entropy value, the more dispersed the gray distribution (uneven spatial distribution of pollutants); the lower the entropy value, the more concentrated the gray distribution (uniform distribution of pollutants).

[0110] The formula for spatial distribution entropy is: .

[0111] w k Grid weights are set based on the distance from pollution sources (such as farmland drainage outlets or village sewage outlets). For example, a weighting rule is: distance from source < 500 meters: w k =1.2 (enhancing the impact on the core pollution area); 500-1000 meters from the source: w k =1.0 (default weight); Distance from source > 1000 meters: w k =0.8 (reduce noise in remote areas).

[0112] Step a7: Fuse single-channel features, inter-channel interaction features, target vector, gradient features, and spatial distribution entropy to generate spatial features.

[0113] Specifically, the electronic device can unify the spatial dimensions of single-channel features, inter-channel interaction features, target vectors, gradient features, and spatial distribution entropy. Then, the electronic device can acquire the weights corresponding to the single-channel features, inter-channel interaction features, target vectors, gradient features, and spatial distribution entropy, and then, based on the acquired weights, fuse the single-channel features, inter-channel interaction features, target vectors, gradient features, and spatial distribution entropy to generate spatial features.

[0114] Step S2023: Input the target water quality image sequence into the spatiotemporal texture feature extraction branch in the preset water quality data determination model to extract the texture features corresponding to each target water quality image.

[0115] Specifically, step S2023 above may include the following steps:

[0116] Step b1: The spatiotemporal texture feature extraction branch slides on the target water quality image sequence based on a preset convolution kernel to generate feature response values ​​corresponding to each position, and generates the original feature map based on each feature response value.

[0117] The preset convolutional kernel includes both temporal and spatial dimensions.

[0118] Specifically, the spatiotemporal texture feature extraction branch can be based on sliding on the target water quality image sequence with a preset convolution kernel. The preset convolution kernel can be a 3×3×3 stereo convolution kernel.

[0119] Spatial dimension (3×3): Captures the texture relationships between adjacent pixels within a single frame (e.g., edges, patches); Temporal dimension (3 frames): Connects three adjacent frames to extract texture changes over time (e.g., movement, diffusion). Physical meaning: For scenarios involving the migration of suspended objects, this convolutional kernel can simultaneously detect: spatial particle boundaries (spatial dimension); and temporal particle movement trajectories (temporal dimension).

[0120] The convolutional kernel slides across a spatiotemporal cube (a stack of 3 images), generating a feature value at each location that represents the joint feature response of that spatiotemporal region. When a suspended object is detected moving from upstream to downstream, the spatial features of the intermediate frame (t) in the temporal dimension form a specific pattern (such as changes in grayscale gradients) with the previous frame (t-1) and the next frame (t+1), and the convolutional kernel outputs a high response value. For static backgrounds (such as shoreline vegetation), the feature changes in the temporal dimension are small, and the convolutional kernel outputs a low response value.

[0121] For example, three consecutive frames of images are stacked into a three-dimensional data block (height × width × time), which is used as input for 3D convolution. A preset stereo convolution kernel slides point by point on the three-dimensional data block. Each time it moves to a position, it performs convolution calculation on the currently covered 3×3×3 region and outputs a feature value. The magnitude of this value reflects the degree of matching between "spatial texture + temporal change" within the region: if there is a pattern of suspended objects moving from upstream (left side of frame t-1) to downstream (right side of frame t+1) within the region, the convolution kernel outputs a high response value (e.g., 0.8); if the region is static shoreline vegetation (no change within 3 frames), it outputs a low response value (e.g., 0.1).

[0122] Then, the original feature map is generated based on the generated feature response values.

[0123] Step b2: Perform global average pooling on the original feature map to compress it into a spatial weight map, and then normalize the spatial weight map to obtain a normalized feature map.

[0124] Specifically, the original feature map (with dimensions C×T×H×W, where C is the number of feature channels, T is the time step, and H and W are the image height and width) is compressed into a C×T vector (one mean for each channel and each time step) through global average pooling. Spatial attention is learned through a two-layer fully connected network: the first layer reduces the feature dimension to C / 8 to reduce computation; the second layer increases the dimension back to C channels and outputs a spatial weight map (with dimensions equal to the input features) in the [0,1] interval via a sigmoid function. Figure 1 The dimensions of the original feature map are C×T×H×W (C is the number of feature channels, T is the time step, and H and W are the spatial height and width).

[0125] Each spatial location (H×W) is assigned a weight, and the weight must correspond one-to-one with the feature channel (C) (the spatial importance of different channels may be different). Therefore, the generated spatial weight map has a dimension of C×H×W.

[0126] Then, the spatial weight map is normalized to obtain a normalized feature map. Among them, the weight of water areas (such as the central flow area and algal patches) approaches 1, and the weight of non-water areas (such as shore vegetation and shadows) approaches 0.

[0127] Step b3: Multiply the original feature map with the normalized feature map to obtain the target feature map.

[0128] Specifically, electronic devices can multiply the original feature map and the normalized feature map pixel by pixel to obtain the target feature map. For example, the feature value of the water body region = original feature map × normalized feature map (e.g., 0.5 × 0.9 = 0.45), preserving and enhancing effective information; the feature value of the non-water body region = original value × low weight (e.g., 0.6 × 0.1 = 0.06), significantly reducing interference.

[0129] Step b4: Perform global average pooling on each channel of the target feature map to obtain a preset feature vector.

[0130] Specifically, the electronic device can perform global average pooling on each channel (C channels) of the target feature map, compressing the H×W spatial dimension into one value (the spatial mean of that channel), and obtaining a C-dimensional vector (each element corresponds to the spatial feature intensity of a channel).

[0131] Then, the target feature maps of the continuous time series (such as frames t-1, t, and t+1) are compressed into C-dimensional vectors to form a "time step-feature vector" sequence (such as t-1→C-dimensional vector, t→C-dimensional vector, and t+1→C-dimensional vector), thereby obtaining the preset feature vector.

[0132] Step b5: Input the preset feature vector corresponding to each time step into the bidirectional LSTM to extract the time-dependent feature vector.

[0133] Specifically, the feature vectors (output of step b4) of each time step t are arranged in chronological order to form a sequence [v_t1, v_t2, ..., v_tN], and the resulting sequence is input into a bidirectional LSTM.

[0134] Forward LSTM output: From the first time step (t=0) to the last time step (t=n), capture "how historical features affect the current frame" (e.g., the algae texture in the previous two frames slowly expands, causing continuous patches to form in the current frame).

[0135] Inverse LSTM output: From the last time step (t=n) to the first time step (t=0), capture "how future features infer the current frame state" (e.g., abnormal green light texture in the current frame indicates that a blue-green algae bloom will occur in the next 2 frames).

[0136] Fusion output: The forward and reverse outputs are concatenated at each time step to form a 2C-dimensional temporally dependent feature vector (one vector for each time step). The temporally dependent feature vector contains both the spatial features of the current frame and the temporal relationship with the previous and next frames.

[0137] Step b6: Perform a convolution operation on the target feature map to obtain the convolutional feature vector.

[0138] Specifically, the electronic device compresses the target feature map (which has been freed from non-aquatic interference) into a C-dimensional convolutional feature vector through 1×1 convolution (preserving the spatial texture details of the current frame, such as the shape and density of pollution patches).

[0139] Step b7: Concatenate the temporally dependent feature vector with the convolutional feature vector to obtain the texture features.

[0140] Specifically, the 2C temporal dependency feature vector output by the bidirectional LSTM is concatenated with the C-dimensional convolutional feature vector to form a 3C-dimensional spatiotemporal fusion feature vector. This spatiotemporal fusion feature vector simultaneously contains: the spatial texture of the current frame (such as the distribution of nitrogen pollution in the red band); the dependency on the previous frame (such as how nitrogen pollution in the previous frame spreads to the current frame); and the association with subsequent frames (such as the texture of the current frame predicting future pollution trends).

[0141] Then, a fully connected network is used to assign weights to the temporal-dependent feature vectors and convolutional feature vectors in the spatiotemporal fusion feature vector, strengthening features strongly correlated with water quality parameters (such as the temporal variation of red light texture corresponding to total nitrogen and the spatial continuity of green light texture corresponding to chlorophyll a), and suppressing secondary features (such as weak water surface reflection). For example, the feature "temporal variation rate of red light texture > 0.3" is assigned a weight of 0.8, and "irrelevant blue light fluctuations" are assigned a weight of 0.1.

[0142] Global average pooling or principal component analysis (PCA) is used to compress the selected features to the target dimension (e.g., 64-dimensional), while standardization is performed (ensuring feature values ​​are distributed in the [0,1] interval) to ensure comparability of features from different time steps and images. The processed feature vectors are then assigned to the corresponding time step (i.e., a single-frame target water quality image), forming the image's "final texture features." Their physical meaning includes: spatial texture attributes such as the size of pollution patches and edge complexity (derived from spatial features); temporal dynamic attributes such as the pollution diffusion rate and texture differences with preceding and following frames (derived from the temporal dependence of bidirectional LSTM); and semantic association attributes such as "matching degree with high-nitrogen pollution templates" and "risk level of algal blooms."

[0143] Step S2024: The spatial features and texture features are fused to generate the target features.

[0144] Specifically, step S2024 above may include the following steps:

[0145] Step c1: Perform numerical analysis on the spatial features and extract the original spatial values ​​at each location.

[0146] Specifically, electronic devices can perform numerical analysis on spatial characteristics (such as the spatial distribution of nitrogen concentration at water quality monitoring points, the spatial range of eutrophication areas in water bodies, etc.) and extract the original spatial values ​​of each location (for example, the nitrogen concentration at one location is 8 mg / L, and at another location it is 2 mg / L).

[0147] Step c2: Based on the distribution pattern of the original spatial values, divide the high-value core area and non-core area to obtain the spatial intensity matrix.

[0148] Specifically, electronic devices can divide the original spatial values ​​into "high-value core areas" and "non-core areas" based on the distribution patterns (e.g., through statistical thresholding or clustering algorithms). The high-value core area can be the region where the spatial values ​​are in the top 20% (or above a preset threshold), and its spatial intensity is assigned a value of 1.0 (representing the highest significance). The non-core area can be the region where the spatial values ​​are below the threshold, and its spatial intensity is assigned a value of 0.5 (representing lower significance). The final result is a spatial intensity matrix, where each element corresponds to a spatial intensity value (containing only 1.0 or 0.5) at a specific location within the spatial features.

[0149] Step c3: Perform texture saliency analysis on the texture features, divide the dominant texture coverage area into non-dominant texture coverage areas, and obtain the texture response matrix.

[0150] Specifically, electronic devices can perform texture saliency analysis on texture features (such as algae distribution texture in water quality images, stripe texture of pollutant diffusion, etc.) and identify dominant textures (such as 45° algae stripe texture related to nitrogen concentration in agricultural pollution) through indicators such as texture energy and contrast.

[0151] Then, the electronic device quantifies the texture sharpness at each location in the texture feature. The dominant texture coverage area is characterized by sharp texture that aligns with the dominant texture's direction / shape, and its texture response is assigned a value of 1.0 (representing the strongest response). Non-dominant texture coverage areas are characterized by blurry texture or belong to irrelevant textures (such as random noise textures), and their texture response is assigned a value of 0.5 (representing a weaker response). The final result is a texture response matrix, where each element corresponds to a texture response value (containing only 1.0 or 0.5) at a specific location within the texture feature.

[0152] Step c4: Calculate the angle between the high-value core region and the dominant texture coverage region.

[0153] Specifically, the electronic device can determine the spatial distribution direction of high-value core areas in spatial features (e.g., high nitrogen concentration areas are distributed at 45° along farmland drainage ditches) and the direction of dominant textures (e.g., algal textures diffuse at 45°). For each location, the angle between the direction of the high-value core area and the coverage area of ​​the dominant texture in the texture feature is calculated.

[0154] Step c5: Generate a direction consistency matrix based on the included angles corresponding to each position.

[0155] Specifically, the electronic device generates an orientation consistency matrix based on the included angles at each position. For example: angle ≤ 15° (highly consistent): orientation consistency is assigned a value of 1.0 (representing a complete orientation match); 15° < angle ≤ 45° (partially consistent): orientation consistency is assigned a value of 0.7 (representing a basic orientation match); angle > 45° (deviation from the dominant orientation): orientation consistency is assigned a value of 0.3 (representing an orientation mismatch).

[0156] The final result is a direction consistency matrix, in which each element corresponds to the degree of direction matching at a certain position (including 1.0, 0.7, and 0.3).

[0157] Step c6: Generate a coupling kernel matrix based on the spatial intensity matrix, texture response matrix, and orientation consistency matrix.

[0158] Specifically, the element values ​​of the coupling kernel matrix are calculated by multiplying the spatial intensity matrix, texture response matrix, and directional consistency. Through the synergistic effect of the three, the weight of key regions is amplified.

[0159] The final numerical range is determined based on the calculation results (adjusted according to the actual needs of the scenario). For example,

[0160] High-value core area + dominant texture coverage + consistent orientation (e.g., 1.0×1.0×1.0=1.0): To highlight key areas, dynamically increase this value to 1.5 (maximum value); Non-core area + non-dominant texture + orientation deviation (e.g., 0.5×0.5×0.3=0.075): Compress to 0.5 (minimum value); Other intermediate cases (e.g., core area but partially consistent orientation: 1.0×1.0×0.7=0.7): Maintain intermediate values ​​(e.g., 0.7-1.2).

[0161] Finally, a coupling kernel matrix is ​​generated, in which each element corresponds to the weight of the spatial-texture feature overlap region. The high-risk associated region (core region + dominant texture + same direction) has the highest weight, and the non-associated region has the lowest weight.

[0162] Step c7: Based on the coupling kernel matrix, spatial features and texture features are fused to generate target features.

[0163] Specifically, electronic devices can calculate the original interaction value between spatial features and texture features, capturing the fundamental correlation between the two: Original interaction value = Spatial feature pixel value × Texture feature pixel value

[0164] Example: High-value core region pixel (spatial value = 0.9) along 45° strong texture (texture value = 0.8) → original interaction value = 0.9 × 0.8 = 0.72. This value only reflects the "overlay of space and texture", but does not distinguish whether it is along the dominant direction (if the texture direction is messy, this value has no practical meaning).

[0165] Then, the electronic device uses a coupling kernel matrix to weight the original interaction value, amplifying the features of the highly collaborative region: target feature pixel value = original interaction value × coupling kernel pixel value.

[0166] Example 1 (highly collaborative region): Original interaction value = 0.72 × Coupling kernel value 1.5 → Interaction feature value = 1.08 (50% improvement compared to the original value); Example 2 (non-collaborative region): Original interaction value = 0.4 (spatial value 0.8 × texture value 0.5) × Coupling kernel value 0.6 → Interaction feature value = 0.24 (suppressed).

[0167] Step S2025: Output target water quality data based on target features.

[0168] Specifically, the electronic device outputs target water quality data based on the target characteristics.

[0169] Step S203: Input the target water quality image and target water quality data into the preset nitrous oxide emission determination model, and output the nitrous oxide emission corresponding to the target water quality.

[0170] Please refer to the above description of step S103 for details on this step, which will not be repeated here.

[0171] Step S204: Based on the target water quality data and nitrous oxide emissions, determine the preset treatment measures corresponding to the target water quality.

[0172] Please refer to the above description of step S104 for details on this step, which will not be repeated here.

[0173] The intelligent water quality treatment method provided in this application embodiment identifies target water quality images using a preset water quality data determination model, determines the corresponding RGB values ​​and infrared simulated bands of the target water quality images, and constructs four-channel image data. The RGB channel can only reflect the visible light reflection of water, while the infrared simulated band is more sensitive to chemical substances in the water, and the RGB channel struggles to capture this correlation. By fusing RGB values ​​and infrared simulated bands, the preset water quality data determination model can simultaneously utilize "visual phenotype" and "spectral fingerprint," providing richer basic information for subsequent water quality data prediction. Single-channel spectral feature analysis is performed on each channel of the four-channel image data to obtain the corresponding single-channel features. Each channel (R, G, B, NIR) has different sensitivities to water quality parameters. Through single-channel analysis, the model can individually capture the "exclusive features" of each band, providing a "differentiated basis" for subsequent fusion and avoiding feature overload caused by multi-channel mixing. Based on the synergistic effect of water quality parameters, inter-channel interactive features are constructed. Interactive features transform isolated single-channel information into "relational features," which better reflect the physicochemical properties of water quality parameters. A sliding window method is used to construct gray-level co-occurrence matrices (GLCMs) for each dimension by sliding across the four-channel image data. These GLCMs quantify the texture uniformity and continuity of local water bodies by statistically analyzing the spatial co-occurrence relationships of pixel gray values ​​within the sliding window. The sliding window setting can adapt to water quality phenomena at different scales, providing "structured data of local texture" for subsequent calculations of contrast and correlation. Each GLCM is converted into a feature vector, and these feature vectors are then fused to generate a target vector. Contrast reflects the degree of difference in gray values ​​within the window. Correlation reflects the spatial consistency of pixel gray values. The combination of these two metrics can distinguish between "natural texture" and "polluted texture," providing a texture-level basis for judging water quality data (such as pollution type and diffusion range). The horizontal and vertical gradients corresponding to the four-channel image data are calculated using the Sobel operator to obtain gradient features, which can capture the boundaries of different regions in the water body. The spatial distribution entropy corresponding to the four-channel image data is calculated. Spatial distribution entropy measures the spatial dispersion of pixel gray values: high entropy values ​​indicate chaotic water quality distribution; low entropy values ​​indicate uniform water quality. By fusing single-channel features, inter-channel interaction features, target vectors, gradient features, and spatial distribution entropy, spatial features are generated. Multi-dimensional spatial semantics are constructed to achieve a comprehensive representation of water quality information: the fused spatial features integrate multi-scale feature fusion, accurately corresponding to the multi-dimensional attributes of water quality and significantly reducing the risk of misjudgment caused by single features.

[0174] The target water quality image sequence is input into the spatiotemporal texture feature extraction branch of the preset water quality data determination model. This branch slides across the target water quality image sequence based on a preset convolutional kernel, generating feature response values ​​for each location, and then generating the original feature map based on these response values. The preset convolutional kernel contains both temporal and spatial dimensions. As it slides across the target water quality image sequence, it can extract the spatial texture of a single image while capturing temporal changes in adjacent images, achieving synchronous fusion of spatiotemporal information and avoiding information fragmentation caused by the separation of spatiotemporal features in traditional methods. By using a customized convolutional kernel, key texture patterns related to water quality parameters in the water quality image can be specifically addressed, improving the effectiveness of the original features. Global average pooling is applied to the original feature map, compressing it into a spatial weight map, which is then normalized to obtain a normalized feature map. Global average pooling compresses the original feature map into a spatial weight map, filtering out noise and interference from secondary regions while retaining information from regions that contribute significantly to water quality features. Normalization maps the weight map to the [0,1] interval, eliminating scale differences between different image sequences and ensuring feature consistency across water quality images under different times and lighting conditions, thus enhancing the model's generalization ability. The target feature map is obtained by multiplying the original feature map with the normalized feature map. The operation of "original features × normalized weights" is equivalent to adaptively enhancing key regions and suppressing secondary regions in the original feature map, significantly improving the signal-to-noise ratio of effective features and reducing interference from irrelevant information in subsequent analysis. The weight map dynamically changes with the image sequence, automatically adjusting the region of interest based on the texture features of water quality at different times, making the feature map more closely reflect the actual water quality state. Global average pooling is performed on each channel of the target feature map to obtain a preset feature vector. Global average pooling compresses the two-dimensional feature map of each channel into a one-dimensional vector, significantly reducing data dimensionality while retaining the core texture features represented by that channel, reducing computational load for subsequent time-series analysis. Pooling smooths local noise, making the feature vector more robust to minor perturbations in the image and improving the reliability of time-dependent feature vectors. The preset feature vector corresponding to each time step is input into a bidirectional LSTM to extract temporally dependent feature vectors, avoiding the inverse temporal correlations that might be missed by a unidirectional LSTM. A convolution operation is performed on the target feature map to obtain convolutional feature vectors. Further spatial local texture is extracted from the target feature map through convolution, supplementing local details that may be lost during global pooling, making the spatial features more comprehensive. The temporally dependent feature vectors are concatenated with the convolutional feature vectors to obtain texture features. Concatenating the temporally dependent feature vectors with the convolutional feature vectors forms a complete spatiotemporal texture feature containing "when + where + what texture," providing multi-dimensional basis for water quality data prediction. Spatial features are converted into quantifiable values, providing computable basic data for subsequent analysis and avoiding the ambiguity of spatial features.By dividing the area into high-value core zones and non-core zones, the key areas with the greatest impact on water quality are highlighted, background interference is filtered out, and features are focused on core analytical objects such as pollution sources. Texture saliency analysis is performed on texture features, dividing the area covered by dominant textures into non-dominant texture coverage areas, resulting in a texture response matrix. The angle between the high-value core zone and the dominant texture is calculated to quantify the matching degree between the spatial core zone and the texture direction, providing a basis for judging whether "pollution spreads along the expected direction." The angle is converted into a weight that can be used for calculation, providing a quantitative basis for "whether space and texture are coordinated" for subsequent fusion, avoiding subjective judgment bias. Spatial intensity, texture response, and directional consistency are integrated to generate dynamic weights. Through coupling kernel weighting, the features of key areas such as "high pollution + diffusion along the dominant direction" are amplified, irrelevant areas are suppressed, and finally, comprehensive features with both spatial distribution and texture dynamics are generated, providing more accurate input for nitrous oxide emission prediction. The target features integrate multidimensional information including spectral, spatial, temporal, and textural data, enabling precise mapping of the physicochemical properties of water quality. Pre-defined water quality data models can convert visual information into quantified chlorophyll a concentrations, addressing the low accuracy of traditional visual estimation and the neglect of spatial distribution by single-spectral analysis. The richness of the target features supports simultaneous prediction of multiple water quality data points without the need for separate modeling for each parameter.

[0175] This embodiment provides an intelligent water treatment method that can be used in the aforementioned electronic device. Figure 3 This is a flowchart of an intelligent water treatment method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:

[0176] Step S301: Obtain the target water quality image corresponding to the target sampling point in the target water quality.

[0177] Please refer to the above description of step S201 for details on this step, which will not be repeated here.

[0178] Step S302: Input the target water quality image into the preset water quality data determination model and output the target water quality data corresponding to the target water quality.

[0179] Please refer to the above description of step S202 for details on this step, which will not be repeated here.

[0180] Step S303: Input the target water quality image and target water quality data into the preset nitrous oxide emission determination model, and output the nitrous oxide emission corresponding to the target water quality.

[0181] Specifically, step S303 above may include the following steps:

[0182] Step S3031: Input the target water quality image into the visual feature encoding branch of the preset nitrous oxide emission determination model, and output the image-gas correlation features.

[0183] Specifically, step S3031 above may include the following steps:

[0184] Step d1 involves identifying the target water quality image, determining the corresponding RGB values ​​and infrared analog bands, and constructing four-channel image data.

[0185] Please refer to the above description of step S2021 for details on this step, which will not be repeated here.

[0186] Step d2 involves identifying the target water quality data and determining the type of pollution.

[0187] Specifically, electronic devices can identify target water quality data and extract key indicators from the target water quality data (such as TN, Chl-a, DO, temperature, etc.). Then, each key indicator is compared with its corresponding threshold. Based on the comparison results, the pollution type determination conditions met by each key indicator are determined. When at least a preset number of key indicators meet the same pollution type determination conditions, the target water quality data is determined to be of that pollution type.

[0188] The criteria for determining the type of pollution are as follows: Agricultural non-point source pollution: TN > 5 mg / L (nitrogen exceeding the standard), Chl-a > 20 μg / L (algal enrichment), DO < 5 mg / L (mild anaerobic), and no significant abnormality in infrared temperature (< 30℃); Industrial point source pollution: TN > 8 mg / L (high nitrogen), infrared temperature > 35℃ (high temperature wastewater), DO < 3 mg / L (strong anaerobic), and Chl-a < 10 μg / L (no algae, growth is inhibited by industrial wastewater); Domestic sewage pollution: TN 3-5 mg / L (medium nitrogen), DO 3-5 mg / L (moderate anaerobic), Chl-a 10-20 μg / L (moderate algae), and pollutant distribution entropy > 3.0 (dispersed discharge).

[0189] Step d3: Determine the weight of each channel in the four-channel image data according to the type of contamination, and generate a weighted channel image.

[0190] Specifically, different pollution types have different dominant influence channels, and the weights of the four channels (R, G, B, and infrared) need to be dynamically adjusted to enhance the feature contribution of key channels. Therefore, electronic devices can determine the weights of each channel in the four-channel image data according to the pollution type and generate weighted channel images.

[0191] For example, agricultural non-point source pollution: dominant pathways: R (nitrogen pollution), G (algae), B (dissolved oxygen); weight allocation: R=0.35, G=0.3, B=0.25, infrared=0.1 (weakening the effect of temperature).

[0192] Industrial point source pollution: Dominant pathways: R (high nitrogen), infrared (high temperature), B (strong anaerobic); Weighting: R=0.3, infrared=0.35, B=0.25, G=0.1 (weakened algal influence).

[0193] Domestic sewage pollution: Dominant pathways: R (medium nitrogen), G (medium algae); Weight allocation: R=0.3, G=0.3, B=0.2, infrared=0.2 (balanced consideration).

[0194] The four-channel image data is multiplied pixel by pixel with the corresponding weight (e.g., R channel pixel value × 0.35 in agricultural pollution) to generate a weighted channel image.

[0195] Step d4: Based on the type of contamination, determine the preset size convolution kernel to perform convolution operation on the weighted channel image to generate preliminary spatial features.

[0196] Specifically, electronic devices can select convolution kernels of corresponding sizes to slide on the weighted channel image based on the spatial scale characteristics of the pollution type, extract spatial features, and generate preliminary spatial features (the feature response value at each location reflects the degree of matching between the region and the pollution type).

[0197] For example, agricultural non-point source pollution (widespread diffusion, such as non-area pollution formed by farmland runoff): convolution kernel size: 7×7 (capturing macroscopic distribution, such as a 1km×1km pollution band); function: extracting "uniform diffusion texture of nitrogen pollution" and "patchy algal cover characteristics". Industrial point source pollution (small-scale aggregation, such as feather pollution from sewage outlets): convolution kernel size: 3×3 (capturing microscopic details, such as a 50m×50m high-concentration core area); function: extracting "high-temperature zone boundaries" and "gradient abrupt changes between strong anaerobic zones and their surroundings". Domestic sewage pollution (medium-scale dispersion, such as dispersed discharges around villages): convolution kernel size: 5×5 (balancing macroscopic and microscopic aspects); function: extracting "patchy characteristics of dispersed pollutant distribution".

[0198] Step d5 involves performing a convolution operation on the four-channel image data using depthwise separable convolution to extract spectral features.

[0199] Specifically, electronic devices can break down standard convolutions into "depth convolutions" (processing each channel individually) and "point convolutions" (merging channel features), reducing computation while preserving spectral details.

[0200] Features are extracted from the four RGB+NIR channels using depthwise convolution (e.g., detecting nitrogen absorption in the red channel and chlorophyll reflectance in the green channel). Then, multi-channel features are fused using point convolution to generate multispectral comprehensive features (e.g., the combination of "strong red absorption + weak NIR reflectance" corresponds to high nitrogen pollution).

[0201] Identify the comprehensive characteristics of the multispectral spectrum and extract key spectral features. For example, the position of the absorption peak in the red light band (620-750nm): a red shift of the absorption peak (longer wavelength) corresponds to an increase in total nitrogen concentration; the fluctuation range of reflectance in the green light band (495-570nm): a fluctuation >15% indicates active algal growth (metabolic processes affect nitrous oxide emissions).

[0202] Step d6 involves performing a convolution operation on the four-channel image data using directional selective convolution to extract texture features.

[0203] Specifically, electronic devices can determine the core texture direction of each channel based on the specific correlation between the texture directionality of four-channel images (R, G, B, and infrared) and the pollution diffusion mechanism. For example, the R channel (nitrogen pollution): the texture direction is consistent with the nitrogen diffusion path (agricultural pollution along the water flow direction, industrial pollution perpendicular to the discharge outlet direction); the G channel (algae): the texture direction is consistent with the algae migration direction (diffused with water flow or wind); the B channel (dissolved oxygen): the texture direction is consistent with the diffusion direction in low-oxygen areas (vertical to the discharge outlet in industrial pollution, along the water flow in agricultural pollution); and the infrared channel (temperature / organic matter): the texture direction is consistent with the diffusion direction of high temperature / high organic matter (directional extension downstream of industrial discharge outlets).

[0204] Preset dominant directions for pollution types: Agricultural non-point source pollution: The dominant direction is the direction of water flow (e.g., 45°), because pollutants spread along the water flow with surface runoff; Industrial point source pollution: The dominant direction is the direction perpendicular to the sewage outlet (e.g., 90°), because wastewater discharge forms a feather-shaped pollution band perpendicular to the sewage outlet.

[0205] Electronic devices determine directional convolution kernels of varying sizes based on the spatial scale of pollution diffusion (agricultural pollution has a large range, while industrial pollution has a small range), covering four basic directions: 0°, 45°, 90°, and 135°. For example, for agricultural non-point source pollution: a 5×5 convolution kernel is used to match the texture of large-scale diffusion (e.g., a 1km-wide pollution band) to ensure the capture of macroscopic directional features; for industrial point source pollution: a 3×3 convolution kernel is used to focus on the fine texture of small-scale diffusion (e.g., a 100m-wide feather-like pollution) to avoid interference from surrounding clean water areas.

[0206] The weights of the convolutional kernels in each direction increase along the target direction (with the highest weight at the center), resulting in a high response for continuous textures along that direction and a low response for messy textures. For example, at 0° (horizontal): the center row of the convolutional kernel has the highest weight (e.g., [0,0,1,2,1]), strengthening continuous textures horizontally; at 45° (diagonal): the main diagonal of the convolutional kernel has the highest weight (e.g., [1,0,0;0,2,0;0,0,1]), strengthening continuous textures along the 45° direction; the structures for 90° (vertical) and 135° (diagonal) are similar, strengthening continuous textures in the vertical and 135° directions, respectively.

[0207] The electronic device applies convolution kernels in four directions to the four-channel images to generate directional response maps for each channel. Applying convolution kernels in four directions to the R channel yields texture response maps for the R channel at 0°, 45°, 90°, and 135° (the higher the response value, the more obvious the nitrogen pollution diffusion texture in that direction). Similarly, convolution is performed on the G, B, and infrared channels to generate their respective four-directional response maps (e.g., the high value area of ​​the 45° response map for the G channel corresponds to the continuous distribution of algae along the water flow).

[0208] Among them, the high response value of the R channel at 45° indicates that nitrogen pollution spreads significantly along the 45° direction (water flow); the high response value of the infrared channel at 90° indicates that the high temperature zone extends significantly along the 90° direction (vertical to the sewage outlet); these response values ​​directly reflect the directional diffusion intensity of the water quality parameters corresponding to the channel.

[0209] Based on the dominant direction of pollution type (e.g., 45° for agriculture, 90° for industry), retain high-response areas in each channel and suppress low-response areas in non-dominant directions.

[0210] Screening for agricultural non-point source pollution: For the four-channel response maps in four directions, only the regions with a response value greater than the threshold T1 (e.g., T1 = 0.6 × the maximum response value of the channel) in the 45° direction are retained, and the low response regions in other directions are set to 0; for example, in the 45° response map of channel G, the continuous high response band of the algae-dense area (medium to high gray level) is retained. These areas are the algae core zone that diffuses along the water flow and are positively correlated with nitrous oxide emissions.

[0211] Screening for industrial point source pollution: For the four-channel response maps in four directions, only retain the regions where the response value in the 90° direction is greater than the threshold T2 (e.g., T2 = 0.7 × the maximum response value of the channel), and set the other directions to 0. For example, in the 90° response map of the infrared channel, retain the high-response extension band of the vertical discharge outlet in the high-temperature zone (high grayscale). These regions are the core pathways for the diffusion of industrial wastewater, and the anaerobic high-temperature environment promotes emissions.

[0212] The dominant directional responses of each channel after screening are fused to generate a comprehensive texture feature map, enhancing the synergistic directionality across channels. Weights are assigned to each channel based on its sensitivity to pollution type: Agricultural pollution: R channel (nitrogen) weight 0.3, G channel (algae) weight 0.3, B channel (dissolved oxygen) weight 0.2, infrared channel weight 0.2; Industrial pollution: R channel weight 0.25, B channel (hypoxia) weight 0.25, infrared channel (high temperature) weight 0.3, G channel weight 0.2. The dominant directional response maps of each channel are then pixel-by-pixel summed according to their weights to generate the final texture feature map.

[0213] Step d7 involves fusing the preliminary spatial features, spectral features, and texture features to generate spectral texture features.

[0214] Specifically, electronic devices can assign differentiated weights to the three types of characteristics based on the core features of the pollution type, thereby strengthening the dimension that has the greatest impact on nitrous oxide emissions.

[0215] For example, for agricultural non-point source pollution, the initial spatial feature weight is 0.2; the spectral feature weight is 0.5; and the texture feature weight is 0.3; for industrial point source pollution, the initial spatial feature weight is 0.4; the spectral feature weight is 0.4; and the texture feature weight is 0.2; and for domestic sewage pollution, the initial spatial feature weight is 0.3; the spectral feature weight is 0.3; and the texture feature weight is 0.4.

[0216] Step d8 maps the spectral texture features to a preset nitrous oxide emission template in a predefined nitrous oxide emission pattern library.

[0217] Specifically, the preset nitrous oxide emission model library contains typical emission templates for different pollution types (trained based on historical data): Template composition: Each template is a mapping relationship of "spectral texture features - emission flux" (e.g., in the agricultural pollution template, "R low gray level + G medium high gray level + 45° texture" corresponds to an emission flux of 50-80 μg / (m²•h)).

[0218] Then, the electronic device performs spatial size alignment (e.g., unifying to 256×256 pixels) and channel dimension matching (ensuring that both contain the co-located features of R, G, B, and infrared) between the current spectral texture features (such as a 128-channel feature map) and the spectral texture feature anchor points of the preset nitrous oxide emission template.

[0219] Cosine similarity is used to quantify the matching degree: (F represents the current spectral texture feature, T represents the template anchor point feature, and the similarity range is 0-1, with higher values ​​indicating better matching.) Templates with a similarity greater than the first preset similarity threshold are retained (if multiple templates meet this threshold, the one with the highest similarity is selected). If the similarity is less than the second preset similarity threshold, it is determined to be a new contamination pattern, triggering the template library update mechanism (new templates will be subsequently included). The first preset similarity threshold is greater than the second preset similarity threshold.

[0220] Step d9: Based on spectral texture features and a preset nitrous oxide emission template, output image-gas correlation features.

[0221] Specifically, based on the optimal matching template and combined with the specificity of the current spectral texture features, preliminary association features are generated: basic association terms: directly referencing the emission pattern parameters of the matching template (such as the flux range of 50-80 μg / (m²•h) for high emission templates) as the benchmark value of the association features; simultaneously extracting the spatial distribution morphology (such as the high emission area extending along the 45° direction) and temporal patterns (such as the emission peak period) in the template.

[0222] Calculate the difference between the current spectral texture features and the template anchor point features (e.g., the high grayscale intensity in the current G channel is 20% higher than the template); adjust the emission mode parameters according to the difference ratio: if the current feature intensity is higher than the template, the upper limit of emission flux is increased (e.g., from 80 μg / (m²•h) to 90 μg / (m²•h)), and vice versa. Example: In agricultural pollution, if the current "G channel texture intensity" is 15% higher than the matching template, it indicates higher algae density, and the N₂O emission flux range is adjusted to 55-85 μg / (m²•h), ultimately outputting the image-gas correlation features.

[0223] Step S3032: Input the target water quality data into the parameter feature encoding branch of the preset nitrous oxide emission determination model, and output the parameter-gas correlation feature.

[0224] Specifically, step S3032 above may include the following steps:

[0225] Step e1: The parameter feature encoding branch identifies the target water quality data. Based on the nonlinear relationship between various data in the target water quality data and nitrous oxide emissions, it divides the dynamic range and assigns values ​​to obtain the basic features corresponding to each data and extracts the rate of change features corresponding to each data.

[0226] Specifically, the parameter feature encoding branch identifies the target water quality data and determines the nonlinear relationship between various water quality data and nitrous oxide emissions (e.g., nitrous oxide emission rates decrease when ammonia nitrogen concentration is too high or too low, and the emission rate is highest at moderate concentrations). Then, based on the nonlinear relationship between various data points and nitrous oxide emissions, a dynamic range (not a fixed threshold, but adjustable based on actual environment or historical data) is defined for each data point. Water quality data falling into different ranges are assigned values ​​to generate "basic features": for example, ammonia nitrogen concentration is divided into three dynamic ranges: "low-medium-high," corresponding to basic feature values ​​of "0.2-0.5-0.8" (the numerical value reflects the contribution intensity of that range to nitrous oxide emissions).

[0227] For each water quality data point, calculate its rate of change (e.g., concentration growth rate, decline rate) over time (e.g., continuous monitoring time series) or space (e.g., gradient change along the water flow direction), to obtain the corresponding rate of change characteristics for each data point. The rate of change characteristics reflect the dynamic trend of water quality indicators (e.g., a rapid increase in ammonia nitrogen concentration may indicate a surge in nitrous oxide emissions), and are an important supplement to measuring emission potential (static basic characteristics cannot reflect trends).

[0228] Step e2: Based on the correlation between the data, establish the coupling characteristics between the data.

[0229] Specifically, electronic devices can determine the correlation patterns between various water quality data based on domain knowledge or statistical analysis. For example, nitrate concentration is negatively correlated with dissolved oxygen (nitrate is more easily converted into nitrous oxide in anoxic environments); another example is that increased water temperature may simultaneously accelerate nitrogen conversion rate and microbial activity, forming a synergistic effect with nitrogen concentration.

[0230] Then, based on the correlation patterns between various water quality data, the features of multiple data points are combined through mathematical operations (such as product, weighted summation, difference, etc.) to generate coupled features. Example 1: If ammonia nitrogen concentration (A) and water temperature (T) synergistically promote discharge, the coupled feature can be represented as "A×T" (the larger the value, the stronger the synergistic effect); Example 2: If dissolved oxygen (DO) and nitrate (N) have an inhibitory relationship, the coupled feature can be represented as "N÷(DO+1)" (the lower the dissolved oxygen, the larger this value, reflecting a weakened inhibition).

[0231] Step e3 involves nonlinear activation of each basic feature and dynamic gating of the rate of change and coupling features to obtain the parameter-gas correlation features.

[0232] Specifically, since the relationship between water quality data and nitrous oxide emissions is mostly nonlinear (e.g., the emission rate increases slowly with concentration at low concentrations and increases sharply at high concentrations), the basic features obtained in step e1 are nonlinearly activated (e.g., using the ideas of Sigmoid, ReLU, etc., without the need for code implementation), thereby amplifying the interval features that have a significant impact on emissions (e.g., the basic features of medium nitrogen concentrations are more prominent after activation), and suppressing features of irrelevant or minor intervals, so that the basic features are more in line with the actual emission patterns.

[0233] Because the importance of rate of change and coupling features may differ under different environments (e.g., the impact of rate of change is small in stable water bodies, while it is large in flowing water bodies), the gating mechanism assigns dynamic weights to rate of change and coupling features based on the overall state of the current water quality data (e.g., whether it is in a period of active discharge). These weights can be automatically adjusted according to the data distribution. For example, if the water quality indicators in a certain area are stable (small rate of change), the weight of the rate of change feature is reduced, while the weight of the coupling feature is increased. Conversely, if the water quality indicators change abruptly (large rate of change) during a certain period, the weight of the rate of change feature is increased to capture short-term discharge fluctuations.

[0234] By integrating the basic features activated by nonlinearity, the rate of change features controlled by dynamic gating, and the coupling features, the final "parameter-gas correlation feature" is formed. This feature integrates the static contribution of a single indicator, the dynamic trend of change, and the synergistic effect of multiple indicators, directly reflecting the correlation strength and pattern between water quality data and nitrous oxide emissions, and providing parameter dimension support for subsequent image-gas correlation feature fusion.

[0235] Step S3033: Perform weighted fusion of image-gas correlation features and parameter-gas correlation features to generate cross-modal features.

[0236] Specifically, step S3033 above may include the following steps:

[0237] Step f1 involves evaluating the reliability of the image-gas correlation features and the parameter-gas correlation features, and obtaining the evaluation scores corresponding to the image-gas correlation features and the parameter-gas correlation features, respectively.

[0238] Specifically, electronic devices can quantitatively evaluate the reliability of image-gas correlation features and parameter-gas correlation features, determine their explanatory power for nitrous oxide emissions, and obtain evaluation scores corresponding to image-gas correlation features and parameter-gas correlation features, respectively.

[0239] For image-gas correlation features: evaluate their spatial consistency with measured emission data (e.g., whether high emission areas overlap with high feature areas in the image) and temporal stability (e.g., whether feature changes are synchronized with emission fluctuations), with a maximum score of 10 points.

[0240] For parameter-gas correlation characteristics: evaluate the goodness of fit between measured parameters and emission data (such as the correlation coefficient between nitrogen concentration and emission flux) and dynamic response speed (such as whether emissions respond promptly after parameter abrupt changes), with a maximum score of 10 points.

[0241] Based on historical data verification, the "error rate reverse scoring method" is adopted: if the prediction error rate of image-gas features is 15%, then the score = 10×(1-15%) = 8.5 points.

[0242] The final output is the evaluation score of the two types of features (e.g., image feature score 8.5 points, parametric feature score 7.8 points).

[0243] Step f2: Calculate the feature mutual information between each sub-feature in the image-gas correlation feature and the feature mutual information between each sub-feature in the parameter-gas correlation feature;

[0244] Specifically, Mutual Information (MI) is an indicator that measures the dependency between two random variables. It can be used to quantify the nonlinear correlation between different modal features (such as image features and parametric features mentioned above). Its value ranges from [0,1] (after normalization), and a higher value indicates a stronger intrinsic correlation between the two. The following is a detailed explanation of the calculation method for mutual information, using a cross-modal feature scenario as an example:

[0245] For two random variables X (such as the "red reflectance gradient" in image features) and Y (such as the "dayly TN variation rate" in parametric features), their mutual information is defined as:

[0246] Where p(x,y) is the joint probability distribution of X and Y; p(x) and p(y) are the marginal probability distributions of X and Y, respectively.

[0247] Electronic devices statistically analyze the frequency of each discrete feature pair (xi, yj) appearing in the samples, using this frequency as an approximation of the joint probability. For example, if the samples with "red light reflectance gradient ∈ [0.6, 0.8)" and "TN daily change rate ∈ [0.5, 0.7)" appear 20 times, and the total number of samples is 100, then p(x=0.6-0.8, y=0.5-0.7) = 20 / 100 = 0.2.

[0248] Then, calculate the marginal probability distributions p(x) and p(y). p(x): the frequency of a single image feature discrete value in all samples (e.g., the sample "red reflectance gradient ∈ [0.6, 0.8)" appears 30 times, so p(x=0.6-0.8)=30 / 100=0.3). p(y): the frequency of a single parameter feature discrete value in all samples (e.g., the sample "TN daily change rate ∈ [0.5, 0.7)" appears 25 times, so p(y=0.5-0.7)=25 / 100=0.25).

[0249] Based on the above probability values, substitute them into the mutual information formula and sum:

[0250] If X and Y are highly correlated (e.g., "red reflectance gradient" and "TN diurnal variation rate"), then the ratio of p(xi,yj)≈p(xi)p(yj) is large, the logarithmic term is positive, and the mutual information value is high (e.g., mutual information = 0.7 in the example). If the correlation between the two is weak (e.g., "blue reflectance" and "pH value"), then the difference between p(xi,yj) and p(xi)p(yj) is large, the logarithmic term is close to 0 or negative, and the mutual information value is low (e.g., mutual information = 0.15 in the example).

[0251] Strongly correlated feature pairs (mutual information > 0.6): such as "red light reflectance gradient" and "TN diurnal variation rate," indicating that both reflect the nitrogen pollution emission mechanism from different modalities (image texture, parameter changes). When fusion, they are given higher weights (e.g., local weight calculation in step 2) to strengthen the synergistic effect. Weakly correlated feature pairs (mutual information < 0.2): These may be due to data noise (e.g., blue light interference from skylight) or physical irrelevance (e.g., pH and blue light reflectance are not directly related). When fusion, their weights are reduced to decrease interference.

[0252] Step f3: Determine the global weights of the image-gas correlation features and parameter-gas correlation features based on the evaluation scores corresponding to the image-gas correlation features and parameter-gas correlation features, respectively.

[0253] Specifically, global weights are assigned based on the reliability assessment scores of the two types of features (the higher the weight, the greater the proportion of that type of feature in the fusion). For example, o assigns global weights according to the "proportion of reliability score": Image reliability = 0.9, parameter reliability = 0.86 → Image weight = 0.9 / (0.9+0.86) = 0.51, parameter weight = 0.49 (rounded to 0.5 / 0.5). If the image is blurred due to rain (reliability = 0.5), parameter reliability = 0.9 → Image weight = 0.5 / (0.5+0.9) = 0.36, parameter weight = 0.64 → parameter features are preferentially adopted.

[0254] Step f4: Based on the global weights and feature mutual information, calculate the local weight matrix between each pair of sub-features.

[0255] Specifically, the local weight matrix is ​​used to measure the relative importance of pairwise sub-features, taking into account both global reliability and sub-feature correlation. Local weight formula: , where MI(i,j) is the mutual information between sub-features i and j.

[0256] The local weight matrix is ​​a matrix of "number of image sub-features × number of parameter sub-features". The higher the element value, the stronger the complementarity of the sub-feature pair (low mutual information) and the higher the reliability of the global feature to which it belongs. Example: If the mutual information between the image sub-feature "emission direction" and the parameter sub-feature "flow velocity direction" is 0.2 (low redundancy), then the local weight = 0.52 × 0.48 / (1 + 0.2) = 0.208, which is higher than that of sub-feature pairs with high mutual information.

[0257] Step f5: Perform an outer product calculation on the image-gas correlation features and the parameter-gas correlation features to generate an initial feature matrix.

[0258] Specifically, the outer product calculation is used to capture the cross-correlation between the two types of feature sub-features and generate an initial feature matrix containing the interaction information of all sub-feature pairs.

[0259] The outer product is defined as follows: If the image-gas correlation feature has m sub-features (vector X = [x1, x2, ..., xm]) and the parameter-gas correlation feature has n sub-features (vector Y = [y1, y2, ..., yn]), then the initial feature matrix M is an m×n matrix with elements Mi,j = xi×yj. Each element represents the "synergistic effect between image sub-feature i and parameter sub-feature j" (e.g., the higher the product value of "high emission area in the image × high nitrogen concentration", the greater the emission potential of the area).

[0260] Step f6: Weight the elements in the initial feature matrix based on the local weight matrix, and then sum and compress them into cross-modal features by row.

[0261] Specifically, the electronic device can element-wise multiply the initial feature matrix M with the local weight matrix W to obtain a weighted matrix M′, where Mi,j′ = Mi,j × Wi,j. This enhances the influence of high-weight sub-feature pairs (such as those with strong complementarity and high reliability) and weakens the interference of low-weight sub-feature pairs (such as those with high redundancy and low reliability).

[0262] Then, the weighted matrix M′ is summed row by row (each row corresponds to an image sub-feature, and the summation yields the comprehensive association value between the sub-feature and all parameter sub-features), generating a cross-modal feature vector of dimension m. This ensures that each element contains information about the image sub-feature and also incorporates information about the parameter sub-features associated with it (e.g., the "image orientation" element = the weighted interaction sum of the orientation and all parameter sub-features).

[0263] Step S3034: Correct the cross-modal features to obtain the target modal features.

[0264] Specifically, the electronic device can process the sub-features (such as image-gas correlation features and parameter-gas correlation features) in the cross-modal features separately. For image-gas correlation features, noise caused by differences in illumination and resolution is removed (such as smoothing reflective points); for parameter-gas correlation features, sensor outliers (such as suddenly changing concentration values) are removed, thereby avoiding single-modal noise interference with subsequent fusion.

[0265] Then, the electronic device binds image-gas correlation features (such as pollution texture) and parameter-gas correlation features (such as nitrogen concentration) through correlation rules (such as "dense texture area" corresponding to "high concentration area"), and marks areas with high correlation (such as overlap > 70%) as core feature areas. Both image-gas correlation features and parameter-gas correlation features are mapped to the [0,1] interval to eliminate dimensional differences.

[0266] Then, the electronic device uses the target modal features, weighted by correlation strength, for fusion correction. For example,

[0267] For high correlation regions, image-gas correlation features and parameter-gas correlation features each account for 50% of the weight; for low correlation regions, more reliable features (such as parameter measured data with higher weight) are retained first, and finally compressed into target modal features of a unified dimension.

[0268] Step S3035: Based on the target modal characteristics, predict the nitrous oxide emissions corresponding to the target water quality.

[0269] Specifically, the electronic device predicts the nitrous oxide emissions corresponding to the target water quality based on the target modal characteristics.

[0270] Step S304: Based on the target water quality data and nitrous oxide emissions, determine the preset treatment measures corresponding to the target water quality.

[0271] Please refer to the above description of step S204 for details on this step, which will not be repeated here.

[0272] The intelligent water quality treatment method provided in this application identifies target water quality images, determines the corresponding RGB values ​​and infrared simulated bands, and constructs four-channel image data. The RGB channels reflect visible light information such as water color and turbidity, while the infrared simulated band captures invisible physical or chemical properties in the water. The target water quality data is then identified to determine the pollution type. Different pollution types have significantly different impact mechanisms on nitrous oxide emissions. Based on the pollution type, the weights corresponding to each channel in the four-channel image data are determined, and a weighted channel image is generated. Different pollution types have different sensitivities to each channel. By adjusting the weights, core features related to the pollution type can be strengthened, interference from irrelevant channels can be weakened, and the signal-to-noise ratio of the features can be improved. Based on the pollution type, a pre-defined size convolution kernel is used to perform convolution operations on the weighted channel image to generate preliminary spatial features. Different pollution types have different spatial distribution scales. The pre-defined size convolution kernel can accurately match the feature scale of the pollution type, avoiding the problems of "missed large-scale features" or "blurred small-scale features" caused by a fixed convolution kernel size. Depthwise separable convolution is used to convolve four-channel image data to extract spectral features. Depthwise separable convolution breaks down standard convolution into "depth convolution" and "point convolution," focusing on the spectral features within each channel while reducing the number of parameters and computational cost. Direction-selective convolution is then used to extract texture features from the four-channel image data. Water textures often exhibit strong directionality, and direction-selective convolution can specifically extract these directional texture features. Preliminary spatial features, spectral features, and texture features are fused to generate spectral-texture features. Spectral features reflect the chemical / physical properties of water quality, while texture features reflect spatial distribution patterns. Their fusion constructs a comprehensive "attribute + distribution" feature profile, fully characterizing the correlation between water quality status and nitrous oxide emissions. The spectral-texture features are then mapped to preset nitrous oxide emission templates in a predefined nitrous oxide emission pattern library. These preset nitrous oxide emission templates are based on a "spectral-texture feature - emission pattern" correspondence built from historical data. The mapping process quickly matches current water quality features with known emission patterns, providing empirical evidence for image-gas correlation. By matching templates from a pattern library, the model can generate reliable correlation features based on historical correlation patterns, even in the absence of new data, thus enhancing generalization ability. Based on spectral texture features and a preset nitrous oxide emission template, image-gas correlation features are output. Through the above steps, the final output image-gas correlation features integrate multi-dimensional information such as spectrum, texture, and pollution type adaptability, and are correlated with emission pattern library templates, achieving an effective mapping from water quality images to nitrous oxide emission features. This feature preserves the spatial and spectral characteristics of the image while directly associating with potential nitrous oxide emission patterns, enabling efficient fusion with parameter-gas correlation features and ultimately improving the accuracy of nitrous oxide emission prediction.

[0273] The parameter feature encoding branch identifies the target water quality data. Based on the nonlinear relationship between various data points and nitrous oxide emissions, it divides dynamic intervals and assigns values ​​to obtain the basic features corresponding to each data point, and extracts the rate of change features corresponding to each data point. By identifying the nonlinear relationship between the target water quality data and nitrous oxide emissions, the limitations of traditional linear division are avoided, enabling more accurate capture of the complex influence of water quality parameters on gas emissions and improving the characterization ability of basic features. Extracting the rate of change features can reflect the driving effect of dynamic changes on nitrous oxide emissions, compensating for the deficiencies of static data. Based on the correlation between various data points, coupling features are established between various data points. There is a synergistic effect among various water quality parameter data, and coupling features can capture this multi-parameter linkage effect, avoiding the one-sidedness of isolated analysis of a single parameter. Through correlation modeling, high-dimensional data is transformed into more representative coupling features, improving the compactness and correlation of features, and providing more valuable input for subsequent gas correlation analysis. Nonlinear activation is applied to each basic feature, and dynamic gating is set for the rate of change features and coupling features to obtain parameter-gas correlation features. Nonlinear activation enhances the model's ability to fit nonlinear relationships, making the basic features more closely reflect the complex mapping between water quality parameters and nitrous oxide emissions. Dynamic gating mechanisms adaptively adjust the weights of rate-of-change and coupling features based on data importance, improving feature specificity and robustness, and ultimately optimizing the accuracy of the correlation modeling between parameters and gas emissions.

[0274] Reliability assessments are performed on image-gas correlation features and parameter-gas correlation features, yielding corresponding assessment scores. Quantifying the reliability of these two modal features provides a basis for subsequent weight allocation, avoiding interference from unreliable features in the fusion result and improving the quality of cross-modal features from the outset. Mutual information is calculated between each sub-feature in the image-gas correlation features and each sub-feature in the parameter-gas correlation features. Mutual information measures the correlation strength between sub-features of different modalities, laying the foundation for capturing cross-modal complementary information and preventing the neglect of key correlations during fusion. Global weights for the image-gas correlation features and parameter-gas correlation features are determined based on their respective assessment scores. Allocating global weights based on the reliability assessment results adaptively highlights more reliable modal information, balances the contributions of the two modalities, prevents a single modality from dominating or being weakened, and improves the rationality of the fusion. Local weight matrices are calculated between each pair of sub-features based on the global weights and feature mutual information. The local weight matrix considers both modality-wide reliability and the correlation strength between sub-features, accurately characterizing the importance of different sub-feature pairs. This allows the fusion process to focus more precisely on key information and reduce the influence of redundant or irrelevant sub-features. An outer product is calculated on the image-gas correlation features and parameter-gas correlation features to generate an initial feature matrix. The outer product operation combines sub-features from both modalities pairwise to construct an initial matrix containing cross-correlation information, fully preserving cross-modal interaction details and providing rich raw material for subsequent weighted optimization. The elements in the initial feature matrix are weighted based on the local weight matrix, and then compressed into cross-modal features by row summation. By compressing the initial matrix elements through local weighting, high-value cross-correlation information can be filtered out, and high-dimensional interaction features can be condensed into compact cross-modal features. This improves computational efficiency while preserving key information, ultimately resulting in a fusion feature that is both complete and targeted, providing more accurate input for subsequent predictions.

[0275] Cross-modal features are corrected to obtain target modal features. Modal differences between image features and parametric features may lead to redundancy or conflict in the fused features. The correction step can eliminate such contradictions, making cross-modal features more consistent and reliable. The correction process can further screen and strengthen features directly related to N2O emissions, improving the "effectiveness" of features and reducing errors in subsequent predictions. Based on the target modal features, the nitrous oxide emissions corresponding to the target water quality are predicted. The target modal features integrate spatial information from the image and quantitative information from the parameters, and after correction, the noise is lower, which can more comprehensively characterize the complex factors affecting N2O emissions, resulting in more accurate predictions compared to single data sources. Cross-modal features cover multi-dimensional information, can cope with the specificity of different types of water bodies, and enhance the model's generalization ability in complex scenarios.

[0276] This embodiment also provides an intelligent water treatment device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0277] This embodiment provides an intelligent water treatment device, such as... Figure 4 As shown, it includes:

[0278] The acquisition module 401 is used to acquire the target water quality image corresponding to the target sampling point in the target water quality;

[0279] The first output module 402 is used to input the target water quality image into the preset water quality data determination model and output the target water quality data corresponding to the target water quality.

[0280] The second output module 403 is used to input the target water quality image and target water quality data into the preset nitrous oxide emission determination model and output the nitrous oxide emission corresponding to the target water quality.

[0281] The determination module 404 is used to determine the preset treatment measures corresponding to the target water quality based on the target water quality data and nitrous oxide emissions.

[0282] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A smart water treatment method, characterized in that, The method includes: Obtain the target water quality image corresponding to the target sampling point in the target water quality; The target water quality image is input into a preset water quality data determination model, and the target water quality data corresponding to the target water quality is output. The target water quality image and the target water quality data are input into a preset nitrous oxide emission determination model, and the nitrous oxide emission corresponding to the target water quality is output. Based on the target water quality data and the nitrous oxide emission, the preset treatment measures corresponding to the target water quality are determined; The step of inputting the target water quality image and the target water quality data into a preset nitrous oxide emission determination model and outputting the nitrous oxide emission corresponding to the target water quality includes: The target water quality image is input into the visual feature encoding branch of the preset nitrous oxide emission determination model, and the image-gas correlation features are output. The target water quality data is input into the parameter feature encoding branch of the preset nitrous oxide emission determination model, and the parameter-gas correlation feature is output. The image-gas correlation features and the parameter-gas correlation features are weighted and fused to generate cross-modal features; The cross-modal features are corrected to obtain the target modal features; Based on the target modal characteristics, the nitrous oxide emission corresponding to the target water quality is predicted.

2. The method according to claim 1, characterized in that, The target water quality image is a time-series image; the step of inputting the target water quality image into a preset water quality data determination model and outputting the target water quality data corresponding to the target water quality includes: The preset water quality data determination model identifies the target water quality image, determines the RGB value and infrared simulated band corresponding to the target water quality image, and constructs four-channel image data. The four-channel image data is input into the spectral-spatial feature extraction branch of the preset water quality data determination model to extract the spatial features corresponding to the four-channel image data. The target water quality image sequence is input into the spatiotemporal texture feature extraction branch of the preset water quality data determination model to extract the texture features corresponding to each target water quality image; The spatial features and the texture features are fused to generate the target features; Based on the target characteristics, the target water quality data is output.

3. The method according to claim 2, characterized in that, The step of inputting the four-channel image data into the spectral-spatial feature extraction branch of the preset water quality data determination model to extract the spatial features corresponding to the four-channel image data includes: Single-channel spectral feature analysis is performed on each channel of the four-channel image data to obtain the single-channel features corresponding to each channel. Based on the synergistic effect of water quality parameters, inter-channel interaction features are constructed; the interaction features include ratio features and difference features. A sliding window method is used to slide over the four-channel image data to construct gray-level co-occurrence matrices for each dimension. Each of the gray-level co-occurrence matrices is converted into a feature vector, and the feature vectors are then fused to generate a target vector; The horizontal and vertical gradients corresponding to the four-channel image data are calculated using the Sobel operator to obtain gradient features. Calculate the spatial distribution entropy corresponding to the four-channel image data; The spatial features are generated by fusing the single-channel features, the inter-channel interaction features, the target vector, the gradient features, and the spatial distribution entropy.

4. The method according to claim 2, characterized in that, The step of inputting the target water quality image sequence into the spatiotemporal texture feature extraction branch of the preset water quality data determination model, and extracting the texture features corresponding to each target water quality image, includes: The spatiotemporal texture feature extraction branch slides on the target water quality image sequence based on a preset convolution kernel to generate feature response values ​​corresponding to each position, and generates an original feature map based on each feature response value; the preset convolution kernel includes a temporal dimension and a spatial dimension; The original feature map is subjected to global average pooling to compress it into a spatial weight map, and the spatial weight map is normalized to obtain a normalized feature map. The target feature map is obtained by multiplying the original feature map with the normalized feature map; Global average pooling is performed on each channel of the target feature map to obtain a preset feature vector; Input the preset feature vector corresponding to each time step into a bidirectional LSTM to extract the time-dependent feature vector; Perform a convolution operation on the target feature map to obtain a convolutional feature vector; The temporal-dependent feature vector is concatenated with the convolutional feature vector to obtain the texture feature.

5. The method according to claim 2, characterized in that, The step of fusing the spatial features and the texture features to generate target features includes: Numerical analysis is performed on the spatial features to extract the original spatial values ​​at each location; Based on the distribution pattern of the original spatial values, high-value core areas and non-core areas are divided to obtain the spatial intensity matrix; The texture features are subjected to texture saliency analysis to divide the dominant texture coverage area and the non-dominant texture coverage area, and the texture response matrix is ​​obtained. Calculate the angle between the high-value core region and the dominant texture coverage region; Based on the included angles corresponding to each position, a direction consistency matrix is ​​generated; Based on the spatial intensity matrix, the texture response matrix, and the orientation consistency matrix, a coupling kernel matrix is ​​generated; Based on the coupling kernel matrix, the spatial features and the texture features are fused to generate the target features.

6. The method according to claim 1, characterized in that, The step of inputting the target water quality image into the visual feature encoding branch of the preset nitrous oxide emission determination model and outputting image-gas correlation features includes: The target water quality image is identified to determine the RGB value and infrared analog band corresponding to the target water quality image, and four-channel image data is constructed. The target water quality data is identified to determine the type of pollution; Based on the pollution type, determine the weight of each channel in the four-channel image data and generate a weighted channel image; Based on the pollution type, a pre-defined size convolution kernel is used to perform a convolution operation on the weighted channel image to generate preliminary spatial features; The four-channel image data are convolved using depthwise separable convolution to extract spectral features. Texture features are extracted by performing a convolution operation on the four-channel image data using directional selective convolution. The preliminary spatial features, the spectral features, and the texture features are fused to generate spectral texture features; The spectral texture features are mapped to preset nitrous oxide emission templates in a predefined nitrous oxide emission pattern library; Based on the spectral texture features and the preset nitrous oxide emission template, the image-gas correlation features are output.

7. The method according to claim 1, characterized in that, The step of inputting the target water quality data into the parameter feature encoding branch of the preset nitrous oxide emission determination model and outputting parameter-gas correlation features includes: The parameter feature encoding branch identifies the target water quality data, divides the dynamic range and assigns values ​​based on the nonlinear relationship between each data point in the target water quality data and nitrous oxide emissions, obtains the basic features corresponding to each data point, and extracts the rate of change features corresponding to each data point. Based on the correlation between various data points, establish the coupling characteristics between them; Nonlinear activation is applied to each of the basic features, and dynamic gating is set for the rate of change feature and the coupling feature to obtain the parameter-gas correlation feature.

8. The method according to claim 1, characterized in that, The step of weighted fusion of the image-gas correlation features and the parameter-gas correlation features to generate cross-modal features includes: The reliability of the image-gas correlation feature and the parameter-gas correlation feature is evaluated to obtain the evaluation scores corresponding to the image-gas correlation feature and the parameter-gas correlation feature, respectively. Calculate the feature mutual information between each sub-feature in the image-gas correlation feature and each sub-feature in the parameter-gas correlation feature; The global weights corresponding to the image-gas correlation feature and the parameter-gas correlation feature are determined based on the evaluation scores corresponding to the image-gas correlation feature and the parameter-gas correlation feature, respectively. Based on the global weights and the feature mutual information, calculate the local weight matrix between each pair of sub-features; The image-gas correlation features and the parameter-gas correlation features are multiplied by an outer product to generate an initial feature matrix; The elements in the initial feature matrix are weighted based on the local weight matrix, and then the summation is performed row-wise to compress the cross-modal features.

9. An intelligent water treatment device, characterized in that, The device includes: The acquisition module is used to acquire the target water quality image corresponding to the target sampling point in the target water quality; The first output module is used to input the target water quality image into a preset water quality data determination model and output the target water quality data corresponding to the target water quality. The second output module is used to input the target water quality image and the target water quality data into a preset nitrous oxide emission determination model, and output the nitrous oxide emission corresponding to the target water quality; wherein, inputting the target water quality image and the target water quality data into the preset nitrous oxide emission determination model and outputting the nitrous oxide emission corresponding to the target water quality includes: inputting the target water quality image into the visual feature encoding branch of the preset nitrous oxide emission determination model, and outputting image-gas correlation features; inputting the target water quality data into the parameter feature encoding branch of the preset nitrous oxide emission determination model, and outputting parameter-gas correlation features; performing weighted fusion of the image-gas correlation features and the parameter-gas correlation features to generate cross-modal features; correcting the cross-modal features to obtain target modal features; and predicting the nitrous oxide emission corresponding to the target water quality based on the target modal features; The determination module is used to determine the preset treatment measures corresponding to the target water quality based on the target water quality data and the nitrous oxide emission amount.