Introduction:
Uncharted microbe-drug relationships constitute an under-exploited reservoir of therapeutic leads. In this manuscript, we introduced a hybrid framework named BRMDA by coupling a bilinear attention network with a random-forest classifier to systematically expose latent microbe-drug associations.
Methods:
Firstly, BRMDA integrated multiple drug-centric, microbe-centric, and disease-centric similarity profiles, along with experimentally validated microbe–drug associations, to construct a unified heterogeneous graph. And then, the bilinear attention network and random-forest classifier were employed to compute the predicted scores for potential microbe-drug associations based on the newly constructed unified heterogeneous graph. Next, benchmarking experiments were conducted under a rigorous five-fold cross-validation protocol using the MDAD dataset to validate the prediction performance of BRMDA. Additionally, case studies were further performed, focusing on front-line antibiotics including amoxicillin and ciprofloxacin as well as clinically relevant pathogens including Bacillus cereus and Mycobacterium tuberculosis, to evaluate the translational validity of the proposed model.
Conclusion:
Intensive experimental results demonstrated that BRMDA outperformed seven state-of-the-art competitors in terms of both AUC and AUPR, and 9 out of the top 10 associations predicted by the model were corroborated by independent literature evidence. These findings underscored the accuracy and translational potential of BRMDA, offering a data-driven compass for antimicrobial discovery and microbe-oriented therapeutic design.
IntroductionMicrobes are an extensive and enigmatic group in the biosphere. They are so tiny that they are usually invisible to the naked eye and can only be observed with the aid of microscopes (Huttenhower et al., 2012). There is a vast diversity of microbes, including bacteria, fungi, and viruses (Liang et al., 2020). Microbes are present throughout the human body (Gill et al., 2006). They not only aid in food absorption and gut health but also enhance mucosal and systemic immunity by balancing the gut microbiota (Ventura, 2009; Sommer and Bckhed, 2013). In the gut, these microbes depend on each other and benefit mutually. When the balance of gut microbiota is disrupted, it may lead to various diseases (Liang et al., 2024). Moreover, many studies have shown that microbes and drugs interact significantly during treatment (Mc et al., 2021). Therefore, understanding the relationship between microbes and drugs is crucial for effective disease treatment.
In-depth biological research has revealed the key connections between drugs and microbes. However, the huge consumption of human resources, materials and time in biological experiments has become a bottleneck restricting the in-depth development of research. In recent years, with the rapid development of research tools, computational methods have been increasingly applied. These methods are specifically designed to predict the interactions between drugs and microbes (Lei et al., 2022). At the same time, researchers have also constructed experimentally validated databases of microbe-drug associations. Databases such as MDAD (Sun et al., 2018) provide valuable data support for relevant research. Based on these foundations, Lai et al. (2025) introduces a novel prediction model called GTFKAN, which leverages the integration of Graph Transformer and Fourier Kolmogorov-Arnold Networks to forecast the interactions between microbes and drugs. Yang et al. (2025) developed a predictive model named NNSFMDA for microbial-drug associations, which integrates Lightweight Transformer Model with Bounded Nuclear Norm Minimization. Liang J. et al. (2025) designed a model named GRL-PUL, which is based on graph representation learning and forward label-free learning, to predict the associations between microbes and drugs. Li et al. (2025) proposed a multi similarity ensemble method with pre-completion and error correction functions for predicting the association between microbes and drugs. Based on the transformer principle, Xiao et al. (2025). Designed a comparative learning model for microbe-drug association prediction graphs.
Inspired by
Liang M. et al. (2025)and
Kuang et al. (2024a), we have developed a novel prediction model, BRMDA, that integrates the concepts of bilinear attention networks and random forest algorithms to predict the correlation between microbes and drugs. As illustrated in
Figure 1, the key contributions of BRMDA are highlighted by the following innovative aspects:
By integrating microbe similarity networks, drug similarity networks, and the known relationships among microbes, drugs, and diseases, we constructed a novel, comprehensive heterogeneous microbe-drug network, designated as Network .
To obtain more reliable scores for latent microbe-drug associations, we first performed a random walk on to generate node embeddings, which would then be fed into a BAN module that explicitly models cross-modal structural relationships, yielding an intermediate fused representation. Next, this representation would be simultaneously forwarded to a fully connected layer and a Random-Forest classifier, producing two independent probability predictions. The final association scores were obtained by a weighted average of the two outputs, balancing the strengths of deep learning and ensemble learning.

The overall structure diagram of BRMDA. (A) The heterogeneous network consisting of microbes, drugs, and diseases was established by integrating microbe similarity networks, drug similarity networks, and the known associations among microbes, drugs and diseases. (B) The heterogeneous microbe-drug network was constructed by integrating microbe similarity networks, drug similarity networks, and the known microbe-drug associations. (C) These two heterogeneous networks were fused, and node embeddings were generated via the random walk with restart. (D) Predicting potential microbe-drug associations by BAN. (E) Predicting potential microbe-drug associations by RF. (F) Predicting the final scores of potential microbe-drug associations.
Materials and methodsData sourcesTo evaluate the predictive capabilities of the BRMDA model, we utilized the MDAD dataset. This dataset, meticulously assembled by Sun et al. (2018) in 2018, represents a comprehensive collection of microbe-drug associations. It was derived from multiple authoritative drug databases, including TTD and DrugBank, as well as extensive scholarly literature. After eliminating duplicate entries, the dataset comprises 1,373 distinct drugs and 173 unique microbes, interconnected by 2,470 associations. Subsequently, we gathered known drug-disease associations and known microbe-disease associations from the dataset introduced by Wang et al. (Lei et al., 2022) in 2022. In the experimental process, only diseases that were associated with at least one drug and one microbe in the MDAD dataset, along with the associations related to these diseases, were retained. Consequently, we ultimately identified 109 diseases, 73 microbes, 233 drugs, 1,121 specific drug-disease associations, and 402 particular microbe-disease associations. In addition, we have collected 138 known microbe-microbe interactions, involving 123 microbes in MDAD, and 5,586 known drug-drug relationships from the dataset compiled by Deng et al. (2022), which includes 1,228 drugs in MDAD. Table 1 presents detailed statistical information.
TypeMicrobesDrugsDiseaseAssociationsMicrobe-drug associations1731,373-2,470Microbe-disease associations73-109402Drug-disease associations-2331091,121Drug-drug associations-1,228-5,586Microbe-microbe associations123--138The specific statistical data for MDAD dataset.
Negative sampling and cross-validationAs MDAD provides curated positive associations but no confirmed negatives, we constructed pseudo-negative instances by uniformly sampling from unlabeled microbe–drug pairs. For evaluation, we used a balanced setting by sampling the same number of pseudo-negatives as positives (1:1). Specifically, we do not duplicate (oversample) positive pairs; instead, all positives are retained, and negatives are randomly sampled from the zero (unknown) entries (i.e., negative down-sampling). To reflect increasing class imbalance, we additionally evaluate multiple negative-to-positive ratios in the supplementary experiments. We then performed stratified five-fold cross-validation on the resulting labeled pairs.
For each fold, the threshold for ACC/F1 is determined on the training split by maximizing the F1-score on the training PR curve, and then applied to the corresponding test split to binarize predictions and compute ACC/F1.
In addition to the balanced setting (1:1), we further evaluated robustness under different pseudo-negative sampling ratios (Neg:Pos = 3:1, 5:1, 10:1). In each fold, pseudo-negative pairs were randomly sampled from unobserved microbe–drug pairs with the specified ratio, while the cross-validation splitting protocol remained unchanged. The corresponding results are reported in Table 2.
Neg:PosAUCAUPRF1ACC1:10.98570.97920.95690.95693:10.98810.96180.92730.96345:10.98950.94970.90240.967310:10.99040.92320.87650.9772Performance under different pseudo-negative sampling ratios (Neg:Pos).
As the negative ratio increases, AUC remains stable (0.9857–0.9904), indicating consistent ranking capability. Meanwhile, AUPR and F1 decrease with increasing imbalance (AUPR: 0.9792 → 0.9232; F1: 0.9569 → 0.8765), which is expected due to the sensitivity of PR-based and threshold-dependent metrics to class prevalence. ACC increases (0.9569 → 0.9772) because the majority class becomes negative. These results suggest that our method is robust to different pseudo-negative sampling ratios.
To prevent information leakage during feature construction, positive edges in the test fold were removed from the training microbe-drug adjacency before computing similarity and random-walk-based features.
MethodsMicrobe-drug incidence matrixLeveraging the correlation data provided, we initially established an association matrix between microbes and drugs. In this matrix, each entry is designated as 1 if a relationship exists between a specific drug and a specific microorganism ; otherwise, it is assigned a value of 0. The specific formula is presented in Equation 1.
Microbe/drug Gaussian kernel similarityThe Gaussian kernel similarity, based on the Gaussian kernel function, is a popular method in microbe-drug association prediction. It assumes similar microbes have similar interactions with the same drug. The Gaussian kernel similarity between drugs and can be computed via Equation 2.
In the Gaussian kernel similarity, denotes the Euclidean distance between two diseases, while the parameter , as shown in Equation 3, plays a crucial role in determining how this distance impacts the similarity measurement.
The Gaussian kernel similarity can also be used to assess the similarity between microbes. In Equations 2–5, and denote the interaction profiles of drug and microbe , respectively, which are defined as the corresponding column and row vectors of the microbe–drug incidence matrix (A). Each entry of these vectors is binary, indicating the presence or absence of a known microbe–drug association.
Microbe/drug functional similarityMicrobe functional similarity is calculated using the Kamneva (2017), based on microbial gene family analysis. It starts with building a microbial protein-protein functional association network using the STRING dataset (Szklarczyk et al., 2019). In this network, nodes are gene families, and edges represent genetic neighborhood scores. The Kamneva tool then creates matrix by comparing the edge scores between two microbes to the total link scores of their gene families.
Moreover, SIMCOMP (Hattori et al., 2010) uses drug chemical structures and molecular formulas to measure structural similarity. It matches nodes and edges in chemical diagrams via algorithms to identify the largest common substructure, thereby calculating similarities between drug frameworks. This approach enables the construction of a drug functional similarity matrix .
Microbe/drug fusion similarityUndoubtedly, it can be challenging to compare all microbes using Gaussian kernel similarity or functional similarity alone. To overcome this hurdle, we have developed a novel similarity matrix by integrating known association data between microbes with two distinct types of similarity information, as detailed in Equation 6.
Likewise, the drug fusion matrix can be derived from Equation 7.
Constructing the heterogeneous networkWe integrated the microbe-drug incidence matrix with the drug fusion similarity matrix and the microbe fusion similarity matrix to construct a unified matrix, as detailed in Equation 8.
Feature constructionConstructing the structure-enhanced heterogeneous graphMatrix serves as a comprehensive adjacency matrix designed to capture the relationships among three types of nodes in a heterogeneous graph: microbes, diseases, and drugs. Its structure is detailed in Equation 9.
As shown in Equation 9, the diagonal blocks of describe within-type similarities, where and denote the microbe fusion similarity matrix and the drug fusion similarity matrix, respectively. The off-diagonal blocks describe cross-type associations, where represents the known microbe–disease associations and represents the known drug–disease associations; their transposed blocks are used to keep the adjacency structure symmetric. The remaining blocks are set to 0, indicating that no disease–disease similarity is introduced and no direct microbe–drug edges are defined in . Notably, the direct microbe–drug incidence information is constructed in Equation 8, and is then extended via zero-padding and embedded into the node space of for the weighted fusion in Equation 10.
Among them, and are adjustable coefficients used to control the importance of similarity edges.
Constructing the unified adjacency matrixExtend matrix to matrix via zero-padding, embed it into the node space of matrix , and then perform weighted fusion to derive a unified adjacency matrix, as shown in Formula 10.
Constructing the node feature matrixBased on the unified adjacency matrix , construct the transition probability matrix as depicted in Equation 11.
Where .
To more efficiently capture both the local and global topological intrinsic properties of the nodes, we further implemented an enhanced Random Walk with Restart (RWR) mechanism on , as detailed in Equation 12.
In Equation 12, denotes the restart probability. is the transpose of , and represents the initial probability vector for node , which is defined in Equation 13.
The RWR will be conducted for each node as the starting point to derive its structural steady-state distribution vector . The concatenated results for all nodes can be utilized to separately construct the microbe embedding matrix , drug embedding matrix , and disease embedding matrix . Where represents the distribution of the spreading influence of each microorganism in the heterogeneous graph, is the structural representation of drug nodes, and is a disease node acting as an intermediary, and its structural embedding reflects bridging ability.
Multimodal feature fusion and BAN trainingBilinear Attention Networks (BAN) is a deep learning model designed for multimodal fusion, with its core principle being the precise capture of interactions between image and text features via bilinear operations (Liu et al., 2025). This network employs two key technologies to strengthen feature interactions and manage complex data relationships: bilinear transformation and attention mechanisms. Specifically, bilinear transformation processes input features using a weight matrix and an additive bias, enabling the precise extraction of nuanced correlations within complex datasets. We apply bilinear transformation to map the three embedding matrices , and into a unified semantic space, as illustrated in Equation 14. Through this transformation, the output results , , and for microbes, drugs, and diseases are obtained.
Among them, , , and denote the transformation matrices for microbes, drugs, and diseases, respectively, while , , and represent the corresponding bias terms for microbes, drugs, and diseases. Next, employ a three-way bilinear interaction to capture the structural relationships between different modalities, as illustrated in Equation 15.
In Equation 15, is the interaction between microbes and drugs, is the interaction between microbes and diseases, and is the interaction between drugs and diseases. , , and are the transpose matrices of , , and , respectively, while , and represent the weight matrices from the input layer to the hidden layer for microbe-drug, microbe-disease, and drug-disease, respectively. Construct an intermediate representation following feature fusion, as depicted in Equation 16.
Then send to the fully connected layer to output the classification result, as depicted in Equation 17.
In Equation 17, is the weight matrix from the input layer to the hidden layer, is the bias vector of the hidden layer, and represents the input vector in matrix . In Equation 18, and represent the weight matrix and bias vector from the hidden layer to the output layer, respectively. represents the direct prediction result of the BAN model, reflecting the end-to-end multimodal inference capability of the model.
Random forest classification prediction modelRandom Forest (RF) is a powerful ensemble learning algorithm that has gained widespread application in both classification and regression tasks (
Kuang et al., 2024b). By constructing an array of decision trees and amalgamating their predictions, it significantly enhances the model’s accuracy and stability.
Step 1: Feed , the intermediate fusion feature of BAN, into the RF classifier.
Step 2: Build the training set . Among them, denotes the binary label assigned to each known microbe-drug association.
Step 3: Harnessing the RF model, we derive the final prediction matrix .
Final predicted microbe-drug association scorescaptures the raw, end-to-end multimodal inference of the BAN model, while distills the same representation through a conventional classifier, trading complexity for added robustness and broader generalization. The two outputs are ultimately fused via a weighted average (Equation 19) to yield the final prediction score.
Here, is swept from 0 to 1 in steps of 0.005 and for every split of the 5-fold CV the model’s scores are collected and the AUC is computed then the weight that yields the highest mean AUC is retained as optimal.
Experiments and resultsIn this section, we first calibrated the model by systematically perturbing its core parameters. Subsequently, six state-of-the-art approaches were benchmarked against BRMDA. To further corroborate the findings, two exemplar microbe-drug pairs were independently examined.
Parameter sensitivity analysisWe first determined the final hyperparameter configuration via a joint grid search. Then, for interpretability, we report one-factor-at-a-time sensitivity curves in Figure 2 by varying a single hyperparameter while fixing the others to the selected optimal configuration.

The AUC and AUPR values on different parameter sensitivity analysis. (a) The AUC and AUPR values on different alpha. (b) The AUC and AUPR values on different lambda. (c) The AUC and AUPR values on different Mt. (d) The AUC and AUPR values on different lambda-m. (e) The AUC and AUPR values on different lambda-e.
Five parameters that critically govern model prediction were identified and analyzed in the context of the real scenario. The first, in Equation 12, originates from set ; the second, in Equation 10, is taken from set ; the third, is the feature considered for each split in a random forest, following standard random-forest practice, its candidate values are drawn from set . Moreover, the fourth, in Equation 9, and the fifth, in Equation 9, are adjustable coefficients used to control the importance of similarity edges, and their candidate values are drawn from set . Thereafter, model performance under the selected hyper-parameter set was quantified by five-fold cross-validation, with the area under the receiver-operating-characteristic curve (AUC) and the area under the precision-recall curve (AUPR) serving as the primary metrics. The outcomes are displayed in Figure 2: panel (a) illustrates the results obtained under varying values of , panel (b) those under different settings, panel (c) the corresponding findings for diverse levels. Panel (d) the corresponding findings for diverse levels, and panel (e) the corresponding findings for diverse levels. As shown in Figure 2, optimal model performance is achieved with the following parameter settings: .
The sensitivity curves in Figure 2 exhibit a non-monotonic pattern, suggesting that the involved hyperparameters control a balance between local neighborhood specificity and global structural propagation in the heterogeneous network. Extreme settings tend to over-emphasize either overly local transitions or overly diffuse propagation, which can weaken the discriminative ranking of candidate associations. Therefore, we select the default configuration from a stable region where performance is consistently high, aligning with the intended design of combining structure-enhanced diffusion with interaction modeling.
Comparison with advanced methodsTo rigorously benchmark BRMDA, we compared it with seven leading algorithms. Fairness was guaranteed by retaining each competitor’s original hyper-parameters and subjecting every model BRMDA included to the same five-fold cross-validation split on the MDAD dataset.
HMDAKATZ (Zhu et al., 2019): Built upon the KATZ metric, the approach quantifies proximity within the heterogeneous graph to infer putative microbe-drug associations.
SCSMDA (Tian et al., 2023): This approach integrates structure-enhanced contrastive learning with self-paced negative sampling to predict microbe-drug associations.
GSAMDA (Tan et al., 2022): This model utilizes graph attention networks and sparse autoencoders to provide a new approach for predicting potential microbial drug interactions.
HMDA-Pred (Fan et al., 2020): This model predicts microbe-drug associations by integrating multi-omics data through a network-consistency projection framework.
MDASAE (Fan et al., 2023): This model leverages a stacked autoencoder and a multi-head attention mechanism to jointly mine and interpret the intricate interplay between microbes and drugs.
MHBVDA (Cheng et al., 2022): This model predicts potential virus-drug associations by reconstructing a virus-drug heterogeneous network via matrix decomposition, heterogeneous graph inference, and bounded nuclear-norm regularization.
NIRBMMDA (Qu et al., 2023): This model infers potential microbe-drug associations by ensemble-integrating neighborhood-based inference (NI) and a restricted Boltzmann machine (RBM) using known associations and integrated similarity information.
We benchmarked all methods under their default settings in a rigorous 5-fold cross-validation on the MDAD dataset, recording AUC and AUPR. As Table 3 and Figure 3 show, BRMDA outperforms every comparator, setting a new state-of-the-art for microbe–drug association prediction.
MethodsAUCAUPRHMDAKATZ0.9012 ± 0.00130.9089 ± 0.0071SCSMDA0.9566 ± 0.00370.9498 ± 0.0059GSAMDA0.9472 ± 0.00170.9318 ± 0.0011HMDA-pred0.9183 ± 0.00150.8953 ± 0.0311MDASAE0.9613 ± 0.00210.9518 ± 0.0011MHBVDA0.8746 ± 0.00250.8583 ± 0.0011NIRBMMDA0.9233 ± 0.00270.9287 ± 0.0036BRMDA0.9887 ± 0.00250.9858 ± 0.0011The results of seven comparison methods.

AUC and AUPR curves of seven competitive methods based on the MDAD dataset.
Beyond reporting the mean scores in Table 3, we interpret the improvements from two complementary perspectives. First, the proposed method consistently achieves higher discrimination and ranking quality across the reported metrics, indicating that the learned representations capture more informative cross-entity signals. Second, the improvement in AUPR is particularly meaningful for microbe–drug association prediction, where positive associations are typically sparse; thus, AUPR better reflects the quality of prioritizing high-confidence candidates for downstream validation. The overall trend in Figure 3 further supports the consistency of this advantage across the reported settings.
Case studyTo rigorously evaluate the predictive performance of the BRMDA model, this study conducted targeted case studies using two clinically widely-used drugs, amoxicillin and ciprofloxacin, and two representative microbes, Bacillus cereus and Mycobacterium tuberculosis.
Amoxicillin (Huttner et al., 2020), a representative β-lactam antibiotic of the penicillin class, has attracted sustained attention in the field. Numerous investigations have demonstrated potent and reproducible activity against Bacillus subtilis (Kovai et al., 2023), Clostridium perfringens (Elbadawy and Aboubakr, 2017), and Listeria monocytogenes (Grayo et al., 2008). Microbes potentially interacting with amoxicillin were first ranked by BRMDA-predicted scores. After excluding the three drug-microbe pairs already recorded in the MDAD dataset, the ten highest-scoring organisms were selected for targeted validation. As shown in Table 4, nine of these ten predicted associations are supported by independent literature indexed in PubMed.
MicrobeEvidenceFirmicutesPMID: 39215861Pseudomonas aeruginosaPMID: 31026042Gardnerella vaginalisPMID: 35690718Staphylococcus capitisPMID: 35999775Bacteroides eggerthiiNAEikenella corrodensPMID: 11600394Streptococcus salivariusPMID: 27569711Enterococcus faeciumPMID: 28670644Staphylococcus aureusPMID: 31396174Eggerthella lentaPMID: 25520446The top 10 amoxicillin associated candidate microbes on MDAD.
Ciprofloxacin (Terp and Rybak, 1988), a second-generation fluoroquinolone, exhibits rapid bactericidal activity and an exceptionally broad antimicrobial spectrum. Clinically, it is a first-line option for acute and chronic urinary-tract infections as well as for life-threatening systemic infections, with efficacy repeatedly validated in randomized trials (Gidabayda et al., 2017). The compound retains potent in-vitro activity against Staphylococcus aureus (Khan et al., 2006), Haemophilus influenzae (Gmuender et al., 2001), and Stenotrophomonas maltophilia (Ba et al., 2004). Microbes potentially interacting with ciprofloxacin were ranked by BRMDA-predicted scores. After excluding the 10 drug-microbe pairs already documented in the MDAD database, the 10 highest-ranking organisms were selected for validation. As shown in Table 5, 9 of these 10 predicted associations have been corroborated by independent studies indexed in PubMed.
MicrobeEvidenceFirmicutesPMID: 36152132Enterococcus faeciumPMID: 36231256Streptococcus salivariusPMID: 33083490Human herpesvirus 5PMID: 32234012Bacteroides eggerthiiNAGardnerella vaginalisPMID: 8109944Escherichia coliPMID: 34791074Eikenella corrodensPMID: 3530124Staphylococcus capitisPMID: 10381660Serratia marcescensPMID: 8031065The top 10 ciprofloxacin associated candidate microbes on MDAD.
Bacillus cereus is a Gram-positive, rod-shaped, β-haemolytic bacterium found in soil and food; it is a common cause of food poisoning (Leong et al., 2023). According to relevant literature reports, Bacillus cereus is associated with various substances, including copper sulfate (Santo et al., 2011) and silver nitrate (Babu and Gunasekaran, 2009). After removing the three drug-Bacillus cereus pairs already catalogued in the MDAD dataset, 9 of the 10 highest-scoring predictions were corroborated by independent PubMed-indexed publications, as shown in Table 6.
DrugEvidenceMetronidazolePMID: 29622912CefoxitinPMID: 2110145AmoxicillinPMID: 36444268MinocyclinePMID: 37154337CiprofloxacinPMID: 40237511ZidovudinePMID: 37573457ResveratrolPMID: 31367359LorazepamNAQuercetinPMID: 16345844LinezolidPMID: 35327787The top 10 Bacillus cereus associated candidate drugs on MDAD.
Mycobacterium tuberculosis, the aetiologic agent of tuberculosis (Cole et al., 1998), has been experimentally linked to numerous agents, including ciprofloxacin (Shan et al., 2007) and triclosan (Freundlich et al., 2009). After exclusion of the 14 drug-Mycobacterium tuberculosis pairs already documented in the MDAD dataset, 9 of the 10 top-ranked predictions were independently validated by PubMed-indexed studies, as summarised in Table 7.
DrugEvidenceMetronidazolePMID: 7811018CefoxitinPMID: 23672214Sul
Comments (0)