manasishrotri / Human-Activity-Recognition

MIT License
0 stars 0 forks source link

Human Activity Recognition using smartphone data

Goal:

We seek to develop a human physical activity recognition model based on the UCI Machine learning Human Activity Recognition dataset

Dataset information

The experiments have been carried out with a group of 30 volunteers within an age bracket of 19-48 years. Each person performed six activities (WALKING, WALKING_UPSTAIRS, WALKING_DOWNSTAIRS, SITTING, STANDING, LAYING) wearing a smartphone (Samsung Galaxy S II) on the waist. Using its embedded accelerometer and gyroscope,3-axial linear acceleration and 3-axial angular velocity at a constant rate of 50Hz was captured The experiments have been video-recorded to label the data manually. The obtained dataset has been randomly partitioned into two sets, where 70% of the volunteers was selected for generating the training data and 30% the test data.

Project steps:

1. Exploratory data analysis :

Checking the distribution of physical activities available in the data set Eliminating activities having very few data points Number of observations for each activity image

Activities per individual:

image

Distribution of moving vs non moving activities

image

2. Predicting moving vs non moving activities:

Logistic regression

Confusion Matrix\               Test_Label\ Y Label      Moving   Non-Moving\ Moving        1609    0\ Non Moving    0    1387

Support vector machines

Confusion Matrix \               Test_Label\ Y Label      Moving   Non-Moving\ Moving      1608    1\ Non Moving   0    1387

Random Forest

Confusion Matrix\               Test_Label\ Y Label      Moving    Non-Moving\ Moving      1609    0\ Non Moving    0    1387

Feature selection using Principle Component Analysis:

image

3. Multiclass classification

Multinomial logistic regression: image

Multiclass SVM:

image

Conclusion:

Human physical activities can be recognition using Machine learning algorithms We could improve human activity recognition by including more activities and incorporating additional sensors providing data such as pulse rate could potentially help increase the reliability of human activity recognition dramatically.