Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time

Effective Sample Pair Generation for Ultrasound Video Contrastive Representation Learning


This repository includes the constructed US-4 dataset and source codes (PyTorch version) for USCL: paper.


Most deep neural networks (DNNs) based ultrasound (US) medical image analysis models use pretrained backbones (e.g., ImageNet) for better model generalization. However, the domain gap between natural and medical images causes an inevitable performance bottleneck when applying to US image analysis. Our idea is to pretrain DNNs on US images directly to avoid this bottleneck. Due to the lack of annotated large-scale datasets of US images, we first construct a new large-scale US video-based image dataset named US-4, containing over 23,000 high resolution images from four US video sub-datasets, where two sub-datasets are newly collected by our local experienced doctors. To make full use of this dataset, we then innovatively propose an US semi-supervised contrastive learning (USCL) method to effectively learn feature representations of US images, with a new sample pair generation (SPG) scheme to tackle the problem that US images extracted from videos have high similarities. Moreover, the USCL treats contrastive loss as a consistent regularization, which boosts the performance of pretrained backbones by combining the supervised loss in a mutually reinforcing way. Extensive experiments on down-stream tasks' fine-tuning show the superiority of our approach against ImageNet pretraining and pretraining using previous state-of-the-art semi-supervised learning approaches. In particular, our pretrained backbone gets fine-tuning accuracy of over 94%, which is 9% higher than 85% of the ImageNet pretrained model on the widely used POCUS dataset. The constructed US-4 dataset and source codes of this work will be made public.


US-4 dataset

The US-4 dataset will be available at US-4.


Quick Start

Fine-tune with Pretrained Model

  1. Pick a model and its config file, for example, config.yaml
  2. Download the model best_model.pth
  3. Download the 5 fold cross validation POCUS dataset
  4. Run the demo with

Our pretrained ResNet-18 model on US-4 dataset can be downloaded as following:

Name epochs Project head Classifier Accuracy download
ResNet-18 300 Yes Yes 94.19 model

This repository reports the fine-tuning accuracy (%) on POCUS dataset.

Train Your Own Model

Coming soon.


The code is developed with an Intel Xeon Silver 4210R CPU @ 2.4GHz and a single Nvidia Tesla V100 GPU.



Licensed under an MIT license.


If you find the code and dataset useful in your research, please consider citing:

    title={Effective Sample Pair Generation for Ultrasound Video Contrastive Representation Learning},
    author = {Yixiong Chen, and Chunhui Zhang, and Li Liu, and Cheng Feng, and Changfeng Dong, and Yongfang Luo, and Xiang Wan},
    journal = {arXiv},
    year = {2020}

    title={POCOVID-Net: automatic detection of COVID-19 from a new lung ultrasound imaging dataset (POCUS)},
    author={Born Jannis, and Br{\"a}ndle, Gabriel, and Cossio Manuel, and Disdier Marion, and Goulet Julie, and Roulin J{\'e}r{\'e}mie, and Wiedemann Nina},

    author={O. Somphone, and S. Allaire, and B. Mory, and C. Dufour},
    title={Live Feature Tracking in Ultrasound Liver Sequences with Sparse Demons},
    booktitle = {International Conference on Medical Image Computing and Computer Assisted Intervention Workshop},
    pages = {53-60}, 


Feedbacks and comments are welcome! Feel free to contact us via or or



This repository includes the constructed US-4 dataset and the code for USCL (PyTorch version).




No releases published


No packages published