A molecular property prediction method based on multimodal gating and contrastive learning

By combining multimodal gating and contrastive learning methods with molecular graph structure and fingerprint features, the problem of relying on single-modal data in existing technologies is solved, and high-precision molecular property prediction is achieved with a small amount of labeled data.

CN121075484BActive Publication Date: 2026-01-30LUDONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511612007.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-01-30
Estimated Expiration
2045-11-06

AI Technical Summary

Technical Problem

Existing graph neural network methods rely heavily on the amount of labeled data in predicting molecular properties and fail to fully utilize the complementary information of multi-source features, resulting in a decline in generalization ability in data-scarce scenarios.

Method used

By employing a multimodal gating and contrastive learning approach, combining molecular graph structure and fingerprint features, and through contrastive learning pre-training and gating fusion mechanisms, we achieve efficient fusion and prediction of multimodal features.

Benefits of technology

It improves the accuracy and generalization ability of molecular property prediction, and can maintain high accuracy even with a small amount of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121075484B_ABST
    Figure CN121075484B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of bioinformatics and relates to a molecular property prediction method based on multimodal gating and contrastive learning, including techniques such as contrastive learning, graph neural networks, cross-modal alignment, and gated attention. First, data standardization and graph construction are performed, and molecular fingerprint embeddings are extracted. Second, a heterogeneous dual-channel graph encoding architecture is adopted, with one channel capturing short-range atomic interactions through an attention mechanism, and the other integrating the global molecular structure and long-range dependencies to generate complementary molecular representations. Subsequently, a cross-modal attention mechanism is introduced to achieve bidirectional association between graph and fingerprint features, and modal weights are adaptively and dynamically allocated via a gated fusion module. Finally, a contrastive pre-training strategy is employed to construct sample pairs using the molecular graph and fingerprint, learning discriminative molecular representations on unlabeled data. This method significantly improves the accuracy of molecular property prediction, providing an efficient and reliable computational tool for virtual drug screening and lead compound optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of bioinformatics and relates to a molecular property prediction method based on multimodal gating and contrastive learning, including contrastive learning, graph neural networks, cross-modal alignment, gating attention and other techniques. Background Technology

[0002] Molecular property prediction is a crucial step in computational chemistry and drug design, aiming to accurately infer the physicochemical properties, biological activity, and toxicity of molecules through computational models. Molecular properties arise from the complex electronic structure, spatial configuration, and interactions between atoms; therefore, effectively extracting these implicit features from molecular representations is a decisive factor in prediction accuracy. This technology plays an irreplaceable role in reducing the cost of new drug development, decreasing reliance on animal testing, and optimizing green chemical synthesis pathways.

[0003] Traditional methods for predicting molecular properties primarily rely on empirical descriptors or quantum chemical calculations. The former constructs statistical models using manually designed molecular fingerprints or physicochemical parameters, but descriptor design is subjective and struggles to cover complex three-dimensional conformations. The latter, while capable of accurately calculating electronic structures, suffers from computational complexity that increases exponentially with the number of atoms, making it unsuitable for large molecular systems. With the development of deep learning technology, graph neural networks (GNNs) have achieved end-to-end molecular representation learning by modeling molecules as topological graphs of atomic nodes and chemical bond edges. However, existing GNN methods have two major limitations: first, they heavily rely on the amount of labeled data, leading to a significant decrease in generalization ability in data-scarce scenarios; second, most models utilize only a single mode of graph structure, neglecting the complementarity of multi-source features such as molecular fingerprints. Summary of the Invention

[0004] Traditional molecular property prediction methods suffer from limited generalization ability due to their reliance on single-modality data and a large number of labeled samples, failing to fully explore and integrate complementary information between different modalities. To address this issue, this invention proposes a molecular property prediction method based on multimodal gating and contrastive learning. By combining molecular graph structure and fingerprint feature information, and utilizing contrastive learning pre-training and gating fusion mechanisms, this method achieves high-precision prediction with a small amount of labeled data, thereby improving the model's molecular property prediction capability.

[0005] A molecular property prediction method based on multimodal gating and contrastive learning includes five processes: molecular data preprocessing and feature extraction, graph neural network encoder construction, contrastive learning pre-training, joint loss function optimization, and multimodal feature fusion. The specific steps are as follows:

[0006] Step 1: Using the ChemInformation Toolkit, the molecular SMILES (Simplified Molecular Input LineEntry System) data is parsed into a molecular graph structure containing 93-dimensional atomic node features and 11-dimensional chemical bond edge features. At the same time, 881-dimensional PubChem fingerprint, 166-dimensional MACCS (Molecular ACCess System) fingerprint and ErG (ExtendedReduced Graph) fingerprint are extracted and concatenated into a 1489-dimensional comprehensive fingerprint feature vector.

[0007] Step 2: Construct two parallel graph neural network encoders. The graph attention encoder uses a two-layer graph attention network. The first layer uses 10 attention heads to output 5120-dimensional features, and the second layer uses a single attention head to output 512-dimensional features. The graph isomorphic encoder uses a three-layer graph isomorphic network with output dimensions of 512, 1024, and 512 dimensions, respectively. At the end of each encoder, integrate two Transformer encoders, each using eight attention heads and a 2048-dimensional feedforward network, to capture global semantic dependencies in the molecule.

[0008] Step 3: Use the NT-Xent (Normalized Temperature-Scaled Cross-Entropy Loss) contrastive loss function, set the temperature parameter as a learnable variable, and take the 512-dimensional features output by the graph attention and graph isomorphic encoder of the same molecule as positive sample pairs, and the features of other molecules in the current batch as negative samples. Self-supervised pre-training is performed by maximizing the cosine similarity of the positive sample pairs.

[0009] Step 4: Simultaneously calculate the binary cross-entropy classification loss and the contrastive learning loss during the downstream task training phase. The contrastive loss is calculated after mapping the features to a 128-dimensional space through a projection network. The contrastive loss weight coefficient is set to 0.1 to achieve joint optimization.

[0010] Step 5: Normalize the pre-trained graph structure features, project the fingerprint features to 512 dimensions through a fully connected network, apply a 4-head cross-modal attention mechanism to achieve bidirectional interaction between graph features and fingerprint features, use a gated fusion module to dynamically adjust the contribution weights of the three feature sources, and finally input the fused features into a multilayer perceptron prediction network containing a normalization layer, GELU (Gaussian Error Linear Unit) activation and random deactivation, and output the molecular property prediction results.

[0011] A molecular property prediction method based on multimodal gating and contrastive learning is described below, with step 1 implemented as follows:

[0012] First, the SMILES string is parsed into molecular objects using a chemical information toolkit, and atomic feature vectors are extracted, including atom type, degree, number of hydrogen atoms, formal charge, chiral label, and hybridization state. Second, edge feature vectors are extracted, including bond type, stereochemical information, and bond orientation, and an adjacency matrix is ​​constructed to represent atomic connections. Finally, PubChem fingerprint, MACCS key fingerprint, and ErG fingerprint are calculated and concatenated into a comprehensive fingerprint vector, providing input features for subsequent multimodal fusion.

[0013] A molecular property prediction method based on multimodal gating and contrastive learning, the implementation process of step 2 is as follows:

[0014] First, a graph attention encoder is constructed to enhance information transmission between nodes through edge features. Second, a graph isomorphic encoder is constructed to aggregate neighbor node information through a multilayer perceptron and complete feature updates by combining edge features. Finally, a Transformer encoder layer is integrated at the end of the two encoders to capture global semantic dependencies of molecules using a multi-head self-attention mechanism, forming a parallel processing architecture.

[0015] A molecular property prediction method based on multimodal gating and contrastive learning, the implementation process of step 3 is as follows:

[0016] First, the NT-Xent contrastive loss function is used to input the features generated by the graph attention and graph isomorphic encoders of the same molecule as positive sample pairs. Second, in the current training batch, the features generated by the graph attention and graph isomorphic encoders of other molecules are used as negative samples, and the concentration of similarity distribution is adjusted by temperature parameter. Finally, the encoder parameters are optimized so that positive sample pairs are close to each other in the feature space and negative sample pairs are far apart, generating a discriminative general molecular representation.

[0017] A molecular property prediction method based on multimodal gating and contrastive learning, the implementation process of step 4 is as follows:

[0018] First, during the downstream task training phase, the binary cross-entropy classification loss and the contrastive learning loss are calculated simultaneously. The contrastive loss is calculated by mapping graph features and fingerprint features to the contrastive space through a projection network. Second, the contrastive loss weight coefficient is set to dynamically balance the contributions of the two losses. Finally, special label values ​​are masked to eliminate the gradient influence of invalid samples and achieve stable joint optimization training.

[0019] A molecular property prediction method based on multimodal gating and contrastive learning is described below, with step 5 implemented as follows:

[0020] First, the graph structure features extracted by the pre-trained graph encoder are normalized, while the molecular fingerprint features are projected onto the same dimension through a fully connected network. Second, a cross-modal attention mechanism is applied to achieve bidirectional interaction between graph features and fingerprint features, and feature enhancement is completed through multi-head attention. Finally, a gated fusion module is used to dynamically adjust the contribution weights of the three feature sources, and the fused features are input into a multilayer perceptron to output the final molecular property prediction results. Attached Figure Description

[0021] Figure 1 This is a flowchart of a molecular property prediction method based on multimodal gating and contrastive learning.

[0022] Figure 2 It is a pre-trained graph with dual encoders.

[0023] Figure 3 It is a comparative learning diagram.

[0024] Figure 4 This is a fusion diagram of a multimodal gating fusion mechanism. Detailed Implementation

[0025] The present invention will now be described in detail with reference to the accompanying drawings and examples.

[0026] The purpose of this invention is to propose a flowchart of a molecular property prediction method based on multimodal gating and contrastive learning. Figure 1 This is a flowchart of a molecular property prediction method based on multimodal gating and contrastive learning. It includes five processes: molecular data preprocessing and feature extraction, graph neural network encoder construction, contrastive learning pre-training, joint loss function optimization, and multimodal feature fusion. The specific implementation steps are shown below:

[0027] Step 1: Using a cheminformatics toolkit, the molecular SMILES data is parsed into a molecular graph structure containing atomic nodes and chemical bond edges. Simultaneously, multi-dimensional molecular fingerprint features such as PubChem fingerprints and MACCS fingerprints are extracted, including the following:

[0028] First, the SMILES string is parsed into molecular objects using the Chem.MolFromSmiles() function, specifically through the Chem.MolFromSmiles() toolkit. Molecules that fail to parse are filtered out. Second, atomic feature vectors are extracted, including atom type (44 elements encoded using one-of-k encoding, dimension 44), atomicity (0-10, dimension 11), number of hydrogen atoms (0-10, dimension 11), formal charge (-2 to 2, dimension 5), chiral label (0-3, dimension 4), hybridization state (5 types, dimension 5), aromaticity (Boolean value, dimension 1), and normalized mass (multiplied by 0.01, dimension 1). Each atom generates a 93-dimensional feature vector, and all features are normalized (divided by the sum of the features). Then, edge feature vectors are extracted, including bond type (single bond, double bond, triple bond, aromatic bond, etc., through...). One-hot encoding (dimension 6) and stereochemical information (0-4, one-hot encoded, dimension 5) are used, resulting in a total edge feature dimension of 11, which is then normalized. Simultaneously, molecular fingerprint features are calculated, including PubChem fingerprints (based on 881 SMARTS patterns, dimension 881), MACCS key fingerprints (dimension 166), and ErG fingerprints (dynamically calculated, variable in dimension, ultimately adjusted to a fixed dimension). All fingerprints are concatenated into a 1489-dimensional composite vector. Finally, global average pooling is used to aggregate node-level features into molecular-level representations. Specifically, the `global_mean_pool` function aggregates a variable number of node features (dimension 93) into fixed-dimensional molecular graph features (dimension 93), and these features are integrated into the final input data for use by the graph neural network for subsequent model training.

[0029] Step 2: Construct two parallel graph neural network encoders based on the molecular graph in Step 1, and integrate Transformer layers to capture global semantic dependencies of molecules; Figure 2 It is a dual-encoder contrastive learning pre-training map, including the following:

[0030] First, a graph attention network encoder is constructed using a two-layer graph convolutional structure: the first layer has an input dimension of 93, an output dimension of 512, and 10 attention heads, resulting in an actual output dimension of 512 × 10 = 5120. It uses ELU activation and random deactivation (p = 0.2), with edge features projected to the 93-dimensional region through a fully connected layer. The second layer has an input dimension of 5120, an output dimension of 512, and 1 attention head, using ELU activation and random deactivation, with edge features projected to the 512-dimensional region. Then, a Transformer encoder layer is integrated at the end of the graph attention encoder. Specifically, the TransformerEncoder module contains two encoder layers, each with 8 attention heads, a feedforward network dimension of 2048, and input and output dimensions of 512 each. It captures global semantic dependencies of molecules through a self-attention mechanism. Second, a graph isomorphic network encoder is constructed using a three-layer graph isomorphic convolutional structure: the first layer has an input dimension of 93, an output dimension of 512, and 10 attention heads, resulting in an actual output dimension of 512 × 10 = 5120. 2. A linear programming algorithm (MLP) with linear layers (93→512) is used for neighbor aggregation, followed by ELU activation. Edge features are projected to 93 dimensions through a fully connected layer. The second layer has an input dimension of 512 and an output dimension of 1024. The MLP is then applied (512→1024), with ELU activation, and edge features are projected to 512 dimensions. The third layer has an input dimension of 1024 and an output dimension of 512. The MLP is then applied (1024→512), with ELU activation, and edge features are projected to 1024 dimensions. A Transformer encoder layer is then integrated at the end of the graph isomorphic encoder, with parameters identical to those of the graph attention encoder. Finally, both encoders process the same molecular graph input in parallel, outputting 512-dimensional molecular-level feature vectors. These graph-level features are ultimately used for predicting molecular properties, achieving accurate modeling and analysis of molecular properties.

[0031] Step 3: Using the NT-Xent contrastive loss function, self-supervised pre-training is performed through a dual encoder architecture to generate a general molecular representation. Figure 3 This is a contrastive learning graph, including the following: First, the NT-Xent contrastive loss function is used, and its mathematical expression is: .in, Let represent the feature vectors generated by the same molecule through graph attention and graph isomorphic encoder, respectively, and sim be the cosine similarity function. This is the temperature parameter (default value 0.1, learnable range 0.05-0.3). NThe batch size is set (default 128). Next, positive and negative sample pairs are constructed: features generated by inputting the same molecule into the graph attention and graph isomorphic encoder are used as positive sample pairs, while features generated by other molecules in the current training batch are used as negative samples. A mask matrix is ​​used to exclude self-comparison. Then, the sharpness of the similarity distribution is adjusted using a temperature parameter, optimizing the encoder parameters to maximize the cosine similarity of positive sample pairs in the feature space and minimize the similarity of negative sample pairs. Finally, the pre-trained encoder weights are saved for downstream task initialization.

[0032] Step 4: During the downstream task training phase, simultaneously calculate the binary cross-entropy classification loss and the contrastive learning loss, and jointly optimize the two losses by balancing the weights. This includes the following: First, during the downstream task training phase, calculate the binary cross-entropy classification loss, whose mathematical expression is: .in, For real labels, This is the original output of the model. For the sigmoid function, N The effective sample size is determined first. Next, the contrastive learning loss is calculated: GNN features and fingerprint features are mapped to a 128-dimensional contrastive space using a projection network. The projection network structure consists of a linear layer (512→256), a normalization layer, a GELU activation layer, and another linear layer (256→128). The contrastive loss is then calculated using the NT-Xent loss function, with the temperature parameter being a learnable variable. Finally, the contrastive loss weight coefficient is set to 0.1, dynamically balancing the two losses. The total loss formula is... Finally, a masking process is performed to calculate the loss and gradient only for valid samples, eliminating the influence of invalid samples.

[0033] Step 5: Dynamically weight and fuse the pre-trained graph structure features and molecular fingerprint features through cross-modal attention and gating fusion mechanisms, and finally input the results into the prediction network to output the molecular property prediction results. Figure 4 This is a multimodal gating fusion mechanism for graph fusion, which includes the following: First, pre-trained graph attention and graph isomorphic encoders are loaded as feature extractors; then, molecular graph data from the training set are input into the graph attention and graph isomorphic encoders respectively to obtain two molecular graph representation vectors. and Secondly, the molecular fingerprint features (1489 dimensions) are projected to 512 dimensions through a fully connected network, mapping them to a feature space of the same dimension as the graph representation. The network structure is: linear layer (1489→1024), normalization layer, GELU activation, random deactivation (0.2), and linear layer (1024→512) to obtain the fingerprint representation vector. Then, a cross-modal attention mechanism is applied to achieve bidirectional interaction between graph features and fingerprint features; the first module uses graph attention features. For querying, using fingerprint features Given a key and a value, output a graph feature representation enhanced with fingerprint information. _attn The second module uses fingerprint features. For querying, use graph isomorphic features Given keys and values, output a fingerprint representation enhanced with GNN information. _attn The original features and the enhanced features are residually connected to obtain... _combined and _combined The two enhanced graph representations and fingerprint representations are concatenated. Then, a gated fusion module dynamically adjusts the contribution weights of the three feature sources (enhanced graph attention, enhanced graph isomorphism, and projected fingerprint). Specifically, the gated fusion module concatenates the three 512-dimensional features into a 1536-dimensional vector, generates a weight matrix through a gated network (linear layer 1536→1536, sigmoid activation), and performs element-wise multiplication with the transformed features (linear layer 1536→1536, normalization layer, GELU). The 512-dimensional fusion features are then output. Finally, the fusion features are input into the prediction network, which has the following structure: linear layer (512→512), normalized layer, GELU activation, random deactivation (0.2), linear layer (512→256), normalized layer, GELU, random deactivation, linear layer (256→128), GELU, linear layer (128→output dimension). The network outputs the molecular property prediction results. For classification tasks, the sigmoid activation function is used to output the probability, and for regression tasks, the numerical value is output directly.

[0034] During the pre-training phase, the model uses a learning rate of... Weight decay is The Adam optimizer was trained for 200 epochs with a batch size of 128; while in the downstream prediction task, a hierarchical learning rate strategy was adopted, where the learning rate of the encoder layer was [missing information]. The prediction head learning rate is and set them respectively and Differential weight decay is achieved, while multi-task joint optimization is realized through a contrast loss weight coefficient of 0.1.

[0035] The initial training phase of this method utilized 306,000 compounds from ZINC 15. Subsequently, it was fine-tuned and evaluated on six downstream tasks (such as BBBP and HIV) covering different properties including blood barrier penetration and side effects. Its average AUC value exceeded previous results by 1.67%, ultimately reaching 0.8431, verifying its superior generalization ability.

[0036] The detailed description of the above examples is a further elaboration of the present invention, but it should not be construed as limiting the present invention to the scope described in the above examples. Within the scope of the present invention, those skilled in the art can make several related simple deductions or substitutions based on other examples, all of which are considered to be within the protection scope of the present invention.

Claims

1. A method for molecular property prediction based on multi-modal gating and contrastive learning, characterized in that, The method comprises the following steps: Step 1, using the chemical information toolkit to parse the molecular SMILES data into a molecular graph structure containing 93-dimensional atomic node features and 11-dimensional chemical bond edge features, while extracting 881-dimensional PubChem fingerprints, 166-dimensional MACCS fingerprints and ErG fingerprints, and splicing them into a 1489-dimensional comprehensive fingerprint feature vector; Step 2, constructing two parallel graph neural network encoders, wherein the graph attention encoder adopts a two-layer graph attention network, the first layer uses 10 attention heads to output 5120-dimensional features, and the second layer uses a single attention head to output 512-dimensional features; the graph isomorphism encoder adopts a three-layer graph isomorphism network, and the output dimensions are 512, 1024 and 512 in turn; and a 2-layer Transformer encoder is integrated at the end of each encoder, each layer uses 8 attention heads and a 2048-dimensional feedforward network to capture the global semantic dependency relationship of the molecule; Step 3, using the NT-Xent contrastive loss function, setting the temperature parameter as a learnable variable, inputting the 512-dimensional features output by the graph attention and graph isomorphism encoders of the same molecule as positive sample pairs, and other molecule features in the current batch as negative samples, and maximizing the cosine similarity of the positive sample pairs for self-supervised pre-training; Step 4, in the downstream task training stage, simultaneously calculate the binary cross-entropy classification loss and the contrastive learning loss, wherein the contrastive loss is calculated after the features are mapped to a 128-dimensional space by a projection network, the contrastive loss weight coefficient is set to 0.1, and joint optimization is realized; Step 5, normalizing the pre-trained graph structure features, projecting the fingerprint features to 512-dimensional space through a fully connected network, applying a 4-head cross-modal attention mechanism to realize bidirectional interaction between graph features and fingerprint features, using a gated fusion module to dynamically adjust the contribution weight of the three feature sources, and finally inputting the fused features into a multi-layer perceptron prediction network containing a normalization layer, a GELU activation and a random dropout to output the molecular property prediction results.

2. The method of claim 1, wherein, The specific implementation process of step 1 includes the following steps: first, parse the SMILES string into a molecular object using the chemical information toolkit, specifically through the Chem.MolFromSmiles function, and filter the molecules that fail to parse; second, extract the atomic feature vector, including atomic type, atomic degree, number of hydrogen atoms, formal charge, chirality label, hybridization state, aromaticity, and normalized mass, generate a 93-dimensional feature vector for each atom, and normalize all features; then, extract the edge feature vector, including bond type and stereochemical information, with a total dimension of 11, and normalize; at the same time, calculate the molecular fingerprint features, including PubChem fingerprint, MACCS key fingerprint, and ErG fingerprint, and concatenate all fingerprints into a 1489-dimensional comprehensive vector; finally, aggregate the node-level features into a molecule-level representation through global average pooling, specifically using the global_mean_pool function to aggregate a variable number of node features into a fixed-dimensional molecular graph feature, and integrate these features into the final input data for the graph neural network, which is used for subsequent model training.

3. The multi-modal gating and contrast learning-based molecular property prediction method of claim 1, the specific implementation process of step 2 being as follows: first, construct a graph attention network encoder with a two-layer graph convolution structure: the first layer has an input dimension of 93, an output dimension of 512, and 10 attention heads, so the actual output dimension is 512x10=5120, uses ELU activation function and random inactivation, and projects the edge features to 93 dimensions through a fully connected layer; the second layer has an input dimension of 5120, an output dimension of 512, and 1 attention head, uses ELU activation and random inactivation, and projects the edge features to 512 dimensions; then, integrate a Transformer encoder layer at the end of the graph attention encoder, specifically using the TransformerEncoder module, which contains 2 encoder layers, each with 8 attention heads, a feedforward network dimension of 2048, and an input and output dimension of 512, to capture the global semantic dependency of the molecule through self-attention mechanism; second, construct a graph isomorphism network encoder with a three-layer graph isomorphism convolution structure: the first layer has an input dimension of 93, an output dimension of 512, uses MLP for neighbor aggregation, ELU activation, and projects the edge features to 93 dimensions through a fully connected layer; the second layer has an input dimension of 512, an output dimension of 1024, MLP, ELU activation, and projects the edge features to 512 dimensions; the third layer has an input dimension of 1024, an output dimension of 512, MLP, ELU activation, and projects the edge features to 1024 dimensions; then, also integrate a Transformer encoder layer at the end of the graph isomorphism encoder with the same parameters as the graph attention encoder; finally, the two encoders process the same molecular graph input in parallel and output 512-dimensional molecular-level feature vectors respectively; these graph-level features are finally used for the prediction task of molecular properties, realizing accurate modeling and analysis of molecular properties.

4. The method of claim 1, wherein the step 3 is implemented as follows: first, an NT-Xent contrastive loss function is used, and the mathematical expression thereof is: ; wherein, and denote the feature vectors generated by the graph attention and graph isomorphism encoders for the same molecule, respectively, and sim is the cosine similarity function, is the temperature parameter, N is the batch size; Secondly, construct positive and negative sample pairs: the features generated by the graph attention and graph isomorphism encoder are input into the same molecule as positive sample pairs, and the features generated by other molecules in the current training batch are used as negative samples, and the self-comparison is excluded by the mask matrix; Then, adjust the sharpness of the similarity distribution through the temperature parameter, optimize the encoder parameters to maximize the cosine similarity of the positive sample pairs in the feature space and minimize the similarity of the negative sample pairs; Finally, save the pre-trained encoder weights for downstream task initialization.

5. The method of claim 1, wherein the step 4 is implemented as follows: first, in the downstream task training phase, a binary cross-entropy classification loss is calculated, and the mathematical expression is: ; wherein, For true labels, for model original output, for sigmoid function, N is the number of valid samples; second, calculate the contrastive learning loss: map the GNN features and fingerprint features to a 128-dimensional contrastive space through the projection network, the projection network structure is linear layer, normalization layer, GELU activation, linear layer, and then use the NT-Xent loss function to calculate the contrastive loss, and the temperature parameter is a learnable variable; then, set the contrastive loss weight coefficient to 0.1, dynamically balance the two losses, and the total loss formula is: ; Finally, perform mask processing, only calculate the loss and gradient for valid samples, and exclude the influence of invalid samples.

6. The method according to claim 1, wherein the step 5 is implemented as follows: first, load the pre-trained graph attention and graph isomorphism encoders as feature extractors; input the molecular graph data in the training set into the graph attention and graph isomorphism encoders respectively to obtain two molecular graph representation vectors and ; second, project the molecular fingerprint features to 512 dimensions through a fully connected network to map them to the same feature space as the graph representation, and the network structure is: linear layer, normalization layer, GELU activation, random dropout, linear layer to obtain the fingerprint representation vector; then, apply a cross-modal attention mechanism to realize the bidirectional interaction between the graph features and the fingerprint features; the first module takes the graph attention features as the query, the fingerprint features as the key and the value, and outputs the graph feature representation enhanced by the fingerprint information _attn ; the second module takes the fingerprint features as the query, the graph isomorphism features as the key and the value, and outputs the fingerprint representation enhanced by the GNN information _attn ; connect the original features and the enhanced features in residual to obtain _combined and _ combined ; splice the two enhanced graph representations and fingerprint representations; then, use a gating fusion module to dynamically adjust the contribution weight of the three feature sources, which is implemented as follows: splice the three 512-dimensional features into a 1536-dimensional vector, generate a weight matrix through a gating network, and multiply it with the transformed features element by element to output a 512-dimensional fusion feature; finally, input the fusion feature into the prediction network, and the network structure is: linear layer, normalization layer, GELU activation, random dropout, linear layer, normalization layer, GELU, random dropout, linear layer, GELU, linear layer, and output the molecular property prediction result; for the classification task, use the sigmoid activation function to output the probability, and for the regression task, directly output the numerical value.​​​​

Citation Information

Patent Citations

  • Molecular representation prediction method based on multiple modes

    CN117292764A

  • Reaction site prediction method and device based on chemical and physical prior driving

    CN120877896A