Background Human activity recognition poses a complex challenge in predicting individuals’ movements from raw sensor data using machine learning models. This paper explores the application of six prominent machine learning techniques – decision tree, random forest, linear regression, Naïve Bayes, k-nearest neighbor, and neural networks – to enhance the accuracy of human activity detection for e-health systems. Despite previous research efforts employing data mining and machine learning, there remains room for improvement in performance. The study focuses on predicting activities such as walking, standing, laying, sitting, walking upstairs, and walking downstairs. Methods The research employs six machine learning algorithms to recognize human activities, including decision tree, random forest, linear regression, Naïve Bayes, k-nearest neighbor, and neural networks. Results Evaluation of the human activity recognition dataset reveals that the random forest classifier, CNN, GRN and neural network yield promising results, achieving high accuracy. However, Naïve Bayes falls short of satisfying outcomes. Conclusions The study successfully classifies activities like SITTING, STANDING, LAYING, WALKING, WALKING_DOWNSTAIRS, and WALKING_UPSTAIRS with a remarkable accuracy of 98%. The contribution lies in the thorough exploration of machine learning techniques, with neural networks emerging as the most effective in enhancing human activity recognition. The findings showcase the potential for advanced applications in e-health systems and beyond.