River planktonic bacterial community composition prediction method based on artificial neural network auto-encoder
Through the method based on artificial neural network autoencoder, the limitations of traditional models in capturing the complex and nonlinear relationships of the plankton bacteria community in rivers are solved, and more accurate and interpretable predictions are achieved, which promotes data-driven deep learning in the environment Applications in the field of science.
Patent Information
- Application Number
- CN202411314845.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The traditional river plankton community prediction model has limitations in dealing with the interaction of complex natural communities and environmental factors, is difficult to capture nonlinear relationships, and lacks interpretability, which limits its application in microbiome research.
Using an artificial neural network autoencoder method, through data acquisition, preprocessing and model construction, the OTU abundance and environmental factors of plankton bacteria are converted into potential space, and the impact of the model is explained using SHAP values, which improves the accuracy and ability of prediction. Explanatory.
It realizes more accurate prediction of the composition of the plankton bacterial community in rivers, enhances the interpretability of the model, provides broader technical support for ecological environment monitoring and protection, and promotes the application of data-driven deep learning in the field of environmental science.
Smart Images

Figure CN119168153A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of environmental science and relates to a method for predicting river planktonic bacterial community composition based on an artificial neural network autoencoder. Background Art
[0002] A core goal of microbial ecology is to understand the interactions between the Earth's microbial communities and environmental factors. Currently, research on the composition of river bacterial plankton communities mainly focuses on exploring their relationships with environmental factors, spatiotemporal characteristics, and major driving factors. In order to compensate for the limitations of field monitoring, researchers have developed various models to predict the composition and dynamic changes of river bacterial plankton communities. These studies are of great significance for formulating ecological management plans and responding to environmental changes.
[0003] Traditional prediction models, such as mechanism-based kinetic models (such as the Monod equation, Lotka-Volterra model) and multivariate linear regression models, have limitations in predicting microbial community structure, mainly reflected in their lack of applicability to complex natural communities and the neglect of the interaction and nonlinear relationships of environmental factors. In addition, natural river systems are affected by multiple complex factors such as geography, hydrology, physics and chemistry, and traditional multivariate regression analysis is difficult to fully capture these complex relationships.
[0004] In this context, deep learning (DL), as an advanced machine learning method, has shown significant advantages in processing large-scale data and complex models. Although DL has achieved remarkable results in the field of bioinformatics, such as medical image diagnosis and genome sequence analysis, its application in microbiome research is still relatively limited. At present, although some studies have used DL methods (such as LSTM and CNN) to predict changes in microbial communities, these methods still lack interpretability when dealing with complex nonlinear relationships and interactions between variables. Therefore, developing a more interpretable data-driven deep learning model is crucial to improve the accuracy and reliability of predicting the composition of river planktonic bacterial communities. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method for predicting the composition of river planktonic bacterial communities based on artificial neural network autoencoders, to provide a simpler and more efficient method for studying the composition of river planktonic bacterial communities, and to provide technical support for better understanding the potential impact of environmental changes on planktonic bacteria.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] The method for predicting the composition of river planktonic bacterial communities based on artificial neural network autoencoders includes the following steps:
[0008] Data collection and preparation: Collect river planktonic bacteria samples and related environmental data, including water body physical and chemical indicators, meteorological elements, geographical patterns and human activities. Form an original data set, covering indicators such as relative abundance of planktonic bacteria, total nitrogen (TN), total phosphorus (TP), dissolved organic carbon (DOC), chlorophyll (Chla), conductivity (Cond), pH, dissolved oxygen (DO), water temperature (WT), air temperature (AT), precipitation (Pre), elevation (elev) and geographical distance. In large watersheds, in order to ensure sufficient data, collect data from different spatial points, such as main streams, tributaries, etc., to ensure that the total number of samples is more than twice the number of community compositions required for prediction.
[0009] Data preprocessing: Check data validity and remove erroneous and empty data. Unify dimensions, using standardization, min-max normalization, mean normalization, or logarithmic normalization. Recode discrete data such as time, landform type, etc., using built-in one-hot encoding or other methods.
[0010] Model construction: Divide the model into training and test sets. Design two encoder models and one decoder model. First encoder: Convert the abundance of bacterioplankton OTUs to latent space (LSOTU). Second encoder: Convert environmental elements to latent space (LSEF). Decoder: Convert the latent space back to bacterioplankton abundance. The latent spaces of the two encoders are trained to be similar, minimizing the difference and creating a combined latent space (LScomb).
[0011] Model training and evaluation: The predictor and decoder are integrated. The predictor returns LScomb from the environmental factors, and the decoder returns the relative abundance of planktonic bacterial OTUs from LScomb. Use a variety of loss functions and evaluation indicators, such as Bray-Curtis distance and mean square error (MSE), to optimize and evaluate the model. Evaluate the model through the test set data and calculate the scores of various evaluation indicators. The SHAP (Shapley Additive Explanations) method is used to explain the model and analyze the impact of each environmental factor on the model prediction results; the calculation of the SHAP value is based on the following formula:
[0012]
[0013] Among them, N is the set of feature i, which includes total nitrogen TN, total phosphorus TP, dissolved organic carbon DOC, chlorophyll Chla, conductivity Cond, pH, dissolved oxygen DO, water temperature WT, air temperature AT, precipitation Pre, elevation elev and geographical distance index, S is the feature subset that does not contain feature i, φ i (f) is the SHAP value of feature i, and f(S) is the predicted output of the model given the feature subset S.
[0014] Model interpretation and saving: Use the SHAP method to interpret the model and analyze the impact of each environmental factor on the prediction results. Calculate the SHAP value to provide model interpretability. Save the trained encoder and decoder models for subsequent use. By inputting new environmental factors, the model can predict the distribution of planktonic bacteria in new samples.
[0015] The beneficial effects of the present invention are:
[0016] (1) The present invention uses a deep learning model, especially an autoencoder, to more accurately predict the composition of river planktonic bacterial communities, thereby improving the accuracy of prediction compared to traditional mechanism-based kinetic models and multivariate linear regression models.
[0017] (2) By using the SHAP value to interpret the model, the present invention can clearly show how each environmental factor affects the model prediction, thereby enhancing the interpretability of the model and making it have higher application value in the field of environmental science.
[0018] (3) Through data-driven methods, the present invention is not limited to the prediction of specific environmental factors, but is able to explore the complex relationship between various environmental factors and the relative abundance of river planktonic bacteria, providing more extensive technical support for ecological environment monitoring and protection.
[0019] (4) The present invention helps to formulate more accurate and timely ecological management plans and provides a scientific basis for responding to the short-term and long-term impacts of environmental changes by accurately predicting changes in river planktonic bacterial communities.
[0020] (5) The application of this invention in the field of microbiome research, especially in the prediction of river planktonic bacterial community composition, has promoted the application and development of data-driven deep learning technology in the field of environmental science.
[0021] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0023] Figure 1 It is a flow chart of the present invention;
[0024] Figure 2 The results collected during the training process of the specific embodiment of the present invention;
[0025] Figure 3 The results of the model testing using the test set in the specific embodiment of the present invention;
[0026] Figure 4 It is a global bar chart of SHAP values of encoder, decoder and predictor in a specific embodiment of the present invention; Figure 4 (a) is the encoder SHAP; Figure 4 (b) is the decoder SHAP; Figure 4 (c) is the forecast period SHAP. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0028] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0029] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0030] Figure 1 This is a flow chart of the present invention. This embodiment predicts the bacterial planktonic community in the upper reaches of the Yangtze River by using an autoencoder model based on a deep artificial neural network to predict the composition of the river bacterial planktonic community using environmental factors. The method specifically includes the following steps:
[0031] 1. Compile and organize the OTU data of 212 samples of planktonic bacteria and related hydrological and water environment data obtained from the upper reaches of the Yangtze River (from Batang, Sichuan to Yichang, Hubei) from 2015 to 2022 to form an original data set. Specific indicators include: time (Year, Month), total nitrogen (TN), total phosphorus (TP), dissolved organic carbon (DOC), chlorophyll (Chla), conductivity (Cond), pH, dissolved oxygen (DO), water temperature (WT), stoichiometric ratio (C / P, C / N, N / P), air temperature (AT), precipitation (Pre), elevation (elev), geographical distance (distance, in this example, the distance from the sample point to the Three Gorges Dam), and reservoir age (RA). Among them, Year, Month, TN, TP, DOC, Chla, Cond, pH, DO, and WT are environmental variables measured in the sample raw water, and AT, Pre, elev, distance, and RA are environmental covariates collected later. The original environmental data set is shown in Table 1, and the planktonic bacterial OTU table is shown in Table 2. In this embodiment, the OTU relative abundance table at the planktonic bacterial phylum level is selected for training.
[0032] Table 1
[0033]
[0034] Table 2
[0035]
[0036]
[0037] 2. Preprocess the original data of the Three Gorges Reservoir, check the validity of the data, remove the erroneous data and empty data, and then perform one-hot encoding on the non-continuous time data. Perform standard normalization on the processed data, and the normalized data is shown in Table 3.
[0038] Table 3
[0039]
[0040] 3. The data set was divided into a training set (n=148) and a test set (n=64) according to a ratio of 7:3, and the AE algorithm was used to construct a prediction model for the planktonic bacterial community structure. Commonly used evaluation indicators such as mean absolute error (MAE), mean square error (MSE), and mean absolute percentage error (MAPE) were used in the model construction process. However, these indicators are difficult to interpret the results under different standardization methods and are easily affected by small values. Therefore, the present invention calculates additional scale-independent indicators, such as the Pearson Correlation coefficient, which calculates the average correlation between each predicted OTU and the actual OTU, and takes the average of each sample; Bray-Curtis Dissimilarity, which calculates the similarity between the predicted value and the actual value, and measures the difference between two samples; Root Relative Squared Error (RRSE) evaluates the prediction error of a single OTU, not a sample. AE model training see Figure 2 , including training and validation losses, metrics; test performance see Figure 3 .
[0041] 4. Use SHAP values to explain the model prediction results. The SHAP values of the encoder, decoder and predictor are calculated separately. Figure 4 , respectively explain how the OTU data is processed by the encoder and converted into the latent space, the decoder reconstructs the OTU data from the latent space, and the predictor uses environmental features to predict the latent space. The X-axis in the figure is the average SHAP value, which indicates the average impact of each feature on the model output; the Y-axis is the different input features Figure 4 (a) shows the planktonic bacteria species. Figure 4 (b) shows the potential features after dimensionality reduction. Figure 4 (c) shows the environmental features. In the figure, “Class” represents the different categories output by the model. Because this is a multi-classification problem, the model may output probability distributions for multiple categories. Each color corresponds to a category (Class), for example Figure 4(a) shows 20 classes (from Class 0 to Class 19). In this case, the classes may be different bacterial phyla. The figure ranks the "importance" of the input features. From top to bottom, the features have a decreasing impact on the output of the model. Year, water temperature, and C / P are the three most important environmental features. The weights of environmental factors in the prediction model reflect to a certain extent the impact of environmental factors on the corresponding prediction targets. For example, the biogeographic pattern (geographic distance, elevation, longitude and latitude) has a relatively important impact on the prediction of planktonic bacterial community composition, further indicating that spatial variation has largely caused changes in the composition of planktonic bacterial communities, which is similar to the results of Liu et al.'s article "Integrated biogeography of planktonic and sedimentary bacterial communities in the Yangtze River" published in the journal Microbiome in 2018.
[0042] 5. According to the results of the previous step, select the main environmental features and train the prediction model of the bacterial plankton community with fewer environmental features. In this embodiment, "YEAR", "WT", "Pre", "C / P" and "distance" are selected. The Bray-Curtis dissimilarity in the test results is 0.1933 and the Pearson correlation coefficient is 0.9153. In addition, the five environmental data of the sample points that need to be predicted can be collected to obtain the river bacterial plankton community structure of the corresponding points. The obtained results are saved in the corresponding tsv file for further analysis.
[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for predicting river planktonic bacterial community composition based on an artificial neural network autoencoder, characterized by: The method comprises the following steps: Collect relevant environmental and biological data; Perform data preprocessing; Divide the training set and the test set; Use autoencoder models to construct a latent space of environmental elements and biome composition, optimize the model and evaluate its performance; Use SHAP values to interpret the model and understand the impact of environmental factors on model predictions; Among them, environmental factors include water environment and meteorological data, and biological data include relative abundance data of planktonic bacterial OTU.
2. The method for predicting river planktonic bacterial community composition based on an artificial neural network autoencoder according to claim 1, characterized in that: The data preprocessing includes checking data validity, removing erroneous data and empty data, unifying dimensions, and adopting standardization, minimum-maximum normalization, mean normalization or logarithmic normalization methods.
3. The method for predicting river planktonic bacterial community composition based on artificial neural network autoencoder according to claim 1, characterized in that: The indicators for optimizing the model and evaluating its performance include mean absolute error, mean square error, mean absolute percentage error, Pearson correlation coefficient, Bray-Curtis dissimilarity and root relative square error.
4. The method for predicting river planktonic bacterial community composition based on artificial neural network autoencoder according to claim 1, characterized in that: In the divided training set and test set, a first encoder, a second encoder and a decoder are designed, the first encoder takes the abundance of planktonic bacteria OTU as an input feature and converts it into a latent space LSOTU; the second encoder takes environmental factors as input features and converts them into a latent space LSEF; The decoder converts the latent space into bacterioplankton abundance; The first encoder and the second encoder are trained as a predictor. During the training process, the latent spaces of the two encoders are forced to be similar, that is, as part of the loss function, the difference between the two latent spaces is minimized to create the latent space of LSOTU (combined latent space, LScomb) for the environment variables. The final model integrates a predictor and a decoder. The predictor returns LScomb from environmental factors, and the decoder returns the predicted relative abundance of bacterial planktonic OTUs from LScomb.
5. The method for predicting river planktonic bacterial community composition based on artificial neural network autoencoder according to claim 4, characterized in that: The performance evaluation of the model on the test set includes calculating the scores of various evaluation indicators; the SHAP (Shapley Additive Explanations) method is used to explain the model and analyze the impact of each environmental factor on the model prediction results; the calculation of the SHAP value is based on the following formula: Among them, N is the set of all features, S is the feature subset that does not contain feature i, φ i (f) is the SHAP value of feature i, and f(S) is the predicted output of the model given the feature subset S; Save the trained encoder and decoder models for subsequent use. By inputting new environmental factors, the model predicts the biological community composition of new samples.
6. The method for predicting river planktonic bacterial community composition based on artificial neural network autoencoder according to claim 1, characterized in that: The environmental factors also include geographical factors, hydrological parameters and physical and chemical indicators.
7. The method for predicting river planktonic bacterial community composition based on artificial neural network autoencoder according to claim 5, characterized in that: The evaluation indicators also include scale-independent indicators, specifically Pearson Correlation, Bray-Curtis Dissimilarity and Root Relative Squared Error (RRSE).
Citation Information
Patent Citations
Method and device for analyzing microbial community composition
CN104039982A
Real-time prediction method and system for relative abundance of pathogenic vibrios on marine microplastics
CN114242156A
Multi-omics and phenotype association mining method based on interpretable auto-encoder
CN115691677A
Underground water pollution natural attenuation capability prediction method and model training method
CN115994570A
Nearshore phytoplankton community structure prediction method based on attention mechanism
CN118261203A
Cited By
Intelligent prediction method and system for spatial distribution of environmental flora
CN121215017A
