# An Explainable CNN Approach for Medical Codes Prediction from Clinical Text

임상 텍스트로부터 의료 코드를 예측하는 설명 가능한 CNN 접근법

Shu Yuan Hu, Fei Teng · arXiv · 2021년 1월 14일

- **연구 문제** 임상 텍스트의 ICD 코드 자동 할당은 수작업보다 효율적일 수 있지만, 코드 근거 구절이 드러나지 않고 모델 내부 작동을 설명하기 어렵습니다.
- **연구 방법** SWAM은 넓은 합성곱 층으로 국소 특징을 많이 학습하고, 레이블별 attention으로 각 코드의 근거 구절을 선택하는 설명 가능한 CNN 접근입니다.
- **주요 결과** MIMIC-III 상위 50개 코드 실험에서 SWAM 모델들은 기준 모델들보다 강한 결과를 보였고, 필터 수만 다른 CAML 비교에서는 일부 레이블의 성능이 개선되었습니다.

## 자동 ICD 코딩의 어려움

임상 기록에는 진단과 치료를 나타내는 ICD 코드가 붙지만, 수작업 코딩은 시간이 많이 들고 오류가 생기기 쉽습니다. 그래서 퇴원 요약 같은 비정형 텍스트에서 코드를 자동으로 할당하는 연구가 이어져 왔습니다. 이 논문은 두 가지 문제를 제기합니다. 첫째, 코드가 붙은 기록만으로는 특정 진단과 치료의 근거가 되는 텍스트 구절이 드러나지 않습니다. 둘째, 실제 적용을 위해서는 예측 결과뿐 아니라 모델 내부의 작동도 설명할 수 있어야 합니다. 저자들은 이 두 과제를 함께 다루기 위해 합성곱 신경망 기반 방법을 제안합니다.

## 넓은 합성곱 층과 레이블별 attention

제안 모델 SWAM은 얕고 넓은 합성곱 층을 사용합니다. 저자들은 각 코드와 관련된 정보성 구절이 문서 여러 위치에 흩어져 있다고 보고, 이 구절들을 국소·저수준 특징으로 간주합니다. 입력은 word2vec CBOW로 MIMIC-III 퇴원 요약에서 사전 학습한 임베딩 행렬이며, 합성곱 필터가 인접한 임베딩을 훑어 각 위치의 표현 H를 만듭니다. 이후 레이블별 attention 구현에서는 레이블마다 파라미터 벡터 u를 두어 H⊤u로 점수를 계산하고 SoftMax로 정규화한 α를 얻습니다. 이 α로 H를 가중합하여 레이블별 문서 벡터를 만들고, 각 레이블에 선형 층과 sigmoid를 적용해 예측합니다. 학습은 레이블별 binary cross-entropy 손실로 이루어집니다.

다른 구현인 완전연결 층 방식에서는 attention 대신 max-pooling으로 벡터를 만듭니다.

![Figure 1: Internal mechanism of SWAM](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-68881e12cda5552355530630f925528a.png?thumb=512)

**Figure 1** Internal mechanism of SWAM.

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.

![Figure 2: The architecture of the model with per-label mechanism](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-597b2d46e3d6dfefc98403458888fecb.png?thumb=512)

**Figure 2** The architecture of the model with per-label mechanism.

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.

![Table 1: Table of Notations](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-9aa80bde969888e3c56f4c7bcdbc5793.png?thumb=512)

**Table 1** Table of Notations

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

## MIMIC-III 상위 50개 코드 실험 설정

평가는 MIMIC-III의 퇴원 요약을 사용하고, 가장 빈도 높은 50개 ICD-9 코드를 레이블로 삼습니다. 필터링 post-training 8,067건, 검증 1,574건, 시험 1,730건입니다. 비교 대상은 bag-of-words 로지스틱 회귀, CAML, 그리고 두 가지 attention 구현인 SWAM-CAML과 SWAM-textCNN입니다. 하이퍼파라미터는 격자 탐색으로 조정했으며 배치 크기는 16으로 고정했습니다. 조기 종료는 Macro-F1이 10 epoch 동안 개선되지 않을 때 적용됩니다. 주요 지표는 Macro-averaged F1이고 P@5, AUC, Micro-averaged F1을 함께 보고합니다.

![Table 2: Descriptive statistics for MIMIC3](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-cbcbefd1148ec261529392c364cc1bd5.png?thumb=512)

**Table 2** Descriptive statistics for MIMIC3

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.

![Table 4: Hyper-parameter tuning ranges and optimal values for SWAM model](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-19792661c8a28aee37d5fde0d2cbd31d.png?thumb=512)

**Table 4** Hyper-parameter tuning ranges and optimal values for SWAM model

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

## 전체 지표 결과와 넓은 폭의 효과

표 3에서 SWAM 모델들은 모든 지표에서 가장 강한 결과를 보였으며, 특히 레이블별 성능을 강조하는 Macro-F1에서 두드러집니다. 저자들은 이 향상을 넓은 구조가 서로 다른 코드의 고유 특징을 더 폭넓게 학습하게 한 결과로 해석합니다. 이 결과는 MIMIC-III 상위 50개 코드 설정에서 얻은 것입니다.

## 필터 수를 바꾼 CAML 비교

넓이의 효과를 확인하기 위해 CAML을 SWAM-CAML과 비교합니다. 두 모델의 차이는 합성곱 필터 수뿐이며, SWAM-CAML은 500개, CAML은 50개의 필터를 사용합니다. CAML에서는 5개 레이블의 정밀도가 0이었는데, 그중 4개 레이블은 SWAM-CAML에서 평균 정밀도 0.53을 보였습니다. 이 결과는 좁은 모델이 일부 레이블의 특징을 학습하지 못했다는 저자들의 해석을 뒷받침합니다. 다만 정밀도 0이 남은 나머지 레이블 1개와 해석의 일반화 범위는 별도로 확인해야 합니다.

![Figure 3: Comparing per-label performances of SWAM-CAML with CAML \[21\],the only diﬀerence between two models are the width of the network. SWAM has 500 ﬁlters,…](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-bed7594c58f61ce7beb78c4141f988fb.png?thumb=512)

**Figure 3** Comparing per-label performances of SWAM-CAML with CAML \[21\],the only diﬀerence between two models are the width of the network. SWAM has 500 ﬁlters, while CAML has 50 ﬁlters.

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 정밀도 0 레이블과 한계

저자들은 정밀도 0으로 남은 코드 285.9(Anemia, unspecified)를 따로 분석합니다. 이 코드는 CAML과 SWAM-CAML 모두에서 정밀도 0이었습니다. 저자들은 빈혈 관련 구절이 필요하지만 충분하지 않으며, 다른 원인이 모두 부재한다는 정보까지 필요하다고 해석합니다. 학습 데이터를 다른 난수 시드로 섞어 재학습해도 285.9는 여전히 학습되지 않았습니다. 이 결과는 데이터 순서에 따른 지역 최적해만으로 설명되지 않는다는 근거로 제시됩니다. 또한 저자들은 전체 ICD 코드 집합으로 확장할 때 필터 수가 크게 늘어나는 문제를 향후 과제로 밝힙니다.

![Table 6: ICD Code with 0 precision in both the wide (SWAM-CAML) and narrow (CAML) models before and after data shuﬄe](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122/figures/figure-28c73778f9d4eb055d56b8baef1809e7.png?thumb=512)

**Table 6** ICD Code with 0 precision in both the wide (SWAM-CAML) and narrow (CAML) models before and after data shuﬄe

[원문](https://arxiv.org/abs/2101.11430v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Shu Yuan Hu, Fei Teng · An Explainable CNN Approach for Medical Codes Prediction from Clinical Text · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.

## 논문 정보

- **저자**: Shu Yuan Hu, Fei Teng
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2021년 1월 14일
- **등록일**: 2026년 11월 6일
- **수정일**: 2021년 1월 14일
- **버전**: v1
- **arXiv**: 2101.11430
- **분류**: cs.CL · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2101.11430v1) · [원문 PDF ↗](https://arxiv.org/pdf/2101.11430v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Method: We develop CNN-based methods for automatic ICD coding based on clinical text from intensive care unit (ICU) stays. We come up with the Shallow and Wide Attention convolutional Mechanism (SWAM), which allows our model to learn local and low-level features for each label. The key idea behind our model design is to look for the presence of informative snippets in the clinical text that correlated with each code, and we infer that there exists a correspondence between "informative snippet" and convolution filter. Results: We evaluate our approach on MIMIC-III, an open-access dataset of ICU medical records. Our approach substantially outperforms previous results on top-50 medical code prediction on MIMIC-III dataset. We attribute this improvement to SWAM, by which the wide architecture gives the model ability to more extensively learn the unique features of different codes, and we prove it by ablation experiment. Besides, we perform manual analysis of the performance imbalance between different codes, and preliminary conclude the characteristics that determine the difficulty of learning specific codes. Conclusions: We present SWAM, an explainable CNN approach for multi-label document classification, which employs a wide convolution layer to learn local and low-level features for each label, yields strong improvements over previous metrics on the ICD-9 code prediction task, while providing satisfactory explanations for its internal mechanics.

## 원문 인용

Shu Yuan Hu, Fei Teng (2021). An Explainable CNN Approach for Medical Codes Prediction from Clinical Text. arXiv:2101.11430v1. https://arxiv.org/abs/2101.11430v1

**BibTeX**

```
@misc{hu2021explainable,
  title = {{An Explainable CNN Approach for Medical Codes Prediction from Clinical Text}},
  author = {Shu Yuan Hu and Fei Teng},
  year = {2021},
  eprint = {2101.11430},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.11430v1}
}
```

## 이 논문의 용어

- [softmax](https://refivu.com/terms/4a7673b6518d-softmax)
- [logistic regression](https://refivu.com/terms/3551369d301a-logistic-regression)
- [Max-Pooling](https://refivu.com/terms/c2bc224c5125-max-pooling)
- [MIMIC-III](https://refivu.com/terms/dd6db3ddda37-mimic-iii)
- [binary cross-entropy](https://refivu.com/terms/bbec6d1b6dde-binary-cross-entropy)
- [micro-averaged F1](https://refivu.com/terms/a75487fb2d98-micro-averaged-f1)
- [CAML](https://refivu.com/terms/f10dfd8c725a-caml)
- [macro-averaged F1](https://refivu.com/terms/565537293e47-macro-averaged-f1)
- [SWAM](https://refivu.com/terms/adf409d71635-swam)
- [textCNN](https://refivu.com/terms/97d98ebf2abd-textcnn)

## 다른 논문 해설

- [Automated stance detection in complex topics and small languages: the challenging case of immigration in polarizing news media](https://refivu.com/papers/d2852de3-abf0-4dd3-b05b-947ced08925e-automated-stance-detection-in-complex-topics-and-small.md)
- [From Rule-Based Models to Deep Learning Transformers Architectures for Natural Language Processing and Sign Language Translation Systems: Survey, Taxonomy and Performance Evaluation](https://refivu.com/papers/ce85494f-1413-48ab-981f-68dc7b69122d-from-rule-based-models-to-deep-learning-transformers.md)
- [A Unified Understanding of Deep NLP Models for Text Classification](https://refivu.com/papers/b997b876-1da5-412e-b061-305960e3137e-a-unified-understanding-of-deep-nlp-models-for.md)
- [Universal Language Model Fine-tuning for Text Classification](https://refivu.com/papers/f2470a4a-1c9b-423c-8757-ba73cfe37b54-universal-language-model-fine-tuning-for-text-classification.md)
- [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://refivu.com/papers/13b055d5-7dcd-422f-b6d8-3704e3d48533-bart-denoising-sequence-to-sequence-pre-training-for.md)
- [Comparison of Machine Learning for Sentiment Analysis in Detecting Anxiety Based on Social Media Data](https://refivu.com/papers/8412f077-3170-4e67-bb2c-f3ad167c019c-comparison-of-machine-learning-for-sentiment-analysis-in.md)
- [Listening for "You": Enhancing Speech Image Retrieval via Target Speaker Extraction](https://refivu.com/papers/3d87a944-dcd8-45d3-99a9-93ba27a05d04-listening-for-you-enhancing-speech-image-retrieval-via.md)
- [A Machine Learning Tutorial for Operational Meteorology, Part I: Traditional Machine Learning](https://refivu.com/papers/bbf899fd-3be5-47d7-b468-25ad7a0bea27-a-machine-learning-tutorial-for-operational-meteorology-part.md)
- [SeUNet-Trans: A Simple yet Effective UNet-Transformer Model for Medical Image Segmentation](https://refivu.com/papers/84841b62-f8df-4cd7-9664-581f52697e2b-seunet-trans-a-simple-yet-effective-unet-transformer.md)
- [Long-Term CSI-based Design for RIS-Aided Multiuser MISO Systems Exploiting Deep Reinforcement Learning](https://refivu.com/papers/3f9cc9d0-8d69-4f5f-8ecb-fe79908af5a7-long-term-csi-based-design-for-ris-aided.md)
- [Large Language Models are Zero-Shot Recognizers for Activities of Daily Living](https://refivu.com/papers/7f02fa96-a1cc-423e-b20b-d091ab242a7a-large-language-models-are-zero-shot-recognizers-for.md)
- [A Scalable Post-Processing Pipeline for Large-Scale Free-Space Multi-Agent Path Planning with PiBT](https://refivu.com/papers/95551d18-44d6-4670-a6fb-fd67d2230b41-a-scalable-post-processing-pipeline-for-large-scale.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/2e80fa24-ec99-471e-8338-d3af6d4e8122-an-explainable-cnn-approach-for-medical-codes-prediction)
