Dual-Location Smartphone IMU Human Activity Recognition Dataset (Hand & Ankle, 60s Trials)
Description
This dataset was created to study smartphone-based Human Activity Recognition (HAR) using raw inertial signals recorded at two common body locations (hand and ankle). The working hypothesis is that longer, continuous recordings (approximately 60 seconds per activity) and multi-sensor fusion (accelerometer, gyroscope, magnetometer) provide richer temporal and biomechanical signatures that improve activity classification, and that non-linear ensemble models capture these relationships more effectively than linear classifiers. What the data contains • Raw sensor streams exported as CSV files from a smartphone IMU logger (Phyphox). • Each trial typically includes three separate CSV files: accelerometer, gyroscope, and magnetometer. • Each CSV contains a time column (seconds) and tri-axial measurements (X, Y, Z) with sensor-specific units. • Two placement conditions are included: hand-held and ankle/foot-mounted. • Ground-truth labels correspond to six daily activities; labels may be encoded jointly with placement (e.g., Walking_Hand, Walking_Foot) to form a 12-class setup. How the data was gathered • Participants performed each activity for approximately 60 seconds per placement. • Recordings were made in real time using a standard smartphone and the Phyphox application, then exported to CSV. • Participants were anonymized; the study followed a minimal-risk, non-invasive protocol with informed consent. How to interpret and use the data • Use the time column as the temporal index for each sensor stream. • For multi-sensor modeling, align streams by time and merge accelerometer, gyroscope, and magnetometer to form a 9-channel signal (Acc/Gyro/Mag × X/Y/Z). • For window-based learning, segment continuous signals with overlapping sliding windows (e.g., 150 samples per window, stride 100 samples). • If using classical ML, compute window-level statistical features (mean, standard deviation, min, max, range, and signal energy) for each channel; this yields 54 features per placement (9 channels × 6 statistics), or 108 features when concatenating hand and ankle features (feature-level fusion).
Files
Steps to reproduce
A. Data collection protocol (raw dataset reproduction) 1. Install Phyphox on an Android smartphone with functioning accelerometer, gyroscope, and magnetometer sensors. 2. Recruit participants and assign anonymized IDs; obtain informed consent under a minimal-risk protocol. 3. Define two placement conditions: (i) hand-held in portrait orientation, and (ii) ankle/foot-mounted with an elastic strap near the ankle. 4. For each participant and each placement, record each activity (Walking, Walking Upstairs, Walking Downstairs, Standing, Sitting, Laying) for approximately 60 seconds. 5. Export CSV logs for accelerometer, gyroscope, and magnetometer for each trial, ensuring time (seconds) and X/Y/Z axes are included. B. Data processing workflow (to reproduce the modeling-ready dataset) 6. Load the three sensor CSV files for a trial (accelerometer, gyroscope, magnetometer). 7. Round time stamps to two decimals (e.g., Time = round(Time, 2)) to facilitate alignment. 8. Perform an inner join/merge across the three streams on the time column to keep only synchronized rows. 9. Construct a fused 9-channel matrix per placement: AccX, AccY, AccZ, GyroX, GyroY, GyroZ, MagX, MagY, MagZ. 10. Segment the fused signals into overlapping sliding windows (150 samples per window; stride 100 samples). 11. Assign a label to each window according to the activity and, if desired, include placement in the label (e.g., Sitting_Hand, Sitting_Foot). 12. Option A (classical ML): extract window-level statistical features (mean, std, min, max, range, energy) per channel; concatenate features across placements for feature-level fusion. C. Model training and evaluation (baseline reproduction) 13. Split windowed samples into training and testing sets (e.g., 80% train / 20% test). 14. Train baseline models such as Random Forest, XGBoost, and LinearSVC using extracted features. 15. Evaluate using accuracy, precision, recall, F1-score, and a confusion matrix. 16. Compare results against the manuscript baseline: Random Forest ~96.13%, XGBoost ~85.22%, LinearSVC ~58.54% accuracy (values may vary depending on random seeds and exact preprocessing).