Sei sulla pagina 1di 10

ABSTRACT

Human activities are inherently translation invariant and hierarchical. Human activity recognition (HAR),
a field that has garnered a lot of attention in recent years due to its high demand in various application
domains, makes use of time-series sensor data to infer activities. In this project, a deep convolutional
neural network (convnet) is used to perform efficient and effective HAR using smartphone sensors by
exploiting the inherent characteristics of activities and 1D time-series signals, at the same time providing
a way to automatically and data-adaptively extract robust features from raw data. Experiments show
that convnets indeed derive relevant and more complex features with every additional layer, although
difference of feature complexity level decreases with every additional layer. Convnets also achieved an
almost perfect classification on moving activities, especially very similar ones which were previously
perceived to be very difficult to classify. Lastly, convnets outperform other state-of-the-art data mining
techniques in HAR for the benchmark dataset collected from 33 volunteer subjects, achieving an overall
performance of 94.79% on the test set with raw sensor data.

PROBLEM STATEMENT
In this project we will focus on time-sliced accelerometer sensor data coming from a smartphone carried
by its users on their waist. Based on the accelerometer data of the x, y and z axis, the 1D CNN should
predict the type of activity a user is performing (such as “Walking”, “Jogging” or “Standing”). Each time
interval of the data will look similar to this for the various activities.
DATASET AND INPUT
The dataset which was used in this project is WISDM dataset. This dataset contains record for six
activities namely Walking, Jogging, Standing, Moving Upstairs, Sitting and Moving Downstairs. This
dataset is a collection of accelerometer data taken from a smartphone that various people carried with
them while conducting six different exercises (Downstairs, Jogging, Sitting, Standing, Upstairs, Walking).
For each exercise the acceleration for the x, y, and z axis was measured and captured with a timestamp
and person ID.

Sample of Dataset which we are using to train our deep neural network model-
ANALYSIS OF DATASET
There are a total of 1098203 number of rows in the dataset and these rows contain data for different
type of six activities perform by the user with timestamp and acceleration in x, y and z axis.

Class Distribution-

There are total six classes in the dataset that is the six different activity perform by the user.

Table for distribution of different type of activities in the Dataset-

ACTIVITIES COUNT AND PERCENTAGE


1.WALKING 424,400(38.6%)

2.JOGGING 342,177(31.2%)

3.UPSTAIRS 122,869(11.2%)

4.DOWNSTAIRS 100,427(9.1%)

5.SITTING 59,939(5.5%)

6.STANDING 48,395(4.4%)
This histogram verifies that the dataset contain data from 33 different users who performed the six
different activities.

ALGORITHM AND TECHNIQUE


In this project we have used one dimensional Convolutional Neural Network (1D CNN) for classifying
activities based on time-series data.

Why we are using 1D CNN?

CNN works well for identifying simple patterns within your data which will then be used to form more
complex patterns within higher layers. A 1D CNN is very effective when you expect to derive interesting
features from shorter (fixed-length) segments of the overall data set and where the location of the
feature within the segment is not of high relevance.
This applies well to the analysis of time sequences of sensor data (such as gyroscope or accelerometer
data). It also applies to the analysis of any kind of signal data over a fixed-length period (such as audio
signals).
Convolutional Neural Network model used for the project is shown below-

PREPROCESSED DATA

RESHAPE THE DATA

1D CONVOLUTIONAL LAYER

1D CONVOLUTIONAL LAYER

MAX POOLING 1D

1D CONVOLUTIONAL LAYER

1D CONVOLUTIONAL LAYER

GLOBAL AVERAGE POOLING 1D

DROUPOUT

DENSE(FINAL LAYER)
MODEL SUMMARY WHICH IS USED IN THE PROJECT

RESULT
We measure our score in terms of Accuracy, Recall, Precision and F1 Score.
1. Accuracy: The ratio between correctly predicted outcomes and the sum of all predictions.

Accuracy= ((TP + TN) / (TP + TN + FP + FN))

2. Precision: When the model predicted positive, was it right? All true positives divided by all positive
predictions.

Precision= (TP / (TP + FP))

3. Recall: How many positives did the model identify out of all possible positives? True positives divided
by all actual positives.

Recall= (TP / (TP + FN))

4. F1-score: This is the weighted average of precision and recall.

F1-score= (2 x recall x precision / (recall + precision))

Now coming to our model the confusion matrix which is obtained after training the model is-
Running it against the test data give the accuracy of 91% and a loss of 40%.

Classification Report on Test Data-

Potrebbero piacerti anche