A graph neural network knowledge editing method based on drug toxicity classification

By extracting subnets from drug molecular structure data and optimizing parameters, the problem of low accuracy in drug toxicity classification was solved, achieving low-cost knowledge editing and improved accuracy.

CN119378659BActive Publication Date: 2025-11-14CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411429715.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-11-14
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

Existing drug molecule structure data is difficult to locate and edit in specific knowledge layers in graph neural networks, resulting in low accuracy of drug toxicity classification and high retraining costs.

Method used

By extracting subnetworks of drug structural features, screening and optimizing parameters, and using a plug-in optimization method to add new knowledge without retraining the model, constraints are added to prevent forgetting, and neuron weights are adjusted.

Benefits of technology

It improved the accuracy of drug toxicity classification, reduced the cost of knowledge editing, avoided false positives caused by neural coupling, and achieved efficient knowledge injection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378659B_ABST
    Figure CN119378659B_ABST
Patent Text Reader

Abstract

This invention relates to the field of graph neural network (GNN) knowledge editing, and particularly to a graph neural network knowledge editing method based on drug toxicity classification. The method includes: acquiring a drug toxicity classification dataset to be processed; extracting a graph subnetwork of the GNN used to classify chemical molecules; extracting class subnetworks from the graph subnetworks that retain only drug structural feature knowledge and compound knowledge; filtering and purifying the class subnetworks that retain only drug structural feature knowledge; optimizing the parameters of the purified class subnetworks; adding constraints to the optimization objective; and optimizing the model using a plug-in optimization method to obtain the optimization objective, thus completing the knowledge editing. Using the graph neural network knowledge editing method based on drug toxicity classification described in this invention, new knowledge can be effectively injected into the drug toxicity classification model, significantly reducing the cost of retraining the model to embed knowledge and improving the feasibility of practical applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of knowledge editing and graph neural networks, specifically to a graph neural network knowledge editing method based on drug toxicity classification. Background Technology

[0002] In drug development, predicting toxicity is crucial, requiring assessment of drug usability based on its molecular structure. Graph Neural Networks (GNNs), a deep learning method based on graph structures, possess powerful expressive capabilities, integrating graph structures into representation learning and achieving excellent performance in various fields involving graph data. Taking a GNN model for classifying compound molecules as an example, its current accuracy is low. Acquiring new knowledge that can improve accuracy requires knowledge editing or retraining the original model, but retraining is too costly.

[0003] Traditional research on knowledge editing in graph neural networks has mainly focused on language models and image models. It involves locating a specific layer in the model that stores particular knowledge and then editing the weights of that layer to change how knowledge is stored in the model.

[0004] Unlike the stable structures of corpus and image data, graph data of drug molecular structures are typically very complex, and the information transmission paths within these graph data in the model are also highly complex. Therefore, it is not possible to simply locate a single layer in a graph neural network (GNN) as the neuron storing the target knowledge. Consequently, a method is needed to perform knowledge editing on GNNs applied to drug toxicity classification from a more granular perspective. Summary of the Invention

[0005] In view of this, the present invention proposes a graph neural network knowledge editing method based on drug toxicity classification to solve the above problems, including: acquiring a drug toxicity classification dataset to be processed; extracting a graph subnetwork of a GNN that classifies chemical molecular structures; extracting class subnetworks from the graph subnetworks that retain only drug structural feature knowledge and compound knowledge; filtering and purifying the class subnetworks that retain only drug structural feature knowledge; optimizing the parameters of the purified class subnetworks; adding constraints to the optimization objective; and using a plug-in optimization method to optimize the model, obtain the optimization objective, and complete the knowledge editing.

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

[0007] By adding constraints to the optimization objective, the problem of large-scale forgetting of the model during the knowledge editing process of the graph neural network for drug toxicity classification is effectively alleviated; by using global tuning of model parameters as a plug-in in the targeted knowledge editing process of subnetworks, and adjusting neuron weights by alternating ES steps, the problem of "collateral damage" to non-target knowledge caused by excessive coupling between neurons is effectively alleviated; by using the method of this invention, new knowledge can be injected into the graph neural network without retraining the graph neural network model for drug toxicity classification, at a low cost. Attached Figure Description

[0008] Figure 1 This is a flowchart of the graph neural network knowledge editing method based on drug toxicity classification described in this invention.

[0009] Figure 2 This is a structural diagram of an embodiment of the present invention;

[0010] Figure 3 This is a schematic diagram of the graph neural network knowledge editing method based on drug toxicity classification described in this invention. Detailed Implementation

[0011] To make the objectives, technical solutions, features, and advantages of this invention clearer, the invention will be further described below with reference to the accompanying drawings and embodiments. It is obvious that the embodiments mentioned are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0012] This invention proposes a graph neural network knowledge editing method based on drug toxicity classification, the flowchart of which is shown below. Figure 1 The structural diagram is as follows Figure 3 Specifically, it includes the following steps:

[0013] Obtain the drug toxicity classification dataset to be processed.

[0014] Extract the graph subnetwork of the GNN for classifying chemical molecules; add masks to the neuron weights of the original graph neural network, take the chemical molecule graph dataset as input, use mutual information as the optimization objective, and obtain M as the importance of the neurons in the model in recognizing the chemical molecule graph dataset; based on the value of M, select the top K important neurons from the neurons of each layer, and retain these neurons as the graph subnetwork, denoted as M. C 图 ; during optimization, the loss will be By minimizing the size, a batch of graph subnets M representing knowledge of individual target class compounds is obtained. C 图 :

[0015]

[0016] Where l represents the measurement-prediction gap; Y represents the actual output; f represents the GNN model that classifies compounds in the drug molecule graph dataset; A represents the adjacency matrix; M represents the mask; and Θ represents the model parameters. To optimize losses.

[0017] Extract the subnetwork from the graph subnetwork that retains only the knowledge of drug structural features; further, M C 图 The subnets in the set are compared horizontally. Neurons in each layer that appear more than two-thirds of the number of subnets in the chemical molecular graph dataset are selected as neurons of the subnet at that layer. For example, if there are N graph subnets, a horizontal comparison is performed on each layer: if a neuron at a certain position in that layer appears in more than 2N / 3 graph subnets, that neuron is retained. This process is repeated layer by layer until the final subnet M representing the chemical molecular graph dataset is obtained. C ; indicates as:

[0018]

[0019] Where n is the number of chemical molecular diagrams of this type, σ (0≤σ≤1) is a hyperparameter used to control the screening intensity of neurons, and σ is preferably 0.6.

[0020] The subnets containing only the compound knowledge of drug structural features are screened and purified; the target subnets to be purified are obtained from the subnets. Will Compare with the remaining sub-networks extracted from the GNN. Perform element difference operations to filter out neurons that do not belong specifically to the target class; through purification operations, obtain a purified subnet that stores almost exclusively knowledge representing compounds of the target class; represented as:

[0021]

[0022] in, For the purified target class subnet; The target subnet is not purified; E is a 0, 1 matrix; This is the 0, 1 matrix of the purified target class subnet.

[0023] The parameters of the purified subnet are optimized; the target knowledge, i.e., a batch of graph structure data, is then analyzed. As input, each of the d class subnets is fed into, yielding d probability outputs corresponding to its respective class. These outputs are then concatenated into a d-dimensional vector, which serves as the probability output of the GNN model during the directional subnetting process in the fully connected layer. The probability outputs of the GNN model during the directional subnetting process are then compared with the expected probability output. The cross-entropy loss is calculated, and the parameters of the target subnet are optimized to directionally embed the chemical molecular structure knowledge to be embedded into the target subnet; this is represented as:

[0024]

[0025] Where N is the number of drug molecule structure diagrams containing the new knowledge embedded; Output the expected probability;

[0026] All of these are knowledge of the drug molecule structure to be embedded; Parameters for the target knowledge class subnet; It is a 0, 1 mask matrix; This refers to the cross-entropy loss between the probability output and the expected probability output of the GNN model during the targeted editing of the subnet.

[0027] Constraints are added to the optimization objective; graph data from non-target categories are input into the original GNN model to obtain graph embeddings. Global average pooling is performed on the graph embeddings of each category, and the pooled result is used as the embedding representing that category, called the pre-edit class embedding; the same method is used to calculate the class embeddings on the edited model, called the post-edit class embeddings; the Euclidean distance between the pre-edit and post-edit class embeddings is used as a constraint to prevent the model from forgetting non-target knowledge on a large scale during the editing process; expressed as:

[0028]

[0029] Where d is the number of non-target classes; The data is graph-structured; f represents the original model before editing, i.e., the original GNN model; f * The edited model; The Euclidean distance is the class embedding obtained before GNN editing and the class embedding obtained after GNN directional editing.

[0030] A plug-in optimization method is used to optimize the model. To alleviate the problem of excessive coupling between neurons, after performing E rounds of optimization on the target subnet for targeted editing, the parameters of the edited target subnet are obtained and merged into the original model. Then, S rounds of global optimization are performed on all parameters of the original model. The number of rounds for subnet optimization and global optimization is controlled by the hyperparameter σ. The objective function for global optimization is expressed as:

[0031]

[0032] Among them, f ′ This is the model after merging the subnet parameters; d represents the number of non-target classes. The cross-entropy loss between the probability output and the expected probability output of the GNN model during global editing; Let be the Euclidean distance between the class embeddings obtained before GNN editing and the class embeddings obtained after global GNN editing.

[0033] To obtain the final optimization objective

[0034]

[0035] Among them, α1, β1, α2, and β2 are all hyperparameters, ranging from 0 to 1, set by the user, and used to control the above. The optimization efforts.

[0036] The embodiments described above are only some embodiments of the present invention. Those skilled in the art will be able to conceive of various changes, modifications, substitutions and variations of the embodiments without departing from the principles and spirit of the present invention. The scope of protection of the present invention is defined by the appended claims and their equivalents, and all the above-mentioned behaviors should be covered within the scope of protection of the present invention.

Claims

1. A graph neural network knowledge editing method based on drug toxicity classification, characterized in that, include: Obtain the drug toxicity classification dataset to be processed; extract the graph subnetwork of the GNN for classifying chemical molecules; Extract subnetworks from the graph subnetworks that retain only drug structural feature knowledge; Screening and purification of subnets that retain only knowledge of drug structural characteristics; The process of screening and purifying the subnets that retain only drug structure feature knowledge includes: obtaining the target subnet to be purified from the subnets. ,Will Each with the other subnets Performing element-difference operations yields the purified subnet; represented as: in, For the purified target class subnet; For the unpurified target class subnet; It is a matrix of 0s and 1s; The 0, 1 matrix of the purified target subnet is given; the parameters of the purified subnet are optimized; constraints are added to the optimization objective; a plug-in optimization method is used to optimize the model to obtain the final optimization objective, completing the knowledge editing of the chemical molecular graph dataset; the plug-in optimization method includes performing E rounds of optimization on the optimization objective of the targeted editing of the target subnet to obtain the parameters of the edited target subnet, merging the parameters into the original model, and performing S rounds of global optimization on all parameters of the original model. The number of subnet optimization rounds E and the number of global optimization rounds S are controlled by the hyperparameter σ; the objective function of global optimization is expressed as: in, The number of drug molecule structure diagrams for embedding new knowledge; Output the expected probability; The model after merging subnet parameters; , All of these are knowledge of the drug molecule structure to be embedded; These are model parameters; The number of non-target classes; A GNN model for classifying compounds in a drug molecule graph dataset; The edited model; The cross-entropy loss between the probability output and the expected probability output of the GNN model during global editing; This represents the Euclidean distance between the class embeddings obtained before GNN editing and the class embeddings obtained after global GNN editing.

2. The graph neural network knowledge editing method based on drug toxicity classification according to claim 1, characterized in that, Extracting the graph subnetwork of a GNN for classifying chemical molecules involves adding masks to the neuron weights of the original graph neural network. Using a chemical molecular graph dataset as input and mutual information as the optimization objective, we obtain... The importance of neurons in the model recognizing chemical molecular graph datasets, according to The element value is selected from the neurons in each layer. There are 10 important neurons, and these neurons are preserved as a graph subnet, denoted as . .

3. The graph neural network knowledge editing method based on drug toxicity classification according to claim 1, characterized in that, The subnetworks in the extracted graph subnetwork that retain only drug structural feature knowledge include those from... Extracting subnets representing chemical molecular graph datasets ; indicates as: in, σ represents the number of molecular diagrams of this type; σ is a hyperparameter.

4. The graph neural network knowledge editing method based on drug toxicity classification according to claim 1, characterized in that, The optimization of the parameters of the purified subnet includes optimizing the graph structure data. As input, respectively input to In each subnet, obtain Each probability output corresponding to this class is concatenated into a single output. The dimension vector serves as the probability output of the GNN model during the directional subnetting process on the fully connected layer. The cross-entropy loss is calculated by comparing the probability output of the GNN model during the directional subnetting process with the expected probability output. The objective function is expressed as: in, The number of drug molecule structure diagrams for embedding new knowledge; Output the expected probability; A GNN model for classifying compounds in a drug molecule graph dataset; , All of these are knowledge of the drug molecule structure to be embedded; Parameters for the target knowledge class subnet; It is a 0, 1 mask matrix; This refers to the cross-entropy loss between the probability output and the expected probability output of the GNN model during the targeted editing of the subnet.

5. The graph neural network knowledge editing method based on drug toxicity classification according to claim 1, characterized in that, The constraints added to the optimization objective include: inputting graph data of non-target categories into the original GNN model to obtain graph embeddings, performing global average pooling on the graph embeddings of each category respectively, and using the pooling results as the pre-edited class embeddings; Calculate the class embeddings on the edited model to obtain the edited class embeddings; Calculate the Euclidean distance between the class embeddings before and after the edit, and use this Euclidean distance as a constraint for the optimization objective; expressed as: in, The number of non-target classes; A GNN model for classifying compounds in a drug molecule graph dataset; The edited model; The Euclidean distance is the class embedding obtained before GNN editing and the class embedding obtained after GNN directional editing.

6. The graph neural network knowledge editing method based on drug toxicity classification according to claim 1, characterized in that, The final optimization goal Represented as: in, , , , All of these are hyperparameters.

Citation Information

Patent Citations

  • Compound toxicity multi-task learning method based on graph isomorphic network

    CN118675656A

  • Prediction method and device for drug molecular feature attribute

    WO2022222492A1