This study aims to develop a predictive model for heart failure using a multilayer perceptron (MLP) as part of the application of deep learning techniques in medical data analysis. Given the increasing prevalence of heart failure and its significant impact on patients' quality of life and healthcare costs, early detection is of paramount importance. The dataset, obtained from Kaggle, consists of 918 medical records containing 12 key health variables, including age, blood pressure, cholesterol level, and fasting blood sugar. The model underwent extensive training and testing, and its performance was evaluated using statistical measures such as precision, recall, accuracy, and AUC-ROC curve. The results showed that the proposed model achieved a prediction accuracy of 91.1%, with a sensitivity of 90.3% and a specificity of 92%, indicating its effectiveness in predicting heart failure compared to traditional models. Further analysis identified ST-segment depression, resting blood pressure, and cholesterol level as the most influential factors in determining the risk of heart failure. Based on these results, the MLP model can be considered an effective tool to assist physicians in the early diagnosis of heart failure. Optimization techniques such as particle swarm optimization (PSO) can be used to improve prediction accuracy. Furthermore, combining the model with advanced analytical methods may enhance its predictive performance. This study highlights the importance of using artificial neural networks in the medical field, emphasizing their role in improving early diagnosis systems, reducing heart failure complications, and improving the overall quality of healthcare services.