Robust and Adaptive AI Models for Medication Usage Forecasting Using ICD-9/10 Code (Student Abstract)

Jonathan LiAAAI 2025 · DOI

TL;DR

This paper introduces a robust and adaptive AI framework for forecasting medication usage and ICD-9/10 code progression, crucial for optimizing healthcare logistics, especially during crises. By combining unsupervised learning, NLP, and ensemble forecasting models with drift detection, the framework achieves promising accuracy and adaptability to changing conditions.

What Problem Does This Paper Address?

Efficiently managing medical resources, particularly medications, is a critical challenge for healthcare systems, especially during high-demand periods like pandemics, outbreaks, or natural disasters. The COVID-19 pandemic starkly revealed vulnerabilities in supply chains and forecasting capabilities, leading to shortages and tragic outcomes. Traditional forecasting methods often struggle with the dynamic and stochastic nature of healthcare data, making it difficult to anticipate demand accurately. This paper addresses the need for robust and adaptive AI models that can reliably forecast medication usage and disease progression (represented by ICD codes) to improve healthcare logistics and decision-making.

Methods

The proposed framework employs a multi-module approach:

  • ICD Encoder: Unsupervised learning and NLP techniques are used to create meaningful vector representations of daily ICD-9/10 codes. This involves mapping ICD-9 to ICD-10 codes, grouping them by the first three characters, and then using Incremental Principal Component Analysis (IPCA) for dimensionality reduction, retaining 97% of the original variance. Small Gaussian noise is added for numerical stability.
  • Medication Usage Encoder: Similar to the ICD encoder, this module creates vector representations for medications. It utilizes the FDA full medication list, focusing on active ingredients to group different brand names. Dosage is factored into usage with normalized units. TF-IDF is applied for vectorization, followed by IPCA and K-means clustering for dimensionality reduction and grouping.
  • Forecasting Models: Several forecasting models are trained and evaluated, including Linear Drift Model, Vector Autoregression (VAR), Temporal Fusion Transformer (TFT), and Autoregressive Long Short-Term Memory (AR-LSTM). The TFT and AR-LSTM models, known for capturing short and long-term dependencies, are further enhanced with Stochastic Weight Averaging (SWA) and trained with different lookback horizons.
  • Ensemble and Drift Detection: To achieve better accuracy, multiple TFT and AR-LSTM models are ensembled using a median method. To handle model drift (when performance degrades due to changing data patterns), a Bayesian Changepoint Detection algorithm is employed. If drift is detected, the framework retrains models with a higher weighting on recent data, ensuring adaptability. Stratified error analysis using Dynamic Time Warping (DTW) is used for a more nuanced evaluation of model performance across different data quantiles.

Datasets

The framework is trained and evaluated on two real-world Electronic Health Record (EHR) datasets:

  • MIMIC-IV ER
  • MIMIC-III

Key Insights and Ideas

  • Vector Representations are Key: Transforming complex ICD code sequences and medication data into meaningful vector representations is fundamental for effective downstream forecasting.
  • Ensembling for Robustness: Combining multiple advanced forecasting models (TFT, AR-LSTM) significantly improves accuracy and reliability compared to individual models.
  • Adaptability is Crucial: Healthcare data is inherently dynamic. A mechanism for detecting and adapting to model drift is essential for maintaining forecasting performance over time, especially in volatile environments.
  • Granular Error Analysis Matters: Simple error metrics are insufficient. Using techniques like DTW for stratified error analysis provides deeper insights into where a model excels or falters.

Key Results

The ensemble model, combining TFT and AR-LSTM, demonstrated promising performance:

  • Average forecasting error of 5.2% at the 5-th day.
  • Average forecasting error of 18.1% at the 10-th day. The paper notes that performance can vary significantly across different medications, with some showing errors exceeding 50% at the 10-day mark, indicating areas for further improvement.

Limitations and Future Work

  • Variable Performance: The authors acknowledge that the forecasting performance varies considerably across different medications, with some medications exhibiting high error rates.
  • Further Investigation: They are actively examining the reasons for poor performance on certain medications and seeking ways to improve the framework's robustness.
  • Adaptability to New Situations: The framework's ability to adapt to emerging situations like pandemics or outbreaks by retraining models with recent data is highlighted as a key feature for future applications.
  • Actionable Insights: The framework aims to provide healthcare providers with actionable insights for inventory and distribution planning, a key area for future development and validation.

Summary updated

BibTeX
@inproceedings{li2025robust,
  author = {Jonathan Li},
  title = {{Robust and Adaptive AI Models for Medication Usage Forecasting Using ICD-9/10 Code (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i28.35267},
}
Figure