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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
tags:
|
| 8 |
- sensor
|
| 9 |
- physics
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
# Hand Detection Training Data
|
| 14 |
+
|
| 15 |
+
This folder contains sensor data collected from mobile devices for training the hand detection model.
|
| 16 |
+
|
| 17 |
+
## Overview
|
| 18 |
+
|
| 19 |
+
The dataset includes accelerometer and gyroscope readings from 2 subjects, each holding a device with both their left and right hands. This data is used to train the Random Forest classifier that achieves 94.6% accuracy in detecting which hand is holding the device.
|
| 20 |
+
|
| 21 |
+
## Directory Structure
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
hand_data/
|
| 25 |
+
├── accelerometer/ # Accelerometer sensor data (primary)
|
| 26 |
+
│ ├── s-1_left_hand.csv # Subject 1, left hand (39,102 samples)
|
| 27 |
+
│ ├── s-1_right_hand.csv # Subject 1, right hand (30,528 samples)
|
| 28 |
+
│ ├── s-2_left_hand.csv # Subject 2, left hand (44,724 samples)
|
| 29 |
+
│ └── s-2_right_hand.csv # Subject 2, right hand (35,408 samples)
|
| 30 |
+
│
|
| 31 |
+
└── gyrocop/ # Gyroscope data (supplementary)
|
| 32 |
+
├── s-1_left_hand.csv # Subject 1, left hand
|
| 33 |
+
└── s-1_right_hand.csv # Subject 1, right hand
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Data Format
|
| 37 |
+
|
| 38 |
+
### Accelerometer Data
|
| 39 |
+
|
| 40 |
+
Each CSV file contains timestamped 3-axis accelerometer readings:
|
| 41 |
+
|
| 42 |
+
| Column | Type | Description |
|
| 43 |
+
|-----------|-----------|------------------------------------------|
|
| 44 |
+
| timestamp | datetime | ISO 8601 format (e.g., 2025-12-27T09:13:07.598506) |
|
| 45 |
+
| x | float | X-axis acceleration (m/s²) |
|
| 46 |
+
| y | float | Y-axis acceleration (m/s²) |
|
| 47 |
+
| z | float | Z-axis acceleration (m/s²) |
|
| 48 |
+
|
| 49 |
+
**Example:**
|
| 50 |
+
```csv
|
| 51 |
+
timestamp,x,y,z
|
| 52 |
+
2025-12-27T09:13:07.598506,0.849452,3.895515,8.087741
|
| 53 |
+
2025-12-27T09:13:08.083118,0.727418,4.000800,8.099705
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
### Gyroscope Data
|
| 57 |
+
|
| 58 |
+
Similar structure with angular velocity measurements (°/s).
|
| 59 |
+
|
| 60 |
+
## Dataset Statistics
|
| 61 |
+
|
| 62 |
+
### Total Samples
|
| 63 |
+
- **Subject 1 (Left)**: 39,102 samples
|
| 64 |
+
- **Subject 1 (Right)**: 30,528 samples
|
| 65 |
+
- **Subject 2 (Left)**: 44,724 samples
|
| 66 |
+
- **Subject 2 (Right)**: 35,408 samples
|
| 67 |
+
- **Total**: 149,762 samples
|
| 68 |
+
|
| 69 |
+
### Collection Method
|
| 70 |
+
- Device: Mobile phone with accelerometer sensor
|
| 71 |
+
- Sampling rate: ~50-100 Hz (varies)
|
| 72 |
+
- Duration: Multiple sessions per subject/hand
|
| 73 |
+
- Environment: Normal daily usage patterns
|
| 74 |
+
|
| 75 |
+
## Data Characteristics
|
| 76 |
+
|
| 77 |
+
### X-Axis (Left/Right Tilt)
|
| 78 |
+
- **Primary discriminator** for hand detection
|
| 79 |
+
- Left hand: Positive values (device tilts right)
|
| 80 |
+
- Right hand: Negative values (device tilts left)
|
| 81 |
+
- Statistical significance: p < 0.000001
|
| 82 |
+
|
| 83 |
+
### Y-Axis (Forward/Backward Tilt)
|
| 84 |
+
- Secondary feature
|
| 85 |
+
- Shows hand-specific patterns
|
| 86 |
+
- Less discriminative than X-axis
|
| 87 |
+
|
| 88 |
+
### Z-Axis (Vertical)
|
| 89 |
+
- Represents gravity component
|
| 90 |
+
- Generally around 9.8 m/s² when stationary
|
| 91 |
+
- Varies with device orientation
|
| 92 |
+
|
| 93 |
+
### Magnitude
|
| 94 |
+
- Calculated: √(x² + y² + z²)
|
| 95 |
+
- Overall movement intensity
|
| 96 |
+
- Helps distinguish activity levels
|
| 97 |
+
|
| 98 |
+
## Usage in Training
|
| 99 |
+
|
| 100 |
+
This data is used in [../which_hand_you_use.ipynb](https://github.com/rockerritesh/sensor/blob/main/hand/which_hand_you_use.ipynb) for:
|
| 101 |
+
|
| 102 |
+
1. **Exploratory Data Analysis (EDA)**
|
| 103 |
+
- Distribution analysis
|
| 104 |
+
- Statistical testing
|
| 105 |
+
- Correlation analysis
|
| 106 |
+
- Time series visualization
|
| 107 |
+
|
| 108 |
+
2. **Feature Engineering**
|
| 109 |
+
- Calculate magnitude
|
| 110 |
+
- Window-based statistics (mean, std, min, max)
|
| 111 |
+
- Temporal features (deltas, trends)
|
| 112 |
+
|
| 113 |
+
3. **Model Training**
|
| 114 |
+
- Single-point Random Forest (94.6% accuracy)
|
| 115 |
+
- Windowed Random Forest (96%+ accuracy)
|
| 116 |
+
- PCA for visualization
|
| 117 |
+
|
| 118 |
+
## File Sizes
|
| 119 |
+
|
| 120 |
+
- `s-1_left_hand.csv`: ~2.1 MB
|
| 121 |
+
- `s-1_right_hand.csv`: ~1.7 MB
|
| 122 |
+
- `s-2_left_hand.csv`: ~2.4 MB
|
| 123 |
+
- `s-2_right_hand.csv`: ~2.0 MB
|
| 124 |
+
|
| 125 |
+
**Total**: ~8.2 MB (accelerometer only)
|
| 126 |
+
|
| 127 |
+
## Data Quality
|
| 128 |
+
|
| 129 |
+
### Completeness
|
| 130 |
+
✅ No missing values
|
| 131 |
+
✅ Continuous timestamps
|
| 132 |
+
✅ Consistent format across all files
|
| 133 |
+
|
| 134 |
+
### Statistical Validation
|
| 135 |
+
✅ Normal distribution per axis
|
| 136 |
+
✅ Significant hand differences (p < 0.05)
|
| 137 |
+
✅ Consistent patterns across subjects
|
| 138 |
+
|
| 139 |
+
## Privacy & Ethics
|
| 140 |
+
|
| 141 |
+
- Data collected with informed consent
|
| 142 |
+
- No personally identifiable information
|
| 143 |
+
- Used solely for research purposes
|
| 144 |
+
- Anonymized subject identifiers (S1, S2)
|
| 145 |
+
|
| 146 |
+
## Collection Guidelines
|
| 147 |
+
|
| 148 |
+
If collecting additional data:
|
| 149 |
+
|
| 150 |
+
1. **Consistency**: Use same device/settings
|
| 151 |
+
2. **Duration**: Minimum 5-10 minutes per hand
|
| 152 |
+
3. **Activity**: Natural usage (browsing, typing, etc.)
|
| 153 |
+
4. **Labeling**: Clear hand identification
|
| 154 |
+
5. **Format**: Match existing CSV structure
|
| 155 |
+
|
| 156 |
+
## Notes
|
| 157 |
+
|
| 158 |
+
- This data is **excluded from git** (see `.gitignore`)
|
| 159 |
+
- Keep data locally or use Git LFS for large files
|
| 160 |
+
- Model files are generated from this data
|
| 161 |
+
- Data collection scripts in `shared/` folder
|
| 162 |
+
|
| 163 |
+
## Related Files
|
| 164 |
+
|
| 165 |
+
- **Training**: [../which_hand_you_use.ipynb](https://github.com/rockerritesh/sensor/blob/main/hand/which_hand_you_use.ipynb)
|
| 166 |
+
- **Models**: `hand_classifier_*.pkl` files
|
| 167 |
+
- **Collection**: `collect_data.py` in shared folder
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
**Last Updated**: December 2025
|
| 172 |
+
**Format Version**: 1.0
|
| 173 |
+
**Total Samples**: 149,762
|