Self-supervision method and system for learning molecular characterization
Through self-supervised pre-training and contrast learning of the InChINet model, combined with SMILES and InChI, the problem of scarcity of traditional molecular characterization methods is solved, and efficient and low-cost molecular characterization in drug discovery is achieved. Predict performance.
Patent Information
- Application Number
- CN202410955752.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-15
AI Technical Summary
Traditional molecular representation methods are difficult to capture global information, and machine learning and deep learning methods face the problems of scarcity and overfitting of label data, and a single form of representation cannot provide comprehensive information.
The InChINet model is pre-trained through a self-supervised method, and the important features of molecules are extracted using label-free data, combined with SMILES and InChI for comparison learning, and the model learning ability is enhanced using token masking, token reordering and SMILES enumeration strategies.
High-precision prediction and generalization performance on different data sets and tasks is achieved, reducing the cost and time of the drug discovery process, and avoiding the problem of low accuracy of traditional manual feature engineering and relying on expert-level knowledge.
Smart Images

Figure CN118969126A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of computational chemistry, biochemical science and artificial intelligence, and in particular to a self-supervisory method and system for learning molecular representation. Background Art
[0002] Drug discovery is a complex and time-consuming process, and screening drugs from a vast molecular space is extremely costly. In order to speed up this process, researchers have proposed various computer-assisted drug discovery (CADD) methods. Despite their success in assisting drug discovery, many traditional CADD methods are difficult to apply in the pharmaceutical industry due to their huge computational costs and time-consuming steps. In recent years, the application of artificial intelligence in drug discovery, such as molecular property prediction, DDI prediction, drug molecule generation, etc., has attracted increasing attention due to its low cost and amazing speed. Therefore, as one of the fundamental challenges of these studies, designing powerful and effective molecular characterization is an important task in drug discovery.
[0003] Traditional molecular representation methods, such as extended connectivity fingerprint (ECFP), use a fixed binary hash function applied to each atom and its neighborhood. These methods focus on local features and may not capture global information. In recent years, the emergence of machine learning and deep learning has provided a new idea for obtaining effective molecular representations, and there have been many works on developing molecular representations based on machine learning and deep learning. For example, given a fingerprint (FP) vector, a deep neural network (DNN) is constructed to predict molecular properties. In addition to FPs, string-based and graph-based representations are also widely used in molecular representation learning. For example, Transformer, recurrent neural network (RNN) and convolutional neural network (CNNs) learn molecular representations using string-based SMILES as input; graph neural network (GNN) treats atoms as nodes and bonds as edges to encode graph-based molecular graphs. However, molecular representation learning based on machine learning and deep learning still faces two major problems. One is that experimental label data is very scarce and expensive to obtain, which limits the size of the data set. Therefore, it is easy to face the problem of overfitting when training the model, and the learned molecular representation lacks generalization performance in a wide range of chemical space. The other is that a single input cannot encode all the information of a molecule. SMILES, IUPAC, InChI, molecular graphs, and other molecular representation methods are not guaranteed to contain all the information about a molecule.
[0004] Therefore, in order to solve the problem of costly traditional experimental methods in drug discovery, and to overcome the drawbacks of traditional machine learning algorithms that rely on handmade feature engineering and have low accuracy, as well as to improve the shortcomings of scarce labeled data and easy overfitting in machine learning and deep learning algorithms, the present invention proposes a self-supervised method for molecular representation learning of InChINet, which uses a large amount of unlabeled data for pre-training, and then outputs embedding as molecular representation for a variety of downstream tasks. The model can obtain high-precision prediction results without the need for complex characterization or domain-specific knowledge, and has excellent performance on different data sets and different tasks, showing reliable prediction performance and generalization performance. Summary of the invention
[0005] In view of the above problems, the present invention provides a self-supervised method for learning molecular representations, the method comprising:
[0006] S1, extract the chemical structure code of the molecule from PubChem to generate a preprocessed data set;
[0007] S2, build an initial deep learning model InChINe t for pre-training based on transformer encoder;
[0008] S3, inputting the preprocessed data set into the InChINet model to train the model, thereby obtaining a pretrained InChINet model;
[0009] S4. Obtaining molecular representation of the molecule to be detected based on the pre-trained InChINet model.
[0010] Optionally, in S3, inputting the preprocessed data set into an InChINet model to train the model, and obtaining the pre-trained InChINet model specifically includes:
[0011] Embed the molecule as an input vector based on the chemical structure encoding of the molecule, and perform additional data augmentation on SMILES;
[0012] Inputting the input vector into a transformer encoder for encoding, projecting the encoded input vector into a joint embedding space, and obtaining a final embedding of SMILES and InChI;
[0013] The InChINet model is optimized based on the final embedding calculation loss to complete the pre-training of the InChINet model.
[0014] Optionally, the method of embedding a molecule as an input vector based on the chemical structure encoding of the molecule specifically includes:
[0015] By using fastBPE to tokenize SMILES and InChI to form a Token list, the generated Token dictionary is searched to digitize the Token list, and the Token list is further embedded into a vector.
[0016] Optionally, the method of projecting the encoded input vector into the joint embedding space to obtain the final embedding of SMILES and InChI specifically includes:
[0017] The position embedding is added to the position information of each element in the input vector encoding sequence, encoded with a transformer encoder based on the input vector, and the transformer encoder output is projected into the joint embedding space to obtain the final embedding of SMILES and InChI.
[0018] Optionally, the method of optimizing the InChINet model based on the final embedding calculation loss and completing the pre-training of the InChINet model specifically includes:
[0019] The SMILES and InChI of the same molecule are regarded as positive pairs, and the rest are regarded as negative pairs. The normalized temperature-scaled cross entropy loss is calculated by contrastive learning to optimize the model; positive pairs are close to each other in the joint embedding space, and negative pairs are far away from each other.
[0020] The present invention also discloses a self-supervisory system for learning molecular representation based on the InChINet model, the system comprising:
[0021] The dataset acquisition module is used to extract the chemical structure codes of molecules from PubChem and generate preprocessed datasets;
[0022] Model building module, used to build the initial deep learning model InChINet for pre-training based on transformer encoder;
[0023] A model training module, used for inputting the preprocessed data set into the InChINet model to train the model and obtain a pre-trained InChINet model;
[0024] The molecular characterization module is used to obtain the molecular characterization of the molecule to be detected based on the pre-trained InChINet model.
[0025] Optionally, the model training module further includes a data enhancement submodule, an embedding acquisition submodule and a pre-training submodule;
[0026] The data enhancement submodule is used to embed the molecule as an input vector based on the chemical structure encoding of the molecule, and additionally perform data enhancement on SMILES;
[0027] The embedding acquisition submodule is used to input the input vector into the transformer encoder for encoding, and project the encoded input vector into the joint embedding space to obtain the final embedding of SMILES and InChI;
[0028] The pre-training submodule is used to optimize the InChINet model based on the final embedding calculation loss, thereby completing the pre-training of the InChINet model.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention uses a self-supervised method to perform comparative learning pre-training on the InChINet model, and extracts important features of the molecule based on a large amount of unlabeled data by guiding the model that the SMILES and InChI embeddings of the same molecule are similar and the SMILES and InChI embeddings of different molecules are not similar, so as to overcome the shortcomings of overfitting caused by the scarcity of experimental label data in previous work, and solve the problem that a single form of representation can only provide knowledge from a single angle. At the same time, the token masking, token reordering, and SMILES enumeration enhancement strategies adopted by the present invention allow the model to learn chemical prior knowledge at the token level and sentence level, which not only avoids the negative transfer of performance brought by the single-level enhancement strategy, but also improves the prediction performance and generalization performance of the model. By pre-training the InChINet model, the disadvantages of low precision of traditional manual feature engineering and dependence on expert-level knowledge are overcome, and the problem of high cost and long time consumption of traditional experimental methods is solved. The InChINet model outputs high-quality molecular representations quickly and efficiently at low cost, can accurately predict molecular properties and drug-drug interactions, can be applied to various links in drug discovery, and accelerates the drug discovery process. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 : is an overall flow chart of the InChINet model of an embodiment of the present invention, FIG. a is a schematic diagram of the process of obtaining the position information of each element; FIG. b is a schematic diagram of the process of list digitization, FIG. c is a schematic diagram of the process of achieving data enhancement effect, and FIG. d is a schematic diagram of the process of obtaining the final molecular representation;
[0033] Figure 2 A cluster analysis diagram of coloring t-SNE projected molecular representations by molecular skeletons according to an embodiment of the present invention;
[0034] Figure 3 It is a cluster analysis diagram of the t-SNE projection molecular representation of the MoleculeNet dataset according to an embodiment of the present invention through labels; Figure a is a visualization diagram of the ESOL dataset, Figure b is a visualization diagram of the FreeSolv dataset, Figure c is a visualization diagram of the BBBP dataset, and Figure d is a visualization diagram of the QM7 dataset;
[0035] Figure 4 Schematic diagram of prediction results of ablation experiments on MoleculeNet datasets according to an embodiment of the present invention; FIG. a is a schematic diagram of prediction results of two classification datasets, and FIG. b is a schematic diagram of prediction results of three regression datasets;
[0036] Figure 5 Schematic diagram of the prediction results of the InChINet model of an embodiment of the present invention on the DeepDDI data set; Figure a is the cross entropy loss value without epoch training, and Figure b is the cross entropy loss value after epoch training;
[0037] Figure 6 This is a performance comparison chart of the DeepDDI dataset baseline model and the InChINet model in an embodiment of the present invention;
[0038] Figure 7 Figure 1 is a schematic diagram of the SMILES-InChI cross-language retrieval evaluation results and an example thereof of an embodiment of the present invention; Figure a is a schematic diagram of the changes in R@1 and R@5 values during the SMILES-to-InChI retrieval process, Figure b is a schematic diagram of the changes in R@1 and R@5 values during the InChI-to-SMILES retrieval process, Figure c is a schematic diagram of an example of SMILES-to-InChI retrieval on 100 molecules, and Figure d is a schematic diagram of an example of SMILES-to-InChI retrieval on 100 molecules. DETAILED DESCRIPTION
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] Embodiment 1
[0041] The present invention provides a self-supervised method for learning molecular representations, such as Figure 1 As shown, the method includes:
[0042] S1. Extract the chemical structure codes of molecules from PubChem to generate a preprocessed data set.
[0043] Molecular data is obtained from a small molecule database to construct a pre-training data set. In this embodiment, PubChem is selected as the small molecule database, 10 million unlabeled molecules are randomly extracted from PubChem as the pre-training data set, and the SMILES and InChI chemical structure encodings of the molecules are used as inputs of InChINet to extract molecular information from different angles. The data set is randomly divided into a training set and a validation set at a ratio of 999:1. The training set is used for pre-training of the InChINet model, and the validation set is used to obtain the best model with the least loss.
[0044] S2. Build the initial deep learning model InChINet for pre-training based on transformer encoder.
[0045] S3. Input the preprocessed data set into the InChINet model to train the model.
[0046] The molecules are embedded as input vectors based on the chemical structure information of the molecules, and SMILES is additionally enhanced; e.g. Figure 1 As shown in (b), SMILES and InChI are tokenized using fastBPE to form a token list tl = {tok1·tok2, ..., tok n}, search the generated Token dictionary to digitize the list, which will be further embedded as a vector. fastBPE is an efficient implementation of the BPE (Byte Pair Encoding) algorithm, which can significantly improve the processing speed while maintaining accuracy; the Token dictionary is a dictionary converted from the vocabulary output by the fastBPE learning preprocessing dataset, which consists of a mapping between vocabulary and numbers.
[0047] The maximum sequence length and token dictionary size are 512 and 8102 respectively. Figure 1(c) Data augmentation is performed using one of the three strategies: token masking, token reordering, and SMILES enumeration. Tokenmasking randomly masks tokens in a molecule at a ratio of 0.25, and replaces the masked tokens with MASK to distinguish other valid tokens. It is a token-level augmentation strategy. Tokenreordering randomly selects multiple tokens at a ratio of 0.25 and randomly swaps their positions. It is a token-level augmentation strategy. SMILES enumeration starts from an atom and traverses the molecular graph in different ways to return a possible SMILES. SMILES enumeration aims to enable the model to learn shared information between different SMILES of the same molecule. It is a sentence-level augmentation strategy.
[0048] The input vector is input into the transformer encoder for encoding and projected into the joint embedding space to obtain the final embedding of SMILES and InChI; Figure 1 As shown in (a), the position embedding PE is added to the input vector to encode the position information of each element in the sequence, and the transformer encoder is used to encode based on the input vector. The output of the transformer encoder is projected into the joint embedding space, and the final embedding of SMILES and InChI is expressed by the following formula:
[0049] PE (pos,2i) =sin(pos / 10000 2i / d )
[0050] PE (pos,2i+1) =cos(pos / 10000 2i / d )
[0051] X( 0 )=x+PE
[0052]
[0053] z=p(TransEncoder(X( 0 )))
[0054] Among them, PE represents position encoding, X (0)is the input vector, LN(·) is layer normalization. MHA(·) represents the multi-head attention layer, FFN(·) represents the feedforward layer, p represents the projection layer, TransEncoder(·) represents the transformer encoder, and z represents the final embedding. The transformer encoder used in the InChINet model consists of 6 encoder layers with a hidden state of 768. The output vector of the transformer encoder is mapped from 768 to 512 by the projection head to obtain the final embedding.
[0055] Based on the final embedding, the loss is calculated to optimize the InChINet model; SMILES and InChI of the same molecule are considered as positive pairs, and the rest are considered as negative pairs. The normalized temperature scaled cross entropy (NT-Xent) loss is calculated by contrastive learning to optimize the InChINet model. The contrastive loss is calculated as follows:
[0056]
[0057] where z i 、z j 、z k is the final embedding, N represents the batch size, Used to measure the similarity of two vectors, τ is the temperature parameter, if k≠i then 1 [k≠i] ∈{0, 1} is 1. The temperature parameter of NT-Xent loss is 0.07 and optimized using Adam optimizer. After 10 epochs of pre-training with a learning rate of 1e-6, the NT-Xent loss dropped to 3.2e-4.
[0058] S4. Obtaining molecular representation of the molecule to be detected based on the pre-trained InChINet model.
[0059] like Figure 1 As shown in (d), once pre-training is completed, InChINet can be migrated to downstream tasks and output embedding as the final molecular representation. The molecular representation can be used for molecular property prediction, drug-drug interaction prediction, cross-language retrieval, cluster visualization, and ablation experiments. For molecular property prediction, DDI prediction, and ablation experiments, InChINet is fine-tuned on downstream datasets and trained with MLP. For cluster visualization and zero-shot cross-language retrieval, InChINet is not fine-tuned and directly generates molecular representations without any task-specific heads.
[0060] The MLP consists of four fully connected layers. The first layer transforms the second dimension of the input vector in_dim2 to in_dim2→in_dim2 / 2, the second layer transforms the second dimension of the input vector to in_dim2 / 2→1, the third layer transforms the first dimension of the input vector in_dim1 to in_dim1→in_dim1 / 2, and the fourth layer transforms the first dimension of the input vector to in_dim1 / 2→1. The last value is the molecular properties and drug-drug interactions predicted by the InChINet model. For molecular property prediction and ablation experiments, in_dim2 and in_dim1 are both 512. For DDI prediction, in_dim2 and in_dim1 are 512 and 1024, respectively, because the MLP input for DDI prediction is the concatenation of two molecular representations.
[0061] Cluster visualization and zero-sample cross-language retrieval will be discussed in detail below. Validation testing was performed based on the pre-trained InChINet model: The molecular characterization is used for molecular property prediction; molecular property prediction is a key task in the drug discovery process. Accurate prediction of molecular properties helps to screen candidate drugs, save expensive time and economic costs, and reduce unnecessary clinical trials. The present invention uses 10 data sets from MoleculeNet to evaluate the performance of InChINet. MoleculeNet is a benchmark suite for molecular machine learning that includes multiple property prediction tasks such as solubility, charge distribution, and quantum mechanical properties. The data sets used in the present invention are BBBP, HIV, ClinTox, Tox21, ESOL, FreeSolv, Lipo, QM7, QM8, and QM9.
[0062] In order to evaluate the performance of the model and facilitate comparison with other models, ROC-AUC is used to report the classification performance, and the root mean square error (RMSE) and mean absolute error (MAE) are used to report the regression performance. The ROC-AUC, RMSE, and MAE formulas are as follows:
[0063]
[0064] Among them, TP, FP, TN, and FN represent true positive examples, true negative examples, false positive examples, and false negative examples, respectively. i ) and Y i is the predicted value and true value of the i-th sample, and N is the number of samples. The ROC curve is constructed with FPR as the x-axis and TPR as the y-axis, and ROC-AUC is the area under the ROC curve.
[0065] Some datasets have multiple tasks, for example, ClinTox includes both FDA approval tasks and clinical trial toxicity tasks. Therefore, the average performance of all tasks needs to be reported. As shown in Table 1, all benchmark datasets are split into training / validation / test sets in the 8 / 1 / 1 ratio recommended by the original MoleculeNet paper. BBBP and HIV backbones are split, ClinTox, Tox21, ESOL, FreeSolv, Lipo, QM8, and QM9 are randomly split, and QM7 is split using a stratified random sampling method. For all datasets, three runs were performed with different random seeds to obtain the mean and standard deviation of the performance.
[0066] Table 1
[0067]
[0068] Tables 2 and 3 list the results of supervised methods, self-supervised methods, and InChINet on 4 classification datasets and 6 regression datasets. Compared with all baselines, InChINet performs best on 6 of the 10 datasets and shows competitive performance on the remaining datasets. In particular, InChINet has a larger ROC-AUC improvement and more loss reduction on small datasets such as ClinTox, ESOL, and FreeSolv. This is because pre-training alleviates the scarcity of labeled data, which has a more significant impact on small datasets. In Table 2, InChINet surpasses all baselines on 2 of the 4 classification datasets. In particular, on ClinTox, InChINet improves ROC-AUC by 5.7% relative to the most competitive baseline D-MPNN involving complex aggregation operations, and occasionally reaches ROC-AUC of 99% or higher due to stochasticity. In Table 3, InChINet outperforms all baselines on 4 of the 6 regression datasets. InChINet surpasses the best results by 23.8% and 16.7% on ESOL and FreeSolv, respectively. SchNet and MGCN perform well on datasets of quantum mechanical nature because these two models are specifically designed for quantum interactions and exploit additional 3D position information. However, without any additional information, InChINet still shows advantages over these two models on QM7 and QM8, and is unable to compete with them only on QM9. In particular, on QM7, there is a significant improvement of 7.9% compared to the best baseline SchNet.
[0069] In addition to its excellent performance, InChINet only relies on SMILES and InChI and does not require any additional information or complex operations. For example, GraphMVP introduces 3D molecular graphs by adding atomic spatial positions to 2D graphs, and we do not even need to incorporate direct topological information into the model.
[0070] Table 2
[0071]
[0072] Table 3
[0073]
[0074] The molecular representation is used for cluster visualization; in order to intuitively demonstrate the effectiveness of the molecular representation learned by InChINet, the representation is projected into 2D space using t-SNE, and different clusters are assigned different colors to clearly show the clustering. The molecular representation output by InChINet is analyzed from two perspectives of the data. The first is to select 8 representative skeletons for molecular coloring, different colors represent different skeletons, and 53,770 molecules are sampled for visualization. The skeleton is one of the representative determinants that has an important influence on the properties of the molecule, so it is used for coloring. Molecules with the same scaffold have similar structures, and molecular representations are closer and easier to form clusters in 2D space. The second is to use MoleculeNet's BBBP, ESOL, FreeSolv and QM7 data sets for visualization, different colors represent different labels, and use the fine-tuned InChINet to generate molecular representations. The fine-tuned InChINet does not contain true labels, but can capture information related to the category. These two experiments demonstrate the superiority of the model, and the embedding generated by InChINet contains information from different aspects.
[0075] like Figure 2 As shown, molecules with the same scaffold exhibit the same color and are essentially kept in the same cluster. Although some molecules have different scaffolds, they are still relatively close in 2D space, because the properties of molecules are not only affected by the scaffold. Figure 2 The three molecules at the bottom have similar structures and all contain piperidine. The two molecules shown at the top both contain two benzene rings, one of which is connected to a fluorine atom. This shows that even without labels, the model can learn information about the backbone and intrinsic connections within the molecule, as molecules of similar properties have similar features.
[0076] like Figure 3As shown in Figure 3, the InChINet model can capture category-related knowledge even without label information. In particular, on the BBBP and ESOL datasets, the representations of molecules with the same category are close in 2D space. Therefore, molecules with similar representations are more likely to be classified into the same category for MLP, which helps improve performance. One possible reason why molecules belong to different categories but have similar representations is that the representation is affected by the overall characteristics of the molecule rather than a single property.
[0077] The molecular characterization is used for ablation experiments; to study the importance of pre-training and enhancement strategies in InChINet, we tested the performance of InChINet-nopre and InChINet-noaug on 5 datasets. InChINet-nopre is the InChINet model directly fine-tuned without pre-training, using the initialized weights for downstream tasks. InChINet-noaug is the InChINet model pre-trained without an enhancement strategy, which is a direct comparative learning between SMILES and InChI. We chose 5 small datasets in MoleculeNet because the small computational cost is conducive to exploring parameters and settings, and due to the excellent performance on small datasets, strategy changes can show more obvious performance changes. Both InChINet-nopre and InChINet-noaug follow the same experimental settings as InChINet.
[0078] Table 4
[0079]
[0080] As shown in Table 4 and Figure 4 As shown, InChINet-nopre and InChINet-noaug show reduced classification AUC-ROC and increased regression RMSE compared to the pre-trained InChINet model. Pre-trained InChINet outperforms InChINet-nopre and InChINet-noaug on all datasets, with average performance improvements of 19.3% and 6.1%, respectively. This shows that pre-training and enhancement strategies can significantly improve the performance of downstream tasks. In particular, pre-training enables our model to benefit from large-scale datasets and is a very important strategy that can significantly improve performance. In addition, on the ClinTox and Lipo datasets, InChINet-nopre even achieved a ROC-AUC of 90.6% and a RMSE of 0.96 based on fine-tuning and data enhancement strategies alone.
[0081] The molecular characterization is used for DDI prediction; DDI may cause adverse drug events (ADEs) with unknown causal mechanisms, resulting in changes in the efficacy, toxicity or pharmacokinetics of the drug, which is one of the most important issues in clinical rational drug administration and post-marketing pharmacovigilance. In drug discovery, DDI prediction is an important task in evaluating the safety and potential clinical application of new drugs, and helps to minimize potential ADEs.
[0082] The DeepDDI dataset is used in the present invention, which covers 192,284 DDIs consisting of 191,878 drug pairs. 86 DDI types (expressed as sentence structures in the DeepDDI model) are associated with at least five drug pairs, which can be divided into a training set (60% of the dataset; three drug pairs), a validation set (20% of the dataset, one pair of drug pairs), and a test set (20% of the dataset; one pair of drugs). Similar to DeepDDI, the DeepDDI dataset is randomly divided into a training set, a validation set, and a test set in a ratio of 6:2:2; accuracy (ACC) is used to evaluate the results of the DDI prediction task, which represents the ratio of correctly predicted results to all predictions, and the formula is as follows:
[0083]
[0084] Among them, TP, TN, FP, and FN are the same as in the ROC-AUC formula. We run three times with different random seeds to obtain the average accuracy.
[0085] Compared to performing multiple binary classification tasks and calculating average precision, multi-classification and multi-label classification are more challenging because the decision space becomes more complex as the number of classes increases. The DDI prediction in this study is a multi-label classification task, which means that drug pairs may have multiple interactions. For example, when used in combination with atazanavir, the metabolism of oxycodone is reduced, and the risk or severity of adverse reactions is increased.
[0086] like Figure 5 As shown in Figure 1, the InChINet model achieved an accuracy of 0.938, and after 50 epochs of training, the binary cross entropy loss dropped from 0.302 to 0.055. Figure 6InChINet, InChINet-nopre, and InChINet-noaug outperform all baselines. Compared with the second-ranked KGNN
[63] and the last-ranked GAT
[64] , InChINet improves ACC by 1.2% and 16.7%, respectively. Compared with DeepDDI, InChINet has a significant improvement of 9.6%. Even without pre-training or augmentation strategies, InChINet-nopre and InChINet-noaug can achieve accuracies above 0.930 and outperform all baselines. In particular, InChINet-nopre achieves an accuracy of 0.931 based solely on the effectiveness of fine-tuning and augmentation strategies.
[0087] The molecular representation is used for zero-shot cross-lingual retrieval; the pre-trained InChINet model can be directly used for the zero-shot cross-lingual retrieval task, which targets new samples not included in the pre-training set. This task can be used to test the effectiveness and generalization performance of the molecular representation output by InChINet, showing the effect of pre-training in a more intuitive way than the validation loss.
[0088] 10k molecules are randomly sampled from PubChem as the retrieval dataset, and please note that the samples in the pre-training dataset are not included. The pre-trained InChINet model is frozen and will not be fine-tuned on the retrieval dataset, because fine-tuning will destroy the test significance by making the SMILES and InChI representations of molecules closer in the embedding space. The steps of SMILES to InChI retrieval are as follows:
[0089] i) obtaining a SMILES representation of the molecule;
[0090] ii) Calculate the cosine similarity between the SMILES representation and the InChI representation of all molecules in the retrieved dataset;
[0091] iii) retain the top K most similar molecules and calculate R@K;
[0092] iv) Repeat steps from i) to iii) and calculate the average R@K for all molecules.
[0093] R@K is the percentage of true values that appear in the first K retrieved molecules. If one molecule is correctly retrieved among the first K results, R@K = 1 / 1 = 1, otherwise R@K = 0 / 1 = 0. R@5 is used as a performance indicator in the present invention. The retrieval process of InChI-SMILES is the same as that of SMILES-InChI. The results of R@5 on the retrieval dataset are 0.881 and 0.889 for SMILES-InChI retrieval and InChI-SMILES retrieval, respectively. In addition to R@5, R@1 was also used to test the InChINet model on 100 molecules, 1k molecules, and 10k molecules, as shown in Figure 7 shown.
[0094] exist Figure 7 In (a) and 7(b), the search performance gradually improves as the dataset size decreases, which is due to the reduction of similar molecules leading to fewer interference options. Taking SMILES-InChI search as an example, R@5 increases from 0.88 for 10k molecules to 0.99 for 1k molecules, and similar molecules provide interference options for the search. Note that R@5 is 1.00 and R@1 is 0.98 on 100 molecules, and only two molecules are not correctly retrieved. Figure 7 (c) and 7(d) show examples of searches for 100 molecules. Taking the SMIELS-InChI search as an example, the top 5 most similar molecules all contain benzene rings and halogen atoms, which shows that InChINet can capture key molecular features because molecules with similar features are also similar in characterization.
[0095] Embodiment 2
[0096] A self-supervised system for learning molecular representations, the system comprising:
[0097] The data set acquisition module is used to extract the chemical structure coding of molecules from PubChem to generate a preprocessed data set; the chemical structure coding of molecules includes the chemical structure coding of molecules in the SMILES style and the chemical structure coding of molecules in the InChI style.
[0098] The model building module is used to build an initial deep learning model InChINet for pre-training based on the transformer encoder.
[0099] The model training module inputs the preprocessed data set into the InChINet model to train the model and obtain the pretrained InChINet model. It also includes a data enhancement submodule, an embedding acquisition submodule and a pretraining submodule; the data enhancement submodule is used to embed the molecule as an input vector based on the chemical structure encoding of the molecule, and additionally perform data enhancement on SMILES; the embedding acquisition submodule is used to input the input vector into the transformer encoder for encoding, and project the encoded input vector into the joint embedding space to obtain the final embedding of SMILES and InChI; the pretraining submodule is used to calculate the loss based on the final embedding and then optimize the InChINet model to complete the pretraining of the InChINet model.
[0100] Specifically, the method includes embedding molecules as input vectors based on the chemical structure encoding of the molecules, and additionally performing data enhancement on SMIL ES; inputting the input vectors into a transformer encoder for encoding, and projecting the encoded input vectors into a joint embedding space to obtain the final embedding of SMILES and InChI; calculating the loss based on the final embedding and then optimizing the InChINet model to complete the pre-training of the InChINet model.
[0101] The method of embedding a molecule as an input vector based on the chemical structure encoding of the molecule specifically includes: using fastBPE to tokenize SMILES and InChI to form a Token list, searching the generated Token dictionary to digitize the Token list, and the Token list is further embedded as a vector. Among them, fastB PE is an efficient implementation of the BPE (Byte Pair Encoding) algorithm, which can significantly improve the processing speed while maintaining accuracy; the Token dictionary is a dictionary converted from the vocabulary output by the fastBPE learning preprocessing data set, which is composed of mappings between vocabulary and numbers.
[0102] The method of projecting the encoded input vector to the joint embedding space to obtain the final embedding of SMILES and InChI specifically includes: adding position embedding to the position information of each element in the input vector encoding sequence, encoding based on the input vector using a transformer encoder, projecting the transformer encoder output to the joint embedding space, and obtaining the final embedding of SMILES and InChI.
[0103] The InChINet model is optimized by calculating the loss based on the final embedding, and the method for completing the pre-training of the InChINet model specifically includes: considering the SMILES and InChI of the same molecule as positive pairs and the rest as negative pairs, and calculating the normalized temperature scaled cross entropy loss through contrastive learning to optimize the model; positive pairs are close to each other in the joint embedding space, and negative pairs are far away from each other.
[0104] The molecular characterization module is used to obtain the molecular characterization of the molecule to be detected based on the pre-trained InChINet model.
[0105] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A self-supervised approach to learning molecular representations, It is characterized in that The method comprises: S1, extract the chemical structure code of the molecule from PubChem to generate a preprocessed data set; S2. Build the initial deep learning model InCh INet for pre-training based on transformer encoder; S3, inputting the preprocessed data set into the InChINet model to train the model, thereby obtaining a pretrained InChINet model; S4. Obtaining molecular representation of the molecule to be detected based on the pre-trained InChINet model.
2. The self-supervised method for learning molecular representations according to claim 1, It is characterized in that In S3, the pre-processed data set is input into the InChINet model to train the model, and obtaining the pre-trained InChINet model specifically includes: Embed the molecule as an input vector based on the chemical structure encoding of the molecule, and perform additional data augmentation on SMILES; Inputting the input vector into a transformer encoder for encoding, projecting the encoded input vector into a joint embedding space, and obtaining a final embedding of SMILES and InChI; The InChINet model is optimized based on the final embedding calculation loss to complete the pre-training of the InChINet model.
3. The self-supervised method for learning molecular representations according to claim 2, It is characterized in that The method of embedding a molecule as an input vector based on the chemical structure encoding of the molecule specifically includes: By using fastBPE to tokenize SMILES and InChI to form a Token list, the generated Token dictionary is searched to digitize the Token list, and the Token list is further embedded into a vector.
4. The self-supervised method for learning molecular representations according to claim 2, It is characterized in that The method of projecting the encoded input vector into the joint embedding space to obtain the final embedding of SMILES and InChI specifically includes: The position embedding is added to the position information of each element in the input vector encoding sequence, encoded with a transformer encoder based on the input vector, and the transformer encoder output is projected into the joint embedding space to obtain the final embedding of SMILES and InChI.
5. The self-supervised method for learning molecular representations according to claim 2, It is characterized in that The method of optimizing the InChINet model based on the final embedding calculation loss and completing the pre-training of the InChINet model specifically includes: The SMILES and InChI of the same molecule are regarded as positive pairs, and the rest are regarded as negative pairs. The normalized temperature-scaled cross entropy loss is calculated by contrastive learning to optimize the model; positive pairs are close to each other in the joint embedding space, and negative pairs are far away from each other.
6. A self-supervisory system for learning molecular representations, the self-supervisory system being used to implement the self-supervisory method according to any one of claims 1 to 5, It is characterized in that The system includes: The dataset acquisition module is used to extract the chemical structure codes of molecules from PubChem and generate preprocessed datasets; Model building module, used to build the initial deep learning model InChINet for pre-training based on transformer encoder; A model training module, used for inputting the preprocessed data set into the InChINet model to train the model and obtain a pre-trained InChINet model; The molecular characterization module is used to obtain the molecular characterization of the molecule to be detected based on the pre-trained InChINet model.
7. The self-supervised system for learning molecular representations according to claim 6, It is characterized in that The model training module also includes a data enhancement submodule, an embedding acquisition submodule and a pre-training submodule; The data enhancement submodule is used to embed the molecule as an input vector based on the chemical structure encoding of the molecule, and additionally perform data enhancement on SMILES; The embedding acquisition submodule is used to input the input vector into the transformer encoder for encoding, and project the encoded input vector into the joint embedding space to obtain the final embedding of SMILES and InChI; The pre-training submodule is used to optimize the InChINet model based on the final embedding calculation loss, thereby completing the pre-training of the InChINet model.
Citation Information
Patent Citations
Drug molecule generation method based on deep learning
CN117831665A
Two-channel comparison model for predicting molecular properties
CN118155746A
Multimodal domain embeddings via contrastive learning
US20230067528A1
Cited By
Learning high order structures from molecular smiles / selfies strings with transformers
WO2026210232A1
