WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis

IntroductionRepresentation learning allows artificial intelligence (AI) models to learn useful features from large, unlabelled datasets. This can reduce the need for labelled data across a range of downstream tasks. It was hypothesised that wave segmentation would be a useful form of electrocardiogr...

Full description

Bibliographic Details
Main Authors: Rob Brisk, Raymond R. Bond, Dewar Finlay, James A. D. McLaughlin, Alicja J. Piadlo, David J. McEneaney
Format: Article
Language:English
Published: Frontiers Media S.A. 2022-03-01
Series:Frontiers in Physiology
Subjects:
Online Access:https://www.frontiersin.org/articles/10.3389/fphys.2022.760000/full
_version_ 1828876635185610752
author Rob Brisk
Rob Brisk
Raymond R. Bond
Dewar Finlay
James A. D. McLaughlin
Alicja J. Piadlo
Alicja J. Piadlo
David J. McEneaney
David J. McEneaney
author_facet Rob Brisk
Rob Brisk
Raymond R. Bond
Dewar Finlay
James A. D. McLaughlin
Alicja J. Piadlo
Alicja J. Piadlo
David J. McEneaney
David J. McEneaney
author_sort Rob Brisk
collection DOAJ
description IntroductionRepresentation learning allows artificial intelligence (AI) models to learn useful features from large, unlabelled datasets. This can reduce the need for labelled data across a range of downstream tasks. It was hypothesised that wave segmentation would be a useful form of electrocardiogram (ECG) representation learning. In addition to reducing labelled data requirements, segmentation masks may provide a mechanism for explainable AI. This study details the development and evaluation of a Wave Segmentation Pretraining (WaSP) application.Materials and MethodsPretraining: A non-AI-based ECG signal and image simulator was developed to generate ECGs and wave segmentation masks. U-Net models were trained to segment waves from synthetic ECGs. Dataset: The raw sample files from the PTB-XL dataset were downloaded. Each ECG was also plotted into an image. Fine-tuning and evaluation: A hold-out approach was used with a 60:20:20 training/validation/test set split. The encoder portions of the U-Net models were fine-tuned to classify PTB-XL ECGs for two tasks: sinus rhythm (SR) vs atrial fibrillation (AF), and myocardial infarction (MI) vs normal ECGs. The fine-tuning was repeated without pretraining. Results were compared. Explainable AI: an example pipeline combining AI-derived segmentation masks and a rule-based AF detector was developed and evaluated.ResultsWaSP consistently improved model performance on downstream tasks for both ECG signals and images. The difference between non-pretrained models and models pretrained for wave segmentation was particularly marked for ECG image analysis. A selection of segmentation masks are shown. An AF detection algorithm comprising both AI and rule-based components performed less well than end-to-end AI models but its outputs are proposed to be highly explainable. An example output is shown.ConclusionWaSP using synthetic data and labels allows AI models to learn useful features for downstream ECG analysis with real-world data. Segmentation masks provide an intermediate output that may facilitate confidence calibration in the context of end-to-end AI. It is possible to combine AI-derived segmentation masks and rule-based diagnostic classifiers for explainable ECG analysis.
first_indexed 2024-12-13T08:26:08Z
format Article
id doaj.art-a92145f2a92848feafeb10676157d5f7
institution Directory Open Access Journal
issn 1664-042X
language English
last_indexed 2024-12-13T08:26:08Z
publishDate 2022-03-01
publisher Frontiers Media S.A.
record_format Article
series Frontiers in Physiology
spelling doaj.art-a92145f2a92848feafeb10676157d5f72022-12-21T23:53:54ZengFrontiers Media S.A.Frontiers in Physiology1664-042X2022-03-011310.3389/fphys.2022.760000760000WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram AnalysisRob Brisk0Rob Brisk1Raymond R. Bond2Dewar Finlay3James A. D. McLaughlin4Alicja J. Piadlo5Alicja J. Piadlo6David J. McEneaney7David J. McEneaney8Faculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomCardiology Department, Craigavon Area Hospital, Craigavon, United KingdomFaculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomFaculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomFaculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomFaculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomCardiology Department, Craigavon Area Hospital, Craigavon, United KingdomFaculty of Computing, Engineering and the Built Environment, Ulster University, Belfast, United KingdomCardiology Department, Craigavon Area Hospital, Craigavon, United KingdomIntroductionRepresentation learning allows artificial intelligence (AI) models to learn useful features from large, unlabelled datasets. This can reduce the need for labelled data across a range of downstream tasks. It was hypothesised that wave segmentation would be a useful form of electrocardiogram (ECG) representation learning. In addition to reducing labelled data requirements, segmentation masks may provide a mechanism for explainable AI. This study details the development and evaluation of a Wave Segmentation Pretraining (WaSP) application.Materials and MethodsPretraining: A non-AI-based ECG signal and image simulator was developed to generate ECGs and wave segmentation masks. U-Net models were trained to segment waves from synthetic ECGs. Dataset: The raw sample files from the PTB-XL dataset were downloaded. Each ECG was also plotted into an image. Fine-tuning and evaluation: A hold-out approach was used with a 60:20:20 training/validation/test set split. The encoder portions of the U-Net models were fine-tuned to classify PTB-XL ECGs for two tasks: sinus rhythm (SR) vs atrial fibrillation (AF), and myocardial infarction (MI) vs normal ECGs. The fine-tuning was repeated without pretraining. Results were compared. Explainable AI: an example pipeline combining AI-derived segmentation masks and a rule-based AF detector was developed and evaluated.ResultsWaSP consistently improved model performance on downstream tasks for both ECG signals and images. The difference between non-pretrained models and models pretrained for wave segmentation was particularly marked for ECG image analysis. A selection of segmentation masks are shown. An AF detection algorithm comprising both AI and rule-based components performed less well than end-to-end AI models but its outputs are proposed to be highly explainable. An example output is shown.ConclusionWaSP using synthetic data and labels allows AI models to learn useful features for downstream ECG analysis with real-world data. Segmentation masks provide an intermediate output that may facilitate confidence calibration in the context of end-to-end AI. It is possible to combine AI-derived segmentation masks and rule-based diagnostic classifiers for explainable ECG analysis.https://www.frontiersin.org/articles/10.3389/fphys.2022.760000/fullartificial intelligenceelectrocardiogram (ECG)machine learningexplainable AIrepresentation learning
spellingShingle Rob Brisk
Rob Brisk
Raymond R. Bond
Dewar Finlay
James A. D. McLaughlin
Alicja J. Piadlo
Alicja J. Piadlo
David J. McEneaney
David J. McEneaney
WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
Frontiers in Physiology
artificial intelligence
electrocardiogram (ECG)
machine learning
explainable AI
representation learning
title WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
title_full WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
title_fullStr WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
title_full_unstemmed WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
title_short WaSP-ECG: A Wave Segmentation Pretraining Toolkit for Electrocardiogram Analysis
title_sort wasp ecg a wave segmentation pretraining toolkit for electrocardiogram analysis
topic artificial intelligence
electrocardiogram (ECG)
machine learning
explainable AI
representation learning
url https://www.frontiersin.org/articles/10.3389/fphys.2022.760000/full
work_keys_str_mv AT robbrisk waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT robbrisk waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT raymondrbond waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT dewarfinlay waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT jamesadmclaughlin waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT alicjajpiadlo waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT alicjajpiadlo waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT davidjmceneaney waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis
AT davidjmceneaney waspecgawavesegmentationpretrainingtoolkitforelectrocardiogramanalysis