Back to project index
Project
Human Activity Classification
Sensor preprocessing and comparison of decision tree, Random Forest, and support vector classifiers for activity recognition.
How it’s builtHow it’s built
Human Activity Classification · Wearable sensor classifier for 19 daily and sports activities
I built a pipeline that flattens per-segment wearable sensor files, standardises them, reduces them with PCA to 50 components, and compares Decision Tree, Random Forest and SVC classifiers with timing and confusion matrices across 19 activities. The saved Random Forest, scaler and PCA are served in a Streamlit app that classifies an uploaded sensor .txt file.
- activity classes
- 19
- classifiers compared
- 3
- PCA components used for training
- 50
- serialised artefacts served
- 3
Technology and what it does here
- scikit-learn 1.2
- StandardScaler, PCA, Decision Tree, Random Forest and SVC with accuracy, precision, F1
- pandas / NumPy
- Reads each sensor .txt segment and flattens it into one feature vector
- Streamlit
- App.py uploads a sensor file and shows the predicted activity and probabilities
- joblib
- Loads the saved model, scaler and PCA in app.py
- matplotlib / seaborn
- Explained-variance plots and confusion matrix heatmaps
Implementation details
- Labels and subject IDs are parsed from the a<NN>/p<N> folder names so the split keeps group information.
- The app applies the same scaler then PCA transform to an uploaded segment before predicting.
Technologies
- Sensor Data
- PCA
- Scikit-learn
