Graph representation learning method and device based on multi-source heterogeneous medical knowledge graph
By comparing learning and graph attention networks, the problem of multi-source heterogeneous medical knowledge graph analysis is solved, and efficient unsupervised graph representation learning is achieved, eliminating the labeling process, and improving model performance and efficiency.
Patent Information
- Application Number
- CN202210315493.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-03-28
AI Technical Summary
Existing graph representation learning methods cannot effectively analyze multi-source heterogeneous medical knowledge graphs, and the multi-view method relies on a large number of sample labels, and the labeling work takes too long.
Using an unsupervised graph representation learning method based on contrast learning, by generating positive and negative samples, using graph attention network for model training, obtaining a multi-view node representation matrix, and generating a global graph representation through weighted fusion and pooling operations, performing Biclassification iterative training.
Unsupervised learning is realized, the data annotation process is eliminated, the model construction efficiency is improved, and the graph representation containing more global information is obtained, which improves the model performance.
Smart Images

Figure CN114741527B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a graph representation learning method and device based on multi-source heterogeneous medical knowledge graphs. Background Art
[0002] With the rapid development of information technology, the amount of information data in the medical field is increasing. Large-scale medical data can often be linked based on the correlation between samples from different angles, thus forming a multi-source heterogeneous medical knowledge graph. By analyzing the multi-source heterogeneous medical knowledge graph, functions such as intelligent diagnosis, intelligent recommendation and prognosis evaluation can be realized, thereby improving the efficiency and progress of diagnosis. However, one of the major technical difficulties in realizing the above functions is how to obtain the graph representation of the multi-source heterogeneous knowledge graph.
[0003] Existing graph representation learning methods are usually single-view methods and cannot be used to analyze multi-source heterogeneous medical knowledge graphs. On the other hand, multi-view graph representation learning methods rely on a large number of sample labels for supervised learning, but labeling work often takes too long. Summary of the invention
[0004] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art, and to provide a graph representation learning method and device based on a multi-source heterogeneous medical knowledge graph. The method can construct a model through an unsupervised graph representation learning method based on contrastive learning, so as to more efficiently obtain the graph representation of the multi-source heterogeneous knowledge graph.
[0005] In a first aspect, the present invention provides a model training method, comprising:
[0006] Using the received multi-view image data as a positive sample, and generating a corresponding negative sample based on the multi-view image data;
[0007] Inputting the positive sample and the negative sample into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive sample and a multi-view node representation matrix of the negative sample;
[0008] Performing weighted fusion on the multi-view node representation matrices of the positive sample to obtain a graph node representation matrix, and determining a global graph representation according to the graph node representation matrix;
[0009] The preset initial model is iteratively trained for binary classification according to the global graph representation, the multi-view node representation matrix of the positive sample, and the multi-view node representation matrix of the negative sample until a training stop condition is reached.
[0010] As a further improvement, before taking the received multi-view image data as a positive sample, the method further includes:
[0011] Acquire initial graph data, wherein the initial graph data includes an adjacency matrix and a feature matrix;
[0012] Calculate the similarity between each two nodes in the feature matrix respectively;
[0013] According to the similarity calculation results, each node is connected to its most similar N nodes to construct a new feature matrix;
[0014] Multi-view graph data is determined based on the adjacency matrix and the new feature matrix.
[0015] As a further improvement, the generating of corresponding negative samples based on the multi-view image data is specifically:
[0016] The feature matrix in the multi-view graph data is randomly scrambled, and negative samples are determined according to the scrambled feature matrix and the adjacency matrix of the multi-view graph data.
[0017] As a further improvement, the multi-view node representation matrix of the positive sample is weightedly fused to obtain a graph node representation matrix, which is specifically:
[0018] Determine the weight value of the node representation matrix of each view through the attention mechanism;
[0019] The node representation matrix of each view is weighted and summed according to the weight value to obtain a graph node representation matrix.
[0020] As a further improvement, determining the global graph representation according to the graph node representation matrix includes:
[0021] A pooling operation is performed on the graph node representation matrix to generate a global graph representation containing global information.
[0022] As a further improvement, the encoder is specifically a graph attention network.
[0023] In a second aspect, the present invention further provides a graph representation learning method based on a multi-source heterogeneous medical knowledge graph, comprising:
[0024] Obtain multi-source heterogeneous medical knowledge graph;
[0025] The multi-source heterogeneous medical knowledge graph is input into a multi-view graph representation learning model to obtain a graph representation of the multi-source heterogeneous medical knowledge graph; wherein,
[0026] The multi-view graph representation learning model is a model trained using the model training method described in the first aspect.
[0027] In a third aspect, the present invention further provides a model training device, comprising:
[0028] A processing module, configured to use the received multi-view image data as a positive sample and generate a corresponding negative sample based on the multi-view image data;
[0029] An encoding module, used for inputting the positive sample and the negative sample into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive sample and a multi-view node representation matrix of the negative sample;
[0030] A fusion module, used for performing weighted fusion on the multi-view node representation matrix of the positive sample to obtain a graph node representation matrix, and determining a global graph representation according to the graph node representation matrix;
[0031] A training module is used to perform binary classification iterative training on the preset initial model according to the global graph representation, the multi-view node representation matrix of the positive sample and the multi-view node representation matrix of the negative sample until a training stop condition is reached.
[0032] The present invention provides a data processing device, including a processor, the processor is coupled to a memory, the memory stores a program, and the program is executed by the processor, so that the data processing device executes the model training method described in the first aspect, or the graph representation learning method based on multi-source heterogeneous medical knowledge graph described in the second aspect.
[0033] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the model training method described in the first aspect above, or the graph representation learning method based on a multi-source heterogeneous medical knowledge graph described in the second aspect.
[0034] Compared with the prior art, the graph representation learning method based on multi-source heterogeneous medical knowledge graph provided by the present invention has at least the following beneficial effects:
[0035] The graph representation learning method based on multi-source heterogeneous medical knowledge graph provided by the present invention can obtain the graph representation results of the multi-source heterogeneous medical knowledge graph by using a pre-built multi-view graph representation learning model, thereby providing a more comprehensive and effective data foundation for subsequent medical diagnosis applications.
[0036] Among them, the multi-view graph representation learning model can save the data labeling process and improve the efficiency of model construction by using contrastive learning for unsupervised training; at the same time, by using the global graph representation for contrastive learning, the learned graph representation can also contain more global information, thereby improving the model performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 It is a flowchart of the model training method provided by an embodiment of the present invention;
[0039] Figure 2 It is a schematic diagram of the structure of a multi-view graph representation learning model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.
[0041] like Figure 1 As shown, in the first aspect, an embodiment of the present invention provides a model training method, comprising the following steps S1 to S4.
[0042] S1: taking the received multi-view image data as a positive sample, and generating a corresponding negative sample based on the multi-view image data.
[0043] In this embodiment, the method for generating multi-view graph data includes: obtaining initial graph data, the initial graph data including an adjacency matrix and a feature matrix; respectively calculating the similarity between each pair of nodes in the feature matrix; connecting each node with its most similar N nodes according to the similarity calculation results to construct a new feature matrix; and determining the multi-view graph data based on the adjacency matrix and the new feature matrix.
[0044] It should be noted that, in this embodiment, the feature matrix in the multi-view graph data may be randomly scrambled, and the negative samples may be determined according to the scrambled feature matrix and the adjacency matrix of the multi-view graph data.
[0045] S2: Input the positive samples and negative samples into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive samples and a multi-view node representation matrix of the negative samples.
[0046] Specifically, the encoder is set as a graph attention network, through which data that is more consistent with the intrinsic connection of features can be extracted to obtain a multi-view node representation matrix of positive and negative samples.
[0047] S3: performing weighted fusion on the multi-view node representation matrices of the positive sample to obtain a graph node representation matrix, and determining a global graph representation according to the graph node representation matrix.
[0048] Specifically, the weight value of the node representation matrix of each view can be determined through the attention mechanism; then the node representation matrix of each view is weighted and summed according to the corresponding weight value to obtain the graph node representation matrix.
[0049] Furthermore, a pooling operation may be performed on the graph node representation matrix to generate a global graph representation containing global information.
[0050] S4: performing binary classification iterative training on the preset initial model according to the global graph representation, the multi-view node representation matrix of the positive sample, and the multi-view node representation matrix of the negative sample until a training stop condition is reached.
[0051] It is understandable that the training stop condition may be: the number of iterations reaches a preset threshold, or the loss function of the pre-trained model reaches a preset convergence condition.
[0052] In the second aspect, an embodiment of the present invention also provides a graph representation learning method based on a multi-source heterogeneous medical knowledge graph, specifically comprising: obtaining a multi-source heterogeneous medical knowledge graph; inputting the multi-source heterogeneous medical knowledge graph into a multi-view graph representation learning model to obtain a graph representation of the multi-source heterogeneous medical knowledge graph.
[0053] The multi-view graph representation learning model can be obtained by training the model training method described in the first aspect. For its specific structure, please refer to Figure 2 .
[0054] The training process of the multi-view graph representation learning model will be described below through a specific embodiment.
[0055] When receiving the initial graph data G, G={A v ,X v},v=1,2,...,K, according to the adjacency matrix A1 and feature matrix X1 corresponding to the initial graph data G, calculate the similarity between each pair of nodes in the feature matrix X1, and connect each node with its most similar Q nodes to construct a multi-view graph data of K views of the initial graph data.
[0056] Specifically, Q can take a value of 15.
[0057] It can be understood that the feature matrix X1 is used to represent the node information in the initial graph data G, and the adjacency matrix A1 is used to represent the association relationship between the nodes.
[0058] Furthermore, the constructed multi-view graph data is used as a positive sample. At the same time, the feature matrix in the graph data is randomly scrambled, and the adjacency matrix remains unchanged to obtain a negative sample G of the graph data G. (-) , G (-) ={A v ,X v (-)},v=1,2,...,K.
[0059] Furthermore, an initial multi-view graph representation learning model is constructed based on the preset initial model, and the parameters in the initial model are randomly initialized.
[0060] Specifically, the adjacency matrix and feature matrix of the positive and negative samples are input into the encoder ε of the preset initial model. v In the example, we get the node representation matrix H of the positive sample. v , and the node representation matrix H of negative samples v (-) .
[0061] In this embodiment, the encoder ε v Specifically, it is a graph attention network.
[0062] Furthermore, the nodes of multiple views of the positive sample are represented by matrices H1, H2, ..., H K Aggregator input to the preset initial model The view-independent graph node representation matrix H is obtained through weighted fusion processing.
[0063] in, h i represents the node representation of each node, and N represents the number of nodes.
[0064] It should be noted that this embodiment specifically fuses the node representation matrices of multiple views through the self-attention mechanism, that is, a weight coefficient is assigned to the node representation corresponding to each node in multiple views through the self-attention mechanism, and then a view-independent graph node representation matrix H is obtained through weighted summation:
[0065]
[0066]
[0067] in, The weight coefficient representing the node representation of the i-th node in the v-th view is obtained through a learnable vector b.
[0068] Compared with the traditional multi-view graph representation learning method that directly concatenates the node representation matrices of each view row by row or sums and averages them, the weighted fusion method based on the self-attention mechanism in this embodiment can effectively reduce the feature dimension while avoiding the masking of important information, thereby ensuring a better model.
[0069] Furthermore, the global graph representation s of the entire graph is obtained from the graph node representation matrix H using the readout function R.
[0070] In this embodiment, the readout function R can be specifically obtained by an average pooling operation to obtain a global graph representation s:
[0071]
[0072] Where σ is a nonlinear activation function.
[0073] In this embodiment, the node representation h of each node is obtained. i Afterwards, a global graph representation of the entire graph is obtained from the node representations of all nodes in a general manner by reading out the function R, and the global graph representation will contain global information.
[0074] Furthermore, the global graph representation s is combined with the encoder ε v The node representation matrix of the output positive and negative samples constitutes positive and negative sample pairs: and ). Where i = 1, 2, ..., N, v = 1, 2, ..., K. At this time, the positive and negative sample pairs are given a pseudo label 1 (positive sample) and 0 (negative sample) respectively.
[0075] For each positive and negative sample pair, this embodiment uses a bilinear scoring function to measure the global graph representation s and each node representation matrix h i The similarity between:
[0076]
[0077] Where P represents a learnable projection matrix, which is used to ensure that the node representation matrix h i and the global graph represents the variance between s.
[0078] This embodiment uses the global graph representation s as a target, so that the final learned representation contains more global information, thereby improving the model performance effect.
[0079] After obtaining the similarity calculation results, the preset initial model parameters are iteratively updated through the binary classification task based on positive and negative sample pairs until the loss function of the model converges or reaches the specified number of iterations to obtain the final multi-view graph representation learning model.
[0080] When a multi-source heterogeneous medical knowledge graph is received, the multi-source heterogeneous medical knowledge graph is input into the trained multi-view graph representation learning model to obtain the node representation of each node of the knowledge graph. The obtained node representation can be used for subsequent tasks such as node classification or edge prediction.
[0081] The above-mentioned embodiment of the present invention obtains the graph representation of the multi-source heterogeneous medical knowledge graph by utilizing the multi-view graph representation learning model, which can provide a more comprehensive and accurate data foundation for subsequent medical diagnosis applications.
[0082] Specifically, by using contrastive learning to unsupervised train the multi-view graph representation learning model, the data labeling process can be omitted and the efficiency of model building can be improved. At the same time, by using the global graph representation for contrastive learning, the learned graph representation can also contain more global information, thereby improving the model performance.
[0083] In a third aspect, another embodiment of the present invention further provides a model training device, comprising a processing module, an encoding module, a fusion module and a training module.
[0084] The processing module is used to use the received multi-view image data as positive samples and generate corresponding negative samples based on the multi-view image data.
[0085] The encoding module is used to input the positive samples and negative samples into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive samples and a multi-view node representation matrix of the negative samples.
[0086] The fusion module is used to perform weighted fusion on the multi-view node representation matrices of the positive samples to obtain a graph node representation matrix, and determine the global graph representation according to the graph node representation matrix.
[0087] The training module is used to perform binary classification iterative training on the preset initial model according to the global graph representation, the multi-view node representation matrix of the positive sample and the multi-view node representation matrix of the negative sample until a training stop condition is reached.
[0088] As the information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the above-mentioned model training method embodiment of the present invention, the specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.
[0089] In a fourth aspect, the present invention provides a data processing device, comprising a processor, wherein the processor is coupled to a memory, the memory stores a program, and the program is executed by the processor, so that the data processing device executes the model training method described in the first aspect, or the graph representation learning method based on multi-source heterogeneous medical knowledge graph described in the second aspect.
[0090] In a fifth aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the model training method described in the first aspect above, or the graph representation learning method based on a multi-source heterogeneous medical knowledge graph described in the second aspect.
[0091] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-monitorable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0092] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A model training method, characterized in that: include: Using the received multi-view image data as a positive sample, and generating a corresponding negative sample based on the multi-view image data; Inputting the positive sample and the negative sample into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive sample and a multi-view node representation matrix of the negative sample; The multi-view node representation matrix of the positive sample is weightedly fused to obtain a graph node representation matrix, and a global graph representation is determined according to the graph node representation matrix, specifically including: The weight value of the node representation matrix of each view is determined by the attention mechanism, and the node representation matrix of each view is weighted and summed according to the weight value to obtain a graph node representation matrix. The graph node representation matrix is pooled to generate a global graph representation containing global information. The similarity between the global graph representation and each node representation in the graph node representation matrix is measured by a bilinear scoring function: Among them, P represents a learnable projection matrix, which is used to ensure that each node represents and the global graph represents the variance between s; According to the global graph representation, the multi-view node representation matrix of the positive sample and the multi-view node representation matrix of the negative sample, the preset initial model is iteratively trained for binary classification until the training stop condition is reached, so as to obtain a multi-view graph representation learning model, wherein the multi-view graph representation learning model is used to obtain the node representation of each node of the multi-source heterogeneous medical knowledge graph; Before using the received multi-view graph data as a positive sample, it also includes: obtaining initial graph data, the initial graph data including an adjacency matrix and a feature matrix; calculating the similarity between each pair of nodes in the feature matrix; connecting each node to its most similar N nodes according to the similarity calculation result to construct a new feature matrix; and determining the multi-view graph data based on the adjacency matrix and the new feature matrix.
2. The model training method according to claim 1, characterized in that: The generating corresponding negative samples based on the multi-view image data is specifically: The feature matrix in the multi-view graph data is randomly scrambled, and negative samples are determined according to the scrambled feature matrix and the adjacency matrix of the multi-view graph data.
3. The model training method according to claim 1, characterized in that: The encoder is specifically a graph attention network.
4. A graph representation learning method based on multi-source heterogeneous medical knowledge graph, characterized in that: include: Obtain multi-source heterogeneous medical knowledge graph; The multi-source heterogeneous medical knowledge graph is input into a multi-view graph representation learning model to obtain a graph representation of the multi-source heterogeneous medical knowledge graph; wherein, The multi-view graph representation learning model is a model trained using the model training method as described in any one of claims 1 to 3.
5. A model training device, characterized in that: include: A receiving module, used to obtain initial graph data, wherein the initial graph data includes an adjacency matrix and a feature matrix; Calculate the similarity between each two nodes in the feature matrix respectively; According to the similarity calculation results, each node is connected to its most similar N nodes to construct a new feature matrix; Determining multi-view graph data based on the adjacency matrix and the new feature matrix; A processing module, configured to use the received multi-view image data as a positive sample and generate a corresponding negative sample based on the multi-view image data; An encoding module, used for inputting the positive sample and the negative sample into an encoder of a preset initial model to obtain a multi-view node representation matrix of the positive sample and a multi-view node representation matrix of the negative sample; A fusion module is used to perform weighted fusion on the multi-view node representation matrices of the positive sample to obtain a graph node representation matrix, and determine the global graph representation according to the graph node representation matrix, specifically comprising: determining the weight value of the node representation matrix of each view through an attention mechanism, performing weighted summation on the node representation matrix of each view according to the weight value to obtain a graph node representation matrix, performing a pooling operation on the graph node representation matrix to generate a global graph representation containing global information, and the similarity between the global graph representation and each node representation in the graph node representation matrix is measured by a bilinear scoring function: Among them, P represents a learnable projection matrix, which is used to ensure that each node represents and the global graph represents the variance between s; A training module is used to perform binary classification iterative training on the preset initial model according to the global graph representation, the multi-view node representation matrix of the positive sample and the multi-view node representation matrix of the negative sample until the training stop condition is reached, thereby obtaining a multi-view graph representation learning model, and the multi-view graph representation learning model is used to obtain the node representation of each node of the multi-source heterogeneous medical knowledge graph.
6. A data processing device, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory stores a program, and wherein the program is executed by the processor, so that the data processing device executes the model training method as described in any one of claims 1 to 3, or the graph representation learning method based on a multi-source heterogeneous medical knowledge graph as described in claim 4.
7. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to execute the model training method described in any one of claims 1 to 3, or the graph representation learning method based on a multi-source heterogeneous medical knowledge graph described in claim 4.
