In this repository you can find the code for classification of the common activities of electrical line workers. We recruited 37 subjects to perform the 10 tasks listed below and collected the acceleration signals from a signle wrist-worn Empatica E4 accelerometer.
The following picture shows a sample subject and the experiment area.
We investigated the performance of k-Nearest Neighbors
, Support Vector Machines
, and Random Forest
classifiers in combination with three feature sets (time
, frequency
, and time-frequency
), and two window lengths (4 and 10 seconds) for the classification. Also, we evaluated the classification performance in two scenarios of intra- and inter-subject. You can find the classification code in Classification.ipynb notebook.
The classification models for each combination of classifiers, feature sets, and window lengths were trained and saved to a pickle file. For inter-subject this resulted in 90 files (for 5 hold out test sets) and for the intra-subject scenario since we trained the models on individual subjects the number of saved files summed up to 666. In InterSubjectReport.ipynb and IntraSubjectReport.ipynb notebooks we load the trained models, evaluate the models on the test sets, perform the statistical analysis for the inter-subject case, and create the reports.
Using the LIME algorithm [1] we found the important features for 2 activities of electric panel and hoisting in frequency and time-frequency feature sets. We reconstructed the signals using the selected features to investigate the relevance of the selected features. We applied the method on 30 correctly classified windows for the electric panel and hoisting tasks and used the most frequently selected features for reconstruction. The codes for the frequency and time-frequency features are provided in LIMEFFTReconstruction.ipynb and LIMEWaveletReconstruction.ipynb notebooks.
Also, all feature importance plots (for all activities) can be found at the bottom of the pages here for the FFT features and here for the wavelet features.
[1] Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should i trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.