Machine learning algorithms for predicting heart failure based on heart sounds captured by electronic stethoscope
Abstract
Heart failure (HF) is a critical medical illness that can be deadly if not diagnosed or predicted in time, as it results from the heart's inability to pump enough blood throughout the body. Traditional diagnostic tools such as electrocardiograms (ECGs), phonocardiograms (PCGs), and stethoscopes have been inadequate for early detection of heart failure. This study leveraged recorded heart-sound data from an electronic stethoscope, converting it into NumPy arrays using Mel-Frequency Cepstral Coefficients (MFCC) to predict heart failure using machine learning (ML) algorithms. The study utilized four ML algorithms: Random Forest (RF), Support Vector Machine (SVM), Gradient Boosting (GB), and Extreme Gradient Boosting (XGBoost). The dataset, comprising 13 MFCC-derived audio features for 300 subjects, was split into 80% for training and 20% for testing using 10-fold cross-validation. To ensure the validity of the reported performance and prevent data leakage, strict patient-wise data separation was enforced, and no feature engineering was conducted after the split. The ML models' performance was assessed using accuracy, sensitivity, precision, specificity, F1-score, precision-recall curve, and Area Under the Curve (AUC) to identify the most accurate model. SVM and XGBoost emerged as the most accurate models in the testing set, achieving 100% accuracy across all metrics and the highest AUCs of 100% for RF, SVM, and XGBoost. Based on heart sound data and ML models, the proposed study has demonstrated superior predictive performance for HF compared with previous studies.