Exploring the impact of window size, overlap, and hyperparameter tuning on the performance of deep learning models in sensor-based human activity recognition
摘要
Sensor-based Human Activity Recognition (HAR) is a fundamental component of health monitoring, smart environments, and wearable intelligence; however, temporal segmentation parameters are often selected heuristically, limiting reproducibility and performance. This work proposes a systematic, data-driven framework to quantify the impact of window size (1–10 s) and overlap ratio (25%, 50%, 75%) on HAR performance. A uniform segmentation strategy is applied across LSTM, Bi-LSTM, and CNN–BiLSTM architectures to ensure fair and unbiased comparison. Experiments are conducted on the PAMAP2 benchmark dataset, which comprises diverse daily, household, and dynamic physical activities recorded using multiple body-worn inertial sensors. Bayesian Optimization, implemented via Optuna with the Tree-structured Parzen Estimator (TPE), is employed to jointly optimize temporal segmentation, architectural, and training hyperparameters. The search space includes window size, overlap ratio, recurrent and convolutional units, kernel and pooling dimensions, dense-layer width, dropout rate, learning rate, batch size, optimizer selection, and training epochs. Early stopping with a patience of five epochs is used to ensure stable convergence. Performance is evaluated using Accuracy, Precision, Recall, F1-score, and Specificity under fivefold and tenfold window-level cross-validation. Results demonstrate that small window sizes combined with high overlap significantly enhance sensitivity to activity transitions, as confirmed through confusion-matrix-based class-wise analysis, while larger windows favor sustained activities with smoother temporal dynamics. The optimized CNN–BiLSTM model, using a 1 s window with 75% overlap, achieves up to 99.65–99.80% accuracy and 99.99% specificity, outperforming recent PAMAP2 baselines by up to 8.35%.These findings establish segmentation-aware design principles for robust and reproducible HAR and demonstrate that high recognition accuracy can be achieved with low-latency inference, supporting real-time deployment on wearable and edge platforms. Future work will extend this framework to leave-one-subject-out (LOSO) validation and multi-dataset evaluation to further assess subject-independent generalization.