Contextual Biomedical Language Models for Imbalance-Aware Drug-Food Interaction Classification
Journal:
bioRxiv
Published Date:
Oct 21, 2026
Abstract
Drug-food interactions (DFIs) are essential to patient safety because they can alter drug effectiveness or cause side effects. Automated classification of DFIs is difficult because of unstructured textual data, semantic ambiguity, and class imbalance, especially when separating neutral interactions. This paper presents an imbalance-aware deep learning approach for classifying drug-food interactions into three classes: safe, neutral, and unsafe. A structured dataset is created from textual drug interaction descriptions by extracting drug-food pairs and labeling them using rule-based heuristics. To address class imbalance, we apply class weighting and focal loss while fine-tuning the context-aware BioBERT language model. Our experiments show that the approach reaches an accuracy of 85% and a macro-averaged F1-score of 0.77, with a notable improvement on the minority neutral class (F1-score of 0.56). The main novelty of this work is the combination of contextual biomedical language modeling with imbalance-aware deep learning, enabling more effective classification of DFI datasets.