<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>November</journal-title>
      </journal-title-group>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>for Automatic Adjustment of Rehabilitation Routines for Stroke Patients</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sergio Martínez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Cristian Gómez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vanesa Herrera</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier A. Albusac</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>José J. Castro-Schez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>David Vallejo</string-name>
          <email>David.Vallejo@uclm.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Castilla-La Mancha</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Paseo de la Universidad 4</institution>
          ,
          <addr-line>13071 Ciudad Real</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>0</volume>
      <fpage>6</fpage>
      <lpage>09</lpage>
      <abstract>
        <p>The ability of new Artificial Intelligence ( AI) models to assist humans in performing tasks is creating new business models and transforming existing ones at breakneck speed. One of the application areas benefiting from this technology is healthcare. The work presented in this article falls within this domain. In this sense, our work focuses on how AI can be used to facilitate the work of therapists responsible for the physical rehabilitation of stroke patients. In particular, we present a decision support system integrated in a global remote rehabilitation system composed of two interconnected applications: the one used by the therapist to define routines and monitor patients and the one used by the patient to perform rehabilitation exercises autonomously. The decision support system is based on the use of fuzzy logic, which significantly increases its scalability and interpretability. The proposed system is capable of automatically suggesting personalised modifications to the rehabilitation routine assigned to a patient by the therapist, based on the patient's performance. In addition, this system integrates aspects of Explainable Artificial Intelligence ( XAI) by being able to justify why it suggests such modifications, so that the therapist has more information when validating or not validating the modifications proposed by the artificial system. The paper discusses a case study describing how a stroke patient's routine is automatically adjusted by the system.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0
International (CC BY 4.0).</p>
      <p>CEUR
Workshop
Proceedings
htp:/ceur-ws.org
ISN1613-073</p>
      <p>CEUR</p>
      <p>
        Workshop Proceedings (CEUR-WS.org)
the scarcity of suitable transportation and competent stroke specialists. This condition
manifests a predilection for the aged population. Stroke symptoms present considerable
heterogeneity amongst patients, with potential impacts on both their physical and
cognitive faculties. Convalescence following a stroke can take several months; however, to
mitigate the resulting disabilities, the implementation of perpetual monitoring by health
care professionals throughout this period is imperative [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The primary focus of stroke rehabilitation centres around physical recuperation.
Physiotherapists aid patients in undertaking physical rehabilitation exercises designed to
restore mobility and autonomy. A particular type of these exercises, named functional
exercises, involves patients performing routine tasks autonomously within their home
environment. These exercises can be implemented independently by patients at home.
Their principal benefit is the ability to simultaneously increase strength, speed, stamina,
and precision, thereby endowing the patient with a higher degree of independence. The
duration of the rehabilitation process may span from a few weeks to several months.</p>
      <p>
        Recently, home rehabilitation has evolved into a practical substitute for conventional
rehabilitation methods. Telerehabilitation facilitates the treatment of stroke and other
ailments via the execution of rehabilitation exercises within a domestic setting. Several
research eforts have been focused on technology-assisted physical rehabilitation performed
at home [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. A subset of technologies, widely embraced for home rehabilitation, is
comprised of immersive technologies that encompass virtual reality, augmented reality,
and mixed reality. By employing these technologies, home rehabilitation systems are
capable of instructing patient movements whilst they independently conduct rehabilitation
exercises. A novel technological application within the realm of physical rehabilitation
involves the use of decision support systems [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which aid therapists in determining
the appropriate rehabilitation routine for each individual patient, taking into account
variables such as the specific exercises to be performed by the patient and the required
number of repetitions for each exercise. The automation of the physical rehabilitation
routine alleviates therapists from this workload. Thus, therapists can accommodate more
patients or they can allocate more quality time to their existing patients, increasing
therapy efectiveness and personalisation [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Our proposal involves the integration of a Decision Support System (DSS) with a home
rehabilitation system for stroke. The rehabilitation system guides the movements of
the patients while performing the exercises using augmented reality. The data collected
during the exercise execution are used by the DSS to adjust the rehabilitation routine.
The primary objective is to maintain motivation of patients by adapting the routine to
an appropriate level of dificulty. If the rehabilitation routine were too dificult then
patients would feel discouraged and frustrated, whereas if it were too easy then patients
would feel bored. This adaptation is achieved through a Fuzzy Inference System (FIS),
which incorporates an explainability module that provides therapists with explanations
of the decisions taken by the system. Being provided with explanations enhances their
trust on the DSS and facilitates its integration into their workflow.</p>
    </sec>
    <sec id="sec-3">
      <title>2. Related work</title>
      <sec id="sec-3-1">
        <title>2.1. DSSs for physical rehabilitation</title>
        <p>
          Physical rehabilitation is an important part of the recovery process of stroke patients.
An alternative way of performing physical rehabilitation is home rehabilitation, which is
gaining prominence both as a viable complement and as a replacement for conventional
physical rehabilitation [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Among the main challenges encountered in home rehabilitation
faces is that therapists are generally less involved in the patients’ rehabilitation than in
on-site rehabilitation. One of the tasks afected by reduced participation is adjusting the
patient’s routines. Therefore, in order to fully implement home rehabilitation it is highly
advisable to automate the process of adjusting the routines according to the evolution
of patients. Automating the adjustment of the routine is not a trivial task, and several
DSSs using diferent AI techniques have been designed.
        </p>
        <p>
          One technique used for automatically adjusting the dificulty of rehabilitation exercises
is state machines. While state machines do not fall under the category of AI, they are a
simple approach to automate the adjustment of physical rehabilitation routines. Pinto et
al. [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] used state machines to implement dynamic dificulty adjustment in their upper
extremity rehabilitation system. Their system consisted of a set of exergames, each with
a discrete number of predefined dificulty levels. The state machine would be responsible
of determining whether the dificulty level should be increased, decreased or maintained.
        </p>
        <p>
          Schulze et al. [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] used Bayesian networks to adjust dificulty in a COPD rehabilitation
system based on a stationary bicycle. One major advantage of Bayesian networks applied
to physical rehabilitation is its ability to handle incomplete data efectively. This is
important in a medical context, since medical knowledge is often uncertain [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. The
probabilities of the network were obtained through clinical knowledge and through
unsupervised learning models.
        </p>
        <p>Capecci et al. [9] used a Hidden Semi-Markov Model for assessing rehabilitation
exercises. Their system extracted features related to the trajectories of the joints using
a RGB-D camera. The features were selected using expert knowledge. The HSMM is
then able to provide Clinical Scores for the execution of the exercises according to said
features. HSMM can be used because the problem satisfies the Markov property; possible
future postures only depend on the current posture [9].</p>
        <p>Karime et al. [10], used a FIS for adapting a rehabilitation routine in the context of
wrist rehabilitation. Their system used sensors to measure the performance of patients.
The inputs of the FIS, which are the reach angle, the angular velocity and the jerkiness,
are extracted from the data measured by the sensors. A major advantage of applying
fuzzy logic to the medical field is that it is able to handle uncertainty.</p>
      </sec>
      <sec id="sec-3-2">
        <title>2.2. Explainable AI</title>
        <p>XAI is a branch of AI focused on producing results that humans can easily understand [11].
XAI models, also known as glass-box models, difer from black-box models in that they
ofer transparency and interpretability. By providing explanations, XAI engenders trust
in the suggested solutions. Consequently, AI can be applied to a broader array of
domains, such as medicine [12]. It is worth noting the trade-of that there is between the
performance and the explainability of the AI method to be used when designing an XAI
model [13].</p>
        <p>XAI methods can generally be classified into five categories: interaction and importance
of features, mechanism of attention, reduction of dimensionality of data, distillation of
knowledge and extraction of rules, and models intrinsically interpretable. Furthermore,
XAI methods can also be categorized according to how the interpretation is performed.
The interpretation of a XAI method can either be intrinsic, where the interpretation is an
inherent part of the AI model, or posthoc when it is an additinal step performed on the
model. The interpretation can also be global when it applies to the logic of the model or
local when it only applies to a particular decision for an instance. Finally, interpretations
can be model-specific or can be agnostic of the model used [ 14].</p>
        <p>Gandolfi et al. [ 15] used Machine Learning (ML), and in particular Random Forest (RF),
to predict the upper limb functional recovery of patients. In addition to creating the RF
model, they incorporated four diferent XAI approaches to determine the most relevant
features of the model. Since RFs are not inherently explainable, the XAI techniques are
post hoc XAI techniques. The techniques used were RF Feature Importance, where the
decrease in node impurity in a node and the probability of reaching the said node are
used to determine the importance of features, Permutation Feature Importance, based
on changes in the prediction error when randomly changing the value of a single feature,
LIME (Local Interpretable Model-agnostic Explanations), which consists in perturbing
data samples and training local surrogate models for individual predictions, and SHAP,
which is based on game theory Shapley values.</p>
        <p>Prentzas et al. [16] developed a framework for combining ML with symbolic reasoning,
and applied it for stroke predictions. Their framework can be applied on top of any
ML technique amenable to rule-generation algorithms (such as RFs and Decision Trees).
It is based on the Gorgias argumentation framework, a logic programming framework
that is able to combine preference reasoning and abduction. The framework consists in
extracting rules from the trained model, processing the resulting rules with Gorgias, and
allowing users to query Gorgias about the reasons behind the decisions of the system. On
the other hand, Settoui et al. [17] applied neuro fuzzy c-means classifiers in the context of
diabetes diagnosis. They are a combination of a fuzzy c-means classifier, which is highly
interpretable but cannot be trained, and neural networks, which are not interpretable
but can be trained. Combining both approaches enables automatic adjustment of fuzzy
rules by representing them in a neural network.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Architecture</title>
      <sec id="sec-4-1">
        <title>3.1. General overview</title>
        <p>Figure 1 provides a global vision, at an architectural level, of the proposal put forward in
this work. As can be seen, there are two applications that communicate with each other
through cloud infrastructure. On the one hand, the therapist’s application allows the
monitoring of patients and includes functionality for user management and the creation</p>
        <sec id="sec-4-1-1">
          <title>THERAPIST APPLICATION</title>
          <p>Management &amp; Visualization</p>
        </sec>
        <sec id="sec-4-1-2">
          <title>CLOUD PROCESSING</title>
          <p>Logic &amp; Persistence Layer
Therapy tailored to the
needs of the patient
Recommender</p>
          <p>Module
Fuzzy Logic-Based
Reasoning Engine</p>
          <p>Fuzzy Rules Generation
Exercises</p>
          <p>Difficulty
Degree
Explainable AI</p>
          <p>Module
Explainable AI: From
Complexity to Clarity
Patient Data</p>
          <p>Routine History
Exercise Adequacy</p>
          <p>Mobility</p>
          <p>Performance
Routine Execution Data
Time # Repetitions
# Sets Completion</p>
          <p>PATIENT</p>
        </sec>
        <sec id="sec-4-1-3">
          <title>PATIENT APPLICATION</title>
          <p>Guided exercise routine</p>
          <p>Routine
Execution</p>
          <p>Exergame
Visualization of the routine &amp;
Gamified guide for the patient</p>
          <p>Body Tracking
Kinematics Analysis
Waypoint Colission Detection
of rehabilitation routines. On the other hand, the patient application allows the patient
to perform rehabilitation exercises autonomously from home, according to the routine
previously assigned by the therapist.</p>
          <p>As the focus of this paper is on the decision support system designed to automatically
adapt rehabilitation routines, the main aspects of its design are discussed below. In
particular, Section 3.2 discusses the technical aspects of the routine recommendation
module, which is based on our previous work [18]. Section 3.3 then describes how the
automatic explanations associated with the module are generated.</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>3.2. Recommender module</title>
        <p>The recommender module has been implemented using a Fuzzy Inference System [19].
Fuzzy logic is a particular case of infinite-valued logic, in which truth values range from
0 to 1 [20]. It was created in 1965 by Lofti Zadeh, and aims to achieve computing with
words [21]. A notable advantage of fuzzy logic is its ability to tolerate uncertainty. Being
able to deal with uncertainty is important in our proposal because joint tracking is
imprecise, and it is not possible to know all the data about the patient with precision.
Fuzzy logic is also highly interpretable, since it is based on rules that follow an if-then
structure. Interpretability is also relevant in our proposal because it facilitated the
incorporation of XAI. The FIS consists in a set of fuzzy variables, which may either be
input or output variables, and an algorithm that employs the fuzzy variables to generate
a new routine from the data collected from the execution of the previous routine by the
patient (see Algorithm 1).</p>
        <p>The input variables of the FIS and their descriptions are as follows:
• time: This variable represents the duration of the daily exercise, ranging from 0 to
300 seconds.
• completion: This variable indicates the percentage of exercises completed compared
to the scheduled exercises in the routine being adjusted. It ranges from 0 to 100.
• reps: This variable represents the number of repetitions of a specific exercise
performed daily, with a maximum limit of 50 repetitions.
• sets: This variable represents the number of sets of an exercise performed daily,
with a maximum of 10 sets.
• performance: This variable reflects the overall patient’s performance level and is
used to summarise past performance. Unlike time or repetitions, it is not tied to
a specific physical metric. It is scaled from 0 to 100 for simplicity, with an initial
value of 50 that can be modified by subsequent recommendations.
• mobility: This variable indicates the general level of mobility perceived by the
therapist. Similarly to performance, it ranges from 0 to 100 and is not tied to
specific physical metrics.
• exergame_dif: This variable complements the execution data when analyzing
parameters of exergames. It ranges from 0 to 100 and follows the same principles as
performance and mobility. Fuzzy rules are used to determine the dificulty based on
predefined waypoints within a unitary square that guides the patient’s movements.
• waypoint_number: This variable represents the number of waypoints for each
repetition of an exercise, ranging from 2 to 10.
• waypoint_distance: This variable represents the average distance between
consecutive waypoints for a given exercise. It ranges from 0 to 1.</p>
        <p>The output variables of the FIS and their descriptions are as follows:
• rep_incr: This variable represents the adjustment to the number of scheduled
repetitions for a specific exercise. A positive value indicates an increment, while a
negative value indicates a decrement. The use of increments avoids abrupt changes
in the routine. It ranges from -40 to 40.
• set_incr: This variable represents the adjustment to the number of scheduled sets
for a specific exercise. It ranges from -3 to 3.
• time_incr: This variable represents the adjustment to the allocated time for the
execution of an exercise. It ranges from -120 to 120.
• performance_incr: This variable represents the contribution of an exercise to the
adjustment of the overall performance. Total adjustment is the average of the
contributions of all exercises. It ranges from -20 to 20.
• adequacy_incr: The adequacy variable indicates how suitable an exercise is for the
patient and ranges from 0 to 100. It is used in the creation of personalised routines
for the selection of exercises. The adjustment range is from -20 to 20.
• exergame_number: This variable represents the number of exercises included in
the personalised routine and ranges from 1 to 10.</p>
        <p>In order to completely define the FIS, it is also necessary to define the fuzzy sets
of each variable. A systematic approach known as fuzzy partitioning was employed to
define the fuzzy sets. For each fuzzy variable, five fuzzy sets were established: VL (very
low), L (low), M (medium), H (high), and VH (very high). The membership function
for all of these fuzzy sets follows a cone shape, where there is a specific value at which
the membership is 1. From that point on, the membership decreases linearly in both
directions until it reaches a membership level of 0. The fuzzy sets are evenly distributed,
with the VL set centred around the lowest possible value for the variable, and the VH
set centred around the highest possible value.</p>
        <p>
          The main guideline while defining the fuzzy rules of the FIS was to maintain the
motivation of the patient. If the routine is too easy then the patient feels bored, while if
the routine is too dificult then the patient feels frustrated [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. The success of physical
rehabilitation depends on the amount of physical activities as well as the patient’s
commitment to the therapy [22]. Listed below are some sample rules. The full list of
rules (a total of 118) and the inference system, coded in R, is available for the reader1.
• fuzzy_rule(time %is% VL &amp;&amp; completion %is% VH, rep_incr %is% VH)
• fuzzy_rule(time %is% VL &amp;&amp; completion %is% M, performance_incr %is% H)
One of the major challenges faced during the design of the FIS was that it deals
with two problems simultaneously: choosing the exercises that comprise the routine and
adjusting the parameters of the exercises. To solve this problem, rules have been designed
with one of the following goals in mind: adjusting a parameter of an exercise, determining
the adequacy of an exercise for a patient and choosing the number of exercises in the
routine. Additionally, rules were added to determine the dificulty of the exergame.
Algorithm 1 describes in detail how these rules are used to adjust the routine. The main
advantage of this algorithm is that it simplifies the design of the fuzzy rules, which are
only focused on one goal, while enabling the FIS to achieve both goals simultaneously.
        </p>
      </sec>
      <sec id="sec-4-3">
        <title>3.3. Explainable AI</title>
        <p>The XAI algorithm used is based on the extraction of rules from the model. Since this
method is based on FIS, it is an intrinsic model-specific method. Additionally, this XAI
algorithm is a local method because it is focused on providing explanations for specific
decisions of the system rather than for the global logic of the model. Our approach
to extracting rules was to analyse the rules that were activated during the inference
and select the most relevant rule for the decision of the system. The most relevant rule
1https://www.esi.uclm.es/www/dvallejo/AIXIA2023/DSS_inference_system.R
quantifiable factors that contribute to the explainability of a FIS are the number of rules
in the system and the number of variables per rule. The lower the number of rules and
variables, the higher the explainability of the model. However, a lower number of rules
and variables tends to impact the efectiveness of the model; there is a trade-of between
explainability and performance [13].</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>4. Results</title>
      <p>This section aims to show how our proposal works by defining a basic rehabilitation
routine and its subsequent automatic adaptation by the DSS integrated into the overall
system. In this sense, details of the system’s reasoning for such adaptation will also be
included. However, before discussing this case study, the following subsections provide
details of the two interrelated applications that make up the overall rehabilitation system:
(i) the patient application and (ii) the therapist application. The DSS is actually a
software module of this second application.</p>
      <sec id="sec-5-1">
        <title>4.1. Patient’s application</title>
        <p>Figure 2 shows the visual aspect of the application used by the patients through diferent
views. In particular, the application ofers a number of tips on how to use the application
(see Figure 2.b), as well as incorporating information on safety use. Currently, the
application ofers two main modes: i) routine mode, where the patient performs the
exercises of the routine previously assigned by the therapist, and ii) autonomous mode,
where the patient can choose which exercise to perform (see Figure 2.c).</p>
        <p>On the other hand, the view in which the patient performs rehabilitation has been
designed with usability as a fundamental element. To this end, virtual spheres are used,
which are numbered so that the user knows which joint of his body must pass through
which area of physical space, always in a predefined order. The reference joint for each
exercise is marked with a small white circle containing a green dot. In addition, it is
possible to set fixed joints so that the patient does not compensate for the lack of mobility
with other parts of the body. For example, Figure 2.d shows how the patient must fix his
elbow (joint marked with a green cross) at a certain point in the space (pink grid) in
order to perform the exercise correctly.</p>
        <p>It is worth noting that the patient’s application is gamified, i.e. it includes a series
of simple mechanics to motivate the patient to perform the exercises. In addition to a
score and timer, the application renders visual efects and plays sounds according to the
patient’s correct (or incorrect) performance.</p>
        <p>Finally, the application uses a machine learning model to track the patient’s skeleton2.
This design choice is diferent from other existing commercial applications, as our system
can run on any computer or mobile phone with a standard webcam. In this sense, it is
able to work directly on 2D images without the need to use specific hardware devices
that calculate positions and orientations in 3D space. This choice greatly increases the
2https://github.com/google/mediapipe
c
b
d
accessibility of technological solutions for physical rehabilitation, as no specific hardware
(such as those with integrated depth sensors) is required. However, the recognition of
certain types of exercises (e.g. joint rotations) is a technical challenge.</p>
      </sec>
      <sec id="sec-5-2">
        <title>4.2. Therapist’s application</title>
        <p>In order for the patient to be guided through a rehabilitation routine, it must first be
defined by a therapist. Our proposal includes a second application that allows both the
definition of routines and the automatic adaptation by the DSS. The two applications are
connected via web technology. In particular, the therapist application is a web application
deployed in the cloud. This choice was made with the scalability of the system in mind,
as the therapist does not need to install any software on his computer.</p>
        <p>Figure 3 shows the routine editing screen. A routine is an ordered sequence of exercises.
Each exercise has a number of sets associated with it, structured in repetitions. The
therapist can also define the maximum time to complete an exercise and the rest time
between sets.</p>
        <p>The therapist’s application provides the ability to automatically adjust a patient’s
assigned routine at the click of a button. The therapist simply clicks a button to generate
the new routine. The visual result is shown in Figure 4.a and consists of the sequence of
exercises previously assigned by the therapist, but with new values associated with sets,
repetitions, maximum time and rest time between sets. Before validating or rejecting the
adjustments proposed by the DSS, the therapist can consult the explanations provided
by the DSS that motivated the automatic modification of the routine according to
the patient’s performance. These explanations are also visual and can be seen in the
Figure 4.b.</p>
      </sec>
      <sec id="sec-5-3">
        <title>4.3. Case study: automatic adjustment of a routine for stroke patients</title>
        <p>This section presents a concrete case of automatic adaptation, considering a simple
rehabilitation routine assigned to a stroke patient. The aim is to show how the DSS
works for a representative example and what information it provides to motivate the
automatic adaptation of the routine. The result of the inference process from three
samples is included to better illustrate the model of the DSS. All examples refer to the
execution data of the same routine: a reference routine that starts on 03-06-2023 and
ends on 09-06-2023. The routine is executed every Monday, Wednesday and Friday and
the daily target is 2 sets of 20 repetitions for each exercise in the system (8 in total).
The exercises included in the original routine are open arm movement, elbow extension,
side arm raise and weighted bicep curl.</p>
        <p>The sample execution data can be seen in Table 1. Each row represents a sample
(column Number). Columns Mobility and Performance represent the patient’s data
for each sample. Mobility and performance were defined in section 3.2. Columns Sets,
Repetitions and Time represent how each patient sample executed the reference routine
previously assigned. This reference routine (2 sets and 20 repetitions per exercise) is the
same for all samples. For example, sample 3 represents a patient that spent 120 seconds
making 1 set of 5 repetitions per exercise (instead of 2 sets of 20 repetitions each).</p>
        <p>On the other hand, columns New Sets, New Repetitions and New Time represent the
output of the DSS after adjusting the routine depending on the patient’s performance,
that is, after the patient made the reference routine for the first time. The recommended
routine generally corresponds to the expected output. In sample number 1 (first row),
the execution data was average and no major changes were made. In sample number
2 (second row), the execution data was pretty good and the dificulty was increased
(more sets, more repetitions and less time). Finally, in sample number 3 (last row), the
execution data is poor and the dificulty is decreased. The changes made in the third
example can be seen graphically in Figure 4. In this case, the DSS maintains the number
of sets regarding the reference routine (2 sets), but the dificulty is actually decreased by
reducing the number of repetitions and increasing the time.</p>
      </sec>
      <sec id="sec-5-4">
        <title>4.4. Limitations of the study</title>
        <p>So far, the proposal has been reviewed by a physiotherapist who has validated the
system of rules that is part of the recommendation module previously discussed in section
3.2. We have also shown the system as a whole, i.e. the two applications, to several
therapists in Spain and the UK, in order to validate the functionality currently ofered
by the system. In parallel, we defined an arbitrary number of rehabilitation routines and
simulated the progress of several fictitious patients in order to verify the adequacy of the
recommendations and explanations ofered by the therapist’s application. This testing
and debugging process allowed us to fine-tune the recommendations module.</p>
        <p>Moreover, while our initial focus has been on stroke rehabilitation, the only component
of the system that is specific to stroke is the list of exercises that can be assigned to
patients. With the appropriate selection of exercises, the system could be adapted
to support the physical rehabilitation of other neurological diseases. Additionally, the
recommendation module is able to select the most adequate exercises for the patient
according to how they perform each exercise. This adaptability facilitates the integration
of exercises for diferent neurological diseases into the system.</p>
        <p>However, a preliminary clinical evaluation is necessary to assess both the patient’s
application, in terms of remote exercise performance, and the therapist’s application as a
whole. With regard to the latter, it is essential to compare the recommendations made by
the system with the ones that the physiotherapist could make when working with patients.
In this sense, we intend to face this clinical evaluation with the Hospital Nacional de
Parapléjicos de Toledo (Spain), entity with which we are currently collaborating in the
development of Virtual Reality (VR) solutions for the rehabilitation of upper limbs in
patients with Spinal Cord Injury (SCI) [23].</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>5. Conclusions and future work</title>
      <p>In this paper, we have presented the design of a DSS capable of automatically generating
and justifying modifications to physical rehabilitation routines previously assigned by
a therapist to his patients. The ability of the DSS to provide visual explanations falls
within the scope of Explainable AI. This DSS is integrated into a system composed of
two interlinked applications that allow both the monitoring of patients and the remote
execution of rehabilitation exercises by them. The DSS is based on the use of fuzzy logic
and, in particular, consists of fuzzy rules that govern its behaviour. The choice of fuzzy
logic significantly increases the scalability and interpretability of the system. The DSS
is able to simultaneously adjust the parameters of the exercises and select the exercises
that make up the modified routine.</p>
      <p>The completion of this work opens up a number of research lines. One is related to
the ability of the DSS to automatically generate the explanations. Although the current
approach to generating is efective, it does not treat all cases equally. If there is only
one rule that contributes significantly to the output of the system, it is selected as the
explanation. However, if there are many rules that contribute significantly to the output,
only one of these rules is selected. This could be improved by generating an explanation
as a combination of similar rules, or by selecting multiple rules as the explanation.</p>
      <p>On the other hand, the current version of the DSS does not accept any information
from the therapist other than the patient’s level of mobility. If therapists had a greater
degree of influence, they could better handle edge cases. For example, if the therapist felt
that the patient needed to do a particular exercise, the DSS would include that exercise
in the routine, despite the level of appropriateness of that exercise.</p>
      <p>Finally, the current version of the DSS is passive; a suggestion is only made if the
therapist requests it. This is because changing patient’s rehabilitation routine without the
therapist’s supervision is not without risk. However, there are other tasks in monitoring
the patient’s progress where the system could play a more important role where the
system could take a more proactive approach. For example, if the routine does not do
enough repetitions, the system could inform the therapist of this situation.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>This work has been funded by University of Castilla-La Mancha (Spain) under Project
ID 2023-GRIN-34400.
a bayesian network: prototype and results of a feasibility study, Informatics for
Health and Social Care 35 (2010) 144–156.
[9] M. Capecci, M. G. C. et al., A hidden semi-markov model based approach for
rehabilitation exercise assessment, Journal of Biomedical Informatics 78 (2018) 1–11.
[10] A. Karime, M. Eid, J. M. Alja'am, A. E. Saddik, W. Gueaieb, A fuzzy-based
adaptive rehabilitation framework for home-based wrist training, IEEE Transactions
on Instrumentation and Measurement 63 (2014) 135–144.
[11] I. Ahmed, G. Jeon, F. Piccialli, From artificial intelligence to explainable artificial
intelligence in industry 4.0: a survey on what, how, and where, IEEE Transactions
on Industrial Informatics 18 (2022) 5031–5042.
[12] H. W. Loh, C. P. e. a. Ooi, Application of explainable artificial intelligence for
healthcare: A systematic review of the last decade (2011–2022), Computer Methods
and Programs in Biomedicine (2022) 107161.
[13] D. Gunning, M. Stefik, J. Choi, T. Miller, S. Stumpf, G.-Z. Yang, XAI—explainable
artificial intelligence, Science Robotics 4 (2019).
[14] S. N. Payrovnaziri, Z. Chen, P. Rengifo-Moreno, T. Miller, J. Bian, J. H. Chen,
X. Liu, Z. He, Explainable artificial intelligence models using real-world electronic
health record data: a systematic scoping review, Journal of the American Medical
Informatics Association 27 (2020) 1173–1185.
[15] M. Gandolfi, I. B. Galazzo, R. G. P. et al., eXplainable AI allows predicting
upper limb rehabilitation outcomes in sub-acute stroke patients, IEEE Journal of
Biomedical and Health Informatics 27 (2023) 263–273.
[16] N. Prentzas, A. Nicolaides, E. Kyriacou, A. Kakas, C. Pattichis, Integrating
machine learning with symbolic reasoning to build an explainable ai model for stroke
prediction, in: 2019 IEEE 19th International Conference on Bioinformatics and
Bioengineering (BIBE), IEEE, 2019, pp. 817–821.
[17] N. Settouti, M. A. Chikh, M. Saidi, Generating fuzzy rules for constructing
interpretable classifier of diabetes disease, Australasian Physical &amp; Engineering Sciences
in Medicine 35 (2012) 257–270.
[18] C. Gmez-Portes, J. J. Castro-Schez, J. Albusac, D. N. Monekosso, D. Vallejo, A fuzzy
recommendation system for the automatic personalization of physical rehabilitation
exercises in stroke patients, Mathematics 9 (2021) 1427.
[19] L. A. Zadeh, Fuzzy logic= computing with words, IEEE transactions on fuzzy
systems 4 (1996) 103–111.
[20] F. J. Pelletier, Petr hájek. metamathematics of fuzzy logic. trends in logic, vol. 4.
kluwer academic publishers, dordrecht, boston, and london, 1998, viii + 297 pp.,
Bulletin of Symbolic Logic 6 (2000) 342–346.
[21] J. Mendel, L. Z. et al., What computing with words means to me [discussion forum,</p>
      <p>IEEE Computational Intelligence Magazine 5 (2010) 20–26.
[22] B. H. Dobkin, Rehabilitation after stroke, New England Journal of Medicine 352
(2005) 1677–1684.
[23] V. Herrera, D. Vallejo, J. J. C.-S. et al., Rehab-immersive: A framework to
support the development of virtual reality applications in upper limb rehabilitation,
SoftwareX 23 (2023) 101412.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Webb</surname>
          </string-name>
          , A. e. a. Fonseca,
          <article-title>Value of treatment by comprehensive stroke services for the reduction of critical gaps in acute stroke care in europe</article-title>
          ,
          <source>European journal of neurology 28</source>
          (
          <year>2021</year>
          )
          <fpage>717</fpage>
          -
          <lpage>725</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>W.</given-names>
            <surname>Johnson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Onuma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Owolabi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sachdev</surname>
          </string-name>
          ,
          <article-title>Stroke: a global response is needed</article-title>
          ,
          <source>Bulletin of the World Health Organization</source>
          <volume>94</volume>
          (
          <year>2016</year>
          )
          <fpage>634</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Schez-Sobrino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Vallejo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. N.</given-names>
            <surname>Monekosso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Glez-Morcillo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Remagnino</surname>
          </string-name>
          ,
          <article-title>A distributed system based on automatic assessment of physical exercises to promote remote physical rehabilitation</article-title>
          ,
          <source>IEEE Access 8</source>
          (
          <year>2020</year>
          )
          <fpage>91424</fpage>
          -
          <lpage>91434</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R. T.</given-names>
            <surname>Sutton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Pincock</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. C.</given-names>
            <surname>Baumgart</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. C.</given-names>
            <surname>Sadowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. N.</given-names>
            <surname>Fedorak</surname>
          </string-name>
          ,
          <string-name>
            <surname>K. I. Kroeker,</surname>
          </string-name>
          <article-title>An overview of clinical decision support systems: benefits, risks, and strategies for success</article-title>
          ,
          <source>NPJ digital medicine 3</source>
          (
          <year>2020</year>
          )
          <fpage>17</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Vallejo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Gmez-Portes</surname>
          </string-name>
          , J. e. a. Albusac,
          <article-title>Personalized exergames language: a novel approach to the automatic generation of personalized exergames for stroke patients</article-title>
          ,
          <source>Applied Sciences</source>
          <volume>10</volume>
          (
          <year>2020</year>
          )
          <fpage>7378</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.</given-names>
            <surname>Paneroni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Colombo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Papalia</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. C.</surname>
          </string-name>
          et al.,
          <article-title>Is telerehabilitation a safe and viable option for patients with COPD? a feasibility study</article-title>
          ,
          <source>COPD: Journal of Chronic Obstructive Pulmonary Disease</source>
          <volume>12</volume>
          (
          <year>2014</year>
          )
          <fpage>217</fpage>
          -
          <lpage>225</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Pinto</surname>
          </string-name>
          ,
          <string-name>
            <surname>H. R. C.</surname>
          </string-name>
          et al.,
          <article-title>Adaptive gameplay and dificulty adjustment in a gamified upper-limb rehabilitation</article-title>
          ,
          <source>in: 2018 IEEE 6th International Conference on Serious Games</source>
          and
          <article-title>Applications for Health (SeGAH)</article-title>
          , IEEE,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Schulze</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Song</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. G.</surname>
          </string-name>
          et al.,
          <article-title>Supporting rehabilitation training of COPD patients through multivariate sensor-based monitoring and autonomous control using</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>