A high-order relationship reasoning method based on asymmetric conditional modulation and contrastive learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-08-11
AI Technical Summary
因此,现有模型在捕获这种条件依赖的实体功能和高阶关系的固有非对称性方面存在明显的局限性,限制了模型在稀疏数据环境下的推理效果
[0016]因此,本发明采用上述一种基于非对称条件调制与对比学习的高阶关系推理方法,通过非对称条件调制机制,使得实体的表示能够根据高阶关系上下文动态适应,有效解决传统静态嵌入方法中的语义纠缠和多义性问题;在多视角查询的基础上设计了对比学习目标,增强特征在空间中的判别性,缓解高阶生物医疗关系中的数据稀疏性问题,在未见实体和稀疏连接的数据集上具备优越的泛化能力和强大的预测性能。
Smart Images

Figure CN122551905A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent medical computing technology, and in particular to a high-order relational reasoning method based on asymmetric conditional modulation and contrastive learning. Background Technology
[0002] In computational biology and translational medicine, high-order relation reasoning problems involving multiple interacting entities are frequently encountered, such as the "drug-gene-disease" association in drug development and the "drug-drug-cell line" interaction in cancer synergistic therapy. The essential characteristic of high-order relations is that they contain multiple entities, which leads to an explosive growth in the combinatorial space of relation tuples.
[0003] Furthermore, biomedical entities often exhibit strong context-dependent functions, leading to severe semantic polysemy when the same entity participates in different relation combinations. For example, the antiplatelet drug clopidogrel primarily causes adverse cardiovascular events in patients carrying loss-of-function variants in the CYP2C19 gene, while exhibiting normal efficacy in other genetic backgrounds. Existing relation learning methods typically learn static entity representations and assume that relation reasoning is symmetric. This assumption forces a single static embedding vector to incorporate multiple functional roles, resulting in semantic entanglement across different relation combinations.
[0004] On the other hand, existing contrastive learning methods primarily focus on pairwise relationships (such as text-image or drug-protein), which are largely symmetric in design. However, higher-order biomedical relationships are inherently asymmetric. Therefore, existing models have significant limitations in capturing the inherent asymmetry of such conditionally dependent entity functions and higher-order relationships, thus restricting their inference performance in sparse data environments. Summary of the Invention
[0005] The purpose of this invention is to provide a high-order relation reasoning method based on asymmetric conditional modulation and contrastive learning, which transforms high-order relation reasoning into a dynamic query-response process. By generating context-aware entity representations through an asymmetric conditional modulation mechanism, it effectively solves the problems of semantic polysemy and asymmetric high-order relations in biomedical entities, thereby achieving accurate relation reasoning and decision support under sparse data.
[0006] To achieve the above objectives, this invention provides a high-order relational reasoning method based on asymmetric conditional modulation and contrastive learning, comprising the following steps: S1. Obtain a high-order relation sample dataset, wherein the sample data includes high-order relation tuples composed of multiple interacting entities; decompose each observed high-order relation tuple into at least one incomplete query tuple and a response entity corresponding to the query tuple. S2. Based on the query condition encoder, the known observed entities in the query tuple are encoded and fused to construct a query feature vector, which is used to encode the query-specific relational context. S3. Using an asymmetric conditional modulation module, the query feature vector is used to generate query-specific modulation parameters; the modulation parameters are applied to the basic embedding of the candidate response entity, and directional and context-aware feature transformation is performed to obtain the conditional entity embedding representation. S4. Using a query-response contrastive learning strategy, calculate the similarity between the query feature vector and the corresponding correct conditional entity embedding representation, and minimize the distance between the query feature and the positive sample entity by using a contrastive loss function, while maximizing the difference with the negative sample entity. S5. Combine the comparison loss under different query configurations to obtain the overall target loss function value, and perform joint optimization and update on the model based on the target loss function value to obtain the trained relational reasoning network; S6. Input the high-order entity relationship data to be tested into the trained relationship reasoning network, and output the predicted association score between the entities to be tested for downstream diagnosis and prediction tasks.
[0007] Preferably, in S2, for a high-order relation tuple containing three entities, let The query feature vector represents the underlying embedding representation of the two observed entities. The calculation expression is: ; in, This represents the concatenation of eigenvectors. This indicates a query mapping network. The query-specific relational context is encoded. Represent a A 3D real vector space represents the set of real numbers. Represent a A real vector space of dimension 1.
[0008] Preferably, in S3, the asymmetric condition modulation module includes a multi-layer network structure with residual connections; for the first... The update expression for the candidate response entity representation at the layer is: ; in, For the basic embedding of entities, Indicates the first Modulation characteristics of the layer; and For query feature vectors The generated layer-specific scaling and offset modulation parameters; This represents element-wise multiplication; finally, the final conditional entity embedding representation is obtained through a projection layer.
[0009] Preferably, in S4, the InfoNCE loss function is used for comparative optimization. For the first... Query feature vectors and its corresponding positive sample conditional entity representation The contrast loss function expression is as follows: ; in, This indicates the batch size, which is the total number of candidate negative samples and positive samples. Represents cosine similarity. This refers to temperature hyperparameters.
[0010] Preferably, in S4, at least one of the following strategies is used to construct the contrastive learning negative samples: (1) Drug-level negative sampling: Replace the drugs in the triples with random drugs from the training set; (2) Microbial-level negative sampling: Replace the microorganisms in the triples with random microorganisms from the training set; (3) Negative sampling of disease level: Replace the disease in the triple with a random disease in the training set; (4) Random negative sampling: Randomly replace one of the entities in the triplet.
[0011] Preferably, in S5, the Adam optimizer is used for joint optimization and updates, and an early stopping strategy is used to prevent overfitting.
[0012] Preferably, in S6, the downstream diagnostic and prediction tasks include: drug discovery, pathogenic gene identification, prediction of drug synergistic therapy, and prediction of adverse drug reactions.
[0013] This invention also provides a high-order relational reasoning system based on asymmetric conditional modulation and contrastive learning, comprising: The data preprocessing module is used to obtain a high-order relation sample dataset and decompose each observed high-order relation into multiple incomplete query tuples and their corresponding response entities. The query encoding module is used to encode and fuse known observed entities in the query tuple based on the query condition encoder to construct a query feature vector specific to the query. An asymmetric modulation module is used to generate query-specific layer modulation parameters using the query feature vector, and apply the layer modulation parameters to the basic embedding of the candidate response entity to obtain a conditional entity embedding representation. The contrastive learning module is used to calculate the similarity between the query feature vector and the corresponding conditional entity embedding representation, and to perform contrastive optimization through a contrastive loss function. The model training module is used to integrate the contrastive loss under different query configurations, jointly optimize and update the model, and obtain a trained relational reasoning network. The inference and prediction module is used to input the high-order entity relationship data to be tested into the trained relationship inference network and output the predicted association scores between the entities to be tested.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned high-order relational reasoning method based on asymmetric conditional modulation and contrastive learning.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the aforementioned high-order relation inference method based on asymmetric conditional modulation and contrastive learning.
[0016] Therefore, this invention adopts the above-mentioned high-order relation reasoning method based on asymmetric conditional modulation and contrastive learning. Through the asymmetric conditional modulation mechanism, the representation of entities can dynamically adapt according to the context of high-order relations, effectively solving the semantic entanglement and ambiguity problems in traditional static embedding methods. Based on multi-view queries, a contrastive learning objective is designed to enhance the discriminativeness of features in space, alleviate the data sparsity problem in high-order biomedical relations, and have superior generalization ability and strong prediction performance on datasets with unseen entities and sparse connections.
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0018] Figure 1 This is an architecture diagram of the relational reasoning framework based on contextual high-order contrastive learning of this invention; Figure 2 This is a bar chart comparing the performance of this invention on a drug synergistic prediction dataset; Figure 3 This is a bar chart comparing the performance of this invention on a drug-gene-adverse reaction dataset; Figure 4 This is a t-SNE visualization of the latent spatial distribution of positive and negative samples in this invention; Figure 5 This is a line graph showing the sensitivity analysis of hyperparameters (loss weights and number of network layers) in this invention. Detailed Implementation
[0019] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0020] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects.
[0021] Example 1 This embodiment provides a high-order relation inference method based on asymmetric conditional modulation and contrastive learning, for high-order relation prediction tasks in the biomedical field. Figure 1 As shown, the method specifically includes the following steps.
[0022] S1. Dataset Construction and Preprocessing.
[0023] This embodiment conducts experimental testing on the DMD (Drug-Microbe-Disease) entity association dataset. The DMD dataset integrates association data from the MDAD and HMDAD databases, and its task is to predict unknown high-order ternary associations of "drug-microbe-disease" based on known triples. Specifically, a dataset containing 2763 drug-microbe-disease triples was collected, involving 270 drugs, 58 microorganisms, and 167 diseases.
[0024] Basic feature extraction is performed on entities: features for drug entities are generated using SMILES strings obtained from PubChem; microbial features are extracted from the NCBI Taxonomy database; and disease features are extracted using MeSH descriptors. During each training iteration, one entity from the triple is masked as the "response entity," and the remaining two entities are used as "known entities" to construct the query condition relation tuple. Each observed higher-order relation tuple is decomposed into an incomplete query tuple and its corresponding response entity.
[0025] S2. Construct query feature vectors based on query condition encoder.
[0026] Initial features of known entities are extracted, and the known observed entities in the query tuple are encoded and fused based on the query condition encoder. For a high-order relation tuple containing three entities, let... The underlying embedding representation of the two observed entities, and the query feature vector. The calculation expression is: ; in, This represents the concatenation of eigenvectors. This indicates a query mapping network. The query-specific relational context is encoded. Represent a A 3D real vector space represents the set of real numbers. Represent a A real vector space of dimension . In this embodiment, the extracted drug features and disease features are concatenated and mapped through a multilayer perceptron (MLP) network to generate a specific query vector that encodes the current high-order interaction relationship.
[0027] S3. Use an asymmetric conditional modulation module to generate a conditional entity embedding representation.
[0028] An asymmetric conditional modulation module is used, utilizing query feature vectors. Generate query-specific modulation parameters. Apply the modulation parameters to the underlying embeddings of candidate response entities, perform directional and context-aware feature transformations, and obtain conditional entity embedding representations.
[0029] The asymmetric conditional modulation module includes a multi-layer network structure with residual connections; for the first... The update expression for the candidate response entity representation at the layer is: ; in, For the basic embedding of entities, Indicates the first Modulation characteristics of the layer; and For query feature vectors The generated layer-specific scaling and offset modulation parameters; This represents element-wise multiplication; finally, the final conditional entity embedding representation is obtained through a projection layer.
[0030] In this embodiment, a domain context is introduced for the candidate response entities (e.g., a microbial candidate library), utilizing the query feature vectors. Dynamically generated scaling parameters and offset parameters A feature-level affine transformation is performed on the basic features of all candidate microbial entities. After modulation by an asymmetric conditional modulation module with multiple residual connections, a conditional microbial representation is output. This step ensures that entity features are no longer static, but dynamically adjusted according to the query context (i.e., a specific combination of drugs and diseases).
[0031] S4. Training is performed using a query-response comparative learning strategy.
[0032] A query-response contrastive learning strategy is employed to calculate the query feature vector. The similarity between the query feature and the corresponding correct conditional entity embedding is calculated, and the distance between the query feature and the positive sample entity is minimized by a contrastive loss function, while maximizing the difference between the query feature and the negative sample entity.
[0033] Specifically, the InfoNCE loss function is used for comparative optimization, for the first... Query feature vectors and its corresponding positive sample conditional entity representation The contrast loss function expression is as follows: ; in, Indicates batch size; Indicates cosine similarity; The temperature hyperparameter is set to τ=0.07 in this embodiment.
[0034] To construct negative samples for contrastive learning, this embodiment employs four negative sampling strategies during training: (1) Drug level: replacing the drugs in the triples with random drugs from the training set; (2) Microbial level: replacing microorganisms; (3) Disease level: replacing diseases; (4) Random negative sampling: arbitrarily replacing any entity in the triples. The cosine similarity between the conditional representations of positive and negative samples in the batch and the query vector is calculated.
[0035] S5, joint optimization and update of the model.
[0036] By combining the comparative losses under different query configurations, the overall target loss function value is obtained. Based on this target loss function value, the model is jointly optimized and updated to obtain the trained relational inference network. In this embodiment, the Adam optimizer is used for model training, and the learning rate is set to 5×10⁻⁶. -3 The weight decay is set to 1×10. -4 The total number of training rounds is 3000 epochs, and an early stopping strategy is implemented based on the validation set loss.
[0037] S6. Model Prediction and Application.
[0038] The high-order entity relationship data to be tested is input into a trained relational reasoning network, which outputs the predicted association scores between the entities to be tested, for use in downstream diagnostic or prediction tasks. In this embodiment, the trained model is used to predict and rank the high-order entity relationships of "drug-microorganism-disease" to be tested. A five-fold cross-validation protocol is adopted, and the evaluation metrics are Hits@1, Hits@3, Hits@5, and normalized depreciation cumulative gain NDCG@1, NDCG@3, NDCG@5 for comprehensive performance evaluation. All experimental results are as follows.
[0039] Table 1 presents the performance comparison results of various methods on the DMD dataset. As shown in Table 1, the model equipped with the contrastive learning module of our proposed method consistently and significantly outperforms existing baseline methods across all evaluation metrics. Specifically, on the Hits@1, Hits@3, and Hits@5 metrics, our method outperforms the previous best-performing baseline model (MCHNN) by +3.26%, +1.26%, and +0.38%, respectively. Similar significant improvements were also observed in the NDCG metric. This fully demonstrates the strong robustness and accuracy of our proposed dynamic query and context-aware modulation modules in Top-K retrieval evaluation. Furthermore, it can be observed that models incorporating hypergraph mechanisms (such as DHNE and MCHNN) significantly outperform traditional graph neural networks and non-graph methods, highlighting the importance of capturing high-order relationships between drugs, microorganisms, and diseases. Our method, by fusing relational context and performing contrastive learning after dynamic modulation, breaks through the geometric bottleneck of static embedding, further raising the upper limit of high-order relational reasoning.
[0040] Table 1. Performance Comparison of Different Methods on the DMD Dataset: Experimental Results ; Figure 2 This study visually demonstrates the performance of our proposed method and various baseline models on the drug synergistic prediction task. The experiment was conducted at NCI-ALMANAC (…). Figure 2 A) and O'Neil ( Figure 2 B) The results were performed on two datasets, comprehensively covering three evaluation settings with varying levels of difficulty: random pairing, cross-cell line, and cross-drug combination. The bar chart results show that our method consistently and significantly outperforms existing baseline methods such as HypergraphSynergy, DeepSynergy, and ComboFM across all evaluation metrics, including AUROC, AUPRC, and F1-Score. In highly challenging hierarchical evaluation scenarios such as predicting unseen cross-cell line and cross-drug combination scenarios, our method exhibits the smallest performance degradation, demonstrating strong model generalization ability and robustness.
[0041] Figure 3This paper presents a performance comparison of the proposed method on the DGA (Drug-Gene-Adverse Reactions) dataset for three core tasks: drug discovery, gene identification, and adverse reaction prediction. Experiments tested three representative backbone network architectures: MLP, GCN, and HGNN. The comparison of the blue and red bars in the figure shows that after adding the module of this invention (red bars) to any backbone network, the model achieved consistent and significant improvements in the three evaluation metrics: AUROC, AUPRC, and MRR. Particularly in the adverse reaction prediction task, the MRR and AUPRC metrics of each backbone network showed the most significant increases, further demonstrating that the asymmetric conditional modulation mechanism of this method can effectively empower various infrastructures.
[0042] Figure 4 This further validates the improved feature representation capability of our proposed method. In this example, the t-SNE algorithm is used to perform dimensionality reduction and visualization analysis on the learned latent feature space. In the figure, blue dots represent negative samples, and red dots represent positive samples. Compared to the basic HGNN model, the feature embeddings learned by our method exhibit a more compact intra-class aggregation structure and clearer inter-class separation boundaries. This improved clustering ability is also rigorously quantitatively confirmed by the significantly improved silhouette coefficient shown in the figure. This fully demonstrates that introducing dynamic contextual information into entity features can effectively alleviate the semantic entanglement caused by static representation, promoting better alignment of the latent space structure with the downstream prediction target.
[0043] Figure 5 The paper presents a hyperparameter sensitivity analysis line graph of the proposed method on the DGA dataset, primarily examining the impact of the auxiliary contrastive loss weights and the number of ACM network layers on the overall model performance. The loss weight subplot shows that, across the three tasks, the contrastive loss weights consistently exhibit a positive correlation with the model's AUROC, AUPRC, and MRR performance, fully validating the effectiveness of introducing contrastive supervision signals to align query and response features. Furthermore, the layer sensitivity analysis demonstrates that the model constructed using this method exhibits good robustness at different network depths, achieving optimal global performance when the number of asymmetric conditional modulation module layers L=3. This layer setting effectively captures high-order structural dependencies between entities while successfully avoiding the oversmoothing problem common in graph learning.
[0044] Therefore, this invention employs a higher-order relation reasoning method based on asymmetric conditional modulation and contrastive learning. Through the asymmetric conditional modulation mechanism, the representation of entities can dynamically adapt according to the context of higher-order relations, effectively solving the semantic entanglement and ambiguity problems in traditional static embedding methods. By designing contrastive learning objectives based on multi-view queries, the discriminativeness of features in space is enhanced, alleviating the data sparsity problem in higher-order biomedical relations. It demonstrates superior generalization ability and strong predictive performance on datasets with unseen entities and sparse connections.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A high-order relation inference method based on asymmetric conditional modulation and contrastive learning, characterized in that, Includes the following steps: S1. Obtain a high-order relation sample dataset, wherein the sample data includes high-order relation tuples composed of multiple interacting entities; decompose each observed high-order relation tuple into at least one incomplete query tuple and a response entity corresponding to the query tuple. S2. Based on the query condition encoder, the known observed entities in the query tuple are encoded and fused to construct a query feature vector, which is used to encode the query-specific relational context. S3. Using an asymmetric conditional modulation module, the query feature vector is used to generate query-specific modulation parameters; the modulation parameters are applied to the basic embedding of the candidate response entity, and directional and context-aware feature transformation is performed to obtain the conditional entity embedding representation. S4. Using a query-response contrastive learning strategy, calculate the similarity between the query feature vector and the corresponding correct conditional entity embedding representation, and minimize the distance between the query feature and the positive sample entity by using a contrastive loss function, while maximizing the difference with the negative sample entity. S5. Combine the comparison loss under different query configurations to obtain the overall target loss function value, and perform joint optimization and update on the model based on the target loss function value to obtain the trained relational reasoning network; S6. Input the high-order entity relationship data to be tested into the trained relationship reasoning network, and output the predicted association score between the entities to be tested for downstream diagnosis and prediction tasks.
2. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning according to claim 1, characterized in that, In S2, for a high-order relation tuple containing three entities, let denote the observed base embedding representation of the two entities, the query feature vector is computed as follows: ; in, This represents the concatenation of eigenvectors. This indicates a query mapping network. The query-specific relational context is encoded. Represent a A 3D real vector space represents the set of real numbers. Represent a A real vector space of dimension 1.
3. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning of claim 1, wherein, In S3, the asymmetric conditional modulation module includes a multi-layer network structure with residual connection; for the i-th layer, the update expression of the candidate response entity representation is: layer, the update expression of the candidate response entity representation is: ; in, For the basic embedding of entities, Indicates the first Modulation characteristics of the layer; and For query feature vectors The generated layer-specific scaling and offset modulation parameters; This represents element-wise multiplication; finally, the final conditional entity embedding representation is obtained through a projection layer.
4. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning of claim 1, wherein, In S4, the InfoNCE loss function is used for comparative optimization. For the first... Query feature vectors and its corresponding positive sample conditional entity representation The contrast loss function expression is as follows: ; wherein, denotes the batch size, i.e. the total number of candidate negative samples and positive samples; denotes the cosine similarity, is a temperature hyperparameter.
5. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning of claim 1, wherein, In S4, at least one of the following strategies is used to construct the contrastive learning negative samples: (1) Drug-level negative sampling: Replace the drugs in the triples with random drugs from the training set; (2) Microbial-level negative sampling: Replace the microorganisms in the triples with random microorganisms from the training set; (3) Negative sampling of disease level: Replace the disease in the triple with a random disease in the training set; (4) Random negative sampling: Randomly replace one of the entities in the triplet.
6. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning of claim 1, wherein, In S5, the Adam optimizer is used for joint optimization and updates, and an early stopping strategy is used to prevent overfitting.
7. The high-order relation reasoning method based on asymmetric condition modulation and contrastive learning of claim 1, wherein, In S6, downstream diagnostic and prediction tasks include: drug discovery, pathogenic gene identification, prediction of drug synergistic therapy, and prediction of adverse drug reactions.
8. A high-order relation inference system based on asymmetric conditional modulation and contrastive learning, characterized in that, include: The data preprocessing module is used to obtain a high-order relation sample dataset and decompose each observed high-order relation into multiple incomplete query tuples and their corresponding response entities. The query encoding module is used to encode and fuse known observed entities in the query tuple based on the query condition encoder to construct a query feature vector specific to the query. An asymmetric modulation module is used to generate query-specific layer modulation parameters using the query feature vector, and apply the layer modulation parameters to the basic embedding of the candidate response entity to obtain a conditional entity embedding representation. The contrastive learning module is used to calculate the similarity between the query feature vector and the corresponding conditional entity embedding representation, and to perform contrastive optimization through a contrastive loss function. The model training module is used to integrate the contrastive loss under different query configurations, jointly optimize and update the model, and obtain a trained relational reasoning network. The inference and prediction module is used to input the high-order entity relationship data to be tested into the trained relationship inference network and output the predicted association scores between the entities to be tested.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the high-order relational reasoning method based on asymmetric conditional modulation and contrastive learning as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the high-order relational reasoning method based on asymmetric conditional modulation and contrastive learning as described in any one of claims 1 to 7.