{"title":"SCEHR: Supervised Contrastive Learning for Clinical Risk Prediction using Electronic Health Records.","authors":"Chengxi Zang, Fei Wang","doi":"10.1109/icdm51629.2021.00097","DOIUrl":null,"url":null,"abstract":"<p><p>Contrastive learning has demonstrated promising performance in image and text domains either in a self-supervised or a supervised manner. In this work, we extend the supervised contrastive learning framework to clinical risk prediction problems based on longitudinal electronic health records (EHR). We propose a general supervised contrastive loss <math> <mrow><msub><mi>ℒ</mi> <mrow><mi>C</mi> <mi>o</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>a</mi> <mi>s</mi> <mi>t</mi> <mi>i</mi> <mi>v</mi> <mi>e</mi> <mspace></mspace> <mi>C</mi> <mi>r</mi> <mi>o</mi> <mi>s</mi> <mi>s</mi> <mspace></mspace> <mi>E</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>o</mi> <mi>p</mi> <mi>y</mi></mrow> </msub> <mo>+</mo> <mi>λ</mi> <msub><mi>ℒ</mi> <mrow><mi>S</mi> <mi>u</mi> <mi>p</mi> <mi>e</mi> <mi>r</mi> <mi>v</mi> <mi>i</mi> <mi>s</mi> <mi>e</mi> <mi>d</mi> <mspace></mspace> <mi>C</mi> <mi>o</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>a</mi> <mi>s</mi> <mi>t</mi> <mi>i</mi> <mi>v</mi> <mi>e</mi> <mspace></mspace> <mi>R</mi> <mi>e</mi> <mi>g</mi> <mi>u</mi> <mi>l</mi> <mi>a</mi> <mi>r</mi> <mi>i</mi> <mi>z</mi> <mi>e</mi> <mi>r</mi></mrow> </msub> </mrow> </math> for learning both binary classification (e.g. in-hospital mortality prediction) and multi-label classification (e.g. phenotyping) in a unified framework. Our supervised contrastive loss practices the key idea of contrastive learning, namely, pulling similar samples closer and pushing dissimilar ones apart from each other, simultaneously by its two components: <math> <mrow><msub><mi>ℒ</mi> <mrow><mi>C</mi> <mi>o</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>a</mi> <mi>s</mi> <mi>t</mi> <mi>i</mi> <mi>v</mi> <mi>e</mi> <mspace></mspace> <mi>C</mi> <mi>r</mi> <mi>o</mi> <mi>s</mi> <mi>s</mi> <mspace></mspace> <mi>E</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>o</mi> <mi>p</mi> <mi>y</mi></mrow> </msub> </mrow> </math> tries to contrast samples with learned anchors which represent positive and negative clusters, and <math> <mrow><msub><mi>ℒ</mi> <mrow><mi>S</mi> <mi>u</mi> <mi>p</mi> <mi>e</mi> <mi>r</mi> <mi>v</mi> <mi>i</mi> <mi>s</mi> <mi>e</mi> <mi>d</mi> <mspace></mspace> <mi>C</mi> <mi>o</mi> <mi>n</mi> <mi>t</mi> <mi>r</mi> <mi>a</mi> <mi>s</mi> <mi>t</mi> <mi>i</mi> <mi>v</mi> <mi>e</mi> <mspace></mspace> <mi>R</mi> <mi>e</mi> <mi>g</mi> <mi>u</mi> <mi>l</mi> <mi>a</mi> <mi>r</mi> <mi>i</mi> <mi>z</mi> <mi>e</mi> <mi>r</mi></mrow> </msub> </mrow> </math> tries to contrast samples with each other according to their supervised labels. We propose two versions of the above supervised contrastive loss and our experiments on real-world EHR data demonstrate that our proposed loss functions show benefits in improving the performance of strong baselines and even state-of-the-art models on benchmarking tasks for clinical risk predictions. Our loss functions work well with extremely imbalanced data which are common for clinical risk prediction problems. Our loss functions can be easily used to replace (binary or multi-label) cross-entropy loss adopted in existing clinical predictive models. The Pytorch code is released at https://github.com/calvin-zcx/SCEHR.</p>","PeriodicalId":74565,"journal":{"name":"Proceedings. IEEE International Conference on Data Mining","volume":" ","pages":"857-866"},"PeriodicalIF":0.0000,"publicationDate":"2021-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9692209/pdf/nihms-1847610.pdf","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings. IEEE International Conference on Data Mining","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/icdm51629.2021.00097","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9
Abstract
Contrastive learning has demonstrated promising performance in image and text domains either in a self-supervised or a supervised manner. In this work, we extend the supervised contrastive learning framework to clinical risk prediction problems based on longitudinal electronic health records (EHR). We propose a general supervised contrastive loss for learning both binary classification (e.g. in-hospital mortality prediction) and multi-label classification (e.g. phenotyping) in a unified framework. Our supervised contrastive loss practices the key idea of contrastive learning, namely, pulling similar samples closer and pushing dissimilar ones apart from each other, simultaneously by its two components: tries to contrast samples with learned anchors which represent positive and negative clusters, and tries to contrast samples with each other according to their supervised labels. We propose two versions of the above supervised contrastive loss and our experiments on real-world EHR data demonstrate that our proposed loss functions show benefits in improving the performance of strong baselines and even state-of-the-art models on benchmarking tasks for clinical risk predictions. Our loss functions work well with extremely imbalanced data which are common for clinical risk prediction problems. Our loss functions can be easily used to replace (binary or multi-label) cross-entropy loss adopted in existing clinical predictive models. The Pytorch code is released at https://github.com/calvin-zcx/SCEHR.
对比学习在图像和文本领域都有良好的表现,无论是自监督学习还是监督学习。在这项工作中,我们将监督对比学习框架扩展到基于纵向电子健康记录(EHR)的临床风险预测问题。我们建议采用一种综合监督对比损失ℒC o n t r s t i v e C r o s s e n t r o p y +λℒs p e r u v i s e d C o n t r s t i v e r e g u l r i z e r学习两个二进制分类(如住院死亡率预测)和多标记分类(例如表现型)在一个统一的框架中。我们的监督对比损失算法实践了对比学习的关键思想,即通过它的两个组成部分,同时把相似的样本拉得更近,把不相似的样本推得更远:ℒC o n t r s t i v e C r o s s e n t r o p y试图对比样本学习锚,它代表的积极的和消极的集群,我ℒs p e r u v s e d C o n t r s t i v e r e g u l r i z e r试图相互对比样本根据他们的监管标签。我们提出了上述监督对比损失的两个版本,我们在现实世界的电子病历数据上的实验表明,我们提出的损失函数在提高强基线甚至最先进的模型在临床风险预测基准任务上的性能方面具有优势。我们的损失函数可以很好地处理临床风险预测问题中常见的极度不平衡的数据。我们的损失函数可以很容易地取代现有临床预测模型中采用的(二值或多标签)交叉熵损失。Pytorch代码在https://github.com/calvin-zcx/SCEHR上发布。