A disease risk prediction method and system based on balancing neighbor perception and metric learning

By employing neighbor perception and metric learning methods, a two-layer GCN network is constructed to balance patient relationship graph data, solving the problem of minority class patient identification in imbalanced data, improving identification ability and graph structure integrity, while reducing computational complexity.

CN120727290BActive Publication Date: 2025-12-30YANTAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511134014.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-14
Publication Date
2025-12-30
Estimated Expiration
2045-08-14

AI Technical Summary

Technical Problem

Existing technologies, when dealing with imbalanced patient relationship graphs, suffer from problems such as the standard GNN model being biased towards the majority class, graph data resampling methods disrupting graph structure, and dedicated imbalanced graph learning models having high computational costs, making it difficult to effectively identify minority class disease nodes.

Method used

We employ a method based on balanced neighbor perception and metric learning. By balancing data through a neighbor perception strategy, we construct a two-layer GCN network model and optimize feature representation using a triplet loss function to improve the identification ability of minority patients.

Benefits of technology

It improves the ability to identify minority patients, maintains the authenticity and integrity of the graph structure, generates highly discriminative feature representations, and reduces computational complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120727290B_ABST
    Figure CN120727290B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer disease prediction, in particular to a disease risk prediction method and system based on balanced neighbor perception and metric learning. The method comprises the following steps: constructing an undirected graph based on an obtained medical clinical statistical data set; balancing the data of the undirected graph by using a neighbor perception strategy; constructing a double-layer GCN network model; training the double-layer GCN network model by using the balanced data; and evaluating the deep influence between nodes by calculating a high-order adjacency matrix. The method can identify those patients who are most closely related to the "disease" group in structure and improve their status in training.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer disease prediction, and in particular to a disease risk prediction method and system based on balanced neighbor perception and metric learning. BACKGROUND

[0002] With the development of medical informatization, researchers can construct patient relationship graphs to conduct disease prediction and transmission analysis. In such graphs, nodes represent patients, and edges represent contact, social, or genetic relationships between patients. Graph neural networks (GNNs), as an emerging technology, have been widely used in learning tasks on graph-structured data (such as patient relationship graphs), especially in patient risk classification. GNNs are powerful tools for processing such graph data, which can predict unknown label nodes (e.g., predict whether a patient has a certain disease) by learning node features and graph structures.

[0003] However, in real disease prediction scenarios, data class imbalance is very common. For example, when the class distribution of patient health status is uneven, the imbalanced graph data and the information transmission method of GNNs can significantly affect the decision boundary. In the absence of sufficient prior knowledge, these methods can exacerbate the overfitting or underfitting problems of the model. This poses a great challenge to the prior art, which is embodied in the following aspects:

[0004] 1. Inherent bias problem of standard GNN models: Traditional graph neural networks naturally bias towards the majority class (e.g., the "healthy" population) when dealing with imbalanced data. More seriously, the message passing-based mechanism on which GNNs rely further amplifies this bias because it disproportionately transmits more information from majority class nodes when aggregating neighbor information in the graph, thereby suppressing the effective feature expression of minority class nodes (e.g., the "sick" population) even more.

[0005] 2. Structural distortion problem of graph data resampling methods: When trying to apply traditional oversampling techniques to graph data, new and unique challenges are encountered. On the one hand, such methods tend to overgeneralize when synthesizing new patient samples for the minority class, i.e., blindly expanding in the feature space without fully considering the actual distribution of majority class patients, which can generate ambiguous boundary samples. On the other hand, in order to maintain the integrity of the graph, these methods must create new contact relationships for the synthesized new patients out of thin air. This usually relies on a link prediction model, but in real graphs with sparse connections, the accuracy of link prediction is often low, resulting in the creation of a large number of unreasonable and incorrect connections, which in turn destroys the original graph structure information.

[0006] 3. Inherent limitations of specialized unbalanced graph learning models: Even some complex models designed specifically for unbalanced graph data have their own limitations. Some methods have inaccurate initial feature representations of minority patients during the learning process, and subsequent optimization steps are highly dependent on these inaccurate representations, leading to further accumulation and amplification of errors. Some other methods introduce extremely complex processing procedures (such as embedding clustering, knowledge distillation, etc.) to improve performance, but this not only significantly increases the computational cost, making it difficult to apply to large-scale patient relationship graphs, but also makes the model extremely sensitive to the setting of hyperparameters, making it difficult to optimize and deploy in practical applications.

[0007] Therefore, how to effectively and accurately identify minority patients with diseases in a class extremely unbalanced patient relationship graph is still a key technical problem to be solved. SUMMARY

[0008] In order to solve the above-mentioned problems, the present application provides a disease risk prediction method and system based on balanced neighbor perception and metric learning.

[0009] In a first aspect, the present application provides a disease risk prediction method based on balanced neighbor perception and metric learning, which adopts the following technical solution:

[0010] A disease risk prediction method based on balanced neighbor perception and metric learning comprises:

[0011] Obtaining a medical clinical statistical data set;

[0012] Constructing an undirected graph based on the obtained medical clinical statistical data set;

[0013] Balancing data of the undirected graph by using a neighbor perception strategy;

[0014] Constructing a double-layer GCN network model;

[0015] Training the double-layer GCN network model by using the balanced data;

[0016] Using the trained model to predict disease risk.

[0017] Further, the construction of the undirected graph based on the obtained medical clinical statistical data set comprises setting an undirected graph , wherein represents an original patient contact relationship matrix, representing the contact relationship between patients, in the original patient contact relationship matrix, =1 indicates that the th patient has direct contact with the th patient; if = 0, it means that two patients have no direct contact, except the original patient contact relationship matrix , represents the feature matrix, where each row represents the features of a patient, is the dimension of the feature, is the set of health status labels of the part of confirmed patients, the value range of , refers to the index set of all patients belonging to the health status category .

[0018] Further, the data balancing of the undirected graph using the neighbor-aware strategy includes introducing an awareness coefficient as a hyperparameter, and calculating the target number of patients that need to be included in each health status category: wherein, is the set of patients in category , is the awareness coefficient, is the total number of categories, and using the neighbor-aware strategy to select unconfirmed patients that are most closely associated with it on the contact relationship network and supplement them to the training set of the category, thereby achieving the balancing of the training set.

[0019] Further, the data balancing of the undirected graph using the neighbor-aware strategy also includes, for quantifying the influence between patients and extracting features, the neighbor-aware strategy is based on the original patient contact relationship matrix to calculate the normalized patient contact relationship matrix , which is represented as: wherein, is the self-loop matrix of , and is the degree matrix, and the normalized adjacency matrix is raised to the power to represent the order neighbor information, which is represented as: In the th layer, the embedded features of the patients are obtained by multiplying the high-order contact relationship matrix and the original feature matrix , which is represented as: .

[0020] Further, the data balancing of the undirected graph using the neighbor-aware strategy also includes, when the neighbor-aware gets the high-order contact relationship matrix according to the formula, then simultaneously performing node exploration and embedded feature calculation, in the normalized adjacency matrix Each row represents the exploration frequency of a node to other nodes, and the risk correlation score matrix is calculated to evaluate the degree of influence of each undiagnosed patient on a specific category, represents an undiagnosed patient is affected by a disease category The cumulative score of all patients in the category is represented as: where is the index set of the category node.

[0021] Further, the data balancing of the undirected graph using the neighbor-aware strategy further includes directly performing a row summation operation on the using the neighbor-aware strategy according to the category index to obtain , which represents the row of the count matrix, and is represented as: where represents the row of , where, for the disease category , the indices of the top unddiagnosed patients with the highest scores in the risk correlation row vector are selected and added to the set of the category . If the current processed category is the category, the embedding features and disease labels of the newly screened high-risk patients are added to the new training set, which is represented as:

[0022] ,

[0023] where and are initialized as empty sets, represents a label set containing elements, and all elements are .

[0024] Further, the training of the double-layer GCN network model using the balanced data includes introducing a triplet loss function to adjust the relationship between the minority class patients and their neighbors by pulling the same class patients closer and pushing the different class patients away, and the feature distance function between patients is where the features of two nodes are , and the cosine distance between each pair of nodes is calculated by the formula, which is represented as: In the method, the minority class patient sample is defined as an anchor patient, and for each anchor node, the is started from the middle, and the same class patients of the 1-hop neighbors are taken as positive samples , the heterogeneous patients as negative samples , construct neighbor-based triplet loss pairs, and the corresponding neighbor-based triplet loss function is defined as:

[0025] .

[0026] Further, the training of the double-layer GCN network model using the balanced data further includes fitting the re-balanced training patient data using the neighbor-based triplet loss function, denoted as:

[0027] ,

[0028] wherein a neural network for extracting feature representation.

[0029] Further, the disease risk prediction using the trained model includes comparing the predicted labels with the true labels, calculating the F1 score and the Matthews correlation coefficient (MCC) to comprehensively measure the true prediction ability of the model on unbalanced data, wherein the F1 value is denoted as:

[0030] ,

[0031] wherein, TP represents the number of correctly classified positive samples, FP represents the number of misclassified negative samples as positive samples, and FN represents the number of misclassified positive samples as negative samples; the MCC is used to measure the correlation between the prediction results and the actual labels, and is denoted as:

[0032] ,

[0033] wherein, TN represents the number of correctly classified negative samples; and the homophily score and the true positive (TP) index are used to measure the degree of connection between nodes of the same class in the graph data and the ability of the model to correctly classify nodes of a certain class, and are denoted as:

[0034] ;

[0035] .

[0036] In a second aspect, a disease risk prediction system based on balanced neighbor perception and metric learning includes:

[0037] A data acquisition module configured to acquire a medical clinical statistical data set;

[0038] A preprocessing module configured to construct an undirected graph based on the acquired medical clinical statistical data set;

[0039] The balance module is configured to balance data of the undirected graph by using a neighbor-aware strategy.

[0040] The model construction module is configured to construct a double-layer GCN network model.

[0041] The training module is configured to train the double-layer GCN network model by using the balanced data.

[0042] The prediction module is configured to perform disease risk prediction by using the trained model.

[0043] In a third aspect, the present application provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor of a terminal device to implement the disease risk prediction method based on balanced neighbor-awareness and metric learning.

[0044] In a fourth aspect, the present application provides a terminal device, which comprises a processor and a computer-readable storage medium, the processor is used to implement instructions, and the computer-readable storage medium is used to store a plurality of instructions, and the instructions are suitable for being loaded and executed by the processor to implement the disease risk prediction method based on balanced neighbor-awareness and metric learning.

[0045] In summary, the present application has the following beneficial technical effects:

[0046] The recognition ability for minority patients is improved. The neighbor-aware strategy of the present application does not passively accept unbalanced data distribution, but actively redefines the importance of each undiagnosed patient based on the topological structure of the patient contact network. By calculating the high-order adjacency matrix to evaluate the deep influence between nodes, the method can identify those patients who are most closely related to the "sick" group in structure, and improve their status in training. In theory, this makes the decision boundary of the model no longer dominated by the original number of patients, but guided by the real epidemiological structural relevance, thereby directly solving the problem that the standard GNN amplifies the influence of the majority class and suppresses the minority class due to message passing.

[0047] The data is balanced while ensuring the authenticity and integrity of the graph structure. The present application avoids the defects of traditional resampling methods in structure design. It does not synthesize any new patient, nor does it create any new contact relationship, and it is a structure-preserving balancing strategy. It completely relies on and trusts the original topological information of the graph, and the core is to identify and "promote" the existing unlabeled patients in the graph that have important structural significance. This design fundamentally avoids the risk of generating ambiguous samples due to "overgeneralization", or destroying the integrity of the graph structure due to relying on unreliable link prediction to "create inaccurate new edges".

[0048] The high-differentiation feature representation is generated and the implementation efficiency is considered. The neighbor-based metric learning module of the application introduces a triplet loss function, and the optimization target is more advanced in theory. It not only makes the model "recognize" the sample, but also actively "reshapes" the multi-dimensional features of the patient in the feature space, that is, it theoretically ensures that the embedding vectors of patients of the same type are more compact, and the embedding vectors of patients of different types are more distant. This makes the final generated minority class patient feature representation more discriminative, directly solving the problem of error accumulation caused by inaccurate initial embedding.

[0049] In addition, unlike other methods that introduce complex processes, resulting in high computational cost and sensitivity to hyperparameters, one of the ingenious designs of the application is to integrate the neighbor-aware process with the message passing process of the GNN (for example, the high-order adjacency matrix is used for both influence calculation and feature propagation). This effectively reduces the additional computational overhead and the complexity of model implementation, improving the practicality of the scheme. BRIEF DESCRIPTION OF DRAWINGS

[0050] Figure 1 is a flowchart of a disease risk prediction method based on balancing neighbor awareness and metric learning according to an embodiment of the application;

[0051] Figure 2 is a model structure example diagram of the application embodiment 1;

[0052] Figure 3 is a homogeneity score and true positive score analysis diagram of the application embodiment 1. DETAILED DESCRIPTION

[0053] The application will be further described in detail below with reference to the accompanying drawings.

[0054] Embodiment 1

[0055] Referring to Figure 1 , the disease risk prediction method based on balancing neighbor awareness and metric learning according to the embodiment includes:

[0056] Obtaining a medical clinical statistical data set;

[0057] Constructing an undirected graph based on the obtained medical clinical statistical data set;

[0058] Balancing the data of the undirected graph by using a neighbor awareness strategy;

[0059] Constructing a double-layer GCN network model;

[0060] Training the double-layer GCN network model by using the balanced data;

[0061] Using the trained model to predict the disease risk.

[0062] Specifically,

[0063] S1. Obtain a medical clinical statistics dataset;

[0064] The data required for this embodiment is derived from anonymized, structured medical information system records, such as electronic health records and hospital information systems. To protect personal privacy, all data is strictly anonymized before being used in this program, and all personal identifiable information (such as name, ID number) is removed and replaced by a unique, meaningless research ID.

[0065] The patient relationship graph is specifically composed as follows: each node in the graph corresponds to a patient with a unique research ID. The node characteristics of each patient is a multi-dimensional vector integrating its multi-modal clinical information, which can specifically include demographic characteristics such as age, gender; clinical signs such as body temperature, blood oxygen saturation; laboratory test results such as white blood cell count, C-reactive protein level; and whether there is a history of diabetes, hypertension, etc. The edges of the graph represent the potential contact relationships between patients, which are inferred from anonymized data, for example, by analyzing the spatiotemporal co-occurrence of two patients visiting the same hospital department within a similar time window, or whether they have the same anonymized address information to construct. Finally, the labels for model training and verification are derived from authoritative diagnostic results, in which patients diagnosed as positive by gold standard methods such as nucleic acid testing are defined as the minority class that needs to be identified, and patients with negative test results constitute the majority class, thus forming the unbalanced dataset required for the study.

[0066] S2. Problem definition and process overview

[0067] Let a undirected graph be given, where denotes the original patient contact relationship matrix, representing the contact relationships between patients. In the original patient contact relationship matrix, =1 indicates that the th patient has had direct contact with the th patient; if =0, it indicates that the two patients have not had direct contact. In addition to the original patient contact relationship matrix , denotes the feature matrix, where each row represents the characteristics of a patient, is the dimension of the feature (e.g., clinical indicators, demographic information, etc.). is the health status label set of some diagnosed patients, for example, the value range of can represent "healthy", "high risk", "infected", etc. categories. refers to the index set of all patients belonging to the health status category .

[0068] The core of this embodiment is to solve the semi-supervised disease risk prediction problem on an imbalanced patient graph. In imbalanced data, if the class distribution imbalance is not considered during the training process, the model may have difficulty accurately classifying minority class samples, because the majority class nodes dominate and suppress the minority class nodes, causing the model to be biased towards the majority class. In real medical data, the number of minority class patients such as "sick" is much less than that of majority class patients such as "healthy", making it difficult for traditional models to accurately identify these minority cases.

[0069] To address this challenge, this paper proposes a balanced neighbor-aware metric learning algorithm (BNML). The overall process is as follows: First, divide the original patient data set into training, validation, and test sets. Next, use the "neighbor-aware" strategy on the training set to filter out potential high-risk patients to build a balanced training set. Then, send this balanced data set into a two-layer GCN model and train it using the "neighbor-based metric learning" strategy. Finally, tune the model through the validation set and classify it on the test set to evaluate its final disease risk prediction performance.

[0070] S3. Neighbor-aware

[0071] The core idea of this section is that if an undiagnosed patient is highly influenced by a certain class of patients (such as the "sick" group), then he himself is more likely to belong to that category. The main task of neighbor-aware is to identify these patients who are frequently perceived by a specific category and assign them to that category, thereby creating a balanced training scenario. The neighbor-aware strategy introduces a hyperparameter - the perception coefficient , and uses the following formula to calculate the target number of patients to be included for each health status category:

[0072] (1)

[0073] where is the set of patients in category , is the perception coefficient, is the total number of categories. For each health status category (especially the minority class "sick"), the neighbor-aware strategy will select The training set is balanced by adding the undiagnosed patients who are most closely associated with the patient on the contact network to the training set for that category.

[0074] To quantify influence among patients and extract features, the neighbor-aware strategy is based on the original patient contact relationship matrix. Calculate the normalized patient contact relationship matrix The calculation formula is as follows:

[0075] (2)

[0076] in, for The self-loop matrix, It is a degree matrix.

[0077] Furthermore, neighbor perception can also improve the normalized adjacency matrix to The power of 1, to represent the 1st power. Rank neighbors (i.e., those who pass through no more than) Information generated through indirect contact by an intermediary, calculated using the following formula:

[0078] (3)

[0079] In the In the layer, the patient's embedded features It can be achieved through a higher-order contact matrix With the original feature matrix Multiplying them together, the calculation formula is as follows:

[0080] (4)

[0081] When the neighbor perception obtains the higher-order contact relationship matrix according to formula (3) Then, it will simultaneously perform node exploration and embedded feature computation. In the normalized adjacency matrix... In the matrix, each row represents the frequency with which a node explores other nodes. To assess the impact of a specific category (such as "illness") on each undiagnosed patient, the algorithm calculates a risk association score matrix. In the counting matrix, Indicates undiagnosed patients Subject to the "illness" category The cumulative score representing the impact on all patients. The calculation formula is as follows:

[0082] (5)

[0083] in For the first The index set of class nodes. Generally, a higher value indicates that the patient has a higher risk of disease.

[0084] The formula (5) gives the calculation process of each element, which reflects the meaning of each node count matrix. Neighbor awareness can directly perform row summation operation on . Then can be obtained, which represents the th row of the count matrix, and its calculation method is as follows:

[0085] (6)

[0086] where represents the th row of . For the "disease" class , the algorithm selects the indexes of the top undiagnosed patients in the risk correlation row vector of the class, and adds them to the set of the class .

[0087] (7)

[0088] If the current processed class is the th class, the embedding features and "disease" label of the newly screened high-risk patients are added to the new training set, and the process can be represented as:

[0089] (8)

[0090] where and are initialized as empty sets, and this process is performed for each class. represents a label set containing elements, and all elements are .

[0091] S4. Build a double-layer GCN model

[0092] (1) Build the first layer of graph convolution:

[0093] The model first builds a graph convolution layer. The parameters of this layer are set to receive the original patient features (dimension nfeat) as input, and linearly transform them to a hidden feature space with dimension 256 (nhid).

[0094] (2) Build the second layer of graph convolution:

[0095] Next, the model constructs a second graph convolutional layer. The input dimension of this layer is set to the output dimension of the first layer (256), and is responsible for further mapping these hidden features to a final embedding vector space of dimension 128 (nembed).

[0096] (3) Constructing the linear output layer:

[0097] After the graph convolutional layers, the model constructs a standard linear fully connected layer. The function of this layer is to serve as the final classifier, which receives the 128-dimensional embedding vectors from the second layer and maps them to the final classification dimension (nclass), which is equal to the total number of health status categories.

[0098] (4) Defining the Dropout rate:

[0099] During the model construction, a Dropout rate parameter is also defined, with a value of 0.3 according to experimental settings, which is used for regularization during the training process.

[0100] After the above construction process, a network structure composed of three core functional modules is finally formed:

[0101] (1) First convolutional module:

[0102] Composition: composed of a graph convolutional layer, a ReLU activation function, and a Dropout layer in series.

[0103] Connection relationship: This module receives the original input of the model (patient features X and adjacency matrix A), and its output is connected to the input end of the second convolutional module.

[0104] Dimension transformation: In terms of structure, it transforms the dimension of the input features from nfeat to 256.

[0105] (2) Second convolutional module:

[0106] Composition: Similar to the first module, it is composed of a graph convolutional layer, a ReLU activation function, and a Dropout layer in series.

[0107] Connection relationship: This module receives the output of the first convolutional module, and its own output is connected to the input end of the linear output module.

[0108] Dimension transformation: In terms of structure, it transforms the 256-dimensional input features into 128-dimensional final embedding vectors.

[0109] (3) Linear output module:

[0110] Composition: composed of a linear fully connected layer.

[0111] Connection: This module receives the embedding vectors outputted by the second convolutional module and produces the final output of the whole model.

[0112] Dimension transformation: In structure, it transforms the inputted 128-dimensional embedding vectors into nclass-dimensional prediction scores.

[0113] S5. Neighbor-based metric learning

[0114] In addition to the neighbor-awareness mentioned above, this part proposes a method based on metric learning, whose core idea is to improve the prediction performance of the model by adjusting the embedding positions of the minority class patient samples in the training data. In order to solve the "over-smoothing" problem caused by the high mixing of patients with different health conditions in features, this paper introduces a new triplet loss function, which adjusts the relationship between the minority class patients and their neighbors by pulling the same class patients closer and pushing the different class patients away.

[0115] About the feature distance function between patients , the cosine distance between each pair of nodes is calculated by the following formula:

[0116] (9)

[0117] In the method, the minority class patient samples are defined as "anchor" patients. For each anchor node, the intermediate representation

[0118] is taken as the starting point (using the hidden representation of the last layer), and the same class patients of its 1-hop neighbors are taken as positive samples , and the different class patients are taken as negative samples , to construct a neighbor-based triplet loss pair. The corresponding neighbor-based triplet loss function is defined as:

[0119] (10)

[0120] The BNML trains the neural network and uses the neighbor-based triplet loss function to fit the rebalanced training patient data. This process can be represented as follows:

[0121] (11)

[0122] where is the neural network used to extract the feature representation, and the loss function can be represented by equation (10).

[0123] S6. Model prediction

[0124] ​After the model training is completed, the process of using it for disease risk prediction is a rigorous, multi-step reasoning process. First is the preparation stage, the system will load the best model version saved according to the performance of the validation set during training. At the same time, the system will prepare a test dataset that has never participated in training, which represents a batch of new patients in the medical context, whose features, contact relationship graphs, and true labels for final evaluation need to be predicted.

[0125] After the preparation is ready, it enters the core prediction stage. The system will input the test patient's feature matrix and contact relationship graph into the loaded best model to perform a forward propagation. In this calculation process, the model uses the learned weights to perform graph convolution and nonlinear transformation on the test patient's features, and finally generates an original prediction score vector for each patient in the test set, which represents the model's preliminary judgment of each patient's health status category.

[0126] Finally, in order to get the final classification results and evaluate the model performance, the system will process the original scores. According to the description in the paper, a softmax function will be applied to these scores to convert them into probabilities representing each patient's belonging to various health status categories. The system will select the category with the highest probability as the final predicted label for the patient. In order to objectively evaluate the prediction effect of the model, these predicted labels will be compared with the real labels reserved in the test set, and the F1 score and Matthew correlation coefficient (MCC) and other key performance indicators will be calculated to comprehensively measure the real prediction ability of the model on unbalanced data.

[0127] Experimental verification:

[0128] 1、Experimental setup

[0129] This part conducts empirical research on the performance of BNML on three actual public datasets, including the description of experimental setup, evaluation of experiments and detailed analysis of results.

[0130] 1.1、Data sets

[0131] In the subsequent experiments, three famous unbalanced citation graph datasets were used:

[0132] Cora, CiteSeer and PubMed.

[0133] Cora: The dataset contains 2708 nodes and 5429 edges. Each node represents a paper in the field of machine learning and is divided into 7 categories. The node features are 1433-dimensional word distribution vectors. Some categories in the dataset have significantly more nodes than others, for example, the "neural networks" category has many more nodes than the "rule learning" category. This imbalance can easily lead to poor performance on minority classes.

[0134] CiteSeer: The dataset contains 3327 nodes and 4732 edges representing 6 categories of papers, with each node represented by a 3703-dimensional bag-of-words feature. The class imbalance problem in this dataset is more severe, with the "machine learning" category having many more nodes than the "agent" category.

[0135] PubMed: The dataset contains 19717 nodes and 44338 edges, with nodes representing papers on diabetes and divided into 3 categories. The features are 500-dimensional TF-IDF vectors. Although there are only three categories, the sample distribution is extremely imbalanced, with the "type 1 diabetes" category having fewer nodes than "type 2 diabetes".

[0136] 1.2, Evaluation indicators

[0137] In this experiment, 3% of the nodes from each graph dataset were randomly selected, and the remaining nodes were divided into a validation set (10%) and a test set (90%) according to the label proportion in the standard GCN method.

[0138] The experiment was conducted on the Pytorch platform and used the ADAM optimizer for training. All models were run on an NVIDIA GeForce GTX 1660Ti GPU. For the BNML model proposed in this paper, the feature mapping number of the first layer of GCN was set to 256, the dropout rate was 0.3, the weight decay coefficient of L2 regularization was 0.00001, and the initial learning rate was set to 0.001. The maximum number of epochs for training was 2000, the early stopping step was set to 200, and the perception coefficient k was set to 3.

[0139] In terms of performance evaluation, the F1 and MCC (Matthews Correlation Coefficient) were used, which are commonly used for imbalanced data classification. The formula for calculating F1 is as follows:

[0140] ,

[0141] where, represents the number of correctly classified positive samples, FP represents the number of negative samples misclassified as positive, and FN represents the number of positive samples misclassified as negative.

[0142] MCC is used to measure the correlation between the predicted results and the actual labels, with a value range of [-1, +1]. The definition of MCC is as follows:

[0143] ,

[0144] where TN represents the number of correctly classified negative samples. The higher the values of these two indicators, the better the classification performance of the model.

[0145] In addition, the homophily score and true positive (TP) score are also used. The homophily score measures the degree of connection between nodes of the same class in graph data. The calculation formula is as follows:

[0146] ,

[0147] The true positive score (TP Score) is used to measure the ability of the model to correctly classify nodes of a certain class. The calculation formula is as follows:

[0148] .

[0149] 2. Homophily Score and True Positive Score Analysis

[0150] In graph networks that meet the independent and identically distributed conditions, the aggregation mechanism of GNN models can cause nodes to receive a large amount of mixed information, leading to a decline in model performance, and even over-smoothing problems. Figure 3 The figure shows the true positive (TP) performance of the GCN model in different classes, as well as the homophily score of each class in the three datasets.

[0151] Cora Dataset: When the homophily score is high (such as Class 0 and Class 1), the true positive (TP) performance of GNN is good, but as the homophily score decreases (such as Class 4 and Class 5), the TP performance of the model rapidly declines.

[0152] Citeseer Dataset: Although the homophily scores of some classes (such as Class 0 and Class 3) are high, the classification performance of GNN is still limited due to the insufficient number of training samples.

[0153] PubMed Dataset: When the homophily score of a class is low (such as Class 2), the representation ability and TP performance of the model significantly decline, especially the performance of tail class nodes is particularly poor.

[0154] Overall, the effective homophily score is crucial for improving the classification performance of GNNs.

[0155] As shown in FIG. 4, the homophily score (purple) and true positive score (red) of different classes in each dataset are shown by the GCN model. Figure 3 Figure 3 (a) is the Cora dataset, Figure 3 (b) is the Citeseer dataset, Figure 3 (c) is the Pubmed dataset.

[0156] 3. Performance verification of BNML

[0157] 3.1. Comparative method

[0158] BNML is compared with nine state-of-the-art GNN models, including ChebNet, GraphSAGE, GCN, GAT, GRAND, GCNII, GraphSMOTE, DR-GCN, and GNN-INCM.

[0159] 3.2. Experimental analysis

[0160] The performance of BNML is compared with nine state-of-the-art GNN-based methods. Table 1 shows the F1 and MCC values of three real datasets, and the results are as follows:

[0161] First, on the Cora and PubMed datasets, the proposed BNML model outperforms all the competing GNN-based methods in classification performance. For example, on the Cora dataset, considering the F1 indicator, the proposed method improves Chebyshev, GraphSAGE, GCN, GAT, GRAND, GCNII, GraphSMOTE, DR-GCN, and GNN-INCM by 18.79%, 13.64%, 13.42%, 9.08%, 8.75%, 8.66%, 7.89%, 7.38%, and 3.65%, respectively. There are four main reasons for this:

[0162] The neighbor-based metric learning strategy of BNML enhances the discriminability of minority class nodes through a triplet loss function.

[0163] BNML improves the number and representativeness of minority class nodes through a neighbor-aware strategy.

[0164] BNML uses high-order information of the normalized adjacency matrix in the neighbor-aware process, which can capture more extensive node relationships.

[0165] ​BNML performs neighbor-awareness concurrently with message passing, reducing computational overhead and model complexity.

[0166] Secondly, the performance of DR-GCN and GNN-INCM is outstanding among all competing methods. For example, in terms of MCC on the Cora dataset, DR-GCN outperforms ChebNet, GraphSAGE, GCN, GAT, GRAND, and GCNII by 22.75%, 11.61%, 7.19%, 3.20%, 1.60%, and 0.87%, respectively. Similarly, in terms of F1 on the Cora dataset, GNN-INCM also outperforms other models, with an improvement of 14.60%, 9.63%, 9.43%, 5.24%, 4.91%, 4.83%, and 4.08% over ChebNet, GraphSAGE, GCN, GAT, GRAND, GCNII, and GraphSMOTE, respectively. Finally, the performance of BNML on the CiteSeer dataset is not as good as on the Cora and PubMed datasets, because the graph structure of the CiteSeer dataset has more isolated nodes and weaker connectivity. This graph structure makes the neighbor-awareness strategy of BNML ineffective in selecting nodes. At the same time, the classification performance of all other models on the Cora and PubMed datasets is better than on the CiteSeer dataset, mainly due to the fact that the CiteSeer dataset contains more classes and has a lower graph density.

[0167] Table 1. Classification performance of BNML and existing GNN-based classification methods on three datasets

[0168]

[0169] Embodiment 2

[0170] The embodiment provides a disease risk prediction system based on balancing neighbor-awareness and metric learning.

[0171] A computer-readable storage medium, wherein a plurality of instructions are stored, the instructions being adapted to be loaded and executed by a processor of a terminal device to implement a disease risk prediction method based on balancing neighbor-awareness and metric learning.

[0172] A terminal device, comprising a processor and a computer-readable storage medium, the processor being configured to implement instructions, and the computer-readable storage medium being configured to store a plurality of instructions, the instructions being adapted to be loaded and executed by the processor to implement a disease risk prediction method based on balancing neighbor-awareness and metric learning.

[0173] The above are preferred embodiments of the present application, and do not limit the protection scope of the present application, so: any equivalent changes made according to the structure, shape, principle of the present application should be covered within the protection scope of the present application.

Claims

1. A disease risk prediction method based on balancing neighbor perception and metric learning, characterized in that, The method comprises the following steps: acquiring a medical clinical statistical data set; constructing an undirected graph based on the acquired medical clinical statistical data set; balancing data of the undirected graph by using a neighbor-aware strategy; constructing a double-layer GCN network model; training the double-layer GCN network model by using the balanced data; performing disease risk prediction by using the trained model; The acquired medical clinical statistics dataset is used to construct an undirected graph, including setting an undirected graph , wherein represents an original patient contact relationship matrix, representing contact relationships between patients, in the original patient contact relationship matrix, =1 indicates that the th patient has direct contact with the th patient; if =0, it indicates that the two patients have no direct contact, in addition to the original patient contact relationship matrix , represents a feature matrix, wherein each row represents the characteristics of a patient, is the dimension of the characteristics, is a set of health status labels of some diagnosed patients, , refers to the index set of all patients belonging to the health status category . The data balancing on the undirected graph by using the neighbor awareness strategy comprises introducing an awareness coefficient as hyperparameters, and compute the target number of patients needed to be included for each health condition category: , wherein, is a class of patient set, is a perception coefficient, is the total number of classes, and using a neighbor perception strategy to select the most closely associated undiagnosed patients on the contact relationship network and supplement to the training set of the class, so as to realize the balance of the training set; The data balancing on the undirected graph by using the neighbor-aware strategy further includes quantifying the influence among patients and extracting features, and the neighbor-aware strategy is based on an original patient contact relationship matrix calculating a normalized patient contact relationship matrix , which is expressed as: , wherein, is a self-loop matrix, is a degree matrix, and the normalized adjacency matrix is raised to the power to represent the th-order neighbor information, denoted as:​ , In the first In the layer, the embedding features of the patient By high-order contact relation matrix And the original feature matrix Multiplication, expressed as: ​ The data balancing of the undirected graph by using the neighbor-aware strategy further comprises: when the neighbor-aware obtains the high-order contact relation matrix according to the formula , then simultaneously performing node exploration and embedded feature calculation, in the normalized adjacency matrix , each row represents the exploration frequency of a node to other nodes, and the risk correlation degree score matrix is calculated to evaluate the influence degree of each undiagnosed patient to a specific category, , indicating the undiagnosed patient , the cumulative score of all patients in the category , is represented as: , wherein is the index set of class nodes; The method of balancing undirected graphs using a neighbor-aware strategy also includes directly balancing the graphs based on the category index using neighbor-aware principles. Perform a row summation operation to obtain , representing the number of the counting matrix Line, represented as: , wherein denotes the first row of the matrix , wherein for the disease category , the indices of the highest scoring undetected patients are selected from the risk association row vector and added to the set of patients , if the category currently processed is the first category, the newly screened high risk patients are added to the new training set with their embedding features and disease labels, denoted as: , wherein and is initialized to an empty set, denotes a set of labels containing elements, all of which are ; The balanced data is used to train a double-layer GCN network model, including introducing a triple loss function, adjusting the relationship between the minority class patients and their neighbors by pulling close the same class patients and pushing away the different class patients, and a feature distance function between patients where the features of two nodes are The cosine distance between each pair of nodes is calculated by a formula, which is represented as: In the method, the minority class patient sample is defined as an anchor point patient, for each anchor point node, from the middle representation , and the same class patients of the 1-hop neighbors thereof are taken as positive samples , and the different class patients are taken as negative samples A neighbor-based triple loss pair is constructed, and a corresponding neighbor-based triple loss function is defined as: ; the training of the double-layer GCN network model by using the balanced data further comprises fitting the rebalanced training patient data by using a neighbor-based triplet loss function, and is expressed as: , wherein a neural network for extracting a feature representation.

2. The disease risk prediction method based on balancing neighbor-awareness and metric learning according to claim 1, characterized in that, the disease risk prediction by using the trained model comprises comparing the predicted label with the real label, calculating an F1 score and a Matthews correlation coefficient (MCC) to comprehensively measure the real prediction ability of the model on unbalanced data, wherein the F1 value is expressed as: , wherein, wherein, TP represents the number of positive samples correctly classified, FP represents the number of negative samples misclassified as positive samples, FN represents the number of positive samples misclassified as negative samples; MCC is used to measure the correlation between the prediction results and the actual labels, and is represented as: , wherein TN represents the number of correctly classified negative samples; meanwhile, a homophily score and a true positive (TP) index are used to measure the connection degree of nodes of the same type to each other in the graph data and the ability of the model to correctly classify nodes of a certain type, and are expressed as: ; 。 3. A disease risk prediction system based on balancing neighbor-awareness and metric learning, performing a disease risk prediction method based on balancing neighbor-awareness and metric learning according to claim 1, characterized in that, The method comprises the following steps: a data acquisition module configured to acquire a medical clinical statistical data set; a preprocessing module configured to construct an undirected graph based on the acquired medical clinical statistical data set; a balancing module configured to balance data of the undirected graph by using a neighbor-aware strategy; a model construction module configured to a double-layer GCN network model; a training module configured to train the double-layer GCN network model by using the balanced data; a prediction module configured to perform disease risk prediction by using the trained model.

Citation Information

Patent Citations

  • Heat storage and supply system and leakage detection method

    CN111797888A

  • Prediction method and device for drug interaction, equipment and storage medium

    CN114694791A