  Contrastive learning has proven useful in many applications where access to
labelled data is limited. The lack of annotated data is particularly
problematic in medical image segmentation as it is difficult to have clinical
experts manually annotate large volumes of data such as cardiac structures in
ultrasound images of the heart. In this paper, We propose a self supervised
contrastive learning method to segment the left ventricle from echocardiography
when limited annotated images exist. Furthermore, we study the effect of
contrastive pretraining on two well-known segmentation networks, UNet and
DeepLabV3. Our results show that contrastive pretraining helps improve the
performance on left ventricle segmentation, particularly when annotated data is
scarce. We show how to achieve comparable results to state-of-the-art fully
supervised algorithms when we train our models in a self-supervised fashion
followed by fine-tuning on just 5\% of the data. We show that our solution
outperforms what is currently published on a large public dataset
(EchoNet-Dynamic) achieving a Dice score of 0.9252. We also compare the
performance of our solution on another smaller dataset (CAMUS) to demonstrate
the generalizability of our proposed solution. The code is available at
(https://github.com/BioMedIA-MBZUAI/contrastive-echo).
