A Small-Sample Drug Chemical Reaction Representation and Automatic Classification Method and Device

Through the VMDNet model, the molecular formula of medicinal chemical reactions is characterized and classified, which solves the problem of taking into account both framework characteristics and significant characteristics under small sample conditions, and the precise classification of medicinal chemical reactions is achieved, which is suitable for the representation and recognition of molecular formulas in the field of biopharmaceuticals.

CN114743615BActive Publication Date: 2025-07-25UNIV OF SCI & TECH BEIJING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210379287.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-02-14
Filing Date
2022-04-12
Publication Date
2025-07-25
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

The existing chemical formula representation methods are difficult to achieve accurate classification under uneven category distribution, and traditional methods perform poorly under small sample conditions, and cannot take into account both the representation and classification of framework characteristics and significant characteristics.

Method used

The medical chemical reaction representation model based on VMDNet is adopted, and the molecular formula features are extracted through the multi-head attention mechanism and adaptive pooling method. Combined with adversarial learning and self-supervised decoupling method, the framework features and significant features are classified and trained respectively to achieve inter-categorical and fine-grained classification.

Benefits of technology

The precise classification of medicinal chemical reactions is achieved under small sample conditions, which improves the adaptability and classification accuracy of the model, and is suitable for the representation and identification of molecular formulas in the field of biopharmaceuticals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114743615B_ABST
    Figure CN114743615B_ABST
Patent Text Reader

Abstract

The present invention provides a small-sample drug chemical reaction representation and automatic classification method and device, which relates to the field of software technology. During the modeling process, the framework features and significant features of the molecular formula are respectively decomposed and learned through a variational autoencoder: adversarial learning is introduced to make the framework features contain only the discriminant information between large categories, that is, coarse-grained discriminant information and not contain specific structural information; through the method of self-supervised decoupling learning, the significant features have strong discriminant ability, and then a model that can accurately recover the original expression containing different fine-grained information is learned. The model VMDNet for representing molecular formulas in the present invention can be well applied in the fields that require accurate representation and recognition of molecular formulas, facilitating the joint invocation of structural information and detailed information, greatly reducing the problem of difficult recognition of similar drug chemical reactions, and having great economic benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field, and in particular to a method and device for representing and automatically classifying small-sample drug chemical reactions. Background Art

[0002] In recent years, the feature representation and classification methods of drug chemical reactions have attracted the attention of many researchers. A drug chemical reaction is a process of converting reactants into one or more products, which is a concise expression for elaborating the chemical reaction process. It is very crucial to extract the characteristic information that expresses the drug chemical reaction information in detail and accurately to achieve accurate classification. In order to expand its application to subsequent new drug discovery and other applications, the model needs to have stronger adaptability to uncommon chemical reaction types and even new categories. The existing chemical formula representation methods generally use recurrent neural networks and variational autoencoders to input the molecular expression in the SMILES (Simplified Molecular Input Line Entry System) format into a specific network, and then represent the chemical formula through the network model. Among them, simply using a recurrent neural network to learn and represent the characteristics of chemical formulas relies more on supervised information. Moreover, since it is end-to-end learning, it may ignore the expression ability, only focus on the discriminative ability, has weak transferability, and is prone to deviation problems due to uneven class distribution. Although the variational autoencoder can meet the representation problem and ensure a certain degree of diversity, it is easy to ignore the discriminative detail information and lacks application support in classification.

[0003] In the prior art, these methods have better performance on large-scale known category data, but it is difficult to apply them to situations such as uneven class distribution. Summary of the Invention

[0004] Aiming at the problem that it is difficult to apply to situations such as uneven class distribution in the prior art, the present invention proposes a method and device for representing and automatically classifying small-sample drug chemical reactions.

[0005] To solve the above technical problems, the present invention provides the following technical solutions:

[0006] On the one hand, a method for representing and automatically classifying small-sample drug chemical reactions is provided, including:

[0007] S1: Extract features from the drug chemical reaction formula;

[0008] S2: Decompose and learn the features extracted from the pharmaceutical chemical reaction molecular formula, and establish a pharmaceutical chemical reaction representation model based on VMDNet (Variational Memory Decomposition Net); wherein, the pharmaceutical chemical reaction molecular formula is decomposed into frame features and significant features;

[0009] S3: According to the pharmaceutical chemical reaction representation model, conduct coarse-grained classification training on the pharmaceutical chemical reaction representation model through the adversarial learning method, and perform inter-category division on the frame features in the pharmaceutical chemical reaction molecular formula;

[0010] S4: According to the pharmaceutical chemical reaction representation model, perform fine-grained classification training on the pharmaceutical chemical reaction representation model through the self-supervised decoupling method; on the basis of the inter-category division, accurately classify the significant features in the pharmaceutical chemical reaction molecular formula features, and complete the representation and automatic classification of small-sample pharmaceutical chemical reactions.

[0011] Optionally, in step S1, extracting features from the pharmaceutical chemical reaction molecular formula includes:

[0012] S11: Extract the token sequence features in the pharmaceutical chemical reaction molecular formula through a sequence representation and classification Transformer (a sequence representation and classification model based on the multi-head attention mechanism), and the format of the pharmaceutical chemical reaction molecular formula is the Simplified Molecular-Input Line-Entry System (SMILES) format;

[0013] S12: Convert the token sequence features into fixed-length features through the adaptive pooling method; concatenate the fixed-length features into a vector.

[0014] Optionally, in step S2, decomposing and learning the pharmaceutical chemical reaction molecular formula features and establishing a pharmaceutical chemical reaction representation model based on VMDNet includes:

[0015] S21: Preset a sample pair training set containing N sample pairs, and the sample pair training set is expressed as

[0016] where N is the number of sample pairs, x n represents the input of the nth pharmaceutical chemical reaction sample, and y n represents the annotation value corresponding to x n ; the sample pair training set also includes two latent variable sets representing the frame feature latent variable and the significant feature latent variable respectively; the pharmaceutical chemical reaction samples in the sample set are independently and identically distributed, and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is Among them, represents the framework information, represents the significant information, represents the sample generator;

[0017] S22: Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform the learning of latent variables;

[0018] S23: Optimize the set of latent variables through VMDNet, use the learned latent variables to represent the drug reaction molecular formula, and construct a drug chemical reaction representation model based on VMDNet.

[0019] Optionally, the two variational autoencoders include: the first variational autoencoder and the second variational autoencoder Among them, the first encoder represents the approximate posterior probability distribution of the framework representation; the second encoder represents the approximate posterior probability distribution of the significant representation, where represents the molecular formula representation containing only the framework information.

[0020] Optionally, in step S3, according to the drug chemical reaction representation model, the drug chemical reaction representation model is trained for coarse-grained classification by the adversarial learning method, and the framework features in the drug chemical reaction molecular formula features are divided among large categories, including:

[0021] S31: Generate the molecular formula x containing only the framework information from the framework features through the sample generator f ; Construct a coarse-grained classifier and a fine-grained classifier for classification among large categories;

[0022] S32: Use x f as the input of the coarse-grained classifier and the fine-grained classifier, train and learn the coarse-grained classifier, and output the classification feedback annotation information y c ;

[0023] S33: Use the coarse-grained classifier and the fine-grained classifier as discriminators, and divide the framework features in the drug chemical reaction molecular formula among large categories through the classification feedback annotation information y c ;

[0024] Optionally, in step S33, use the coarse-grained classifier and the fine-grained classifier as discriminators, and divide the framework features in the drug chemical reaction molecular formula among large categories through the classification feedback annotation information y c including:

[0025] Use the coarse-grained classifier and the fine-grained classifier as discriminators. When the classification feedback annotation information y output by the fine-grained classifierc When it is 0, that is, when the significant feature is 0, the generated drug reaction molecular formula does not contain significant information and only represents coarse-grained features, and the framework features in the drug chemical reaction molecular formula are classified among major categories.

[0026] Optionally, in step S4, according to the drug chemical reaction representation model, through self-supervised decoupling, fine-grained classification training is performed on the drug chemical reaction representation model; on the basis of the classification among major categories, precise classification of the significant features in the drug chemical reaction molecular formula features is completed, and small-sample drug chemical reaction representation and automatic classification are achieved, including:

[0027] By adopting the method of self-supervised decoupling, with two parallel variational autoencoders, the fine-grained classifier in the drug chemical reaction representation model is trained to perform precise classification among major categories of drug reaction molecular formulas.

[0028] Optionally, by adopting the method of self-supervised decoupling, with two parallel variational autoencoders, the fine-grained classifier in the drug chemical reaction representation model is trained to perform precise classification among major categories of drug reaction molecular formulas, including:

[0029] S41: Connect two variational autoencoders in series;

[0030] S42: For the first variational autoencoder Randomly replace one element of the latent variable representing the significant feature to obtain the transformed latent variable of the significant feature Use the transformed latent variable of the significant feature as the input of the sample generator to output a new drug reaction molecular formula

[0031] S43: Use the new drug reaction molecular formula as the input of the second variational autoencoder to output the latent variable z representing the significant feature f , z s ; during decoding, replace the replaced element back;

[0032] S44: Set the target distance loss for training to make the output of the final model the same as the result without replacement, and complete the precise classification of drug chemical reactions.

[0033] On the one hand, a small-sample drug chemical reaction representation and automatic classification device is provided. This device is applied to an electronic device and includes:

[0034] A feature extraction module for extracting features from the drug chemical reaction molecular formula;

[0035] A model building module, configured to perform decomposition learning on the features after extracting the chemical reaction molecular formula of the drug, and build a drug chemical reaction representation model based on VMDNet; wherein, the chemical reaction molecular formula of the drug is decomposed into a framework feature and a significant feature;

[0036] A coarse-grained classifier training module, configured to perform coarse-grained classification training on the drug chemical reaction representation model by means of adversarial learning according to the drug chemical reaction representation model, and perform inter-category division on the framework features in the chemical reaction molecular formula of the drug;

[0037] A fine-grained classifier training module, configured to perform fine-grained classification training on the drug chemical reaction representation model by means of self-supervised decoupling according to the drug chemical reaction representation model; on the basis of inter-category division, perform precise classification on the significant features in the chemical reaction molecular formula of the drug, and complete the representation and automatic classification of small-sample drug chemical reactions.

[0038] Optionally, a feature extraction module, configured to:

[0039] Extract the token sequence features in the chemical reaction molecular formula of the drug by means of the Transformer method, and the format of the chemical reaction molecular formula of the drug is in the SMILES format;

[0040] Convert the token sequence features into fixed-length features by means of an adaptive pooling method; splice the fixed-length features into a vector;

[0041] Decompose the chemical reaction molecular formula of the drug into a framework feature and a significant feature.

[0042] On the one hand, an electronic device is provided, the electronic device includes a processor and a memory, and at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned method for representing and automatically classifying small-sample drug chemical reactions.

[0043] On the one hand, a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned method for representing and automatically classifying small-sample drug chemical reactions.

[0044] The above technical solutions of the embodiments of the present invention have at least the following beneficial effects:

[0045] In the above solution, aiming at the problem that the representation of drug chemical reactions cannot take into account both the framework features and the significant features, in the field of its representation and classification, the representation and classification of chemical molecular formulas are realized by using VMDNet. The specific implementation method is as follows: learning the framework features and the significant features respectively to realize the representation and accurate classification of drug chemical reactions under the condition of small sample training data. This model using VMDNet to represent molecular formulas can be well applied in the fields that require accurate representation and recognition of molecular formulas (such as the field of biopharmaceuticals), facilitating the joint invocation of structural information and detailed information, greatly reducing the problem of difficult recognition of similar drug chemical reactions, and having great economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0047] Figure 1 It is a flowchart of a method for representing and automatically classifying small-sample drug chemical reactions provided by an embodiment of the present invention;

[0048] Figure 2 It is a flowchart of a method for representing and automatically classifying small-sample drug chemical reactions provided by an embodiment of the present invention;

[0049] Figure 3 It is an internal structure diagram of a model for representing and automatically classifying small-sample drug chemical reactions provided by an embodiment of the present invention;

[0050] Figure 4 It is a block diagram of a device for representing and automatically classifying small-sample drug chemical reactions provided by an embodiment of the present invention;

[0051] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the drawings and specific embodiments.

[0053] An embodiment of the present invention provides a method for representing and automatically classifying small-sample drug chemical reactions. This method can be implemented by an electronic device, and the electronic device can be a terminal or a server. As Figure 1 shown in the flowchart of the method for representing and automatically classifying small-sample drug chemical reactions, the processing flow of this method can include the following steps:

[0054] S101: Extract features from the chemical reaction formula of the drug;

[0055] S102: Decompose and learn the features extracted from the chemical reaction formula of the drug, and establish a drug chemical reaction representation model based on the Variational Memory Decomposition Network (VMDNet); wherein, the chemical reaction formula of the drug is decomposed into a framework feature and a significant feature;

[0056] S103: According to the drug chemical reaction representation model, conduct coarse-grained classification training on the drug chemical reaction representation model through the adversarial learning method, and divide the framework features in the chemical reaction formula of the drug into different major categories;

[0057] S104: According to the drug chemical reaction representation model, conduct fine-grained classification training on the drug chemical reaction representation model through the self-supervised decoupling method; on the basis of the division between major categories, accurately classify the significant features in the chemical reaction formula features of the drug, and complete the representation and automatic classification of small-sample drug chemical reactions.

[0058] Optionally, in step S101, extracting features from the chemical reaction formula of the drug includes:

[0059] S111: Extract the token sequence features in the chemical reaction formula of the drug through a sequence representation and classification Transformer model based on the multi-head attention mechanism, and the chemical reaction formula of the drug is in the Simplified Molecular Input Line Entry Specification (SMILES) format;

[0060] S112: Convert the token sequence features into fixed-length features through the adaptive pooling method; splice the fixed-length features into a vector.

[0061] Optionally, in step S102, decomposing and learning the chemical reaction formula features of the drug and establishing a drug chemical reaction representation model based on VMDNet includes:

[0062] S121: Preset a sample pair training set containing N sample pairs, and the sample pair training set is represented as

[0063] wherein, N is the number of sample pairs, x n represents the input of the nth drug chemical reaction sample, and y n represents the annotation value corresponding to x n ; the sample pair training set also includes two latent variable sets representing the framework feature latent variable and the significant feature latent variable respectively; the drug chemical reaction samples in the sample set are independently and identically distributed and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is Among them, represents the framework information, represents the significant information, represents the sample generator;

[0064] S122: Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform the learning of latent variables;

[0065] S123: Optimize the set of latent variables through VMDNet, use the learned latent variables to represent the drug reaction molecular formula, and construct a drug chemical reaction representation model based on VMDNet.

[0066] Optionally, the two variational autoencoders include: the first variational autoencoder and the second variational autoencoder Among them, the first encoder represents the approximate posterior probability distribution of the framework representation; the second encoder represents the approximate posterior probability distribution of the significant representation, where represents the molecular formula representation containing only the framework information.

[0067] Optionally, in step S103, according to the drug chemical reaction representation model, the drug chemical reaction representation model is trained for coarse-grained classification by the adversarial learning method, and the framework features in the drug chemical reaction molecular formula features are divided among large categories, including:

[0068] S131: Generate the molecular formula x containing only the framework information from the framework features through the sample generator f ; Construct a coarse-grained classifier and a fine-grained classifier for classification among large categories;

[0069] S132: Use x f as the input of the coarse-grained classifier and the fine-grained classifier, train and learn the coarse-grained classifier, and output the classification feedback annotation information y c ;

[0070] S133: Use the coarse-grained classifier and the fine-grained classifier as discriminators, and divide the framework features in the drug chemical reaction molecular formula among large categories through the classification feedback annotation information y c ;

[0071] Optionally, in step S33, use the coarse-grained classifier and the fine-grained classifier as discriminators, and divide the framework features in the drug chemical reaction molecular formula among large categories through the classification feedback annotation information y c including:

[0072] Taking the coarse-grained classifier and the fine-grained classifier as discriminators, when the classification feedback annotation information y c output by the fine-grained classifier is 0, that is, when the significant feature is 0, the generated drug reaction molecular formula does not contain significant information and only represents the coarse-grained feature, and the framework features in the drug chemical reaction molecular formula are classified among major categories.

[0073] Optionally, in step S104, according to the drug chemical reaction representation model, through the self-supervised decoupling method, the fine-grained classification training of the drug chemical reaction representation model is carried out; on the basis of the classification among major categories, the significant features in the drug chemical reaction molecular formula features are accurately classified to complete the representation and automatic classification of small-sample drug chemical reactions, including:

[0074] By adopting the self-supervised decoupling method, with two parallel variational autoencoders, the fine-grained classifier in the drug chemical reaction representation model is trained to accurately classify among the major categories of drug reaction molecular formulas.

[0075] Optionally, by adopting the self-supervised decoupling method, with two parallel variational autoencoders, the fine-grained classifier in the drug chemical reaction representation model is trained to accurately classify among the major categories of drug reaction molecular formulas, including:

[0076] S141: Connect the two variational autoencoders in series;

[0077] S142: Randomly replace one element of the latent variable representing the significant feature in the first variational autoencoder to obtain the transformed latent variable of the significant feature Take the transformed latent variable of the significant feature as the input of the sample generator and output a new drug reaction molecular formula

[0078] S143: Take the new drug reaction molecular formula as the input of the second variational autoencoder and output the latent variable z representing the significant feature f , z s ; during decoding, replace the replaced element back;

[0079] S144: Set the target distance loss for training to make the output of the final model the same as the result without replacement, and complete the accurate classification of drug chemical reactions.

[0080] In the embodiments of the present invention, this method is inspired by the research in cognitive psychology, that is, when people store memories of daily things, they will summarize the common structures, and when encountering new things, they will call the common structures and supplement details according to the actual situation. During the modeling process, the framework features and significant features of the chemical formula are respectively decomposed and learned through a variational autoencoder: adversarial learning is introduced to make the framework features contain only the discriminant information between large categories, that is, coarse-grained discriminant information and not contain specific structure information; through self-supervised decoupling learning, the significant features have strong discriminant ability, and then the original expression that can accurately recover different fine-grained information is learned. In this way, the chemical formula information obtained is accurate, complete, and has strong applicability. Compared with traditional recurrent neural networks and variational autoencoders, the representation method based on VMDNet can effectively avoid the problems of inaccurate feature information extraction and incomplete information expression. Therefore, the present invention has very important theoretical value and application value.

[0081] Embodiments of the present invention provide a method for small-sample drug chemical reaction representation and automatic classification, which can be implemented by an electronic device, and the electronic device can be a terminal or a server. As Figure 2 shown in the flowchart of the method for small-sample drug chemical reaction representation and automatic classification, the processing flow of the method may include the following steps:

[0082] S201: Extract the token sequence features in the chemical formula of the drug chemical reaction through a sequence representation and classification Transformer model based on a multi-head attention mechanism, and the format of the chemical formula of the drug chemical reaction is the Simplified Molecular Input Line Entry Specification (SMILES) format.

[0083] In a feasible implementation manner, first, it is necessary to use Transformer to extract the features of the chemical formula of the drug chemical reaction. In the actual molecular representation field, the specific chemical formula is in the SMILES format, and Transformer is used to extract the sequence features of the chemical formula.

[0084] S202: Convert the token sequence features into fixed-length features through an adaptive pooling method; concatenate the fixed-length features into a vector.

[0085] In a feasible implementation manner, since the sequence features are of variable length, an adaptive pooling method is used to convert the sequence features into fixed length, and then these features are concatenated into a vector.

[0086] S203: Preset a sample pair training set containing N sample pairs, and the sample pair training set is specifically represented as

[0087] where, N is the number of sample pairs, x n represents the input of the nth drug chemical reaction sample, and y n represents the corresponding xn The labeled value; the sample pair training set further includes two latent variable sets which respectively represent the framework feature latent variable and the significant feature latent variable; the drug chemical reaction samples in the sample set are independently and identically distributed, and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is wherein represents the framework information represents the significant information represents the sample generator

[0088] In a feasible implementation manner, at the beginning of training, a training set containing N sample pairs is given as where x n represents the input of the drug chemical reaction sample, and y n represents the labeled value corresponding to x n Assume that the samples in the sample set are independently and identically distributed, and can be randomly generated according to the two latent variable sets All latent variables follow the standard normal distribution, that is wherein represents the framework information represents the significant information represents the sample generator. The main objective is to represent the molecular formula with these two sets of latent variables, and the verification method is: to complete the identity verification by measuring the KL (Kullback-Leibler divergence, KL divergence) distance between different molecular formula representations

[0089] In the embodiments of the present invention, it is necessary to use VMDNet to realize the representation of the drug chemical reaction molecular formula. Generally, the chemical reaction formula information feature representation cannot take into account both feature information and framework information, while VMDNet can improve the discriminability and expression ability of such representations

[0090] S204: Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform latent variable learning

[0091] In a feasible implementation manner, in order to learn these two sets of latent variables, two probability encoders are introduced, which are respectively wherein, the former represents the approximate posterior probability distribution of the framework representation; the latter represents the approximate posterior probability distribution of the significant representation, wherein represents the molecular formula representation containing only framework information, and the calculation method of this value will be introduced later. Optimize the parameters θ, φ f , φ s , the calculation method of each sample value is the same, so the subscript n is omitted later. When using the batch gradient descent optimization algorithm for optimization, calculate the average of all sample values in the batch

[0092]

[0093] where γ f and γ s are hyperparameters, and two sets of latent variables are obtained by optimizing the problem described in Equation (1).

[0094] S205: Optimize the set of latent variables through VMDNet, use the learned latent variables to represent the drug reaction molecular formula, and construct a drug chemical reaction representation model based on VMDNet.

[0095] In a feasible implementation, during the process of learning two sets of latent variables, since the framework information may have a certain potential impact on the detailed information, in order to make the framework and the significant representation independent of each other, the following constraints are additionally introduced to make the joint conditional probability distribution of the framework and the significant representation as close as possible to the product of the conditional probability distributions, that is, the following formula:

[0096]

[0097] where is the joint conditional probability distribution of the framework representation and the significant representation, and the independence of the framework representation and the significant representation is achieved by optimizing the KL distance between the joint conditional probability distribution of the framework and the significant representation and the conditional probability distribution.

[0098] However, the constraint described in Equation (2) is difficult to optimize, and here the density ratio technique is used for approximate solution, that is, the following formula:

[0099] C≈log(D(z f , z s )) / (1 - D(zw, z s ))) (3)

[0100] where D represents a binary classifier, and its input is the concatenation of the zf and zs vectors. Thus, the model for representing drug chemical reactions using VMDNet is obtained.

[0101] In a feasible implementation, the two variational autoencoders include: the first variational autoencoder and the second variational autoencoder where the first encoder represents the approximate posterior probability distribution of the framework representation; the second encoder represents the approximate posterior probability distribution of the significant representation, where represents the molecular formula representation containing only framework information.

[0102] S206: Generate the molecular formula x containing only framework information from the framework features through the sample generator f ; construct a coarse-grained classifier and a fine-grained classifier for classification between large categories.

[0103] In a feasible implementation, the present invention takes the representation and classification of pharmaceutical chemistry and reactions as the research background to solve the problems of feature representation and accurate classification modeling of this type of chemical reaction formula information. After S205, the two sets of latent variable sets generated by the model still need further optimization to meet accurate representation and classification, and further learning is carried out for the framework features and significant features respectively.

[0104] In a feasible implementation, the internal learning structure of the specific classification model is as Figure 3 shown, where represents randomly replacing an element of the latent variable of the significant feature, represents z f , the molecular formula estimated via the sample generator p θ , CLS coarse and CLS fine represent the coarse-grained classifier and the fine-grained classifier respectively, both of which are binary classifiers; y c represents the annotation value of the coarse classifier, used to distinguish different major categories, and y represents the annotation value of the fine-grained classifier, used to achieve accurate classification of each category.

[0105] S207: Using x f as the input of the coarse-grained classifier and the fine-grained classifier, training and learning the coarse-grained classifier, and outputting classification feedback annotation information y c ;

[0106] S208: Using the coarse-grained classifier and the fine-grained classifier as discriminators, and dividing the framework features in the pharmaceutical chemical reaction molecular formula into different major categories through the classification feedback annotation information y c .

[0107] In the embodiment of the present invention, using the coarse-grained classifier and the fine-grained classifier as discriminators, when the classification feedback annotation information y c output by the fine-grained classifier is 0, that is, when the significant feature is 0, the generated pharmaceutical reaction molecular formula does not contain significant information but is sufficient to represent the coarse-grained feature, and the framework features in the pharmaceutical chemical reaction molecular formula are divided into different major categories.

[0108] In a feasible implementation, as Figure 3 shown on the left, that is, only using the framework feature z f to generate the molecular formula x θ containing only framework information via the sample generator p f , and then using x f as the input of the coarse-grained classifier CLS coarse (f(x)) and a fine-grained classifier CLSfine The input of (f(x)), after learning and classification, feeds back the labeled information y c , Two pre-trained classifiers are used as discriminators to achieve the classification of molecular formula categories. Among them, f(x) is a feature mapping function, pre-trained by an unsupervised contrastive learning algorithm; y c The apparent features learned by contrastive learning are obtained through a clustering algorithm.

[0109] To verify whether the classification of the classifier is correct, the cross-entropy function BCE( ) is introduced to measure the accuracy of classification, that is, the following formula:

[0110] L adv = BCE(CLS fine (f(x)), y) - BCE(CLS coarse (f(x)), y c ) (4)

[0111] Among them, the typical form of the function BCE( ) for a single sample is the following formula:

[0112]

[0113] In formula (5), y is the actual value, is the predicted value. In formula (4), the actual value reflects y c is and y, and the predicted value reflects as CLS coarse (f(x)) and CLS fine (f(x)).

[0114] S209: Connect two variational autoencoders in series;

[0115] S210: For the first variational autoencoder Randomly replace one element of the latent variable representing the significant feature to obtain the transformed latent variable of the significant feature Use the transformed latent variable of the significant feature as the input of the sample generator to output a new drug response molecular formula

[0116] S211: Use the new drug response molecular formula as the input of the second variational autoencoder to output the latent variable z representing the significant feature f , z s ; During decoding, replace the replaced element back;

[0117] S212: Set the target distance loss for training to make the output of the final model the same as the result without replacement, and complete the accurate classification of pharmaceutical chemical reactions. By adopting the self-supervised decoupling method, two parallel variational autoencoders are used to train the fine-grained classifier in the pharmaceutical chemical reaction representation model to accurately classify between major categories of pharmaceutical reaction molecular formulas, and complete the representation and automatic classification of small-sample pharmaceutical chemical reactions.

[0118] In the embodiment of the present invention, since during training, the constraint that makes the framework and the significant representation conditionally independent is too strong, it is easy to eliminate useful information in order to enforce conditional independence, which affects the training effect. Therefore, further learning for significant features is required. The present invention adopts the self-supervised decoupling method to further eliminate the spurious causal relationship between the framework and the significant features. Two parallel variational autoencoders are used to train the fine-grained classifier in the pharmaceutical chemical reaction representation model to accurately classify between major categories of pharmaceutical reaction molecular formulas.

[0119] In a feasible implementation, the two variational autoencoder models are connected in series. For the first model, as Figure 3 shown, randomly replace one element of the latent variable representing the significant feature to obtain the transformed latent variable of the significant feature Denoted as z f , The molecular formula x estimated by the sample generator p θ will also change accordingly to For the second model, use the output of the first model as the input to estimate z f , z s . And during decoding, replace the replaced element in z s back. To ensure the training effect, set the target distance loss for training to make the obtained output the same as the result without replacement, and thus complete the accurate classification of pharmaceutical chemical reactions.

[0120] In a feasible implementation manner, the entire design process of the present invention is divided into four major steps. In the first step, a Transformer is used to extract the characteristics of the chemical reaction molecular formula of the drug; in the second step, VMDNet is used to represent the chemical reaction molecular formula of the drug. Two probability encoders are used to decompose and learn the frame features and significant features of the objects in the molecular formula through a variational autoencoder, and two sets of latent variable sets are learned through samples of chemical drug reactions. The parameters of the learning are optimized by maximizing the variational lower bound, and the KL distance is tested. Finally, two independent sets of latent variables are obtained for representing the molecular formula; in the third step, the two sets of latent variable sets generated in the second step are used to further learn the frame features and significant features respectively. Among them, for the frame features, the idea of adversarial learning is introduced so that it represents the common features between major categories, and different major categories are divided only by the frame features. For the significant features, a self-supervised decoupling method is adopted, and a fine-grained classifier is trained with two cascaded variational autoencoder models to achieve accurate classification between classes. After the above steps, the design is completed.

[0121] In an embodiment of the present invention, aiming at the problem that the chemical reaction representation of drugs cannot take into account both frame features and significant features, in the field of its representation and classification, VMDNet is used to realize the representation and classification of chemical molecular formulas. The specific implementation method is as follows: learn the frame features and significant features respectively to realize the representation and accurate classification of chemical drug reactions under the condition of small sample training data. This model using VMDNet to represent molecular formulas can be well applied in fields that require accurate representation and recognition of molecular formulas (such as the biopharmaceutical field), facilitating the joint invocation of structural information and detailed information, greatly reducing the problem of difficult recognition of similar chemical drug reactions, and having great economic benefits.

[0122] Figure 4 It is a block diagram of a device for representing and automatically classifying small-sample chemical drug reactions shown according to an exemplary embodiment. Refer to Figure 4 , the device 400 includes:

[0123] A feature extraction module 410, configured to extract features from the chemical reaction molecular formula of the drug;

[0124] A model establishment module 420, configured to perform decomposition learning on the features extracted from the chemical reaction molecular formula of the drug, and establish a chemical drug reaction representation model based on VMDNet; wherein, the chemical reaction molecular formula of the drug is decomposed into frame features and significant features;

[0125] A coarse-grained classifier training module 430, configured to perform coarse-grained classification training on the chemical drug reaction representation model according to the chemical drug reaction representation model by an adversarial learning method, and perform division between major categories on the frame features in the chemical reaction molecular formula of the drug;

[0126] The fine-grained classifier training module 440 is used to perform fine-grained classification training on the drug chemical reaction representation model according to the drug chemical reaction representation model by means of self-supervised decoupling; on the basis of the division between large categories, accurately classify the significant features in the drug chemical reaction molecular formula to complete the representation and automatic classification of small-sample drug chemical reactions.

[0127] Preferably, the feature extraction module 410 is used to extract the token sequence features in the drug chemical reaction molecular formula by means of the Transformer method, and the format of the drug chemical reaction molecular formula is the SMILES format;

[0128] Convert the token sequence features into fixed-length features by means of the adaptive pooling method; splice the fixed-length features into a vector; decompose the drug chemical reaction molecular formula into frame features and significant features.

[0129] Preferably, the model establishment module 420 is used to preset a sample pair training set including N sample pairs, and the sample pair training set is expressed as

[0130] where N is the number of sample pairs, x n represents the input of the nth drug chemical reaction sample, and y n represents the annotation value corresponding to x n ; the sample pair training set also includes two latent variable sets which respectively represent the frame feature latent variable and the significant feature latent variable; the drug chemical reaction samples in the sample set are independently and identically distributed and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is where represents the frame information, represents the significant information, represents the sample generator;

[0131] Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform the learning of latent variables;

[0132] Optimize the latent variable set through VMDNet, use the learned latent variables to represent the drug reaction molecular formula, and construct a drug chemical reaction representation model based on VMDNet.

[0133] Preferably, the two variational autoencoders include: the first variational autoencoder and the second variational autoencoder where the first encoder represents the approximate posterior probability distribution of the frame representation; the second encoder represents the approximate posterior probability distribution of the significant representation, where represents the molecular formula representation containing only frame information.

[0134] Preferably, the coarse-grained classifier training module 430 is configured to generate a molecular formula x containing only framework information from the framework features via a sample generator f ; construct a coarse-grained classifier and a fine-grained classifier for inter-category classification;

[0135] Using x f as the input of the coarse-grained classifier and the fine-grained classifier, train and learn the coarse-grained classifier, and output classification feedback annotation information y c ;

[0136] Using the coarse-grained classifier and the fine-grained classifier as discriminators, and based on the classification feedback annotation information y c perform an inter-category division on the framework features in the drug chemical reaction molecular formula.

[0137] Preferably, the coarse-grained classifier training module 430 is further configured to use the coarse-grained classifier and the fine-grained classifier as discriminators. When the classification feedback annotation information y c output by the fine-grained classifier is 0, that is, when the significant feature is 0, the generated drug reaction molecular formula does not contain significant information and only represents the coarse-grained feature, and perform an inter-category division on the framework features in the drug chemical reaction molecular formula.

[0138] Preferably, the fine-grained classifier training module 440 is configured to train the fine-grained classifier in the drug chemical reaction representation model by using a self-supervised decoupling method with two parallel variational autoencoders for accurate classification between large categories of drug reaction molecular formulas.

[0139] Preferably, the fine-grained classifier training module 440 is further configured to: connect the two variational autoencoders in series;

[0140] For the first variational autoencoder randomly replace one element representing the significant feature latent variable to obtain a transformed significant feature latent variable Use the transformed significant feature latent variable as the input of the sample generator to output a new drug reaction molecular formula Use the new drug reaction molecular formula as the input of the second variational autoencoder to output the latent variable z representing the significant feature f , z s ; during decoding, replace the replaced element back;

[0141] Set a target distance loss for training to make the output of the final model the same as the result without replacement, and complete the accurate classification of drug chemical reactions.

[0142] Figure 5 It is a schematic structural diagram of an electronic device 500 provided by an embodiment of the present invention. The electronic device 500 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 501 and one or more memories 502. Among them, at least one instruction is stored in the memory 502, and the at least one instruction is loaded and executed by the processor 501 to implement the steps of the following method for representing and automatically classifying small-sample drug chemical reactions:

[0143] S1: Extract features from the chemical reaction formula of the drug.

[0144] S2: Decompose and learn the features extracted from the chemical reaction formula of the drug, and establish a drug chemical reaction representation model based on the variational memory decomposition network VMDNet; wherein, the chemical reaction formula of the drug is decomposed into frame features and significant features.

[0145] S3: According to the drug chemical reaction representation model, perform coarse-grained classification training on the drug chemical reaction representation model by the adversarial learning method, and divide the frame features in the chemical reaction formula of the drug among different major categories.

[0146] S4: According to the drug chemical reaction representation model, perform fine-grained classification training on the drug chemical reaction representation model by the self-supervised decoupling method; on the basis of the division among different major categories, accurately classify the significant features in the features of the chemical reaction formula of the drug, and complete the representation and automatic classification of small-sample drug chemical reactions.

[0147] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the above instructions can be executed by a processor in a terminal to complete the above method for representing and automatically classifying small-sample drug chemical reactions. For example, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0148] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk, or an optical disk, etc.

[0149] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A small-sample drug chemical reaction representation and automatic classification method, characterized in that, Including: S1: Extract features from the chemical reaction formula of the drug; S2: Decompose and learn the features extracted from the chemical reaction formula of the drug, and establish a drug chemical reaction representation model based on the Variational Memory Decomposition Network (VMDNet); wherein, the chemical reaction formula of the drug is decomposed into a framework feature and a significant feature; S21: Preset a sample pair training set including N sample pairs, and the sample pair training set is represented as , where N is the number of sample pairs, denotes the input of the nth drug chemical reaction sample, denotes the corresponding annotation value; the sample pair training set further includes two latent variable sets , which respectively represent the frame feature latent variable and the significant feature latent variable; the drug chemical reaction samples in the sample pair training set are independently and identically distributed, and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is , , where represents the sample generator. S22: Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform learning of latent variables; S23: Optimize the set of latent variables through VMDNet, use the learned latent variables to represent the chemical reaction formula of the drug, and construct a drug chemical reaction representation model based on VMDNet; S3: According to the drug chemical reaction representation model, perform coarse-grained classification training on the drug chemical reaction representation model through the adversarial learning method, and perform classification between large categories on the framework features in the chemical reaction formula of the drug; S31: Generate a molecular formula containing only framework information from the framework features via a sample generator ; construct a coarse-grained classifier and a fine-grained classifier for classification between major categories; S32: Using as the input of the coarse-grained classifier and the fine-grained classifier, training and learning the coarse-grained classifier, and outputting classification feedback annotation information ; S33: Use the coarse-grained classifier and the fine-grained classifier as discriminators, and label information is annotated through the classification feedback Perform inter-category division on the framework features in the chemical reaction molecular formula of the drug S4: According to the drug chemical reaction representation model, perform fine-grained classification training on the drug chemical reaction representation model through the self-supervised decoupling method; on the basis of the classification between large categories, perform precise classification on the significant features in the chemical reaction formula features of the drug, and complete the representation and automatic classification of small-sample drug chemical reactions; By adopting the self-supervised decoupling method, with two parallel variational autoencoders, based on the drug chemical reaction representation model, establish a drug chemical reaction representation and automatic classification model based on VMDNet, perform fine-grained classification training, and perform precise classification between large categories of drug reaction formulas.

2. The method according to claim 1, wherein In the step S1, extracting features from the chemical reaction formula of the drug includes: S11: Extract the token sequence features in the chemical reaction formula of the drug through a sequence representation and classification Transformer model based on the multi-head attention mechanism, and the chemical reaction formula of the drug is in the Simplified Molecular Input Line Entry System (SMILES) format; S12: Convert the token sequence features into fixed-length features through the adaptive pooling method; splice the fixed-length features into a vector.

3. The method according to claim 2, characterized in that, The two variational autoencoders include: a first variational autoencoder , and a second variational autoencoder ; wherein, the first variational autoencoder represents an approximate posterior probability distribution of the framework features; the second variational autoencoder represents an approximate posterior probability distribution of the significant features, where represents a chemical reaction formula of a drug that contains only framework information.

4. The method according to claim 3, wherein In the step S33, the coarse-grained classifier and the fine-grained classifier are used as discriminators, and the classification feedback annotation information is used to perform a large-category division on the framework features in the chemical reaction formula of the drug, including: Taking the coarse-grained classifier and the fine-grained classifier as discriminators, when the classification feedback annotation information output by the fine-grained classifier is 0, that is, when the significant feature is 0, the generated drug reaction molecular formula does not contain significant information and only represents the coarse-grained feature, and the framework features in the drug chemical reaction molecular formula are classified among major categories.

5. The method according to claim 4, wherein The method of adopting self-supervised decoupling, based on the drug chemical reaction representation model, establishing a drug chemical reaction representation and automatic classification model based on VMDNet, performing fine-grained classification training, and performing precise classification between large categories of drug reaction formulas includes: S41: Connect two variational autoencoders in series to establish a drug chemical reaction representation and automatic classification model based on VMDNet; S42: For the first variational autoencoder Randomly replace an element of the latent variable representing the significant feature to obtain the transformed latent variable of the significant feature , and use the transformed latent variable of the significant feature as the input of the sample generator to output a new drug response molecular formula ; S43: Take the new drug reaction molecular formula as the input of the second variational autoencoder During decoding, replace the randomly replaced elements back to their original elements and output the latent variable representing the significant features ; S44: Set the target distance loss for training, so that the final output of the drug chemical reaction representation and automatic classification model based on VMDNet is the same as the result without being replaced, and complete the precise classification of the drug chemical reaction.

6. A small-sample pharmaceutical chemical reaction representation and automatic classification device, characterized in that, The device includes: A feature extraction module for extracting features from the chemical reaction formula of the drug; A model establishment module for decomposing and learning the features extracted from the chemical reaction formula of the drug, and establishing a drug chemical reaction representation model based on VMDNet; wherein, the chemical reaction formula of the drug is decomposed into a framework feature and a significant feature; A model establishment module, which is used to preset a sample pair training set containing N sample pairs, and the sample pair training set is expressed as , where N is the number of sample pairs, represents the input of the nth drug chemical reaction sample, represents the corresponding annotation value; the sample pair training set further includes two latent variable sets , which respectively represent the frame feature latent variable and the significant feature latent variable; the drug chemical reaction samples in the sample set are independently and identically distributed and are randomly generated according to the two latent variable sets, and both latent variables follow the standard normal distribution, that is , , where represents the sample generator. Construct two variational autoencoders, optimize the encoder parameters by maximizing the variational lower bound, and perform the learning of latent variables; Optimize the set of latent variables through VMDNet, use the learned latent variables to represent the drug reaction molecular formula, and construct a drug chemical reaction representation model based on VMDNet; A coarse-grained classifier training module, which is used to perform coarse-grained classification training on the drug chemical reaction representation model by the adversarial learning method according to the drug chemical reaction representation model, and perform inter-class division on the framework features in the drug chemical reaction molecular formula; A coarse-grained classifier training module for generating a molecular formula containing only framework information from the framework features via a sample generator ; constructing a coarse-grained classifier and a fine-grained classifier for classification between major categories; Use as the input of the coarse-grained classifier and the fine-grained classifier, train and learn the coarse-grained classifier, and output classification feedback annotation information ; Use the coarse-grained classifier and the fine-grained classifier as discriminators, and label information is annotated through the classification feedback. Perform classification among major categories on the framework features in the chemical reaction molecular formula of the drug. A fine-grained classifier training module, which is used to perform fine-grained classification training on the drug chemical reaction representation model by the self-supervised decoupling method according to the drug chemical reaction representation model; on the basis of the inter-class division, perform precise classification on the significant features in the drug chemical reaction molecular formula to complete the representation and automatic classification of small-sample drug chemical reactions; A fine-grained classifier training module, which is used to establish a drug chemical reaction representation and automatic classification model based on VMDNet on the basis of the drug chemical reaction representation model by adopting the method of self-supervised decoupling with two parallel variational autoencoders, perform fine-grained classification training, and perform precise classification between the categories of the drug reaction molecular formula.

7. The device according to claim 6, characterized in that, The feature extraction module is used for: Extract the token sequence features in the drug chemical reaction molecular formula by the Transformer method, and the format of the drug chemical reaction molecular formula is in SMILES format; Convert the token sequence features into fixed-length features by the adaptive pooling method; splice the fixed-length features into a vector; Decompose the drug chemical reaction molecular formula into framework features and significant features.

Citation Information

Patent Citations

  • Image classification method and system based on hierarchical multi-task learning

    CN110309888A

  • Small sample fine-grained entity classification method based on relational graph convolutional network

    CN113051399A