Klasifikasi Aktivitas Manusia Menggunakan Algoritma Random Forest pada Dataset Imbalanced Smartphone Sensor

Authors

  • Muhammad Ali Rozai Universitas Muhammadiyah Jember
  • Agung Nilogiri STIKOM Tunas Bangsa
  • Taufiq Timur STIKOM Tunas Bangsa
  • Triawan STIKOM Tunas Bangsa
  • Qurotta A’yun STIKOM Tunas Bangsa

Keywords:

random forest, SMOTE, class imbalance, human activity recognition, hyperparameter tuning

Abstract

Human Activity Recognition (HAR) berbasis sensor smartphone memiliki potensi untuk mendukung berbagai aplikasi, namun ketidakseimbangan kelas (class imbalance) dapat memengaruhi kemampuan model dalam mengenali kelas minoritas. Penelitian ini bertujuan menganalisis kinerja Random Forest sebelum dan sesudah penanganan class imbalance serta pengaruh hyperparameter tuning menggunakan GridSearchCV dalam mengklasifikasikan aktivitas Standing dan Walking. Dataset Accelerometer and Gyroscope Mobile Phone dari UCI Machine Learning Repository terdiri atas 31.991 sampel dan setelah cleaning menjadi 31.847 sampel dengan rasio ketidakseimbangan sekitar 1:54,8. Metode yang digunakan meliputi preprocessing, normalisasi MinMaxScaler, SMOTE (k-neighbors=5) pada data latih, dan pengujian empat kondisi model pada stratified split 70:30 dan 80:20. Evaluasi menggunakan Accuracy, Macro Precision, Macro Recall, dan Macro F1-Score, dengan Macro F1-Score sebagai metrik utama. Hasil menunjukkan bahwa SMOTE meningkatkan Macro F1-Score dari 63,48% menjadi 69,12% pada split 70:30 dan dari 61,44% menjadi 67,88% pada split 80:20. Hyperparameter tuning memberikan pengaruh yang berbeda pada setiap kondisi, dengan hasil terbaik pada kombinasi SMOTE dan tuning pada split 70:30 sebesar 69,12%, sedangkan pada split 80:20 meningkat dari 67,88% menjadi 68,26%. Robustness check menggunakan sepuluh random seed menunjukkan hasil yang relatif konsisten dengan standar deviasi yang rendah.

References

ALANAZI, M., ALDAHR, R.S. & ILYAS, M., 2024. Human Activity Recognition through Smartphone Inertial Sensors with ML Approach. Engineering, Technology and Applied Science Research, 14(1), pp.12780-12787.

ALSAHLY, A., 2022. Accelerometer and Gyroscope Mobile Phone Dataset. UCI Machine Learning Repository. https://doi.org/10.3390/s22176513

BALAHA, H.M. & HASSAN, A.E.-S., 2023. Comprehensive Machine and Deep Learning Analysis of Sensor-Based Human Activity Recognition. Neural Computing and Applications, 35(17), pp.12793-12831.

BARREÑADA, L., DHIMAN, P., TIMMERMAN, D., BOULESTEIX, A.L. & VAN CALSTER, B., 2024. Understanding Overfitting in Random Forest for Probability Estimation: a Visualization and Simulation Study. Diagnostic and Prognostic Research, pp.1-15.

BICHRI, H., CHERGUI, A. & HAIN, M., 2024. Investigating the Impact of Train/Test Split Ratio on the Performance of Pre-Trained Models with Custom Datasets. International Journal of Advanced Computer Science and Applications, 15(2), pp.331-339.

BREIMAN, L., 2001. Random Forests. Machine Learning, 45(1), pp.5-32.

CHAWLA, N.V., BOWYER, K.W., HALL, L.O. & KEGELMEYER, W.P., 2002. SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research, 16, pp.321-357.

HAIRANI, H., ANGGRAWAN, A. & PRIYANTO, D., 2023. Improvement Performance of the Random Forest Method on Unbalanced Diabetes Data Classification Using SMOTE-Tomek Link. Bulletin of Electrical Engineering and Informatics, 7, pp.258-264.

MADE LIANDANA, I.M., SUSILA, I.M.D. & ATMOJO, Y.P., 2024. Pengenalan Aktivitas Manusia dengan Seleksi Fitur ANOVA dan Mutual Information (MI) pada Data Sensor Accelerometer Berbasis Machine Learning. Jurnal Sistem Dan Informatika (JSI), 18(2), pp.118-130.

MURAINA, I., 2022. Ideal Dataset Splitting Ratios in Machine Learning Algorithms: General Concerns for Data Scientists and Data Analysts. In: Proceedings of the International Conference on Software Engineering and Computer Systems.

PIRES, I.M., HUSSAIN, F., GARCIA, N.M. & LAMESKI, P., n.d. Homogeneous Data Normalization and Deep Learning: A Case Study in Human Activity Classification.

RAINIO, O., 2024. Evaluation Metrics and Statistical Tests for Machine Learning. Scientific Reports, pp.1-14.

TANGIRALA, S., 2020. Evaluating the Impact of GINI Index and Information Gain on Classification using Decision Tree Classifier Algorithm. International Journal of Advanced Computer Science and Applications, 11(2), pp.612-619.

THAKUR, D. & BISWAS, S., 2023. Guided Regularized Random Forest Feature Selection for Smartphone Based Human Activity Recognition. Journal of Ambient Intelligence and Humanized Computing, 14(7), pp.9767-9779.

WIDIAWATI, C.R.A. & YUNITA, I.R., 2025. Enhancing Minority Class Prediction in Wearable Sensor-Based Activity Recognition Using SMOTE Oversampling. International Journal for Applied Information Management, 5(1), pp.1-15.

ZHANG, P., JIA, Y. & SHANG, Y., 2022. Research and Application of XGBoost in Imbalanced Data. Measurement and Control, 18(263).

Downloads

Published

24-08-2026