The prediction of health metrics for drivers has become increasingly crucial due to the potential impact of drivers’ health conditions on traffic accidents. Heart attack is one of the primary causes of health-related traffic tragedies. However, drivers’ heart rate (HR) is considered highly-private data, which should not be collected by a centralized server for training the prediction model. To this end, we contribute FedHeart, a novel privacy-preserving federated learning (FL) system for HR prediction. We observe distinct HR changes when drivers are in steady-state and changing-state conditions, and thus we utilize FL to train two separate models for these states. To enhance the prediction accuracy, we incorporate contrastive learning to extract HR features. Through experiments on two real-world datasets, we validate the efficiency of the proposed system in accurately predicting HR during driving scenarios.