Fairness-aware graph classification model construction method for imbalanced microbiome data
Patent Information
- Application Number
- HK32026119547
- Authority / Receiving Office
- HK · HK
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2026-02-24
- Publication Date
- 2026-09-11
Abstract
Description
This invention relates to the fields of bioinformatics and machine learning, and specifically to a method for constructing a fairness-aware graph classification model for imbalanced microbial data. Background: Human gut microbiome data is of significant value in disease diagnosis, but microbial abundance data often exhibits high dimensionality, sparsity, and class imbalance (e.g., few samples of rare species). Traditional methods such as random forests or deep neural networks struggle to capture complex interactions between species and are prone to bias towards the majority class, leading to decreased prediction performance for the minority class. Existing technologies, such as the GMRepo database, provide metagenomic data but lack fairness optimization for imbalanced data. While graph neural networks can model network structure, they do not integrate fairness constraints. Therefore, a method for constructing a fairness-aware graph classification model for imbalanced microbial data is urgently needed. Summary of the Invention: The purpose of this invention is to provide a method for constructing a fairness-aware graph classification model for imbalanced microbial data to address the classification bias problem caused by imbalanced microbial data. This method integrates microbial interactions through a species co-occurrence network graph, utilizes GNNs to learn embedded representations, and designs a microbial fairness loss function to dynamically adjust the decision boundary. To achieve the above objectives, the present invention provides the following technical solution: A method for constructing a fairness-aware graph classification model for imbalanced microbial data, comprising the following steps: 51. Acquiring microbial abundance data and patient feature data, wherein the microbial abundance data includes a species abundance matrix from gut microbiome sequencing, and the patient feature data includes electronic health records; 52. Constructing a microbial interaction network, wherein microbial species are represented as nodes, node features are initialized as species abundance, edges represent co-occurrence relationships between species, and edge weights are calculated based on co-occurrence frequencies; 53. Processing the microbial interaction network using a graph neural network to learn microbial embedding representations and obtain molecular-level embedding representations; 54. Concatenating the microbial embedding representations with the embedding representations of patient feature data to form a holistic patient representation; 55. Inputting the holistic patient representation into a prediction model for disease prediction, and introducing a fairness-aware loss function to optimize the model to address the data imbalance problem; 1 HK 30137553 A Specification S6. Generating a disease prediction report based on the prediction results. Preferably, in step S1, the microbial abundance data is obtained through high-throughput sequencing technology and preprocessed, including removing low-abundance species, processing outliers, and standardizing abundance values; the patient characteristic data includes age, gender, and body mass index, and is converted into numerical vectors through embedding layers or normalization processing.Preferably, in step S2, the calculation of said edge weights is based on co-occurrence statistics, and the formula is: γ(speciesᵢ, speciesⱼ), wherein the co-occurrence frequency is determined by counting the occurrences of species in the same sample; said microbial interaction network is further optimized by applying threshold filtering or similarity indexes. Preferably, in step S3, said graph neural network employs a graph convolutional network, a graph attention network or a GraphSAGE model. Preferably, in step S4, said concatenation operation is implemented via vector concatenation, and the formula is: hᵖₐₜᵢₑₙₜ = hₘₒₗₑcᵤₗₐᵣ ⊕ h_EHR, wherein ⊕ represents a vector concatenation operation, hₘₒₗₑcᵤₗₐᵣ is a microbial embedding representation, and h_EHR is a patient feature embedding representation; an attention mechanism is further introduced to dynamically adjust feature contribution. Preferably, in step S5, said prediction model is a feedforward network comprising 1 to 3 hidden layers, with an activation function being ReLU or Sigmoid, and an output layer being Softmax; said fairness-aware loss function is designed based on label distribution-aware margin loss, and the formula is: ℒ = -log[ exp(s_y - γ - Cn_y) / (exp(s_y - γ - Cn_y) + Σ_{j≠y} exp(s_j)) ], wherein s_y corresponds to the logit of the correct microbial species y, γ is a species sensitivity threshold, n_y is the abundance of species y, and C is a hyperparameter. Preferably, the value range of said hyperparameter C is 0.1 to 1.0, and the value range of γ is 10 to 30; said loss function is further combined with an oversampling technique to handle data imbalance. Preferably, in step S6, said disease prediction report comprises a risk score, a key microbial marker analysis and a visual chart; said key microbial markers are identified by feature importance analysis, such as Fusobacterium nucleatum or Bacteroides fragilis. The present invention further discloses an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above fairness-aware graph classification model construction method for imbalanced microbial data when executing the computer program. The present invention further discloses a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above fairness-aware graph classification model construction method for imbalanced microbial data when executed by a processor. In the above technical solution, the technical effects and advantages of the present invention are: By constructing a microbial species co-occurrence network graph, using a graph neural network to learn embedding representations, and dynamically adjusting class weights in combination with a fairness-aware loss function, the problem of bias toward minority-class samples in high-dimensional sparse data is effectively solved, thereby improving the model's ability to recognize rare species. In addition, the present solution enhances the generalization ability and robustness of the model by integrating patient electronic health record data and microbial embeddings, which is superior to traditional methods, and can be extended to other disease scenarios such as non-alcoholic fatty liver disease, thus having wide applicability.Figure 1 is a schematic flowchart of the method for constructing a fairness-aware graph classification model for imbalanced microbial data according to the present invention; Figure 2 is a schematic flowchart of the workflow of the method for constructing a fairness-aware graph classification model for imbalanced microbial data according to the present invention. Detailed Description of Embodiments The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present invention. The present invention will now be further described with reference to the accompanying drawings and specific embodiments. As shown in Figure 1, a method for constructing a fairness-aware graph classification model for imbalanced microbial data according to an embodiment of the present invention includes the following steps: S1, acquiring microbial abundance data and patient characteristic data. Specifically, microbial abundance data includes species abundance matrices from gut microbiome sequencing, where each sample corresponds to the abundance values of multiple microbial species. This data can be obtained through high-throughput sequencing technologies (such as Illumina sequencing) and stored in CSV or matrix format. Patient characteristic data includes electronic health records (EHRs), such as age, sex, body mass index (BMI), medical history, and lifestyle information. This data is stored in tabular form after standardized preprocessing (such as normalization and missing value imputation). Data sources may include public databases (such as GMRepo) or clinical collection systems to ensure data quality and consistency. 511. Data Collection: Collect microbiome data from multiple sources, including metagenomic sequencing results from fecal samples. Specifically, the number of samples can range from thousands to tens of thousands. For example, the colorectal cancer (CRC) dataset contains 36,000 samples covering 663 microorganisms; the non-alcoholic fatty liver disease (NAFLD) dataset contains 25,000 samples covering 550 microorganisms. Ethical guidelines must be followed during data collection, and patient information must be anonymized. 512. Data Preprocessing: Cleaning and transforming the raw data. Specifically, this includes removing low-abundance species (e.g., species with abundance below 0.01%), handling outliers (using Z-score or IQR methods), and standardizing abundance values (e.g., through log transformation or relative abundance calculation). Patient EHR data needs to be coded, for example, converting categorical variables (e.g., gender) to numerical values and scaling continuous variables (e.g., age) to a uniform range. S2. Constructing a microbial interaction network.Specifically, microbial species are represented as nodes, and node features are initialized as species abundance. Edges represent co-occurrence relationships between species, and edge weights are calculated based on co-occurrence frequency. For example, the weight value can be determined by counting the number of times a species appears in the same sample, using the formula: w^(speciesj). After the network is constructed, a graph structure G=(V,E) is formed, where K is the set of nodes and E is the set of edges. The network construction can be further optimized, for example, by using Jaccard similarity or Pearson correlation coefficient as supplementary indicators for edge weights. 521. Node Definition: Each node corresponds to a microbial species, and the node feature vector contains species abundance information. Specifically, the species list can be obtained from a standard database (such as NCBI Taxonomy) to ensure the uniqueness of species identification. In the node feature moments, N is the number of species, and dv is the feature dimension (usually 1, representing the abundance value). 522. Edge Weight Calculation: Edge weights are determined based on co-occurrence statistics. Specifically, the co-occurrence frequency can be quantified by calculating the probability of species pairs appearing simultaneously in the sample, using the formula: w = co-occurrence frequency. To enhance the robustness of the network, threshold filtering (e.g., retaining only edges with weights greater than 0.1) can be applied, or a Gaussian kernel function can be used to smooth the weights. 523. Network Validation: Perform quality checks on the constructed network. Specifically, evaluate the network structure using network metrics (e.g., node degree distribution, clustering coefficient) to ensure it conforms to microbial ecological characteristics. If anomalies are found, the weight calculation method can be adjusted or prior knowledge (e.g., phylogenetic trees) can be introduced. The network construction process in step S2 above can be referenced in Figure 2, which shows the graph structure with microbial species as nodes and co-occurrence relationships as edges. 53. Use graph neural networks to learn microbial embedding representations. Specifically, apply graph convolutional networks (GNNs) to process the microbial graph and learn the latent embedding vector for each node. The input to a GNN is the node feature matrix ^Xspecies and the graph structure G, and the output is a molecular-level embedding representation. Its computation process is: Hmolecular(G, XSpecjes). GNN layers can include multiple rounds of message passing and aggregation operations to capture complex interactions between microorganisms. GNN models can choose variants such as GCN, GraphSAGE, or GAT, and the number of layers (e.g., 2-3 layers) and activation function (e.g., ReLU) can be adjusted according to the task. 531. GNN Model Setup: Choose a suitable GNN architecture. Specifically, for microbial networks, the GCN model is commonly used, and its graph convolutional layer formula is: where 2 is the adjacency matrix with added self-loops, 5 is the degree matrix, is the embedding of the first-layer nodes, _ is the trainable weight, and is the activation function. The embedding dimension is usually set to 128-256 dimensions to balance expressive power and computational efficiency. 532. Training Process: Supervised or self-supervised training of the GNN.Specifically, cross-entropy loss or contrast learning objective is used, Adam is selected as the optimizer, the learning rate is set to 0.001-0.01, and the number of training epochs is 50-100. To prevent overfitting, Dropout (with a rate of 0.2-0.5) or L2 regularization can be introduced. 533. Embedding extraction: obtain node embeddings from the output of GNN. Specifically, Hmaieeu / a can be used as a low-dimensional representation of microbial species for downstream tasks. Embedding quality can be evaluated by visualization (such as t-SNE) or clustering. 54. Integrate patient characteristics and microbial embeddings to form patient representation. Specifically, the microbial embedding Hmolecular obtained in step S3 is spliced with the embedding representation of patient EHR data to form a comprehensive patient representation vector, the formula is: Hpatient = Hmolecular ⊕ EHR, HK 30137553 A Description where ⊕ represents the vector concatenation operation. Patient EHR data can be converted into a numerical vector through an embedding layer, for example, a fully connected network is used for feature extraction, and categorical variables (such as disease history) are mapped into dense vectors. 541. Patient feature embedding: encode EHR data. Specifically, an embedding layer or one-hot encoding is used to process categorical features, and continuous features are directly normalized. The embedding dimension can be set according to feature complexity, for example, age and BMI can be mapped into 16-dimensional vectors. 542. Splicing operation: merge microbial embeddings and patient embeddings. Specifically, ensure that the dimensions of the two embedding vectors are compatible, for example, splicing after adjusting the dimensions through linear projection. The dimension of the vector after splicing can be 256-512 dimensions, which is used as the overall representation of the patient. 543. Feature fusion optimization: to improve the fusion effect, an attention mechanism can be introduced. Specifically, weighted summation or Transformer module is used to dynamically adjust the contribution of microorganisms and patient characteristics. S5. Perform disease prediction and optimize the model. Specifically, the patient representation is input into a feed-forward network (FFN) for classification prediction, and the prediction label ŷ is output, the formula is ŷ=FFN(Hpatient). Meanwhile, a fairness-aware loss function (MFL) is introduced to solve the problem of data imbalance. The loss function is designed based on label distribution-aware margin loss (LDAM), the formula is: L_MFL = log(1+exp(s(h_y - ~y - Δ))) + C exp(-s_h n_y) where h_y corresponds to the logit of the correct microbial species y, Δ is the species sensitivity threshold, n_y is the abundance of species y, C is a hyperparameter (usually set to 0.1-1.0), and s is a scaling factor (usually set to 10-30). This loss function ensures that rare microbial species receive more attention during training and improves the generalization ability of the model.551. Prediction Model Setup: The FFN can contain 1-3 hidden layers, with 64-128 neurons per layer. The activation function is ReLU or Sigmoido, and the output layer is Softmax, used for binary classification (disease / health). Model training uses batch gradient descent with a batch size of 32-64. 552. Loss Function Optimization: MFL parameter tuning is performed through cross-validation. Specifically, hyperparameters C and s are chosen based on the dataset distribution; for example, in the CRC dataset, C=0.5, s=20; in the NAFLD dataset, C=0.3, s=25. To handle extreme imbalances, oversampling techniques (such as SMOTE) can be combined. 553. Model Evaluation: Performance is evaluated using metrics such as accuracy (ACC), PRAUC, and F1 score. Specifically, metrics are calculated on the test set and compared with baseline models (such as Random Forest, DNN, GCN) to ensure GutGraph's advantages. 6 HK 30137553 A Instruction Manual S6, Generating a Disease Prediction Report. Specifically, after the model training is completed, it is applied to new patient data, outputting prediction results and key microbial biomarker analysis, such as identifying disease-related microbial species (e.g., Fusobacterium nucleatum), and generating a visual report for clinical decision support. The report may include risk scores, confidence intervals, and recommended measures. 561, Result Output: The prediction results are presented in probability form, for example, a disease probability greater than 0.5 is considered positive. At the same time, feature importance analysis is output, highlighting key microbial nodes. 562, Report Generation: A structured report is created, including text summaries and charts (e.g., microbial network diagrams). The report format can be PDF or an interactive web interface for easy use by doctors. The above steps constitute the core process of this invention. For further detailed explanation, the following description is based on several embodiments. Embodiment 1: Application of Colorectal Cancer (CRC) Prediction In this embodiment, the invention is applied to a CRC dataset containing 36,000 samples and 663 microorganisms. Data preprocessing includes removing low-abundance species and standardization. When constructing the microbial network, edge weights were calculated using Jaccard similarity with a threshold of 0.05. The GNN model employed a 2-layer GCN with an embedding dimension of 128, trained using the Adam optimizer with a learning rate of 0.005 and 80 epochs. The fairness loss parameters were set to C=0.5 and s=20. After integrating patient EHR (age, sex, BMI), the FFN output the prediction results. Experiments showed that this embodiment achieved a PRAUC of 0.8084 and an F1 score of 0.9351 on the test set, outperforming the baseline model. Example 2: Non-alcoholic fatty liver disease (NAFLD) prediction application. This embodiment targets the NAFLD dataset, with 25,000 samples and 550 microbial species. Pearson correlation coefficients were introduced as supplementary edge weights in the network construction.The GNN uses the GAT model to capture the attention mechanism, with an embedding dimension of 256. The loss function parameters are C=0.3 and s=25. Liver function indicators are added as patient features to improve representation ability. The results show a PRAUC of 0.8021 and an H-score of 0.9284, validating the generalization ability of the invention. Example 3: Personalized Medicine Case. Taking a 55-year-old male patient from Hong Kong as an example, his fecal sample was sequenced using MGI to obtain microbial data. After constructing the network, GutGraph identified overrepresentation of *Fusobacterium nucleatum*, consistent with clinical CRC. The prediction probability was 0.85, and a report was generated recommending colonoscopy. This example demonstrates the practicality of the invention in a real-world scenario. The invention can also be implemented in variations, such as using the GraphGPT framework to integrate a large language model, or introducing multi-task learning to handle concurrent diseases. These variations all fall within the scope of protection of this invention. 7 HK 30137553 A Specification The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention. 8 HK 30137553 A Claim 1. A method for constructing a fairness-aware graph classification model for imbalanced microbial data, characterized by comprising the following steps: 51. Acquiring microbial abundance data and patient feature data, wherein the microbial abundance data includes a species abundance matrix from gut microbiome sequencing, and the patient feature data includes electronic health records; 52. Constructing a microbial interaction network, wherein microbial species are represented as nodes, node features are initialized as species abundance, edges represent co-occurrence relationships between species, and edge weights are calculated based on co-occurrence frequencies; 53. Processing the microbial interaction network using a graph neural network to learn microbial embedding representations and obtain molecular-level embedding representations; 54. Concatenating the microbial embedding representations with the embedding representations of the patient feature data to form a holistic patient representation; 55. Inputting the holistic patient representation into a prediction model for disease prediction, and introducing a fairness-aware loss function to optimize the model to address the data imbalance problem; 56. Generating a disease prediction report based on the prediction results. 2. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S1, the microbial abundance data is obtained through high-throughput sequencing technology and preprocessed, including removing low-abundance species, processing outliers, and standardizing abundance values; the patient characteristic data includes age, gender, and body mass index, and is converted into a numerical vector through embedding layers or normalization processing.3. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S2, the edge weights are calculated based on co-occurrence statistics, with the formula: % = co-occurrence(specieSbSpeciesj), where the co-occurrence frequency is determined by the number of times a species appears in the same sample; the microbial interaction network is also optimized using threshold filtering or similarity indicators. 4. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S3, the graph neural network uses a graph convolutional network, a graph attention network, or a GraphSAGE model. 5. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S4, the splicing operation is implemented through vector concatenation, with the formula: ient ~^molecular ㊉^^EHR, where ㊉ represents the vector concatenation operation, is the microbial embedding representation, and is the patient feature embedding representation; an attention mechanism is also introduced to dynamically adjust the feature contribution. 6. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S5, the prediction model is a feedforward network containing 1-3 hidden layers, the activation function is ReLU or Sigmoid, and the output layer is Softmax; the fairness-aware loss function is designed based on label distribution-aware edge loss, and the formula is: ^(hy-Ay) rA4FZ, log ... 8. A method for constructing a fairness-aware graph classification model for imbalanced microbial data according to claim 1, characterized in that, in step S6, the disease prediction report includes a risk score, key microbial biomarker analysis, and a visualization chart; the key microbial biomarkers are identified through feature importance analysis, such as *Fusobacterium nucleatum* or *Bacteroides fragilis*. 9. An electronic device, characterized in that it includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method for constructing a fairness-aware graph classification model for imbalanced microbial data according to any one of claims 1-8.2 HK 30137553 A Instruction Manual Appendix Figure 1 1 HK 30137553 A Fusobacterium nucleatum molecular characterization age gender patient characterization microbial equity loss node: micro-principles object degree edge: based on co-occurrence and correlation relationship weak similar rods release Escherichia coli function forward propagation neural network Gut intestinal species abundance embedding hemp 4 cross reference, ! 1 , Pu exhibition electronic health record data embedding BMI HK 30137553 A 2.
