robotology / assistive-rehab

Assistive and Rehabilitative Robotics
https://robotology.github.io/assistive-rehab/doc/mkdocs/site
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Report showing the improvements of Y1Q3 #97

Closed vvasco closed 5 years ago

vvasco commented 6 years ago

We plan to produce a report describing the main improvements of Y1Q3 with respect to Y1M5. Y1M5 is tagged as v1.0.0 in master, therefore we can compare the output of the two demos in response to the same experiment.

vvasco commented 6 years ago

We plan to compare the response of the entire pipeline to the following three movements:

For each movement, we will test the following situations:

We will test the response offline, in order to have the exact same movement to elicit the two pipelines. The comparison will be done in terms of:

pattacini commented 6 years ago

Let's store this report within GitHub as a markdown or juypter notebook.

vvasco commented 5 years ago

Acquisition

The improvements that Y1Q3 introduces in terms of acquisition are listed below:

  1. Filtering the disparity map
  2. Optimizing the skeleton
  3. Reducing latencies

1. Filtering the disparity map

The disparity map provided by the camera is inaccurate around the human contour and might have holes, leading keypoints close to the contour (e.g. hands) or on an hole to be projected incorrectly. For example, the following video shows the depth map for an abduction movement, where the hand is projected to infinite:

In Y1M5, the disparity map is used as provided by the camera, without any additional processing, and thus it is affected by the effect described. In Y1Q3, the disparity map is eroded (and thus the depth map dilated), which has the double effect of:

  1. increasing the probability for keypoints closer to the contour to fall within the correct depth map;
  2. filling holes in the depth.

The following video shows the effect of filtering the depth map and keypoints falling within the correct depth:

Unprocessed depth (Y1M5) Filtered depth (Y1Q3) Keypoints inside the depth

2. Optimizing the skeleton

Exercises that require movements parallel to the optical axis make some keypoints ambiguous. For example, in the external and internal rotation, the elbow is not directly observable as the hand occludes it. Therefore both keypoints are projected to the same depth, as shown here:

Without optimization (Y1M5)

In Y1Q3, we introduce an optimization of the skeleton, which adjusts the depth of the keypoints such that the length of the arms is equal to that observed during an initial phase. The following image shows the result of the optimization, in which elbow and hand are projected correctly.

With optimization (Y1Q3)

3. Reducing latencies

yarpOpenPose introduces a visible latency in the depth map, as shown here:

Without yarpOpenPose With yarpOpenPose

In Y1Q3, yarpOpenPose propagates the depth image in sync with the output of skeleton detection, in order to equalize the delay between the two streams.

Extending the feedback

Y1M5

In Y1M5, the feedback is based on the definition of dynamic joints (i.e. joints performing the exercise (1)) and static joints (i.e. joints staying in the initial position (2)):

  1. dynamic joints contribute to the dynamic score, which computes their range of motion in a predefined temporal window, by awarding joints moving within the correct range of motion;
  2. static joints contribute to the static score, which computes their deviation from a predefined resting position.

Dynamic and static scores are combined to produce three levels:

  1. low: both dynamic and static scores are low, producing the following feedback:

    "You are not moving very well!"

  2. medium: either dynamic or static score is medium, producing the following feedback:

    "You are doing the exercise correctly, but you could do it better."

  3. high: both dynamic and static scores are high, producing the following feedback:

    "You are moving very well!"

This kind of feedback is purely qualitative and has a series of drawbacks, which are:

Y1Q3

To overcome the drawbacks of Y1M5, in Y1Q3 the concept of dynamic and static joints is removed and the exercise is treated in its entirety as an action. Therefore the feedback is produced based on the following two layers:

  1. action recognition: which classifies the exercise and triggers the second layer if the predicted class equals the label of the exercise to perform. Otherwise, the feedback produced is negative. This layer is fundamental as it guarantees a random or a wrong movement to not produce positive feedback.
  2. joint analysis: which compares the observed skeleton with a predefined template for that movement, differently based on the exercise. The comparison with a template skeleton allows us to analyze also the speed of the movement.

With this architecture, the feedback is extended and articulated in the following levels:

Action Recognition

The action recognition is carried out using a Recurrent Neural Network (RNN) with Long Short-Term Memory (LSTM) cells.

Joint analysis

This analysis is differentiated according to the exercises, which are classified as:

  1. range of motion exercises (i.e. abduction, internal and external rotation);
  2. reaching exercises.

Comparison between Y1M5 and Y1Q3

The following tables compare feedbacks produced by the two pipelines developed in Y1M5 and in Y1Q3 respectively, in response to the same movement. Corrrect feedbacks are highlighted.

Y1M5 Y1Q3
Correct 1. You are moving very well!
2. You are moving very well!
1. You are moving very well!
2. You are moving very well!
Fast 1.You are moving very well!
2.You are moving very well!
1. Move the left arm slower!
2. Move the left arm slower!
Slow 1.You are moving very well!
2.You are moving very well!
1. Move the left arm further up!
2. Move the left arm further up!
Low ROM 1.You are moving very well!
2.You are moving very well!
1. Move the left arm further up!
2. Move the left arm further up!
Wrong 1. You are doing the exercise correctly, but you could do it better.
2. You are doing the exercise correctly, but you could do it better.
1. You are doing the wrong exercise.
2. You are doing the wrong exercise.
Y1M5 Y1Q3
Correct 1. You are doing the exercise correctly, but you could do it better.
2. You are doing the exercise correctly, but you could do it better.
1. Move the left arm slower!
2.You are moving very well!
Fast 1.You are moving very well!
2.You are moving very well!
1.Move the left arm slower!
2.Move the left arm slower!
Slow 1. You are doing the exercise correctly, but you could do it better.
2. You are moving very well!
1. You are moving very well!
2. Move the left arm faster!
Low ROM 1.You are moving very well!
2. You are doing the exercise correctly, but you could do it better.
1.You are moving very well!
2.Move the left arm slower!
Wrong 1. You are doing the exercise correctly, but you could do it better.
2. You are doing the exercise correctly, but you could do it better.
1. You are doing the wrong exercise.
2. You are doing the wrong exercise.
Y1M5 Y1Q3
Correct 1.You are moving very well!
2.You are moving very well!
1.You are moving very well!
2.You are moving very well!
Fast 1.You are moving very well!
2.You are moving very well!
1.Move the left arm slower!
2.Move the left arm slower!
Slow 1.You are moving very well!
2.You are moving very well!
1.You are moving very well!
2.Move the left arm faster!
Low ROM 1.You are not moving very well!
2.You are not moving very well!
1. Move the left arm backwards!
2. Move the left arm backwards!
Wrong 1.You are not moving very well!
2.You are not moving very well!
1. You are doing the wrong exercise.
2. You are doing the wrong exercise.

It can be noticed that:

pattacini commented 5 years ago

Outstanding report 🥇