A method for accurate tracing of water pollution based on neural network model

Through the water pollution source tracing method based on the neural network model, combined with multi-source data and reinforcement learning strategies, the network parameters are dynamically adjusted, which solves the problem of insufficient real-time and accuracy of water pollution monitoring in the existing technology, and achieves high-level detection of pollution sources. Precise positioning and accurate identification of pollutant types improve the flexibility and adaptability of monitoring.

CN118425458BActive Publication Date: 2024-09-17CHENGDU YIQINGYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410897309.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-09-17
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

Existing water pollution monitoring technologies have deficiencies in real-time, accuracy, generalization capabilities, data processing capabilities, dynamic adjustment mechanisms, and spatial feature identification, making it difficult to accurately locate pollution sources and accurately identify pollutant types, especially in surface-to-surface areas. Lack of flexibility and adaptability to complex water quality changes.

Method used

An accurate water pollution source tracing method based on the neural network model is adopted. Through multi-source data collection and integration, combined with the spatial attention mechanism and reinforcement learning strategy, the network parameters are dynamically adjusted, and migration operators and correction factors are used to optimize the prediction performance to achieve high detection of pollution sources. Precision positioning and accurate identification of pollutant types.

Benefits of technology

It improves the accuracy and robustness of water pollution source tracing, can quickly adapt to data changes and noise, achieves high-precision positioning of pollution sources and accurate identification of pollutant types, and provides strong technical support for environmental protection and water resources management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118425458B
    Figure CN118425458B
Patent Text Reader

Abstract

The present invention discloses a method for accurate water pollution source tracing based on a neural network model, and relates to the field of intelligent algorithms for water pollution source tracing. The present invention combines multi-source data such as water body indicators, spatial characteristics, spectral characteristics, etc. as inputs of a prediction and tracing model, and utilizes a neural network model to achieve high-precision positioning of pollution sources and accurate identification of pollutant types; and by adding a dynamic correction factor to the neural network model, the model is able to adjust the learning rate in real time according to the prediction performance. Furthermore, the model is more flexible during the training process, and can quickly adapt to data changes and noise, thereby improving the accuracy and robustness in water pollution source tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent algorithms for tracing the source of water pollution, and specifically to a method for accurately tracing the source of water pollution based on a neural network model. Background Art

[0002] Although existing water pollution monitoring technologies, including chemical analysis, biological monitoring, physical detection and remote sensing technology, can provide water quality information to a certain extent, they have obvious deficiencies in real-time, accuracy, generalization, data processing capabilities, etc.

[0003] Although chemical analysis techniques are accurate, they usually require laboratory operations, are time-consuming, and are not suitable for real-time monitoring. Biological monitoring techniques use the sensitivity of organisms to pollutants to assess water quality, but their ability to identify specific pollutants is limited. Physical detection techniques monitor the physical properties of water bodies through sensors. Although they have a fast response speed, they usually can only provide limited water quality information. Remote sensing technology can cover a wide area, but it is difficult to accurately locate the source of pollution due to the resolution and accuracy of the sensors.

[0004] Early machine learning technologies, such as those based on statistical models and simple machine learning algorithms, have advantages in processing speed, but are limited in the generalization and adaptability of the models. These technologies lack prediction accuracy and adaptability when faced with new or unknown pollutants, especially when dealing with large-scale, multi-source, and high-dimensional water quality data, where efficiency and accuracy are limited. In addition, existing technologies lack a dynamic adjustment mechanism, making it difficult to dynamically adjust monitoring strategies based on real-time monitoring data and environmental changes. In terms of spatial feature identification, traditional methods have difficulty in accurately extracting and strengthening the spatial features of pollution sources. In terms of optimizing model prediction performance, existing technologies usually rely on fixed parameter adjustment strategies, lack flexibility and adaptability, and are difficult to cope with complex water quality changes.

[0005] In summary, the existing water pollution monitoring technology has obvious deficiencies in terms of real-time performance, accuracy, generalization ability, data processing ability, dynamic adjustment mechanism, spatial feature recognition, and prediction performance optimization. In order to overcome these problems and improve the efficiency and accuracy of water pollution monitoring, it is urgent to develop a new technical method. This scheme is proposed in this context, aiming to achieve accurate tracing of water pollution by integrating neural network models and multi-source data acquisition technology, and provide strong technical support for environmental protection and water resources management. Summary of the invention

[0006] The present invention aims to propose a more efficient, accurate and reliable technical means, which can provide strong technical support for environmental protection and pollution control.

[0007] A method for accurately tracing the source of water pollution based on a neural network model comprises the following steps:

[0008] S1. Collect multi-source data on water quality information, alarm pollution factor information, point information, and real-time water sample spectra, integrate the collected multi-source data, and extract feature sets from real-time water sample spectra and feature spectrum libraries;

[0009] S2. Combine the outlet location information database and the pollution source spatial topology map to extract and enhance the spatial features through the spatial attention mechanism;

[0010] S3. Based on the reinforcement learning strategy, the state space is defined according to the parameter set of the time step, and the action space is defined according to the adjustment amount of the network parameters;

[0011] S4. dynamically adjust the correction factor based on the prediction performance of the model for the current input data, wherein the prediction performance includes the accuracy of the model in spatially locating the pollution source and the accuracy of the model in identifying the type of pollutants; and guide the update of network parameters by combining the current optimal parameters and the historical optimal parameters, as well as environmental feedback, through the migration operator;

[0012] S5. Feed forward the feature representation after parameter update through the output layer to generate the preliminary prediction results of the model. According to the task requirements, convert the original output of the output layer into the prediction results required for the task. The prediction results required for the task include: the geographic coordinates of the pollution source and / or the location information on the topological map, the predicted type of the pollution source and its probability distribution, and the predicted location of the pollution source and / or the location probability distribution.

[0013] Furthermore, in step S3, the state space is defined according to the parameter set of the time step, which is specifically expressed as:

[0014] ;

[0015] Among them, the represents the state space, The characteristic vector representing water quality information includes pH value, dissolved oxygen and chemical oxygen demand indicators. The characteristics of the alarm pollution factor include the specific pollutant threshold and type that triggers the alarm. Indicates point information, including the geographic coordinates of the sampling point and its position in the monitoring network. It represents the feature set extracted from the water sample spectrum and the feature spectrum library. Represents spatial characteristics and is used to represent the spatial distribution information of pollution sources.

[0016] Furthermore, in step S3, the action space is defined according to the adjustment amount of the network parameters, which is specifically expressed as:

[0017] ;

[0018] Among them, the represents the action space, Represents the weight adjustment amount, which is used to indicate the update amplitude of the neural network weight at the current time step. Represents the bias adjustment, which is used to indicate the update amplitude of the neural network bias at the current time step.

[0019] Furthermore, in step S4, dynamically adjusting the correction factor according to the prediction performance of the model for the current input data specifically includes the following sub-steps:

[0020] S4011. Setting the initial value of the correction factor;

[0021] S4012. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model;

[0022] S4013. Calculate the spatial positioning accuracy and pollutant type identification accuracy from the last time step arrive The amount of change;

[0023] S4014. Dynamically adjust the correction factor according to performance changes, specifically expressed as:

[0024] ;

[0025] Among them, the Represents the adjusted correction factor, represents the correction factor, represents a hyperparameter used to control the sensitivity of the correction factor adjustment. Indicates performance changes, the It is obtained by weighted calculation of spatial positioning accuracy and pollutant type identification accuracy. represents the long-term average accuracy, Represents a constant and is used to avoid division by zero errors.

[0026] Furthermore, in step S4, guiding the network parameter update by migrating the operator, combining the current optimal parameters and the historical optimal parameters, and environmental feedback specifically includes the following sub-steps:

[0027] S4021. Initialize network parameters, including weights and bias ;

[0028] S4022. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model;

[0029] S4023. Identify the current step The optimal parameters and ; Collect historical optimal parameters and ;

[0030] S4024. Update the network parameters through the migration operator according to the current correction factor, which is specifically expressed as:

[0031] ;

[0032] Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the correction factor, Indicates the current time step The optimal weight coefficient is represents the optimal weight of history, Indicates that at time step The bias, Indicates that at time step The optimal bias, Indicates that at time step The bias, represents the optimal bias of history, Represents the coefficient dynamically adjusted according to environmental feedback. Represents a coefficient that is dynamically adjusted based on historical data.

[0033] Furthermore, in step S5, after the model generates a preliminary prediction result, it also includes optimizing the output through an enhancement mechanism of a feedback operator, which specifically includes the following sub-steps:

[0034] S501. After the model performs forward propagation and generates a predicted output, the error between the predicted value and the actual value is calculated;

[0035] S502. quantify the overall prediction performance of the model through a loss function; and calculate the gradient of the loss function with respect to the network parameters;

[0036] S503. Adjust the gradient according to the correction factor to control the amplitude of parameter update; and update the weights and biases of the network according to the calculated gradient and correction factor;

[0037] S504. Use the updated parameters for the next model prediction to form a feedback loop until the model converges.

[0038] Furthermore, in step S501, the error between the predicted value and the actual value is calculated as follows:

[0039] ;

[0040] Among them, the Represents the error value, represents the true value, Represents the model prediction value.

[0041] Furthermore, in step S502, the gradient of the loss function with respect to the network parameters is calculated as follows:

[0042] ;

[0043] ;

[0044] Among them, the Represents the gradient of the loss function with respect to the weight, Represents the gradient of the loss function with respect to the bias, represents the loss function, represents the partial derivative of the loss function, represents the partial derivative of the weight, Indicates that at time step The weight of Indicates that at time step The bias.

[0045] Furthermore, in step S503, the gradient is adjusted according to the correction factor, and the amplitude of the control parameter update is specifically expressed as:

[0046] ;

[0047] Among them, the Represents the weight gradient after adjustment by the correction factor. represents the correction factor, Represents the gradient of the loss function with respect to the weight, Indicates that at time step The weight of represents the bias gradient after adjustment by the correction factor. Represents the gradient of the loss function with respect to the bias, Indicates that at time step The bias.

[0048] Furthermore, in step S503, according to the calculated gradient and correction factor, the weight and bias of the network are updated as follows:

[0049] ;

[0050] Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the learning rate, Represents the weight gradient after adjustment by the correction factor. Indicates that at time step The bias, Indicates that at time step The bias, Represents the bias gradient after adjustment by the correction factor.

[0051] The beneficial effects of the invention are:

[0052] The present invention proposes a method for accurate water pollution source tracing based on a neural network model, which combines multi-source data such as water body indicators, spatial characteristics, and spectral characteristics as inputs of the prediction and tracing model, and uses the neural network model to achieve high-precision positioning of pollution sources and accurate identification of pollutant types;

[0053] The present invention adds a dynamic correction factor to the neural network model, so that the model can adjust the learning rate in real time according to the prediction performance. Furthermore, the model is more flexible during the training process and can quickly adapt to data changes and noise, thereby improving the accuracy and robustness in water pollution tracing. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A method flow chart of a method for accurately tracing the source of water pollution based on a neural network model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following.

[0056] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0057] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative work are within the scope of protection of the present invention. It should be noted that relational terms such as the terms "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0058] Moreover, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0059] The features and performance of the present invention are further described in detail below in conjunction with the embodiments.

[0060] Specifically, Figure 1 , A method for accurately tracing the source of water pollution based on a neural network model, comprising the following steps:

[0061] S1. Collect multi-source data on water quality information, alarm pollution factor information, point information, and real-time water sample spectra, integrate the collected multi-source data, and extract feature sets from real-time water sample spectra and feature spectrum libraries;

[0062] S2. Combine the outlet location information database and the pollution source spatial topology map to extract and enhance the spatial features through the spatial attention mechanism;

[0063] S3. Based on the reinforcement learning strategy, the state space is defined according to the parameter set of the time step, and the action space is defined according to the adjustment amount of the network parameters;

[0064] S4. dynamically adjust the correction factor based on the prediction performance of the model for the current input data, wherein the prediction performance includes the accuracy of the model in spatially locating the pollution source and the accuracy of the model in identifying the type of pollutants; and guide the update of network parameters by combining the current optimal parameters and the historical optimal parameters, as well as environmental feedback, through the migration operator;

[0065] S5. The updated feature representation is fed forward through the output layer to generate the preliminary prediction results of the model. According to the task requirements, the original output of the output layer is converted into the prediction results required for the task, and the prediction results required for the task include: the geographical coordinates of the pollution source and / or the location information on the topological map, the predicted type of the pollution source and its probability distribution, and the predicted location and / or location probability distribution of the pollution source. Specifically, this embodiment realizes the efficient integration of multi-source data by accurately collecting water quality information, alarm pollution factors, point information and real-time water sample spectra; through feature extraction technology, key information is identified from spectral data, and the spatial attention mechanism is used to strengthen the recognition of the spatial distribution characteristics of pollution sources; combined with reinforcement learning strategies, the state space and action space are dynamically defined to achieve adaptive adjustment of network parameters; through the collaborative work of correction factors and migration operators, the model can optimize the prediction performance according to real-time feedback, and finally output the precise location and type of pollution sources.

[0066] It should be noted that for spectral characteristics, the Lambeer law is used Calculate the absorbance, where represents absorbance, represents the molar absorption coefficient, Represents the pollutant concentration, Indicates the optical path length. In addition, for water quality indicators, including but not limited to pH value, dissolved oxygen (DO), chemical oxygen demand (COD), ammonia nitrogen (NH3-N), etc., the abnormality of the indicators can be used as a preliminary basis for judging pollution.

[0067] Exemplarily, the neural network in this embodiment adopts the RLNNA neural network architecture, specifically:

[0068] Input layer: Combining water quality indicators and spectral features, the input dimension is the number of water quality indicators plus the dimension of spectral data;

[0069] Feature layer: Use convolutional layer CNN to extract local features of water quality indicators and spatial features of spectral data;

[0070] Time series layer: For time series data, such as continuous monitoring data, a recurrent layer (RNN) is used to capture temporal dependencies;

[0071] Spatial attention layer: The spatial attention mechanism is used to enhance the model’s ability to identify the geographical location of pollution sources.

[0072] It should be noted that in water pollution tracing, the spatial attention mechanism can help the model identify the diffusion pattern of pollutants in rivers or lakes, as well as the importance of different geographical locations in contributing to pollution. Specifically, a convolutional neural network is used to extract features from the original data, and a parameterized attention network is used to calculate the attention weight of each spatial position based on the extracted features. The calculated attention weight is applied to the feature representation, and the weighted features are integrated to form a comprehensive feature representation of each monitoring point.

[0073] Furthermore, in step S3, the state space is defined according to the parameter set of the time step, which is specifically expressed as:

[0074] ;

[0075] Among them, the represents the state space, The characteristic vector representing water quality information includes pH value, dissolved oxygen and chemical oxygen demand indicators. The characteristics of the alarm pollution factor include the specific pollutant threshold and type that triggers the alarm. Indicates point information, including the geographic coordinates of the sampling point and its position in the monitoring network. It represents the feature set extracted from the water sample spectrum and the feature spectrum library. Represents spatial characteristics and is used to represent the spatial distribution information of pollution sources.

[0076] Furthermore, in step S3, the action space is defined according to the adjustment amount of the network parameters, which is specifically expressed as:

[0077] ;

[0078] Among them, the represents the action space, Represents the weight adjustment amount, which is used to indicate the update amplitude of the neural network weight at the current time step. Represents the bias adjustment, which is used to indicate the update amplitude of the neural network bias at the current time step.

[0079] Furthermore, in step S4, dynamically adjusting the correction factor according to the prediction performance of the model for the current input data specifically includes the following sub-steps:

[0080] S4011. Setting the initial value of the correction factor;

[0081] S4012. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model;

[0082] S4013. Calculate the spatial positioning accuracy and pollutant type identification accuracy from the last time step arrive The amount of change;

[0083] S4014. Dynamically adjust the correction factor according to performance changes, specifically expressed as:

[0084] ;

[0085] Among them, the Represents the adjusted correction factor, represents the correction factor, represents a hyperparameter used to control the sensitivity of the correction factor adjustment. Indicates performance changes, the It is obtained by weighted calculation of spatial positioning accuracy and pollutant type identification accuracy. represents the long-term average accuracy, Represents a constant, which is used to avoid division by zero errors. Specifically, the principle of dynamic adjustment of the correction factor is: first set an initial value, and then after each training step, evaluate the prediction performance based on the model's spatial positioning accuracy and pollutant type identification accuracy. Among them, the change in performance indicators is used to dynamically adjust the correction factor to ensure that the model can flexibly adjust the learning step size when facing different data distributions. The update of the correction factor reflects the impact of performance changes on the learning rate, achieving a more efficient training process.

[0086] Furthermore, in step S4, guiding the network parameter update by migrating the operator, combining the current optimal parameters and the historical optimal parameters, and environmental feedback specifically includes the following sub-steps:

[0087] S4021. Initialize network parameters, including weights and bias ;

[0088] S4022. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model;

[0089] S4023. Identify the current step The optimal parameters and ; Collect historical optimal parameters and ;

[0090] S4024. Update the network parameters through the migration operator according to the current correction factor, which is specifically expressed as:

[0091] ;

[0092] Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the correction factor, Indicates the current time step The optimal weight coefficient is represents the optimal weight of history, Indicates that at time step The bias, Indicates that at time step The optimal bias, Indicates that at time step The bias, represents the optimal bias of history, Represents the coefficient dynamically adjusted according to environmental feedback. Represents the coefficient that is dynamically adjusted according to historical data. Specifically, the migration operator combines the current optimal parameters and the historical optimal parameters in parameter update, while taking into account environmental feedback, ensuring that the network parameters can be updated towards the global optimal solution in each iteration.

[0093] Furthermore, in step S5, after the model generates a preliminary prediction result, it also includes optimizing the output through an enhancement mechanism of a feedback operator, which specifically includes the following sub-steps:

[0094] S501. After the model performs forward propagation and generates a predicted output, the error between the predicted value and the actual value is calculated;

[0095] S502. quantify the overall prediction performance of the model through a loss function; and calculate the gradient of the loss function with respect to the network parameters;

[0096] S503. Adjust the gradient according to the correction factor to control the amplitude of parameter update; and update the weights and biases of the network according to the calculated gradient and correction factor;

[0097] S504. The updated parameters are used for the next model prediction, forming a feedback loop until the model converges. Specifically, the gradient of the loss function provides the direction to reduce the error, and the correction factor dynamically adjusts the direction to control the amplitude of the parameter update, forming a closed loop according to the mechanism, so that the model can self-optimize after each iteration until convergence is achieved.

[0098] Furthermore, in step S501, the error between the predicted value and the actual value is calculated as follows:

[0099] ;

[0100] Among them, the Represents the error value, represents the true value, Represents the model prediction value.

[0101] Furthermore, in step S502, the gradient of the loss function with respect to the network parameters is calculated as follows:

[0102] ;

[0103] ;

[0104] Among them, the Represents the gradient of the loss function with respect to the weight, Represents the gradient of the loss function with respect to the bias, represents the loss function, represents the partial derivative of the loss function, represents the partial derivative of the weight, Indicates that at time step The weight of Indicates that at time step The bias.

[0105] Furthermore, in step S503, the gradient is adjusted according to the correction factor, and the amplitude of the control parameter update is specifically expressed as:

[0106] ;

[0107] Among them, the Represents the weight gradient after adjustment by the correction factor. represents the correction factor, Represents the gradient of the loss function with respect to the weight, Indicates that at time step The weight of represents the bias gradient after adjustment by the correction factor. Represents the gradient of the loss function with respect to the bias, Indicates that at time step The bias.

[0108] Furthermore, in step S503, according to the calculated gradient and correction factor, the weight and bias of the network are updated as follows:

[0109] ;

[0110] Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the learning rate, Represents the weight gradient after adjustment by the correction factor. Indicates that at time step The bias, Indicates that at time step The bias, Represents the bias gradient after adjustment by the correction factor.

[0111] Furthermore, for the output of the model, specifically:

[0112] For classification prediction tasks, the output layer of the model is processed through the softmax activation function to map the high-dimensional feature space to the probability distribution of pollution source types. For each pollution source, the model provides a prediction probability, indicating the possibility that the sample belongs to this type of pollution source; for regression tasks, the output layer of the model directly predicts the concentration value of the pollutant through linear or nonlinear activation functions, and outputs a continuous range of values, representing the estimated concentration of the pollutant; the above subtasks are used to predict suspected pollution sources.

[0113] For the task of locating polluted river sections, the geographical location information (such as longitude and latitude) of the water quality monitoring points is encoded into a format that the model can process. The model uses spatial features to identify the possible location of the pollution source. Combined with the pollutant propagation model and hydrodynamic principles, the model predicts the diffusion path of pollutants along the river, thereby locating the river section where the pollution occurs. The above subtasks are used to locate and trace the pollution source.

[0114] For multi-source data, water quality indicators, spectral data, spatial information and other multi-source data are integrated to form a comprehensive feature representation to support model prediction. The prediction results of the model need to be interpreted in combination with domain knowledge. For example, the predicted pollutant types and concentrations are compared with the known pollution source characteristics to verify the rationality of the prediction.

[0115] As a further preferred implementation scheme, a water pollution accurate tracing system based on a neural network model is proposed, wherein the preferred implementation scheme uses neural network technology to monitor and analyze water quality information in real time to achieve accurate positioning of pollution sources and rapid identification of pollutant types. The system provides users with efficient and accurate water pollution tracing services through technical means such as multi-source data collection, feature extraction, spatial attention mechanism, reinforcement learning strategy and dynamic parameter adjustment. Specifically including:

[0116] Multi-source data acquisition and integration module, used to automatically collect water quality information, alarm pollution factors, point information and real-time water sample spectra and other data; through efficient data integration technology, extract key feature sets from real-time water sample spectra and feature spectrum libraries;

[0117] The spatial feature extraction and enhancement module is used to combine the outlet location information database and the pollution source spatial topology map, and use the spatial attention mechanism to enhance the recognition of the spatial distribution characteristics of the pollution source;

[0118] The reinforcement learning strategy module is used to dynamically define the state space and action space to achieve adaptive adjustment of network parameters. The state space is composed of water quality information, alarm pollution factors, point information, spectral characteristics and spatial characteristics; the action space is defined by weight adjustment and bias adjustment to guide the update of neural network weights and biases;

[0119] Dynamic parameter adjustment and optimization module, used to dynamically adjust the correction factor and optimize the learning step size of the model based on the model prediction performance. The adjustment of the correction factor reflects the impact of performance changes on the learning rate, achieving a more efficient training process;

[0120] The migration operator and parameter update module is used to combine the current optimal parameters, historical optimal parameters and environmental feedback, and guide the update of network parameters through the migration operator. This ensures that the network parameters can be updated towards the global optimal solution in each iteration;

[0121] The prediction result generation and optimization module is used to systematically generate preliminary prediction results, including the geographical coordinates of the pollution source, the predicted type and its probability distribution. Through the enhancement mechanism of the feedback operator, the output results are optimized to form a closed-loop feedback cycle until the model converges;

[0122] The error calculation and gradient update module is used to calculate the error between the predicted value and the actual value and quantify the overall prediction performance of the model.

[0123] The gradient is adjusted according to the correction factor to control the amplitude of parameter update and realize self-optimization of the model.

[0124] For example, for the above implementation, the neural network architecture used is specifically:

[0125] Input layer: receives integrated data, including water quality indicators, point information, real-time water sample spectra, etc.

[0126] Feature extraction layer:

[0127] A one-dimensional convolutional layer (1D-CNN) is used to extract local features in real-time water sample spectral data.

[0128] A two-dimensional convolutional layer (2D-CNN) is used to extract one-dimensional and two-dimensional features from the feature map library.

[0129] Spatial feature layer: Combine the outlet location information database and the pollution source spatial topology map, and use the spatial attention mechanism to extract and enhance spatial features.

[0130] Time series analysis layer: If the data contains time series, use the recurrent neural network (RNN) layer to process it.

[0131] Fusion layer: Fusion the outputs of the above layers to provide comprehensive features for further analysis.

[0132] Output layer: According to the task requirements, the softmax layer is designed to classify the types of pollution sources, or the regression layer is designed to estimate the concentration. Specifically, the above implementation adopts a neural network optimization algorithm based on reinforcement learning, RLNNA, which is a method that combines reinforcement learning RL and neural network optimization algorithm NNA. This algorithm optimizes the weights and structure of the neural network through the reinforcement learning mechanism, thereby improving the performance of the model. RLNNA optimizes the neural network model through the reinforcement learning mechanism, improving the efficiency and accuracy of accurate tracing of water pollution. This method can adaptively adjust the model structure and continuously approach the optimal solution.

[0133] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. A method for accurately tracing the source of water pollution based on a neural network model, characterized in that: The following steps are involved: S1. Collect multi-source data on water quality information, alarm pollution factor information, point information, and real-time water sample spectra, integrate the collected multi-source data, and extract feature sets from real-time water sample spectra and feature spectrum libraries; S2. Combine the outlet location information database and the pollution source spatial topology map to extract and enhance the spatial features through the spatial attention mechanism; S3. Based on the reinforcement learning strategy, the state space is defined according to the parameter set of the time step, and the action space is defined according to the adjustment amount of the network parameters; S4. dynamically adjusting the correction factor according to the prediction performance of the model for the current input data, wherein the prediction performance includes the accuracy of the model in spatially locating the pollution source and the accuracy of the model in identifying the type of pollutant; And through the migration operator, combined with the current optimal parameters and historical optimal parameters, as well as environmental feedback, the network parameter update is guided; S5. Feed forward the updated feature representation through the output layer to generate the preliminary prediction results of the model, and convert the original output of the output layer into the prediction results required by the task according to the task requirements, wherein the prediction results required by the task include: the geographical coordinates of the pollution source and / or the location information on the topological map, the predicted type of the pollution source and its probability distribution, and the predicted location of the pollution source and / or the location probability distribution; In step S3, the state space is defined according to the parameter set of the time step as follows: ; Among them, the represents the state space, The characteristic vector representing water quality information includes pH value, dissolved oxygen and chemical oxygen demand indicators. The characteristics of the alarm pollution factor include the specific pollutant threshold and type that triggers the alarm. Indicates point information, including the geographic coordinates of the sampling point and its position in the monitoring network. It represents the feature set extracted from the water sample spectrum and the feature spectrum library. Represents spatial characteristics, used to represent the spatial distribution information of pollution sources; In step S3, the action space is defined according to the adjustment amount of the network parameters, which is specifically expressed as: ; Among them, the represents the action space, Represents the weight adjustment amount, which is used to indicate the update amplitude of the neural network weight at the current time step. Represents the bias adjustment, which is used to indicate the update amplitude of the neural network bias at the current time step; In step S4, dynamically adjusting the correction factor according to the prediction performance of the model for the current input data specifically includes the following sub-steps: S4011. Setting the initial value of the correction factor; S4012. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model; S4013. Calculate the above spatial positioning accuracy and pollutant type identification accuracy from the last time step arrive The amount of change; S4014. Dynamically adjust the correction factor according to performance changes, specifically expressed as: ; Among them, the Represents the adjusted correction factor, represents the correction factor, represents a hyperparameter used to control the sensitivity of the correction factor adjustment. Indicates performance changes, the It is obtained by weighted calculation of spatial positioning accuracy and pollutant type identification accuracy. represents the long-term average accuracy, Represents a constant, used to avoid division by zero errors; In step S4, guiding the network parameter update by migrating the operator, combining the current optimal parameters and the historical optimal parameters, and environmental feedback specifically includes the following sub-steps: S4021. Initialize network parameters, including weights and bias ; S4022. After each training step, evaluate the spatial positioning accuracy and pollutant type identification accuracy of the model; S4023. Identify the current step The optimal parameters and ; Collect historical optimal parameters and ; S4024. Update the network parameters through the migration operator according to the current correction factor, which is specifically expressed as: Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the correction factor, Indicates the current time step The optimal weight coefficient is represents the optimal weight of history, Indicates that at time step The bias, Indicates that at time step The optimal bias of The bias, represents the optimal bias of history, Represents the coefficient dynamically adjusted according to environmental feedback. Represents a coefficient that is dynamically adjusted based on historical data.

2. A method for accurately tracing the source of water pollution based on a neural network model as claimed in claim 1, characterized in that: In step S5, after the model generates a preliminary prediction result, it also includes optimizing the output through an enhancement mechanism of a feedback operator, which specifically includes the following sub-steps: S501. After the model performs forward propagation and generates a predicted output, the error between the predicted value and the actual value is calculated; S502. quantify the overall prediction performance of the model through a loss function; and calculate the gradient of the loss function with respect to the network parameters; S503. Adjust the gradient according to the correction factor to control the amplitude of parameter update; and update the weights and biases of the network according to the calculated gradient and correction factor; S504. Use the updated parameters for the next model prediction, forming a feedback loop until the model converges.

3. A method for accurately tracing the source of water pollution based on a neural network model as claimed in claim 2, characterized in that: In step S501, the error between the predicted value and the actual value is calculated as follows: ; Among them, the Represents the error value, represents the true value, Represents the model prediction value.

4. A method for accurately tracing the source of water pollution based on a neural network model as claimed in claim 2, characterized in that: In step S502, the gradient of the loss function with respect to the network parameters is calculated as follows: ; ; Among them, the Represents the gradient of the loss function with respect to the weight, represents the loss function, represents the partial derivative of the loss function, represents the partial derivative of the weight, Indicates that at time step The weight of Indicates that at time step The bias, Represents the gradient of the loss function with respect to the bias.

5. A method for accurately tracing the source of water pollution based on a neural network model as claimed in claim 2, characterized in that: In step S503, the gradient is adjusted according to the correction factor, and the amplitude of the control parameter update is specifically expressed as: ; Among them, the Represents the weight gradient after adjustment by the correction factor. represents the correction factor, Represents the gradient of the loss function with respect to the weight, Indicates that at time step The weight of represents the bias gradient after adjustment by the correction factor. Represents the gradient of the loss function with respect to the bias, Indicates that at time step The bias.

6. A method for accurately tracing the source of water pollution based on a neural network model as claimed in claim 2, characterized in that: In step S503, according to the calculated gradient and correction factor, the weight and bias of the network are updated as follows: ; Among them, the Indicates that at time step The weight of Indicates that at time step The weight of represents the learning rate, Represents the weight gradient after adjustment by the correction factor. Indicates that at time step The bias, represents the bias at the time step, Represents the bias gradient after adjustment by the correction factor.