Prediction model construction method, method for detecting groundwater pathogenic microorganisms and computer program product

By constructing a prediction model of biological characteristics, volume and detection sensitivity, the problem of insufficient detection accuracy of groundwater microorganisms in different regions and rainfall conditions is solved, and accurate microbial detection and adaptive detection method selection are achieved.

CN118657232AActive Publication Date: 2024-09-17SHENZHEN SHENGRUN ENG CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410980657.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-09-17
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

Groundwater microbial detection under different regions and rainfall conditions is difficult to meet detection accuracy requirements, and is affected by the adaptability of microorganisms to environmental changes and the uncertainty of volume changes.

Method used

Construct prediction models, including biological characteristics prediction models, microbial volume prediction models and detection sensitivity prediction models, and use machine learning algorithms (such as support vector machines, multi-layer perceptrons and random forests) to predict microbial species based on groundwater chemical property parameters and microbial data. , biological characteristics and detection difficulty, determine the appropriate detection method.

Benefits of technology

It ensures that the detection of groundwater pathogenic microorganisms in different regions and rainfall conditions can meet the accuracy requirements, improves the accuracy and adaptability of detection, and appropriately selects plate culture method or polymerase chain reaction detection method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657232A
    Figure CN118657232A
Patent Text Reader

Abstract

The invention discloses a prediction model construction method, a method for detecting pathogenic microorganisms in underground water and a computer program product. The construction method comprises the following steps: collecting chemical property parameters of each underground water under various rainfall conditions, types of pathogenic microorganisms in the water, biological characteristic data and volume data of the pathogenic microorganisms, and detection sensitivity data corresponding to various microorganisms under various volumes; and respectively executing the biological characteristic prediction model construction training step, the biological volume prediction model construction training step and the detection sensitivity prediction model construction training step to obtain a trained biological characteristic prediction model, a trained microorganism volume prediction model and a trained detection sensitivity prediction model. According to the invention, the biological characteristic data, the volume data and the detection sensitivity of the microorganisms can be predicted by using the three prediction models so as to determine the detection mode of the microorganisms, and the detection of the pathogenic microorganisms in underground water under different rainfall conditions in different regions can meet the detection precision requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of groundwater pathogenic microorganism detection, and in particular to a prediction model construction method for groundwater pathogenic microorganism detection, a method for groundwater pathogenic microorganism detection and a computer program product. Background Art

[0002] Rainfall activities can affect the changes in chemical parameters of groundwater, such as pH value, conductivity and dissolved oxygen. According to the paper "Behavior Analysis of Bacteria in Long-term Storage Water" (Long Tengrui, Xie Chaoxin, Fang Zhendong), changes in groundwater chemical parameters will directly affect the biological characteristics of microorganisms, such as activity, reproduction rate and metabolic rate, and changes in the biological characteristics of microorganisms will lead to changes in the volume of microorganisms. The quality of groundwater is closely related to the types and number of pathogenic microorganisms it contains. Pathogenic microorganisms in groundwater are usually tested to analyze the quality of groundwater. The industry uses a unified detection method to detect pathogenic microorganisms in groundwater after different rainfall conditions in different regions. Due to different rainfall activities in different regions, frequencies / intensities / times (i.e., different rainfall conditions) have different effects on groundwater chemical parameters, and different types of microorganisms have different adaptability to environmental changes, there is a large uncertainty in the microbial response to environmental changes, which makes the change in microbial volume also have a large uncertainty. The size of the microorganism will affect the detection difficulty and detection accuracy of the microorganism. The same type of microorganism may need to adopt different detection methods at different volumes to make the detection results meet the required detection accuracy. Using a unified testing method to detect pathogenic microorganisms in groundwater in different regions that have experienced different rainfall conditions may not meet the detection accuracy requirements. Summary of the invention

[0003] The technical problem to be solved by the present invention is how to ensure that groundwater microbial detection under different rainfall conditions in different regions can meet the detection accuracy requirements.

[0004] In order to solve the above technical problems, the present invention provides a method for constructing a prediction model for detecting pathogenic microorganisms in groundwater, comprising the following steps: S1. For each of the multiple groundwaters in different regions, perform the following data collection steps: ——S11. Collect the chemical property parameters of the groundwater under various rainfall conditions, the types of pathogenic microorganisms in the water and their biological characteristics, and the volume data of various pathogenic microorganisms in the water; ——S12, collect the detection sensitivity data corresponding to various pathogenic microorganisms at various volumes; S2. Execute the following biological characteristic prediction model construction training steps to obtain a trained biological characteristic prediction model: ——S21, taking the chemical property parameters of groundwater under a certain rainfall condition as input, taking the microbial species and biological characteristic data of the groundwater under the rainfall condition as output, a set of biological characteristic training samples is formed, and multiple sets of such biological characteristic training samples are constructed accordingly; ——S22, using machine learning algorithms to build a biological characteristic prediction model, and training the biological characteristic prediction model through the above-mentioned multiple groups of biological characteristic training samples, so that it has the ability to identify groundwater chemical property parameters to obtain microbial species and their biological characteristic data; S3, executing the following microbial volume prediction model construction training steps to obtain a trained microbial volume prediction model: ——S31, taking the biological characteristic data of a pathogenic microorganism in groundwater under a certain rainfall condition as input, and taking the volume data of the microorganism in the groundwater under the certain rainfall condition as output, a set of microorganism volume training samples is formed, and multiple sets of such microorganism volume training samples are constructed accordingly; ——S32, using a machine learning algorithm to construct a microbial volume prediction model, the above-mentioned multiple groups of microbial volume training samples are used to train the microbial volume prediction model so that it has the ability to identify the biological characteristic data of microorganisms to obtain microbial volume data; S4. Execute the following detection sensitivity prediction model construction training steps to obtain a trained detection sensitivity prediction model: ——S41, taking a volume data of a microorganism as input and taking the detection sensitivity of the microorganism under the volume data as output, a set of detection sensitivity training samples is formed, and multiple sets of such detection sensitivity training samples are constructed accordingly; ——S42. Use machine learning algorithm to build a detection sensitivity prediction model, and train the detection sensitivity prediction model through the above-mentioned multiple groups of detection sensitivity training samples to enable it to have the ability to identify microbial volume data and derive its detection sensitivity.

[0005] Furthermore, step S22 of the prediction model construction method specifically uses a support vector machine algorithm to construct a biological characteristic prediction model.

[0006] Further: In step S2, before executing the biological property prediction model construction training step, the correlation coefficient between each chemical property parameter of groundwater and the biological property data of microorganisms is calculated using the Pearson correlation coefficient and / or the Spearman rank correlation coefficient, and a significance test is performed on each calculated correlation coefficient, and the chemical property parameter that has a significant impact on the biological property data of microorganisms is selected according to the significance test result; In step S21, the chemical property parameters of groundwater at a certain location that have a significant impact on the biological characteristic data of microorganisms under a certain rainfall condition are specifically taken as input.

[0007] Furthermore, step S32 specifically uses a multi-layer perceptron neural network to construct a microbial volume prediction model.

[0008] Furthermore, step S42 specifically uses a random forest algorithm to construct a detection sensitivity prediction model.

[0009] Further: In step S4, before executing the detection sensitivity prediction model construction training step, the microbial volume features that are highly correlated with the detection sensitivity are screened out through correlation analysis and recorded as high-correlation volume features; In step S41, a highly correlated volume feature of a volume of a microorganism is used as input.

[0010] Further, groundwater chemical property parameters include pH, conductivity and dissolved oxygen, and / or biological property data include activity, reproduction rate and metabolic rate.

[0011] The present invention also provides a method for detecting pathogenic microorganisms in groundwater, comprising the following steps: S5, obtaining the current chemical property parameters of groundwater at a location, inputting the chemical property parameters of the groundwater at the location into the biological property prediction model trained in step S2 in the above-mentioned prediction model construction method, and using the biological property prediction model to obtain the types of pathogenic microorganisms and their biological property data of the groundwater at the location according to the chemical property parameters of the groundwater at the location; S6, inputting the biological characteristic data of various pathogenic microorganisms obtained in step S5 into the microbial volume prediction model trained in step S3 in the above-mentioned prediction model construction method, and using the microbial volume prediction model to obtain the volume data of various pathogenic microorganisms of the groundwater according to the biological characteristic data of various pathogenic microorganisms; S7, inputting the volume data of various pathogenic microorganisms obtained in step S6 into the detection sensitivity prediction model trained in step S4 in the above-mentioned prediction model construction method, and using the detection sensitivity prediction model to obtain the detection sensitivity of various pathogenic microorganisms of the groundwater according to the volume data of various pathogenic microorganisms, and thereby obtain the detection difficulty of various pathogenic microorganisms, and the detection sensitivity is negatively correlated with the detection difficulty; S8. For each pathogenic microorganism in the groundwater obtained in step S5, if the detection difficulty is lower than the preset difficulty threshold, the plate culture method is used to detect the pathogenic microorganism in the groundwater; otherwise, the polymerase chain reaction method is used to detect the pathogenic microorganism in the groundwater.

[0012] Furthermore, in step S5, if the predicted number of pathogenic microorganisms exceeds a preset number, an early warning is triggered.

[0013] The present invention also provides a computer program product, including a computer program, which is executed by a processor to implement the above-mentioned method for constructing a prediction model for detecting pathogenic microorganisms in groundwater, or to implement the above-mentioned method for detecting pathogenic microorganisms in groundwater.

[0014] The prediction model construction method provided by the present invention uses steps S1 to S4 to pre-construct a trained biological characteristic prediction model, a microbial volume prediction model, and a detection sensitivity prediction model. The method for detecting groundwater pathogenic microorganisms provided by the present invention uses the above three prediction models to detect groundwater pathogenic microorganisms. Specifically: step S5 predicts the biological characteristic data of various types of pathogenic microorganisms through the biological characteristic prediction model, step S6 predicts the volume data of various types of pathogenic microorganisms through the microbial volume prediction model, step S7 predicts the detection sensitivity of various microorganisms and obtains the detection difficulty of various microorganisms based on this, and finally step S8 determines which detection method to take to detect the microorganism based on the detection difficulty of various microorganisms. It can be seen that the present invention can predict the volume of various microorganisms in water according to the current chemical property parameters of groundwater, and then determine the detection difficulty of various microorganisms according to the predicted volumes of various microorganisms, and determine the current appropriate detection method for various microorganisms in groundwater accordingly, so as to ensure that the detection of groundwater pathogenic microorganisms under different rainfall conditions in different regions can meet the detection accuracy requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of the method for constructing a predictive model for detecting pathogenic microorganisms in groundwater.

[0016] Figure 2 It is a schematic diagram of the process of detecting pathogenic microorganisms in groundwater. DETAILED DESCRIPTION

[0017] The present invention is further described in detail below in conjunction with specific implementation methods.

[0018] To detect pathogenic microorganisms in groundwater, we must first follow the following steps: Figure 1 The prediction model construction method shown is used to construct various prediction models for detecting pathogenic microorganisms in groundwater. The specific construction process is as follows: According to the chain reaction between the chemical property parameters of groundwater caused by rainfall activities, the biological characteristics of pathogenic microorganisms in groundwater, the volume of microorganisms, and the microorganism detection sensitivity (detection sensitivity can characterize the detection difficulty), this embodiment specifically designs three prediction models - biological characteristic prediction model, microorganism volume prediction model, and detection sensitivity prediction model. In order to make these three prediction models have corresponding prediction capabilities, corresponding training samples need to be taken to train them. The steps are detailed as follows.

[0019] First, the following step S1 is used to collect relevant data.

[0020] S1. For each of the multiple groundwaters in different regions, perform the following data collection steps: ——S11. Collect the chemical property parameters of the groundwater under various rainfall conditions, the types of pathogenic microorganisms in the water and their biological characteristics, and the volume data of various pathogenic microorganisms in the water; ——S12. Collect the detection sensitivity data corresponding to various pathogenic microorganisms at various volumes.

[0021] In this embodiment, for each groundwater, under each rainfall condition, water quality sensors are used to collect the chemical property parameters of the groundwater under such rainfall conditions, and the chemical property parameters include pH value, conductivity and dissolved oxygen; biosensors are used to collect the types of pathogenic microorganisms and their biological characteristic data in the groundwater under such rainfall conditions, and the biological characteristic data include activity, reproduction rate and metabolic rate; optical microscope measurement and image segmentation methods are used to analyze and obtain the volume data of various pathogenic microorganisms in the groundwater under such rainfall conditions, and the volume data includes volume characteristics such as length, width, height or diameter and volume values. This embodiment uses three indicators, namely rainfall frequency, rainfall intensity and rainfall period, to describe rainfall conditions. Different rainfall conditions belong to different rainfall conditions if any of these three indicators are different. This embodiment establishes a groundwater quality database, and stores the collected groundwater chemical property parameters in the groundwater quality database; it also establishes a microbial biological characteristic database, and stores the collected pathogenic microorganism types and their biological characteristic data in the microbial biological characteristic database. For example, when establishing a groundwater quality database, a relational database such as MySQL or PostgreSQL can be used, and a reasonable data table structure can be designed according to the characteristics of the data, for example, including fields such as sampling point location, sampling time, pH value, conductivity, dissolved oxygen, etc. For missing values ​​or outliers, K-nearest neighbor interpolation can be used for data interpolation. In this embodiment, the detection sensitivity data corresponding to various pathogenic microorganisms at various volumes are obtained by technicians based on their work experience, and a microbial detection sensitivity database is established accordingly.

[0022] After collecting relevant data, a corresponding prediction model can be constructed and the constructed prediction model can be trained with these data. The construction and training process of the biological characteristic prediction model is shown in the following step S2.

[0023] S2. Execute the following biological characteristic prediction model construction training steps to obtain a trained biological characteristic prediction model: ——S21, taking the chemical property parameters of groundwater under a certain rainfall condition as input, taking the microbial species and biological characteristic data of the groundwater under the rainfall condition as output, a set of biological characteristic training samples is formed, and multiple sets of such biological characteristic training samples are constructed accordingly; ——S22. Use machine learning algorithms to build a biological characteristic prediction model, and train the biological characteristic prediction model through the above-mentioned multiple groups of biological characteristic training samples, so that it has the ability to identify groundwater chemical property parameters to obtain microbial species and their biological characteristic data.

[0024] This embodiment preprocesses the chemical property parameters and pathogenic microorganism types and their biological characteristic data of groundwater collected from various places under various rainfall conditions, including data cleaning, standardization and normalization operations, to ensure the quality and consistency of the data and prepare for model training. Exemplarily, when performing data preprocessing, Python's Pandas library can be used to clean the data, such as removing features with missing values ​​exceeding 20%, interpolating the remaining missing values ​​using the KNN algorithm, and then using the Min-Max standardization method to normalize the data and scale the data to the [0,1] interval. Then this embodiment uses the Pearson correlation coefficient and / or the Spearman rank correlation coefficient to calculate the correlation coefficient between each chemical property parameter of groundwater and the biological characteristic data of the microorganism, and performs a significance test on each calculated correlation coefficient. According to the significance test results, the chemical property parameters that have a significant impact on the biological characteristic data of the microorganism are selected, and when constructing the training sample, the chemical property parameters that have a significant impact on the biological characteristic data of the microorganism are used as input. When performing correlation analysis, you can use the pearsonr or spearmanr function of the scipy library to calculate the Pearson correlation coefficient or the Spearman rank correlation coefficient, respectively, set the significance level α=0.05, and screen the chemical property parameters whose significance P value of the correlation is less than α. For example, the analysis found that the Pearson correlation coefficient between pH value and the activity of pathogenic microorganisms is -0.85, and the P value is 0.001, which is less than 0.05, indicating that the pH value and the activity of pathogenic microorganisms are significantly negatively correlated, so the pH value is used as one of the input chemical property parameters. On the contrary, if the analysis finds that the significance P value of the correlation between conductivity and the activity of pathogenic microorganisms is greater than 0.05, it means that the correlation between conductivity and the activity of pathogenic microorganisms is not significant and has no statistical significance, so conductivity is not used as one of the input chemical property parameters.

[0025] In this embodiment, according to the chemical property parameters of groundwater at various locations under various rainfall conditions and the corresponding microbial species and their biological characteristic data, a number of biological characteristic training samples are constructed in accordance with step S21 to obtain a biological characteristic training sample set; then a machine learning algorithm, such as a support vector machine algorithm, is used to construct a biological characteristic prediction model, and each training sample in the biological characteristic training sample set is used to train the biological characteristic prediction model, so that the model has the ability to identify the chemical property parameters of groundwater to derive the microbial species and their biological characteristic data.

[0026] When using the support vector machine algorithm to build a biological characteristic prediction model, a kernel function is selected from the linear kernel function, polynomial kernel function and radial basis kernel function, and the penalty coefficient C is optimized to control the model complexity and tolerance for misclassified samples. At the same time, the slack variable ξ is optimized to allow a certain degree of misclassification, improve the model robustness, and improve the model's fitting ability and generalization ability to achieve better prediction accuracy; k-fold cross validation is further used to balance the estimated bias and variance, and the trained biological characteristic prediction model is evaluated, and the mean square error, mean absolute error and determination coefficient of the model are calculated to judge the prediction effect and stability of the model. For example, using the SVC class of the sklearn library, selecting the Gaussian radial basis kernel function, and through 5-fold cross validation and grid search, the optimal penalty coefficient C=10 and kernel function parameter γ=0.1 are obtained. At this time, the average prediction accuracy of the model on the test set is 92%. If the model performance does not meet the requirements, the biological characteristic prediction model is optimized by the feature selection algorithm. Specifically, according to the recursive feature elimination method, the model is recursively trained to delete the features with the smallest contribution until the preset number of features or performance threshold is reached, and the feature subset with the largest contribution to the prediction result is screened out to reduce the model complexity and improve the generalization ability while ensuring the model performance. Then, the training samples are re-used to train the biological characteristic prediction model and iteratively optimize the model performance. For example, the recursive feature elimination algorithm is used for feature selection, the number of features to be selected is set to 10, and one feature is eliminated in each iteration. The model is repeatedly trained and the performance is evaluated until the performance index reaches the threshold or the number of features is reduced to 10. Then the optimized biological characteristic prediction model is tested with the test sample, and it is found that after feature selection, the average prediction accuracy of the model is increased to 95%, and the number of features is reduced from 30 to 18, which effectively reduces the model complexity.

[0027] In this embodiment, the groundwater chemical property parameters are input into the trained biological property prediction model, and the biological property prediction model is used to derive the types of groundwater pathogenic microorganisms and their biological properties - activity, reproduction rate and metabolic rate - according to the input groundwater chemical property parameters, and the types of groundwater pathogenic microorganisms and their biological properties are output to the user as prediction results. Preferably, hydrogeologists and microbiologists are invited to judge the rationality and interpretability of the prediction results. If the prediction results are considered unreasonable, the model needs to be analyzed and adjusted and improved if necessary. For example, after outputting the prediction results, three experts in related fields can be invited to judge the prediction results, and the rationality, interpretability and credibility of the prediction results can be scored using the Likert 5-level scale, and the average value is taken as the comprehensive score. The comprehensive score of the expert judgement is 4.2, indicating that the prediction results are generally reasonable and credible, but there is still room for further improvement. At the same time, it is also necessary to compare the prediction results with historical data (microorganism species and their biological property data under the same or similar chemical property parameters) to ensure the accuracy and credibility of the prediction results. This embodiment regularly collects new groundwater chemical property data and pathogenic microorganism characteristic data, retrains and updates the biological characteristic prediction model, ensures that the biological characteristic prediction model can adapt to changes in environmental conditions, and continuously provides accurate and reliable prediction services. For example, new monitoring data is collected once a quarter, the model is retrained, and it is continuously updated to adapt to changes in environmental conditions. In the two consecutive years of model updates, the prediction accuracy has increased from 95% to 98%, proving the migration ability and stability of the model.

[0028] The construction and training process of the microbial volume prediction model is shown in step S3 below.

[0029] S3, executing the following microbial volume prediction model construction training steps to obtain a trained microbial volume prediction model: ——S31, taking the biological characteristic data of a pathogenic microorganism in groundwater under a certain rainfall condition as input, and taking the volume data of the microorganism in the area under the rainfall condition as output, a set of microorganism volume training samples is formed, and multiple sets of such microorganism volume training samples are constructed accordingly; ——S32. A machine learning algorithm is used to construct a microbial volume prediction model. The above-mentioned multiple groups of microbial volume training samples are used to train the microbial volume prediction model so that it has the ability to identify the biological characteristic data of microorganisms and obtain microbial volume data.

[0030] This embodiment cleans and preprocesses the types of various pathogenic microorganisms in the water under various rainfall conditions and their biological characteristics data - activity, reproduction rate and metabolic rate - and the individual volume data of various pathogenic microorganisms obtained by microscope measurement and image segmentation methods, removes missing values ​​and outliers, and performs data standardization to scale the data to the same scale range. Exemplarily, in the data preprocessing stage, the Pandas library in Python is used to clean the biological characteristic data and volume data of the microorganisms, remove features with missing values ​​exceeding 20%, use the KNN algorithm to interpolate the remaining missing values, and then use the Min-Max standardization method to normalize the data and scale the data to the [0,1] interval.

[0031] In this embodiment, according to the types of various pathogenic microorganisms in groundwater at various locations under various rainfall conditions and their biological characteristic data, as well as the individual volume data of various pathogenic microorganisms obtained by microscope measurement and image segmentation methods, a number of microbial volume training samples are constructed in accordance with step S31 to obtain a microbial volume training sample set. In this embodiment, a machine learning algorithm, such as a multi-layer perceptron neural network, is used to construct a microbial volume prediction model, and each training sample in the microbial volume training sample set is used to train the microbial volume prediction model, so that it has the ability to identify the biological characteristic data of microorganisms and obtain microbial volume data.

[0032] When using a multi-layer perceptron neural network to construct a microbial volume prediction model, for the design of the network structure, the number of hidden layers and the number of neurons in each layer are reasonably selected according to the dimension of the input features, the number of samples, and the complexity of the nonlinear relationship. The performance of different structures is evaluated by the cross-validation method to select the optimal network structure; for the selection of the activation function, the ReLU activation function is selected according to the function of the network layer and the characteristics of the data. For example, the network structure adopts a three-layer structure, the input layer contains three features, namely microbial activity, reproduction rate, and metabolic rate; the hidden layer contains 10 neurons, and the activation function is ReLU; the output layer contains 1 neuron, and the activation function is a linear function. After the microbial volume prediction model is constructed, the microbial volume prediction model is trained using each training sample in the microbial volume training sample set, so that it has the ability to identify the biological characteristic data of microorganisms to obtain microbial volume data. During the training process, the back propagation algorithm is used to optimize the network weights. The input data is forward propagated to the output layer through forward propagation, and the weighted sum and activation value of each layer are calculated; the loss function is calculated, and the predicted value of the output layer is compared with the true value; according to the gradient of the loss function to the output layer weight, the gradient of the hidden layer weight is calculated by the chain rule, and the error is back-propagated to the input layer; according to the gradient descent algorithm, the gradient obtained by back propagation is used to update the weight of each layer, and the iteration is repeated until the preset number of iterations is reached or the loss function value converges, so as to continuously improve the model's fitting ability and generalization ability. For example, the Adam optimization algorithm is used, the learning rate is set to 0.01, the batch size is set to 32, and the number of iterations is set to 100; PyTorch is used to implement the back propagation algorithm, and the gradient of the loss function to the weight of each layer is calculated by setting the loss function to the mean square error function, and the gradient clipping technology is used to limit the gradient to the interval [-1,1] to prevent gradient explosion. After the microbial volume prediction model is initially trained, the performance of the trained microbial volume prediction model is evaluated by the cross-validation method. Specifically, the data set is randomly divided into a training set and a test set by using the holdout method or k-fold cross-validation. The k-fold cross-validation can make more full use of the data and reduce the impact of the randomness of data division on the evaluation results. Then the mean square error and mean absolute error of the model on the test set are calculated to determine the prediction accuracy and stability of the model, and the model is further optimized and adjusted according to the evaluation results. For example, the training sample set is randomly divided into a training set and a test set in a ratio of 8:2 using the holdout method. The microbial volume prediction model is trained and evaluated multiple times. After each training, the mean square error (MSE), mean absolute error (MAE) and determination coefficient (R²) of the model are calculated on the test set to determine whether it has good prediction performance. For example, after multiple training and evaluations, the microbial volume prediction model has an MSE of 0.05, a MAE of 0.18, and an R² of 0.92 on the test set, indicating that the model has good prediction performance.

[0033] This embodiment regularly updates and maintains the microbial volume prediction model, and retrains and optimizes the model by combining regular updates and triggered updates based on the newly acquired microbial biological characteristic data and volume data. During the update process, the newly collected data is cleaned and preprocessed, the relevance and importance of the features are re-evaluated, and the model performance before and after the update is comprehensively evaluated to ensure that the performance of the updated model is improved. At the same time, the updated model is versioned, the update time, update content and performance indicators are recorded, and the updated model is deployed to the production environment for real-time monitoring and early warning, timely detection and processing of abnormal data, and the adaptability and robustness of the model are improved to ensure that the model can continue to provide support for the prediction and analysis of microbial volume. This embodiment, for example, sets a regular update of the microbial volume prediction model once a month. In addition, even if the monthly update date is not reached, if the model prediction error exceeds 20% for 3 consecutive days, it will trigger an immediate update. When updating, the newly collected data is cleaned and preprocessed, the relevance of the features is re-evaluated, and the features with a correlation less than 0.1 are removed. The updated model is named "MLP_model_v2.0", the update time is recorded as "2023-05-01", and it is deployed on the server. The newly collected data is predicted every 5 minutes. When the difference between the predicted value and the actual value exceeds 30%, an early warning is automatically triggered to notify relevant personnel to investigate and handle the problem.

[0034] The construction and training process of the detection sensitivity prediction model is shown in the following step S4.

[0035] S4. Execute the following detection sensitivity prediction model construction training steps to obtain a trained detection sensitivity prediction model: ——S41, taking a volume data of a microorganism as input and taking the detection sensitivity of the microorganism under the volume data as output, a set of detection sensitivity training samples is formed, and multiple sets of such detection sensitivity training samples are constructed accordingly; ——S42. Use machine learning algorithm to build a detection sensitivity prediction model, and train the detection sensitivity prediction model through the above-mentioned multiple groups of detection sensitivity training samples to enable it to have the ability to identify microbial volume data and derive its detection sensitivity.

[0036] This embodiment cleans and preprocesses the collected various microbial volume data and the detection sensitivity data corresponding to various microorganisms at various volumes, removes outliers and noise data, and standardizes the data to scale the data to the same scale range. Exemplarily, in the data preprocessing stage, Python's Pandas library is used to clean the microbial volume data, remove samples with missing values ​​accounting for more than 20%, and use the KNN algorithm to interpolate the remaining missing values, where the K value is set to 5, and then the Z-score standardization method is used to normalize the data and scale the data to a range with a mean of 0 and a standard deviation of 1.

[0037] In this embodiment, according to various microbial volume data and the detection sensitivity data corresponding to various microorganisms at various volumes, a plurality of detection sensitivity training samples are constructed in accordance with step S41 to obtain a detection sensitivity training sample set. In this embodiment, a machine learning algorithm such as a random forest algorithm is used to construct a detection sensitivity prediction model, and each training sample in the detection sensitivity training sample set is used to train the detection sensitivity prediction model so that it has the ability to identify the microbial volume data and obtain its detection sensitivity.

[0038] Before constructing the training samples, this embodiment screens out the microbial volume features that have the greatest impact on the detection sensitivity through correlation analysis. Combining the correlation, redundancy and interpretability factors of the features, the Pearson correlation coefficient is used to screen out the features that are highly correlated with the detection sensitivity. For example, the Pearson correlation coefficient between each feature and the detection sensitivity is first calculated, and the features with an absolute value of the correlation coefficient greater than 0.6 are selected as high-correlation volume features. When constructing the training samples according to step S41, only the high-correlation volume features in the microbial volume data are used as input, and the detection sensitivity of the microorganism under the volume data is used as output to form a set of detection sensitivity training samples. When training the detection sensitivity prediction model, this embodiment uses the grid search method to optimize the hyperparameters of the model, including the number of trees, the maximum depth of each tree, and the minimum number of samples for each tree; and k-fold cross validation is used to determine the optimal parameter combination of the model, specifically: the data set is randomly divided into k mutually exclusive subsets, one of which is selected as the validation set each time, and the remaining k-1 subsets are used as the training set, repeated k times, and the average value of the k evaluation indicators is taken as the final performance evaluation result. When selecting the k value, it is necessary to balance the deviation and variance. Generally, 5 or 10 are more commonly used. The k value can be adjusted according to the size of the data and the limitation of computing resources. The optimal parameters and hyperparameters of the detection sensitivity prediction model are determined by cross validation. In addition, this embodiment also uses a feature selection method based on recursive feature elimination to select the optimal feature subset according to the performance of the model. For example, after preliminary training, the recursive feature elimination method is used to recursively remove features with a step size of 0.1. According to the performance of the detection sensitivity prediction model on the validation set, the optimal feature subset is selected from the initial feature set. For example, the number of features in the initial feature set is 20. After processing by the recursive feature elimination method, 12 are selected as the optimal feature subset, which improves the prediction accuracy of the detection sensitivity prediction model and reduces its complexity.

[0039] This embodiment evaluates the stability and robustness of the detection sensitivity prediction model by performing sensitivity analysis and uncertainty analysis on the detection sensitivity prediction model. When performing sensitivity analysis, a single-factor sensitivity analysis method can be used, that is, only changing the value of one input variable at a time, observing the changing trend of the model output, and calculating sensitivity indicators, including partial derivatives and standardized regression coefficients. Each input feature is added or subtracted 10% near its mean in turn, and the rate of change of the model output is calculated to obtain the sensitivity coefficient of each feature. For example, the sensitivity coefficient of microbial length is 0.25, indicating that for every 10% change in length, the detection difficulty will change by 2.5%. When performing uncertainty analysis, a Monte Carlo simulation method can be used, that is, randomly sampling the probability distribution of the input variables, repeatedly running the model, observing the distribution of the output variables, and calculating uncertainty indicators, including variance and confidence interval. The model is optimized and improved according to the analysis results to improve the reliability and applicability of the model. This embodiment constructs a trained biological characteristic prediction model, a microbial volume prediction model, and a detection sensitivity prediction model according to the above steps S1 to S4, and then can be used as follows. Figure 2 The above three prediction models constructed are used to detect pathogenic microorganisms in groundwater. The specific detection steps are as follows: S5. Obtain the current chemical property parameters of the groundwater at a location, input the chemical property parameters of the groundwater at that location into the biological property prediction model trained in step S2 above, and use the biological property prediction model to obtain the types of pathogenic microorganisms and their biological property data of the groundwater at that location based on the chemical property parameters of the groundwater at that location.

[0040] S6. The biological characteristic data of various pathogenic microorganisms obtained in step S5 are input into the microbial volume prediction model trained in step S3 above, and the volume data of various pathogenic microorganisms in the groundwater are obtained based on the biological characteristic data of various pathogenic microorganisms using the microbial volume prediction model.

[0041] S7. Input the volume data of various pathogenic microorganisms obtained in step S6 into the detection sensitivity prediction model trained in step S4 above. Use the detection sensitivity prediction model to obtain the detection sensitivity of various pathogenic microorganisms in the groundwater based on the volume data of various pathogenic microorganisms. Based on this, the detection difficulty of various pathogenic microorganisms is obtained. The detection sensitivity is negatively correlated with the detection difficulty.

[0042] S8. For each pathogenic microorganism in the groundwater obtained in step S5, if the detection difficulty is lower than the preset difficulty threshold, the plate culture method is used to detect the pathogenic microorganism in the groundwater; otherwise, the polymerase chain reaction method is used to detect the pathogenic microorganism in the groundwater.

[0043] The above-mentioned preset difficulty threshold is determined as follows: according to the linear relationship between detection sensitivity and detection difficulty (negative correlation), the detection sensitivity of various microorganisms under different volume data is converted into the corresponding detection difficulty, and then these detection difficulties are sorted from small to large, and each value is taken as the threshold in turn with a step size of 0.01, and the specificity and sensitivity under the threshold are calculated. The ROC curve is drawn accordingly, and the specificity and sensitivity are balanced according to the ROC curve and specific application requirements, and the optimal threshold is selected. For example, when the area under the curve (AUC) is 0.95 and the specificity is 0.9, the corresponding threshold of 0.7 is used as the preset difficulty threshold. In step S8, if the detection difficulty of the pathogenic microorganism is lower than 0.7, the plate culture method is used to detect the pathogenic microorganism in the groundwater at the location, otherwise the polymerase chain reaction method is used to detect the pathogenic microorganism in the groundwater at the location.

[0044] The plate culture method is simple to operate and low in cost, and meets the needs of conventional microbial detection. Therefore, this embodiment uses this method to detect microorganisms with a detection difficulty of less than 0.7. When performing detection, this embodiment improves the culture efficiency and detection rate of microorganisms by optimizing the culture medium formula and culture conditions. Specifically: in optimizing the culture medium formula, nutrients and selective inhibitors that are beneficial to the growth of target microorganisms are added to improve the growth rate and selectivity of target microorganisms, while inhibiting the growth of other non-target microorganisms; in optimizing culture conditions, the temperature, pH value and dissolved oxygen content are controlled to simulate the optimal growth environment of microorganisms, shorten the culture time, and improve the detection efficiency; in terms of detection and counting, an automated microscope counting system is used. The automated microscope counting system uses machine vision algorithms to segment, extract features and classify microscope images, realize automatic identification and counting of microorganisms, reduce errors in manual operations, and improve the accuracy and repeatability of detection. The plate culture detection process is as follows: streak inoculation on LB solid culture medium, culture conditions are 37°C and aerobic conditions for 24 hours; by adding antibiotics and pH indicators to the culture medium, selective culture and identification of target bacteria can be achieved. For example, for the culture of Staphylococcus aureus, 7.5% sodium chloride and 1% mannitol are added to the LB culture medium to inhibit the growth of other bacteria and improve the detection rate of Staphylococcus aureus; a fully automatic colony counter is used to photograph the plate, image processing is performed using the OpenCV library, the colony area is extracted using the threshold segmentation method, and the colony is morphologically filtered to remove spots and noise. Then, based on the color, size, shape and other characteristics of the colony, the support vector machine algorithm is used for classification, and the Staphylococcus aureus colonies are identified and counted with an accuracy rate of more than 95%.

[0045] The polymerase chain reaction (PCR) detection method can specifically detect low-abundance target microorganisms. Therefore, this embodiment uses this method to detect microorganisms with a detection difficulty higher than 0.7, which can ensure the detection accuracy of groundwater pathogenic microorganisms and avoid errors and omissions. The polymerase chain reaction (PCR) detection method requires the design of primers and probes. When designing primers and probes, the conservatism and specificity of the target sequence are combined, and bioinformatics tools are used for sequence alignment and primer design, and the specificity and amplification efficiency of primers and probes are verified by experiments. When optimizing the reaction conditions, it is necessary to reasonably set the annealing temperature and time according to the physical and chemical properties of the primers and probes, optimize the magnesium ion concentration, dNTP concentration and enzyme dosage, and ensure the stability and repeatability of the amplification reaction. The quantitative detection of microorganisms is achieved through the real-time fluorescence quantitative PCR method, and the abundance information of microorganisms is obtained. Taking Staphylococcus aureus as an example, the polymerase chain reaction (PCR) detection process is explained: First, specific primers and TaqMan probes are designed for the nuc gene of Staphylococcus aureus. The primer sequences are 5'-GCGATTGATGGTGATACGGTT-3' and 5'-AGCCAAGCCTTGACGAACTAAAGC-3', and the probe sequence is 5'-FAM-AGATGGTAGAAAATGCAAAGAAAATTGAAGTCG-BHQ1-3'; the reaction system is set to 20 μL, including 2×PCR Mix 10 μL, 0.5 μL of upstream and downstream primers, 0.3 μL of TaqMan probe, 2 μL of DNA template, and then add water to 20 μL; set the reaction conditions to 95°C pre-denaturation for 5 min, 95°C denaturation for 15 s, 60°C annealing and extension for 30 s, for a total of 40 cycles; use the nuc gene of Staphylococcus aureus to design specific primers and TaqMan probes, and perform polymerase chain reaction on pathogenic microorganisms in groundwater according to the above reaction system and reaction conditions to detect whether the pathogenic microorganisms in the groundwater have the nuc gene of Staphylococcus aureus. If so, it is considered that the groundwater contains Staphylococcus aureus.

[0046] The prediction model construction method provided by the present invention uses steps S1 to S4 to pre-construct a trained biological characteristic prediction model, a microbial volume prediction model, and a detection sensitivity prediction model. The method for detecting groundwater pathogenic microorganisms provided by the present invention uses the above three prediction models to detect groundwater pathogenic microorganisms. Specifically: step S5 predicts the biological characteristic data of various types of pathogenic microorganisms through the biological characteristic prediction model, step S6 predicts the volume data of various types of pathogenic microorganisms through the microbial volume prediction model, step S7 predicts the detection sensitivity of various microorganisms and obtains the detection difficulty of various microorganisms based on this, and finally step S8 determines which detection method to take to detect the microorganism based on the detection difficulty of various microorganisms. It can be seen that the present invention can predict the volume of various microorganisms in water according to the current chemical property parameters of groundwater, and then determine the detection difficulty of various microorganisms according to the predicted volumes of various microorganisms, and determine the current appropriate detection method for various microorganisms in groundwater accordingly, so as to ensure that the detection of groundwater pathogenic microorganisms under different rainfall conditions in different regions can meet the detection accuracy requirements.

[0047] In this embodiment, preferably, in the above step S5, if the number of pathogenic microorganisms obtained exceeds the preset number, an early warning is triggered. In this way, this embodiment uses the biological characteristic prediction model to timely predict the types of microorganisms and their biological characteristics in the groundwater, and derives the degree of microbial contamination of the groundwater. If the degree of microbial contamination exceeds the normal level, an early warning is triggered, and the management personnel can be notified in time to take relevant treatment measures. Under normal circumstances, it is necessary to wait until the results of the groundwater pathogenic microorganism detection are out before analyzing the degree of microbial contamination. The present invention can analyze and predict the degree of microbial contamination of groundwater without waiting for the completion of the groundwater pathogenic microorganism detection, and trigger an early warning in time.

[0048] Preferably, in this embodiment, LSTM is used to establish a time series water quality prediction model, and the historical water quality data (time series) in the groundwater quality database is used to train the time series water quality prediction model, so that it has the ability to predict groundwater quality. For example, the water quality data at a certain time point in the historical water quality data is used as input, and the water quality data in a preset time period after the time point in the historical water quality data is used as output to form a group of training samples. The time series water quality prediction model is trained through multiple groups of such training samples. After the training is completed, the time series water quality prediction model can predict the water quality data in the future period based on the current groundwater water quality data.

[0049] In this embodiment, preferably, the chemical property parameters of groundwater under a rainfall condition, the types of pathogenic microorganisms in the water and their biological characteristic data, and the volume data of various pathogenic microorganisms in the water are stored in an associated database as a group of data, and the collected chemical property parameters, the types of pathogenic microorganisms in the water and their biological characteristic data, and the volume data of various pathogenic microorganisms in the water are integrated and processed to obtain several groups of data, which are stored in the associated database. In this embodiment, the Apriori algorithm or the FP-growth algorithm is used to mine frequent item sets and association rules in the associated database. Specifically: according to the characteristics of the data and business needs, support and confidence thresholds are set to balance the quantity and quality of the rules, generate frequent item sets and association rules that meet the threshold requirements, and reveal the association patterns and laws between different factors. For example, using the FP-growth algorithm, setting the minimum support to 0.05 and the minimum confidence to 0.8, the frequent item sets and association rules of each group of data in the association database are mined, and 50 association rules are finally obtained, among which the rule with the highest support is: pH value between 6.5-7.5, conductivity between 500-1000μS / cm-> many types of pathogenic microorganisms, support is 0.15, confidence is 0.9, and lift is 2.5. In this embodiment, experts evaluate the association rules obtained by mining, screen out valuable association rules, and then convert the association rules into warning rules, specifically using the preconditions in the association rules as warning conditions, and generating warning rules in combination with preset warning processing measures. Taking the above rule "pH value between 6.5-7.5, conductivity between 500-1000μS / cm -> many types of pathogenic microorganisms" as an example, this embodiment automatically uses "pH value between 6.5-7.5, conductivity between 500-1000μS / cm" as the warning condition, and the preset warning treatment measure is: SMS notification of management personnel, so the generated warning rule is "If pH value is between 6.5-7.5 and conductivity is between 500-1000μS / cm, SMS notification of management personnel". This embodiment uses the mining results of association rules to automatically establish a groundwater pathogenic microorganism warning rule database. When the monitoring data meets the warning condition of any warning rule in the warning rule database, the warning signal is automatically triggered and the corresponding warning treatment measures are executed.

[0050] This embodiment is implemented by computer code programming. Figure 1 The prediction model construction method for detecting pathogenic microorganisms in groundwater shown in the figure obtains a corresponding computer program product, which is executed by a processor to achieve the following Figure 1 The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater is shown; and computer code programming is also used to implement the following Figure 2The method for detecting pathogenic microorganisms in groundwater shown in the figure obtains a corresponding computer program product, which is executed by a processor to achieve the following Figure 2 The method shown is for detecting pathogenic microorganisms in groundwater.

[0051] The above is only an implementation method of the invention, and does not limit the scope of patent protection. Those skilled in the art can make non-substantial changes or substitutions based on the invention, which still fall within the scope of patent protection.

Claims

1. A method for constructing a prediction model for detecting pathogenic microorganisms in groundwater, characterized in that: The following steps are involved: S1. For each of the multiple groundwaters in different regions, perform the following data collection steps: ——S11. Collect the chemical property parameters of the groundwater under various rainfall conditions, the types of pathogenic microorganisms in the water and their biological characteristics, and the volume data of various pathogenic microorganisms in the water; ——S12, collect the detection sensitivity data corresponding to various pathogenic microorganisms at various volumes; S2. Execute the following biological characteristic prediction model construction training steps to obtain a trained biological characteristic prediction model: ——S21, taking the chemical property parameters of groundwater under a certain rainfall condition as input, taking the microbial species and biological characteristic data of the groundwater under the rainfall condition as output, a set of biological characteristic training samples is formed, and multiple sets of such biological characteristic training samples are constructed accordingly; ——S22, using machine learning algorithms to build a biological characteristic prediction model, and training the biological characteristic prediction model through the above-mentioned multiple groups of biological characteristic training samples, so that it has the ability to identify groundwater chemical property parameters to obtain microbial species and their biological characteristic data; S3, executing the following microbial volume prediction model construction training steps to obtain a trained microbial volume prediction model: ——S31, taking the biological characteristic data of a pathogenic microorganism in groundwater under a certain rainfall condition as input, and taking the volume data of the microorganism in the groundwater under the certain rainfall condition as output, a set of microorganism volume training samples is formed, and multiple sets of such microorganism volume training samples are constructed accordingly; ——S32, using a machine learning algorithm to construct a microbial volume prediction model, the above-mentioned multiple groups of microbial volume training samples are used to train the microbial volume prediction model so that it has the ability to identify the biological characteristic data of microorganisms to obtain microbial volume data; S4. Execute the following detection sensitivity prediction model construction training steps to obtain a trained detection sensitivity prediction model: ——S41, taking a volume data of a microorganism as input and taking the detection sensitivity of the microorganism under the volume data as output, a set of detection sensitivity training samples is formed, and multiple sets of such detection sensitivity training samples are constructed accordingly; ——S42. Use machine learning algorithm to build a detection sensitivity prediction model, and train the detection sensitivity prediction model through the above-mentioned multiple groups of detection sensitivity training samples to enable it to have the ability to identify microbial volume data and derive its detection sensitivity.

2. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: Step S22 specifically uses a support vector machine algorithm to construct a biological characteristic prediction model.

3. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: In step S2, before executing the biological property prediction model construction training step, the correlation coefficient between each chemical property parameter of groundwater and the biological property data of microorganisms is calculated using the Pearson correlation coefficient and / or the Spearman rank correlation coefficient, and a significance test is performed on each calculated correlation coefficient, and the chemical property parameter that has a significant impact on the biological property data of microorganisms is selected according to the significance test result; In step S21, the chemical property parameters of groundwater at a certain location that have a significant impact on the biological characteristic data of microorganisms under a certain rainfall condition are specifically taken as input.

4. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: Step S32 specifically uses a multi-layer perceptron neural network to construct a microbial volume prediction model.

5. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: Step S42 specifically uses a random forest algorithm to construct a detection sensitivity prediction model.

6. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: In step S4, before executing the detection sensitivity prediction model construction training step, the microbial volume features that are highly correlated with the detection sensitivity are screened out through correlation analysis and recorded as high-correlation volume features; In step S41, a highly correlated volume feature of a volume of a microorganism is used as input.

7. The method for constructing a prediction model for detecting pathogenic microorganisms in groundwater according to claim 1, characterized in that: Groundwater chemical property parameters include pH, conductivity and dissolved oxygen, and / or biological property data include activity, reproduction rate and metabolic rate.

8. A method for detecting pathogenic microorganisms in groundwater, characterized in that: The following steps are involved: S5, obtaining the current chemical property parameters of the groundwater at a location, inputting the chemical property parameters of the groundwater at the location into the biological property prediction model trained by step S2 in the prediction model construction method described in right 1, and using the biological property prediction model to obtain the types of pathogenic microorganisms and their biological property data of the groundwater at the location according to the chemical property parameters of the groundwater at the location; S6, inputting the biological characteristic data of various pathogenic microorganisms obtained in step S5 into the microbial volume prediction model trained by step S3 in the prediction model construction method described in right 1, and using the microbial volume prediction model to obtain the volume data of various pathogenic microorganisms in the groundwater according to the biological characteristic data of various pathogenic microorganisms; S7, inputting the volume data of various pathogenic microorganisms obtained in step S6 into the detection sensitivity prediction model trained by step S4 in the prediction model construction method described in right 1, using the detection sensitivity prediction model to obtain the detection sensitivity of various pathogenic microorganisms of the groundwater according to the volume data of various pathogenic microorganisms, and thereby obtain the detection difficulty of various pathogenic microorganisms, and the detection sensitivity is negatively correlated with the detection difficulty; S8. For each pathogenic microorganism in the groundwater obtained in step S5, if the detection difficulty is lower than the preset difficulty threshold, the plate culture method is used to detect the pathogenic microorganism in the groundwater; otherwise, the polymerase chain reaction method is used to detect the pathogenic microorganism in the groundwater.

9. The method for detecting pathogenic microorganisms in groundwater according to claim 8, characterized in that: In step S5, if the predicted number of pathogenic microorganisms exceeds a preset number, an early warning is triggered.

10. A computer program product comprising a computer program, characterized in that The computer program is executed by a processor to implement the prediction model construction method for detecting groundwater pathogenic microorganisms as described in any one of claims 1 to 7, or the method for detecting groundwater pathogenic microorganisms as described in claim 8 or 9.

Citation Information

Patent Citations

  • Method for predicting microflora structure based on power law scaling model of diversity-area relationship (DAR)

    CN110021337A

  • Underground water pollution natural attenuation capability prediction method and model training method

    CN115994570A

  • Water quality monitoring and trend prediction method based on microbial growth model

    CN116751835A

  • Water environment microorganism detection method and system based on multi-source data and medium

    CN117171675A

  • Underground water resource evaluation system for geological survey

    CN117575385A