This project focuses on Human Activity Recognition (HAR) using Smartphones, where study participants carried a smartphone equipped with an inertial sensor while performing daily activities. The goal is to classify these activities into one of six categories:
β
Walking
β
Walking Upstairs
β
Walking Downstairs
β
Sitting
β
Standing
β
Laying
This classification is achieved using machine learning techniques on sensor data collected from accelerometers and gyroscopes.
The dataset contains sensor data from the Human Activity Recognition with Smartphones database. Each record includes:
πΉ Triaxial Acceleration β From the accelerometer (total acceleration & estimated body acceleration)
πΉ Triaxial Angular Velocity β From the gyroscope
πΉ 561 Feature Vector β Containing time-domain and frequency-domain variables
πΉ Activity Label β Corresponding to one of the six activities
The data is scaled from -1 (minimum) to 1.0 (maximum) for better model performance.
π Sample Data Types (Last 5 Columns):
data.dtypes.tail()
angle(tBodyGyroJerkMean,gravityMean) float64
angle(X,gravityMean) float64
angle(Y,gravityMean) float64
angle(Z,gravityMean) float64
Activity object
βοΈ Preprocess & Clean Data for ML models
βοΈ Feature Engineering to extract meaningful patterns
βοΈ Train Classification Models to predict activities
βοΈ Evaluate Model Performance using accuracy and confusion matrices
βοΈ Optimize Performance using hyperparameter tuning
- Python π
- Pandas, NumPy (Data Handling)
- Scikit-Learn (Machine Learning)
- Matplotlib, Seaborn (Data Visualization)
- Jupyter Notebook (Interactive Development)
π Metrics Used:
β
Accuracy
β
Precision
β
Recall
β
Confusion Matrix
The dataset is well-balanced, and the models are evaluated to ensure high classification accuracy across all activity categories.
π Human-Activity-Classification
βββ π data/ # Dataset Files
βββ π notebooks/ # Jupyter Notebooks
βββ π models/ # Trained Models
βββ π README.md # Project Documentation
βββ π requirements.txt # Dependencies
1οΈβ£ Clone the Repository
git clone https://github.com/Tolumie/Human-Activity-Classification-Project.git
cd Human-Activity-Classification-Project
2οΈβ£ Install Dependencies
pip install -r requirements.txt
3οΈβ£ Run the Jupyter Notebook
jupyter notebook
4οΈβ£ Train & Evaluate the Model
β
Implement Deep Learning (LSTMs, CNNs) for better feature extraction
β
Improve real-time activity detection using streaming data
β
Optimize feature engineering for better classification accuracy
This project is open-source under the MIT License.
π Contributions are welcome! Fork this repo and submit a PR.