Clear Sky Science · en

Knowledge graph-enhanced deep learning for pharmaceutical demand forecasting

· Back to index

Why smarter drug forecasts matter

Hospitals, pharmacies, and patients all depend on having the right medicines available at the right time. Order too little, and life‑saving drugs may be out of stock when they are urgently needed. Order too much, and shelves fill with products that expire and waste money. The challenge is that demand for medicines swings with flu seasons, new outbreaks, changing guidelines, and the way doctors swap or combine drugs. This paper presents a new way to forecast drug demand that uses both advanced artificial intelligence and structured medical knowledge to make healthcare supply chains more reliable and efficient.

Figure 1
Figure 1.

Limits of today’s forecasting tools

Many hospitals and suppliers still rely on traditional statistical models that assume demand follows relatively smooth, predictable trends. These methods treat each drug as if it lives in its own world, ignoring how one medicine can replace or complement another. Newer machine‑learning and deep‑learning models, such as neural networks, do a better job of handling ups and downs in time‑series data, but they, too, usually focus only on past sales numbers. As a result, they often miss an important part of the story: how doctors actually choose among different drugs when treating patients with the same illness, especially when there are substitutes or common combinations.

Adding a map of how drugs relate

The authors tackle this problem by building a “knowledge graph” for pharmaceuticals—a kind of map that links drugs, symptoms, and diseases. In this graph, each node represents a drug or symptom, and each connection represents a real‑world relationship, such as one antibiotic substituting for another, or a vitamin commonly prescribed together with a cold remedy. By grounding the forecast in this structured map, the model can see that if demand for one drug rises or falls, demand for its close substitutes or typical partners may change as well. This turns scattered sales records into a connected picture of how treatments interact in practice.

How the hybrid AI model works

To turn this map and the sales history into forecasts, the study proposes a hybrid model called KG‑GCN‑LSTM. First, a graph convolutional network (GCN) flows information along the links of the knowledge graph so that each drug’s representation reflects not only its own history but also the behavior of related drugs. A special “clipping” step then focuses the model back on the target drug, reducing noise from less relevant neighbors. Next, a long short‑term memory network (LSTM)—a type of recurrent neural network designed for sequences—processes the enriched weekly demand data to learn patterns over time, such as seasonality, gradual growth, and sudden spikes. Finally, a simple output layer turns these learned patterns into predictions of future demand.

Figure 2
Figure 2.

Real‑world tests in a busy pharmacy

The researchers tested their approach on more than half a million sales records from an Indonesian pharmacy, covering over 200 products. They cleaned and aggregated the data into weekly demand, filtered out items with very short histories, and constructed the knowledge graph using international drug classifications and known drug–drug interactions. The new model was then compared against a broad range of established techniques, from classic ARIMA and support vector regression to modern deep‑learning systems like CNN‑LSTM, N‑BEATS, and TimeMixer. Across several standard error measures, the knowledge‑enhanced model delivered the most accurate forecasts overall, cutting relative error by about 3.6 percentage points compared with a strong deep‑learning baseline and matching the performance of the latest TimeMixer approach while being more interpretable and better suited to drugs with limited history.

What this means for patients and providers

For non‑specialists, the core message is straightforward: when forecasting tools understand not just “how much of each drug was sold” but also “how drugs relate to one another in real medical use,” they can better anticipate future needs. The KG‑GCN‑LSTM model shows that weaving domain knowledge into AI can reduce stockouts and overstocking, helping pharmacies keep essential medicines on the shelf without tying up unnecessary funds. While building and maintaining high‑quality knowledge graphs still requires effort, this study points to a future in which smarter, knowledge‑aware algorithms quietly support more resilient and cost‑effective healthcare supply chains.

Citation: Chen, X., Lu, G., Zhang, H. et al. Knowledge graph-enhanced deep learning for pharmaceutical demand forecasting. Sci Rep 16, 4776 (2026). https://doi.org/10.1038/s41598-026-35113-4

Keywords: drug demand forecasting, healthcare supply chain, knowledge graph, graph neural networks, time series forecasting