Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALGO] {LR_Det_Ullrich} #32

Closed
2 of 19 tasks
alexstihi opened this issue Oct 3, 2023 · 0 comments
Closed
2 of 19 tasks

[ALGO] {LR_Det_Ullrich} #32

alexstihi opened this issue Oct 3, 2023 · 0 comments
Assignees

Comments

@alexstihi
Copy link
Contributor

alexstihi commented Oct 3, 2023

This issue is meant to track the implementation of the {LR_Det_Ullrich} algorithm for left/right foot detection for a single IMU sensor placed on the lower back.

Short description:

1) The McCamley algorithm

In the original McCamley algorithm, the angular velocity around the vertical axis ($gyr_{v}$) serves as the distinguishing factor for identifying left and right ICs. The process involves the following steps:

  • Signal Pre-processing: Subtracting the signal mean and applying a low-pass filter (4th order Butterworth filter with a 2 Hz cut-off frequency).
  • IC Assignment: Analyzing the sign of the filtered $gyr_{v}$ value at the IC time point $n$ for classification. If the value is positive, the IC is attributed to the right foot; if negative, it's attributed to the left foot.

As a first extension to the original McCamley algorithm, the angular velocity around the anterior-posterior axis, $gyr_{ap}$, can resemble a periodic wave with a constant phase shift w.r.t. $gyr_{v}$ after application of the low-pass filter described above. This is also a suitable input signal for the McCamley algorithm, when inverting the sign. A second and final extension to the original McCamley algorithm is to use the combination of the filtered signals for the vertical and anterior-posterior signals, $gyr_{comb}$:

$$ \begin{equation} gyr_{comb} = gyr_{v} - gyr_{ap} \end{equation} $$

2) Machine Learning Approaches

In the ML-based algorithms, we expand the feature set by incorporating the first and second derivatives of the filtered signals at the time points of the $n$ ICs. Consequently, for a dataset containing a total of $N$ ICs, this results in a $N \times 6$ feature matrix. To ensure uniformity, the feature set is min-max normalized.

Four different algorithms are employed for the left/right detection, which is essentially a binary classification task:

  • Linear Support Vector Machine (SVM-lin)
  • Radial Basis Function Support Vector Machine (SVM-rbf)
  • k-Nearest Neighbours (kNN)
  • Random Forest Classifiers (RFC)

Link to original implementation: N/A

Reference Papers: Ullrich M, Kuderle A, Reggi L, Cereatti A, Eskofier BM, Kluge F. Machine learning-based distinction of left and right foot contacts in lower back inertial sensor gait data. Annu Int Conf IEEE Eng Med Biol Soc. 2021, available at: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9630653

Notes

TBA

Todo-List

Provide ground truth labels for each IC (left or right) from the gold-standard data. Use this to compute the accuracy of the algorithms on the test data. The accuracy is formally defined as the number of agreements between predicted left and right labels and the ground truth labels divided by the total number of ICs, as described in below:

$$\text{accuracy} = \frac{\sum _{n=1}^N (pred_{n}==true_{n})}{N}$$

Prepare work:

  • Linked this issue in the meta issue for algorithm development
  • Created new branch and PR for this algorithm
  • Input Output datatypes identified
  • Relevant algorithm parameters identified
  • Identified all relevant information
  • Confirmed the info and general implementation plan with the rest of the developer team

Generate results from original implementation

  • Original algorithm is running locally
  • Example outputs from original algorithms generated and added to the repo

Implementation of Algorithm

  • Core algorithm implemented
  • Wrapper class implemented
  • Initial peer-code review completed
  • Extensive docstring added to algorithm class (should include references!)
  • General tests added for the wrapper class
  • Unit tests added (in particular to test edge cases)
  • Example created (example should show how to use the algorithm, visualize the algo results and show a comparison the reference data and the results from the original implementation)
  • Regression test for example created
  • Added wrapper class to documentation
  • Final code review completed
  • PR merged and meta issue updated
@alexstihi alexstihi self-assigned this Oct 3, 2023
@AKuederle AKuederle linked a pull request Nov 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants