Drug side effect frequency prediction method and device, electronic equipment and storage medium
By using a weighted fusion of one-dimensional sequence features and two-dimensional structural features, along with a graph attention network, the problem of insufficient generalization ability of existing drug side effect frequency prediction methods in the case of sparse data on new drugs or unknown side effects is solved, and efficient and accurate drug side effect frequency prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINJIANG UNIVERSITY
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-17
AI Technical Summary
Existing methods for predicting the frequency of drug side effects perform poorly when data on new drugs or unknown side effects are sparse. Their feature representations are singular and do not fully utilize multi-source information, resulting in limited generalization ability and insufficient prediction accuracy.
Learnable weights are fused using one-dimensional sequence features and two-dimensional structural features. A side effect similarity graph is constructed by combining graph attention network and medical term embedding. Semantic features are extracted through multi-layer graph attention network, and a comprehensive loss function is used for model training to achieve drug-side effect frequency prediction.
It significantly improves the AUC, MAP, and Top-k recall metrics for predicting drug side effect frequency, enhances generalization and robustness for low-frequency/unobserved combinations, and reduces the cost and time of traditional biological experiments.
Smart Images

Figure CN121885233A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of biomedical informatics and drug safety assessment technology, and in particular to a method, device, electronic device, and storage medium for predicting the frequency of drug side effects. Background Technology
[0002] With the accumulation of pharmaceutical R&D data and advancements in clinical informatics, accurately predicting the frequency of drug side effects has become a key issue in drug safety assessment and clinical decision-making. Traditionally, side effect frequencies are determined primarily through randomized controlled trials, but these methods are time-consuming and resource-intensive, and the trial scale is limited. Especially in certain specific populations (such as the elderly or children), data scarcity makes it difficult to comprehensively cover all trial-based evidence. Therefore, computational models are needed to predict the frequency of drug side effects on a large scale, in order to help reduce adverse reactions and improve the overall safety of drug therapy.
[0003] In recent years, various computational methods have been proposed for predicting the frequency of drug side effects, mainly including traditional machine learning methods, matrix factorization methods, and graph neural network methods based on deep learning. Early traditional methods (such as the multi-kernel learning KTA-MKL model) utilized the similarity between drugs and side effects for prediction, but they heavily relied on known frequency matrices and performed poorly on data sparsity issues related to new drugs or unknown side effects. Subsequently, researchers proposed nonnegative matrix factorization (NMF) models to improve model interpretability, but their generalization ability was limited due to the lack of utilization of drug structure and side effect semantic features. The development of deep learning has driven progress in this field, with some methods utilizing graph convolutional networks (GCNs) or graph attention networks (GATs) to capture the complex relationships between drugs and side effects, achieving significant performance improvements. For example, Zhao et al. proposed combining drug molecular structure features with side effect semantic embeddings and capturing high-order interactions through convolutional neural networks, significantly improving prediction accuracy. Subsequently, Xu et al. developed the DSGAT model based on graph attention networks, learning feature representations on drug atomic graphs and side effect networks, enhancing the model's ability to represent structural information. Another representative method, MGPred, uses attention mechanisms to fuse drug features from multiple perspectives to predict drug-side effect frequency associations.
[0004] Despite the achievements of the aforementioned advanced methods, several shortcomings remain. Many existing models use relatively singular feature representations, failing to fully consider the heterogeneity and complementarity of different information perspectives. For example, DSGAT, based solely on drug atomic structure and simple side effect network features, still has limitations in integrating multi-source information. Similarly, while MGPred integrates multi-perspective features of drugs, it does not fully utilize the semantic information and complex relationships of side effects, resulting in weak model discrimination ability, manifested in low AUC values and biases in predicting high-frequency side effects. Summary of the Invention
[0005] In order to at least solve one of the technical problems existing in the prior art, the present invention provides a method, device, electronic device and storage medium for predicting the frequency of drug side effects.
[0006] One aspect of the present invention provides a method for predicting the frequency of drug side effects, comprising:
[0007] Obtain one-dimensional sequence features and two-dimensional structural features of the target drug;
[0008] The one-dimensional sequence features and the two-dimensional structural features are weighted and fused using learnable weight parameters to obtain a fused feature representation of the target drug.
[0009] A side effect similarity graph is constructed by using known drugs and side effects. The side effect similarity graph includes side effect nodes and edges connecting the side effect nodes. The side effect nodes are initialized as first semantic feature vectors by embedding preset medical terms.
[0010] A graph attention network is used to calculate the attention coefficient between the side effect node and its neighboring nodes. The first semantic feature vector is updated using the attention coefficient to obtain the second semantic feature vector.
[0011] The first prediction model is used to predict the fused feature representation and the second semantic feature vector to obtain the frequency prediction value. The model loss is determined based on the frequency prediction value and the preset true value. The first prediction model is iteratively trained based on the model loss to obtain the second prediction model.
[0012] The target drug's side effect frequency is predicted by using a second prediction model.
[0013] According to the aforementioned drug side effect frequency prediction method, obtaining the one-dimensional sequence features and two-dimensional structural features of the target drug includes:
[0014] The one-dimensional sequence features are obtained by extracting the SMILES molecular formula of the target drug using a pre-trained model; the two-dimensional structural features are obtained by extracting the molecular graph structure of the drug using a pre-trained model.
[0015] According to the aforementioned drug side effect frequency prediction method, the one-dimensional sequence features and the two-dimensional structural features are weighted and fused using learnable weight parameters to obtain a fused feature representation of the target drug, including:
[0016] The formula for weighted fusion is:
[0017]
[0018] in Indicates the first One-dimensional sequence characteristics of a drug Indicates the first Two-dimensional structural characteristics of the drug For feature representation, These are learnable weight parameters. To use activation function The learned weight parameters;
[0019] Representing fusion features A fully connected neural network is used for projection to obtain the fused feature representation of the target drug. for:
[0020]
[0021] in, It is the weight matrix of the projection. It is a bias vector. It is the ReLU activation function. For potential spatial dimensions.
[0022] According to the aforementioned drug side effect frequency prediction method, a side effect similarity graph is constructed using known drugs and side effects. This similarity graph includes side effect nodes and edges connecting them. A preset medical terminology embedding is used to initialize the side effect nodes as a first semantic feature vector, including:
[0023] Based on the known side effects of drugs, the similarity between any two side effects is calculated using cosine similarity. :
[0024]
[0025] in, Side effect node Frequency distribution vectors across multiple drugs, symbol Represents the vector dot product. The Euclidean norm of a vector. This indicates the identifier of another side effect node;
[0026] Based on cosine similarity, the side effect node is calculated. The similarity graph of side effects is obtained from the similar nodes. ,in This indicates the side effects of the drug, with each side effect node including the corresponding side effect. Edges connecting to the side effect node:
[0027]
[0028] in, In the side effect similarity graph, node a is determined by cosine similarity. The set of most similar side effect nodes This indicates that node b in the side effect similarity graph is determined by cosine similarity. The set of the most similar side effect nodes;
[0029] The semantic features of side effects are determined by the hierarchical classification system of the MedDRA medical terminology dictionary. The semantic features of side effects are encoded and assigned to the side effect node to obtain the first semantic feature vector.
[0030] According to the aforementioned drug side effect frequency prediction method, a graph attention network is used to calculate the attention coefficient between the side effect node and its neighboring nodes. The first semantic feature vector is updated using the attention coefficient to obtain the second semantic feature vector, which includes:
[0031] A multi-layer graph attention network is used to extract deep features of side effect nodes, including iterative aggregation of the neighbor nodes of the side effect nodes to obtain the side effect. In the The hidden states of a layered graph attention network are:
[0032]
[0033] in , It is the first The learnable weight matrix of the layer. It is the attention coefficient, used to determine neighboring nodes. For nodes The impact;
[0034] Comparison Nodes with his neighbors The attention coefficient is obtained by calculating the features:
[0035]
[0036] in This indicates vector concatenation. These are the learnable vector parameters used to calculate the attention score. It is a leaky ReLU activation function. This represents the proportion of information from neighbor node b in the new representation of node j;
[0037] go through After layer GAT extraction, the output vector of each side effect node is obtained. According to the output vector Identify potential indications of side effects Through latent representation The second semantic feature vector is obtained by updating the side effect node.
[0038] According to the aforementioned method for predicting the frequency of drug side effects, the model loss is:
[0039]
[0040] in, For model loss; positive samples Represents the set of all known drug-side effect pairs; negative samples This represents the set of all pairs of samples for which no side effects were reported, and is considered a negative sample. It is a drug and side effects The predicted frequency value; This represents the standard MSE loss for all samples. As a weighting factor, negative samples The penalty items, This is the frequency threshold.
[0041] According to the aforementioned method for predicting the frequency of drug side effects, the target drug is predicted using a second prediction model to obtain the predicted frequency of side effects, including:
[0042] The fusion feature representation of the target drug is obtained by projection processing through the fully connected layer of the second prediction model to obtain the latent feature matrix of the drug.
[0043] After processing the initial semantic feature matrix of the target drug through the second prediction model, the obtained second semantic feature vector and the latent feature matrix of the drug are processed through a multi-layer graph attention network to obtain the latent feature matrix of side effects.
[0044] The predicted frequency of side effects of the target drug is determined by using the vector inner product based on the latent feature matrix of the drug and the latent feature matrix of its side effects.
[0045] Another aspect of the present invention provides a drug side effect frequency prediction device, comprising:
[0046] The first module is used to obtain the one-dimensional sequence features and two-dimensional structural features of the target drug;
[0047] The second module is used to perform weighted fusion of the one-dimensional sequence features and the two-dimensional structural features using learnable weight parameters to obtain a fused feature representation of the target drug.
[0048] The third module is used to construct a side effect similarity graph based on known drugs and side effects. The side effect similarity graph includes side effect nodes and edges connecting the side effect nodes. The side effect nodes are initialized as first semantic feature vectors using preset medical terminology embedding.
[0049] The fourth module is used to calculate the attention coefficient between the side effect node and its neighboring nodes using a graph attention network, and to update the first semantic feature vector using the attention coefficient to obtain the second semantic feature vector.
[0050] The fifth module is used to predict the fused feature representation and the second semantic feature vector using the first prediction model to obtain the frequency prediction value, determine the model loss based on the frequency prediction value and the preset true value, and iteratively train the first prediction model based on the model loss to obtain the second prediction model.
[0051] The sixth module is used to predict the target drug using the second prediction model, and obtain the predicted frequency of the target drug's side effects.
[0052] Another aspect of the present invention provides an electronic device, including a processor and a memory;
[0053] The memory is used to store programs;
[0054] The processor executes the program to implement the method as described above.
[0055] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the methods described above.
[0056] The beneficial effects of this invention are: it enables large-scale drug-side effect frequency prediction in a short time, significantly improves indicators such as AUC, MAP and Top-k recall, has better generalization and robustness for low-frequency / unobserved combinations, and effectively reduces the blindness and cost of traditional biological experiments. Attached Figure Description
[0057] Figure 1 This is a schematic diagram of the drug side effect frequency prediction process according to an embodiment of the present invention.
[0058] Figure 2 This is a schematic diagram of the training system for the drug side effect frequency prediction model according to an embodiment of the present invention.
[0059] Figure 3 This is a schematic diagram illustrating the frequency of side effects of a target drug according to an embodiment of the present invention.
[0060] Figure 4 This is an ROC curve comparing the performance of the method in this embodiment of the invention with other existing methods.
[0061] Figure 5 This is a box plot of the predicted score distribution versus the true frequency of nine drugs not included in the training dataset, which were independently tested according to an embodiment of the present invention.
[0062] Figure 6 This is a schematic diagram of a drug side effect frequency prediction device according to an embodiment of the present invention. Detailed Implementation
[0063] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings. Throughout the description, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions. In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" can be used interchangeably. Terms such as "first," "second," etc., are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the sequential relationship of the indicated technical features. In the following description, the consecutive reference numerals for method steps are for ease of review and understanding. Adjusting the implementation order of steps, in conjunction with the overall technical solution of the present invention and the logical relationship between the various steps, will not affect the technical effect achieved by the technical solution of the present invention. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0064] refer to Figure 1 ,in Figure 1 This is a schematic diagram of the drug side effect frequency prediction process according to an embodiment of the present invention, which includes, but is not limited to, steps S100 to S600:
[0065] S100: Obtain the one-dimensional sequence features and two-dimensional structural features of the target drug.
[0066] In some embodiments, one-dimensional sequence features are extracted from the SMILES molecular formula of the drug using a pre-trained model, and two-dimensional structural features are extracted from the molecular graph structure of the drug using a pre-trained model.
[0067] This invention selects two core characterization methods—drug sequence and structure—as well as semantic classification and statistical mapping of side effects, covering key aspects of chemical properties and medical knowledge. This avoids interference that may be caused by introducing redundant or noisy modalities (such as free text). This not only reduces the difficulty of data acquisition (without relying on additional text corpora or disease-related data) but also reduces the burden on model learning and the risk of overfitting.
[0068] In this invention, the feature extraction stage is clearly defined and highly targeted: different perspectives are extracted by pre-trained models, resulting in high-quality representations that are not confused with each other; then, adaptive fusion is performed using trainable fusion weights, preserving key features from each perspective while suppressing noise. Furthermore, the acquisition of side effect features combines medical knowledge (MedDRA semantics) with statistical relationships (frequency similarity), efficiently extracting representations containing semantic connections through graph neural networks.
[0069] S200 uses learnable weight parameters to perform weighted fusion of one-dimensional sequence features and two-dimensional structural features to obtain the fused feature representation of the target drug.
[0070] In some embodiments, one-dimensional and two-dimensional features of a drug are weighted and fused. The fusion method involves introducing a learnable weight parameter and summing the one-dimensional and two-dimensional features according to the weight to obtain a fused feature representation for each drug.
[0071] In some embodiments, the fusion feature representation of the target drug is obtained as follows:
[0072] The fusion weights in the above embodiments are trainable parameters. The initial value was set to 0.5, and optimized during training through backpropagation. This was to ensure that the weight values remained within a reasonable range. Within this embodiment of the invention, a sigmoid activation function constraint is applied during the optimization process. The final drug fusion characteristics... Feature-level fusion is performed using an adaptive weighted summation method, defined as follows:
[0073]
[0074] in Indicates the first One-dimensional sequence characteristics of a drug Indicates the first Two-dimensional structural characteristics of the drug For feature representation, These are learnable weight parameters. To use activation function The learned weight parameters.
[0075] in and Each drug The model obtains one-dimensional feature embeddings from the SMILES Transformer and two-dimensional feature embeddings from the graph convolutional network. This learnable fusion strategy enables the model to dynamically determine the contribution of each view to the final drug representation, thereby improving the model's adaptability and prediction accuracy. The resulting multi-view feature vectors... Simultaneously encapsulating both sequence and structural information of the drug, its representational power far surpasses that of single-view features. This vector reflects both the drug's sequence characteristics and its structural features. This adaptive fusion mechanism can mitigate the noise effects inherent in single-modal approaches while preserving complementary features between different perspectives.
[0076] In obtaining the fusion feature vector of each drug Subsequently, embodiments of the present invention use a fully connected neural network to project it into a task-specific latent space. In this framework, embodiments of the present invention employ fully connected layers to... Mapped to the latent vector of the drug ( (For potential spatial dimensions). Defined as follows:
[0077]
[0078] in It is the weight matrix of the projection. It is a bias vector. It is the ReLU activation function. In this embodiment of the invention, the dimension of the drug potential vector is pre-set to be the same as that of the side effect potential vector to ensure that the two can be interactively fused through inner product.
[0079] The innovation of this invention's fusion mechanism lies in its phased fusion based on information properties: for multimodal information within the drug, a controllable weighted fusion is employed to ensure that information from each perspective is fully utilized and does not obscure each other; for the correlation information between side effects, a graph neural network is used to fuse pattern information of similar side effects, preserving the fusion of data-driven relational information and domain knowledge semantics. The final concise inner product prediction ensures that the fusion result directly serves the calculation of frequency scores, without unnecessary complex combinations. In terms of effectiveness, this hierarchical fusion allows the model to extract local modal details while capturing global relational patterns, thus significantly improving prediction performance.
[0080] S300 constructs a side effect similarity graph based on known drugs and side effects. The side effect similarity graph includes side effect nodes and edges connecting them. The side effect nodes are initialized as first semantic feature vectors using preset medical terminology embedding.
[0081] In some embodiments, a lightweight side effect similarity graph is constructed by fusing semantic attributes and frequency distribution information of side effects to extract higher-order semantic features.
[0082] Initial characteristics of each side effect node This is represented by its occurrence among all drugs, i.e., the frequency matrix. The Based on these frequency features, the column vectors in this invention calculate the cosine similarity between any two side effects, as defined below:
[0083]
[0084] in Indicates side effect nodes exist Frequency distribution vector of a drug, symbol " " represents the vector dot product, This represents the Euclidean norm of a vector.
[0085] Then, in this embodiment of the invention, the k-nearest neighbor algorithm is used to select the k most similar nodes to each side effect node based on the cosine similarity of each side effect frequency vector, thereby constructing a side effect similarity graph. The nodes of this graph Each node represents a side effect, and there are M nodes in total. The set of edges is defined as follows:
[0086]
[0087] in This represents the set of the k most similar side effect nodes for node a, determined by cosine similarity. If an edge exists between node a and node b, it indicates that they are highly similar in their frequency distribution patterns induced by the drug, and may be related in terms of mechanism of action or physiological manifestation.
[0088] Meanwhile, to incorporate prior medical semantic information, this embodiment of the invention utilizes the hierarchical classification system of the MedDRA (Medical Dictionary for Regulatory Activities) to represent the semantic features of each side effect. Each side effect is encoded into a 243-dimensional semantic feature vector (using multi-hot encoding to indicate the category of the side effect in the MedDRA classification system) according to its system organ classification (SOC), higher-level grouping terms, etc. This embodiment of the invention assigns this vector to the corresponding side effect node as its initial node feature.
[0089] S400 uses a graph attention network to calculate the attention coefficients between side effect nodes and their neighbor nodes, and updates the first semantic feature vector using the attention coefficients to obtain the second semantic feature vector.
[0090] In some embodiments, a graph neural network is used to analyze the side effect graph constructed above. Modeling is performed to learn a low-dimensional embedding representation for each side effect node, thereby capturing its MedDRA-based semantic attributes and relationships with other side effects. This embodiment of the invention employs a multi-layer graph attention network (GAT) for deep feature extraction. The initial input feature for each side effect node is its corresponding 243-dimensional semantic vector, denoted as... GAT updates node characteristics by iteratively aggregating information from each node's neighbors. At each GAT layer, each side-effect node... They will all pay attention to their neighboring nodes. And calculate the weighted sum of the eigenvectors from the previous layer. Formally, for a learnable weight matrix... GAT layer, side effects In the The hidden state of the layer is:
[0091]
[0092] in , It is the first The learnable weight matrix of the layer. It is the attention coefficient, used to determine neighboring nodes. For nodes The influence of attention coefficients is determined by comparing nodes. with his neighbors The features (highlighting relevant neighbors using a learnable attention mechanism) are calculated. The calculation method is as follows:
[0093]
[0094] in" " indicates vector concatenation, These are the learnable vector parameters used to calculate the attention score. It is a leaky ReLU activation function. Through the above standardization, we obtain... This represents the proportion of information from neighbor b in the new representation of node j. The embodiments of the present invention stack... This layered GAT allows information in the side effect network to propagate at most [a certain distance]. This involves jumping to capture indirect relationships between side effects. After layer GAT extraction, each side effect node will generate an output vector. The embodiments of the present invention use this as a potential representation of the side effect. .
[0095] In implementation, this embodiment of the invention adjusts the output dimension of the last layer GAT to... This ensures that the dimension of the side effect latent vector is consistent with that of the drug latent vector. GAT's attention mechanism and non-linear feature aggregation enable the resulting side effect embeddings to reflect both the local graph structure (i.e., information shared between similar side effects) and the rich semantic features from MedDRA. In this way, the embeddings of similar side effects (neighboring nodes in the graph) in the latent space will be close to each other, while each embedding can still retain the unique semantic features of that node.
[0096] S500 uses a first prediction model to predict the fused feature representation and the second semantic feature vector to obtain the frequency prediction value. The model loss is determined based on the frequency prediction value and the preset true value. The first prediction model is iteratively trained based on the model loss to obtain the second prediction model.
[0097] In some embodiments, this imbalance is addressed by designing a loss function that encourages accurate regression on positive (observed side effects) samples while avoiding bias on negative (no observed side effects) samples. The embodiments of this invention use sets... This represents the set of all known drug-side effect pairs (positive samples). This represents the set of all paired samples (negative samples) for which no side effects were reported. The loss function in this embodiment of the invention. It includes two items: (1) mean squared error (MSE) for positive samples; and (2) a penalty term for negative samples, which prevents the model from predicting excessively high frequency values when no side effects are observed. Formally, embodiments of the present invention define:
[0098]
[0099] in, It is a drug and side effects The prediction frequency. It is a small frequency threshold. These are the tradeoff coefficients. The first loss term is the standard MSE for all observed samples, ensuring the model learns to accurately fit known frequency values. The second loss term is used for negative sample bias control: when the frequency value predicted by the model is higher than a small threshold... In such cases, a secondary penalty is introduced into the prediction to avoid unreported side effects.
[0100] The supervision method in this invention uses a comprehensive loss function to ensure accurate fitting of the frequencies of known associations while achieving a binary classification-like effect through implicit constraints on unknown associations. This approach avoids explicitly increasing the model complexity associated with the classification task, maintaining a simple and consistent training process. Simultaneously, the introduction of a negative sample penalty term makes the model cautious about the "unknown," enhancing the reliability of the prediction results in practical applications (reducing the risk of misclassifying zero samples as high-frequency).
[0101] In yet another embodiment, reference is made to Figure 2 The schematic diagram of the model training system shown uses the SIDER4.1 dataset, a drug-side effect frequency matrix, for both model training and evaluation. The SIDER4.1 database collects information on the frequency of side effects reported in clinical trials. This embodiment of the invention filters out drugs that do not contain any side effect frequency records in SIDER4.1, retaining only drugs and side effects with at least one known frequency, thus ensuring the validity of the training data. The final dataset contains approximately 750 drugs, 994 side effects, and 37,071 drug-side effect association records. This invention trains the model on the training set, optimizes the model parameters on the validation set, and finally evaluates the model performance on the test set.
[0102] The dual-branch structure of this invention features clear module boundaries and efficient inference capabilities. Drugs and side effects are represented through their respective channels, and then fused for prediction using only a simple inner product, resulting in a smaller model parameter count and a simpler structure. Furthermore, this design is naturally suited for reconstructing large-scale frequency matrices: given the latent vectors of all drugs and all side effects, matrix multiplication can simultaneously produce frequency predictions for all pairs, greatly improving inference efficiency. Simultaneously, the dual-branch structure provides the model with good scalability—adding a new drug or side effect only requires calculating its vector representation, without needing to retrain the entire model.
[0103] S600 uses a second prediction model to predict the target drug and obtain the predicted frequency of the target drug's side effects.
[0104] refer to Figure 3 The flowchart illustrating the side effect frequency of the target drug shown includes, but is not limited to, steps S610-S630:
[0105] S610, the fusion feature representation of the target drug is obtained and projected through the fully connected layer of the second prediction model to obtain the latent feature matrix of the drug.
[0106] In this embodiment of the invention, the fused multi-view drug features are projected through a fully connected layer to obtain a drug latent feature matrix. (where each row vector) Indicates drug Representation in the latent space).
[0107] S620: After processing the initial semantic feature matrix of the target drug through the second prediction model, the obtained second semantic feature vector and the potential feature matrix of the drug are processed through a multi-layer graph attention network to obtain the potential feature matrix of side effects.
[0108] Regarding side effects, the embodiments of the present invention will use the initial semantic feature matrix. (each row vector) Side effects The MedDRA semantic vectors and the adjacency matrix of the KNN graph are input into the GAT layer, and then... The side effect latent feature matrix is obtained after layer operation. , where each row vector Indicates side effects The final embedded representation.
[0109] S630: The predicted frequency of side effects of the target drug is determined by using the vector inner product based on the potential feature matrix of the drug and the potential feature matrix of the side effects.
[0110] Understandably, for any given drug-side effects... The model predicts the frequency value by calculating the inner product of the corresponding latent vectors. and By using the inner product of these matrices, this embodiment of the invention can obtain a matrix of predicted frequency values for all drug-side effect pairs:
[0111]
[0112] in Indicates drug and side effects The prediction frequency. This embodiment of the invention attempts to use an optional fully connected predictor that will... The parameters are connected and output to a small neural network to obtain frequency scores. However, in experiments of this embodiment of the invention, this increased complexity did not significantly improve performance; instead, it greatly increased the number of parameters and reduced interpretability. Therefore, the final model of this embodiment uses a simple inner product. This proved effective as a predictive layer and is consistent with the matrix factorization method used in previous frequency prediction studies. The predictive model ultimately yields drug-side effect frequency predictions; higher prediction values indicate a higher frequency of drug-induced side effects, and vice versa.
[0113] This invention focuses on the single objective of frequency regression, without introducing additional classification task interference, and can fully utilize the model capacity to characterize subtle differences in frequency magnitude. This focus helps improve the accuracy and stability of frequency prediction.
[0114] To further explore the contribution of each component in the MVFDSP model to the prediction of drug side effect frequency, this invention conducted a series of deletion experiments. Specifically, this invention systematically removed one-dimensional drug features (1D-DF), two-dimensional drug graph features (2D-DF), side effect semantic features (SESemantic), and side effect graph structural features (SEGraph). This invention comprehensively evaluated and analyzed the impact of removing these features on the model's predictive performance. Detailed experimental results are shown in Table 1.
[0115] Table 1 Performance of embodiments of the present invention under different variants
[0116]
[0117] Figure 4 The ROC curves are used to compare the performance of the method in this embodiment of the invention with other existing methods. MVFDSP is the method in this embodiment of the invention. Compared with other methods, the method of this invention obviously achieves a higher area under the ROC curve (AUC).
[0118] Figure 5 To facilitate this invention, nine drugs not included in the training dataset were independently tested. The frequency of side effects for these drugs was predicted using the MVFDSP model, and the predicted score distribution was compared with the actual frequency using box plots. Meanwhile, Figure 3 In independent tests, the predicted side effect frequencies generally showed good agreement with the actual frequencies, particularly in the medium to high frequency categories of side effects. These results demonstrate the model's good predictive accuracy and stability. Although some biases and outliers existed in the prediction of low-frequency side effects for certain drugs, the overall trend was clearly discernible, and the box plots significantly highlighted the distribution differences. These findings indicate that the model in this embodiment not only possesses robust predictive capabilities for known data but can also be effectively extended to the prediction of side effect frequencies for new drugs, highlighting its practical application value and potential clinical significance.
[0119] Figure 6 This is a schematic diagram of a drug side effect frequency prediction device according to an embodiment of the present invention. The device includes a first module 610, a second module 620, a third module 630, a fourth module 640, a fifth module 650, and a sixth module 660.
[0120] The system comprises the following modules: First, it acquires one-dimensional sequence features and two-dimensional structural features of the target drug; second, it weights and fuses the one-dimensional sequence features and two-dimensional structural features using learnable weight parameters to obtain a fused feature representation of the target drug; third, it constructs a side effect similarity graph based on known drugs and side effects, the graph including side effect nodes and edges connecting them, and initializes the side effect nodes as first semantic feature vectors using preset medical terminology embedding; fourth, it calculates the attention coefficients between side effect nodes and their neighboring nodes using a graph attention network, updates the first semantic feature vectors using these attention coefficients to obtain a second semantic feature vector; fifth, it uses a first prediction model to predict the fused feature representation and the second semantic feature vector to obtain frequency prediction values, determines the model loss based on the frequency prediction values and preset true values, and iteratively trains the first prediction model based on the model loss to obtain a second prediction model; and sixth, it uses the second prediction model to predict the target drug's side effect frequency prediction results.
[0121] Exemplarily, with the cooperation of the first, second, third, fourth, fifth, and sixth modules in the device, the embodiment device can implement any of the aforementioned drug side effect frequency prediction methods, namely, acquiring the one-dimensional sequence features and two-dimensional structural features of the target drug; weighting and fusing the one-dimensional sequence features and two-dimensional structural features using learnable weight parameters to obtain a fused feature representation of the target drug; constructing a side effect similarity graph through known drugs and side effects, the side effect similarity graph including side effect nodes and edges connecting side effect nodes, and initializing the side effect nodes as a first semantic feature vector using preset medical terminology embedding; calculating the attention coefficient between the side effect node and its neighboring nodes using a graph attention network, updating the first semantic feature vector using the attention coefficient to obtain a second semantic feature vector; predicting the fused feature representation and the second semantic feature vector using a first prediction model to obtain a frequency prediction value; determining the model loss based on the frequency prediction value and a preset true value; iteratively training the first prediction model based on the model loss to obtain a second prediction model; and predicting the target drug using the second prediction model to obtain the side effect frequency prediction result of the target drug.
[0122] This invention also provides an electronic device, which includes a processor and a memory;
[0123] The memory stores the program;
[0124] The processor executes a program to perform the aforementioned drug side effect frequency prediction method; the electronic device has the function of carrying and running the software system for predicting the drug side effect frequency provided in the embodiments of the present invention, such as a personal computer, minicomputer, mainframe, workstation, network or distributed computing environment, standalone or integrated computer platform, or communicating with charged particle tools or other imaging devices, etc.
[0125] This invention also provides a computer-readable storage medium storing a program that is executed by a processor to implement the drug side effect frequency prediction method described above.
[0126] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented in the embodiments of this invention. Alternative embodiments are contemplated, in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0127] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method for predicting the frequency of drug side effects.
[0128] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, considering the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed in the embodiments of the invention, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0129] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can include, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0131] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0132] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0133] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0134] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0135] The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A method of predicting the frequency of drug side effects, characterized by, include: Obtain one-dimensional sequence features and two-dimensional structural features of the target drug; The one-dimensional sequence features and the two-dimensional structural features are weighted and fused using learnable weight parameters to obtain a fused feature representation of the target drug. A side effect similarity graph is constructed by using known drugs and side effects. The side effect similarity graph includes side effect nodes and edges connecting the side effect nodes. The side effect nodes are initialized as first semantic feature vectors by using preset medical terminology embedding. A graph attention network is used to calculate the attention coefficient between the side effect node and its neighboring nodes. The first semantic feature vector is updated using the attention coefficient to obtain the second semantic feature vector. The first prediction model is used to predict the fused feature representation and the second semantic feature vector to obtain the frequency prediction value. The model loss is determined based on the frequency prediction value and the preset true value. The first prediction model is iteratively trained based on the model loss to obtain the second prediction model. The target drug's side effect frequency is predicted by using a second prediction model.
2. The method of predicting the frequency of adverse drug effects according to claim 1, characterized by, The acquisition of one-dimensional sequence features and two-dimensional structural features of the target drug includes: The one-dimensional sequence features are obtained by extracting the SMILES molecular formula of the target drug using a pre-trained model; the two-dimensional structural features are obtained by extracting the molecular graph structure of the drug using a pre-trained model.
3. The method for predicting the frequency of drug side effects according to claim 1, characterized in that, The step of weighting and fusing the one-dimensional sequence features and the two-dimensional structural features using learnable weight parameters to obtain the fused feature representation of the target drug includes: The formula for weighted fusion is: in Indicates the first One-dimensional sequence characteristics of a drug Indicates the first Two-dimensional structural characteristics of the drug For feature representation, These are learnable weight parameters. To use activation function The learned weight parameters; Representing fusion features A fully connected neural network is used for projection to obtain the fused feature representation of the target drug. for: in, It is the weight matrix of the projection. It is a bias vector. It is the ReLU activation function. For potential spatial dimensions.
4. The method for predicting the frequency of drug side effects according to claim 1, characterized in that, The step involves constructing a side effect similarity graph using known drugs and side effects. This graph includes side effect nodes and edges connecting them. The side effect nodes are initialized as first semantic feature vectors using a pre-defined medical terminology embedding method. Based on the known side effects of drugs, the similarity between any two side effects is calculated using cosine similarity. : in, Side effect node Frequency distribution vectors across multiple drugs, symbol Represents the vector dot product. The Euclidean norm of a vector. This indicates the identifier of another side effect node; Based on cosine similarity, the side effect node is calculated. The similarity graph of side effects is obtained from the similar nodes. ,in This indicates the side effects of the drug, with each side effect node including the corresponding side effect. Edges connecting to the side effect node: in, In the side effect similarity graph, node a is determined by cosine similarity. The set of most similar side effect nodes This indicates that node b in the side effect similarity graph is determined by cosine similarity. The set of the most similar side effect nodes; The semantic features of side effects are determined by the hierarchical classification system of the MedDRA medical terminology dictionary. The semantic features of side effects are encoded and assigned to the side effect node to obtain the first semantic feature vector.
5. The method for predicting the frequency of drug side effects according to claim 4, characterized in that, The graph attention network calculates the attention coefficients between the side-effect node and its neighboring nodes, and updates the first semantic feature vector using these attention coefficients to obtain the second semantic feature vector, including: A multi-layer graph attention network is used to extract deep features of side effect nodes, including iterative aggregation of the neighbor nodes of the side effect nodes to obtain the side effect. In the The hidden states of a layered graph attention network are: in , It is the first The learnable weight matrix of the layer. It is the attention coefficient, used to determine neighboring nodes. For nodes The impact; Comparison Nodes with his neighbors The attention coefficient is obtained by calculating the features: in Indicates vector concatenation. These are the learnable vector parameters used to calculate the attention score. It is a leaky ReLU activation function. This represents the proportion of information from neighbor node b in the new representation of node j; go through After layer GAT extraction, the output vector of each side effect node is obtained. According to the output vector Identify potential indications of side effects Through latent representation The second semantic feature vector is obtained by updating the side effect node.
6. The method for predicting the frequency of drug side effects according to claim 1, characterized in that, The model loss is: in, For model loss; positive samples Represents the set of all known drug-side effect pairs; negative samples This represents the set of all pairs of samples for which no side effects were reported, and is considered a negative sample. It is a medicine and side effects The predicted frequency value; This represents the standard MSE loss for all samples. As a weighting factor, negative samples The penalty items, This is the frequency threshold.
7. The method for predicting the frequency of drug side effects according to claim 1, characterized in that, The step of predicting the target drug using the second prediction model to obtain the predicted frequency of the target drug's side effects includes: The fusion feature representation of the target drug is obtained by projection processing through the fully connected layer of the second prediction model to obtain the latent feature matrix of the drug. After processing the initial semantic feature matrix of the target drug through the second prediction model, the obtained second semantic feature vector and the latent feature matrix of the drug are processed through a multi-layer graph attention network to obtain the latent feature matrix of side effects. The predicted frequency of side effects of the target drug is determined by using the vector inner product based on the latent feature matrix of the drug and the latent feature matrix of its side effects.
8. A device for predicting the frequency of drug side effects, characterized in that, include: The first module is used to obtain the one-dimensional sequence features and two-dimensional structural features of the target drug; The second module is used to perform weighted fusion of the one-dimensional sequence features and the two-dimensional structural features using learnable weight parameters to obtain a fused feature representation of the target drug. The third module is used to construct a side effect similarity graph based on known drugs and side effects. The side effect similarity graph includes side effect nodes and edges connecting the side effect nodes. The side effect nodes are initialized as first semantic feature vectors using preset medical terminology embedding. The fourth module is used to calculate the attention coefficient between the side effect node and its neighboring nodes using a graph attention network, and to update the first semantic feature vector using the attention coefficient to obtain the second semantic feature vector. The fifth module is used to predict the fused feature representation and the second semantic feature vector using the first prediction model to obtain the frequency prediction value, determine the model loss based on the frequency prediction value and the preset true value, and iteratively train the first prediction model based on the model loss to obtain the second prediction model. The sixth module is used to predict the target drug using the second prediction model, and obtain the predicted frequency of the target drug's side effects.
9. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the drug side effect frequency prediction method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the drug side effect frequency prediction method as described in any one of claims 1-7.