Drug interaction prediction method based on dynamic substructure division and hierarchical feature fusion
By employing a dynamic substructure partitioning and hierarchical feature fusion method, an enhanced molecular graph is constructed and a hierarchical fragment embedding matrix is generated. This addresses the insufficient generalization ability of existing drug interaction prediction methods in new drug and complex combination scenarios, achieving efficient drug interaction prediction and interpretable results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-10
AI Technical Summary
Existing drug interaction prediction methods struggle to effectively capture complex nonlinear interactions between drugs and lack generalization ability in new drug or rare combination scenarios. Traditional methods rely on the quality of hand-crafted feature engineering, deep learning methods fail to explicitly characterize higher-order synergistic or antagonistic effects between drug pairs, and multi-source data fusion methods experience performance degradation when data is scarce.
We employ a method based on dynamic substructure partitioning and hierarchical feature fusion. We construct an enhanced molecular graph using the RDKit tool, use the METIS-XFrag algorithm to partition substructure fragments, and combine chemical bond energies and SMARTS patterns to verify the integrity of functional groups. We introduce graph attention networks and cross-attention networks to generate hierarchical fragment embedding matrices and construct a dynamic hypergraph for drug interaction prediction.
It significantly improves the accuracy and interpretability of drug interaction prediction, can adaptively adjust fragment segmentation, capture multi-scale chemical features, provide visualized and interpretable results, and improve the model's predictive performance in new drug and complex combination scenarios.
Smart Images

Figure CN121839183A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of drug action prediction technology, specifically to a drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion. Background Technology
[0002] Drug-drug interaction (DDI) refers to the phenomenon where the pharmacological effects or toxic side effects of two or more drugs are altered when used simultaneously or sequentially. This alteration may lead to enhanced or weakened drug efficacy, or it may produce new adverse reactions. Clinically, the harms of drug interactions are mainly manifested in three aspects: First, reduced efficacy; for example, the combined use of antibiotics and hepatic enzyme inducers can accelerate antibiotic metabolism, leading to decreased blood drug concentrations and treatment failure. Second, increased toxicity; for example, the combined use of warfarin and nonsteroidal anti-inflammatory drugs (NSAIDs) can significantly increase the risk of bleeding, which can be life-threatening in severe cases. Third, aggravated side effects, magnifying previously mild or insidious adverse reactions and affecting patient compliance and recovery progress.
[0003] Due to the complexity of drug interactions (DDIs), they are difficult to predict. Early DDI identification mainly relied on in vitro experiments and clinical observations. These methods were not only costly and time-consuming, but also difficult to cover a vast number of drug combinations. With the development of artificial intelligence technology, computational prediction methods based on machine learning have gradually become mainstream, mainly including three categories, each with obvious limitations. Traditional machine learning methods rely on manually extracted one-dimensional molecular descriptors (such as molecular weight, lipid-water partition coefficient) or two-dimensional similarity measures. These methods are highly dependent on the quality of feature engineering and are difficult to effectively capture the complex nonlinear interactions between drugs, limiting the model's expressive power and generalization performance. Secondly, although deep learning methods based on graph neural networks (GNNs) can directly process molecular graph structures and learn topological information, most models still encode each drug as an independent entity, failing to explicitly characterize the higher-order synergistic or antagonistic effects between drug pairs caused by shared chemical substructures. Furthermore, some graph partitioning strategies are prone to severing functional groups, impairing the integrity of chemical semantics. Multi-source data fusion methods integrate multi-dimensional biomedical information such as targets, pathways, and side effects to enhance drug characterization. However, their performance is highly dependent on the quality and coverage of external data. In new drug or rare combination scenarios, they face the bottleneck of data scarcity, and their generalization ability is significantly reduced. Summary of the Invention
[0004] Purpose of the invention: In order to solve the problems existing in the above-mentioned background technology, the present invention proposes a drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion.
[0005] Technical Solution: This invention discloses a drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion, comprising the following steps:
[0006] Step 1) Receive the drug SMILES sequence, calculate the physicochemical characteristics using the RDKit tool, and fuse the chemical structure information and physicochemical properties of the drug to construct an enhanced molecular map;
[0007] Step 2) Perform dynamic graph partitioning and boundary expansion on the enhanced molecular graph to generate chemically semantically complete substructure fragments; set edge weights based on chemical bond energies, use the METIS-XFrag algorithm to partition the initial fragments, expand the neighbors of the boundary atoms, verify the integrity of functional groups through SMARTS mode, and output the extended fragment set;
[0008] Step 3) Generate a hierarchical fragment embedding matrix through a two-stage fusion of "intra-fragment aggregation - inter-fragment interaction"; for each extended fragment, aggregate atomic features using a graph attention network, and learn global associations between fragments using 8-head cross attention to generate a 128-dimensional hierarchical fragment embedding matrix.
[0009] Step 4) Drug response The hierarchical segment embedding matrix is used to calculate the segment interaction weight matrix through a cross-attention network. The top-3 high-weight segment pairs are selected using a dynamic threshold τ learned during training. A weighted adaptive dynamic hypergraph is constructed, with the vertex set being the segment set of the two drugs and the hyperedge set being the selected interaction segment pairs.
[0010] Step 5) Based on the hyperedge weights of the dynamic hypergraph, global interaction features are extracted through a hypergraph neural network, drug interaction probabilities are predicted using a multilayer perceptron (MLP), and visually interpretable results are generated.
[0011] Furthermore, the specific steps for enhancing molecular map construction in step 1) include:
[0012] The RDKit tool was used to parse the drug's SMILES string into an initial molecular graph. Node set Includes atom type, valence, and formal charge characteristics, edge set Includes information on chemical bond types and bond energies; A represents the extracted drug.
[0013] The 21-dimensional physicochemical properties of drug molecules were calculated using the RDKit tool. A distance-weighted algorithm was then used to assign the molecular-level physicochemical features to each atomic node, resulting in atomic-level physicochemical feature vectors. ;
[0014] For each atomic node in the initial molecular diagram , structural feature vector With physicochemical eigenvectors By concatenating the features, a 38-dimensional bimodal atomic feature vector is obtained. The structural feature vector It includes atom type, valence encoding, and formal charge; it integrates the bimodal features of all atoms to construct an enhanced molecular map. ,in It is a set of bimodal features.
[0015] Furthermore, the specific steps of step 2) dynamic graph partitioning and boundary expansion include:
[0016] Enhanced molecular map Weights are set according to chemical bond type: single bond weight = 1, double bond weight = 2, triple bond weight = 3, aromatic bond weight = 1.5, preserving the topological structure;
[0017] The METIS-XFrag algorithm was used to divide the initial fragments. Satisfying the node number constraint The objective is to minimize the sum of the weights of cross-partition edges;
[0018] Add 1-hop direct neighbor nodes to the boundary atoms of the initial fragment (i.e., atoms with cross-fragment neighbors) to generate the extended fragment. If the expanded segments overlap, the original segments to which the atoms belong will be preserved.
[0019] The extended fragments are matched using the SMARTS pattern library, and the completeness rate of functional groups is calculated. If the completeness rate is ≥90%, the extended fragment set is output. Otherwise, readjust the partition parameters.
[0020] Furthermore, step 2) also includes detecting key functional groups using a chemosensing strategy and adaptively adjusting the boundary expansion strategy, specifically:
[0021] Functional groups are classified by priority: aromatic rings and conjugated systems are classified as category 1 with a weight of 3.0; carboxyl and amino groups are classified as category 2 with a weight of 2.0; hydroxyl and ester groups are classified as category 3 with a weight of 1.5; and single bonds and aliphatic chains are classified as the basic category with a weight of 1.0.
[0022] For Class I functional groups, a 2-hop neighbor expansion is performed with a radius ≤ 3 Å. For Class II functional groups, a 1-hop expansion is performed with a radius ≤ 2 Å. For Class III and below, a standard 1-hop expansion is used. The functional group integrity is calculated in real time during the expansion process, and the expansion is stopped immediately if it reaches 95%.
[0023] Furthermore, a chemical constraint optimization mechanism is introduced during the dynamic graph partitioning process to balance the cost of topological cutting with the integrity of chemical structure by minimizing the objective function: The partitioning parameters are dynamically adjusted based on the molecular scale. For edge weights, Indicates whether to cut the edge. This is a functional group integrity indicator function. This is the chemical constraint weighting coefficient, used to adjust the proportion of chemical integrity in the optimization.
[0024] Furthermore, step 3) involves the specific steps for generating the hierarchical fragment embedding matrix, including:
[0025] For the extended fragment in step 2 Extract the bimodal feature vectors of atoms and construct the feature matrix of fragment atoms. m is the number of atoms in the fragment;
[0026] Atom features are aggregated using the Graph Attention Network (GAT): for atoms Calculate with neighbors Attention weights;
[0027] Update atomic features to generate an atomic-level aggregated feature matrix for each fragment. ;right Average by column to generate initial fragment embeddings. ;
[0028] All segments Forming the initial matrix of global fragments An 8-head cross-attention algorithm is used to calculate segment interaction weights, multi-head features are concatenated, and linear transformation is applied. Generate final fragment embedding All fragments Composition of hierarchical fragment embedding matrix .
[0029] Furthermore, after obtaining the initial embedding at the fragment level... Subsequently, the semantic representation is enhanced by combining chemical type embedding, and a gating mechanism is introduced to adaptively fuse features, specifically:
[0030] Each fragment is chemically classified, including acidic, basic, and hydrophobic, to generate chemical type embeddings. Initial embedding of fused fragments via gating mechanism and Output Enhanced Fragment Embedding ;
[0031] Optimization using dual-gated networks , The first layer of the dual-gated network: balancing local features within a segment. Global interaction features between fragments First, fused features are generated; second-layer gating: feature weights are refined through a scale-adaptive mechanism, and the output is stabilized through residual connections and layer normalization. , To stabilize output characteristics, This is a fusion feature of dual-gated networks. The residual features are input features, which are augmented fragment embeddings. , For layer normalization operation;
[0032] A three-level feature pyramid is constructed to capture multi-scale structural information, and the final projection is a 128-dimensional hierarchical fragment embedding matrix.
[0033] Furthermore, the specific steps for generating the cross-attention dynamic hypergraph in step 4) include:
[0034] Receiving drug pairs Hierarchical fragment embedding matrix of drug A Hierarchical fragment embedding matrix of drug B L represents the number of fragments of drug B, and K represents the number of fragments of drug A;
[0035] The fragment interaction weight matrix is calculated using an 8-head cross-attention network. The average of the multiple positions is taken as the final weight;
[0036] Dynamic threshold learned through training Filter the top-3 high-weighted segment pairs and construct hyperedges. Let represent the core fragment interaction unit between drug A and drug B, and calculate the hyperedge weights: , Indicates drug A The fragment and drug B The interaction intensity of each segment;
[0037] Constructing dynamic hypergraphs , where vertex set , For an extended fragment set of drug A, The extended fragment set, hyperedge set of drug B It consists of constructed hyperedges, each hyperedge connecting one segment of drug A to three segments of drug B.
[0038] Furthermore, step 5) of predicting drug-drug interactions includes the following specific steps:
[0039] Based on the hyperedge weights of dynamic hypergraphs, vertex representations are learned through a hypergraph convolutional network (HGNN) and input into a fully connected layer to predict drug interaction probabilities. The fragment interaction weight matrix is then used. Perform Softmax normalization, draw a heatmap with drug A fragments as rows and drug B fragments as columns, label the top-3 high-weight fragment pairs and their weight values, highlight the atomic positions corresponding to the top-3 fragment pairs in the molecular structure diagrams of drugs A and B, connect interactive fragments with arrows and label the interaction type, extract the weight values of the top-10 fragment pairs, and calculate the percentage contribution of each fragment pair.
[0040] Furthermore, the visually interpretable results in step 5) also include interaction mechanism analysis:
[0041] Based on fragment interaction weights and chemical types, the potential mechanisms of drug interactions are automatically inferred, including hydrogen bonding, hydrophobic interactions, and π-π stacking. The output provides a text description explaining the corresponding chemical interaction types of the top-3 fragments and their contributions to the interaction.
[0042] The beneficial effects of this invention are:
[0043] 1. This invention constructs a 38-dimensional dual-modal atomic-level feature representation by integrating the structural features of drug SMILES with the physicochemical features of RDKit (such as molecular weight, number of hydrogen bonds, TPSA, etc.), overcoming the limitation of traditional methods that rely on only a single feature source; combined with the METIS dynamic partitioning algorithm and the 1-hop boundary expansion strategy, it ensures that the integrity rate of functional groups such as carboxyl groups and benzene rings is ≥90%, avoiding the chemical semantic fragmentation problem caused by fixed segmentation methods, enabling the model to more accurately capture the multi-dimensional chemical information of drug molecules.
[0044] 2. This invention embeds the principle of chemical bond energy (single bond = 1, double bond = 2, triple bond = 3, aromatic bond = 1.5) into the partition weights of the METIS diagram, prioritizing the severing of weakly interacting chemical bonds; it verifies the integrity of functional groups through the SMARTS pattern library and introduces a chemical constraint optimization mechanism to make the substructure partitioning process of the model conform to chemical laws, significantly improving the chemical rationality of fragment partitioning.
[0045] 3. By introducing a chemical sensing strategy and a functional group priority mechanism (weight 3.0 for Class I functional groups, 2.0 for Class II, and 1.5 for Class III), the model not only follows the topological structure during the partitioning process, but is also guided to a solution space that conforms to chemical semantics. When faced with novel drug molecules or complex functional group combinations that have not appeared in the training data, this strategy can adaptively adjust the expansion range (2-hop for Class I and 1-hop for Class II), avoiding the generation of fragment partitioning results that violate chemical common sense.
[0046] 4. The hierarchical FR block proposed in this invention adaptively models multi-scale chemical features from the atomic level to the fragment level and then to the molecular level through intra-fragment GAT aggregation (capturing local chemical bond interactions) and inter-fragment 8-head cross attention (aggregating global structural information); the dynamic hypergraph construction module calculates fine-grained fragment interactions through cross attention weight matrix, while capturing interaction modes at different spatial scales such as local functional group interactions and global molecular synergistic effects.
[0047] 5. The dynamic hypergraph construction method proposed in this invention dynamically selects the top-3 high-weight fragment pairs through an adaptive threshold τ learned during training, and constructs personalized hypergraph structures according to the specific interaction patterns of different drug pairs. Combined with a gating mechanism, it adaptively fuses intra-fragment and inter-fragment features, and the feature pyramid captures multi-scale information. This dynamic characteristic enables the model to flexibly adjust to the chemical properties of different drug pairs, and its predictions are more in line with the actual interaction mechanisms, which is superior to traditional hypergraph methods based on static hyperedge weights.
[0048] 6. The cross-attention dynamic hypergraph construction framework proposed in this invention uses the modeling idea of drug molecule fragments as hypergraph vertices and fragment interactions as hyperedges. It is not only applicable to drug interaction prediction, but also provides a transferable technical solution for other fields involving complex intermolecular interactions.
[0049] 7. This invention provides a complete interpretable traceability from fragment interaction weight matrix to molecular structure and then to chemical action mechanism; through multimodal interpretation methods such as heatmap visualization of fragment interaction intensity, highlighting key functional groups on molecular structure, and quantifying relative contribution, it facilitates pharmaceutical researchers to verify and understand the basis of model decision-making, and significantly improves the credibility and practicality of deep learning models in the field of drug development. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to the present invention.
[0051] Figure 2 This is a schematic diagram of the single-layer hierarchical feature fusion FR block structure of the present invention;
[0052] Figure 3 This is a schematic diagram of the cross-attention mechanism of the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] like Figure 1 As shown, this invention discloses a drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion, comprising the following steps:
[0055] Step 1: Multimodal molecular feature extraction and fusion
[0056] This step aims to integrate the chemical structure information and physicochemical properties of the drug to construct an enhanced molecular graph representation containing multi-dimensional information, providing "structure + physicochemical" dual-modal atomic-level features for subsequent modules.
[0057] S11. Molecular structure extraction
[0058] The RDKit tool was used to convert the SMILES strings of drugs into molecular graph structures. Taking the drugs aspirin (SMILES: CC(=O)Oc1ccccc1C(=O)O) and warfarin (SMILES: O=C1C(Cc2ccccc2)=C(O)c3ccccc3C1=O) from the TWOSIDES database, the SMILES strings were first parsed into molecular objects using the RDKit's Chem.MolecularFromSmiles() function. Then, their topological structures were extracted, and an initial molecular graph was defined. .
[0059] in, Let A be the set of nodes for drug A, and each node... It corresponds to an atom in the drug molecule (such as C, O, N, etc.). Let A be the set of chemical bond edges of drug A, and each edge... It represents the chemical bonds between atoms (such as single bonds, double bonds, triple bonds, and aromatic bonds).
[0060] S12. Calculation and mapping of physicochemical properties
[0061] The physicochemical properties of drug molecules are calculated and mapped using the Descriptors module of RDKit.
[0062] First, 21 physicochemical properties related to drug interactions (including molecular weight, number of hydrogen bond donors, number of hydrogen bond acceptors, topological polar surface area, lipid-water partition coefficient, etc.) were selected to form a molecular-level physicochemical feature vector. (Taking aspirin as an example,) Subsequently, a distance-weighted strategy was used to assign molecular-level features to each atom, resulting in atomic-level physicochemical feature vectors. The calculation formula is: Among them, the distance weighting coefficient Defined as: , For atoms With atoms The shortest path distance in the molecular diagram (e.g., the distance between the carboxyl oxygen atom and the adjacent carbon atom in aspirin is 1), distance decay parameter (Default value) Controls the influence range of neighboring atoms. At this point, neighboring atoms within a 3-bond range (d≤3) of the target atom contribute over 70% of the physicochemical characteristics, ensuring that local functional group effects dominate the physicochemical features (such as the strong polarity of carboxyl oxygen). This strategy allows atomic physicochemical features to simultaneously encompass global molecular properties (such as molecular weight) and local proximity effects (such as the strong polarity of carboxyl oxygen atoms), solving the problem that traditional physicochemical features cannot reflect the local atomic environment. This has been validated using the aspirin case: when At that time, the hydrogen bond acceptor weight of the carboxyl oxygen atom was 0.82 (significant value).
[0063] S13. Dual-modal feature fusion
[0064] The molecular diagram structural features from step S11 are combined with the atomic-level physicochemical features from step S12 to generate an enhanced molecular diagram. For each atom in the molecular diagram... Its structural feature vector With physicochemical eigenvectors By concatenating the vectors, we obtain the bimodal atomic feature vectors: .
[0065] in, This indicates a vector concatenation operation, after which the feature dimension is 17 + 21 = 38 (i.e., ... The fusion features of the carboxyl oxygen atom in aspirin include both structural and physicochemical components, comprehensively characterizing its chemical properties. The set of bimodal features of all atoms constitutes a feature matrix. Finally, an enhanced molecular map is constructed: In the formula, For a set of atomic nodes, For edge set, It is a dual-modal feature set (integrating structural and physicochemical information).
[0066] Step S2: Dynamic Substructure Partitioning
[0067] This step generates chemically semantically complete substructure fragments through dynamic graph partitioning and boundary expansion, ensuring that key functional groups (such as carboxyl, amino, and benzene rings) are not fragmented.
[0068] S21. Molecular diagram preprocessing
[0069] Extraction of enhanced molecular maps Topology (node set) and edge set Ignoring atomic features, edge weights are set based on chemical bond type. This reflects the relative strength of the bond. Single bond: Double bond: (Double bonds have approximately twice the energy of single bonds); Triple bonds: Aromatic bond: This bond energy-based weighting ensures that strongly interacting chemical bonds (such as double and triple bonds) are not easily broken during partitioning, thus protecting the integrity of key functional groups. In aspirin, the C=O double bond weight of the carboxyl group is 2.0, and the aromatic bond weight of the benzene ring is 1.5, ensuring that strong chemical bonds are protected during partitioning.
[0070] S22.METIS-XFrag dynamic partitioning uses the METIS-XFrag algorithm to divide the initial substructure segments.
[0071] To avoid fragments being too large or too small (such as single-atom fragments), the atomic number balance constraint must be met: Subject to: .
[0072] in, It is a cross-partition edge set (i.e., a set of chemical bonds that have been broken). Let k be the set of nodes in the k-th partition. As an imbalance factor, a 5% difference in the number of nodes is allowed between partitions. The target number of partitions is calculated using the following formula: (Based on the average number of atoms in the functional groups of organic chemistry, each fragment is assumed to contain approximately 5 atoms).
[0073] By minimizing the sum of cross-partition edge weights (For all cut edges) METIS-XFrag preferentially cuts weakly interacting chemical bonds (such as single bonds) while avoiding cutting strongly interacting chemical bonds (such as double and triple bonds), thereby initially protecting the functional group structure at the topological level.
[0074] When partitioning, set constraints: each fragment contains approximately 5 atoms, which is a reasonable setting based on the average size of organic functional groups. The output result is the initial fragment set.
[0075] In this embodiment, the dynamic partitioning of the aspirin molecule (21 atoms) and the total number of atoms... Target partition settings Imbalance factor The partitioning results are as follows:
[0076] : Benzene ring (7 carbon atoms + 1 oxygen atom)
[0077] ⁾: Carboxyl group (1 carbon atom + 2 oxygen atoms)
[0078] ⁾: Ester group (2 carbon atoms + 2 oxygen atoms)
[0079] ⁾: Methyl group (1 carbon atom + 3 hydrogen atoms)
[0080] The initial fragment set is denoted as ,in , (There is no overlap between the segments).
[0081] S23. Boundary extension repair of functional group integrity
[0082] Because METIS-XFrag partitions based solely on topological structure, some functional groups may be fragmented (e.g., the C=O double bond and OH single bond of a carboxyl group belong to different segments). To address this issue, a 1-hop neighbor expansion is performed on the boundary atoms of the initial segments:
[0083] Identify boundary atoms adjacent to other fragments in the initial fragment, add their direct neighbor atoms to the original fragment, and adopt different expansion strategies according to the importance of functional groups:
[0084] The aromatic ring / conjugated system employs extended 2-hop neighbors (radius ≤ 3 Å) to ensure the integrity of the large π-bond system; the carboxyl / amino groups employ extended 1-hop neighbors (radius ≤ 2 Å) to ensure the structure of the basic functional groups.
[0085] For example, in the aspirin molecule, the carboxyl group segment expands the adjacent benzene ring carbon atom, keeping the carboxyl structure intact. If atomic overlap occurs after expansion (i.e., the same atom is contained in multiple segments), the original segment to which it belongs is retained, avoiding classification conflicts.
[0086] (1) For each initial segment traverse all its nodes If node at least one neighboring node If the neighbor belongs to another segment, then mark it. These are boundary atoms.
[0087] (2) For each boundary atom Set all its 1-hop direct neighbor nodes Add to current segment , to obtain extended fragment :
[0088]
[0089] in, for The boundary set of atoms.
[0090] (3) If fragment overlap occurs after expansion (i.e., the same atom is contained in multiple fragments), the following rules shall be used to resolve the conflict:
[0091] Retain atoms The original initial fragment ( The "mother fragment"), only Added to other fragments as "shared atoms", but Feature updates are still dominated by the mother segment.
[0092] For the initial fragment of aspirin, after boundary expansion: The benzene ring is extended by one carbon atom (the carbonyl carbon of the ester group) to ensure the integrity of the CO ester bond. The carboxyl group is extended by one carbon atom (the carbon atom attached to the benzene ring) to ensure the integrity of the C-COOH structure. The ester group is extended by two atoms (the oxygen atom of the benzene ring and the carbon atom of the methyl group) to ensure the complete ester group structure. The methyl group does not need to be extended (it is already a complete -CH3 structure), and the extended fragment set is denoted as... .
[0093] S24. Functional group integrity check
[0094] To ensure that the expanded fragments have chemical significance, the structural rules of key functional groups are first precisely defined using the SMARTS chemical language.
[0095] (1) Use SMARTS chemical language to precisely define the key functional groups that need to be retained, including: carboxyl, amino, hydroxyl, etc.
[0096] Then, RDKit is called to perform substructure matching on each extended fragment, strictly verifying the atom type, bond order, and topological connection relationship (e.g., the aspirin carboxyl fragment is successfully matched).
[0097] (2) Use the Chem.MolFromSmarts() function of RDKit to convert the SMARTS pattern into a query molecule, and then for each extended fragment Perform substructure matching:
[0098]
[0099] in, For fragments The corresponding RDKit molecule object, The query molecule object for the functional group.
[0100] Next, calculate the functional group integrity rate: Quantitatively assess the overall chemical integrity.
[0101] Finally, a dynamic decision is made based on a threshold. If the integrity rate is ≥90%, the fragment set is output; if it is below the threshold, the partition imbalance factor is automatically increased to 1.10 and the target number of partitions is reduced, triggering the METIS repartitioning process. This process forms a closed-loop verification mechanism to ensure that all output fragments contain complete chemical functional groups.
[0102] In this embodiment, the extended fragment set of aspirin was verified, and four functional groups (one carboxyl group, one ester group, one benzene ring, and one methyl group) were detected, with all four groups being complete matches, achieving a completeness rate of [missing information]. The verification passed.
[0103] S25. Chemical Constraint Optimization
[0104] The process stops immediately upon reaching the ideal integrity rate to avoid over-segmentation; simultaneously, a chemical constraint objective function is introduced into the METIS partitioning algorithm. Finally, the fragment size and λ value are dynamically adjusted based on molecular scale. For example, after optimization, the probability of benzene ring (a type of functional group) fragmentation in aspirin (a small molecule) decreased from 25% to 0.05%, effectively preserving the structure of key functional groups (such as large π bonds). and This represents the two end atoms of the edge in the molecular diagram (i.e., the two atomic nodes connected by chemical bonds). For edge weights, Indicates whether to cut the edge. This is a functional group integrity indicator function. This is the chemical constraint weighting coefficient, used to adjust the proportion of chemical integrity in the optimization.
[0105] Step S3: Hierarchical fragment feature fusion
[0106] like Figure 2 The diagram shows the structure of a single-layer FR block. This step uses a hierarchical design of "local aggregation within fragments + global interaction between fragments" to stack multiple FR blocks, abstracting the atomic features of the extended fragment set into a high-dimensional embedding that combines local chemical bonding and global fragment association.
[0107] S31. Initialization of intra-fragment atomic features
[0108] For extended fragment sets Each segment The atomic features contained therein are extracted as initial input. The features of each atom come from the bimodal atomic feature vector output in step S1, and the fragment is then processed. The atomic features are represented as a matrix ( For fragments The number of atoms). Among them, the benzene ring fragment of aspirin ( The initial characteristic matrix of 8 atoms It contains the structural features and physicochemical information of each carbon atom.
[0109] S32. Intra-fragment atomic-level feature aggregation (GAT layer)
[0110] Each fragment is aggregated at the atomic level using a graph attention network (GAT) to learn local chemical bonding interactions (such as the conjugation effect of benzene rings and hydrogen bonds of carboxyl groups).
[0111] First, atomic features are aggregated for each extended fragment to learn chemical bonding interactions. Based on atomic features (structure + physicochemical information) and molecular diagram connectivity, interatomic attention weights are calculated: for atoms within the fragment... and his neighbors Through learnable transformation matrices and attention parameters Calculate weights This reflects the strength of chemical bonds (e.g., carbon atoms in a benzene ring gain higher weights due to conjugation).
[0112]
[0113] in, , For atoms To his neighbors Attention weights, representing Features The degree of contribution of the features, , Atoms , The dual-modal eigenvectors For attention parameter vectors, .
[0114] Next, the atomic features are updated by weighted summation to generate a 64-dimensional atomic aggregate feature matrix. .
[0115] In this embodiment, the carbon atoms of the aspirin benzene ring are polymerized by GAT, thus incorporating the aromaticity and electronic delocalization effect of adjacent carbon atoms.
[0116] S33. Fragment-level initial embedding generation
[0117] Atomic characteristics of GAT after polymerization Compression is performed, and global average pooling is used to generate initial embeddings at the fragment level. The atomic feature matrix of each fragment is averaged column-wise to obtain a 64-dimensional embedding vector. Abstracting local chemical bond features (such as hydrogen bonding of carboxyl groups). All fragments are embedded to form a 64-dimensional initial matrix. .
[0118] For each of the four segments of aspirin (benzene ring, carboxyl group, ester group, and methyl group), an embedding vector characterizing its chemical properties is generated.
[0119] S34. Global Interaction Between Segments (Multi-head Cross-attention)
[0120] like Figure 3 As shown, a multi-head cross-attention mechanism is used to perform global interaction on the initial embedding of segments, learning the correlations between different segments (such as the synergistic effect between functional groups, spatial proximity, etc.). The core idea of cross-attention is to make each segment "attention" all other segments, calculate the correlation weights between segments, and thus achieve global information exchange.
[0121] Inter-segment interaction is achieved through 8-head cross-attention. First, the attention weights between segments are calculated. (Reflecting on fragments) For fragments (The degree of dependence). Then, the 64-dimensional segment embedding is split into 8 heads (8 dimensions each), the interaction features are calculated independently, and the spliced parts are then projected into the output. Compressed into 128-dimensional final embedding Adding residual connections and layer normalization ensures stability and enables fragment embedding to fuse local and global information. Specifically, the embedding of the aspirin benzene ring incorporates the polarity information of the carboxyl group, enhancing the representation of functional group synergy.
[0122] S35. Hierarchical Fragment Embedding Matrix Output
[0123] The final 128-dimensional embedding combining all segments: Each fragment embedding simultaneously encodes local chemical bonding interactions (from GAT aggregation, such as aromatic conjugation of the benzene ring) and global fragment associations (from cross-attention, such as spatial proximity of the benzene ring and carboxyl group), forming a high-dimensional semantic feature matrix required for drug interaction prediction. In the aspirin output matrix, the carboxyl group embedding includes hydrogen bonding interactions (local) and electronic effects of the benzene ring (global).
[0124] S36. Introduce “fragment-level initial embedding + chemical type embedding + gating mechanism fusion”, classify each fragment by chemical type (such as acid, basic, hydrophobic, etc.), and fuse chemical type embedding with fragment initial embedding through gating mechanism.
[0125] The chemical type gate value is calculated as follows: By using a weighted fusion of two types of features based on gate values, the enhanced fragment embedding is obtained: .
[0126] Next, a dual-gated network is used to further optimize the feature representation. The first layer gates balance local features within the segment. Global interaction features between fragments Generate fusion representation The second-layer gating refines feature weights through a scale-adaptive mechanism. Finally, the output is stabilized through residual connections and layer normalization. , To stabilize output characteristics, This is a fusion feature of dual-gated networks. The residual features are input features, which are augmented fragment embeddings. , This is a layer normalization operation.
[0127] A three-level feature pyramid is constructed to capture multi-scale structural information, and the multi-scale features are unified into a 128-dimensional output through splicing and projection.
[0128] Step S4: Dynamic Hypergraph Construction
[0129] This step generates an adaptive dynamic hypergraph for drug pairs through cross-attention and dynamic thresholding. To quantify the interaction patterns of functional groups among drugs.
[0130] S41. Drug Pair Fragment Embedding Input
[0131] Input the drug pair to be predicted Hierarchical fragment embedding matrix:
[0132] Extended fragment set of drug A The corresponding embedding matrix is (K is the number of fragments of drug A. Each row corresponds to a 128-dimensional feature of a fragment, encoding the local chemical bonding interactions of the fragment and their association with the global fragment.)
[0133] Extended fragment set of drug B The corresponding embedding matrix is (L represents the number of fragments of drug B, with the characteristic meaning being...) Consistent).
[0134] For example, in a drug pair (aspirin, warfarin), aspirin has K=4 (the fragment consists of a benzene ring, carboxyl group, ester group, and methyl group), and its embedding matrix... Warfarin's L=5 (fragment consisting of a coumarin ring, a benzene ring, a hydroxyl group, a ketone group, and an isopropyl group), its embedding matrix... .
[0135] S42. Calculation of Inter-segment Interaction Weights
[0136] Quantifying the inter-fragment interaction strength (such as hydrogen bonding, hydrophobic interactions, etc.) of drug A and drug B using a multi-head cross-attention network: First, for and Linear projection is performed to obtain a query (Q), key (K), and value (V) matrix (used to capture semantic relationships between segments); then, Q, K, and V are split into multiple independent attention heads, and each head calculates the inter-segment weights through scaled dot product attention; finally, the outputs of multiple heads are averaged to obtain the inter-segment interaction weight matrix. ,in Indicates drug A The fragment and drug B The interaction strength of each fragment (the higher the value, the higher the probability of interaction). For example, the weight of aspirin carboxyl group to warfarin hydroxyl group is 0.85 (suggesting hydrogen bonding), and the weight of aspirin methyl group to warfarin isopropyl group is 0.72 (suggesting hydrophobic interaction).
[0137] S43. Dynamic threshold filtering of core fragment pairs
[0138] from Select core fragment pairs (those that contribute the most to DDI) from the fragment pairs.
[0139] First, train an adaptive threshold. ( For learnable parameters, (Using the sigmoid function, the threshold is mapped to the (0, 1) interval to achieve adaptive adjustment); then, for each fragment of drug A... ,filter Strongly interactive fragment pairs were identified, and drug fragment B with the highest Top-3 interaction weights was selected. Then, construct the hyperedge. (Connect one segment of drug A with three strongly interacting segments of drug B to reflect the collaborative interaction of functional groups), and calculate the hyperedge weight (take the average of the weights of the top-3 segments to reflect the overall interaction strength of the hyperedge).
[0140] in, This represents the filtering criteria for strongly interactive fragment pairs, specifically fragments from drug A. Fragment of drug B The interaction intensity exceeds the adaptive threshold.
[0141] For example, the carboxyl group of aspirin ( The strong interaction fragment of warfarin is the hydroxyl group () , ), ketone group ( , ), benzene ring ( , ), constructing hyperedges (The warfarin fragment index has been adjusted to 5-9) The weight of the superedge is (0.85+0.70+0.65) / 3=0.73.
[0142] S44. Dynamic Hypergraph Construction
[0143] Constructing a dynamic hypergraph, vertex set It contains K segments of drug A and L segments of drug B (with a total of K+L vertices, indices from 1 to K+L); hyperedge set The edge weight set consists of the superedges selected in step S43 (each superedge connects one segment of drug A to three strongly interacting segments of drug B); The weight of the corresponding hyperedge ( (Ensure strong interaction).
[0144] For example, in the hypergraph of aspirin and warfarin, the vertex set is... (Aspirin segments 1–4, warfarin segments 5–9), the hyperedge set is ( Aspirin's carboxyl group and warfarin's hydroxyl, ketone, and benzene ring; (Aspirin methyl and warfarin isopropyl, coumarin ring, benzene ring), edge weight set is (all greater than) ).
[0145] Step S5: Drug Interaction Prediction
[0146] Based on dynamic hypergraph Global interaction features are extracted using a hypergraph neural network (HGNN), and drug interactions are predicted using a multilayer perceptron (MLP).
[0147] S51. Hypergraph Feature Extraction
[0148] First, construct the hypergraph association matrix. Define the membership relationship between a vertex and a hyperedge (when a vertex belongs to a hyperedge). ), calculate the vertex degree matrix (The diagonal elements are the sum of the weights of the hyperedges in which the vertices participate) and the hyperedge degree matrix (The diagonal elements represent the number of vertices contained in the hyperedge). Generate the Laplacian matrix of the hypergraph. Then, the vertex features are updated through a 3-layer feature propagation: Initial features Embedding a splicing matrix into 128-dimensional fragments of drugs A / B, and outputting the result after 3 iterations. It captures high-order interaction features between fragments (such as the synergistic effect of hydrogen bonding between carboxyl and hydroxyl groups).
[0149] in, For the hypergraph Laplacian matrix, For the hypergraph incidence matrix, It is the identity matrix. Let be the vertex degree matrix. It is the hypermarginality matrix. This is a diagonal matrix with hyperedge weights. The convolution parameter matrix is a learnable matrix. , which is the iteration number of the 3-layer convolution.
[0150] S52. Drug-based global feature generation
[0151] feature matrix Separation is characteristic of drug A (forward (line) and characteristics of drug B (back (Okay). Global max pooling is used to extract key drug-grade features: , Where max is the element-wise maximum value operation, generating a 128-dimensional feature vector. (Global characteristics of drug A) (Global characteristics of drug B).
[0152] Next, the global features of drug A and drug B are concatenated to generate a drug pair feature vector: It integrates similarities and differences.
[0153] Among them, difference features Capturing differences between drugs This represents the element-wise product (Hadamard product), used to capture drug similarity. This represents vector concatenation. This is a difference feature (capturing drug differences). This is for element-wise product (to capture drug similarity).
[0154] S53. Interaction Probability Prediction
[0155] The DDI prediction probability is output through a multilayer perceptron (MLP). Drug pair features are then used. Input a three-layer fully connected neural network (MLP) to predict the probability of drug interactions.
[0156] MLP structure:
[0157] ,
[0158] ,
[0159] ,
[0160] in, Let W1 be the global feature vector of the drug pair, W2 and W3 be the weight matrices of each layer of the MLP, b1, b2 and b3 be the bias vectors of each layer of the MLP, and h1 and h2 be the input features of the hidden layers of the MLP. Dropout is used to predict drug interaction probabilities and as a regularization technique to prevent overfitting. The output... This represents the predicted probability of drug interactions. An interaction was determined to exist.
[0161] After the characteristic inputs of aspirin and warfarin are given, the MLP output is... The study determined that there was a high-risk interaction.
[0162] The model employs weighted binary cross-entropy optimization to balance positive and negative samples. .
[0163] Where N is the total number of drug pairs, For real labels, (Balanced sample) Predict probabilities for the model
[0164] The interaction weight matrix obtained in step S4 ( Indicates drug A The fragment and drug B The interaction intensity of each segment is normalized using Softmax: .
[0165] in, It has the following property: the sum of all its elements is 1. ), each element This indicates the relative contribution of the segment to the model's prediction of high risk. The original interaction weight matrix obtained in step S4 is shown, where K is the number of fragments of drug A and L is the number of fragments of drug B. It is an exponential function. , The index of the target fragment pair (fixed). , The variable (change) is used to sum all pairs of segments.
[0166] For example, using the drug interactions with aspirin, warfarin, and the original interaction matrix. (aspirin A fragment, warfarin After Softmax normalization, the fragments are obtained .
[0167] Normalized matrix Verify the normalization results.
[0168] Step S54: Interpretability Output
[0169] Based on the interaction weight matrix By combining drug molecular structure with multimodal visualization and mechanism analysis, intuitive and interpretable results are generated, clearly demonstrating the core driving factors and potential mechanisms of drug interactions.
[0170] First, draw a fragment interaction heatmap: construct a heatmap with K functional group fragments of drug A as rows and L functional group fragments of drug B as columns, with color depth corresponding to... The value is directly proportional to the value (the larger the value, the greater the contribution of the fragment pair); mark the top-3 high-weight fragment pairs in the figure (such as the carboxyl fragment of aspirin). With warfarin's hydroxyl fragment ), and clarify the core driving factors of model decision-making.
[0171] Next, molecular structure annotation is performed. The indexes of the top-3 fragment pairs (e.g., the index of drug A's top-3 fragment pairs) are then used. The fragment, the first of drug B Each fragment is mapped back to the original molecular structure (converted from the SMILES string), locating specific atomic positions (e.g., the carboxyl group of aspirin corresponds to the atomic group {C7,O8,O9,H10}, and the hydroxyl group of warfarin corresponds to the atomic group {C15,O16,H17}). In the molecular structure diagrams of drugs A and B, the atoms corresponding to these fragments are highlighted, and arrows connect the interacting fragment pairs. The interaction type between them is marked according to the physicochemical properties of the fragments, visually demonstrating the spatial position and chemical properties of the interaction.
[0172] Finally, calculate the contribution of each fragment: by The values are sorted in descending order, and the top-10 high-weight fragment pairs are extracted. The relative contribution of each fragment pair (reflecting its proportion of influence on drug interaction) is calculated using the following formula: .(in, Indicates Top-10 segment pairs The sum of (This represents a single fragment pair. For example, the contribution of the carboxyl group in aspirin to the hydroxyl group in warfarin is...) The contributions of aspirin methyl and warfarin isopropyl are: The two drugs together contribute 48.3%, which is the core driving factor for the model's prediction of high risk. The carboxyl group of aspirin and the hydroxyl group of warfarin are key action sites. There is a high-risk drug interaction when aspirin and warfarin are used together (model prediction probability 0.92).
[0173] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion, characterized in that: The steps include the following: Step 1) Receive the drug SMILES sequence, calculate the physicochemical characteristics using the RDKit tool, and fuse the chemical structure information and physicochemical properties of the drug to construct an enhanced molecular map; Step 2) Perform dynamic graph partitioning and boundary expansion on the enhanced molecular graph to generate chemically semantically complete substructure fragments; set edge weights based on chemical bond energies, use the METIS-XFrag algorithm to partition the initial fragments, expand the neighbors of the boundary atoms, verify the integrity of functional groups through SMARTS mode, and output the extended fragment set; Step 3) Generate a hierarchical fragment embedding matrix through a two-stage fusion of "intra-fragment aggregation - inter-fragment interaction"; for each extended fragment, aggregate atomic features using a graph attention network, and learn global associations between fragments using 8-head cross attention to generate a 128-dimensional hierarchical fragment embedding matrix. Step 4) Drug response The hierarchical segment embedding matrix is used to calculate the segment interaction weight matrix through a cross-attention network. The top-3 high-weight segment pairs are selected using a dynamic threshold τ learned during training. A weighted adaptive dynamic hypergraph is constructed, with the vertex set being the segment set of the two drugs and the hyperedge set being the selected interaction segment pairs. Step 5) Based on the hyperedge weights of the dynamic hypergraph, global interaction features are extracted through a hypergraph neural network, and the drug interaction probability is predicted using a multilayer perceptron (MLP), generating visually interpretable results.
2. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1, characterized in that, The specific steps in enhancing molecular map construction in step 1) include: The RDKit tool was used to parse the drug's SMILES string into an initial molecular graph. Node set Includes atom type, valence, and formal charge characteristics, edge set Includes information on chemical bond types and bond energies; A represents the extracted drug. The 21-dimensional physicochemical properties of drug molecules were calculated using the RDKit tool. A distance-weighted algorithm was then used to assign the molecular-level physicochemical features to each atomic node, resulting in atomic-level physicochemical feature vectors. ; For each atomic node in the initial molecular diagram , structural feature vector With physicochemical eigenvectors By concatenating the features, a 38-dimensional bimodal atomic feature vector is obtained. The structural feature vector It includes atom type, valence encoding, and formal charge; it integrates the bimodal features of all atoms to construct an enhanced molecular map. ,in It is a set of bimodal features.
3. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1, characterized in that, The specific steps of step 2) dynamic graph partitioning and boundary expansion include: Enhanced molecular map Weights are set according to chemical bond type: single bond weight = 1, double bond weight = 2, triple bond weight = 3, aromatic bond weight = 1.5, preserving the topological structure; The METIS-XFrag algorithm was used to divide the initial fragments. Satisfying the node number constraint The objective is to minimize the sum of the weights of cross-partition edges; Add 1-hop direct neighbor nodes to the boundary atoms of the initial fragment (i.e., atoms with cross-fragment neighbors) to generate the extended fragment. If the expanded segments overlap, the original segments to which the atoms belong will be preserved. The extended fragments are matched using the SMARTS pattern library, and the completeness rate of functional groups is calculated. If the completeness rate is ≥90%, the extended fragment set is output. Otherwise, readjust the partition parameters.
4. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1 or 3, characterized in that, Step 2) further includes detecting key functional groups using a chemosensing strategy and adaptively adjusting the boundary expansion strategy, specifically: Functional groups are classified by priority: aromatic rings and conjugated systems are classified as category 1 with a weight of 3.0; carboxyl and amino groups are classified as category 2 with a weight of 2.0; hydroxyl and ester groups are classified as category 3 with a weight of 1.5; and single bonds and aliphatic chains are classified as the basic category with a weight of 1.
0. For Class I functional groups, a 2-hop neighbor expansion is performed with a radius ≤ 3 Å. For Class II functional groups, a 1-hop expansion is performed with a radius ≤ 2 Å. For Class III and below, a standard 1-hop expansion is used. The functional group integrity is calculated in real time during the expansion process, and the expansion is stopped immediately if it reaches 95%.
5. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1 or 3, characterized in that, In the dynamic graph partitioning process, a chemical constraint optimization mechanism is also introduced to balance the cost of topological cutting with the integrity of chemical structure by minimizing the objective function: The partitioning parameters are dynamically adjusted based on the molecular scale. For edge weights, Indicates whether to cut the edge. This is a functional group integrity indicator function. This is the chemical constraint weighting coefficient, used to adjust the proportion of chemical integrity in the optimization.
6. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1, characterized in that, Step 3) The specific steps for generating the hierarchical fragment embedding matrix include: For the extended fragment in step 2 Extract the bimodal feature vectors of atoms and construct the feature matrix of fragment atoms. m is the number of atoms in the fragment; Atom features are aggregated using the Graph Attention Network (GAT): for atoms Calculate with neighbors Attention weights; Update atomic features to generate an atomic-level aggregated feature matrix for each fragment. ;right Average by column to generate initial fragment embeddings. ; All segments Forming the initial matrix of global fragments An 8-head cross-attention algorithm is used to calculate segment interaction weights, multi-head features are concatenated, and linear transformation is applied. Generate final fragment embedding All fragments Composition of hierarchical fragment embedding matrix .
7. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 6, characterized in that, Obtaining fragment-level initial embeddings Subsequently, the semantic representation is enhanced by combining chemical type embedding, and a gating mechanism is introduced to adaptively fuse features, specifically: Each fragment is chemically classified, including acidic, basic, and hydrophobic, to generate chemical type embeddings. ; Initial embedding of fused fragments via gating mechanism and Output Enhanced Fragment Embedding ; Optimization using dual-gated networks , The first layer of the dual-gated network: balancing local features within a segment. Global interaction features between fragments Generate fusion features; The second-layer gating: refines feature weights through a scale-adaptive mechanism, and stabilizes the output through residual connections and layer normalization. , To stabilize output characteristics, This is a fusion feature of dual-gated networks. The residual features are input features, which are augmented fragment embeddings. , For layer normalization operation; A three-level feature pyramid is constructed to capture multi-scale structural information, and the final projection is a 128-dimensional hierarchical fragment embedding matrix.
8. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1, characterized in that, The specific steps for generating the cross-attention dynamic hypergraph in step 4) include: Receiving drug pairs Hierarchical fragment embedding matrix of drug A Hierarchical fragment embedding matrix of drug B L represents the number of fragments of drug B, and K represents the number of fragments of drug A; The fragment interaction weight matrix is calculated using an 8-head cross-attention network. The average of the multiple positions is taken as the final weight; Dynamic threshold learned through training Filter the top-3 high-weighted segment pairs and construct hyperedges. Let represent the core fragment interaction unit between drug A and drug B, and calculate the hyperedge weights: , Indicates drug A The fragment and drug B The interaction intensity of each segment; Constructing dynamic hypergraphs , where vertex set , For an extended fragment set of drug A, The extended fragment set, hyperedge set of drug B It consists of constructed hyperedges, each hyperedge connecting one segment of drug A to three segments of drug B.
9. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 1, characterized in that, Step 5) The specific steps for predicting drug-drug interactions include: Based on the hyperedge weights of dynamic hypergraphs, vertex representations are learned through a hypergraph convolutional network (HGNN) and input into a fully connected layer to predict drug interaction probabilities. The fragment interaction weight matrix is then used. Perform Softmax normalization, draw a heatmap with drug A fragments as rows and drug B fragments as columns, label the top-3 high-weight fragment pairs and their weight values, highlight the atomic positions corresponding to the top-3 fragment pairs in the molecular structure diagrams of drugs A and B, connect interactive fragments with arrows and label the interaction type, extract the weight values of the top-10 fragment pairs, and calculate the percentage contribution of each fragment pair.
10. The drug interaction prediction method based on dynamic substructure partitioning and hierarchical feature fusion according to claim 9, characterized in that, The visually interpretable results in step 5) also include interaction mechanism analysis: Based on fragment interaction weights and chemical types, the potential mechanisms of drug interactions are automatically inferred, including hydrogen bonding, hydrophobic interactions, and π-π stacking. The output provides a text description explaining the corresponding chemical interaction types of the top-3 fragments and their contributions to the interaction.