Transthoracic Echocardiography (TTE) is a crucial tool for assessing cardiac morphology and function quickly and non-invasively without ionizing radiation. However, the examination is subject to intra- and inter-user variability and recordings are often limited to 2D imaging and assessments of end-diastolic and end-systolic volumes. Current 3D TTE is time-consuming and provides lower image quality than 2D TTE. We have developed a novel, fully automated machine learning-based framework to generate a 4D (3D plus time) personalized model of the left ventricular (LV) blood pool. This digital twin was generated from specific 2D echocardiographic views employing deep neural networks, pre-trained on a synthetic dataset, and fine-tuned in a self-supervised manner using a novel optimization method for cross-sectional imaging data. This 4D model enabled detailed three dimensional analyses of LV systolic and diastolic function with high temporal resolution. Validation was performed on a multi-center dataset encompassing TTE exams of 144 patients with normal TTEs (controls) and 314 patients with acute myocardial infarction (AMI). LV volume measurements in controls derived from the digital twin showed a high correlation with the values from the clinical TTE reports (Pearson correlation coefficient of 0.7). In AMI patients, these novel biomarkers showed a high predictive value for survival (area under the curve (AUC) of 0.82 for 1-year all-cause mortality) and and excellent diagnostic value for infarct localisation and quantification, bearing the potential to improve diagnostic accuracy and risk assessment. Thus, our digital twin allows for fully automated robust LV shape analyses over time including contractility, relaxation, and regional wall motion abnormalities aiming at replacing expensive 3D imaging modalities with cheaper and more versatile 2D cardiac ultrasound.