Skip to content

Using accelerometer dataset to create Step Count algorithm and Walking Classification models.

License

Notifications You must be signed in to change notification settings

kevin-chao-com/walking-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

walking-detection

  • This is a project to demonstrate how to create "walking detection" models with various approaches.

  • Purpose:

    • The purpose of this project is to demonstrate how to create Machine Learning Models from raw accelerometer dataset. I use Walking Detection as an example.
    • The whole process aims to be simple and easy to understand the end-to-end pipeline of Data Science project.
  • Data:

    • The raw accelerometer data was download from:
    • The sampling rate of the Acc data is 100 Hz
    • Data including labeled activities of walking, stair climbing, and driving.
    • Types of activities:
      • 1=walking (Walking)
      • 2=descending stairs (DescStairs)
      • 3=ascending stairs (AscendStairs)
      • 4=driving (Driving)
      • 77=clapping (Clapping)
      • 99=non-study activity (NonStudyAct)
    • Device positions:
      • lw: left wrist (WristL)
      • rw: right wrist (WristR)
      • lh: left hip (HipL)
      • rg: right hip (HipR)
      • la: left ankle (AnkleL)
      • ra: right ankle (AnkleR)
    • The unit of accelerometer is in g (9.8 m/s^2)
  • Source:

    • 01_data_understanding.ipynb
      • Jupyter notebook to show how to understand the raw accelerometer data, conduct simple quality control, and show data visualization.
    • 02_data_preparation_time_series_analysis.ipynb
      • Show basic signal process steps to analize high-friquency accelerometer data.
      • Show algorithm to compute Step Count in both time and frequency domains
    • 03_data_preparation_features_creation.ipynb
      • Show how to create a dataframe with various features
    • 03b_data_preparation_features_creation_all_subjects.ipynb
      • Run all subjects' feature files
    • 04_modeling_evaluation.ipynb
      • Run Scikit-learn models and evaluate the model.
    • 04b_modeling_with_Spark.ipynb
    • 04c_modeling_with_PyTorch.ipynb
    • 04d_modeling_with_TensorFlow.ipynb
  • Outputs:

    • Format of acc file:
      • Columns: 'subject_id', 'device_loc', 'act_id', 'act_name', 'event_num', 'walk_or_not', 'unique_id', 'time', 'acc_x', 'acc_y', 'acc_z'
      • Row: idf1ce9a0f, AnkleL, 1, Walking, 1, 1, idf1ce9a0f_AnkleL_1_Walking_1_1, 354.05, -0.070, -0.973, 0.078
      • .....
      • Row: idf1ce9a0f, AnkleL, 99, NonStudyAct, 547, 0, idf1ce9a0f_AnkleL_99_NonStudyAct_547_0, 3282.01, -0.059, 0.043, 0.992
    • ML modeling results will be placed under:
      • ~/outputs/xxML_outputs/

About

Using accelerometer dataset to create Step Count algorithm and Walking Classification models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published