https://github.com/prakashjha1/sensor-based-human-intervention-detection
Objective: Develop an on-device machine-learning model for Android that classifies sensor sequences into four scenarios; walking, handheld still, on-desk with interaction, and on-desk idle using sensor data.
https://github.com/prakashjha1/sensor-based-human-intervention-detection
classification feature-engineering feature-extraction lightgbm machine-learning-algorithms matplotlib neural-networks pandas python3 scikit-learn tensorflow
Last synced: 2 months ago
JSON representation
Objective: Develop an on-device machine-learning model for Android that classifies sensor sequences into four scenarios; walking, handheld still, on-desk with interaction, and on-desk idle using sensor data.
- Host: GitHub
- URL: https://github.com/prakashjha1/sensor-based-human-intervention-detection
- Owner: prakashjha1
- License: mit
- Created: 2025-08-28T16:29:03.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-28T16:48:37.000Z (10 months ago)
- Last Synced: 2025-08-28T23:30:11.638Z (10 months ago)
- Topics: classification, feature-engineering, feature-extraction, lightgbm, machine-learning-algorithms, matplotlib, neural-networks, pandas, python3, scikit-learn, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 577 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sensor Data Classification Pipeline
A comprehensive machine learning pipeline for classifying human motion patterns using sensor data. The system supports multiple classification algorithms, automated feature selection, hyperparameter optimization, and mobile deployment through TensorFlow Lite conversion.
## 🚀 Features
- **Multi-Algorithm Support**: Decision Tree, Random Forest, LightGBM, Neural Network
- **Automated Feature Engineering**: Rolling statistics, magnitude, and rate features
- **Feature Selection**: Recursive Feature Elimination with Cross-Validation (RFECV)
- **Hyperparameter Optimization**: Grid search with cross-validation
- **Mobile Deployment**: TensorFlow Lite model conversion for Android
- **Comprehensive Evaluation**: Per-class metrics, confusion matrices, and performance analysis
### Prerequisites
```bash
Python 3.8+
```
### Required Dependencies
```bash
pip install pandas numpy scikit-learn lightgbm tensorflow matplotlib seaborn joblib
```
## 📁 Output Files
The pipeline generates a timestamped results directory with the following files:
```
model_results_YYYYMMDD_HHMMSS/
├── best_model.pkl # Best performing model
├── feature_selector.pkl # Feature selection transformer
├── scaler.pkl # Data scaler (if needed)
├── test_predictions.csv # Predictions on test set
├── results_summary.json # Comprehensive results
├── [ModelName]_model.tflite # TensorFlow Lite model
└── confusion_matrix_[ModelName].png # Confusion matrices
```
### Results Summary Structure
```json
{
"timestamp": "20250828_143022",
"best_model_name": "Random Forest",
"best_model_score": 0.9456,
"model_comparison": {
"Random Forest": {
"accuracy": 0.9456,
"auc_score": 0.9678,
"model_size_kb": 145.2,
"needs_scaling": false
}
},
"files_created": {
"predictions": "test_predictions.csv",
"best_model": "best_model.pkl",
"tflite_model": "Random_Forest_model.tflite",
"tflite_size_kb": 89.3
}
}
```