PyPulse: A Python Library for Biosignal Imputation
Kevin Gao [email protected], Maxwell A. Xu [email protected], James M. Rehg [email protected], Alexander Moreno [email protected] · 2024
Read PyPulse: A Python Library for Biosignal Imputation by Kevin Gao [email protected], Maxwell A. Xu [email protected], James M. Rehg [email protected], Alexander Moreno [email protected] (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-06382.txt.
Introduction
Kevin Gao and co-authors present a 2024 Python library for filling gaps in biosignal data. Heart, brain, and wearable sensor traces often lose chunks to loose contacts or dropped sends. Filling those gaps well is a first step for most later analysis.
Their library, PyPulse, works in both clinic and wearable settings. It ships with trained fill methods that run out of the box on new data. A full train or test run of a base method takes one line of code. An interactive visual tool lets users compare methods side by side. The package is shared under an open license on public code and package archives.
Catalog record
| CREATOR | Kevin Gao [email protected], Maxwell A. Xu [email protected], James M. Rehg [email protected], Alexander Moreno [email protected] |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 10 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-06382
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PyPulse: A Python Library for Biosignal Imputation Kevin Gao [email protected], Maxwell A. Xu [email protected], James M. Rehg [email protected], Alexander Moreno [email protected] Abstract We introduce PyPulse, a Python package for imputation of biosignals in both clinical and wearable sensor settings. Missingness is commonplace in these settings and can arise from multiple causes, such as insecure sensor attachment or data transmission loss. PyPulse’s framework provides a modular and extendable framework with high ease-of-use for a broad userbase, including non-machine-learning bioresearchers. Specifically, its new capabilities include using pre-trained imputation methods out-of-the-box on custom datasets, running the full workflow of training or testing a baseline method with a single line of code, and comparing baseline methods in an interactive visualization tool. We released PyPulse under the MIT License on Github and PyPI. The source code can be found at: https://github.com/rehg-lab/pulseimpute . keywords Imputation, biosignals, time series, deep learning, signal processing 1 Introduction Biosignal sensor technologies have revolutionized health monitoring and interventions, enabling real-time monitoring of vital physiological signals ( Stuart et al. 2022 ; Abidoye et al. 2011 ; Da Costa et al. 2018 ) . However, a primary challenge in utilizing signals for health monitoring is their susceptibility to missing data due to sensor displacement, technical faults, or interference ( Rahman et al. 2017 ) . Traditional imputation methods, such as mean filling or linear interpolation ( Le et al. 2018 ; Dong et al. 2019 ) , often fail to adequately address the unique characteristics of pulsative signals, such as their quasi-periodicity and the specific morphological features indicative of clinical significance. Additionally, the lack of large-scale, publicly available datasets with realistic missingness patterns has stalled the development and testing of advanced imputation methods. PulseImpute ( Xu et al. 2022 ) addresses this gap as the first work to provide realistic mHealth scenarios and a diverse set of baselines, including a novel transformer-based architecture that captures domain-specific information such as local context through dilated convolutions. However, while these efforts have provided invaluable insight, their work is not easily extendable by non-machine-learning researchers, despite the clear clinical applications. The codebase does not provide an API and has a highly specialized software stack, making it difficult to extend for user-provided custom datasets. For example, a given experiment configuration file is specific to a given dataset, missingness mechanism, and model, with no modularity, making it infeasible use a custom dataset or try experimental combinations of models and missingness mechanisms without significant structural changes to the codebase. User Type Focus Area Use Cases Health Researcher Upload noisy signals to obtain cleaned dataset for downstream analysis. PPG/ECG Imputation for HRV analysis ( Benchekroun et al. 2023 ; Tsai et al. 2021 ) ; Wearable signal imputation for enabling Just-in-Time-Interventions ( Chatterjee et al. 2020 ; Ertin et al. 2011 ; Nahum-Shani et al. 2018 ) Machine Learning Researcher Research in general imputation methodology and theory. General temporal imputation methods ( Cao et al. 2018b ) ; Theoretical work on MAR, MCAR, MNAR mechanisms ( Pedersen et al. 2017 ) ; Uncertainty Modeling to propagate uncertainty to downstream classification ( Jun et al. 2020 ; Shukla and Marlin 2021 ) Interdisciplinary Researcher (Health and ML) Develop novel imputation algorithms for health time-series applications. FFT imputer and BDC transformer for pulsative signal imputation ( Rahman et al. 2015 ; Xu et al. 2022 ) ; ECG-specific imputation ( Bashir and Wei 2018 ; Yang et al. 2020 ; Manimekalai and Kavitha 2018 ) ; PPG quality assessment ( Naeini et al. 2019 ; Orphanidou and Orphanidou 2018 ) Table 1 : Intended audience and their use cases for our PyPulse package In this paper, we introduce PyPulse, a Python package that allows the user to fully customize the process of imputation generation for missing data in a given dataset. PyPulse supports a broad range of scientific and engineering related use cases, as shown in Table 1 . To support these uses, we have created a modularized software stack that provides new capabilities with an API framework: (i) a flexible and user-friendly configuration file stemming from structural changes to every module; (ii) support for custom datasets; (iii) support for custom missingness mechanisms and the ability to select any missingness mechanism with any dataset; (iv) a visualization module to compare the generated imputations of baseline methods on a single interactive plot. At a high level, PyPulse allows a user to run the full workflow by simply running a single command, while optionally uploading a custom dataset or modifying an experimental configuration file. 2 Software Architecture Figure 1 : a) PyPulse framework where blue are the modules, green are the classes, and orange is I/O. b) Example experiment config demonstrating model, data, and train inputs. Figure 1 a shows the software architecture of PyPulse and each module is described below. Experiment Configuration The Configuration module provides an organized hierarchy of YAML files sorted by model type and experiment name. Each configuration file is sorted into three sections: data, model, train. The data section includes the the specific dataset being loaded along with its preprocessing as well as the missingness mechanism to be applied. The model section specifies the imputation model and model-specific parameters. The train section applies training hyperparameters (i.e. batch size). An example of this config can be found in Fig. 1 b. The configuration files are validated before they are run, and they can be defined via command-line arguments or via a specific YAML file. Datasets In PyPulse, flexibility and extendability are achieved through a modular class hierarchy for managing datasets. The abstract base Datasets class manages the preprocessing of general datasets, while specialized subclasses can be defined for loading specific datasets with particular pre-processing necessities (e.g. denoising). The independent Missingness module defines a base class that maps missingness strategies specified in the configuration to their corresponding implementation classes. To facilitate customization, users can extend the Datasets or Missingness base class by overriding their respective preprocessing, data loading methods, and missingness application functions, allowing users to easily handle their unique datasets. Our custom dataset class supports various input formats out of the box. This class-based design ensures that new datasets and missingness methods can be seamlessly integrated without altering existing components. Models Models provides a suite of 11 imputation algorithms that cover both classical and deep learning methodologies. Deep learning include the state-of-the-art BDC transformer method ( Xu et al. 2022 ) and other transformer-based methods, DeepMVI ( Bansal et al. 2021 ) , Vanilla ( Vaswani et al. 2017 ) , Conv9 ( Li et al. 2019 ) , RNN-based BRITS ( Cao et al. 2018a ) , and RNN-GAN-based BRITS with GAIL ( Ho and Ermon 2016 ) and NAOMI ( Liu et al. 2019 ) . Classical include the neighbor-based linear interpolation ( Dong et al. 2019 ) , statistics-based mean filling ( Le et al. 2018 ) , and the frequency-based FFT ( Rahman et al. 2015 ) . The imputation, data loading, and training functionalities are handled generically in the base class for each category of model, and the addition of a specific novel model requires only the re-implementation of the forward pass. Visualization The Visualization module accepts a dataset, missingness type, and any number of