Full text
Universidade do Minho Escola de Engenharia Tiago Sanches Franco Clinical Decision Support System to Electrostimulation Treatments for Muscle Rehabilitation in the Elderly October, 2024 UMinho | 2024 Tiago Sanches Franco Clinical Decision Support System to Electrostimulation Treatments for Muscle Rehabilitation in the Elderly
University of Minho School of Engineering Tiago Sanches Franco Clinical Decision Support System to Electrostimulation Treatments for Muscle Rehabilitation in the Elderly PhD Thesis Doctorate in Informatics Thesis supervised by Pedro Manuel Rangel Santos Henriques Paulo Alexandre Vara Alves october 2024
Copyright and Terms of Use for Third Party Work This dissertation reports on academic work that can be used by third parties as long as the internationally accepted standards and good practices are respected concerning copyright and related rights. This work can thereafter be used under the terms established in the license below. Readers needing authorization conditions not provided for in the indicated licensing should contact the author through the RepositóriUM of the University of Minho. License granted to users of this work: CC BY-NC-SA https://creativecommons.org/licenses/by-nc-sa/4.0/ i
Acknowledgements With deep gratitude, I would like to sincerely thank everyone who was part of this challenging doctoral journey. This work results from the support, dedication, and generosity of many. First and foremost, I am incredibly thankful to my supervisor, Professor Pedro Henriques, and my co-supervisor, Professor Paulo Alves. Their knowledge, patience, and consistent guidance led me through each step of this journey. I am equally grateful to Professor Maria João Varanda Pereira, who provided weekly support alongside my supervisors. Thank you for the trust you placed in me and the challenges you presented, which have shaped me both as a researcher and a person. To my partner and love, Laís Fabiana Serafini, who was by my side through moments of exhaustion, joy, and achievement. I offer my deepest thanks for your essential support, understanding, and patience throughout this journey. I am also grateful to my father and mother, whose attentiveness and care have been a constant source of strength, even from afar. To my sister, whose encouraging words have supported me not only in this work but throughout my life, I am deeply thankful. To the participants in the experimental studies, thank you for generously sharing your time and commitment to help advance this project. Without your involvement, this work would not have been possible. I would also like to thank Professors Paulo Leitão, Tiago Pedrosa, and José Rufino, who played key roles in the NanoStim project, along with students Leonardo Sestrem de Oliveira, Felipe Gimenez da Silva, Raul Kaizer, and João Gonçalves, who contributed significantly to the project. I am also thankful to physiotherapists Nelson Azevedo and Elsa Costa for their technical and scientific support throughout the NanoStim project. My sincere thanks to Ana Carolina Cardoso De Sousa and the Research Centre for Biomedical Engiii
neering members at the Universitat Politècnica de Catalunya. I am grateful for your warm welcome and professionalism, which provided a stimulating environment. To all my colleagues at the Research Centre in Digitalization and Intelligent Robotics (CeDRI), with whom I shared countless conversations, discussions, and cups of coffee, thank you for your friendship. Finally, I am grateful to the Foundation for Science and Technology (FCT), Portugal for the PhD scholarship grant number 2020.05704.BD , which made this research possible and allowed me to focus entirely on my studies. This work was supported European Regional Development Fund (ERDF) through the Operational Programme for Competitiveness and Internationalization (COMPETE 2020), under Portugal 2020, in the framework of the NanoStim (POCI-01-0247-FEDER-045908) project. This work was supported by national funds through FCT/MCTES (PIDDAC): CeDRI, UIDB/05757/2020 and UIDP/05757/2020; SusTEC, LA/P/0007/2020; Centro ALGORITMI, UIDB/00319/2020. This work reflects the contributions of each of you, and I am sincerely grateful. iii
Statement of Integrity I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. University of Minho, Braga, october 2024 Tiago Sanches Franco iv
Abstract The aging population poses increasing challenges to healthcare systems, particularly regarding long-term muscular rehabilitation services for the elderly. Conditions such as sarcopenia and knee osteoarthritis, which are common in this age group, compromise mobility and quality of life, making rehabilitation essential for ensuring active aging. Neuromuscular electrical stimulation has proven to be an effective intervention, but its proper application depends on personalized parameterization and continuous monitoring. This PhD project presents an innovative solution to this scenario: a Clinical Decision Support System (CDSS) aimed at electrostimulation treatments. Developed within the scope of the NanoStim project, CDSS integrates Industry 4.0 technologies to create an efficient, portable, and cost-effective wearable system, allowing treatment to be conducted at home, with increased accessibility and reduced clinical visits. A system architecture with sensitive data protection for home treatment scenarios is proposed. The system processes real-time muscle fatigue metrics, interprets knee extension exercises, and adjusts electrostimulation in a personalized manner. Three experimental studies validated CDSS. In the first, the system demonstrated the ability to synchronize biofeedback data and remove artifacts from the electromyographic signal. In the second, the accuracy of the mobile application in processing muscle fatigue metrics in real-time was demonstrated. In the third, the CDSS was compared with a gold-standard motion capture system, and responsive electrostimulation modes based on real-time biofeedback were tested. Finally, a statistical correlation analysis was conducted between the fatigue levels predicted by the CDSS and the participants’ subjective feedback. The CDSS received ethical approvals from different institutions and clearance for sensitive data storage. The analyzed results show that CDSS has the potential to innovate in the field of remote muscular rehabilitation and improve the quality of life for the elderly through personalized treatments. Keywords Biofeedback, Decision Support, Electrostimulation, Remote Rehabilitation, Wearable Device v
Resumo O envelhecimento da população impõe desafios crescentes aos sistemas de saúde, especialmente no que diz respeito aos serviços de reabilitação muscular de longo prazo para idosos. Condições como sarcopenia e osteoartrite do joelho, comuns nessa faixa etária, comprometem a mobilidade e a qualidade de vida, tornando a reabilitação essencial para garantir um envelhecimento ativo. A eletroestimulação neuromuscular tem se mostrado uma intervenção eficaz, mas a sua aplicação adequada depende de uma parametrização personalizada e acompanhamento contínuo. Esta tese de doutoramento apresenta uma solução inovadora para esse cenário: um Sistema de Suporte à Decisão Clínico (SSDC) para tratamentos de eletroestimulação. Desenvolvido no âmbito do projeto NanoStim, o SSDC integra tecnologias da Indústria 4.0 para criar um sistema wearable eficiente, portátil e de baixo custo, permitindo que o tratamento seja realizado em casa, com maior acessibilidade e redução de consultas clínicas. Assim, é proposto uma arquitetura de sistema com proteção de dados sensíveis para o cenário de tratamento ao domiciliar. O sistema processa em tempo real métricas relacionadas a fadiga muscular, interpreta o exercício de extensão de joelho e ajusta a eletroestimulação de forma personalizada. Três estudos experimentais validaram o SSDC. No primeiro, o sistema demonstrou a capacidade de sincronizar os dados de biofeedback e remover artefatos do sinal eletromiográfico. No segundo, foi evidenciada a precisão da aplicação móvel em processar métricas de fadiga muscular em tempo real. No terceiro, o SSDC foi comparado com um sistema padrão-ouro de captura de movimento, foram testados modos de eletroestimulação responsivos ao biofeedback coletado em tempo real. Por fim, foi realizado uma análise estatística de correlação entre o nível de fadiga previsto pelo SSDC com o feedback subjetivos dos participantes. O SSDC recebeu aprovações éticas de diferentes instituições e aprovação para armazenamento de dados sensíveis. Os resultados analisados mostram que o SSDC tem potencial de inovar a área de reabilitação muscular remota e melhorar a qualidade de vida dos idosos por meio de tratamentos personalizados. Palavras-chave Biofeedback, Dispositivo Vestível, Eletroestimulação, Reabilitação Remota, Suporte a Decisão vi
55 Example of segment with identified stimulation artifact. . . . . . . . . . . . . . . . . 111 56 Example of EMG signal captured during the FES experiment filtered. . . . . . . . . . . 113 57 Example of segment with identified stimulation artifact filtred. . . . . . . . . . . . . . 113 58 Mean muscle activity of subjects in mV. . . . . . . . . . . . . . . . . . . . . . . . . 114 59 Maximum Voluntary Contraction of subjects. . . . . . . . . . . . . . . . . . . . . . . 114 60 Mean muscle activity of subjects normalized by MVC. . . . . . . . . . . . . . . . . . 115 61 Variation in Maximum Angle and Duration of Knee Extension Movement - Experiment 1. . 116 62 Cycles of Knee Extension Movement. . . . . . . . . . . . . . . . . . . . . . . . . . 117 63 Muscle Activity in Knee Angle Ratio. . . . . . . . . . . . . . . . . . . . . . . . . . . 118 64 Comparison between the First and Third Test. . . . . . . . . . . . . . . . . . . . . . 119 65 Comparison between the First and Last Movement. . . . . . . . . . . . . . . . . . . 119 66 Trajectory of Median Frequency and RMS during the First and Third tests. . . . . . . . . 121 67 Concatenated Trajectory of Median Frequency and RMS during Tests 1 and 3. . . . . . 122 68 Variation in Maximum Angle and Duration of Knee Extension Movement - Experiment 2. . 125 69 Cycle of Knee Extension Movement - Exp 2. . . . . . . . . . . . . . . . . . . . . . . 126 70 Trend of the avgFreq metric during the session. . . . . . . . . . . . . . . . . . . . . 128 71 Trend of the medianFreq metric during the session. . . . . . . . . . . . . . . . . . . 128 72 Trend of the RMS metric during the session. . . . . . . . . . . . . . . . . . . . . . . 128 73 JASA Method apply to Experimental Test. . . . . . . . . . . . . . . . . . . . . . . . 129 74 (A) Occurrence of Fatigue (B) Intensity of Occurrences by Configuration. . . . . . . . . 131 75 Fatigue Levels Achieved by Configuration. . . . . . . . . . . . . . . . . . . . . . . . 132 76 Contraction number at first fatigue level achieved. . . . . . . . . . . . . . . . . . . . 132 77 (A) Amount of Occurrence (B) Average Intensity of First and Last Level per Participant. . 133 78 (A) Contractin Number of Levels Change (B) Average Intensity per Level. . . . . . . . . 134 79 Comparison between systems of the AvgF req metric. ................135 80 Comparison between systems of the MedFreq metric.................135 81 Comparison between systems of the RMS metric. ..................135 82 MoCap equipment: Camera (A) and Body Makers (B). . . . . . . . . . . . . . . . . . 138 83 Experimental Setup Showing the Positioning of Electrodes, Sensors, and Markers. . . . . 140 84 Pre-Processing Methodology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 85 OpenSimModelScaling. ...............................142 86 Variation in Maximum Angle and Duration of Knee Extension Movement - Experiment 3. . 144 xiii
87 Comparison of Maximum Angle Variation between CDSS and MoCap. . . . . . . . . . . 145 88 Comparison of Maximum Angle Variation between CDSS Adjusted and MoCap. . . . . . 146 89 Kinematic Comparison of Movement between the systems. . . . . . . . . . . . . . . . 147 90 Dynamic Comparison of Movement between the systems. . . . . . . . . . . . . . . . 148 91 Knee angle at the start and end of stimulation modes.. . . . . . . . . . . . . . . . . . 150 92 EMG signal during Raising the Leg stimulation. ....................151 93 EMG signal during Range of Angle stimulation......................151 94 Self-Reported Feedback of Experiment 3. . . . . . . . . . . . . . . . . . . . . . . . 152 95 Stimulation Noise in the EMG signal. (A) Raising the Leg (B) Range Of Angle . . . . . . . 154 96 Muscle Activity in Both Legs - Experiment 3. . . . . . . . . . . . . . . . . . . . . . . 155 97 Muscle Activity Variation During Experimental Sessions in Both Legs - Experiment 3. . . 155 98 Trend of the Averange Frequency Metric - Experiment 3. . . . . . . . . . . . . . . . . 156 99 Trend of the Median Frequency Metric - Experiment 3. . . . . . . . . . . . . . . . . . 156 100 Trend of the RMS Metric - Experiment 3. . . . . . . . . . . . . . . . . . . . . . . . . 157 101 Joint Amplitude and Spectrum Analysis (JASA) - Experiment 3. . . . . . . . . . . . . . 157 102 Fatigue Occurrences by Configuration in Both Legs - Experiment 3. . . . . . . . . . . . 158 103 Intensity of Occurrences by Configuration in Both Legs - Experiment 3. . . . . . . . . . 159 104 Fatigue Levels Achieved by Configuration on the Left Leg - Experiment 3. . . . . . . . . 160 105 Fatigue Levels Achieved by Configuration on the Right Leg - Experiment 3. . . . . . . . 160 106 Contraction Number at First Fatigue Level Achieved on the Left Leg - Experiment 3. . . . 161 107 Contraction Number at First Fatigue Level Achieved on the Right Leg - Experiment 3. . . 161 108 Amount of Fatigue Occurrences (A) and Intensity (B) by Subjects on the Left Leg. . . . . 162 109 Evolution of Fatigue Perception in the Self-Report on the Left Leg. . . . . . . . . . . . 162 110 Amount of Fatigue Occurrences (A) and Intensity (B) by Subjects on the Right Leg. . . . 163 111 Evolution of Fatigue Perception in the Self-Report on the Right Leg. . . . . . . . . . . . 164 112 Comparison of self-report fatigue with predicted level by subject. . . . . . . . . . . . . 166 xiv
List of Tables 1 InclusionSearchTerms................................. 24 2 ExclusionSearchTerms. ............................... 25 3 ResearchQuestions. ................................. 26 4 InclusionCriteria.................................... 27 5 ExclusionCriteria.................................... 27 6 Identification of Selected Articles. . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7 Data and Acquisition Tools Used in the Selected Studies. . . . . . . . . . . . . . . . . 38 8 Study participants by type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 9 Biofeedback data and packet volume. . . . . . . . . . . . . . . . . . . . . . . . . . 59 10 Optimized Data Transmission Frequency. . . . . . . . . . . . . . . . . . . . . . . . 59 11 Evaluation metrics of the applied filters in degrees. . . . . . . . . . . . . . . . . . . . 104 12 Anthropometric data of the subjects - Experiment 1 . . . . . . . . . . . . . . . . . . 107 13 Comparative Metrics between the First and Third Tests. . . . . . . . . . . . . . . . . 120 14 Anthropometric data of the subjects - Experiment 2. . . . . . . . . . . . . . . . . . . 124 15 Assessment metrics on fatigue metrics. . . . . . . . . . . . . . . . . . . . . . . . . 136 16 Anthropometric data of the subjects - Experiment 3. . . . . . . . . . . . . . . . . . . 139 17 Kinematic Evaluation Metrics Comparison. . . . . . . . . . . . . . . . . . . . . . . . 147 18 Dynamic Evaluation Metrics Comparation. . . . . . . . . . . . . . . . . . . . . . . . 148 19 Average Variation in Fatigue and Comfort Across Experimental Sessions. . . . . . . . . 153 20 Correlations between predicted and self-reported fatigue levels. . . . . . . . . . . . . . 167 xv
Chapter 1 Introduction This chapter opens the dissertation, outlining its contents. Initially, the first section contextualizes the motivation behind the doctoral project. Subsequently, the second section explains the objectives and highlights their relevance in the research context. The third section details the research methodologies used in the study. Finally, the fourth section discusses the general structure of this document. 1.1 Motivation and Relevance Over the last few decades, a substantial global increase in life expectancy has been recorded, particularly in regions such as Europe and Portugal. This positive trend is linked to advances in healthcare technology, improvements in living standards, and greater access to education. Notably, the demographic group of individuals aged 65 and above, constituting the elderly population, stands out as one of the fastest-growing segments, significantly impacting societal dynamics and the healthcare systems (Dattani et al., 2023). Figure 1: Population growth in Portugal by age group (Ritchie et al., 2023). To understand the magnitude of population growth, Figure 1 illustrates population growth in Portugal divided by age groups. Comparing statistics from 1980 to 2020, it is possible to note that Portugal’s elderly population grew from 1.12 million to 2.32 million, representing an increase of more than 100%. 1
Similarly, European populations are reflecting this growth at a proportional rate, worldwide this growth is even bigger, close to 200% for the same period (Ritchie et al., 2023). As the proportion of older adults increases, the demand for primary and long-term health services also grows, especially those related to chronic conditions and age-related diseases. The gradual decline in functional capacity due to aging is natural progress common to all living beings, requiring constant care to preserve an active and dignified life (WHO, 2021). Thus, rehabilitation treatments face a critical accessibility problem that tends to get worse. A Study was carried out by Cieza et al. (2020) to assess the demand for rehabilitation services worldwide and its impact on the healthcare system. The results obtained reveal that one in three people in the world, approximately 2.4 billion individuals, need these services. These estimates contradict the common belief that the need for rehabilitation is restricted to a limited number of people. This finding highlights the magnitude of the demand for rehabilitation services and emphasizes the importance of effective strategies to serve this considerable portion of the global population. The concern about the delay in finding the necessary treatment is addressed by the World Health Organization (WHO) in their report on healthy aging for the decade between 2021 and 2030 (WHO, 2021). The report highlights the significance of improving functional capacity to promote more independent aging and suggests data-driven solutions to achieve scalable and accessible answers. The traditional treatment for mobility rehabilitation is regular physical exercise, improving the performance of strength, endurance, balance, flexibility, and so on. However, regular training for the elderly can be expensive since some pathologies such as cardiovascular diseases and neuromuscular problems can make the execution of some exercises unfeasible, generating a need to attend specialized training centers or hire specialized agents (Chodzko-Zajko et al., 2009). A solution positioned as an interesting and less expensive alternative to the traditional training methods could be home-based neuromuscular electrical stimulation (NMES), also known as Functional Electrical Stimulation (FES). NMES is a technique that artificially produces muscle contraction through the application of an electrical current with surface electrodes on the muscles. There is still no consensus on all reactions that the application of NMES provokes in the body and especially in the muscle. However, it is believed that training with NMES produces an increase in the muscle’s capacity to generate force, triggering a series of benefits (Imoto et al., 2013). NMES is generally applied to improve functional capacity, preservation and recovery of muscle mass, and muscle strengthening. A systematic review presented by Langeard et al. (2017) show that training with NMES is safe and has an efficiency similar to traditional training in the elderly. Furthermore, they 2
show that training with NMES can bring considerable benefits to the physiological state, improving gait and balance performance, especially in less active elderly people. Despite this, the use of NMES as a training method for muscle rehabilitation in the elderly is considered recent. So far, there is no consensus on which configurations produce a more adequate rehabilitation. Several parameters have already been tested for the treatment, however, there is no evidence that only a certain set of parameters can trigger positive effects in the treatment. (Langeard et al., 2017). Maffiuletti (2010) reports that evidence suggests that the effectiveness of electrostimulation depends more on the patient’s natural characteristics than on the adjustable parameters of NMES treatment. In this context, the research area Health 4.0 can play an essential role in constructing treatments that consider individual particularities. Health 4.0 is a recent area that encompasses how health is managed and delivered, considering the latest technological advances that combine concepts derived from Industry 4.0, including the Internet of Things, Big Data, Machine Learning, and mobile apps (Bause et al., 2019). Combining these elements provides the fundamental requirements to create patient-centered approaches that were not available before. The key that enables the design of innovative treatments is the data collected through sensors integrated into wearables or smart devices (Lou et al., 2020). Several sensors can acquire high-quality data that can be clinically relevant, for example, motion identification through the Inertial Measurement Unit sensor (IMU), heart rate measurement through the Electrocardiogram sensor, muscle contraction volume through the Electromyogram sensor (EMG), blood pressure through Oximeter sensor, among others (Jayaraman et al., 2020). 1.2 Research Objectives This doctoral project aims to advance the principles of Health 4.0 by designing and developing a Clinical Decision Support System (CDSS) tailored for neuromuscular electrical stimulation (NMES) treatments in muscle rehabilitation for the elderly. The CDSS is conceived as an intelligent system that supports healthcare professionals in creating personalized rehabilitation plans that adapt to each patient’s unique biological responses. Additionally, the system facilitates remote, home-based treatments through a wearable device, addressing the growing demand for scalable, accessible, and effective rehabilitation solutions to manage conditions such as sarcopenia and knee osteoarthritis in the aging population. 3
Research Question How can a Clinical Decision Support System be designed to support remote rehabilitation with electrostimulation using a wearable device? This main research question guides the investigation into how a CDSS can be developed to effectively support remote muscle rehabilitation by integrating real-time biofeedback data from NMES treatment sessions. The goal is to create a system capable of performing automated analyses of muscle behavior, providing personalized treatment that adjusts to the patient’s condition over time. Moreover, the CDSS is expected to enhance communication between healthcare professionals and patients, ensuring a more integrated, data-driven, responsive rehabilitation process. In order to address the central research question effectively, it is necessary to break it down into specific investigations that focus on critical elements of the CDSS design and functionality. Each research question targets a fundamental part of the system, contributing to a structured and comprehensive understanding of its development. These questions are crucial for guiding the design and implementation of the CDSS in a structured, evidence-driven approach that facilitates the achievement’s replicability. Specific Research Questions 1. How can real-time biofeedback from a wearable device be processed to monitor and assess muscle fatigue during remote rehabilitation accurately? 2. What methods can be implemented to securely store and transmit sensitive patient data within the system architecture? 3. How can electrostimulation treatments be dynamically adjusted in real-time based on biofeedback data during a treatment session? Given on the research questions that pilot this PhD thesis, the doctoral project establishes four main objectives for overcoming the technological, clinical, and ethical challenges in developing the CDSS. Objectives • Design a System Architecture: Develop a system architecture that supports the integration of advanced algorithms such as machine learning and computational simulations within the context of muscle rehabilitation, ensuring the feasibility of remote treatments. 4
• Establish a Technological Interface: Create an interface that streamlines the rehabilitation process and enhances communication between patients and healthcare providers, promoting more efficient treatment monitoring and personalized feedback. • Ensure Data Protection and Privacy: Implement robust mechanisms for secure storage and transmission of sensitive patient data that align with ethical and legal standards. • Develop a Reasoning Method: Design a reasoning method capable of dynamically adjusting electrostimulation parameters based on real-time biofeedback. In addition, the project commits to contribute to the WHO proposals for the decade of healthy aging in two scientific forms. The first refers to collaboration with innovative ways to collect, measure and analyze data on the health of the elderly. The second refers to lower the cost of new treatments and expand access, opting for alternatives that enable online communication. 1.3 Research methodology This PhD work used two methodologies. Considering the nature of this research project, which involves the development of an Information System, the methodology adopted was Design Science Research, specifically Design Science Research Methodology for Information Systems (DSRM-IS). Since it was also required to develop models and explore different types of data, a second methodology that fits better was applied. In this context the research was guided by the Standard Cross-Industry Process for Data Mining (CRISP-DM). 1.3.1 Design Science Research Methodology for IS The DSRM-IS methodology consists of a set of principles, practices and procedures that must be followed to develop Information Systems and the necessary analytical perspectives to develop IS research. DSRM-IS is an iterative process that includes six main activities: Identify Problem and Motivate, Define objectives of a solution, Design and Development, Demonstration, Evaluation, Communication (Peffers, 2008). The DSRM-IS activities are presented in Figure 2. 5
Figure 2: DSRM Process Model (Peffers, 2008). Briefly, the competencies that must be performed in each activity are described below: •Identify Problem and Motivate: The first activity consists of defining the specific research problem and justify the value of the solution presented. •Define objectives of a solution: this activity aims to infer the solution objectives from the definition of the problem and the possible and attainable knowledge. Objectives can be quantitative or qualitative, as long as they allow reaching a solution to the identified problem. •Design and Development: the third activity consists of creating the artifact. A design research artifact can be any designed object as long as it has the research contribution built into the design. •Demonstration: In activity four it is necessary to demonstrate the use of the artifact solving at least the problem instances. The demonstration can be made in the form of experimentation, simulation, case study, proof, or other appropriate activity. •Evaluation: In this activity, it is necessary to observe and measure how well the artifact supports a solution to the problem. For this, knowledge of relevant metrics and analysis techniques is required. At the end of this activity, it is required to decide whether to iterate back to activity 3 to try to improve the artifact’s effectiveness. •Communication: The last activity is related to the communication of the problem and its importance, the artifact, its usefulness and novelty, the rigor of its design and its effectiveness for researchers. For this project, the communication activity was carried out through the publication of research articles and the publication of the doctoral dissertation. 6
1.3.2 Cross-Industry Standard Process for Data Mining The CRISP-DM methodology defines a hierarchical process model in terms for the execution of Machine Learning projects. This methodology can be described in four levels of abstraction: phase, generic task, specialized task and process instance. The purpose of CRISP-DM is to provide an overview of the life cycle of a project divided into 6 phases. The different phases are: business understanding, data understanding, data preparation, modeling, evaluating and deployment. This life cycle is an iterative process, where the outcome of the phase will determine the next step to be taken (Wirth and Hipp, 2000). Figure 3 illustrates the phases and links between the phases of the CRISP-DM methodology. The competencies that must be performed in each phase are described below: •Business understanding: The first phase is concerned with understanding the objectives and requirements from a business perspective. From the goals, a data mining problem and a preliminary project plan are defined. •Data understanding: The second phase aims to know the data after an initial collection. It is intended that this phase can identify data quality problems, discover features and detect important subsets of the data. There is a close link with the first phase, as formulating the data mining problem requires at least some understanding of the available data. •Data preparation: In this phase, all activities to build a final dataset are performed, including the selection of datasets, rows and attributes, as well as data transformation and cleansing. Thus, the output of this phase is the input set for the modeling tools. •Modeling: The fourth phase consists of selecting and applying several modeling techniques to the data. There is a close link between the third phase as some data issues can be found during modeling and need to go back to data preparation. •Evaluating: At this stage, it is expected that the project has some models that demonstrate high quality from the perspective of data analysis. The main objective is to evaluate using metrics that justify a solution in the business objectives defined in the first phase. At the end, a decision must be made about the implementation of the models. •Deployment: The task assigned to the last phase of the CRISP methodology depends on the purpose for which the models were created. As an example, for a theoretical study it is preferable to create documentation or write an article. However in industry it may be more interesting to implement the model in production. 7
amplitude or strength of the pulses, and pulse width indicates the temporal duration of each pulse train (Lynch and Popovic, 2008). Despite these fundamental parameters, there is a variety of studies and treatments that go further, modifying the shape of the wave used. Among these modifications are rectangular, triangular or even irregular wave configurations. Generally, the pulses are biphasic, consisting of a positive pulse followed by a negative pulse. However, there are variations, including monophasic (a single pulse) or three-phase (three pulses in sequence) configurations. Figure 6: Schematic of biphasic electrostimulation pulses. Adapted (Lynch and Popovic, 2008). Figure 6 visualizes these concepts schematically. The parameters A in Figure 6 represent the size of an individual pulse. Since the schematic is of a biphasic electrostimulation, the negative component is present. The negative component size is represented by parameter B, which generally has the same value as A. Parameter C describes the period, being the amount of time between the beginning of one pulse and the beginning of the next. The D parameter indicates the pulse width, representing how long the pulse train will remain active. In a review presented by Langeard et al. (2017) of the functional effects that NMES has in the elderly, reports that electrical stimulation programs are highly inconsistent. The use of symmetrical rectangular pulses from 100 to 400 µs biphasic was the only common point of all the researched studies. The frequency ranged from 20 Hz to high levels close to 100 Hz, with adjustment of the tolerance level for each patient. In addition to the variation in stimulation characteristics, studies also show variations in the temporal composition of the treatment. The duration of treatment programs can vary from 4 to 16 weeks before reformulation. The number of weekly sessions also varies, from 2 to 4 times a week. Lastly, a single NMES treatment session can take 9 to 40 minutes to complete . 14
Despite this, several programs were successful in their purpose. Langeard reports any NMES training between 2 and 4 times a week for at least 4 weeks, with a frequency between 20 Hz and 70 Hz and with an intensity between 30 mA and 128 mA seems to be safe to trigger positive effects of NMES for muscle rehabilitation in the elderly. Furthermore, the use of NMES combined with voluntary training can increase the effectiveness of the treatment. The review presented by Nishida et al. (2016) investigated the potential use of electrostimulation as an intervention for sarcopenia in the elderly. Although the review emphasizes the variability of the effects of NMES depending on different treatment protocol, including stimulation frequency and session duration, the literature indicates that the application of low frequency stimuli (less than 20 Hz), short sessions (less than 30 minutes) linked to fatigue management may have better results. Notably, protocols with higher frequencies (60 Hz) also demonstrated positive results in healthy elderly people, indicating an increase in the diameters of both type I and type II muscle fibers. Thus, it is noteworthy that the determination of the ideal parameters to treat sarcopenia in the elderly has not yet been definitively established, requiring additional clinical studies with outcome measures focused on improving muscle strength. Imoto et al. (2013) performed a randomized clinical trial looking for evidence of the effectiveness of NMES in patients with KOA. Studies show that NMES is effective in improving pain, function and activities of daily living in patients with KOA. The treatment program administered ranged from 4 to 12 weeks in duration using a frequency of 25 to 50 Hz. 2.3 Decision Support System Belonging to the field of information systems (IS), Decision Support Systems (DSS) are computer-based systems developed to assist in decision making. The term DSS started before the 1970s and its focus was to improve the management decision-making process and pay-off (Arnott and Pervan, 2005). Power (2002) defines DSS as interactive computer-based systems that help people use communications, data, documents, knowledge and computer models to solve problems and make decisions and agrees with Arnott and Pervan (2005) that refer to Alter (1980) as one of the pioneers in the DSS field. Alter (1980) indicates that a DSS is identified through the following characteristics: 1. Specifically designed to facilitate decision-making processes; 2. Design to support, rather than automate decision-making; 3. Able to respond quickly to the changing needs of decision makers. 15
From the beginning, much of the theoretical study in DSS is focussed in understanding how the decision-making process takes place and how great managers make their decisions. In practice, the evolution of the DSS shows that the transformation of these theories into the effective use of DSS is a timeconsuming process and only after other subfields (mainly Business Intelligence and business analytics) matured and were incorporated to solve major problems in DSS area, the topic began to expand (Arnott and Pervan, 2014). Arnott and Pervan have been working for years looking to organize knowledge about DSS and define new questions about the discipline. Among their publications, a diagram of the DSS area genealogy was built from 1960 to 2000 (Arnott and Pervan, 2005) and updated until 2010 (Arnott and Pervan, 2014). Shown in Figure 7 , the purpose of this diagram is to understand how, and which fields of information technology (IT) have come together to create a new subfield in DSS area. Figure 7: The genealogy of the DSS field, 1960–2010 (Arnott and Pervan, 2014). In sequence, Arnott and Pervan (2008) indicate the most relevant subfields in the DSS, namely: 1. Personal Decision Support Systems (PDSS): Systems developed for one manager or a small group of managers focused on assisting their decision tasks. 2. Group Support Systems (GSS): DSS built to improve the efficiency of group work and communication. 16
3. Negotiation Support Systems (NSS): Systems that deal with the optimization of negotiations between opposing parties. 4. Intelligent Decision Support Systems (IDSS): the application of artificial intelligence techniques to decision support. 5. Knowledge Management-Based DSS (KMDSS): Systems that use the knowledge of individual and organizational memory to decision support. 6. Data Warehousing (DW): systems that provide the large-scale data infrastructure for decision support. 7. Enterprise Reporting and Analysis Systems: enterprise focused DSS including executive information systems (EIS), business intelligence (BI), and corporate performance management systems (CPM). Since this PhD project is focused on building custom NMES treatments using data-driven, it is natural to focus on Intelligent DSS (IDSS), which involves DSS that incorporates Artificial Intelligence like machine learning techniques and modern optimizations. According to the genealogy shown in Figure 7, the doctoral work scope falls under Knowledge Management, which encompasses the objectives of analyzing data collected through various systems to generate knowledge and apply it to improve decisions. 2.3.1 Clinical Decision Support Systems Clinical Decision Support Systems (CDSS) are tools designed to improve healthcare services by utilizing clinical knowledge, patient information, sensor data, and diagnostics. By providing knowledge that is intelligently filtered and presented at appropriate times, CDSS aims to improve health and healthcare. It supports clinical decision making, contributing to system efficiency, reducing errors and unnecessary expenses, and potentially improving patient well-being (Loya et al., 2014). Since the inception of the term CDSS in 1970, a wide variety of tools and interventions, both automated and non-automated, have been introduced to improve clinical decision making. The suite of non-automated tools includes clinical guidance and digital resources, also known as an Electronic Health Record (EHR). This technological advance plays an essential role in the management of medical information, translating the traditional paper patient record into a digitalized version, providing substantial improvements in the efficiency of the healthcare system (Sutton et al., 2020). Another category, known as basic or simple clinical decision support systems, cover systems focused on guiding attention and time management. Examples of these systems include laboratory information 17
systems (LISs) and pharmaceutical information systems (PISs) Wasylewicz and Scheepers-Hoeks (2019). These platforms issue alerts and suggest practical actions, such as recommending new medications or warnings about possible drug interactions. Finally, the latest progress is seen in advanced CDSS, providing personalized recommendations for each patient taking into account their unique characteristics. These systems represent a notable advance in the field of medical diagnosis, being applied in extensive and intricate domains (Wasylewicz and ScheepersHoeks, 2019). CDSSs have been widely discussed in the literature, helping doctors choose appropriate treatments and identify pathologies. Currently, CDSS are already used in practice, such as the use of x-ray images to recognize cancer, increasing the accuracy of diagnosis and accelerating the recovery process. Figure 8: The CDSS Components (Shoaip et al., 2019). Advanced CDSS typically consists of three essential components. The first component refers to storage strategies for clinical knowledge and health data. This component encompasses concerns about the protection of sensitive data, the availability of resources, interoperability, and among other responsibilities. The second component is the Inference Engine, where a certain deductive process is applied to transform the stored information into knowledge relevant to a specific decision-making process. The third component is the User Interface, which serves as a communication bridge between the knowledge generated and the users. CDSS typically embed a User Interface through mobile applications, desktop systems or websites, significantly influencing the acceptance and use of these tools. The core of the CDSS lies in the Inference Engine, which employs reasoning methods. These reasoning methods provide powerful tools and techniques for manipulating knowledge, making inferences, and making decisions to effectively solve problems. The reasoning process in a medical diagnosis is complex, as it must consider several facts, including the patient’s history, current symptoms, test results, therapies 18
received, and possible allergies (Shoaip et al., 2019). The most common reasoning methods in the medical field include Rule-Based Reasoning (RBR), CaseBased Reasoning (CBR), Machine Learning-Based Reasoning (MLBR) and Model-Based Reasoning (MBR). Each of these methods offers distinct approaches to inferring clinical knowledge, from applying logical rules to learning from large clinical data sets. This diversity reflects the need to choose reasoning methods appropriate to different representations of knowledge and areas of application in medical practice. According to Papadopoulos et al. (2022), reasoning methods can be found divided into two main categories. The first, “Knowledge-Based,” includes approaches such as Work-flow driven, RBR and Probabilistic reasoning. The second category is “Non-Knowledge Based”, involving different AI approaches such as Machine Learning (ML) algorithms, Artificial Neural Networks (NN), Genetic Algorithms (GA), Support Vector Machines (SVM), among others. Despite being labeled as “Non-Knowledge-Based”, these methods do not imply the absence of the use of data. In reality, the term means that AI algorithms typically do not rely on pre-existing knowledge during processing. 2.3.2 Rule-Based Reasoning Rule-Based Reasoning (RBR) is a method that uses logical rules to infer new information from existing facts. In the context of CDSS, the application of RBR allows the formal representation of medical knowledge, maintaining machine interpretability (Papadopoulos et al., 2022). Rule-based systems are recognized for their agility in dealing with constantly changing circumstances and are commonly referred as the core of Expert Systems. These systems comprise a base of rules, usually organized into sets, and an inference engine that operates based on these rules. The representation of rules follows the IF −THEN form, mathematically A=> B, where Aare the conditions (antecedent) leading to the actions C(consequent) (Velickovski, 2016). A crucial feature is that although rules collaborate as part of the program, they must be stored as data to facilitate maintenance and enable scalability. Thus, rules generally reside in the “production memory” or “rule knowledge base” of a CDSS. The inference engine compares these rules with the “facts” (patient data) in the “working memory” and, when the conditions are met, the rules are triggered, being able to generate new facts, withdraw information, add an alert, or modify an existing state. Several expert systems have already been presented in the literature, some of which are currently in the public domain and widely used, such as CLIPS 1and Drools 2 1https://clipsrules.net 2https://drools.org 19
. Although not specifically designed for medical data, they are widely used in CDSS applications. These tools, highlighted by stability and support from a vast community, support the development of expert systems and CDSSs (Papadopoulos et al., 2022). RBR presents benefits such as modularity, ease of explanation, and similarity with human thinking and the cognitive process. However, it faces challenges when dealing with rule exceptions, lack of information, unexpected values in the data, and some tasks can be very specific to a condition or process, which makes it hard to parameter the actions (Shoaip et al., 2019). 2.3.3 Case-Based Reasoning Case-Based Reasoning (CBR) emerges as an innovative approach to solving computational problems inspired by the human cognitive process. The fundamental premise of CBR lies in the reuse of solutions derived from past cases to address current challenges, providing an efficient and adaptive approach. The benefits of CBR become evident in the continuous improvement of system performance, which becomes more effective by remembering and adapting previous solutions to similar problems. This method optimizes resolution time and contributes to continuous learning over time (Shen et al., 2015). CBR operates through a cycle of four fundamental steps. Firstly, the retrieval of relevant past cases occurs, where case memory stores information about previous diagnoses and treatments. Then, the past solution is adapted to suit the current clinical situation, considering individual patient characteristics. Application of the adapted solution is followed by evaluation of results, forming the basis for continuous updating of the case memory. Finally, the last step is to decide whether the new case will be maintained or not (Verma, 2022). The main challenge in a CBR system is the similarity matching algorithm to extract from the CB the previous cases ’most similar’ to the present one. The CBR method integrates qualitative and quantitative aspects for storing and retrieving cases, resembling problem-solving through comparison with previous indexed cases. Semantic distances from different approaches, such as structural similarity algorithms and statistical learning, are generally used to obtain previous cases. CBR stands out for its intuitive nature, lack of knowledge elicitation to create rules, and continuous learning through use. However, it presents challenges such as considerable storage space required and the large amount of processing time needed to find similar cases. The adaptation of the cases can also be a challenging process (Shoaip et al., 2019). 20
2.3.4 Model-Based Reasoning Model-Based Reasoning (MBR) is a technique that employs computational models to simulate complex realworld systems. These models can be based on theoretical or empirical knowledge, and aim to accurately reproduce the real behavior of the chosen process. In the context of CDSS, MBR is generally used to create simulations to predict and diagnose medical conditions. MBR is particularly effective in situations where a comprehensive understanding of the underlying mechanisms is essential. In the medical field, this involves creating models of physiological processes, disease progression, and treatment outcomes. These models enable CDSS to generate hypotheses, test scenarios, and provide insights that support clinical decision-making. For example, models of cardiovascular dynamics can simulate therapeutic interventions and predict patient outcomes (Shoaip et al., 2019). A notable example of MBR in practice is the use of musculoskeletal models, such as OpenSim 3, to simulate human body dynamics. OpenSim is an open-source tool that allows the construction and analysis of musculoskeletal models of the human body. These models can simulate movements and dynamics in various situations, providing valuable insights for muscle rehabilitation (Delp et al., 2007a). MBR supports continuous learning and adaptation. As new data is collected, the models can be updated to reflect the latest knowledge and trends, ensuring that the CDSS remains updated and effective. This adaptability is crucial in the medical field, where new treatments and discoveries are constantly emerging. However, building and maintaining these models requires high-quality data and can be complex and costly. Model validation is essential to ensure they accurately reflect real patient conditions (Papadopoulos et al., 2022). 2.3.5 Machine Learning-Based Reasoning Machine learning-Based reasoning (MLBR) involves using machine learning algorithms to analyze large data sets and identify patterns useful in decision-making. Unlike traditional methods that rely on explicit programming, MLR uses algorithms that learn from data, identify patterns, and make decisions with less human intervention. MLBR utilizes large datasets to train models that can predict outcomes, classify medical conditions, and suggest treatments based on historical data. This approach is particularly valuable in healthcare, where vast amounts of patient data, including EHR, medical images, and genomic data, can be harnessed to improve clinical decision-making (Sutton et al., 2020). 3https://simtk.org/projects/opensim 21
A significant advantage of MLBR is its ability to manage complex and non-linear relationships within the data. Machine learning models, such as neural networks (NN) and support vector machines (SVM), are proficient at capturing these intricate patterns, which might be challenging for traditional statistical methods. For example, deep learning algorithms have shown remarkable results in image recognition tasks, such as detecting abnormalities in radiographs and Magnetic Resonance Imaging (RMI) (Wasylewicz and Scheepers-Hoeks, 2019). An exemplary case is Enlitic 4, a company that develops CDSS specifically designed to analyze medical images like X-rays and MRI. Their AI-driven solutions assist radiologists by accurately detecting anomalies, thus speeding up diagnostic processes and enhancing clinical outcomes. This approach also supports personalized medicine by considering individual patient characteristics and tailoring recommendations accordingly. This personalized approach enhances treatment efficacy and reduces the risk of adverse effects. However, obtaining and managing the extensive and diverse data required for effective MLBR poses a significant challenge (Papadopoulos et al., 2022). 4https://enlitic.com 22
Chapter 3 State of the Art To understand the state of the art on CDSS for muscular rehabilitation of the lower limbs with electrical stimulation, an approach was adopted that integrates bibliometric analysis and systematic literature review. The bibliometric analysis offers an overview of research trends over time, while the systematic review focuses on providing a detailed assessment of the most recent and relevant studies in the field. 3.1 Methodology The methodology used to develop the state of the art can be divided into two main stages. Initially, an iterative search process was carried out to identify keywords that should be included and excluded from the search query. At this stage, the R Studio tool and the Bibliometrix library (Aria and Cuccurullo, 2017) were used to analyze the meta information of the articles. In the second stage, it was applied the methodology developed by Kitchenham and Charters (2007) to create a Systematic Literature Review considering publications from the last 5 years, that is, from the beginning of 2019 to the end of 2023. 3.1.1 Keywords Identification The proper identification of keywords is a crucial step in conducting a literature review, especially when dealing with a multidisciplinary subject such as the development of CDSS for muscular rehabilitation of the lower limbs with electrical stimulation. Nowadays online literary databases provide a set of tools that help create advanced searches, such as the use of Boolean logic and field restriction, but for some subjects it still common to find a huge number of studies unrelated to the main topic. In our case, the high number of unrelated studies is mainly due to two factors. The first factor is related to the vast literature available on muscular rehabilitation treatments without mentioning the use of any system. The second factor is linked to the high applicability of electrical stimulation in the human body, not restricted only to the lower limbs. Furthermore, the term electrical stimulation can also be found 23
Figure 11: Top 10 bigram terms over time. The analysis of the bigrams presented in Figure 11 revealed interesting patterns in the evolution of the most frequent terms over time. The term “control system” emerges as the main and most consistent term over the years, with the first publications dating back to the early 1980s and a continuous presence until the present day. This suggests that researchers have consistently sought to control movement since the beginning of investigations. Secondly, “muscle fatigue” stands out, especially from 2010 onwards, indicating a growing interest in this complex topic. This rise suggests an evolution in researchers’ understanding over time, expanding the scope of investigations to consider not only movement control but also the effects of muscle fatigue in this context. This shift in focus is supported by the evolution of the term “muscle model”, which follows a similar but less intense trend. The third most used term, “neural network”, demonstrates a constant rise over the years, with periods of stagnation interspersed. This pattern suggests computational challenges that may limit the effective use of neural networks at certain times, highlighting the need for continued development in this area. Other notable terms include “FES Cycling” and “ELECTRIC MOTOR”, which show a similar increase in frequency and are correlated. This indicates that research on muscular rehabilitation with electrical stimulation, using bicycles and exoskeletons, began to gain prominence in 2015 and continues to be one of the main research topics today. Continuing with the analysis of the bigrams extracted from the abstracts, a Co-occurrence network 30
graph was generated. This graph was constructed based on the terms that co-occurred most frequently in the abstracts, revealing the relationships between the terms and identifying significant thematic groupings. The Louvain algorithm was applied to identify clusters, with the number of nodes set to 100 to ensure a comprehensive analysis. This algorithm utilizes a hierarchical clustering method that recursively combines communities into a single node and performs modularity clustering on condensed graphs. The goal is to maximize a modularity score for each community. Modularity quantifies the quality of the assignment of nodes to communities. It assesses how densely connected the nodes are within a community compared to how connected they would be in a random network. This results in groups of terms that co-occur more frequently and are more strongly interconnected, with no overlap Lu et al. (2015). Figure 12: Co-occurrence Network of bigram terms. Five distinct clusters were identified, as illustrated in Figure 12, each representing a specific branch of study applied to systems with electrical stimulation for lower limbs rehabilitation. The central theme of each cluster was determined empirically based on the related terms included in the cluster. •System Development: This cluster is centered around terms related to the development of control and stimulus systems. Includes words such as “control system”, “stimulation parameters”, “closed loop”, “stimulation patterns”, “motor control”, “power consumption”. This suggests a focus on creating and improving systems for controlling and administering electrical stimulation. 31
•Control Method: Set related to strategies and control methods to parameterize electrical stimulation given a certain objective. It includes terms such as “control strategy”, “control scheme”, “adaptive control”, “control law”, “sliding mode” and “tracking performance”. This indicates a concern with the development of adaptive and robust control techniques to optimize the effectiveness of electrical stimulation. •Artificial Intelligence: This cluster focuses on the use of artificial intelligence in research related to muscle rehabilitation with electrical stimulation. It includes terms such as “neural network”, “machine learning”, “artificial neural”, “musculoskeletal model”, and “clinical application”. This suggests a growing trend of using machine learning algorithms and advanced computational models to improve muscle rehabilitation approaches. •Biofeedback: This group is related to the physiological response and monitoring of biological signals during the muscular rehabilitation process. Relevant terms include “muscle fatigue,” “muscle contraction,” “muscle model,” “signal processing,” “real time,” “muscle activity,” and “EMG signal.” These terms reflect the interest in understanding muscle fatigue and muscle activity during treatment. •FES Cycling: This cluster focuses on research exploring the use of electrical stimulation using bicycles and exoskeletons. Includes terms such as “fes cycling”, “electric motor”, “tracking error”, “stability analysis”, “cadence tracking”, “desired cadence”, “cycling system” and “hybrid system”. This cluster collaborates with the idea that this topic is increasingly on the agenda and can bring relevant benefits to muscular rehabilitation. Analyzing bigram terms and identifying clusters provides information about the main topics surrounding this Ph.D. research topic and how they relate to each other. The clusters highlight different aspects of research, from the development of control systems and their methods to the application of artificial intelligence and the use of biofeedback. The intersection between these clusters suggests promising opportunities for interdisciplinary research and the integration of innovative approaches. Finally, this bibliometric analysis provides a comprehensive overview of the leading research trends in CDSS for lower limb muscle rehabilitation through electrical stimulation. This detailed understanding of trends over time can guide future investigations and contribute to the continuous advancement of the area, allowing the identification of knowledge gaps and opportunities for innovation. 32
3.3 Systematic Literature Review This section presents an analysis of the 29 selected articles, following the previously described systematic review methodology (see Figure 9), covering the period from 2019 to 2023 inclusive. As said above, the search was to find articles describing decision support systems developed to assist physicians in electrostimulation treatment. However, none of the analyzed articles actually presented a decision support system. Instead, all selected articles describe electrostimulation control systems for lower limb rehabilitation, without the effective participation of the physician during treatment or monitoring of the patient’s clinical progress throughout the sessions. The selected articles mainly address three main themes: 17 focused on FES Cycling, 8 on Exoskeleton and 4 on Knee Control. Regarding the type of publication, 8 are from conferences and 21 are journal articles. The corresponding authors come from various countries, with the United States leading with 12 articles, followed by Brazil with 3. Italy, France, Iran and China contributed 2 articles each, while Japan, Turkey, Malaysia, Serbia, Germany and the United Kingdom contributed with 1 article each. This detailed information is available in Table 6, along with the references and authors of the articles. ID Author (Year) Aim Country Type A1 Watanabe and Tadano (2019) FES Cycling Japan Conference A2 Obuz et al. (2019) Exoskeleton Turkey Journal A3 Estay et al. (2019) FES Cycling USA Conference A4 Ghanbari et al. (2019) FES Cycling USA Journal A5 Rahim et al. (2019) Exoskeleton Malaysia Conference A6 Cerone et al. (2019) FES Cycling Italy Conference A7 Sijobert et al. (2019) FES Cycling France Journal A8 Duenas et al. (2020) FES Cycling USA Journal A9 Bao et al. (2020) Exoskeleton USA Journal A10 Teodoro et al. (2020) FES Cycling Brazil Journal A11 Ricarte et al. (2020) FES Cycling Brazil Conference A12 Zhang et al. (2020b) Knee Control China Journal 33
A13 Zhang et al. (2020a) Knee Control China Conference A14 Arcolezi et al. (2021) Knee Control France Journal A15 Isaly et al. (2021) FES Cycling USA Journal A16 Cousin et al. (2021) FES Cycling USA Journal A17 Aldrich and Cousin (2021) FES Cycling USA Journal A18 Molazadeh et al. (2021) Exoskeleton USA Journal A19 Rouse et al. (2021) FES Cycling USA Journal A20 Allen et al. (2022) FES Cycling USA Journal A21 Chang et al. (2022) Exoskeleton USA Journal A22 Nekoukar (2021) Knee Control Iran Journal A23 Jafari and Erfanian (2022) FES Cycling Iran Journal A24 Coelho-Magalhães et al. (2022) FES Cycling Brazil Journal A25 Popović-Maneski and Mateo (2022) FES Cycling Serbia Journal A26 Lyu et al. (2023) Exoskeleton Germany Journal A27 Wannawas and Faisal (2023) FES Cycling England Conference A28 Sun et al. (2023) Exoskeleton USA Journal A29 Ferrari et al. (2023) Exoskeleton Italy Conference Table 6: Identification of Selected Articles. FES-Cycling FES-Cycling is a therapeutic approach that combines the use of stationary bicycles with electrical stimulation of the muscles of the lower limbs. Generally, the quadriceps, hamstrings and gluteal muscle groups are stimulated in a coordinated sequence to generate a positive crank cycle. This method presents improvements in the cardiorespiratory, neuromuscular and skeletal system, such as increased muscle mass, improved blood circulation and reduced bone loss. However, these improvements may be mitigated due to the possibility of accelerated fatigue or physical exhaustion (van der Scheer et al., 2021). Generally, bicycles or tricycles have a motor that also assists the movement, allowing patients with 34
little or no capacity for voluntary movement in their legs to perform the exercise. This practice is carried out indoors, generally in a stationary system with a focus on rehabilitation, however, it is currently possible to find competitions that use this system and demonstrate new technologies, such as the Bike Race - Cybathlon 1. The main challenge of FES-Cycling is to coordinate electrical stimulation with the bicycle motor to maintain an effective and comfortable cadence for the patient without excessive fatigue. This synchronization is often done through complex mathematical models and the use of sensors to monitor cadence and adjust the electrical stimulus and motor accordingly. In the United States, the group led by researcher Warren Dixon was responsible for all 8 publications on FES-Cycling that were selected for this systematic review. The work of this group has contributed significantly to the advancement of knowledge about FES-Cycling and its potential in lower limb rehabilitation. Exoskeleton Exoskeletons represent an important innovation in the area of rehabilitation, designed to help people with motor disabilities regain mobility and independence. These devices consist of external mechanical structures equipped with motors, sensors and control systems, designed to be worn around the joints of the human body, providing support and assistance during movement. Its main objective is to offer additional help to people with physical disabilities, such as spinal cord injuries, strokes or musculoskeletal disorders (Anaya et al., 2018). The selected studies address an exoskeleton model that incorporates the application of electrical stimulation to muscles to aid movement. This technique, also known as hybrid exoskeletons or FES exoskeletons, aims to provide a more effective, safe and robust rehabilitation therapy. It compensates for the lack of strength in muscles stimulated with the motor to produce movement, similar to FES-cycling. Hybrid exoskeletons for lower limb rehabilitation generally have motors in the hip and knee joints, focusing on movements such as lifting the leg while sitting in a chair, getting up from a chair or walking. However, as in the case of FES-cycling, the biggest challenge is coordinating the stimulator and the motors together to produce the necessary movement, without causing excessive fatigue or discomfort to the patient. For more complex movements, such as walking, the challenge can be even greater, requiring a more sophisticated control system. 1https://cybathlon.ethz.ch/en/event/disciplines/fes 35
Knee Control Knee controllers represent a simpler approach compared to other rehabilitation technologies such as FES Cycling and exoskeletons. In this approach, no motors are used, only FES stimulation is used to control the knee joint. Generally, electrical stimulation is applied only to the quadriceps, aiming at the movement of lifting the leg. Thus, the system needs to calculate the stimulation parameters to perform the movement, aiming to increase the range of movement or sustain repetitions without excessive fatigue. In addition to offering a more traditional rehabilitation solution, knee control can be seen as a proof of concept for other applications, such as exoskeletons. This simplified approach allows the implementation of new technologies in a basic version, which can then be scaled to more advanced applications. An example is the addition of electromyography sensors to monitor muscle fatigue in real-time. 3.3.1 RQ_01: What are the main characteristics of the system architecture? Most of the reviewed studies do not provide a precise description of the adopted system architecture, mentioning multiple devices and systems without clearly explaining their interactions. Instead, they typically mention a series of devices connected by cables to a computer, where processing is performed primarily in MATLAB/Simulink or in-house developed software, with few additional details. These devices range from encoders to measure bicycle cadence, power meters and acquisition boards, especially in studies related to FES-cycling. Furthermore, it is notable that the most commonly used stimulation machine was the Hasomed RehaStim. However, three studies stand out for proposing systems that are not limited to cable connectivity and present a more unified approach. Study A6 proposes a modular systems architecture composed of two sets of wireless modules. One module is responsible for signal acquisition, while the other represents a stimulator machine. These modules communicate via WiFi to a multiplatform software developed with the Qt framework in C++. While this approach allows flexibility as the modules can be apply to multiple regions, it also brings with it significant technological challenges for the control system. Study A11 describes a modular architecture based on the Robot Operating System (ROS), representing a more structured approach compared to other studies. The modular part of the architecture allows the acquisition of signals and the use of different types of sensors. In the case analyzed, it was implemented with an IMU motion sensor. The rest of the architecture consists of a portable computer and a stimulator, 36
both connected by cables. Study A24 deserves attention as it provides a more detailed description of its system architecture. Using an electronic board, this study establishes communication with an Android mobile application via Bluetooth. However, it remains unclear how the data is subsequently transferred for offline processing. Additionally, the study incorporates a power meter that transmits data via Bluetooth to a computer, but without details about its complete integration into the overall system. In summary, while most studies do not provide a detailed description of the system architectures used, there is a trend towards wired connectivity to a computer for data processing, with some mention of wireless communication for data transmission. Moreover, the lack of details on how colleted data is stored offline and integrated into the global system remains a common gap in the studies reviewed. 3.3.2 RQ_02: What data is used and how is it acquired? A diverse set of sensors and tools were used in the selected articles to collect crucial data for controlling electrostimulation. In some cases additional data for validation were also collected that were not used in the control. Table 7 seeks to summarize the information found. ID Data Used Acquisition Tools A1 Crank angle (EMG data were used to defined stimulation patterns in previously study) 2 IMUs sensors A2 Knee angle Encoder A3 Crank angle, velocity and acceleration and power Encoder and power meter A4 Crank angle, velocity and acceleration and power Encoder and power meter A5 Knee angle (for validation only) Cameras A6 Knee angle Electronic goniometer A7 Thigh angle 2 IMU sensors A8 Crank angle, velocity and acceleration and power Encoder and power meter A9 Knee angle Encoder A10 Crank angle, velocity and acceleration Electronic goniometer and IMU sensor A11 Crank angle 1 IMU sensor 37
A12 Knee angle Electronic goniometer A13 Ankle and knee angle and rectus femoris EMG Angle sensor and myoeletronic sensor A14 Knee angle Electronic goniometer and IMU sensor A15 Crank angle, velocity and acceleration and power Encoder and power meter A16 Crank angle, velocity and acceleration and power Encoder and power meter A17 Crank angle, velocity and acceleration and power Encoder and power meter A18 Knee and hip angle 2 Encoders A19 Crank angle, velocity and acceleration and power Encoder and power meter A20 Crank angle, velocity and acceleration and power Encoder and power meter A21 Knee and hip angle, leg force and angular displacement 2 Encoders, force sensor and treadmill A22 Knee angle 2 IMUs sensors A23 Crank angle Encoder A24 Crank angle, velocity and acceleration and power Encoder and power meter A25 Crank angle Encoder A26 Body motion capture, motor torque Torque sensor and cameras A27 Crank angle Encoder A28 Knee angle, force, motor torque Encoder, dynamometer and torque sensor A29 Motor torque, knee angle, rectus femoris EMG Encoder and EMG sensor Table 7: Data and Acquisition Tools Used in the Selected Studies. As can be seen from Table 7, most studies rely on joint angles to guide electrostimulation control, with the knee joint being the most common among them, although the thigh, ankle, and hip angles were also found to be used. For FES-Cycling studies, except for articles A6 and A7, all studies use crank angle. It can also be observed that all studies were using some type of joint angle. Given that the majority of studies focus on FES-Cycling and employ crank angle, the most common acquisition tool is the encoder, which also measures bike speed and acceleration. Second, it is noticeable 38
that IMU sensors are increasingly gaining space in this research area, as well as electronic goniometers, which can be seen as prototypes of IMUs in this use case. This is due to the fact that many of these IMU sensors, despite having accelerometers and gyroscopes inside, are used to convert their data into angles, a function fulfilled with precision by electronic goniometers. Finally, EMG sensors were also seen, which are important for assessing muscle activity and are related to fatigue. However, only 2 articles use this data, both collecting from the rectus femoris muscle. 3.3.3 RQ_03: How is sensitive data protected? None of the selected studies addressed or at least commented on data storage or sensitive data protection, revealing a significant and critical gap in the field of research. Even the articles that mention the use of offline data for training machine learning algorithms do not discuss details on how this data is stored or made available, leaving an important question unanswered. This lack of attention to data security highlights the immaturity of systems focused on stimulation control in terms of infrastructure and system architecture. It also suggests a lack of interoperability between these systems and a very low commercial availability. These issues are crucial not only for academic research but also for the practical implementation of these technologies in clinical environments. 3.3.4 RQ_04: What are the reasoning methods used in these systems? As previously mentioned, the selected studies do not explicitly describe a decision support system but rather control systems for stimulation. However, each system incorporates a type of reasoning method to adjust stimulation parameters, although these methods are not explicitly described using these terms. Figure 13 presents a chart quantifying the reasoning methods found. The majority of the selected articles utilize the model-based method as their reasoning method, employing mathematical models to simulate scenario behavior and determine the necessary stimulation parameters to maintain movement as planned. This method is typically applied in a closed-loop control system, where encoder and power meter data are used to feed the model. Six studies employed the rule-based reasoning method to control stimulation. This method is simpler than others, typically activating and deactivating stimulation based on a variable or set of variables. A simple example is controlling the timing of muscle stimulation activation and deactivation based on predefined crank angles in FES-cycling. The remaining six studies utilized machine learning algorithms to control stimulation. Some studies used these algorithms only to activate and deactivate stimulation, without controlling parameters such 39
performed, ensuring the device is optimized for the treatment environment. The mobile app will guide the patient through a user-friendly interface, offering instructions and session progress information. The application will replicate the stimulation mode performed in the clinic and will also allow dynamic adjustments during the session. If the system detects changes in muscle fatigue metrics that exceed the limits established by the doctor, the app will automatically adjust the treatment. At the end of the session, the patient will complete a brief questionnaire about the experience and their physical condition. All collected data, including sensor information, stimulation parameters, and questionnaire responses, will be uploaded to the cloud. The physician is immediately notified that the session has been completed. This approach allows the physician to access biofeedback data online, enabling he or she to assess the patient’s response to treatment and create a detailed evaluation report. If necessary, the physician can modify the session settings and schedule a new session for the patient. This continuous treatment cycle repeats until the rehabilitation process is fully completed. 4.1.2 System Architecture The proposed system architecture for muscular rehabilitation treatments using electrical stimulation was designed to incorporate the technological advances of health 4.0. This includes the use of microservices, cloud computing, internet of things, mobile applications, among others. This approach aims to offer a comprehensive and effective solution, capable of meeting the requirements described in the treatment scenarios. A detailed overview of systems that inspired this design and the initial implementation is provided in the article (Franco et al., 2022b). It is important to emphasize that the information to be stored is highly confidential. In addition to personal information, such as the names and addresses of system users, health-related data such as active diseases, clinical observations, and more will also be managed and processed. To ensure the security of this sensitive data, a strategy has been developed to adhere to best practices for data protection, segmenting stored data and mitigating potential cyberattacks. The proposed system is based on a three-layer architecture, using the smartphone as an intermediary device. Despite this, we split the interior of the secure cloud layer into two layers, making it possible to consider this architecture as four layers. This division guarantees that only the components that need external communication are available with public IP. Components that need to be more secure, such as databases and the logging service, are separated and only available on the private network. The system architecture shown in Figure 16 has seven main components. The characteristics and functions of each 46
component are as follows: Figure 16: System Architecture. Wearable Device: Component that includes a system, sensors for biofeedback data acquisition and the electrical stimulator. This component is the actuator device that perform the remote rehabilitation and communicate with mobile app. Mobile Application: Intermediate application between the wearable device and the cloud. Its main functions will be: receive the stimulation protocol from the cloud and providing it to the wearable device; organize the data received by the treatment session and send it to the cloud; provide and collect the patient information. System Panel: Administrative panel for professionals to manage patients and treatments. On this website, the physician will be able to visualize and adapt the treatment plan. In addition, it will be possible to view the biofeedback acquired by the wearable device and respond to messages from patients. Clinical Service: Service that stores and processes the clinical data of patients. This information are: patient characteristics and medical history, clinical reports and biofeedback collected by wearable device during sessions. Management API: A module capable of managing and providing the necessary resources for the operation of the mobile app and the administrative panel. For example, managing patients, professionals, messages, equipment, and others. Single Sign-On (SSO): Component responsible for generating the access and refresh tokens. The 47
purpose of SSO is to provide a single point of authentication within the architecture, thus ensuring that access of the multiple services is secure and transparent. Log Service: Component required to maintain log integrity across the entire architecture. The intent is that all components provide logs periodically for this service, creating a unique auditable and secure access point. The communication between the components is varied, depending on their purpose within the architecture. To optimize battery life, the wearable device communicates with the mobile app via Bluetooth Low Energy. Meanwhile, interactions between the secure cloud, the mobile app, and the system panel adhere to the HTTP protocol with Secure Sockets Layer (SSL) certificate and JSON Web Token (JWT). The Clinical Service, SSO, and Management API systems communicate with the Log Service also using HTTP with SSL, but with public and private key authentication. 4.1.3 Sensitive Data Protection The architecture is based on micro services. This approach enables data to be split and stored in different parts according to the operational needs of each service. Thus, the patients’ personal data, such as addresses, phone numbers, responsible doctor, among others, are stored under the Management API. The clinical data, such as treatment plans, recommended treatments, disease history, diagnoses, among others, are stored in the Clinical Service. To maintain data privacy, the identifiers of each entity must be different in each database. This ensures that if both database systems are hacked, the attacker would not be able to link which diagnosis belongs to which patient, minimizing the impact. To maintain the data relationships between the systems, the pseudonymization technique was applied. This technique allows the identity of subjects to be hidden from any outsourced services by assigning pseudo-identifiers. Thus, the third-party services are not able to relate the pseudonyms to the real identifications, so they do not recognize the author of the data provided. If a client application needs to recognize the identity of the data, a grant of access is requested. If the request is accepted, the triggered services return the data that can be queried by the client app that requested it (as can be seen in Figure 17). 48
Figure 17: Representation of pseudonymization technique. To ensure the integrity of requests JSON Web Signature (JWS) was used during communication. Each service was configured with asymmetric keys and has access to public keys of other services. In this way, the data in a message is signed by a sending service using its private key, so other services can verify the information using the public key of the sending service. Figure 18 represents a simplified process of signing and checking content using asymmetric keys. Figure 18: Signature and content verification process using asymmetric keys. Using signed messages prevent repudiation of services. The public key can be used to reveal the real sender of a message, and modifications during transmission (integrity). All micro services have a specific key, and the check process only works with the correct public key. The trust of information is established when the generator of a message is recognized as an internal service. The relationship of the Clinical Service and the Management API can be understood as outsourced services to each other. Thus, when a mobile app wants to access either of the two services, it must send in the header of each request the access token provided by SSO service. Inside this token, three main pieces of information will be stored, the role the user belongs to, and two encrypted packets. The first packet is encrypted by the public key of the Clinical Service with the pseudo-anonymized identifier for the Clinical Service. The second packet follows the same logic but encrypted and pseudo anonymized for the Management API. When a request is made, each service can open the packet with its private keys and search in their data 49
for information that correlates with the sent identifiers. This ensures that the only ones who could discover the relationship between the two databases are the owners of the information, that is, the ones who should really have access. In his Master’s work, developed in conjunction with this doctoral project, (Silva, 2021) has explored the information security and scalability approaches to be used in this architecture. 4.1.4 Database Modeling To maximize the efficiency of each module of the system architecture, different Database Management Systems (DBMS) were employed. Taking into account the distinct characteristics of the stored data, Postgres1(SQL) was chosen for the Management API database and the Single Sign-On (SSO) service, while MongoDB 2(NoSQL) was selected for the Clinical Service database. To ensure system interoperability, a set of elements was adapted by adding attributes and modifying nomenclature to facilitate the exchange of information with systems that follow the HL7 FHIR3health data exchange standard. HL7 FHIR (Fast Healthcare Interoperability Resources) is a crucial standard that promotes efficient clinical data integration between different systems, modernizing healthcare processes. Figure 19: Entity-Relationship (ER) Model of the Management API Database. 1https://postgresql.org 2https://mongodb.com 3https://fhir.org 50
Figure 19 illustrates the entity-relationship model used to design the necessary data structure for the Management API. This database was set up to handle personal data, including information on practitioners, patients, appointments, and rental devices. The Entity People was created to aggregate related attributes, serving as the primary entity in the hierarchy. Each record in the Entity People must have an SSO_ID to link the user to the SSO service and may have multiple addresses and contacts. Entity Appointment store the status, start time, and end time, and can include information about the location. However, they do not store data related to the pathology being treated. Although it has not yet been implemented, the system is also designed to support the borrowing of wearable devices, with the expectation that these devices may come in different versions. The NoSQL data model required for the functioning of the clinical service is depicted in Figure 20. This model stores data related to patient health and applied treatments. Since MongoDB supports embedded documents, the database consists in only four main collections: Conditions, Observations, Care-Plans and Sessions. The another “collections” that appear in Figure 20 are embedded documents of the four main collections mentioned above. The collection Conditions pertains to specific illnesses and their initial stages. The collection Observations stores updated information on the patient’s condition, with a new observation document generated for each appointment. The collection Sessions collection, the most complex in the data model, is responsible for storing stimulation parameters, biofeedback data, and calibration data, among other information. Additionally, there is a contractions document that records metrics related to muscle fatigue during treatment sessions, which are calculated by the mobile app. All raw sensor data is stored compressed in binary form. For home-based treatment sessions, a care-plan document needs to be generated, specifying the start date and objectives. In the data model, home sessions extend the standard clinic sessions by incorporating additional information and features giving rise to the Care-Plans collection. The design includes an intelligent rules system that adapts sessions in real-time. The automatic session settings document stores triggers for stimulation adjustments proposed by the physician, ensuring personalized and responsive treatment. This approach ensures that the system can handle with the complexity and sensitivity of patients’ health data, offering a secure, efficient, and scalable data model for muscle rehabilitation treatments. The final database model was repeatedly refactored throughout the development process to incorporate new technologies. 51
Figure 20: NoSQL data model for the clinical service. 52
4.2 Prototyping 4.2.1 Cloud Infrastructure The cloud infrastructure developed distributed the components of the system architecture across seven virtual machines (VMs) based on Ubuntu Server 20, hosted within the Research Centre in Digitalization and Intelligent Robotics (CeDRI) cluster at the Instituto Politécnico de Bragança (IPB) building. Out of the seven VMs, only three have IPs on the public network, each dedicated to a different module of the system being Clinical Service, Management API, and SSO. The Clinical Service and Management API were developed from scratch using Python4programming language and Flask5framework, recognized for its flexibility and ease of implementation. Both services were designed following the Model-View-Controller (MVC) design pattern (Trygve, 2003), ensuring clear separation of concerns for enhanced maintainability and scalability. Furthermore, the service endpoints were documented using Swagger6, a tool that offers interactive and dynamic documentation of APIs, simplifying understanding and used by developers for standardizing inputs and outputs. For providing the SSO service, the open-source solution Keycloak7was adopted. Installed via Docker8, this choice offers a user-friendly interface for implementing secure and complex authentication strategies, such as two-factor authentication and OAuth v29. The remaining four VMs were allocated in an internal network, allowing access only to the three services with public IPs. Thus, one VM was for the MongoDB database, and two were for the Postgres database to supply Management API and SSO. The last VM is destined to Logs service and its database were installed on the same VM, as this module does not require a public IP. This configuration aims to enhance the security of access for each component of the infrastructure. 4.2.2 Wearable Device Supported by the Portugal 2020 program and international partnerships, the NanoStim project10 united a consortium focused on advancing remote rehabilitation. The team included six Portuguese organizations: Instituto Politécnico de Bragança, Universidade do Minho, NATG, INOVA+, Impetus, and TeandM, and the 4https://www.python.org 5https://flask.palletsprojects.com 6https://swagger.io 7https://www.keycloak.org 8https://docker.com 9https://oauth.net/2 10 https://nanostim.pt 53
University of Texas, USA. In this document, the term wearable device refers primarily to the hardware component developed during the NanoStim project. The term wearable system is used to refer to the system running inside the wearable device that is part of the proposed system architecture. Figure 21 illustrates the design of the wearable device, which integrates essential components chosen for their low cost and ability to provide effective muscle rehabilitation treatment. Figure 21: Wearable Device Design. The primary component is the low-cost microcontroller, a small computer on a single chip that integrates a processor, memory, and peripherals. This microcontroller manages all the sensors and communicates with the mobile application. The ESP32 microcontroller, specifically the WROOM-32E11 version, known for its versatility, cost-effectiveness, and built-in Wi-Fi and Bluetooth features, was utilized. The ESP32 is ideal for wearable devices and IoT applications due to its low power consumption, support for multiple communication interfaces, and efficient processing capabilities, such as Bluetooth Low Energy v4.212. Its key specifications include a dual-core 32-bit Tensilica Xtensa LX6 CPU operating at up to 240 MHz, 448 KB of SRAM, 520 KB of ROM, and peripheral interfaces with a 12-bit ADC. The wearable device includes two types of sensors: Electromyography (EMG) sensors and Inertial Measurement Unit (IMU) sensors. The EMG sensor measures the electrical activity of muscles through electrodes positioned on the skin. The measured electrical activity is returned as an analog signal with a frequency band of interest between 0 and 500 Hz, which is then converted to digital by the microcontroller. The signal conditioning circuit, essential for processing EMG signals, was developed from scratch and more 11 https://www.espressif.com/en/products/socs/esp32 12 https://www.bluetooth.com/specifications/specs/core-specification-amended-4-2 54
details can be found in article (Sestrem. et al., 2022). IMU sensors measure acceleration and rotation across multiple axes, typically consisting of a 3-axis accelerometer and a 3-axis gyroscope, known as a 6-axis IMU. The accelerometer measures linear acceleration, while the gyroscope measures angular velocity. In the field of rehabilitation, this data is generally used to monitor movements and orientations in three-dimensional space. The MPU-605013 IMU sensor was chosen for its reliability and efficiency in I2C communication14. An essential component in the proposed application is the electrical stimulation circuit, which generates electrical impulses to stimulate nerves controlling the muscles, promoting contractions and movements. This component is the actuator for restoring or improving muscle function in patients with injuries or diseases in our context. The stimulation circuit was also developed from scratch and a Master’s thesis (Gonçalves, 2023) was developed testing various low-cost components to replicate the electrical stimulation of commercial devices. All mentioned components are integrated into a Printed Circuit Board (PCB), as illustrated in Figure 22. The PCB is enclosed within a 3D-printed case with dimensions of 10 cm (length) × 12.5 cm (width) × 3.5 cm (height), excluding the USB cable. This case also houses the system’s battery, which provides an operational life of approximately 6 hours per charge. The portable design allows the wearable device to be conveniently charged via USB and easily used in various environments. Additionally, the total cost of production for each unit remains below 100 euros, making it a cost-effective solution. Figure 22: Wearable Device Components in PCB. 13 https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf 14 https://docs.arduino.cc/learn/communication/wire 55
such as research institutions, clinics and hospitals. The main features available to the administrator are: 1. Manage Organizations: The administrator can create, edit and delete organizations. To register an organization it is necessary to provide the address and contact details of someone responsible for the institution. 2. Manage Physicians: The administrator can add, edit, and remove physicians by associating them with specific organizations. The physician’s registration includes credentials, qualifications, contact and address. Physician: The physician is responsible for managing patients, appointments and care plans. The functionalities available to the physician includes managing: 1. Patients: Register and maintain patient information, including personal data, credentials, contact and address. 2. Appointments: Schedule, edit, and cancel appointments, allowing efficient management of the appointment calendar. 2.1 Observations: Add observations and notes to appointments, recording important information about the patient’s condition and treatment progress. 3. Medical Records: Maintain patients’ medical records, including: 3.1 Pathologies: Record and update patient pathologies, documenting relevant medical conditions. 3.2 Treatment Plans: Define and monitor treatment plans, specifying therapeutic goals and methods to be used. 3.3 Treatment Sessions: Record and track sessions performed, including viewing biofeedback data recorded by the wearable system, recording an automatic treatment session and simulating fatigue levels based on a previously performed session. The Use Case diagram in Figure 24 describes in detail the interactions of the actors, enhancing the actions each role can perform. Before accessing these functionalities, users must first log in using a SSO system with OAuth 2.0 authentication, ensuring secure access to the system. The development of the web-based administrative panel enhances user convenience, allowing access to the system at any time and from any location. This approach provides flexibility and facilitates the 62
efficient and accessible management of treatments and clinical research. Additionally, the management of sessions enables detailed analysis of the biofeedback data collected by the wearable system, as well as the applied stimulation parameters, offering valuable insights for monitoring and optimizing treatments. Figure 24: Use Case Diagram for System Panel. 63
Chapter 5 Intelligent Features for Treatment Customization In this chapter, five essential features are presented that form the foundation of a CDSS designed to make muscle rehabilitation treatments more responsive to biofeedback data collected from patients during electrostimulation sessions. These features not only enhance the informatization of the treatment but also significantly improve response time, making the system more intelligent and adaptable compared to traditional rehabilitation treatments using conventional actuators. The five features can be divided into three main categories. The first category encompasses movement recognition and fatigue parameterization, describing the methods used to transform raw data into valuable information about the physiological state of the muscle under treatment. The second category focuses on the implemented electrostimulation treatment modes and how they can be adapted based on biofeedback. Finally, the last section outlines the utilities developed to enhance the healthcare professional’s experience when using the CDSS. 5.1 Movement Recognition Understanding the movements performed by the patient during treatment sessions is crucial for optimizing rehabilitation protocols. Initially, the NanoStim project planned to use a single EMG sensor to extract the parameters related to muscle state and effort. However, this approach may be limited, as with just the EMG signal, it would be challenging to differentiate the amplitude of movements, making it difficult to assess the effectiveness of the treatment over time. To address this limitation, a research was conducted to identify the most suitable sensors and data processing methods needed to accurately capture leg movements during treatment. A literature review on biomechanical approaches for classifying knee osteoarthritis Franco et al. (2021) highlighted the extensive use of IMU sensors. These sensors are often used to measure the angle of the knee joint through two IMU sensors, one attached to the thigh and the other to the shin. 64
Guided by these findings, the decision was made to integrate two IMU sensors into the wearable system to monitor the knee joint angle in real time. Therefore, this session describes how raw data extracted from IMU sensors is used to recognize and classify movements performed during rehabilitation treatment. 5.1.1 Mathematical Model The mathematical model used to compute knee angle of the subject is based on the theory of multibody system dynamics, as presented by (Olinski et al., 2017). In this approach, the orientation of a body in space is given by the orientation of a local frame attached to the body with respect to a reference coordinate system as illustrated in Figure 25. Figure 25: IMU sensor with the reference coordinate system. Considering the particular case in which the orientation changes occur in a specific plane, as presented in Figure 26a, the mapping of frames with respect to a reference frame can be represented by a single rotation from a reference to another (Figure 26b). Figure 26: (a) Frame representation relative to a reference. (b) Linear mapping of a frame to another. 65
To map a frame worth in respect to another in the case of rotations in the YZ-plane of an angle Φj around the x-axis, as presented in Figure 26, the Euler angles are determined by applying the linear mapping successively from rotation matrices (RΦ1 and RΦ2) in each of these spaces. The rotation matrix is given by Equation (5.1), where j= 1 or j= 2: Rj= 1 0 0 0cos(Φj)−sen(Φj) 0sen(Φj)cos(Φj). (5.1) Considering the sagittal plane as the plane of reference for the movements, once the abduction/adduction angles are neglected (Figure 27), the orientation of the leg’s frame and the thigh’s frame, both concerning the inertial coordinate system, are represented as rotations in the referred plane. When the monitored movement occurs in the sagittal plane, the knee angle is given by the difference between the thigh and leg angles Φknee = Φ2−Φ1. Figure 27: Sensors with the angles representation. Adapted from (Olinski et al., 2017). IMU data is measured relative to the inertial coordinate system. By attaching an IMU to both the thigh and the shin, their respective orientations can be determined in relation to the inertial system. The difference in these orientations provides the knee angle. This method allows for accurate and continuous monitoring of knee movements, ensuring precise data for rehabilitation purposes. 66
5.1.2 Knee Extension Exercise The knee extension exercise is fundamental in muscle rehabilitation, especially for the quadriceps muscle group. This exercise involves extending the knee joint and activating the quadriceps femoris, the largest muscle group in the thigh. Strengthening the quadriceps is essential for maintaining knee joint stability and promoting proper gait patterns (McGinty et al., 2000). To perform the knee extension exercise, the patient sits in a chair or on a knee extension machine with knees bent at a 90-degree angle and feet flat on the floor or footrests. The exercise begins by extending the knees and raising the legs until they are parallel to the floor or fully extended. The movement is completed when the patient’s leg returns to the starting position. Figure 28 illustrates the data collected by the biofeedback system during a knee extension exercise. Figure 28: Data collected during knee extension exercise. The knee angle illustrated in Figure 28 passes through several parabolas with the concavity facing upwards, representing each time the knee extension movement was performed. It is also possible to visualize the EMG signal synchronized with the movement, with an increase in the signal amplitude when the leg begins to rise and a decline in amplitude when the leg begins to descend, representing the muscle activation required by the vastus medialis muscle to perform the movement. In this method, the knee extension movement was segmented into four distinct phases, systematically defined by two threshold lines. The first threshold line determines the minimum angle the knee angle must go through to be considered the start of the leg rise. The value for the first threshold was determined as 20°. The second threshold line represents the minimum angle the knee angle must go through for 67
the knee extension movement to be considered sufficient. The physician should adjust this value for each patient since the full knee extension range can be reduced in a muscle rehabilitation context. However, in this study, it was defined as 60º. From the threshold lines, the four phases are determined from the following intervals: The first phase represents the upward movement, starting with values above the first threshold and ending at the second threshold; for example, the leg left 20º and reached 60º. The second phase is when the movement is already considered sufficient. It can be categorized when the knee angle is above the value of the second threshold, that is, values above 60º. The third phase represents the downward movement of the leg, which can only happen if phase 1 and phase 2 have occurred previously. It can be categorized as descending when the values are between the first and second threshold, equal to phase 1. Finally, phase 4 represents the leg at rest, classified when the knee angle values are below the first threshold, for example, values below 20º. Figure 29: Classification of movement between the four phases. In this way, as the mobile application receives the knee angle data, the current state of movement is classified based on this system of rules, as illustrated in Figure 29. Similar to a state machine, it is considered that the subject managed to perform the knee extension movement correctly once when the four phases were performed in sequence. When the sequence is complete, and the movement is considered correct, it is considered in this study that the subject performed a contraction. Thus, it is possible to visualize four recognized contractions in Figure 29. 68
The EMG signal used to analyze each contraction in this system is obtained by cutting the corresponding EMG signal between phases 1, 2, and 3 of the knee extension movement, excluding phase 4. This cutting method focuses on capturing only the most significant part movement, omitting the rest time between contractions. The decision to exclude phase 4 is based on the understanding that this phase, characterized by leg rest, contains less representative information for analysis. Additionally, it is likely to introduce positioning noise and prolonged periods with minimal muscle activity, which can impair the accuracy of the analysis. When the knee extension movement fails to go through all four phases, it is classified as incorrect contraction. For example, the subject started to lift the leg, failed to reach the second threshold, and returned to the resting position, keeping phases 2 and 3 missing. In these cases, the corresponding EMG signal is disregarded for analysis. Algorithm 1 materializes the described method responsible for updating the movement of the knee extension phase. This code runs continuously in the background during rehabilitation treatment in the wearable system and the mobile app. In order to provide a user-friendly interface, a screen in the mobile application was developed to supply real-time visualization of knee angle movement. The screen updates at a frequency of 10 times per second, aligning with the data transmission rate of the wearable system. This dynamic interface allows users to continuously monitor knee extension movements as they occur. The interface displays the current phase of contractions, the description of the current angle, and the total number of contractions recognized. Additionally, the physicians can easily adjust the minimum angle limit using user-friendly buttons on the screen, as depicted in Figure 30. This functionality aims to improve the adaptation of the rehabilitation process to the needs of each patient with accurate and updated information for the physician. Figure 30: Phases of contraction recognition interfaces. 69
Algorithm 1 Knee Extension Movement Recognition Algorithm 1: kneeExtensionPhase ←“resting” 2: angleStartContraction ←20 3: angleRecognizeContraction ←60 4: currentContractionStatus ←False 5: while isRecognitionActive do 6: angleKnee ←updateKneeAngle() 7: if angleKnee >0then 8: if angleKnee <angleStartContraction then 9: if kneeExtensionPhase == “moving down” then #Contraction Recognize 10: processContraction() 11: else #Reset without contraction 12: kneeExtensionPhase ←“resting” 13: currentContractionStatus ←False 14: end if 15: else if currentContractionStatus == False then #Start Contraction 16: currentContractionStatus ←True 17: kneeExtensionPhase ←“moving up” 18: else if angleKnee >angleRecognizeContraction then #Recognition Angle Achieved 19: kneeExtensionPhase ←“up” 20: else if kneeExtensionPhase == “up” then #Below the achieved recognition angle 21: kneeExtensionPhase ←“moving down” 22: end if 23: end if 24: delay(10) 25: end while 70
5.2 Muscle Fatigue Monitor Monitoring muscle fatigue is crucial for muscle rehabilitation treatments, allowing physician to adjust treatment protocols and prevent overexertion or injury. Muscle fatigue is the inability of a muscle to generate or sustain a given level of force, leading to decreased performance, increased risk of injury, and delayed recovery (Enoka and Duchateau, 2008). By monitoring muscle fatigue, physician can assess patient progress, determine if the current treatment plan is effective, and adjust treatment intensity and frequency according to the patient’s muscle response. In muscle rehabilitation treatments, patients usually perform exercises targeting specific muscles, such as the knee extension exercise, which focuses on recovering quadriceps muscle, especially the vastus medialis and vastus lateralis. These exercises are usually repeated several times, and the intensity and duration can gradually increase over time, leading to muscle fatigue (Hassanlouei et al., 2012). In traditional clinical settings, physician closely monitor patients and adjust exercises as needed. However, in remote rehabilitation, this level of interaction is more difficult, despite advances in remote rehabilitation, making it crucial to have a system that can monitor muscle fatigue in real-time during a treatment session. 5.2.1 Fatigue Metrics The vastus medialis muscle is one of the thigh muscles responsible for extending the knee. When this muscle is healthy, more stability is generated in the knee, avoiding inappropriate movements. However, with aging, the vastus medialis can become weaker, resulting in decreased knee stability and an increased risk of injury (Moznuzzaman et al., 2021). Figure 31 shows an example of data from the EMG sensor positioned in the vastus medialis muscle and applied the method to recognize knee extension movement. This section describes the operations performed on EMG signal clipped to calculate three relevant metrics in the context of muscle fatigue. Two metrics are related to the signal spectrum: the average and median frequencies. These metrics provide information about the frequency characteristics of the EMG signal and can indicate changes in muscle fiber activation. Specifically, a shift in activation from fast-twitch (type 2) fibers to slow-twitch (type 1) fibers indicate muscle fatigue. This shift is reflected in the signal spectrum by a leftward skew of the mean and median frequencies, resulting in lower frequency values (Cifrek et al., 2009). In addition, Root Mean Square (RMS) is calculated to quantify the amplitude of the EMG signal. The RMS value indicates the level of muscle activation. Higher RMS values correspond to greater muscle 71
of patients, providing greater management capabilities and responsiveness to real-time movement. This section describes three distinct stimulation modes, detailing their general and specific parameters, as well as practical implementation via the wearable system and mobile application. All stimulation modes share three main parameters common to muscle stimulators: intensity, pulse width, and frequency, as detailed in Section 2.2. In addition to these, each mode has specific parameters to manage its unique characteristics. 5.3.1 Commercial Stimulator The first mode replicates the functionality of the traditional commercial stimulator. In this mode, the stimulator operates in a cyclical pattern, where it is activated for a predetermined period and then deactivated for another period. This cyclical pattern is usually described as a duty cycle ratio, such as 1:2, meaning one second with the stimulator active and two seconds inactive. Figure 33: Sequence Diagram of the Commercial Stimulator. Figure 33 shows the sequence diagram of the integration of the mode 1 in CDSS. The physician 78
initiates mode 1 on the mobile application, configures the stimulation default parameters, defines the duty cycle parameters, and starts the treatment. At this stage, the wearable system starts two loops: the first manages the overall treatment time, while the second controls the duty cycle. The second loop runs with a period equal to the total duration of the stimulation and rest phases combined. During each iteration of this loop, the system checks the current time within the cycle and adjusts the stimulation accordingly, ensuring that the activation and rest intervals follow the predefined parameters. 5.3.2 Raising the Leg Stimulator The second mode introduces a more dynamic approach to muscle stimulation. In this mode, the stimulator is activated only when the leg is in phase one (moving upward) of the knee extension movement. This ensures that the electrical stimulation is synchronized with the active muscle contraction phase, providing support precisely when the muscle is working most intensively. This method can help improve muscle coordination and reduce the risk of fatigue by optimizing the timing of stimulation. Figure 34: Sequence Diagram of the Raising the Leg Stimulator. Figure 34 presents the sequence diagram for the second mode. The physician initiates mode 2 on the 79
mobile application, configures the standard stimulation parameters, sets the limit angle to recognize the knee extension movement, and starts the treatment. In this mode, during each iteration of the treatment cycle, the contraction phase is updated according to Algorithm 1. Next, it is checked whether the movement phase corresponds to the active phase of stimulation. 5.3.3 Range of Angle Stimulator The third mode aims at a more specific customization, allowing the physician to select a specific range of knee angles during which the stimulator should be activated. This targeted approach ensures that the muscle receives stimulation during the moment of greatest activation, providing assistance in sustaining the movement. Furthermore, this stimulation mode is more adaptable to patients’ muscle activations, which may differ from the expected pattern for knee extension movement. Figure 35: Sequence Diagram of the Range of Angle Stimulator. Figure 35 illustrates the sequence diagram for the range of angle stimulation mode. The physician starts mode 3 in the mobile application, configures the standard stimulation parameters, defines the range of angles, that is, the minimum angle to start stimulation and the maximum to stop stimulation, and starts the treatment. Every 10 ms, the wearable system updates the knee angle and checks whether it is within the defined range. If the knee angle is within the range, the stimulus is activated; otherwise, it is disabled. 80
5.4 Rule-based Stimulation One of the key intelligent features investigated in this thesis for treatment customization is rule-based stimulation. This approach enables the adjustment of electrostimulation parameters in response to muscle fatigue by utilizing real-time biofeedback. It also allows physicians to interpret the patient’s muscle response during the session, which is not commonly possible in traditional clinical physiotherapy settings. This interaction allows for the parametrization and customization of treatment according to the individual characteristics of each patient. Rule-Based Reasoning (RBR) systems are a well-established approach in CDSS, as discussed in the background section. The implementation of this system was motivated by two main factors. First, the ease of interpretation of rule-based methods by physicians results in a shorter learning curve compared to more complex methods. Advanced techniques can cause problems or lead to inadequate treatments if physician are not fully familiar with them. Therefore, the simplicity of RBR ensures that physicians can adopt and use the system with confidence. Second, creating consistent datasets for applying more complex methods is a significant challenge. Obtaining large volumes of consistent, high-quality data is especially difficult in projects that started from scratch, as it requires multiple initial validations and ethics committee approvals. The need for robust data limits the effectiveness of artificial intelligence-based approaches, making RBR a practical and efficient alternative. 5.4.1 Fatigue Stages The rule-based system developed for the CDSS relies on the definition of fatigue stages as one of its key operational mechanisms. These fatigue stages are determined using metrics related to muscular fatigue, being Root Mean Square and Median Frequency, calculated for each contraction performed by the patient. To interpret these metrics and identify fatigue occurrences, the CDSS uses the Joint Analysis of Spectrum and Amplitude (JASA) method, widely used in the literature to differentiate between normal and fatigued muscle responses during exercise. The JASA method was originally proposed to distinguish the effects of muscle fatigue from variations in muscle strength through the simultaneous analysis of changes in the frequency spectrum and the amplitude of the EMG signal. Studies like Luttmann et al. (2000), Conforto et al. (2014) and Dufaug et al. (2020) help to validated the effectiveness of JASA in assessing changes in muscle behavior, especially in activities involving repetitive or prolonged efforts. 81
JASA is effective in graphically representing the relationship between Median Frequency, which reflects the conduction velocity of muscle fibers, and RMS, which indicates signal amplitude and is associated with muscle strength. When observed on a Cartesian plane, these two metrics allow the categorization of muscle state into four main physiological scenarios: Q1: An increase in RMS and a shift in MDF to the right, suggesting an increase in muscle strength. Q2: A decrease in RMS and a shift in MDF to the right, indicating fatigue recovery. Q3: A decrease in RMS and a shift in MDF to the left, indicating a reduction in muscle strength. Q4: An increase in RMS and a shift in MDF to the left, characterizing muscle fatigue. This approach has been widely validated, and studies have shown a strong correlation between the drop in frequency of the EMG signal and the increase in amplitude as markers of fatigue. The JASA method effectively identifies the point at which the muscle begins to show signs of fatigue, allowing treatments, such as electrostimulation, to be adjusted based on the patient’s muscle condition. In simple terms, a fatigue occurrence is interpreted when the muscle needs to generate more force to perform a task but does so less efficiently by using slower fibers. This pattern is identified when there is a simultaneous increase in RMS (indicating greater muscle effort) and a drop in MDF (indicating the use of slower fibers). The CDSS calculates these metrics for each contraction, and when both conditions are met, the system identifies a fatigue occurrence. In addition to detecting these occurrences, the CDSS evaluates the intensity of each fatigue event. This intensity is calculated using the Euclidean norm equation px2+y2, where xis the percentage increase in RMS and yis the percentage decrease in MDF. This allows the system not only to detect fatigue but also to quantify its severity, distinguishing between mild and intense episodes. Control Parameters The rule-based system of the CDSS uses three main parameters to define the progression of fatigue stages: Late Start (S): Defines the number of initial contractions that are ignored when monitoring fatigue occurrences, eliminating events related to the muscle’s initial adaptation to the exercise. Fatigue Occurrences (F): Specifies the number of fatigue occurrences required for the system to register a change in stage, adjusting the treatment sensitivity according to fatigue progression. Minimum Intensity (M): Determines the minimum intensity a fatigue occurrence must reach to be considered valid, ensuring that only significant events are accounted for. These parameters allow the physician to customize the treatment according to the patient’s muscle response. When a fatigue stage is reached, the system can trigger specific rules that adjust electrostimu82
lation parameters as needed. To facilitate the adjustment of these parameters and provide a clinical validation tool, a fatigue stage simulator was developed and integrated into the CDSS administrative panel. This simulator allows physician to test different combinations of S,F, and Mand visualize how the system responds to the patient’s muscular fatigue progression. This feature is particularly useful for optimizing treatment and ensuring the system appropriately responds to the needs of each patient. Figure 36 demonstrates the simulator in a test session with 100 contractions. This tool provides a clear visualization of fatigue stage progression, helping physicians precisely and optimally adjust the parameters to increase treatment effectiveness. Figure 36: Muscle Fatigue Stages Simulator. As shown in Figure 36, the trajectory of the fatigue metrics does not follow a linear pattern, presenting oscillations throughout the test session. These variations reflect the dynamic nature of muscle activity and fluctuations in the effort required to perform the movement. In this example, the fatigue occurrence parameter was configured to detect three occurrences to trigger a stage change, with a minimum intensity of 1 and the late start set to 10, ensuring that the count of occurrences only begins after the tenth contraction, avoiding influences from the initial phase of muscle adaptation. The orange points in Figure 36 represent contractions identified by the CDSS as fatigue occurrences, 83
signaling moments when there was an increase in RMS and a decrease in MDF, both with intensities above 1, according to the defined parameters. In this example, the participant experienced 15 fatigue occurrences throughout the session, and since the occurrence parameter was set to 3, the system recognized 5 fatigue stages. This indicates that the clinician would have five opportunities to adjust the stimulation parameters, such as pulse width and stimulation intensity, as muscle fatigue progresses. 5.4.2 Automatic Session To differentiate sessions conducted in the clinic and manually adjusted by the physician from pre-programmed sessions using the rule-based system, the terminology of assisted sessions and automatic sessions was established. As described in the proposed treatment scenario, initial treatment sessions are conducted in the clinic to familiarize both the physician and the patient with the new treatment and devices. Additionally, these sessions aim to create an initial baseline of the patient’s muscle response. With the initial data collected, the fatigue stage simulator is used to analyze muscle responses and determine the optimal values that allow for coherent stage transitions as personally assessed by the physician. Once the fatigue parameters are adjusted, the physician can register an automatic session. In these sessions, the stimulation parameters are automatically adjusted by the system when a fatigue stage change occurs, as defined by the rules. Figure 37 shows the form that needs to be filled out to create an automatic session. Initially, the form requests the treatment plan, the recommended date, and a session description. Next, the physician can adjust the initial stimulation parameters, including standard parameters and those specific to the stimulation mode. After that, it is possible to adjust the adaptive parameters of the patient’s fatigue stage, such as the number of fatigue occurrences, minimum intensity, late start, and the minimum angle for contraction recognition. Subsequently, the physician must define how much to increase the intensity and pulse width at each fatigue stage change. Finally, the stop session parameters are defined, which include the maximum stage archived, the total duration of the session, and the maximum number of contractions. The primary objective is to complete all the contractions planned by the physician before one of the other two stop conditions is reached. However, if there is an indication of excessive fatigue, it is expected that one of the other two conditions will be activated. 84
Figure 37: Automatic Session Form. Figure 38 displays the main interfaces of the treatment session with the rule-based system activated. As shown in the first screen, there is an indication of the fatigue stage as 0, representing the initial state of the session. When the subject reaches the first fatigue stage, the second screen appears, requesting the patient’s permission to increase the stimulation intensity as previously set by the physician. Following this, the treatment interface is updated with the new fatigue stage, and the session continues. 85
Figure 38: Automatic Session Adaptation Screens. 5.5 Data visualization Data visualization plays a fundamental role in the CDSS, converting complex data sets into comprehensible and actionable information. In muscle rehabilitation, real-time visualization helps physicians monitor progress, adjust parameters, and ensure the accuracy of the administered treatment. In addition to providing specialized analysis, these visual tools are designed to enhance the interaction between the system and its users, making the rehabilitation process more transparent and manageable. The final section of this chapter explores the data visualization components implemented in the CDSS. In addition to the interfaces already described in previous sections, four more interfaces have been implemented, two in the mobile application and two in the administrative panel. These interfaces aim to facilitate physician’ decision-making by transforming captured biofeedback into interpretative and intuitive visual components. 5.5.1 Mobile App Two main screens were developed in the mobile application that ensure accurate capture of biofeedback data and help the physician understand the muscle response in real time. 86
Figure 39: Calibration Overview Screen. The calibration overview screen, as shown in Figure 39, displays the results of a successful calibration performed with the myHealth System. This screen presents processed data for the three contractions recognized during the calibration phase. The data, including the maximum angle reached, the median frequency value calculated in Hz, and the duration of each contraction, are not just numbers. They are practical tools that can be used to compare with previous treatment sessions and check for progress in the patient’s range of motion. A chart showing the average volume of the EMG signal captured during the three contractions is presented at the end of the interface. This chart allows for analyzing the knee angles at which the muscle shows greater activation during the knee extension movement. In this way, this chart is significant for two stimulation modes: the raising the leg stimulator and the range of angles stimulator, which rely on the angle to activate the stimulation. Thus, besides ensuring that the electrodes are well-positioned and capturing the correct muscle activity, it also enables a more precise adjustment of the stimulation, considering the patient’s current response. The second data visualization interface of the mobile app is illustrated in Figure 40. This interface provides a real-time analysis of the contractions recognized during the treatment session. Each time a contraction occurs, the mobile app calculates metrics related to muscle fatigue and updates the graphs. 87
with the objectives of promoting personalized treatments. Through a rigorous methodology and detailed empirical validations, it is intended to demonstrate that the developed CDSS is an innovative and valuable tool for physicians and patients, significantly contributing to the advancement of muscle rehabilitation with electrostimulation. This chapter is divided into five main sections. The first section outlines the evaluation Metrics used during the development and testing phases. The second section describes the preliminary validation procedures, including hardware verification, security analysis and preliminary sessions. The subsequent sections present the experimental studies, each addressing a different validation of the system. The first experimental study examines the quality and synchronization of the data acquisition and process EMG signals with stimulation artifacts generated by commercial device. The second study focuses on real-time muscle fatigue monitoring and analyzes the system’s ability to process data during treatment sessions. The final study provides an in-depth analysis of the CDSS’s accuracy by utilizing a gold-standard motion capture system, comparing different stimulation modes, and examining the statistical correlation between the fatigue perceived by participants and the levels of fatigue predicted by the CDSS. 6.1 Evaluation Metrics To evaluate the performance of the developed CDSS, three key metrics were employed: Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE). In our context, these metrics will be applied to comparative analysis between the CDSS with other systems and methodologies, such as comparing real-time processing done by the mobile app with processing done on a computer using raw data. To elucidate these evaluation metrics, consider two data sets we aim to analyze for similarity: the data points vector from the CDSS (A) and the data points vector from a comparable technology (F). If all elements of vector Aare subtracted from vector F, the resulting error vector Erepresents the discrepancies between the two data sets. An ideal system would yield an error vector with a sum of zero, indicating no error. The MAE metric is calculated as the average of the absolute errors, disregarding the error signs. This means that errors above and below the actual value are treated equally. MAE provides a straightforward interpretation of the average magnitude of the errors, making it a useful metric for general error analysis. The equation for MAE is given by: 94
MAE =1 n n X t=1 |At−Ft|(6.1) The MSE metric is the average of the squared differences between the actual and system output values. By squaring the errors, this metric places a larger penalty on larger errors, thus highlighting significant discrepancies more effectively than MAE. The MSE is calculated using the following equation: MSE =1 n n X t=1 (At−Ft)2(6.2) The RMSE metric is the square root of the MSE, providing an error metric in the same units as the original data, which makes it more interpretable. RMSE is particularly sensitive to large errors (outliers) and thus is a robust measure of the system’s performance. The equation for RMSE is: RMSE =v u u t 1 n n X t=1 (At−Ft)2=√MSE (6.3) 6.2 Preliminary Validation This section covers the initial experiments and fundamental validations conducted to ensure the functionality and robustness of the proposed system. These steps were essential early in the development process to ensure that the system operates as expected and meets the rigorous safety and efficiency standards required in clinical settings. Preliminary testing includes a variety of analyses, such as data transmission tests, safety analysis, initial hardware and software tests, and validation of the IMU sensors. The primary goal was to establish a solid foundation for subsequent development. Each of these subsections provides a detailed overview of the methods and results obtained, demonstrating how each component of the system was tested. 6.2.1 Transmission Test Initially, the first prototyping of the presented system included the implementation of all components described in the system architecture, albeit with basic functionalities such as user and session registration. Before hardware implementation, the capability of the ESP32 microcontroller was tested to handle EMG sensor acquisition, manage stimulation and parameter changes, and communicate via BLE with the mobile app simultaneously. Additionally, the system’s ability to manage a treatment session, including starting, pausing, canceling, and saving data to the cloud, was verified. 95
The first test simulated a treatment lasting 1 minute, with stimulation parameter changes sent every 8 seconds. To verify the reception of EMG sensor data, a data packet was sent every 200 ms from the wearable system to the mobile app with simulated data. More details about this test and pertinent discussions at the beginning of the system’s development were presented in the article (Franco et al., 2022b). Figure 44: Packet exchange time between the wearable system and the mobile app. As shown in Figure 44, the low-cost, low-power ESP32 microcontroller proved capable of efficiently maintaining both the processing of electrostimulation and data transmission. The analysis of packet exchange times showed that the average packet transmission time is 206 ms, indicating an average delay of only 6 ms to assemble each processed packet. This result suggests that the additional latency introduced by data transmission is minimal and does not significantly affect the system’s operation. The ability to perform multiple functions simultaneously without noticeable performance degradation is a promising indicator of the proposed system and the chosen hardware. 6.2.2 Security Analysis To ensure the integrity, privacy, and availability of clinical data managed by the CDSS, a master’s thesis was developed in conjunction with this doctoral thesis within the NanoStim project (Silva, 2021). This thesis was motivated by the need for scientific rigor in validating the protection of sensitive data in clinical environments. The main strategies for protecting sensitive data implemented in the CDSS were covered in Section 4.1.3. This subsection describes the key tests conducted and their conclusions as detailed in Silva (2021)p, elucidating the robustness of the presented system architecture. The security analysis comprised three main components: availability testing, functional testing, and threat modeling. To simulate a realistic scenario for the system’s usage, the CDSS implementation used for security analysis included Kubernetes for container orchestration, ClusterControl for database man96
agement, and HAProxy as a load balancer. This setup aimed to ensure automated failover, ease of maintenance, scalability, and auditability of the architecture. The first test, availability testing, aimed to evaluate the CDSS’s behavior when one of its services fails and measure the response time until the system stabilizes again. The results showed that the Management API and Clinical Service took 2 to 4 seconds to become available again, while the SSO service with Keycloak took about 50 seconds to reestablish. Using Kubernetes, ClusterControl, and HAProxy minimizes availability issues, as redundancy ensures the system remains available even if a service or database is removed, with only a brief reduction in processing power. The functional test aimed to validate the communication strategies between the system’s components and the CDSS behavior under peak request loads on each of the APIs, preventing Distributed Denial of Service (DDoS) attacks. For this, endpoints from each service (Management API, Clinical Service, and SSO) were selected for testing. Each endpoint involved a specific routine to promote authentication and the exchange of pseudo-anonymized information. A Python script was used to simulate the information flow, repeatedly sending requests to identify if the server’s resource usage increased. The number of requests incremented by 100, up to a maximum of 3500 simultaneous requests. The results showed no significant changes in the average response time, remaining consistent across all request levels. Finally, STRIDE threat modeling was conducted. This analysis describes potential threats, understands their causes, and creates mitigation strategies. STRIDE modeling addresses aspects such as spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privileges. The analysis revealed that all system assets could be targeted, indicating a broad attack surface. The assets in insecure environments, such as the mobile app, web administrative panel, and wearable device, are potential entry points for attacks. Identifying and reducing the likelihood of these threats is essential for enhancing CDSS security. Establishing robust methods for recognizing services, devices, users, and information complicates the malicious exploitation of CDSS functionalities, positively impacting privacy. The security analysis conducted supports the thesis that it is possible to create a CDSS that handles sensitive data. The described strategies, along with the test results, demonstrate the ability to ensure data protection in a CDSS that collects sensor data through a wearable system. Additionally, the implementation used in the tests with Kubernetes, ClusterControl, and HAProxy software demonstrates the CDSS’s capability in a more realistic environment, with scalability and redundancy. 97
6.2.3 A First Experiment The first prototype of the hardware for the wearable system developed in the NanoStim project was assembled on a breadboard, connecting the components of the ESP32 Dev Kit microcontroller, a commercial signal acquisition board (EBZ-AD8233), and a custom-made electrical stimulation circuit. This initial prototype was described in (Sestrem. et al., 2022), which explores in greater detail the electronic components included in the wearable system and the EMG signal acquisition test with wet and dry electrodes. With this hardware, it was possible to implement a first version of the mobile application, described in (Franco et al., 2022a). This version of the application included all the activity flows described in the treatment scenarios, including receiving stimulation parameters registered in the cloud by the physician, a treatment screen that displayed the acquired EMG sensor signal in real-time, and a self-report feedback interface after the completion of the treatment session. To validate this version of the application, a test treatment session was configured through the administrative panel, lasting 1 minute and varying the stimulation configurations. The test session was conducted with four healthy volunteers, with the EMG sensor positioned on the vastus medialis muscle with the help of a physician. When the test session began, the volunteer, seated on a bench, lifted their leg five times in one minute without being stimulated. Figure 45: Test treatment session on a volunteer without electrostimulation. (A) Subject’s leg relaxed. (B) Subject’s knee is fully extended. The test conducted to validate that the application can follow the necessary steps for NMES muscle rehabilitation treatment, as illustrated in Figure 45. In Figure 45A, the volunteer’s leg is relaxed, repre98
senting the rest period. At this moment, muscle activity is low, resulting in a slight alteration in the EMG signal displayed by the application. When the volunteer lifts their leg, a voluntary muscle contraction is generated. Therefore, in Figure 45B, it is possible to see how the EMG signal displayed by the application significantly changed its wave amplitude. To verify if the NMES configurations were being transmitted correctly, a resistor was placed at the NMES actuator output of the wearable system to simulate human skin. A multimeter was connected to this load to verify the current value as well as an oscilloscope to measure the frequency and waveform, as shown in Figure 46. The signal indicated by the devices followed the parameters provided by the mobile application, confirming the accuracy of the transmission of the stimulation configurations. Figure 46: Oscilloscope with stimulation pulses applied to the resistor. 6.2.4 Validation of IMU Sensors Following the implementations, the next step was to validate the IMU sensors. For this, the study described in (Franco et al., 2022c) was conducted. In this study, a new wearable system was created, composed of two identical modules. Each module included an ESP32, an MPU-6050 IMU sensor, and a battery, all soldered onto a perforated board and housed in a 3D-printed case. The case was designed to be placed on the thigh and shin, and hold by an elastic band. The purpose of this study was threefold. The first purpose was to verify that the ESP32 could handle two additional tasks: reading from two IMU sensors using I2C communication and sending the data via BLE. The second purpose was to validate the mathematical model presented in Section 5.1.1 for knee angle recognition and the real-time update 99
of the mobile app interface. The third purpose was the characterization and comparison of low-cost computational filters to improve the accuracy of the IMU sensor to measure angles. Computational Power Problem The ESP32 is an MCU with sufficient computational power to acquire sensor data at high frequencies, as the clock of a standard model, such as the ESP32-WROOM-32D, exceeds 150 MHz. However, due to the number of simultaneous tasks, it was observed that the time between each sample from the IMU sensor varied. To address this, the IMU modules were programmed to execute a software replicating the treatment protocol, with the addition of a dedicated thread designed to collect a IMU sample every 8 ms. This setup ideally results in a sampling frequency of 125 Hz. However, due to the shared processing power with other tasks, the collected data showed acquisition frequencies of 99–100 Hz. Additionally, the average time interval between each sample was 9.8 ms, with some peaks above 24 ms. The graph in Figure 47 shows the time difference between each sample collected by the wearable system in a sample acquisition. Figure 47: ∆Time of IMU samples collected by the wearable system. In contrast, the reading of the EMG sensor does not experience these delays. This is because the EMG sensor reading is executed through an interrupt function, triggered precisely every 1 ms. This level of precision cannot be achieved with the IMU sensors because their communication occurs via I2C. On the ESP32 MPU, it is not possible to collect data from the I2C interface within an interrupt function. As a 100
result, the IMU reading thread competes with other threads, such as data transmission via BLE, leading to the delays observed in Figure 47. IMUs Sensor Validation Scenario To investigate the performance of IMU sensors for knee angle recognition, the UR3 robotic arm was used. The UR3 collaborative industrial robot from Universal Robotics1is suitable for assembly and screwdriver activities, usually positioned on the top of benches. This robotic arm was chosen for two main reasons: firstly, the availability of the robot in the laboratory where the research was carried out; secondly, due to the fact that the UR3 has a certificate validating the precision of the joint’s movements. Thus, it is possible to configure the UR3 to perform a given movement with a minimum error in trajectories, making the validation more cohesive. Each wearable module was attached with clothing elastics to different parts in one of the joints of the UR3 robot, representing the knee joint, as illustrated in Figure 48. Figure 48: Wearable modules attached to the UR3 robot. The UR3 robot can be programmed to follow a sequence of positions determined by the joint angle. Thus, for all tests performed, the robot was programmed to move the selected joint in the following positions repeatedly: [0◦,90◦,75◦,90◦,60◦,45◦]. Each time the joint reached one of the chosen angles, the UR3 remained static for two seconds before moving to the next position. To compare the movement performed by the UR3 robot with the wearable system, a Python application 1https://universal-robots.com/products/ur3-robot 101
was developed to communicate with the UR3 via Wi-Fi and collect the angle of the chosen joint. It is important to note that the UR3 updates the register that stores the joint angle at a frequency of 30 Hz. To align with the amount of data generated by the wearable system, the sampling frequency of the software was set to 100 Hz, allowing for a higher density of comparable data. To analyze the data acquired by the wearable system, a treatment session without stimulation was recorded for each test performed. The acquired data were stored in a MongoDB database, from where they could be imported into a Jupyter Notebook for analysis before implementing the knee angle recognition feature in the mobile app. In the end, two time-series arrays were generated for each test, containing the angles recorded by the UR3 and the wearable system. The tests consisted of powering both systems and acquiring data continuously for 100 seconds. This procedure was repeated several times to verify the consistency of the acquired data, and no significant differences were found between the runs. The results presented in this section represent a snapshot of the movement performed by the systems three times during one of the acquisitions. Although both systems were configured with the same sampling frequency, it was not possible to automatically synchronize data acquisition from both systems simultaneously. Therefore, manual synchronization of the data was necessary. Figure 49 shows the raw data from the wearable system synchronized with the data acquired by the UR3 robot. Figure 49: Wearable system raw data synchronized with UR3 data. As can be seen in Figure 49, both sensors, gyroscope, and accelerometer can reproduce the movement performed by the UR3, but they are inaccurate. As the accelerometer can better measure slow 102
movements, the error is small during continuous movements, as shown in Figure 49 in the range of motion from 0° to 90°. However, when the UR3 stops, the accelerometer takes time to stabilize, generating noise peaks. Contrarily, the gyroscope can better measure sudden speed changes, presenting less noise. However, in continuous movements, a small error is accumulated in every sample, resulting in a significant difference compared to the desired degree at the end of the movement. Comparing the two sensors using the evaluation metrics, the gyroscope has a considerably worse result than the accelerometer. For the MAE metric, the accelerometer has a value of 1.27 and the gyroscope 5.37, four times higher. For the RMSE, the accelerometer has 2.09 and the gyroscope 6.18, three times higher. Lastly, the MSE of the accelerometer is 4.38, and for the gyroscope it is 38.27, eight times higher. Filters with Algorithmic Complexity O(1) Within the area of Signal Processing, several filters have been studied to improve the accuracy of IMU sensors. As commented in the literature review of the article Franco et al. (2022c), the implementation of filters such as Kalman and Madgwick can considerably reduce errors in the measurement of joint angles. However, the implementation of the best filters requires a very high computational cost, which is a resource often limited in embedded systems. The Big O notation is one of the most used notations to describe the computational cost of a given algorithm. This notation takes into account the size of the input and counts the number of instructions used to execute a given sequence of code. For example, for an algorithm that calculates whether the given input is even or odd, only one instruction will be used, resulting in an algorithmic complexity of O(1). For an algorithm that needs to traverse a vector of size n, the algorithmic complexity is O(n), since at least n instructions will be executed to complete the task (Chivers et al., 2015). The algorithm complexity presented by Valade et al. (2017) for the Kalman filter is O(10n3); for the extended Kalman filter, it is O(4n3). A study on the algorithmic complexity of the Madgwick filter was not found, but as calculations with matrices were used, the algorithmic complexity was to be at least O(n). Furthermore, these algorithms require memory resources to store the intermediate matrices needed in every calculation, that is not also abundant in embedded systems. Given this scenario, three filters with lower computational cost and algorithmic complexity of O(1) were tested to determine the best one for implementation in the wearable embedded system. The filters tested were: Simple Moving Average (SMA), Exponential Moving Average (EMA), and Complementary Filter (CF) for the accelerometer and gyroscope. 103
various clearly visible peaks can be observed, indicating the stimulation artifacts. Despite these peaks, the voluntary muscle response can also be seen occurring over the stimulation artifacts. When the stimulation is turned off, the peaks disappear, and the signal returns to normal activity, free from the interference of the artifacts. This section describes the methodology applied to remove these artifacts, resulting in clean, filtered EMG signals suitable for subsequent analysis. The first step was to calculate the exact period between the stimulation pulses. Given that the commercial device was set to 1 Hz, the expected interval between pulses was 1000 ms. To confirm this, the signal from tests 1 and 2 was cropped to a segment that definitely contained stimulation for all participants, specifically from seconds 100 to 130. Next, the find_peaks function from the SciPy library was used to detect peaks in the rectified EMG signal. These peaks were defined as values exceeding the signal’s mean plus three times the standard deviation. With this, the average time between the peaks was calculated, and the median interval among all participants was determined, defining the time interval between each stimulation pulse. The result was an interval of 970.33 ms, diverging from the expected value. Figure 54 shows an example of the rectified EMG signal with its identified peaks, as described. Figure 54: Example of peak detection in the EMG signal. Artifact Segmentation The logic for identifying the stimulation segment is based on the frequency of occurrence of the stimulation pulses. Knowing this frequency, the first step is to determine the start of the stimulation window. To achieve this, an algorithm was developed to segment the inter-pulse intervals (IPIs). The algorithm works by analyzing two consecutive windows of data. For each window, the index with 110
the lowest value within that window is found. If the difference between these indices is less than a threshold of 30 points, it indicates that stimulation has likely started, as the minimum points are very close, signaling the presence of a stimulation artifact. To confirm that stimulation has indeed started, the next five windows are tested. If the difference between the indices remains below the threshold, the vector index indicating the start of stimulation is identified. To segment the windows, the index is moved back 50 points to ensure a safety margin, and segmentation is performed every 970 points. Segmentation of the artifacts stops when the difference between the minimum indices of the windows exceeds the threshold. After identifying the start of stimulation, the next step is to separate the stimulation artifact, the M wave, and the voluntary signal. The start of the artifact is defined as 30 points before the local minimum within the first 70 points of the window. Next, within the following 200 points of the vector, it is calculated where the signal crosses zero (i.e., shifts from negative to positive or from positive to negative). The first zero-crossing point is defined as the end of the stimulation artifact. The M wave is defined as the segment between the end of the stimulation artifact and the fourth subsequent zero-crossing point. Figure 55: Example of segment with identified stimulation artifact. 111
In Figure 55A, an example of an IPI is shown with the marking of the start and end of the artifact and the M wave. Figures 55B and 55C display, respectively, the average and standard deviation of the artifacts and M waves of all experiment participants. The average time for the stimulation artifacts and M wave among participants was 160 ms out of 970 possible, corresponding to about 16% of the IPI. This segment of the signal needs to be filtered to achieve a clean EMG signal that closely represents the participant’s true response. Cubic Interpolation Filter To ensure the continuity of the EMG signals and remove stimulation artifacts, a filter based on cubic interpolation of the data adjacent to the artifact segments was applied. Cubic interpolation is a mathematical technique used to estimate new data points within the range of a discrete set of known data points. Unlike linear interpolation, which connects adjacent points with straight lines, cubic interpolation uses third-degree polynomials to connect the points, resulting in a smooth curve that passes through the original data points. Cubic interpolation is preferred in many applications because, unlike linear interpolation, it not only guarantees the continuity of the interpolated function but also the continuity of its first and second derivatives. This makes cubic interpolation especially useful for biological signals, such as EMG, where maintaining the signal’s properties is particularly important. To apply the filter to each identified artifact segment, the total size of the segment, or the number of points occupied by the artifact, is determined. Then, a set of data points equal to the size of the artifact is selected before and after the artifact. These segments are used to construct the cubic interpolation function. The ‘CubicSpline‘ function from the SciPy library is used to generate the interpolation. The cubic interpolation function is applied to the interval corresponding to the artifact segment, generating an interpolated segment that replaces the artifact in the original signal. This procedure ensures that the transition between the real data and the interpolated data is smooth and continuous, maintaining the integrity of the EMG signal. In Figure 56, an example of an EMG signal after the application of the filter can be seen. Note that this is the same signal shown in Figure 53, but with the stimulation artifacts removed. Figure 57 shows an example of a segment with the stimulation artifact and the respective filtered signal. It can be observed that the application of the cubic interpolation filter effectively removed the stimulation artifacts, resulting in a clean and continuous signal. 112
Figure 56: Example of EMG signal captured during the FES experiment filtered. Figure 57: Example of segment with identified stimulation artifact filtred. 6.3.3 Maximum Voluntary Contraction (MVC) MVC is a crucial concept in electromyography studies, used to measure the most significant force that a muscle or muscle group can generate during voluntary contraction. Practically, MVC serves as a reference point for normalizing EMG signals, allowing muscle activities to be expressed as a percentage of the individual’s maximum effort. This normalization enables clear comparisons between subjects and experimental conditions, as it accounts for the inherent variations in absolute muscle strength across subjects. In Figure 58, the average muscle activity of each subject during the first test is displayed in millivolts (mV). The visual analysis suggests that most volunteers exhibited similar muscle activation levels, with 113
some notable variations in three subjects. This observation implies that the subjects exercised comparable effort during the test. Figure 58: Mean muscle activity of subjects in mV. For a proper normalization of the data, EMG signals collected during the second test (STS test) were used to identify the maximum muscle activity during a dynamic task. The final 15 seconds of the test were selected based on the assumption that subjects had performed their maximum effort during this period. The extracted EMG signals were processed in four steps: (1) rectification of the signal, (2) smoothing using a moving average window of size 300, (3) identification of the peak amplitude, and (4) calculation of the average of 20 adjacent points around the identified peak. The results of this process are shown in Figure 59, which presents the MVC values of each subject. Figure 59: Maximum Voluntary Contraction of subjects. 114
Following the MVC calculation, all subjects’ EMG data were normalized, expressing muscle activity as a percentage of the MVC, as illustrated in Figure 60. Figure 60: Mean muscle activity of subjects normalized by MVC. A comparison between Figure 58 and Figure 60 highlights the normalization value. In Figure 58, muscle activation values appear relatively similar across subjects; meanwhile, in Figure 60, a bigger variability is observed, with some subjects using up to 40% of their total muscle capacity, while others utilized less than 10%. This indicates that some subjects had more ease in performing the movement than others, or in other words, some subjects needed to demand more of their vastus medialis muscle to perform the same task compared to other subjects. It is important to emphasize that the mean muscle activation normalized by the MVC is a weak indicator of the subjects’ muscle fatigue. Although it is possible to assess the percentage of muscle required to perform the movement, it is not possible to say how much longer the subject would be able to maintain the movement with the same percentage of muscle use. It is possible that some subjects, despite having high mean muscle activation values, can sustain the movement longer than a subject with a lower average. This happens because our muscles have varied intrinsic characteristics, such as fiber type, body fat, and muscle volume, which influence the muscle’s ability to sustain the movement for a longer or shorter time, which would more accurately indicate muscle fatigue. 6.3.4 Knee Extension Movement Recognition With the EMG signals properly processed and normalized, the next step in the experimental study was to apply the knee extension movement recognition algorithm, as described in Section 5.1. This phase of the 115
study was crucial for validating the effectiveness of the developed algorithm in accurately identifying and segmenting the movements performed by the volunteers using real data collected during the experimental sessions. The main goal was to verify whether the proposed method could precisely recognize movement cycles, an essential task for the CDSS’s effective application in clinical environments. The recognition algorithm was then applied to the data from all participants, resulting in 15 recognized movements in the first test and 15 more in the third test, as expected for each participant. The first investigation on this topic focused on the variation in the maximum angle achieved and the duration of each contraction. Figure 61: Variation in Maximum Angle and Duration of Knee Extension Movement - Experiment 1. The chart in Figure 61 indicated that there was a variation in the duration of contractions recognized among the volunteers, with an average of approximately 8 seconds per contraction. Most subjects completed the movement by taking 1 second to raise the leg, maintaining the leg at the maximum position for 6 seconds, and taking 1 second to lower the leg. However, the most notable observation was that all subjects displayed a maximum angle exceeding 90 degrees, which is anatomically improbable. This angular deviation was attributed to the imprecise positioning of the IMU modules, which had already been identified in preliminary studies. The confirmation of this deviation in this experimental study suggested the need for a system calibration process before each session to reduce angular error and ensure a more accurate representation of knee movement. A normalization process was performed to correct the knee angle collected in this experimental study, adjusting the maximum value of each test to 90 degrees, respecting human anatomical limits. 116
Figure 62: Cycles of Knee Extension Movement. Figure 62 presents the mean and standard deviation of the recognized contractions, with the cropped knee angle and the EMG signal. The data were interpolated so that the duration of the movement cycle was transformed into a percentage of the total cycle, allowing for comparisons disregarding differences in contraction duration. The chart in Figure 62 evidence that the algorithm worked as expected since the data from the IMU and EMG sensors were synchronized. If the algorithm had segmented the movements incorrectly, disorganized peaks would be expected in the EMG signal. The chart shows an increase in muscle activity at the beginning of the movement, specifically during leg elevation, followed by a stable activation level during the holding phase and a gradual decrease during the descent phase. The analysis of the results indicates slight variation in knee angle during the movements performed by the volunteers, suggesting that the movements were carried out consistently. However, muscle activity showed more significant variation among participants, indicating that some individuals needed to exert more muscle force to complete the movement compared to others. In some cases, muscle activity was up to twice as high in certain individuals. For a more detailed analysis of muscle activity during knee extension movement, the EMG signal data were transformed into a ratio of the knee angle for each contraction. The mean and standard deviation of these ratios were then calculated, generating the chart shown in Figure 63. 117
Figure 63: Muscle Activity in Knee Angle Ratio. The analysis reveals that the volunteers’ muscle activity gradually increased as the knee angle increased, reaching its peak in the last 20 degrees of extension. This result suggests that the vastus medialis muscle remains highly active during the initial phase of the movement, playing a crucial role in the full extension of the knee. However, muscle activity during the holding phase was less intense, indicating that muscle effort is significantly higher in the early stages of the movement. In order to obtain a more precise representation of this hypothesis, a line in Figure 63 was added to evidence the muscle activity of a specific part of the movement cycle, being between 15% and 35% of the total cycle, where the peak of activity was observed in Figure 63. The chart revealed that muscle activity during this period was considerably higher than during the holding phase, reinforcing the importance of the vastus medialis muscle in the last 20 degrees of the knee extension movement. First Test vs Third Test Following the objectives, a comparative analysis was conducted between the data obtained in the first and third tests, with the primary goal of identifying and quantifying possible differences between the two assessment moments. This allowed the identification of signs of muscle fatigue or changes in movement execution over time. 118
Figure 64: Comparison between the First and Third Test. Figure 64 presents a graphical comparison between the movements recognized in the first and third tests. In Figure 64A, the graph shows the trajectory of the knee angle for both tests, while part B presents the muscle activity. As seen in Figure 64A, the movement recognized in both tests is quite similar, indicating that the volunteers consistently performed the knee extension movement. However, it can be observed that, in the third test, the knee angle during the sustaining phase is slightly lower compared to the first test. This suggests that the subjects had some difficulty maintaining the maximum angle as the muscles became more fatigued. In Figure 64B, which illustrates the muscle activity, a more noticeable difference between the two tests is observed. The muscle activity in the third test is visibly higher compared to the first test, indicating that the volunteers’ muscles had to work harder to perform the movement in the last repetition. This increase in muscle activity may be indicative of accumulated fatigue throughout the exercises, requiring additional effort from the muscles to complete the knee extension movement. Figure 65: Comparison between the First and Last Movement. A second analysis was conducted to investigate this difference further, presented in Figure 65. In this analysis, the first and last movements performed throughout the entire experimental session were selected. In Figure 65A, it is observed that there was no significant difference in the sustaining phase 119
between subjects, with an approximate average of 5 seconds for each contraction, with an average of 1 seconds to raise the leg, 3 second remaining at the top and 1 seconds on the way down. The maximum angle reached was 83° on average across all subjects. It was also noted that the majority of subjects increased the maximum angle reached with each contraction, resulting in the maximum peak between contractions 30 and 40. Figure 69: Cycle of Knee Extension Movement - Exp 2. Similar to the first experimental study, the graph in Figure 69 presents the average and standard deviation of the segments from the EMG signal and knee angle, both normalized to the complete movement cycle. The data analysis shows that the signals are well synchronized, as expected, demonstrating the accuracy of the movement recognition algorithm. However, a notable difference compared to the first study is the timing of the peak muscle activity. In the second experimental study, this peak occurs closer to the middle of the contraction cycle. This variation can be explained by the difference in the average duration of contractions between the two studies. In the first experimental study, the contractions lasted an average of 8 seconds, with 6 seconds dedicated to the holding phase. In contrast, in the second study, the holding phase was reduced to an average of 2 seconds, resulting in a redistribution of muscle activity throughout the movement cycle. This change was intentional in the protocol to replicate a contraction more similar to what is typically performed in rehabilitation clinics. 126
6.4.3 Fatigue Metrics Evaluation This section presents a statistical analysis of three metrics related to muscle fatigue: AvgFreq, MedFreq, and RMS. These metrics were obtained from the EMG signal derived from the segment identified by recognizing contractions based on knee angle and subsequently calculated as described in section 4.2. The calibration process described converts these metrics into percentages relative to the initial state of the test, which is crucial for monitoring the session’s progression. However, to compare across multiple subjects, the data still needs to be standardized due to variations in EMG signal strength. Thus, the data were normalized as standard deviations from the mean. Additionally, due to some failures in reading the EMG signal from the wearable system, it was necessary to remove up to 3 contractions from some subjects. Consequently, the reported values represent a moving average with a window size of five across 45 contractions. For subjects without signal discrepancies, the initial 5 data points were excluded. This methodology offers insights into the trend of metric values throughout the session. Figure 70 and Figure 71 illustrate the trends of metrics related to signal frequency, AvgFreq and MedFreq for each subject, and the average trend among the entire group. The average trend decreases as contractions progress. This decline in frequency indicates a decrease in muscle fiber conduction velocity, which is consistent with the expected physiological response to fatigue. As the participant becomes fatigued, the muscle’s ability to generate force decreases, resulting in a slower conduction velocity of the muscle fiber, shifting the signal power spectrum to lower frequencies Cifrek et al. (2009). In some cases, there was a constancy or even an increase in the AvgFreq and MedFreq metrics until the half of the session. This can be understood as a period of adaptation to the movement that the subject went through. These results demonstrate similarities with those presented in Liu et al. (2019), where the median frequency went through several waves with a negative slope until the end of the exercise. In contrast to the frequency metrics, the average trend of the RMS metric illustrated in Figure 72 does not exhibit a sharp decrease. In general, the predominant behavior was an increase until halfway through the session and then a decrease. This observation suggests that the subject added strength until halfway through the session, potentially adapting to the movement and compensating for the onset of fatigue. Afterward, there are two most likely possibilities: The first is that the RMS decreases, indicating fatigue with a lack of ability to generate more force to sustain the movement, as demonstrated by the authors in Shaw et al. (2020). The second option is when the RMS stabilizes or increases, indicating that the subject calmly endured the exercise until the end. 127
Figure 70: Trend of the avgFreq metric during the session. Figure 71: Trend of the medianFreq metric during the session. Figure 72: Trend of the RMS metric during the session. 128
The Joint Analysis of Spectrum and Amplitude (JASA) is a method that seeks to understand muscular responses by simultaneously considering the MedFreq and RMS metrics in a Cartesian plane. The JASA method aims to distinguish the changes observed in the EMG signal between the effects of muscle fatigue and variations in muscle force that occurred during exercise (Luttmann et al., 2000). These quadrants of the Cartesian plane represent different physiological scenarios: the increase in RMS and the displacement of MedFreq to the right indicate a possible increase in muscular force (Q1); the decrease in RMS and the displacement of MedFreq to the left suggest a probable reduction in muscular force (Q3); the increase in RMS and the shift of MedFreq to the left indicate muscle fatigue (Q4); the decrease in RMS and the shift of MedFreq to the right indicate recovery from previous fatigue (Q2). Figure 73: JASA Method apply to Experimental Test. Figure 73 illustrates the application of the JASA method to the contractions recognized of the entire group. The dots were colored in a gradient from red to green, indicating the first contractions as redder to the last ones as greener. Thus, it is possible to see that despite the varied start, the average progression of the muscular response during the session was a decrease in force and some cases of fatigue. This is an expected muscular response for healthy subjects who practice physical activity regularly. 129
Contributing again to an interpretation that there was some challenge at the beginning of the session to adapt to the movement, and then there was a control of force until the end of the session. Using the chosen fatigue metrics allows a comprehensive assessment of muscle fatigue. While frequency metrics reflect physiological changes associated with fatigue, RMS provides information about participant exertion levels. The integration of these metrics improves the understanding of the progression of fatigue and facilitates the identification of different stages of muscle fatigue, as exemplified using the JASA method. Furthermore, other parameters related to muscle fatigue extracted from the EMG sensor can be used, as described by Cifrek et al. (2009), once the data has been properly cut and processed with motion recognition by the IMUs. It is essential to emphasize that the interpretation of these findings must be the responsibility of the physician, who has the necessary knowledge about the patient’s pathology. It is essential to recognize that different pathologies may present different fatigue behaviors compared to healthy individuals. Therefore, the physician plays a crucial role in analyzing these metrics and making informed decisions based on understanding the patient’s condition. 6.4.4 Muscle Fatigue Level Simulator The final analysis conducted with the data from the second experimental study focused on the behavior of the muscle fatigue level simulator, applied to the fatigue metrics calculated by the CDSS. This subsection aims to exemplify how the adjustable parameters of the simulator can influence the characterization of each participant’s fatigue, allowing the stimulation treatment to be tailored according to the real-time biofeedback collected. As previously explained in Section 5.4 of this document, the fatigue level simulator has three main parameters that determine its adaptability. The first parameter, referred to as S, represents the number of contractions after which the simulator begins to operate, helping to exclude fatigue episodes caused by initial muscle adaptation to the exercise. The second parameter, F, indicates the number of fatigue occurrences required to trigger a change in fatigue level. Lastly, the third parameter, M, corresponds to the minimum intensity that a fatigue occurrence must reach to be considered valid. To demonstrate the simulator’s flexibility, different sets of values were tested for each of these parameters: S= [5,10,20],M= [1,2,3], and F= [2,3,4]. These parameter combinations resulted in 27 different configurations, which were applied individually to each participant’s session, generating the results of this section. 130
Figure 74: (A) Occurrence of Fatigue (B) Intensity of Occurrences by Configuration. Figure 74A presents a box plot showing the number of fatigue occurrences when varying the Sand M parameters. It is evident that the average number of fatigue occurrences among participants significantly decreased as the minimum intensity (M) increased, with M= 3 showing the fewest occurrences. The variation of the Sparameter revealed little change when starting the monitoring after the 5th or 10th contraction. However, when the simulator began operating after the 20th contraction, both the average number of fatigue occurrences and the standard deviation decreased substantially. Figure 74B shows the average intensity of the recorded fatigue occurrences for each configuration, with variations in the Sand Mparameters. As expected, the average intensities of the contractions increased as the minimum threshold (M) was raised, excluding lower-intensity values and pushing the average upward. Additionally, some fatigue occurrences were identified as outliers because their values were significantly above the norm. It is noted that these contractions with greater intensity predominantly occurred later in the session since only one of the outliner occurrences was filtered when the S= 20 configuration was applied. Following the analysis, a comparison was made between the average levels of fatigue recorded by the CDSS, considering different numbers of occurrences required for a level change. The final level reached is a crucial metric in the CDSS’s rule-based method, as it indicates how often can the physician adjust the parameters of the electrostimulation treatment during a session. As shown in Figure 75, participants experienced a range of zero to five fatigue levels, depending on the simulator parameters. For configurations that required only two occurrences of fatigue, at least one level change occurred for all participants, with the average being around three level changes. In contrast, when four occurrences were required for a level change, some participants did not reach the first fatigue level. In the last scenario, most participants did not reach level 1, and only a few managed to do so. In order to complement Figure 75, Figure 76 shows the repetition at which the first level change occurred in each configuration. It can be seen that configurations requiring two occurrences of fatigue led to relatively early level changes in the session, with most participants reaching the first level between 131
contractions 20 and 30, except for configurations with a late start defined at contraction 20. Figure 75: Fatigue Levels Achieved by Configuration. Figure 76: Contraction number at first fatigue level achieved. The configurations that most accurately captured the participants’ muscle responses during the experiment 2 sessions were those using the parameters F= 3,S= 10, and M= 1. This configuration considers a higher number of fatigue occurrences than M= 2, with all participants reaching at least one level, and for most, this level occurred around contraction 30. Additionally, the hypothesis developed in the previous subsection suggests that, while participants experienced some level of fatigue, especially at the beginning of the session, they did not feel excessively 132
fatigued. Therefore, fatigue levels between one and three are expected to be normal for healthy individuals performing this type of exercise. This information provides valuable data for the physician to make informed adjustments to the treatment according to the expected effects. Subjects Fatigue Evaluation To further analyze the results, the chosen configuration for the subsequent data was F= 3,S= 10, and M= 1 of the fatigue level simulator, as it presented an optimal balance between sensitivity to muscle effort and the ability to track participants’ fatigue progression throughout the experiment. Figure 77: (A) Amount of Occurrence (B) Average Intensity of First and Last Level per Participant. Figure 77A illustrates the number of fatigue occurrences for each subject during the session of experimental study 2. It is noted that participants exhibited a varied number of fatigue occurrences, supporting the hypothesis that only some subjects felt more fatigued. Three subjects recorded eight or more occurrences, while, on the other hand, subjects 4 and 6 had only 4 and 3 occurrences, respectively. This indicates that these subjects were better prepared for the exercise. In Figure 77B, the average intensity of the first and last fatigue levels reached by the participants is compared. It is observed that, for three subjects, the initial intensities were higher than the final ones, highlighting greater difficulty in adapting to the exercise. Additionally, subjects 7 and 2 showed the largest increases in average intensity and also had high numbers of fatigue occurrences. For the defined configurations, the simulator indicated that subjects 2, 3, and 7 experienced more difficulty performing the exercise. Finally, Figure 78 aims to clarify at what point during the experimental session the fatigue levels were reached on average and their respective intensities. As previously noted, for most participants, the first fatigue level was reached around the 30th repetition, which is more than halfway through the proposed exercise. The second and third levels, on average, were reached during the last 10 repetitions. The intensity between the fatigue levels was quite similar, although for level 2, a greater variation was observed 133
compared to level 1. Figure 78: (A) Contractin Number of Levels Change (B) Average Intensity per Level. 6.4.5 Mobile Data vs. Cloud Data In order to evaluate the consistency and accuracy of the Fatigue Monitoring Method in real-time, this section compares the data processed in the mobile app with the data processed on the computer from the raw data. With this, it is possible to obtain information about the performance and reliability of data processing algorithms. Two metrics were used to perform the comparative analysis between the systems, namely: Mean Absolute Error (MAE) and Mean Mean Square Error (RMSE). These metrics seek to parameterize the difference between the data obtained in each system, interpreted as our error. Figures 79, 80 and 81 present comparative charts showing the average error between real-time processing performed by the mobile application and cloud processing for calculating fatigue metrics for all subjects. These charts also provide insights into the average post-application error resulting from the implementation of a moving average with a window size of 5, as previously discussed. The vertical lines associated with each data point in the charts represent the standard deviation calculated across all subjects, allowing a deeper understanding of the data distribution. From these charts, it is evident that the metrics related to frequency (AvgFreq and MedFreq) had more errors than the RMS metric. The most plausible explanation for the divergence between the systems lies in the calculations related to the transformation of the signal in the frequency spectrum and not in how the sensor data is cut and synchronized. Otherwise, the RMS metric would also present average errors similar to AvgFreq and MedFreq. Also, these calculations were one of the few parts within the mobile system that was not programmed from scratch, especially the Fourier Transform Algorithm. Given the use of different programming languages in implementing the method, variations such as differing variable precision may contribute to this effect. 134
Figure 79: Comparison between systems of the AvgF req metric. Figure 80: Comparison between systems of the MedFreq metric. Figure 81: Comparison between systems of the RMS metric. 135