Accurate and Well-Calibrated ICD Code Assignment Through Attention Over Diverse Label Embeddings
Gonçalo Gomes, Isabel Coutinho, Bruno Martins
TL;DR
This work tackles automated ICD code assignment from long, complex clinical notes by introducing a Transformer-based framework that blends two text-encoding regimes (Longformer-enabled LE and Chunk Encoding CE) with a label-embedding scheme built from diverse ICD synonyms. A multi-synonym attention mechanism leverages UMLS and external knowledge bases to enrich code representations, while a joint learning objective $\mathcal{L} = \mathcal{L}_C + \lambda \mathcal{L}_Q$ couples multi-label classification with text quantification to improve calibration. Empirically, CE with Multi-Synonyms Attention and joint quantification achieves state-of-the-art results on MIMIC-III-50 and MIMIC-III-clean, with the Huber-based calibration variant (CLQ_Huber) providing robust calibration without sacrificing classification accuracy. The approach yields well-calibrated probabilities that support downstream tasks like prevalence estimation and quantification, and it demonstrates strong few-shot behavior for rare codes. Future work could exploit ICD hierarchical structure and test alternative calibration-focused losses to further boost performance and reliability.
Abstract
Although the International Classification of Diseases (ICD) has been adopted worldwide, manually assigning ICD codes to clinical text is time-consuming, error-prone, and expensive, motivating the development of automated approaches. This paper describes a novel approach for automated ICD coding, combining several ideas from previous related work. We specifically employ a strong Transformer-based model as a text encoder and, to handle lengthy clinical narratives, we explored either (a) adapting the base encoder model into a Longformer, or (b) dividing the text into chunks and processing each chunk independently. The representations produced by the encoder are combined with a label embedding mechanism that explores diverse ICD code synonyms. Experiments with different splits of the MIMIC-III dataset show that the proposed approach outperforms the current state-of-the-art models in ICD coding, with the label embeddings significantly contributing to the good performance. Our approach also leads to properly calibrated classification results, which can effectively inform downstream tasks such as quantification.
