AutoMap: Automatic Medical Code Mapping for Clinical Prediction Model Deployment

Zhenbang Wu, Cao Xiao, Lucas M. Glass, David M. Liebovitz, Jimeng Sun

Introduction

Deep learning has significantly advanced clinical predictive modeling, yet deploying these models across diverse healthcare institutions remains a major "last-mile" challenge. This difficulty stems primarily from data heterogeneity; for instance, a model trained on ICD-9 codes at a large academic center often fails when applied to a community hospital using ICD-10 or proprietary coding systems.

Standard solutions are often inadequate. Manual mapping via the Unified Medical Language System (UMLS) is labor-intensive and frequently incomplete, particularly for rare or site-specific codes. Furthermore, many target hospitals lack the large-scale labeled datasets required for traditional fine-tuning, and privacy regulations often prevent the sharing of raw patient data for joint training. To address these hurdles, we present AutoMap, an automated framework for cross-system medical code mapping.

The AutoMap Framework

AutoMap is a coarse-to-fine framework designed to learn a mapping function $\phi(\cdot)$ that translates target hospital embeddings into the source hospital’s embedding space. This process occurs in three distinct stages:

  1. Step 0: Unsupervised Embedding: Initial embeddings for the target hospital's codes are generated using algorithms like GloVe or Word2Vec, based on code co-occurrence patterns in the target site's unlabeled records.
  2. Step 1: Ontology-level Alignment: This "coarse" phase leverages the hierarchical structure of medical ontologies. By aligning groups of codes at higher levels of the hierarchy using iterative self-supervised learning and Procrustes optimization, the model establishes a stable foundation for mapping.
  3. Step 2: Code-level Refinement: In this "fine" phase, a teacher-student framework is employed. An adversarial discriminator ("Teacher A") ensures translated embeddings match the source distribution, while the original prediction model ("Teacher B") ensures the mapping preserves task-relevant features.
Overview of the AutoMap framework, showing the progression from initial embedding to ontology-level alignment and code-level refinement.

Experimental Setup

The framework was evaluated using two major Electronic Health Record (EHR) datasets: eICU, a multi-center database with over 200,000 admissions, and MIMIC-III, a single-center database containing records for over 53,000 ICU stays. Two critical downstream tasks were tested: Mortality Prediction and Length-of-Stay (LOS) Estimation.

Key Results and Insights

AutoMap consistently outperformed standard cross-lingual mapping tools (e.g., MUSE, VecMap) and traditional transfer learning approaches across several metrics:

  • Predictive Performance: For mortality prediction, AutoMap achieved relative improvements of up to 3.9% in AUC-ROC and 8.7% in AUC-PR over the best baselines. Similar gains were observed for LOS estimation, with improvements of up to 4.7% in AUC-ROC.
  • Mapping Accuracy: Direct code-mapping tests showed an 11.3% improvement in "hit@10" scores compared to the strongest baseline.
  • Data Efficiency: The model remained robust even in low-data regimes, maintaining effectiveness with as few as 100 labeled records at the target site.
  • Cross-Domain Adaptation: Remarkably, AutoMap demonstrated the ability to adapt between different data types, such as mapping diagnosis codes to medication codes.

Discussion and Limitations

The success of AutoMap highlights the value of using medical ontologies as a strong prior for alignment. Starting with broad categories before narrowing to specific codes prevents the model from being overwhelmed by the noise of rare codes.

However, some limitations remain. The refinement step currently requires a "white-box" backbone model to access internal parameters. Additionally, while k-means clustering can serve as a fallback, the system performs best when a formal medical hierarchy is available. Future work will focus on adapting to dynamic coding practices over time and extending the framework to black-box model deployments.

By automating the translation of medical data, AutoMap provides a scalable path for the widespread deployment of clinical AI, bridging the gap between disparate medical coding systems.

Summary updated

BibTeX
@inproceedings{wu2022automap,
  author = {Zhenbang Wu and Cao Xiao and Lucas M. Glass and David M. Liebovitz and Jimeng Sun},
  title = {{AutoMap: Automatic Medical Code Mapping for Clinical Prediction Model Deployment}},
  booktitle = {ECML/PKDD},
  year = {2022},
  doi = {10.1007/978-3-031-26390-3\_29},
}
Figure