This module aims to help therapists recommend new exercises to patients who perform home rehabilitation. Generally, therapists ask patients to carry out a series of exercises at home, when the therapy has not yet been completed in the rehabilitation center. Once the patients return to the clinic, therapists interview them about how they have performed the exercises and evaluate their progress in order to be able to recommend new exercises. Without the use of technology, the therapists’ knowledge may be inaccurate regarding the patients’ progress as they do not know their commitment at home.
The developed system will collect data on how the patients have performed exercises at home within their rehabilitation plan. In addition, the system, using an intelligent recommender, is able to adapt the rehabilitation plan to the patients’ needs. This section presents the architecture devised for the intelligent rehabilitation module which will be used by the general system to autonomously modify the patients’ rehabilitation plan according to their evolution.
However, entering before fully into detail of the formal model, the next subsection shows the fundamental ideas of the proposed system.
3.2.1. Fundamental Ideas
This system allows therapists to define a rehabilitation therapy based on the patients’ injury and the their initial assessment regarding the patients’ condition (their injury state, their physical condition, and their age).
Particularly, the overall rehabilitation system makes use of the gym metaphor to define a rehabilitation therapy. This means that our approach is based on the global concept of patient’s rehabilitation plan, which can be considered as a succession of exercises taken from E and ordered by their complexity, which must be carried out by the patient in a sequential way. However, the plan should be able to be altered according to the patient’s progress. Thus, provided that the system detects that the patient is finding difficulties to perform an exercise in the plan, the system should be capable of recommending an exercise with lower complexity. It even may modify an existent exercise, reducing the number of repetitions or increasing the time to be spent on it. On the other hand, the system should behave in a similar way when in a situation in which complex exercises are easily performed.
Thus, a rehabilitation plan for a patient , denoted as , is defined as follows: where each is also an element of E (i.e., ) and it is satisfied that with being a function that returns the complexity of the exergame (taken from ).
As mentioned above, the exercises that form part of a patient’s plan are initially selected and organized by the therapists according to the patient’s injury and condition. The recommendation module will automatically adjust the plan according to the patient’s performance, acting on the set of exercises included, their order or even their configuration (values of parameters (number of repetitions) and t (time needed to finish the exercise) taken from ).
3.2.2. Recommender Module Definition
The recommendation system presented herein has been proposed as a function that will determine an action on the patient’s rehabilitation plan to be adjusted, as much as possible, to the patient’s state of recovery. Therefore, this function models the existing relationship between the domain, i.e., the patient’s condition in the recovery of the injured limb, and the codomain, i.e., an action to be performed in the rehabilitation plan.
The challenge to be faced is the domain of definition of such a function. This should provide information on how the patients are progressing in their recovery. It will be determined by how they have performed the last exercise of the plan as well as the state in which they are found regarding their recovery.
The variables, which can be recorded by the system, and can provide information on how the patient performed the last exercise of the plan, are defined below:
difference_number_steps () is the difference between the number of steps that the patients and the therapists performed to carry out the last rehabilitation exercise (i.e., the patient fails to pass through all the virtual points that establish the exercise trajectory);
accumulated_deviation () is the cumulative spatial deviation between the patient’s exercise and that gold standard or the therapist’s exercise (i.e., this calculation is based on the distance accumulated when traversing the trajectory associated to the last exercise );
difference_time () is the temporal difference regarding the execution of the last exercise between the patient and the therapist.
These variables collect information about the patients’ status, i.e., how they have performed the last exercise of the allocated plan. However, they do not take into account their evolution, that is, how they have progressed. Significantly, it becomes essential to add this information to the domain to know the actual state of the patient in detail. Thus, the variable progress_level () was included in order to track the state in which a patient is found before performing the last exercise. Its value belongs to the range , and the initial one is determined by the therapists when they assess the patient for the first time. It should be noted that the value of the previous variable is considered to choose the exercises for the patient’s rehabilitation plan. Furthermore, this variable is modified depending on the patient’s evolution towards the last recovery session.
On the other hand, the codomain should reflect the next exercise to be performed by the patients according to their condition. In this research work, the initial rehabilitation plan established by the therapist is modified by proposing a new exercise based on a desirable difficulty recommended to the patient. Thus, the output will consist of a new exercise, which will be established depending on the difficulty given by one of the following functions:
. It chooses an exercise from E whose lesion and joint are similar to the last exercise . This function takes into account an exercise that has not yet been performed, since the system internally stores information about the patients and the exercises they performed, i.e., their level of success regarding the exercise, their points, as well as the time spent by the patient to complete it. To do this, this function takes two parameters: (1) a label indicating the complexity of the exercise to be searched for (, more complexity; , same complexity; , less complexity) based on the (2) last performed exercise ();
. It recommends the repetition of the last exercise performed by the patient based on modifying its configuration. This function takes as parameters (number of repetitions) and t (time needed to finish the exercise) from .
It is important to highlight that the execution of the last exercise influences the patient’s progress level, i.e., the results from the execution of the affects the value of the variable progress_level (). This is why any action on this variable will also be included as an output of the recommender system. This variable, denoted as , is named Effect_on_PPL.
When modeling the function that relates the domain or inputs to the codomain or outputs, a mechanism is used to understand why the recommendation was made. At the same time, this mechanism also deals with the imprecision and uncertainty that exists when evaluating the performance of the last exercise performed by the patient. Even when evaluating the level of progress of the patient within the context of their rehabilitation plan. For this reason, a set of IF-THEN fuzzy rules (R), which model the function , are defined.
The linguistic variable
V (i.e.,
) considers the following domain of definition:
very low (
), low (
L), medium (
M), high (
H), very high (
)} being
x defined from 1 to 3. Each linguistic value in
is defined by means of a trapezoidal function (
), enclosed by a lower limit
a, an upper limit
d, a lower support limit
b, and an upper support limit
c, where
(see Equation (
2)). If the values of
b and
c are equal, a triangular function is obtained:
The choice of the trapezoidal function to construct the membership function, for each of the values that the variables used in the system can take, is justified because it is the only one that gives us the necessary freedom to represent any type of value (i.e., ordered-discrete or ordinal, unordered-discrete or nominal, boolean, numerical, ranking or the most frequent continuous) [
23].
The domain of the definition of each variable
, i.e.,
, is matched to the normalized measurements
. The membership value was confined to the closed range
. The corresponding fuzzy membership set is depicted in
Figure 2.
On the other hand, the linguistic input variable
may take the following values: “excellent achievement” (
, equivalent to 9 or 10); “outstanding achievement” (
, equivalent to 7 or 8); “satisfactory achievement” (
, equivalent to 5 or 6); and “not achieved” (
, smaller than 5). Each linguistic value that this variable can take is defined by means of a trapezoidal function—as can be seen
Figure 3.
The linguistic output variable
takes the following values: “substantial decrease” (
, equivalent to decrease 1 point); “moderate decrease” (
, equivalent to decrease
point); “no change” (
); “moderate increase” (
, equivalent to increase
point); and “substantial increase” (
, equivalent to increase 1 point). Each one of these linguistic values will also be defined by means of a trapezoidal function—as can be seen in
Figure 4. It is purely used to modify the patient’s level of progress as the patient recovery level potentially suffers a change after a physical activity. The operations to be considered are three: increasing the patient’s progress, decreasing it or maintaining it.
Knowledge engineering techniques have been used during the design of the system, mainly based on interviews with physicians, using designs and executions which have been fine-tuned in different stages as a basis. Thanks to this process, the rules and the variables and values they take have been determined, seeking a compromise between understandability and efficiency.
As for the other output of the system, it will be a recommended exercise for the patient by invoking the function , as mentioned above. This function will recommend an exercise from the set with higher, lower or same complexity as the last exercise performed by the patient. Otherwise, if the exercise to be recommended is not found, E will be used. The function is shown in Algorithm 1. It should be pointed out that we assume an exercise will certainly be taken from E.
Invoking the function
involves recommending to the patient the repetition of the last performed exercise
, however, altering some of its configuration parameters from
, namely
by setting a different number of repetitions, or
t by giving a different time to finish the exercise
. The modification of the values may be an increase (+) or reduction (-) in the parameters
and
t.
Algorithm 1: Behavior of proposed exergame function. |
![Mathematics 09 01427 i001]() |
Each rule has the following form: IF is AND is AND is AND is THEN and is . On the one hand, represents the exercise to be recommended. On the other hand, represents the values that the variable takes in the rule i, that is, ⊆. Similarly, and represent the values that the variables and take in the rule i, respectively, where ⊆ and ⊆. The set is a global set that represents the values that must take the variable V. Furthermore, the set and are the global sets that represent the values that must take the variables and .
Lastly, some of the rules defined in this system to model the behavior of the recommender system, which will constitute the conditional knowledge of the remote rehabilitation system, are shown below:
: | IF is {} |
| AND is {} |
| AND is {} |
| THEN AND is {} |
: | IF is {M} |
| AND is {M} |
| AND is {} |
| THEN AND is {} |
: | IF is {} |
| AND is {,H} |
| AND is {} |
| THEN AND is {} |
: | IF is {M} |
| AND is {M} |
| AND is {M} |
| AND is {} |
| THEN AND is {} |
At this point, we must clarify that a variable not appearing in a rule means that all the values of its definition domain may be taken. For example, in the rule , the variable () takes the following values: . As can be seen, the rules are highly explainable, which will help understand why the system makes a new recommendation.
3.2.3. Functions Of The Proposed Recommender System
In this section, we present how the proposed system uses the fuzzy rules presented above to recommend a new rehabilitation exercise and to alter a patient’s progress level.
Given that the output of the rules consists of two elements, that is, the recommended exercise and an alteration in the value of the patient’s progress level, two outputs need to be obtained for each occurrence of the inputs (). Therefore, the system infers two situations for each input, which are enumerated below:
For this purpose, we will consider that the rules inform of the following two relations, since the consequent is related to a logical AND: and .
To infer within the first relationship, we will check the activation degree of each rule. This will be done by evaluating the antecedent of each one. This evaluation is performed as discussed subsequently.
A function
will be associated with each variable
in the rule
j, whose definition depends on the values taken by the variable
in it. Therefore, if the variable takes a single linguistic label
(i.e.,
), the definition of the function
will be the same as the one defining the linguistic value (i.e.,
). However, when the variable takes more than one linguistic value, this function will be built based on whether or not the values are close to the domain of definition of the variable
, i.e.,
. For consecutive linguistic values, we will refer to this set as C. The function
will be defined as a trapezoidal one with the following parameters:
If the variable
in a rule takes non-consecutive values, or there are two non-consecutive groups of values, the function
will be defined with as many trapezoidal functions as there are non-consecutive values or non-consecutive groups (
Figure 5).
Example 1. For the rule shown above, which is: IF is {VL} AND is {VL} AND is {VL,L,M,H,VH} AND PPL() is {OA,EA} THEN AND EPPL is {SI}, the functions will be defined as follows: The
activation degree of a rule
for an input (
), where
is the input value (crisp value) taken by the variable
, will be calculated by determining the membership value of each input
to the function that defines the input variable
, i.e.,
. Given that the antecedent of our rules has more than one part related with a logical AND operator, the t-norm [
24] of the minimum has been applied to obtain a single membership value. The definition of this calculus is as follows:
To obtain the output of this first inference process, the t-conorm [
24] of the maximum will be used (i.e., the t-conorm corresponding to the minimum t-norm). As a result, the system will recommend the exercise that proposes the rule with the highest activation degree:
On the other hand, the inference of the second relationship has been carried out by using the Mamdani’s fuzzy inference method [
25], whose output is a fuzzy set. This fuzzy inference process is composed of the following steps:
Evaluate the antecedent for each rule to obtain a single membership value, i.e., activation degree (). We will do this as in the previous case;
Obtain the conclusion of each rule in . To do this, we truncate the fuzzy value taken by the consequent of the rule in the variable using the minimum with the activation degree() on its membership function. The output will be a new fuzzy set defined by means of a membership function where:
and it is defined as
with
being the value that the variable
takes in the rule
(
).
Aggregate rule’s conclusions into a single fuzzy set defined by means of the function
, using a fuzzy aggregation operator. The t-conorm of the maximum has been used to aggregate the truncated output functions returned by the previous step:
Defuzzification. Since we want to obtain a crisp value that affects to the
value, which we recall is confined to the range
, so we need to transform the fuzzy set obtained in step 3 into a single numerical value. To do this, we used the defuzzification method of the centroid, which returns the center of the area under the fuzzy set obtained in step 3. It should be pointed out that the total area of the membership function distribution used to represent the combined control action is divided into a number of sub-areas. We denote the centroid as
and it is calculated as
where
N indicates the number of sub-areas,
and
represent the area and the centroid of the area, respectively, of the
sub-area.
The value
(
) is used to modify the patient’s progress level (
) with the aim of updating their progress:
We would like to conclude by stressing that Zadeh’s conventional t-operators of Min and Max, which have been used in this system, perform significantly well within the context of our problem [
26].