Skip to content

Human Activity Classification using Machine Learning Classifying human activities (walking, sitting, standing, etc.) using smartphone sensor data from accelerometers and gyroscopes.

Notifications You must be signed in to change notification settings

Tolumie/Human-Activity-Classification-model

Repository files navigation

Human Activity Classification Project

πŸ“Œ Overview

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.


πŸ“‚ Dataset Information

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

πŸš€ Project Objectives

βœ”οΈ 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


πŸ› οΈ Technologies Used

  • Python 🐍
  • Pandas, NumPy (Data Handling)
  • Scikit-Learn (Machine Learning)
  • Matplotlib, Seaborn (Data Visualization)
  • Jupyter Notebook (Interactive Development)

πŸ“Š Model Performance & Evaluation

πŸ“ˆ 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.


πŸ“ Folder Structure

πŸ“‚ Human-Activity-Classification  
 β”œβ”€β”€ πŸ“ data/                # Dataset Files  
 β”œβ”€β”€ πŸ“ notebooks/           # Jupyter Notebooks  
 β”œβ”€β”€ πŸ“ models/              # Trained Models  
 β”œβ”€β”€ πŸ“„ README.md            # Project Documentation  
 β”œβ”€β”€ πŸ“„ requirements.txt     # Dependencies  

πŸ‘¨β€πŸ’» How to Run the Project

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


πŸ“Œ Future Improvements

βœ… Implement Deep Learning (LSTMs, CNNs) for better feature extraction
βœ… Improve real-time activity detection using streaming data
βœ… Optimize feature engineering for better classification accuracy


πŸ“œ License

This project is open-source under the MIT License.

πŸ”— Contributions are welcome! Fork this repo and submit a PR.

About

Human Activity Classification using Machine Learning Classifying human activities (walking, sitting, standing, etc.) using smartphone sensor data from accelerometers and gyroscopes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published