Molecular property prediction and drug design system based on graph contrast learning

By employing graph contrastive learning techniques and multi-view augmentation, the problems of existing methods relying on labeled data and lacking interpretability are addressed. This enables the learning of general representations from unlabeled data, improving the accuracy and interpretability of molecular property predictions and supporting multi-task learning and molecular optimization design.

CN121812010APending Publication Date: 2026-04-07JIANGSU HOPERUN SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-12
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing molecular property prediction methods based on graph neural networks rely on a large amount of labeled data, making it difficult to capture the similarity relationships between molecules, lacking interpretability, having insufficient multi-task generalization ability, failing to effectively integrate 3D geometric information, and lacking guidance for molecular optimization design.

Method used

By employing graph contrastive learning techniques, combined with multi-view enhancement, similarity preservation, and interpretability analysis, a general representation is learned from unlabeled data through a self-supervised contrastive learning mechanism. A substructure-aware graph neural network is designed to achieve molecular property prediction and drug design.

Benefits of technology

Learning general representations from unlabeled data improves the model's generalization ability and prediction accuracy, provides interpretable analysis, supports multi-task learning and molecular optimization design, reduces training data costs and time, and improves prediction accuracy and computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121812010A_ABST
    Figure CN121812010A_ABST
Patent Text Reader

Abstract

The invention discloses a molecular property prediction and drug design system based on graph comparative learning. The molecular property prediction and drug design system comprises a data preprocessing module, a graph coding module, a comparative learning module, a property prediction module and an interpretability analysis module. According to the method, molecules are modeled into an atom-bond graph structure, a self-supervised contrast learning mechanism is adopted to learn general representation from a large-scale unlabeled molecule library, and a graph neural network with multi-view graph enhancement, a molecule similarity keeping mechanism and substructure perception is combined to obtain a multi-view graph structure; accurate prediction of molecular properties, drug-target interaction prediction and molecular optimization design based on property targets are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of computational chemistry and artificial intelligence, specifically to a molecular property prediction and drug design system based on graph comparison learning, applicable to various application scenarios such as drug discovery, materials design, catalyst optimization, and environmental pollutant assessment. Background Technology

[0002] With the deepening application of artificial intelligence technology in the field of chemistry, deep learning-based molecular property prediction methods have become important tools in modern drug design and materials development. Traditional molecular property prediction methods mainly rely on molecular descriptors and machine learning models, but these methods often require manually designed features and are difficult to capture complex structural information of molecules. In recent years, graph neural networks (GNNs) have attracted widespread attention because they can directly process the graph structure representation of molecules.

[0003] However, existing methods for predicting molecular properties based on graph neural networks still have the following technical problems:

[0004] 1. Reliance on large amounts of labeled data: Traditional supervised learning methods require a large amount of labeled molecular data, but obtaining high-quality labeled molecular property data is costly and time-consuming. For newly discovered molecules or rare properties, labeled data is often severely insufficient, limiting the model's generalization ability.

[0005] 2. Difficulty in capturing intermolecular similarity relationships: Existing methods mainly focus on the representation learning of individual molecules, lacking explicit modeling of intermolecular similarity relationships. In chemistry, molecules with similar structures often have similar properties, but existing models struggle to effectively utilize this prior knowledge, resulting in low accuracy in similarity searches and molecule retrieval.

[0006] 3. Lack of interpretability: Most deep learning methods are considered "black boxes," making it difficult to explain why the model predicts a molecule has a specific property. In drug design, understanding which substructures (functional groups, ring structures, pharmacophores) lead to specific properties is crucial, but existing methods lack effective interpretable analysis mechanisms.

[0007] 4. Insufficient multi-task generalization ability: Existing models are usually trained for a single task, such as predicting only molecular solubility or only drug activity. When multiple properties need to be predicted simultaneously, multiple independent models often need to be trained, which cannot fully utilize the correlation between different tasks, resulting in wasted computational resources and limited performance.

[0008] 5. Insufficient utilization of 3D geometric information: The 3D geometric structure of molecules (bond length, bond angle, dihedral angle) has an important influence on properties, but most methods only consider 2D topological structure and cannot effectively integrate 3D geometric information, which limits the prediction accuracy.

[0009] 6. Lack of guidance for molecular optimization design: Existing methods mainly focus on property prediction, but lack effective guidance mechanisms for how to optimize molecular structure and design new molecules with target properties based on prediction results, making it difficult to achieve reverse design from properties to structure.

[0010] Therefore, there is an urgent need for a molecular property prediction and drug design system capable of learning universal molecular representations from unlabeled data, effectively capturing intermolecular similarity relationships, possessing interpretable analysis capabilities, and supporting multi-task learning and molecular optimization design. This invention addresses these technical challenges by employing graph contrast learning technology, combined with multi-view enhancement, similarity preservation, and interpretability analysis, providing an efficient and reliable technical solution for AI-driven molecular design. Summary of the Invention

[0011] To address the aforementioned issues, this invention provides a molecular property prediction and drug design system based on graph contrastive learning. By modeling molecules as atomic-bond graph structures, a self-supervised contrastive learning mechanism is used to learn universal representations from a large-scale unlabeled molecular library. Combined with multi-view graph enhancement, molecular similarity preservation mechanisms, and substructure-aware graph neural networks, the system achieves accurate prediction of molecular properties, prediction of drug-target interactions, and molecular optimization design based on property objectives.

[0012] The specific plan is as follows:

[0013] A molecular property prediction and drug design system based on graph comparison learning, comprising:

[0014] The data preprocessing module is used for molecular graph representation and multi-view construction. Molecular graph representation generates multiple views for the same molecule through different graph transformation operations, including 2D topological graph views, substructure enhancement views, and bond deletion views. Multi-view construction maintains semantic consistency across different views of the same molecule, while allowing for differences in structural representation.

[0015] Graph Encoding Module: Design a Substructure-Aware Graph Neural Network (SA-GNN) to extract molecular representations for identifying and encoding important molecular substructures (such as functional groups, ring structures, and pharmacophores). It also highlights the influence of molecular substructures on molecular properties through an attention mechanism, providing high-quality molecular representations for subsequent comparative learning and property prediction.

[0016] Contrastive learning module: The contrastive learning mechanism is adopted to make different views of the same molecule similar in the representation space and to separate the representations of different molecules in the space, thereby learning a general molecular representation from unlabeled data; this mechanism is the key to the self-supervised learning of this invention, enabling the model to make full use of large-scale unlabeled molecular data;

[0017] Property prediction module: Constructs a multi-task prediction head to predict multiple molecular properties simultaneously;

[0018] Interpretability Analysis Module: Based on substructure perception and property prediction results, it provides interpretability through substructure attention scores and gradient analysis.

[0019] Furthermore, the data preprocessing module includes:

[0020] Modeling molecules as graph structures ,in Represents a set of atomic nodes. For the number of atoms, Represents the set of chemical bond edges; each atom node Eigenvectors containing atom type, hybridization state, and charge ,in The atomic feature dimension; each edge Feature vectors containing key type, key order, and whether they are in a cycle ,in The edge feature dimension;

[0021] To enhance the robustness and generalization ability of the model, multiple molecular diagram views are constructed; let the original molecular diagram be... Generate functions through views Generate multiple views:

[0022]

[0023] in Indicates the first Various view transformation operations, For the generated first One view, , Total number of views;

[0024] The specific implementation method for view generation is as follows:

[0025] 2D topology view : It is an identity transformation function that preserves the original molecular structure, i.e. This view serves as a baseline view, preserving complete structural information of the molecule.

[0026] Substructure Enhanced View This method enhances the atomic node features in substructures by identifying important functional groups (such as carboxyl-COOH, ester-COO-, hydroxyl-OH, amino-NH2, etc.) and ring structures (such as benzene rings, heterocycles, etc.). Specifically, for atomic nodes... If it belongs to an important functional group or a ring structure, then the substructure label vector is increased by feature concatenation. The enhanced node features are ,in For tag vectors that encode functional groups or ring structures (such as one-hot encoding or embedding vectors). This represents a vector concatenation operation; if an atom does not belong to an important substructure, the original features are preserved; this view allows the model to better focus on functional groups and ring structures that play a key role in molecular properties by highlighting important substructures.

[0027] Key to delete view This method generates structural variants by randomly deleting some non-critical chemical bonds. Specifically, it first identifies non-critical chemical bonds (prioritizing single bonds not in the ring to avoid disrupting the main structure of the molecule), and then randomly deletes these bonds according to a preset deletion ratio (e.g., 10%-20%) to generate structural variants. This view increases the diversity of data and improves the robustness and generalization ability of the model by introducing structural perturbations.

[0028] By constructing multiple views, different views of the same molecule remain semantically consistent (all representing the same molecule), but their structural representations differ (feature enhancement or structural perturbation), providing positive sample pairs for contrastive learning, enabling the model to learn molecular representations robust to structural changes.

[0029] Furthermore, the graph encoding module includes:

[0030] For input molecular graph SA-GNN first updates the node representation through a message passing mechanism; in the... Layers, nodes The representation is updated as follows:

[0031]

[0032] in Indicates the first Layer nodes The hidden representation, For the hidden layer dimension, Represents a node The set of neighboring nodes, This is an aggregation function used to aggregate information about neighboring nodes. This is an update function used to merge the current node information and the aggregated neighbor information; initially, That is, the original feature vectors of atomic nodes are used in layer 0;

[0033] The message passing mechanism is specifically as follows:

[0034] The function can be implemented in various ways, including summation, mean calculation, max pooling, or attention-weighted aggregation. This invention preferably employs an attention-based aggregation method (such as Graph Attention Network, GAT), which adaptively aggregates information from important neighboring nodes by calculating attention weights between nodes; specifically, for neighboring nodes... Calculate attention weights Then, the neighbor information is aggregated using a weighted summation method: ,in It is a multilayer perceptron. This indicates vector concatenation;

[0035] The function is used to merge the representation of the current node. The aggregated neighbor information is then processed using a linear transformation and activation function: ,in The weight matrix is ​​a learnable matrix. For activation functions (such as ReLU). This represents the aggregated neighbor information; through multi-layer message passing, the node representation can gradually integrate information from multi-hop neighbors, thereby capturing the global structural features of the molecule.

[0036] go through After layer message passing, the final representation of each node is obtained. To identify important substructures, a substructure attention mechanism is designed; for each node... Calculate the attention score for each important substructure:

[0037]

[0038] in This is a learnable weight matrix used to perform linear transformations on the node representations. This is the attention weight vector, used to calculate the attention score. For bias vectors, This represents the total number of layers in the graph neural network. This represents the total number of atomic nodes in the molecule. Represents a node The importance score, and satisfying ;

[0039] Through the attention mechanism, the model can automatically identify atoms and substructures that play a key role in molecular properties, so that atoms in important functional groups and ring structures can obtain higher attention scores.

[0040] The final molecular graph representation is obtained by weighted aggregation of all node representations:

[0041]

[0042] in This is the graph representation vector of the molecule. This representation not only includes overall molecule structural information but also highlights the contributions of important substructures through attention weights, making key substructures have a greater impact on the final representation. This molecule representation vector will serve as the foundational feature for subsequent contrastive learning, similarity preservation, and property prediction.

[0043] Furthermore, the contrastive learning module includes

[0044] For molecular diagrams Two different views and (Generated by the aforementioned view function) and (Generated), and the representation vectors are obtained through SA-GNN respectively. and Since these two views come from the same molecule, they are semantically consistent but differ in structural representation, and therefore can serve as positive sample pairs for contrastive learning. The goal of contrastive learning is to maximize the similarity of positive sample pairs (different views of the same molecule) while minimizing the similarity of negative sample pairs (views of different molecules).

[0045] Comparative learning was performed using the InfoNCE loss function:

[0046]

[0047] in The cosine similarity function is used to measure the degree of similarity between two vector representations. and Let be any two representation vectors, The L2 norm of a vector. This is a temperature hyperparameter used to adjust the sharpness of the similarity distribution. The smaller the size, the sharper the distribution. The negative sample set contains all view representations of other molecules in the current training batch. This represents the representation vector of the negative sample. By minimizing this loss function, the model learns a representation space that makes different views of the same molecule similar (similarity close to 1) and different molecules separate (similarity close to 0), thus learning discriminative molecular representations from unlabeled data.

[0048] Furthermore, based on the aforementioned contrastive learning mechanism, in order to fully utilize prior chemical knowledge (molecules with similar structures often have similar properties), this invention designs a molecular similarity preservation mechanism. A molecular similarity graph is constructed based on chemical similarity metrics (such as Tanimoto similarity and pharmacophore similarity). An additional loss function constraint allows similar molecules to cluster in the representation space, while different molecules are separated. This mechanism complements the contrastive learning mechanism, jointly optimizing the molecular representation space.

[0049] Let the molecular set be ,in For the number of molecules, For any two elements in the set and Calculate their chemical similarity Calculate the Tanimoto coefficient based on molecular fingerprints (such as Morgan fingerprints and MACCS fingerprints):

[0050]

[0051] in Indicates molecule The fingerprint set was generated using a molecular fingerprinting method. Indicates the size of the set. To represent the intersection of sets, Represents the union of sets; The larger the value, the more similar the two molecules are in chemical structure;

[0052] The molecular fingerprint generation method is as follows:

[0053] Molecular fingerprinting is a method of encoding molecular structure into a fixed-length binary vector or set. This invention preferably uses Morgan fingerprinting (also known as circular fingerprinting or ECFP fingerprinting) or MACCS fingerprinting. The method for generating Morgan fingerprints is as follows: for each atom in the molecule, using it as the center, enumerate all possible substructure patterns (such as atom type, bond type, ring structure, etc.) within a specified radius (e.g., radius 2 or 3), hash these substructure patterns into a fixed-length binary vector, and finally obtain the molecular fingerprint set. MACCS fingerprinting is based on 166 predefined structural features (such as specific functional groups, ring structures, etc.), checks whether molecules contain these features, and generates a 166-bit binary vector; by calculating the intersection and union of two molecular fingerprint sets, the Tanimoto similarity coefficient is obtained, which can measure the degree of structural similarity between two molecules.

[0054] Construct a molecular similarity graph, where nodes represent molecules and edge weights are similarity scores; for similarities exceeding a threshold... Molecular pairs (usually set to 0.6) are added to the set of similar molecular pairs. ;

[0055] The similarity preservation loss function is defined as:

[0056]

[0057] in Let be a set of similar pairs of molecules, containing all pairs that satisfy the condition... Molecular pairs , and Molecules and The representation vector obtained by the SA-GNN encoder (dimension: ), The L2 norm of a vector. The boundary hyperparameter (usually set to 2.0) controls the minimum distance between different molecular representations. The first term of the loss function minimizes the distance between the representation vectors of similar molecules (the higher the similarity, the smaller the distance), and the second term ensures that the distance between the representation vectors of different molecules is not less than [value missing]. This maintains the similarity relationship of molecules in the representation space, allowing molecules with similar structures to cluster together in the representation space.

[0058] Furthermore, the property prediction module includes:

[0059] Based on the aforementioned substructure-aware graph neural network, contrastive learning, and similarity preservation mechanism, a molecular representation is learned. (This indicates that, through the aforementioned comparative learning and similarity preservation mechanism optimization, it possesses discriminative and generalization capabilities.) A multi-task prediction head is constructed to simultaneously predict multiple molecular properties, including basic physicochemical properties (such as molecular weight, LogP, and solubility), biological activities (such as IC50 and Ki value), and ADMET properties (such as absorption, distribution, metabolism, excretion, and toxicity). Multi-task learning can fully utilize the correlation between different tasks, improving the model's generalization ability and representation quality.

[0060] For the task , , Given the total number of tasks, the prediction head is defined as follows:

[0061]

[0062] in For the task The weight matrix, For the task The bias vector, For the task The output dimension, For the task The predicted value is the predicted molecular property; for regression tasks (such as LogP, solubility prediction). , It is a scalar; for classification tasks (such as toxicity classification). Equal to the number of categories, This is the category probability distribution vector;

[0063] The joint loss function for multiple tasks is defined as follows:

[0064]

[0065] in The total number of tasks. For the task Weighting coefficients (used to balance the importance of different tasks). For the task The loss function (such as mean squared error, MSE) is used for regression tasks: Cross-entropy is used for classification tasks. For the task The true label. Through multi-task learning, different tasks share the underlying representation. This enables the learned representations to adapt to multiple tasks simultaneously, improving the model's generalization ability and representation quality.

[0066] Furthermore, based on the design of the aforementioned modules, a two-stage training strategy is adopted: the first stage involves self-supervised contrastive learning pre-training (utilizing the aforementioned contrastive learning mechanism and similarity preservation mechanism), and the second stage involves multi-task supervised fine-tuning (utilizing the aforementioned multi-task prediction head). This training strategy enables the model to fully utilize large-scale unlabeled data and small amounts of labeled data, achieving an improvement from general representation to task-specific performance; specifically including:

[0067] Phase 1: Self-supervised comparative learning pre-training

[0068] On large-scale unlabeled molecular datasets, the SA-GNN encoder is jointly optimized by contrastive learning loss and similarity preservation loss:

[0069]

[0070] in The aforementioned contrastive learning loss (InfoNCE loss) is used. Preserving loss for the similarity defined above, The weighting coefficient for the similarity loss (usually set to 0.5) is used to balance the importance of the two losses; this stage enables the model to learn a general molecular representation from unlabeled data, without any property labels, and the learned representation... It has the ability to distinguish and generalize.

[0071] Phase Two: Multi-task monitoring and fine-tuning

[0072] On labeled multi-task datasets, fix the encoder parameters or fine-tune the encoder using a small learning rate while optimizing the prediction head parameters:

[0073]

[0074] in For the multi-task joint loss defined above, To contrast the learning loss (used to maintain the quality of the representations learned during the pre-training phase). The weight coefficients for the contrast learning loss (typically set to 0.1) are used to maintain the quality of the pre-trained representations during fine-tuning, avoiding overfitting to labeled data and losing general representational capabilities. Through two-stage training, the model can learn general representations from large-scale unlabeled data while achieving excellent performance on specific tasks.

[0075] Furthermore, the interpretability analysis module includes:

[0076] For predicted molecular properties (Based on the aforementioned prediction head) (Calculated), calculate the contribution of each node to the prediction result:

[0077]

[0078] in For nodes Substructure attention score, For nodes go through The final representation after layer message passing, Indicates predicted value Node representation The gradient (calculated via backpropagation). Represents the absolute value or vector norm. Represents a node Importance scores are used. This formula combines attention scores (reflecting the importance of nodes within substructures) and gradients (reflecting the sensitivity of nodes to predictions), enabling more accurate identification of atoms and substructures that play a crucial role in properties. By visualizing important nodes and substructures, users can understand why the model predicts a molecule has specific properties, which functional groups, ring structures, or pharmacophores play a key role in those properties, providing a scientific basis for optimal molecular design.

[0079] Through the above technical solution, this invention realizes a molecular property prediction and drug design system based on graph comparison learning. It can learn universal representations from unlabeled data, effectively capture the similarity relationships between molecules, provide interpretable analysis, and support multi-task learning and molecular optimization design, providing strong technical support for AI-driven molecular design.

[0080] The beneficial effects of this invention are as follows:

[0081] 1. Through a self-supervised contrastive learning mechanism, this invention can learn general representations from large-scale unlabeled molecular data without requiring a large amount of expensive property labeling data. Compared with traditional supervised learning methods, the cost of acquiring training data is reduced by more than 80%, and the training cycle is shortened by more than 60%, enabling the model to quickly adapt to new domains and tasks.

[0082] 2. Through multi-view comparative learning and molecular similarity preservation mechanisms, the molecular representation learned in this invention exhibits stronger discriminative and generalization capabilities. Experiments on multiple benchmark datasets show that, compared to traditional graph neural network methods, LogP reduces prediction RMSE by 25%, solubility prediction RMSE by 30%, toxicity classification accuracy by 18%, and IC50 prediction RMSE by 22%, achieving industry-leading levels in all metrics.

[0083] 3. This invention innovatively provides interpretable analysis at the substructure level, clearly identifying which functional groups, ring structures, or pharmacophores play a key role in specific properties. This capability is of great value in drug design, enabling researchers to perform targeted molecular optimization based on model analysis results, thereby improving the success rate of drug design.

[0084] 4. Through a molecular similarity preservation mechanism, this invention effectively integrates prior knowledge from the field of chemistry (such as the rule that similar structures have similar properties), enabling the model to better understand the structure-property relationships between molecules. Compared to purely data-driven methods, the model's performance is improved by more than 35% in data-sparse scenarios.

[0085] 5. Through multi-task joint learning, this invention can predict multiple molecular properties simultaneously. Compared with training multiple independent models, it reduces computational resource consumption by 70%, increases inference speed by 3 times, and improves overall performance through knowledge sharing between tasks.

[0086] 6. Through large-scale unlabeled data pre-training, the molecular representation learned in this invention has strong generalization ability and can quickly adapt to new tasks and new fields. In few-shot learning scenarios (only 100 labeled samples), the model performance can still reach 85% of that trained on full data, which is significantly better than the model trained from scratch.

[0087] 7. Through interpretability analysis, this invention can not only predict molecular properties but also guide the optimized design of molecular structures. Researchers can modify key substructures in a targeted manner based on the importance analysis results to design new molecules with target properties, achieving reverse design from properties to structure.

[0088] 8. This invention can be applied to multiple fields such as drug discovery, materials design, catalyst optimization, environmental pollutant assessment, and pesticide design, and has broad market application prospects and commercial value. Especially in scenarios requiring rapid screening of candidate molecules and understanding of structure-property relationships, this invention has irreplaceable technical advantages.

[0089] 9. The technical framework of this invention has good scalability, can easily integrate more modal information (such as 3D geometric structure, reaction path, etc.), can be extended to more prediction tasks, and can be adapted to graph neural network architectures of different scales, providing a solid foundation for subsequent technology iteration and functional enhancement. Attached Figure Description

[0090] Figure 1 This is a flowchart of the present invention.

[0091] Figure 2 This is a framework diagram of the present invention. Detailed Implementation

[0092] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0093] As shown in the figure, this embodiment provides a molecular property prediction and drug design system based on graph comparison learning, with molecular activity prediction and optimization design in drug discovery as the application scenario. The specific scheme is as follows:

[0094] I. System Architecture and Data Preparation

[0095] A molecular property prediction and drug design system was constructed, which includes a data preprocessing module, a graph coding module, a comparison learning module, a property prediction module, and an interpretability analysis module.

[0096] Dataset configuration:

[0097] Unlabeled pre-trained dataset: ChEMBL database (containing approximately 2 million unlabeled molecular structures)

[0098] Annotated fine-tuning dataset: BindingDB (contains approximately 800,000 drug-target interaction data points, annotated with IC50 values).

[0099] Multi-task dataset: Self-built dataset (containing annotations of various properties of 100,000 molecules, including LogP, solubility, toxicity, ADMET properties, etc.)

[0100] The system uses SMILES strings as molecular input and converts them into a graph structure representation using the RDKit library. Each atom node's features include: atom type (one-hot encoded, covering common atoms such as C, N, O, S, P, F, Cl, Br, and I), hybridization state, formal charge, whether it's in an aromatic ring, degree (connectivity), etc., with feature dimensions... Each edge feature includes: bond type (single, double, triple, aromatic), whether it is in a cycle, bond conjugation, etc., feature dimensions. .

[0101] II. Molecular Diagram Representation and Multi-View Construction Implementation

[0102] Based on the aforementioned data preparation, for the input molecule, a standard 2D topological graph is first constructed according to the methods for molecular graph representation and multi-view construction described above. Taking the aspirin molecule (SMILES: "CC(=O)OC1=CC=CC=C1C(=O)O") as an example, this molecule contains 21 atomic nodes and 22 edges, with each atomic node having a feature dimension of... Feature dimensions of each edge .

[0103] Multi-view generation strategy:

[0104] 2D topological view: Preserves the original molecular structure. ,in It is the identity transformation function.

[0105] Enhanced Substructure View: Identify important functional groups (such as carboxyl-COOH and ester-COO-), enhance the atomic node features in these substructures, and mark important substructures by adding additional feature dimensions.

[0106]

[0107] in For atoms The original feature vector (defined by the aforementioned data preparation). Label the substructure vector. , This indicates a vector concatenation operation. If atoms... If it belongs to an important functional group, then A non-zero vector (encoding functional group type) is used; otherwise, a zero vector is generated. This generates an enhanced view of the substructure. ,in This is a transformation function to enhance the substructure.

[0108] Bond deletion view: Randomly delete 10% of non-critical chemical bonds (prioritizing single bonds not in the ring), generating structural variants. ,in This is a key deletion transformation function.

[0109] In this embodiment, the number of views is set. Three different views are generated for each molecule for subsequent comparative learning.

[0110] III. Substructure Perceptual Graph Neural Network Encoding Implementation

[0111] Based on the molecular graph view constructed above, a 5-layer SA-GNN encoder is constructed according to the design of the substructure perception graph neural network encoding described above. ), hidden layer dimensions This embodiment uses a graph attention network (GAT) as the specific implementation of the aforementioned abstract message passing mechanism (Update and Aggregate functions). GAT adaptively aggregates neighbor node information through the attention mechanism, which can better capture the features of molecular substructures.

[0112] Node representation update process:

[0113] For the layer( ),node From its neighboring nodes Aggregate information; this is the specific implementation of the aforementioned Aggregate function:

[0114]

[0115] in For the first Layer weight matrix ( , ), It is the ReLU activation function. This indicates that the node representation and edge features are concatenated. For nodes For neighboring nodes Attention weights Indicates to Sum all neighboring nodes. Initially, .

[0116] Attention weight The calculation formula is:

[0117]

[0118] in A learnable attention vector (dimension 1) ), The LeakyReLU activation function is used. The weight matrix is ​​the same as in the previous formula. This formula implements an adaptive attention mechanism, enabling the model to focus on important neighboring nodes and edges.

[0119] Substructure attention calculation:

[0120] After five layers of message passing, the final representation of each node is obtained. Following the aforementioned substructure attention mechanism design, calculate the substructure importance score for each node. Set the weight matrix. Attention vector Bias vector :

[0121]

[0122] in The learnable weight matrix (corresponding to the aforementioned) (), used to perform linear transformations on node representations. This is the attention weight vector, used to calculate the attention score. For bias vectors, This represents the total number of layers in the graph neural network. This represents the total number of atomic nodes in the molecule. For nodes The final representation after 5 layers of message passing (corresponding to the aforementioned) ,in ), Represents a node The importance score, and satisfying For aspirin molecules ( The calculated attention scores show that atoms in the carboxyl and ester groups have higher attention scores. The value (average approximately 0.08-0.12), while atoms in the alkyl chain have lower... The values ​​(averaging approximately 0.02–0.04) are consistent with chemical intuition, indicating that the model has successfully identified important functional groups.

[0123] Molecules represent polymerization:

[0124] According to the aforementioned formula, the final molecule representation is obtained by weighted aggregation of all node representations:

[0125]

[0126] in A graph representation vector of a molecule (dimension) For the aspirin molecule, a 256-dimensional molecular representation vector is obtained, which will be used for subsequent contrastive learning and property prediction.

[0127] IV. Implementation of Multi-View Comparison Learning

[0128] Based on the aforementioned generated multi-views and the constructed SA-GNN encoder, the mechanism is implemented according to the design of the aforementioned multi-view contrastive learning mechanism. During the pre-training phase, a training strategy with a batch size of 512 is adopted. For each molecule in the batch, three views are generated according to the aforementioned method, resulting in 1536 image samples (512 molecules × 3 views).

[0129] Contrastive learning loss calculation:

[0130] For molecules Two different views and (Generated by the aforementioned view function) and (Generated), and the representation vectors are obtained respectively through the aforementioned SA-GNN encoder. and (All dimensions are 256). Set temperature hyperparameters. .

[0131] For positive sample pairs Similarity is calculated using the aforementioned cosine similarity function. Assuming , (Different views of the same molecule), calculate cosine similarity to obtain .

[0132] negative sample set Includes all view representations of the other 511 molecules in the batch (a total of 1533 negative samples). Calculation Similarity with all negative samples, assuming an average similarity of 0.15.

[0133] Calculate the contrastive learning loss using the aforementioned InfoNCE loss function:

[0134]

[0135] Substitute specific values: , ,get:

[0136]

[0137] By minimizing this loss, the model learns to make different views of the same molecule similar (similarity close to 1) and different representations of different molecules separate (similarity close to 0), thereby learning discriminative molecular representations from unlabeled data.

[0138] V. Implementation of Molecular Similarity Preservation Mechanisms

[0139] Building upon the aforementioned comparative learning, this mechanism was implemented according to the design of the aforementioned molecular similarity preservation mechanism. Intermolecular similarity was calculated based on Morgan fingerprints (radius 2, 2048 bits). For the 512 molecules in the batch, the Tanimoto similarity of all molecular pairs was calculated using the aforementioned formula:

[0140]

[0141] in Indicates molecule Using Morgan's fingerprint set, construct a similarity matrix. .

[0142] Set a similarity threshold ,for Molecular pairs, added to the set of similar molecular pairs Suppose that approximately 1200 pairs of similar molecules are found in a batch of 512 molecules.

[0143] Similarity preservation loss calculation:

[0144] Set boundary hyperparameters For similar molecular pairs Assuming , and Molecules and The representation vector (dimension 256) obtained by the aforementioned SA-GNN encoder. Therefore, according to the aforementioned formula, this loss is .

[0145] For dissimilar molecular pairs Assuming Therefore, according to the aforementioned formula, this loss is (Minimum distance requirement has been met); if The loss is .

[0146] Calculate the similarity preservation loss using the aforementioned formula:

[0147]

[0148] Set similarity loss weights According to the formula for the aforementioned two-stage training strategy, the total pre-training loss is:

[0149]

[0150] in This is the contrastive learning loss calculated above.

[0151] VI. Multi-task nature prediction and implementation

[0152] Based on the molecular representation learned above (This indicates optimization through the aforementioned contrastive learning and similarity preservation mechanism), and a multi-task prediction head is constructed according to the aforementioned design of multi-task property prediction and joint optimization. In this embodiment, four prediction task heads are constructed ( ):

[0153] LogP prediction (regression task) ): Predicts the lipophilicity of molecules, output dimension

[0154] Solubility prediction (regression task) ): Predict water solubility (logS), output dimension

[0155] Toxicity classification (binary classification task) ): Predicts whether a molecule is toxic, output dimension

[0156] IC50 prediction (regression task) ): Predicts the IC50 value of drug-target interaction, output dimension

[0157] Predicting head structure:

[0158] For LogP prediction tasks ( According to the aforementioned formula, the weight matrix (in , ), bias (The regression task is a scalar):

[0159]

[0160] in The weight matrix for the LogP prediction task (corresponding to the aforementioned) ,in , ), The bias vector for the LogP prediction task (corresponding to the aforementioned) (The regression task is a scalar) The molecular representation vector obtained above (corresponding to the aforementioned) ,in ), The predicted value of LogP (corresponding to the aforementioned) ,in ).

[0161] For toxicity classification tasks ( ), weight matrix ( ), bias :

[0162]

[0163] in It is a binary probability distribution. This is the softmax normalization function.

[0164] Multi-task loss calculation:

[0165] Set task weights (LogP) (Solubility) (Toxicity has a high weight in classification tasks). (IC50, with a higher weighting for drug activity task).

[0166] For regression tasks ( ), using mean squared error loss:

[0167]

[0168] in This is the true label for LogP.

[0169] For classification tasks ( Cross-entropy loss is used:

[0170]

[0171] in For toxicity categories, use true labels (one-hot encoded). To predict probabilities.

[0172] According to the aforementioned formula, the total loss from multitasking is:

[0173]

[0174] VII. Model Training Implementation

[0175] Model training is conducted according to the aforementioned two-stage training strategy.

[0176] Phase 1: Self-supervised comparative learning pre-training

[0177] Pre-training was performed on the ChEMBL dataset (2 million unlabeled molecules) for 10 epochs. The AdamW optimizer was used, with an initial learning rate of [missing information]. The batch size is 512, and cosine annealing is used for learning rate scheduling. Following the aforementioned formula, the contrastive learning loss weight is set to 1.0, and the similarity loss weight is... The total pre-training loss is:

[0178]

[0179] in The contrastive learning loss calculated above, The loss is maintained for the similarity calculated above.

[0180] During training, the model learned a general molecular representation. After pre-training, the representation quality was evaluated on the validation set: the average cosine similarity of different view representations of the same molecule reached 0.89, and the average similarity of representations of different molecules was 0.12, indicating that the model successfully learned discriminative representations, laying the foundation for subsequent fine-tuning.

[0181] Phase Two: Multi-task monitoring and fine-tuning

[0182] Fine-tuning was performed on a labeled multi-task dataset (100,000 molecules) and trained for 20 epochs. A small learning rate was used. Batch size 128. Set the contrastive learning loss weights according to the aforementioned formula. This is used to maintain the quality of the pre-trained representations. The total fine-tuning loss is:

[0183]

[0184] in The multi-task joint loss calculated above, To contrast the learning loss (used to maintain the quality of pre-trained representations).

[0185] After training, the model's performance on the test set was as follows: the root mean square error (RMSE) for LogP prediction was 0.68, the RMSE for solubility prediction was 0.85, the accuracy for toxicity classification reached 91.2%, and the RMSE for IC50 prediction was 0.92 (logscale). Compared with the baseline method that only uses supervised learning, all indicators were improved by 15-25%, which verifies the effectiveness of the method of this invention.

[0186] VIII. Implementation of Interpretability Analysis

[0187] Based on the aforementioned substructure attention mechanism and property prediction results, this analysis is implemented according to the design of the aforementioned interpretability analysis mechanism. For predicted molecular properties, the system provides substructure importance analysis. Taking the LogP prediction of the aspirin molecule as an example, assuming the predicted value is obtained through the aforementioned prediction head... .

[0188] Importance score calculation:

[0189] Calculate the contribution of each node to the prediction result using the aforementioned formula. For each node... (such as the oxygen atom in a carboxyl group), its attention fraction (Calculated by the aforementioned substructure attention mechanism, corresponding to the aforementioned...) ),gradient (Calculated through backpropagation, Corresponding to the above exist The specific value of time, Corresponding to the above exist The specific value at time is the node. (The final representation after 5 layers of message passing) is then, according to the aforementioned formula, the importance score is:

[0190]

[0191] in The importance score corresponding to the aforementioned definition represents the node. Contribution to the prediction results.

[0192] For carbon atoms in alkyl chains The gradient is 0.12, and the importance score is... .

[0193] The system visualization shows that atoms in the carboxyl and ester groups have high importance scores (average 0.04-0.05). These functional groups have a significant impact on the lipophilicity of molecules, consistent with chemical knowledge. Users can use the visualization interface to see which substructures play a key role in specific properties, understand the basis of the model's predictions, and receive guidance for molecular optimization design.

[0194] Through the detailed description of this embodiment, those skilled in the art can clearly understand the technical solution of the present invention, and can implement the present invention in practical application scenarios according to the described method and system configuration, so as to achieve efficient and accurate molecular property prediction and drug design.

[0195] In summary, this invention innovatively designs multiple molecular graph view generation strategies (2D topological graph, substructure enhanced view, and bond deletion view). Through comparative learning, different views of the same molecule are made similar in representation space, while the representations of different molecules are separated. This method can learn general representations from large-scale unlabeled molecular data, breaking through the limitation of traditional methods that rely on a large amount of labeled data, and significantly improving the model's generalization ability.

[0196] This invention designs a graph neural network capable of automatically identifying and encoding important molecular substructures (functional groups, ring structures, pharmacophores), highlighting the influence of key substructures on molecular properties through an attention mechanism. This architecture not only improves prediction accuracy but also provides a foundation for interpretability analysis, enabling users to understand why the model predicts a molecule to have specific properties.

[0197] This invention constructs a molecular similarity graph based on prior chemical knowledge (Tanimoto similarity, molecular fingerprint), and uses a similarity-preserving loss function to cluster similar molecules in the representation space, separating different molecules. This mechanism fully utilizes prior knowledge in the field of chemistry to improve the accuracy of molecular retrieval and similarity search, enabling the model to better understand the structure-property relationships between molecules.

[0198] This invention designs a multi-task prediction head that simultaneously optimizes multiple molecular property prediction tasks (LogP, solubility, toxicity, IC50, etc.), improving representation quality and generalization ability through knowledge sharing between tasks. Compared to single-task models, multi-task learning can fully utilize the correlation between different tasks, reduce computational resource consumption, and improve overall performance.

[0199] This invention employs a two-stage training strategy: self-supervised contrastive learning pre-training and multi-task supervised fine-tuning. The first stage learns a general representation from unlabeled data, while the second stage performs task-specific fine-tuning on labeled data. This strategy effectively addresses the problem of scarce labeled data for molecular properties, enabling the model to fully utilize large-scale unlabeled data while achieving excellent performance on small-scale labeled data.

[0200] This invention calculates the contribution of each atomic node to the prediction results through substructure attention scores and gradient analysis, providing a visually interpretable analysis. This mechanism transforms the model from a "black box," enabling users to understand which substructures lead to specific properties and providing a scientific basis for drug design and molecular optimization.

[0201] This invention designs a flexible view generation function that can adaptively select view transformation strategies based on molecular characteristics. Different view generation strategies are employed for different categories of molecules (such as small molecule drugs and macrocyclic compounds), thereby improving the effectiveness of comparative learning and the adaptability of the model.

[0202] The above embodiments are merely typical illustrative methods of the present invention, and the scope of protection of the present invention is not limited thereto. All equivalent substitutions and improvements made under the concept of the present invention should fall within the scope of protection. It should be emphasized that any modifications or minor adjustments made by those skilled in the art without departing from the basic principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A molecular property prediction and drug design system based on graph comparison learning, characterized in that, include: The data preprocessing module is used for molecular graph representation and multi-view construction. Molecular graph representation generates multiple views for the same molecule through different graph transformation operations, including 2D topological graph views, substructure enhancement views, and bond deletion views. Multi-view construction maintains semantic consistency across different views of the same molecule, while allowing for differences in structural representation. Graph encoding module: Design a substructure-aware graph neural network (SA-GNN) to extract molecular representations, which are used to identify and encode important molecular substructures, and highlight the influence of molecular substructures on molecular properties through an attention mechanism; Contrastive learning module: Employs a contrastive learning mechanism to make different views of the same molecule similar in the representation space, and to separate the representations of different molecules in the space, thereby learning a general molecular representation from unlabeled data; Property prediction module: Constructs a multi-task prediction head to predict multiple molecular properties simultaneously; Interpretability Analysis Module: Based on substructure perception and property prediction results, it provides interpretability through substructure attention scores and gradient analysis.

2. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, The data preprocessing module includes: Modeling molecules as graph structures ,in Represents a set of atomic nodes. Number of atoms Represents the set of chemical bond edges; each atom node Eigenvectors containing atom type, hybridization state, and charge ,in The atomic feature dimension; each edge Feature vectors containing key type, key order, and whether they are in a cycle ,in The edge feature dimension; To enhance the robustness and generalization ability of the model, multiple molecular diagram views are constructed; let the original molecular diagram be... Generate functions through views Generate multiple views: in Indicates the first Various view transformation operations, For the generated first One view, , Total number of views; The specific implementation method for view generation is as follows: 2D topology view : It is an identity transformation function that preserves the original molecular structure, i.e. ; Substructure Enhanced View This involves enhancing the atomic node features in these substructures by identifying important functional groups and ring structures. Specifically, for atomic nodes... If it belongs to an important functional group or a ring structure, then the substructure label vector is increased by feature concatenation. The enhanced node features are ,in A tag vector that encodes functional groups or ring structure types. This indicates a vector concatenation operation; if an atom does not belong to an important substructure, its original features are preserved. Key to delete view The method involves generating structural variants by randomly deleting some non-critical chemical bonds. Specifically, non-critical chemical bonds are first identified, and then these bonds are randomly deleted according to a preset deletion ratio to generate structural variants.

3. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, The graph encoding module includes: For input molecular graph SA-GNN first updates the node representation through a message passing mechanism; in the... Layers, nodes The representation is updated as follows: in Indicates the first Layer nodes The hidden representation, For the hidden layer dimension, Represents a node The set of neighboring nodes, This is an aggregation function used to aggregate information about neighboring nodes. This is an update function used to merge the current node information and the aggregated neighbor information; initially, That is, the original feature vectors of atomic nodes are used in layer 0; The message passing mechanism is specifically as follows: The function employs an attention-based aggregation method, adaptively aggregating information about important neighbor nodes by calculating the attention weights between nodes; specifically, for neighbor nodes... Calculate attention weights Then, the neighbor information is aggregated using a weighted summation method: ,in It is a multilayer perceptron. This indicates vector concatenation; The function is used to merge the representation of the current node. The aggregated neighbor information is then processed using a linear transformation and activation function: ,in The weight matrix is ​​a learnable matrix. For activation function, This represents the aggregated neighbor information; through multi-layer message passing, the node representation can gradually integrate information from multi-hop neighbors, thereby capturing the global structural features of the molecule. go through After layer message passing, the final representation of each node is obtained. To identify important substructures, a substructure attention mechanism is designed; for each node... Calculate the attention score for its important substructure: in This is a learnable weight matrix used to perform linear transformations on the node representations. This is the attention weight vector, used to calculate the attention score. For bias vectors, This represents the total number of layers in the graph neural network. This represents the total number of atomic nodes in the molecule. Represents a node The importance score, and satisfying ; The final molecular graph representation is obtained by weighted aggregation of all node representations: in is the graphical representation vector of the molecule.

4. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, The contrastive learning module includes For molecular diagrams Two different views and The representation vectors are obtained through SA-GNN. and Comparative learning was performed using the InfoNCE loss function. in The cosine similarity function is used to measure the degree of similarity between two vector representations. and Let be any two representation vectors, Describes the L2 norm of a vector. This is a temperature hyperparameter used to adjust the sharpness of the similarity distribution. The negative sample set contains all view representations of other molecules in the current training batch. The representation vector of the negative sample.

5. The molecular property prediction and drug design system based on graph comparison learning according to claim 4, characterized in that, A molecular similarity preservation mechanism is designed, which constructs a molecular similarity graph based on chemical similarity metrics. An additional loss function constraint enables similar molecules to cluster in the representation space and different molecules to separate in the representation space. This mechanism complements the contrastive learning mechanism to jointly optimize the molecular representation space. Let the molecular set be ,in For the number of molecules, For any two elements in the set and Calculate their chemical similarity Calculate the Tanimoto coefficient based on molecular fingerprinting: in Indicates molecule The fingerprint set was generated using a molecular fingerprinting method. Indicates the size of the set. To represent the intersection of sets, Represents the union of sets; The larger the value, the more similar the two molecules are in chemical structure; The molecular fingerprint generation method is as follows: Morgan fingerprints or MACCS fingerprints can be used. The Morgan fingerprint generation method involves: for each atom in the molecule, enumerating all possible substructure patterns within a specified radius centered on that atom, hashing these substructure patterns into a fixed-length binary vector, and finally obtaining the molecule's fingerprint set. MACCS fingerprinting is based on 166 predefined structural features. It checks whether a molecule contains these features and generates a 166-bit binary vector. By calculating the intersection and union of two molecular fingerprint sets, the Tanimoto similarity coefficient is obtained, which can measure the degree of structural similarity between two molecules. Construct a molecular similarity graph, where nodes represent molecules and edge weights are similarity scores; for similarities exceeding a threshold... Molecular pairs, added to the set of similar molecular pairs ; The similarity preservation loss function is defined as: in Let be a set of similar pairs of molecules, containing all pairs that satisfy the condition... Molecular pairs , and Molecules and The representation vector obtained by the SA-GNN encoder Describes the L2 norm of a vector. is a boundary hyperparameter used to control the minimum distance between different molecular representations.

6. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, The property prediction module includes: Based on the aforementioned substructure-aware graph neural network, contrastive learning, and similarity preservation mechanism, a molecular representation is learned. Construct a multi-task prediction head to predict multiple molecular properties simultaneously; For the task , , Given the total number of tasks, the prediction head is defined as follows: in For the task The weight matrix, For the task The bias vector, For the task The output dimension, For the task The predicted value, i.e. the predicted molecular properties; The joint loss function for multiple tasks is defined as follows: in For the total number of tasks, For the task The weighting coefficients, For the task loss function, For the task The true label.

7. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, A two-stage training strategy is adopted: the first stage involves self-supervised contrastive learning pre-training, and the second stage involves multi-task supervised fine-tuning; specifically, it includes: Phase 1: Self-supervised comparative learning pre-training On large-scale unlabeled molecular datasets, the SA-GNN encoder is jointly optimized by contrastive learning loss and similarity preservation loss: in The contrastive learning loss is defined above. Preserving loss for the similarity defined above, These are the weighting coefficients for the similarity loss, used to balance the importance of the two losses; Phase Two: Multi-task monitoring and fine-tuning On labeled multi-task datasets, fix the encoder parameters or fine-tune the encoder using a small learning rate while optimizing the prediction head parameters: in For the multi-task joint loss defined above, To compare learning loss, The weight coefficients of the comparative learning loss are used to maintain the quality of the pre-trained representation during fine-tuning and to avoid overfitting the labeled data and losing general representational capabilities.

8. The molecular property prediction and drug design system based on graph comparison learning according to claim 1, characterized in that, The interpretability analysis module includes: For predicted molecular properties Calculate the contribution of each node to the prediction result: in For nodes Substructure attention score, For nodes go through The final representation after layer message passing, Indicates predicted value Node representation gradient, Represents the absolute value or vector norm. Represents a node Importance score.