Need help with dynamic?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

195 Stars 72 Forks Other 131 Commits 11 Opened issues


EchoNet-Dynamic is a deep learning model for assessing cardiac function in echocardiogram videos.

Services available


Need anything else?

Contributors list

Interpretable AI for beat-to-beat cardiac function assessment

EchoNet-Dynamic is a end-to-end beat-to-beat deep learning model for 1) semantic segmentation of the left ventricle 2) prediction of ejection fraction by entire video or subsampled clips, and 3) assessment of cardiomyopathy with reduced ejection fraction.

For more details, see the accompanying paper,

Video-based AI for beat-to-beat assessment of cardiac function
David Ouyang, Bryan He, Amirata Ghorbani, Neal Yuan, Joseph Ebinger, Curt P. Langlotz, Paul A. Heidenreich, Robert A. Harrington, David H. Liang, Euan A. Ashley, and James Y. Zou. Nature, March 25, 2020.


We share a deidentified set of 10,030 echocardiogram images which were used for training EchoNet-Dynamic. Preprocessing of these images, including deidentification and conversion from DICOM format to AVI format videos, were performed with OpenCV and pydicom. Additional information is at These deidentified images are shared with a non-commerical data use agreement.


We show examples of our semantic segmentation for nine distinct patients below. Three patients have normal cardiac function, three have low ejection fractions, and three have arrhythmia. No human tracings for these patients were used by EchoNet-Dynamic.

| Normal | Low Ejection Fraction | Arrhythmia | | ------ | --------------------- | ---------- | | | | | | | | | | | | |


First, clone this repository and enter the directory by running:

git clone
cd dynamic

EchoNet-Dynamic is implemented for Python 3, and depends on the following packages: - NumPy - PyTorch - Torchvision - OpenCV - skimage - sklearn - tqdm

Echonet-Dynamic and its dependencies can be installed by navigating to the cloned directory and running

pip install --user .


Preprocessing DICOM Videos

The input of EchoNet-Dynamic is an apical-4-chamber view echocardiogram video of any length. The easiest way to run our code is to use videos from our dataset, but we also provide a Jupyter Notebook,

, to convert DICOM files to AVI files used for input to EchoNet-Dynamic. The Notebook deidentifies the video by cropping out information outside of the ultrasound sector, resizes the input video, and saves the video in AVI format.

Setting Path to Data

By default, EchoNet-Dynamic assumes that a copy of the data is saved in a folder named

in this directory. This path can be changed by creating a configuration file named
(an example configuration file is

Running Code

EchoNet-Dynamic has three main components: segmenting the left ventricle, predicting ejection fraction from subsampled clips, and assessing cardiomyopathy with beat-by-beat predictions. Each of these components can be run with reasonable choices of hyperparameters with the scripts below. We describe our full hyperparameter sweep in the next section.

Frame-by-frame Semantic Segmentation of the Left Ventricle

echonet segmentation --save_video

This creates a directory named

, which will contain - log.csv: training and validation losses - checkpoint of weights for the model with the lowest validation loss - size.csv: estimated size of left ventricle for each frame and indicator for beginning of beat - videos: directory containing videos with segmentation overlay

Prediction of Ejection Fraction from Subsampled Clips

echonet video

This creates a directory named

, which will contain - log.csv: training and validation losses - checkpoint of weights for the model with the lowest validation loss - test_predictions.csv: ejection fraction prediction for subsampled clips

Beat-by-beat Prediction of Ejection Fraction from Full Video and Assesment of Cardiomyopathy

The final beat-by-beat prediction and analysis is performed with

. This script combines the results from segmentation output in
and the clip-level ejection fraction prediction in
. The beginning of each systolic phase is detected by using the peak detection algorithm from scipy (
) and a video clip centered around the beat is used for beat-by-beat prediction.

Hyperparameter Sweeps

The full set of hyperparameter sweeps from the paper can be run via
. In particular, we choose between pretrained and random initialization for the weights, the model (selected from
, and
), the length of the video (1, 4, 8, 16, 32, 64, and 96 frames), and the sampling period (1, 2, 4, 6, and 8 frames).

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.