CardioFit: A WebGL-Based Tool for Fast and Efficient Parameterization of Cardiac Action Potential Models to Fit User-Provided Data

Darby I. Cairns, Maxfield R. Comstock, Flavio H. Fenton, Elizabeth M. Cherry · 2025

Read CardioFit: A WebGL-Based Tool for Fast and Efficient Parameterization of Cardiac Action Potential Models to Fit User-Provided Data by Darby I. Cairns, Maxfield R. Comstock, Flavio H. Fenton, Elizabeth M. Cherry (2025) 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-2504-13274.txt.

Introduction

Darby Cairns and co-authors present in this 2025 paper CardioFit, a browser tool that fits heart-cell models to a user's own data in seconds. Models of the cardiac action potential let researchers test how rhythm shifts under drugs or disease, but each new case needs parameters matched to recordings. That fitting is slow and fiddly by hand.

CardioFit runs a particle swarm search in JavaScript, sped by the graphics hardware through WebGL. Users pick which parameters may move, set their ranges, and steer the swarm. Fits land in a few seconds across many models and data sets, and the runs reveal how model choice and data shape the outcome.

Catalog record

CREATORDarby I. Cairns, Maxfield R. Comstock, Flavio H. Fenton, Elizabeth M. Cherry
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE76 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2504-13274

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

CardioFit: A WebGL-Based Tool for Fast and Efficient Parameterization of Cardiac Action Potential Models to Fit User-Provided Data Darby I. Cairns, Maxfield R. Comstock, Flavio H. Fenton, Elizabeth M. Cherry Abstract Cardiac action potential models allow examination of a variety of cardiac dynamics, including how behavior may change under specific interventions. To study a specific scenario, including patient-specific cases, model parameter sets must be found that accurately reproduce the dynamics of interest. To facilitate this complex and time-consuming process, we present an interactive browser-based tool that uses the particle swarm optimization (PSO) algorithm implemented in JavaScript and taking advantage of the WebGL API for hardware acceleration. Our tool allows rapid customization and can find low-error fittings to user-provided voltage time series or action potential duration data from multiple cycle lengths in a few iterations (10-32), corresponding to a runtime of a few seconds on most machines. Additionally, our tool focuses on ease of use and flexibility, providing a webpage interface that allows users to select a subset of parameters to fit, set the range of values each parameter is allowed to assume, and control the PSO algorithm hyperparameters. We demonstrate our tool’s utility by fitting a variety of models to different datasets, showing how convergence is affected by model choice, dataset properties, and PSO algorithmic settings, and explaining new insights gained about the physiological and dynamical roles of the model parameters. Keywords : cardiac modeling, parameter fitting, particle swarm optimization, identifiability 1 Background Mathematical models are widely used to predict and analyze the electrical behavior of cardiac cells and tissue. Although solving the differential equations that underlie most modern models of cardiac action potentials [ 1 ] is a challenging numerical task [ 2 ] , due to the often large number of variables required to describe them as well as the large number of cells required for 2 and 3D simulations. Software like Chaste [ 3 ] , OpenCarp [ 4 ] , and a set of WebGL programs [ 5 , 6 ] have been developed to simplify obtaining model solutions. However, even relatively simple cardiac models include many parameters whose values can be modified to represent cells and tissue under different conditions and to accommodate the inherent variability between individuals [ 7 ] Because these parameters have complex, interacting effects on the model output, finding a set of parameters for a model that accurately captures the relevant behavior of data recorded from experiments or from a different model is challenging. A variety of approaches have been used to tackle the problem of finding appropriate parameter values, including simulated annealing [ 8 ] , least squares [ 9 ] and gradient-based approaches [ 10 ] , and regression methods [ 11 , 12 ] . Genetic algorithms, which maintain a pool of candidate solutions (parameterizations) that are improved using biologically-inspired crossover, selection, and mutation transformations, also have been widely used [ 13 , 14 , 15 , 16 , 17 ] . Particle swarm optimization (PSO) similarly maintains a pool of candidate solutions, but rather than evolving the individuals according to rules inspired by genetics, the candidates move in random degrees toward the best solutions that have been identified in previous iterations [ 18 , 19 , 20 ] ; it has also been combined with a quadratic optimization algorithm in a hybrid approach to improve convergence [ 21 ] . Techniques like data assimilation [ 22 , 23 ] also have been used to estimate parameter values along with the system state. As an alternative to more traditional optimization methods, Bayesian approaches have been used to estimate not a single set of parameter values but a posterior probability distribution—given a model output, how likely a particular model parameterization is—using a variety of algorithms, such as Markov chain Monte Carlo [ 24 ] , approximate Bayesian computation [ 25 , 26 ] , Bayesian active learning [ 27 ] , Bayesian history matching [ 28 ] , and Hamiltonian Monte Carlo [ 29 , 30 ] . Implementations for many of these approaches to fitting cardiac model parameters may require extensive programming, so that the selection of a technique for a particular application may depend on prior experience and preferences. In the present study, we present CardioFit, a tool to find cardiac model parameterizations that is fast, flexible, easy to use, and applicable in many settings without requiring detailed understanding of the model parameters or optimization algorithm. To promote computational efficiency, we utilize the parallelism provided by graphics hardware on modern computers, which influences our choice of optimization approach toward one that can benefit from this architecture. Toward this end, CardioFit uses PSO to optimize parameter values for several cardiac models to match user-provided datasets. PSO requires updating a pool of candidate solutions over multiple iterations, with each candidate solution at each iteration requiring a full solution of the model to be compared with the data. Due to its limited communication needs, the PSO algorithm is well suited to be executed on thousands of cores in parallel. Consequently, CardioFit can implement PSO with a large candidate pool (up to tens of thousands) and often can identify a low-error parameter fitting within a few dozen iterations in seconds, even on modest hardware, without sacrificing accuracy. As CardioFit uses the WebGL API for JavaScript and is implemented as a webpage, no machine-specific manual compilation or installation is necessary to optimize performance. The only setup required is visiting a website hosting the program or downloading the code and opening it in a web broswer. The source code for the CardioFit program is publicly available on GitHub 1 1 1 http://github.com/mcomstock/cardiofit-royalsociety-2024 . Previously, we have shown that this approach is capable of fitting a cardiac action potential (AP) model to data taken from explanted human hearts with Brugada syndrome [ 31 ] and to data generated from complex cardiac models [ 20 ] . In this work, we present a detailed description of CardioFit’s implementation and quantify its effectiveness. We find that CardioFit can fit datasets taken from biophysically complex models to several phenomenological and minimal cardiac models, accurately capturing key properties of the original data, such as AP duration (APD), alternans, and action potential morphology. We demonstrate similarly accurate fittings for a variety of experimental data sets, with as many model parameter values being fit simultaneously as desired. We also show that with available graphics hardware, a large number of candidate solutions can be used to find appropriate model parameterizations with just tens of PSO iterations. In addition, the fitting process leads to additional insights into the roles of parameters in cardiac models as well as identifiability. 2 Methods In this section, we provide information about the cardiac models and their simulation, the optimization algorithm, and the datasets considered as well as CardioFit’s design and implementation. Additional details are available in the Supplement. 2.1 Cardiac action potential models The two- to four-variable cardiac models used in CardioFit describe the change in a dimensionless voltage variable u over time: \displaystyle\frac{du}{dt}=I_{\text{tot}}+I_{\text{stim}}, (1) where I_{\text{tot}} is a function of u and one or more variables that evolve in time according to the specific model and I_{\text{stim}} is an external stimulus current. The models currently

Read the complete text