Underground water quality monitoring method and system based on artificial intelligence

By using artificial intelligence-based multi-dimensional data processing and dynamic frequency adjustment methods in groundwater quality monitoring, the problems of incomplete data and resource waste in traditional monitoring methods are solved, the comprehensiveness and accuracy of monitoring are improved, and water quality prediction is enhanced ability.

CN119337330AInactive Publication Date: 2025-01-21LIAOCHENG YELLOW RIVER ENG BUREAU
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411898994.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional groundwater water quality monitoring methods have problems such as monitoring data that cannot fully reflect water quality changes, resource waste caused by fixed monitoring frequency, difficulty in fusion of multi-dimensional data, insufficient identification of feature importance, and insufficient fitting ability to complex water quality changes.

Method used

An artificial intelligence-based method is used to collect multi-dimensional water quality data, dynamically adjust the frequency of data acquisition, and use multi-dimensional data processing sub-models, feature weighted fusion methods based on attention mechanisms and water quality prediction activation functions to optimize hyperparameters to improve model performance.

Benefits of technology

It improves the comprehensiveness and accuracy of groundwater quality monitoring, optimizes resource allocation, improves monitoring efficiency and emergency response capabilities, and enhances the accuracy and stability of water quality prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337330A_ABST
    Figure CN119337330A_ABST
Patent Text Reader

Abstract

The invention discloses a groundwater quality monitoring method and system based on artificial intelligence. The method comprises the steps of data acquisition, data preprocessing, groundwater quality prediction, hyper-parameter optimization and dynamic groundwater quality monitoring. The invention belongs to the technical field of water quality information processing, and particularly relates to an underground water quality monitoring method and system based on artificial intelligence. According to the scheme, a method for collecting multi-dimensional water quality data and dynamically adjusting data acquisition frequency is creatively provided, and the comprehensiveness of underground water quality monitoring is effectively improved; a multi-dimensional data processing sub-model, a feature weighted fusion method based on an attention mechanism and a water quality prediction activation function are provided, and the accuracy and stability of an underground water quality prediction result are improved; an algorithm for obtaining the optimal parameters of the model is improved by adopting a uniform distribution sampling initialization method, a convergence control weight and a linear extension spiral strategy, an optimal parameter combination is obtained, the accuracy of a model output result is improved, and therefore the groundwater quality prediction result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water quality information processing, and specifically relates to a groundwater quality monitoring method and system based on artificial intelligence. Background Art

[0002] The groundwater quality monitoring method and system based on artificial intelligence collects, processes and analyzes groundwater quality monitoring data through artificial intelligence. The system uses intelligent analysis methods to evaluate the groundwater quality status in real time, accurately identify the trend of water quality changes, and timely warn of potential pollution risks, providing scientific decision-making support for water resources management and environmental protection, which is of great significance to groundwater resource protection and sustainable development of the ecological environment; however, there are problems in traditional groundwater quality monitoring methods, such as the inability of monitoring data to fully reflect water quality changes and the waste of resources caused by fixed monitoring frequencies; there are technical problems in existing water quality prediction models, such as difficulty in multi-dimensional data fusion, insufficient identification of feature importance, and insufficient ability to fit complex water quality changes; there are technical problems in existing models suitable for water quality prediction, such as improper settings of built-in parameters, which leads to inaccurate model output results. Summary of the invention

[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a groundwater quality monitoring method and system based on artificial intelligence. In view of the problems in traditional groundwater quality monitoring methods that monitoring data cannot fully reflect water quality changes and fixed monitoring frequency leads to resource waste, this solution creatively proposes a method for collecting multi-dimensional water quality data and dynamically adjusting data acquisition frequency, which effectively improves the comprehensiveness and accuracy of groundwater quality monitoring, can optimize resource allocation and improve monitoring efficiency, and enhances the emergency response capability of water quality monitoring, providing scientific support for environmental protection and groundwater resource management; in view of the technical problems in existing water quality prediction models such as difficulty in multi-dimensional data fusion, insufficient feature importance identification and insufficient ability to fit complex water quality changes, this The solution innovatively proposes a multi-dimensional data processing sub-model, a feature weighted fusion method based on the attention mechanism, and a water quality prediction activation function, which ensures the accurate capture and fusion of various water quality data features, automatically identifies the importance of multi-dimensional data, and enhances the ability to fit complex nonlinear changes in groundwater quality, thereby improving the accuracy and stability of groundwater quality prediction results; in view of the technical problem that the existing models suitable for water quality prediction have improper built-in parameter settings, resulting in inaccurate model output results, this solution adopts a uniformly distributed sampling initialization method, convergence control weights, and a linear expansion spiral strategy to improve the algorithm for obtaining the optimal model parameters, obtain the optimal parameter combination, and improve the accuracy of the model output results, so that the groundwater quality prediction results are more accurate.

[0004] The technical solution adopted by the present invention is as follows: The groundwater quality monitoring method based on artificial intelligence provided by the present invention comprises the following steps:

[0005] Step S1: data collection;

[0006] Step S2: data preprocessing;

[0007] Step S3: groundwater quality prediction;

[0008] Step S4: hyperparameter optimization;

[0009] Step S5: Dynamic groundwater quality monitoring.

[0010] Further, in step S1, the data collection is specifically to obtain water quality monitoring raw data from the local water management system by collection; the water quality monitoring raw data includes historical groundwater quality monitoring data and real-time groundwater quality monitoring data; the historical groundwater quality monitoring data and the real-time groundwater quality monitoring data both contain groundwater chemical index data, groundwater biological index data, groundwater spectral index data and environmental data; the historical groundwater quality monitoring data also includes groundwater quality prediction status; the groundwater quality prediction status includes normal state, light pollution state, moderate pollution state and severe pollution state; the groundwater chemical index data includes pH, conductivity, dissolved oxygen, turbidity and heavy metal concentration; the groundwater biological index data includes microbial species, microbial quantity and environmental DNA; the groundwater spectral index data includes spectral reflectance and spectral absorption peak; the environmental data includes regional characteristics and groundwater depth characteristics; the regional characteristics are divided into agricultural areas, industrial areas, urbanized areas and natural ecological areas; the groundwater depth characteristics are divided into shallow groundwater, middle groundwater and deep groundwater.

[0011] Furthermore, in step S2, the data preprocessing is used to perform data cleaning, standardization and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data; the data cleaning is to process missing values, outliers and duplicate values; the standardization is to standardize the data based on the maximum and minimum normalization method; the feature selection is to select features from the raw water quality monitoring data using a correlation analysis method.

[0012] Further, in step S3, the groundwater quality prediction includes establishing a water quality prediction model, training the water quality prediction model and real-time prediction of groundwater quality; specifically, the following steps are included:

[0013] Step S31: Establishing a water quality prediction model, specifically including the following steps:

[0014] Step S311: Initialize the sub-model internal architecture LSTM, the formula used is as follows:

[0015] ;

[0016] In the formula, represents the output of the forget gate, It indicates input data. Indicates the hidden state at the last moment. and They represent the weight matrices corresponding to the forget gate processing input data and processing hidden states, respectively. represents the bias parameter of the forget gate, represents the Sigmoid function, i t represents the output of the input gate, and They represent the weight matrices corresponding to the input gate processing input data and processing hidden states, respectively, and b i represents the bias parameter of the input gate, represents the candidate value of the new cell state, and Respectively represent the weight matrices corresponding to the cell state processing input data and processing hidden state, The bias parameter representing the cell state, It represents the cell state at the current moment. It indicates the cell state at the last moment. represents the output of the output gate, and They represent the weight matrices corresponding to the output gate processing input data and processing hidden states, respectively. represents the bias parameter of the output gate, Indicates the hidden state at the current moment, It is the hyperbolic tangent function;

[0017] Step S312: Calculate the sub-model output, specifically based on Three independent sub-models are established to process different types of time series data. Each sub-model has an independent weight matrix and bias term. The formula used is as follows:

[0018] ;

[0019] ;

[0020] ;

[0021] In the formula, Represents the hidden state of the chemical indicator at the current moment, which is the output feature of the chemical indicator sub-model. Represents the hidden state of the bio-indicator at the current moment, which is the output feature of the bio-indicator sub-model. Indicates the hidden state of the spectral index at the current moment, which is the output feature of the spectral index sub-model. Indicates the chemical index data input at the current moment, Indicates the biological indicator data input at the current moment, Indicates the spectral index data input at the current moment, Indicates the establishment of a chemical index sub-model based on LSTM. Represents the biological indicator sub-model based on LSTM, Represents the spectral index sub-model established based on LSTM;

[0022] Step S313: Perform feature fusion, specifically weighted fusion of these features through the attention mechanism, including the following steps:

[0023] Step S3131: Calculate the feature score using the following formula:

[0024] ;

[0025] ;

[0026] ;

[0027] In the formula, Indicates the feature scores of the corresponding chemical index features, biological index features and spectral index features, Indicates the characteristics of the corresponding region and groundwater depth characteristics The feature score of Indicates the regional characteristics in the preliminary water quality monitoring data, represents the groundwater depth characteristics in the preliminary water quality monitoring data, and represents the weight matrix corresponding to each feature, and represents the bias parameter corresponding to each feature, Indicates the corresponding chemical index characteristics, biological index characteristics and spectral index characteristics, Indicates the characteristics of the corresponding region and groundwater depth characteristics , represents the sum of all feature scores;

[0028] Step S3132: Calculate the attention weight using the following formula:

[0029] ;

[0030] ;

[0031] In the formula, represents the attention weights corresponding to the chemical index features, biological index features and spectral index features, Indicates the attention weights corresponding to regional characteristics and groundwater depth characteristics;

[0032] Step S3133: Final feature fusion, the formula used is as follows:

[0033] ;

[0034] In the formula, represents the final fusion feature;

[0035] Step S314: Design a water quality prediction activation function, the formula used is as follows:

[0036] ;

[0037] In the formula, represents the water quality prediction activation function, x represents the input variable of the water quality prediction activation function, represents the parameter that adjusts the shape of the activation function, Represents the smoothing factor, which is used to adjust the responsiveness of the output value;

[0038] Step S315: Calculate the predicted value of the model output layer using the following formula:

[0039] ;

[0040] In the formula, represents the output value of the model, represents the weight matrix of the output layer, Represents the bias parameter of the output layer;

[0041] Step S32: training a water quality prediction model, specifically using the historical groundwater quality monitoring data in the preliminary water quality monitoring data to train a water quality prediction model to obtain a trained water quality prediction model;

[0042] Step S33: Real-time prediction of groundwater quality, specifically, using the real-time groundwater quality monitoring data in the preliminary water quality monitoring data as input data of the trained water quality prediction model to obtain the real-time prediction status of groundwater quality.

[0043] Furthermore, in step S4, the hyperparameter optimization specifically includes the following steps:

[0044] Step S41: Initialize parameters, specifically construct the initial parameters of the algorithm; the initial parameters of the algorithm include the population size N and the maximum number of iterations ;

[0045] Step S42: Initialize the population, specifically use a uniform distribution sampling initialization method to initialize the search individuals, including the following steps:

[0046] Step S421: Generate N chaotic sequence values ​​and initialize the random value z0. The formula used is as follows:

[0047] ;

[0048] In the formula, represents the i+1th chaotic sequence value in the dth dimension, Indicates the random number offset;

[0049] Step S422: The chaotic sequence value is converted to search individuals. The formula is as follows:

[0050] ;

[0051] In the formula, represents the initialization position of the dth dimension of the i-th individual, lb d andub d Respectively represent the search lower and upper limits of dimension d, represents the i-th chaotic sequence value of the d-th dimension;

[0052] Step S43: Calculate the fitness value, specifically calculate the fitness value f of individuals in the population i ; The performance of the water quality prediction model established based on the individual position is used as the individual fitness value, and the individuals are sorted from best to worst according to the fitness value to obtain the individual position with the highest current global fitness value ;

[0053] Step S44: Calculate the location update weight using the following formula:

[0054] ;

[0055] In the formula, t represents the current number of iterations, represents the position update weight in the current iteration, Indicates the control smoothing factor, which is used to adjust the number of attenuation times;

[0056] Step S45: Calculate the convergence control weight, the formula used is as follows:

[0057] ;

[0058] In the formula, represents the convergence control weight in the current iteration, Represents the parameter that controls the decay rate, with a value between In the range, Represents the inverse function of the sine function;

[0059] Step S46: Update the searched individual location, specifically by updating the individual location through three actions: , then global search behavior is adopted. If , then local search behavior is adopted. If , then the linear expansion spiral strategy is used to update the position, and the formula used is as follows:

[0060] ;

[0061] ;

[0062] ;

[0063] ;

[0064] In the formula, represents the distance between the current search individual and the random search individual, Represents the distance between the current search individual and the optimal search individual, represents a random search individual, represents the d-th dimension position of the i-th individual in the t-th generation population, represents the position of the individual with the best fitness value in the population in the tth iteration on dimension d, and Indicates between A random number uniformly distributed in the range, represents the probability factor that controls the selection of the search strategy, and Determines the starting amplitude and growth rate of the spiral search, represents the parameters that control the shape of the spiral search, Indicates the d-th dimension position of the i-th individual in the t+1-th generation population;

[0065] Step S47: search determination, specifically, by constructing a search termination condition, performing search determination on the optimal individual position, and obtaining the optimal individual position data setting;

[0066] The search termination conditions include threshold termination and iteration termination;

[0067] The threshold termination is specifically to set the fitness threshold, when the individual fitness value f i When it is above the fitness threshold, the hyperparameter search is completed;

[0068] The iteration termination specifically refers to terminating the iteration and obtaining the optimal individual position when the maximum number of iterations is reached;

[0069] The optimal individual position includes a combination of water quality prediction model parameters.

[0070] Furthermore, in step S5, the dynamic groundwater quality monitoring is specifically based on the real-time predicted status of groundwater quality, identifies potential groundwater quality pollution risks, and dynamically adjusts the data acquisition frequency according to the real-time predicted status of groundwater quality. If the real-time predicted status of groundwater quality is abnormal, a water quality pollution warning is automatically triggered, and relevant monitoring personnel are notified in time. At the same time, the real-time groundwater quality monitoring data acquisition frequency is increased. If the real-time predicted status of groundwater quality is normal, the real-time groundwater quality monitoring data acquisition frequency is maintained.

[0071] The technical solution adopted by the present invention is as follows: the groundwater quality monitoring system based on artificial intelligence provided by the present invention includes a data acquisition module, a data preprocessing module, a groundwater quality prediction module, a hyperparameter optimization module and a dynamic groundwater quality monitoring module;

[0072] The data acquisition module obtains raw water quality monitoring data by collecting historical groundwater quality monitoring data and real-time groundwater quality monitoring data from the local water management system, and sends the raw water quality monitoring data to the data preprocessing module;

[0073] The data preprocessing module receives the data sent by the data acquisition module, and performs data cleaning, standardization processing and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data, and sends the preliminary water quality monitoring data to the groundwater quality prediction module;

[0074] The groundwater quality prediction module receives the preliminary water quality monitoring data sent by the data preprocessing module, and establishes a water quality prediction model to predict the groundwater quality in real time, obtains the real-time prediction status of the groundwater quality, and sends the real-time prediction status of the groundwater quality to the dynamic groundwater quality monitoring module;

[0075] The hyperparameter optimization module optimizes the parameter acquisition process of the water quality prediction model by establishing a search algorithm, obtains a water quality prediction model parameter combination, and sends the water quality prediction model parameter combination to the groundwater quality prediction module;

[0076] The dynamic groundwater quality monitoring module receives the results sent by the groundwater quality prediction module, identifies potential groundwater quality pollution risks based on the real-time prediction status of the groundwater quality, and dynamically adjusts the data acquisition frequency according to the real-time prediction status of the groundwater quality.

[0077] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0078] (1) In response to the problems in traditional groundwater quality monitoring methods, such as the inability of monitoring data to fully reflect water quality changes and the waste of resources caused by fixed monitoring frequencies, this scheme creatively proposes a method for collecting multi-dimensional water quality data and dynamically adjusting the frequency of data acquisition, which effectively improves the comprehensiveness and accuracy of groundwater quality monitoring, optimizes resource allocation and improves monitoring efficiency, and enhances the emergency response capability of water quality monitoring, providing scientific support for environmental protection and groundwater resource management.

[0079] (2) In order to address the technical problems of existing water quality prediction models, such as difficulty in fusing multidimensional data, insufficient identification of feature importance, and insufficient ability to fit complex water quality changes, this solution innovatively proposes a multidimensional data processing sub-model, a feature weighted fusion method based on an attention mechanism, and a water quality prediction activation function. This ensures the accurate capture and fusion of various water quality data features, automatically identifies the importance of data in multiple dimensions, and enhances the ability to fit complex nonlinear changes in groundwater quality, thereby improving the accuracy and stability of groundwater quality prediction results.

[0080] (3) In view of the technical problem that the existing models suitable for water quality prediction have improper built-in parameter settings, which leads to inaccurate model output results, this scheme adopts the uniform distribution sampling initialization method, convergence control weights and linear expansion spiral strategy to improve the algorithm for obtaining the optimal model parameters, obtain the optimal parameter combination, improve the accuracy of the model output results, and thus make the groundwater quality prediction results more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 A schematic diagram of the process of the groundwater quality monitoring method based on artificial intelligence provided by the present invention;

[0082] Figure 2 A schematic diagram of a module of a groundwater quality monitoring system based on artificial intelligence provided by the present invention;

[0083] Figure 3 This is a schematic diagram of the process of groundwater quality prediction in step S3;

[0084] Figure 4 A schematic diagram of the process of hyperparameter optimization in step S4;

[0085] Figure 5 A schematic diagram of a process for establishing a water quality prediction model in step S31;

[0086] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0087] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0088] In the description of the present invention, it is necessary to understand that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred system or element must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.

[0089] Example 1, see Figure 1 The present invention provides a method for monitoring groundwater quality based on artificial intelligence, which comprises the following steps:

[0090] Step S1: data collection, specifically, obtaining raw water quality monitoring data by collecting historical groundwater quality monitoring data and real-time groundwater quality monitoring data from the local water management system;

[0091] Step S2: data preprocessing, specifically, performing data cleaning, standardization processing and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data;

[0092] Step S3: groundwater quality prediction, specifically, predicting the groundwater quality in real time by establishing a water quality prediction model to obtain a real-time prediction status of the groundwater quality;

[0093] Step S4: hyperparameter optimization, specifically, optimizing the parameter acquisition process of the water quality prediction model by establishing a search algorithm to obtain a parameter combination of the water quality prediction model;

[0094] Step S5: Dynamic groundwater quality monitoring, specifically identifying potential groundwater quality pollution risks based on the real-time predicted status of groundwater quality, and dynamically adjusting the data acquisition frequency according to the real-time predicted status of groundwater quality.

[0095] Example 2, see Figure 1 and Figure 2This embodiment is based on the above embodiment. In step S1, the data collection is specifically to obtain the original water quality monitoring data from the local water management system through collection; the original water quality monitoring data includes historical groundwater quality monitoring data and real-time groundwater quality monitoring data; the historical groundwater quality monitoring data and real-time groundwater quality monitoring data both include groundwater chemical index data, groundwater biological index data, groundwater spectral index data and environmental data; the historical groundwater quality monitoring data also includes groundwater quality prediction status; the groundwater quality prediction status includes normal state, slightly polluted state, moderately polluted state and severely polluted state; the groundwater chemical indicator data include pH, conductivity, dissolved oxygen, turbidity and heavy metal concentration; the groundwater biological indicator data include microbial species, microbial quantity and environmental DNA; the groundwater spectral indicator data include spectral reflectance and spectral absorption peak; the environmental data include regional characteristics and groundwater depth characteristics; the regional characteristics are divided into agricultural areas, industrial areas, urbanized areas and natural ecological areas; the groundwater depth characteristics are divided into shallow groundwater, middle groundwater and deep groundwater.

[0096] Example 3, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S2, the data preprocessing is used to perform data cleaning, standardization and feature selection on the original water quality monitoring data to obtain preliminary water quality monitoring data; the data cleaning is to process missing values, abnormal values ​​and duplicate values; the standardization is to standardize the data based on the maximum and minimum normalization method; the feature selection is to use the correlation analysis method to select features from the original water quality monitoring data.

[0097] Example 4, see Figure 1 , Figure 2 , Figure 3 and Figure 5 This embodiment is based on the above embodiment. In step S3, the groundwater quality prediction includes establishing a water quality prediction model, training the water quality prediction model and real-time prediction of groundwater quality; specifically, the following steps are included:

[0098] Step S31: Establishing a water quality prediction model, specifically including the following steps:

[0099] Step S311: Initialize the sub-model internal architecture LSTM, the formula used is as follows:

[0100] ;

[0101] In the formula, represents the output of the forget gate, It indicates input data. Indicates the hidden state at the last moment. and They represent the weight matrices corresponding to the forget gate processing input data and processing hidden states, respectively. represents the bias parameter of the forget gate, represents the Sigmoid function, i t represents the output of the input gate, and They represent the weight matrices corresponding to the input gate processing input data and processing hidden states, respectively, and b i represents the bias parameter of the input gate, represents the candidate value of the new cell state, and Respectively represent the weight matrices corresponding to the cell state processing input data and processing hidden state, The bias parameter representing the cell state, Indicates the current cell state. It indicates the cell state at the last moment. represents the output of the output gate, and They represent the weight matrices corresponding to the output gate processing input data and processing hidden states, respectively. represents the bias parameter of the output gate, Indicates the hidden state at the current moment, It is the hyperbolic tangent function;

[0102] Step S312: Calculate the sub-model output, specifically based on Three independent sub-models are established to process different types of time series data. Each sub-model has an independent weight matrix and bias term. The formula used is as follows:

[0103] ;

[0104] ;

[0105] ;

[0106] In the formula, Represents the hidden state of the chemical indicator at the current moment, which is the output feature of the chemical indicator sub-model. Represents the hidden state of the bio-indicator at the current moment, which is the output feature of the bio-indicator sub-model. Indicates the hidden state of the spectral index at the current moment, which is the output feature of the spectral index sub-model. Indicates the chemical index data input at the current moment, Indicates the biological indicator data input at the current moment, Indicates the spectral index data input at the current moment, Indicates the establishment of a chemical index sub-model based on LSTM. Represents the biological indicator sub-model based on LSTM, Represents the spectral index sub-model established based on LSTM;

[0107] Step S313: Perform feature fusion, specifically weighted fusion of these features through the attention mechanism, including the following steps:

[0108] Step S3131: Calculate the feature score using the following formula:

[0109] ;

[0110] ;

[0111] ;

[0112] In the formula, Indicates the feature scores of the corresponding chemical index features, biological index features and spectral index features, Indicates the characteristics of the corresponding region and groundwater depth characteristics The feature score of Indicates the regional characteristics in the preliminary water quality monitoring data, represents the groundwater depth characteristics in the preliminary water quality monitoring data, and represents the weight matrix corresponding to each feature, and represents the bias parameter corresponding to each feature, Indicates the corresponding chemical index characteristics, biological index characteristics and spectral index characteristics, Indicates the characteristics of the corresponding region and groundwater depth characteristics , represents the sum of all feature scores;

[0113] Step S3132: Calculate the attention weight using the following formula:

[0114] ;

[0115] ;

[0116] In the formula, represents the attention weights corresponding to the chemical index features, biological index features and spectral index features, Indicates the attention weights corresponding to regional characteristics and groundwater depth characteristics;

[0117] Step S3133: Final feature fusion, the formula used is as follows:

[0118] ;

[0119] In the formula, represents the final fusion feature;

[0120] Step S314: Design a water quality prediction activation function, the formula used is as follows:

[0121] ;

[0122] In the formula, represents the water quality prediction activation function, x represents the input variable of the water quality prediction activation function, represents the parameter that adjusts the shape of the activation function, Represents the smoothing factor, which is used to adjust the responsiveness of the output value;

[0123] Step S315: Calculate the predicted value of the model output layer using the following formula:

[0124] ;

[0125] In the formula, represents the output value of the model, represents the weight matrix of the output layer, Represents the bias parameter of the output layer;

[0126] Step S32: training a water quality prediction model, specifically using the historical groundwater quality monitoring data in the preliminary water quality monitoring data to train a water quality prediction model to obtain a trained water quality prediction model;

[0127] Step S33: Real-time prediction of groundwater quality, specifically, using the real-time groundwater quality monitoring data in the preliminary water quality monitoring data as input data of the trained water quality prediction model to obtain the real-time prediction status of groundwater quality.

[0128] By performing the above operations, this solution innovatively proposes a multidimensional data processing sub-model, a feature weighted fusion method based on the attention mechanism, and a water quality prediction activation function to address the technical problems of existing water quality prediction models, such as difficulty in multidimensional data fusion, insufficient identification of feature importance, and insufficient ability to fit complex water quality changes. This ensures the accurate capture and fusion of various water quality data features, automatically identifies the importance of data in multiple dimensions, and enhances the ability to fit complex nonlinear changes in groundwater quality, thereby improving the accuracy and stability of groundwater quality prediction results.

[0129] Example 5, see Figure 1 , Figure 2 and Figure 4 This embodiment is based on the above embodiment. In step S4, the hyperparameter optimization specifically includes the following steps:

[0130] Step S41: Initialize parameters, specifically construct the initial parameters of the algorithm; the initial parameters of the algorithm include the population size N and the maximum number of iterations ;

[0131] Step S42: Initialize the population, specifically use a uniform distribution sampling initialization method to initialize the search individuals, including the following steps:

[0132] Step S421: Generate N chaotic sequence values ​​and initialize the random value z0. The formula used is as follows:

[0133] ;

[0134] In the formula, represents the i+1th chaotic sequence value in the dth dimension, Indicates the random number offset;

[0135] Step S422: The chaotic sequence value is converted to search individuals. The formula is as follows:

[0136] ;

[0137] In the formula, represents the initialization position of the dth dimension of the i-th individual, lb d andub d Respectively represent the search lower and upper limits of dimension d, represents the i-th chaotic sequence value of the d-th dimension;

[0138] Step S43: Calculate the fitness value, specifically calculate the fitness value f of individuals in the population i ; The performance of the water quality prediction model established based on the individual position is used as the individual fitness value, and the individuals are sorted from best to worst according to the fitness value to obtain the individual position with the highest current global fitness value ;

[0139] Step S44: Calculate the location update weight using the following formula:

[0140] ;

[0141] In the formula, t represents the current number of iterations, represents the position update weight in the current iteration, Indicates the control smoothing factor, which is used to adjust the number of attenuation times;

[0142] Step S45: Calculate the convergence control weight, the formula used is as follows:

[0143] ;

[0144] In the formula, represents the convergence control weight in the current iteration, Represents the parameter that controls the decay rate, with a value between In the range, Represents the inverse function of the sine function;

[0145] Step S46: Update the searched individual location, specifically by updating the individual location through three actions: , then global search behavior is adopted. If , then local search behavior is adopted. If , then the linear expansion spiral strategy is used to update the position, and the formula used is as follows:

[0146] ;

[0147] ;

[0148] ;

[0149] ;

[0150] In the formula, represents the distance between the current search individual and the random search individual, Represents the distance between the current search individual and the optimal search individual, represents a random search individual, represents the d-th dimension position of the i-th individual in the t-th generation population, represents the position of the individual with the best fitness value in the population in the tth iteration on dimension d, and Indicates between A random number uniformly distributed in the range, represents the probability factor that controls the selection of the search strategy, and Determines the starting amplitude and growth rate of the spiral search, represents the parameters that control the shape of the spiral search, Indicates the d-th dimension position of the i-th individual in the t+1-th generation population;

[0151] Step S47: search determination, specifically, by constructing a search termination condition, performing search determination on the optimal individual position, and obtaining the optimal individual position data setting;

[0152] The search termination conditions include threshold termination and iteration termination;

[0153] The threshold termination is specifically to set the fitness threshold, when the individual fitness value f i When it is above the fitness threshold, the hyperparameter search is completed;

[0154] The iteration termination specifically refers to terminating the iteration and obtaining the optimal individual position when the maximum number of iterations is reached;

[0155] The optimal individual position includes a combination of water quality prediction model parameters.

[0156] By performing the above operations, in view of the technical problem that the existing models suitable for water quality prediction have improper built-in parameter settings, resulting in inaccurate model output results, this solution adopts a uniform distribution sampling initialization method, convergence control weights and a linear expansion spiral strategy to improve the algorithm for obtaining the optimal model parameters, obtain the optimal parameter combination, and improve the accuracy of the model output results, so that the groundwater quality prediction results are more accurate.

[0157] Example 6, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S5, the dynamic groundwater quality monitoring is specifically based on the real-time prediction status of the groundwater quality, identifies potential groundwater quality pollution risks, and dynamically adjusts the data acquisition frequency according to the real-time prediction status of the groundwater quality. If the real-time prediction status of the groundwater quality is abnormal, a water quality pollution warning is automatically triggered, and relevant monitoring personnel are notified in time. At the same time, the real-time groundwater quality monitoring data acquisition frequency is increased. If the real-time prediction status of the groundwater quality is normal, the real-time groundwater quality monitoring data acquisition frequency is maintained.

[0158] By performing the above operations, this solution creatively proposes a method of collecting multi-dimensional water quality data and dynamically adjusting the data acquisition frequency to address the problems in traditional groundwater quality monitoring methods, such as the inability of monitoring data to fully reflect water quality changes and the waste of resources caused by fixed monitoring frequencies. This method effectively improves the comprehensiveness and accuracy of groundwater quality monitoring, optimizes resource allocation and improves monitoring efficiency, and enhances the emergency response capabilities of water quality monitoring, providing scientific support for environmental protection and groundwater resource management.

[0159] Embodiment 7, see Figure 1 and Figure 2 , this embodiment is based on the above embodiment, and the groundwater quality monitoring system based on artificial intelligence provided by the present invention includes a data acquisition module, a data preprocessing module, a groundwater quality prediction module, a hyperparameter optimization module and a dynamic groundwater quality monitoring module;

[0160] The data acquisition module obtains raw water quality monitoring data by collecting historical groundwater quality monitoring data and real-time groundwater quality monitoring data from the local water management system, and sends the raw water quality monitoring data to the data preprocessing module;

[0161] The data preprocessing module receives the data sent by the data acquisition module, and performs data cleaning, standardization processing and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data, and sends the preliminary water quality monitoring data to the groundwater quality prediction module;

[0162] The groundwater quality prediction module receives the preliminary water quality monitoring data sent by the data preprocessing module, and establishes a water quality prediction model to predict the groundwater quality in real time, obtains the real-time prediction status of the groundwater quality, and sends the real-time prediction status of the groundwater quality to the dynamic groundwater quality monitoring module;

[0163] The hyperparameter optimization module optimizes the parameter acquisition process of the water quality prediction model by establishing a search algorithm, obtains a water quality prediction model parameter combination, and sends the water quality prediction model parameter combination to the groundwater quality prediction module;

[0164] The dynamic groundwater quality monitoring module receives the results sent by the groundwater quality prediction module, identifies potential groundwater quality pollution risks based on the real-time prediction status of the groundwater quality, and dynamically adjusts the data acquisition frequency according to the real-time prediction status of the groundwater quality.

[0165] It should be noted that, in this article, relational terms such as first and second, etc. 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. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0166] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.

[0167] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A groundwater quality monitoring method based on artificial intelligence, characterized in that: The method comprises the following steps: Step S1: data collection, specifically, collecting historical groundwater quality monitoring data and real-time groundwater quality monitoring data from the local water management system, wherein the historical groundwater quality monitoring data and the real-time groundwater quality monitoring data both contain groundwater chemical index data, groundwater biological index data, groundwater spectral index data and environmental data, to obtain water quality monitoring raw data; Step S2: data preprocessing, specifically, performing data cleaning, standardization processing and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data; Step S3: groundwater quality prediction, specifically, establishing a water quality prediction model and training the model through a multidimensional data processing sub-model, a feature weighted fusion method based on an attention mechanism, and a water quality prediction activation function, and inputting real-time groundwater quality monitoring data into the trained prediction model to obtain a real-time prediction status of groundwater quality; Step S4: Hyperparameter optimization, specifically, improving the algorithm for obtaining the optimal parameters of the model by adopting a uniform distribution sampling initialization method, convergence control weights, and a linear expansion spiral strategy, and obtaining a combination of water quality prediction model parameters; Step S5: Dynamic groundwater quality monitoring, specifically identifying potential groundwater quality pollution risks based on the real-time predicted status of groundwater quality, and dynamically adjusting the data acquisition frequency according to the real-time predicted status of groundwater quality.

2. The method for monitoring groundwater quality based on artificial intelligence according to claim 1, characterized in that: In step S3, the groundwater quality prediction includes establishing a water quality prediction model, training the water quality prediction model and real-time prediction of groundwater quality; specifically, the following steps are included: Step S31: Establishing a water quality prediction model, specifically including the following steps: Step S311: Initialize the sub-model internal architecture LSTM, the formula used is as follows: ; In the formula, represents the output of the forget gate, It indicates input data. Indicates the hidden state at the last moment. and They represent the weight matrices corresponding to the forget gate processing input data and processing hidden states, respectively. represents the bias parameter of the forget gate, represents the Sigmoid function, i t represents the output of the input gate, and They represent the weight matrices corresponding to the input gate processing input data and processing hidden states, respectively, and b i represents the bias parameter of the input gate, represents the candidate value of the new cell state, and Respectively represent the weight matrices corresponding to the cell state processing input data and processing hidden state, The bias parameter representing the cell state, Indicates the current cell state. It indicates the cell state at the last moment. represents the output of the output gate, and They represent the weight matrices corresponding to the output gate processing input data and processing hidden states, respectively. represents the bias parameter of the output gate, Indicates the hidden state at the current moment, It is the hyperbolic tangent function; Step S312: Calculate the sub-model output, specifically based on Three independent sub-models are established to process different types of time series data. Each sub-model has an independent weight matrix and bias term. The formula used is as follows: ; ; ; In the formula, Represents the hidden state of the chemical indicator at the current moment, which is the output feature of the chemical indicator sub-model. Represents the hidden state of the bio-indicator at the current moment, which is the output feature of the bio-indicator sub-model. Indicates the hidden state of the spectral index at the current moment, which is the output feature of the spectral index sub-model. Indicates the chemical index data input at the current moment, Indicates the biological indicator data input at the current moment, Indicates the spectral index data input at the current moment, Indicates the establishment of a chemical index sub-model based on LSTM. Represents the biological indicator sub-model based on LSTM, Represents the spectral index sub-model established based on LSTM; Step S313: Perform feature fusion, specifically weighted fusion of features through an attention mechanism, including the following steps: Step S3131: Calculate the feature score using the following formula: ; ; ; In the formula, Indicates the feature scores of the corresponding chemical index features, biological index features and spectral index features, Indicates the corresponding regional characteristics and groundwater depth characteristics The feature score of Indicates the regional characteristics of the preliminary water quality monitoring data, represents the groundwater depth characteristics in the preliminary water quality monitoring data, and represents the weight matrix corresponding to each feature, and represents the bias parameter corresponding to each feature, Indicates the corresponding chemical index characteristics, biological index characteristics and spectral index characteristics, Indicates the corresponding regional characteristics and groundwater depth characteristics , represents the sum of all feature scores; Step S3132: Calculate the attention weight using the following formula: ; ; In the formula, represents the attention weights corresponding to the chemical index features, biological index features and spectral index features, Indicates the attention weights corresponding to regional characteristics and groundwater depth characteristics; Step S3133: Final feature fusion, the formula used is as follows: ; In the formula, represents the final fusion feature; Step S314: Design a water quality prediction activation function, the formula used is as follows: ; In the formula, represents the water quality prediction activation function, x represents the input variable of the water quality prediction activation function, represents the parameter that adjusts the shape of the activation function, Represents the smoothing factor, which is used to adjust the responsiveness of the output value; Step S315: Calculate the predicted value of the model output layer using the following formula: ; In the formula, represents the output value of the model, represents the weight matrix of the output layer, Represents the bias parameter of the output layer; Step S32: training a water quality prediction model, specifically using the historical groundwater quality monitoring data in the preliminary water quality monitoring data to train a water quality prediction model to obtain a trained water quality prediction model; Step S33: Real-time prediction of groundwater quality, specifically, using the real-time groundwater quality monitoring data in the preliminary water quality monitoring data as input data of the trained water quality prediction model to obtain the real-time prediction status of groundwater quality.

3. The method for monitoring groundwater quality based on artificial intelligence according to claim 1, characterized in that: In step S4, the hyperparameter optimization specifically includes the following steps: Step S41: Initialize parameters, specifically construct the initial parameters of the algorithm; the initial parameters of the algorithm include the population size N and the maximum number of iterations ; Step S42: Initialize the population, specifically use a uniform distribution sampling initialization method to initialize the search individuals, including the following steps: Step S421: Generate N chaotic sequence values ​​and initialize the random value z0. The formula used is as follows: ; In the formula, represents the i+1th chaotic sequence value in the dth dimension, Indicates the random number offset; Step S422: The chaotic sequence value is converted to search individuals. The formula is as follows: ; In the formula, represents the initialization position of the dth dimension of the i-th individual, lb d andub d Respectively represent the search lower and upper limits of dimension d, represents the i-th chaotic sequence value of the d-th dimension; Step S43: Calculate the fitness value, specifically calculate the fitness value f of individuals in the population i ; The performance of the water quality prediction model established based on the individual position is used as the individual fitness value, and the individuals are sorted from best to worst according to the fitness value to obtain the individual position with the highest current global fitness value ; Step S44: Calculate the location update weight using the following formula: ; In the formula, t represents the current number of iterations, represents the position update weight in the current iteration, Indicates the control smoothing factor, which is used to adjust the number of attenuation times; Step S45: Calculate the convergence control weight, the formula used is as follows: ; In the formula, represents the convergence control weight in the current iteration, Represents the parameter that controls the decay rate, with a value between Within the range, Represents the inverse function of the sine function; Step S46: Update the searched individual location, specifically by updating the individual location through three actions: , then global search behavior is adopted. If , then local search behavior is adopted. If , then the linear expansion spiral strategy is used to update the position, and the formula used is as follows: ; ; ; ; In the formula, represents the distance between the current search individual and the random search individual, Represents the distance between the current search individual and the optimal search individual, represents a random search individual, represents the d-th dimension position of the i-th individual in the t-th generation population, represents the position of the individual with the best fitness value in the population in the tth iteration on dimension d, and Indicates between A random number uniformly distributed in the range, represents the probability factor that controls the selection of the search strategy, and Determines the starting amplitude and growth rate of the spiral search, represents the parameters that control the shape of the spiral search, Indicates the d-th dimension position of the i-th individual in the t+1-th generation population; Step S47: search determination, specifically, by constructing a search termination condition, performing search determination on the optimal individual position, and obtaining the optimal individual position data setting; The search termination conditions include threshold termination and iteration termination; The threshold termination is specifically to set the fitness threshold, when the individual fitness value f i When it is above the fitness threshold, the hyperparameter search is completed; The iteration termination specifically refers to terminating the iteration and obtaining the optimal individual position when the maximum number of iterations is reached; The optimal individual position includes a combination of water quality prediction model parameters.

4. The method for monitoring groundwater quality based on artificial intelligence according to claim 1, characterized in that: In step S5, the dynamic groundwater quality monitoring is specifically based on the real-time predicted state of groundwater quality, identifies potential groundwater quality pollution risks, and dynamically adjusts the data acquisition frequency according to the real-time predicted state of groundwater quality. If the real-time predicted state of groundwater quality is abnormal, a water quality pollution warning is automatically triggered, and relevant monitoring personnel are notified in time. At the same time, the real-time groundwater quality monitoring data acquisition frequency is increased. If the real-time predicted state of groundwater quality is normal, the real-time groundwater quality monitoring data acquisition frequency is maintained.

5. The method for monitoring groundwater quality based on artificial intelligence according to claim 1, characterized in that: In step S1, the data collection is specifically to obtain the original water quality monitoring data from the local water management system by collecting; the original water quality monitoring data includes historical groundwater quality monitoring data and real-time groundwater quality monitoring data; the historical groundwater quality monitoring data and real-time groundwater quality monitoring data both include groundwater chemical index data, groundwater biological index data, groundwater spectral index data and environmental data; the historical groundwater quality monitoring data also includes groundwater quality prediction status; the groundwater quality prediction status includes normal state, light pollution state, moderate pollution state and severe pollution state; the groundwater chemical index data includes pH, conductivity, dissolved oxygen, turbidity and heavy metal concentration; the groundwater biological index data includes microbial species, microbial quantity and environmental DNA; the groundwater spectral index data includes spectral reflectance and spectral absorption peak; the environmental data includes regional characteristics and groundwater depth characteristics; The regional characteristics are divided into agricultural areas, industrial areas, urbanized areas and natural ecological areas; the groundwater depth characteristics are divided into shallow groundwater, middle groundwater and deep groundwater.

6. The method for monitoring groundwater quality based on artificial intelligence according to claim 1, characterized in that: In step S2, the data preprocessing is used to perform data cleaning, standardization and feature selection on the raw data of water quality monitoring to obtain preliminary data of water quality monitoring; the data cleaning is to process missing values, abnormal values ​​and duplicate values; the standardization is to standardize the data based on the maximum and minimum normalization method; The feature selection is to select features from the original data of water quality monitoring using a correlation analysis method.

7. An artificial intelligence-based groundwater quality monitoring system, used to implement the artificial intelligence-based groundwater quality monitoring method as described in any one of claims 1 to 6, characterized in that: It includes data acquisition module, data preprocessing module, groundwater quality prediction module, hyperparameter optimization module and dynamic groundwater quality monitoring module.

8. The groundwater quality monitoring system based on artificial intelligence according to claim 7 is characterized by: The data acquisition module obtains raw water quality monitoring data by collecting historical groundwater quality monitoring data and real-time groundwater quality monitoring data from the local water management system, and sends the raw water quality monitoring data to the data preprocessing module; The data preprocessing module receives the data sent by the data acquisition module, and performs data cleaning, standardization processing and feature selection on the raw water quality monitoring data to obtain preliminary water quality monitoring data, and sends the preliminary water quality monitoring data to the groundwater quality prediction module; The groundwater quality prediction module receives the preliminary water quality monitoring data sent by the data preprocessing module, and establishes a water quality prediction model to predict the groundwater quality in real time, obtains the real-time prediction status of the groundwater quality, and sends the real-time prediction status of the groundwater quality to the dynamic groundwater quality monitoring module; The hyperparameter optimization module optimizes the parameter acquisition process of the water quality prediction model by establishing a search algorithm, obtains a water quality prediction model parameter combination, and sends the water quality prediction model parameter combination to the groundwater quality prediction module; The dynamic groundwater quality monitoring module receives the results sent by the groundwater quality prediction module, identifies potential groundwater quality pollution risks based on the real-time prediction status of the groundwater quality, and dynamically adjusts the data acquisition frequency according to the real-time prediction status of the groundwater quality.

Citation Information

Cited By

  • Water pollutant concentration intelligent detection system and detection method thereof

    CN119881257A

  • Gas-liquid interface accurate positioning method based on artificial intelligence

    CN120388073A