45 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 Conference Paper Novel Functional Electrical Stimulation Parameter Optimization for Neurorehabilitation Using Both Conventional and AI Techniques Arsenios Arsenidis1, Alexandros Moraitopoulos2, Alkinoos Athanasiou2, Alexandros Vildiridis3, Panagiotis Bamidis2, Petros Stefaneas4 and Alexandros Astaras5 1Department of Physics School of Applied Mathematical and Physical Sciences, NTUA, Greece. 2Lab of Medical Physics & Digital Innovation, AUTH, Greece. 3Department of Business Administration, University of Piraeus, Greece. 4Department of Mathematics School of Applied Mathematical and Physical Sciences, NTUA, Greece. 5Computer Science Division of Science & Technology American College of Thessaloniki, Greece. * Corresponding Author Email: sl_arsenis@hotmail.com ABSTRACT Neurological conditions such as stroke or spinal cord trauma often attenuate or disrupt nerve connections, leading to loss of muscle function, sensation, or responsiveness. The application of physical and occupational therapy rehabilitation protocols can help regain some of the lost functions and significantly improve a patient’s quality of life. These protocols leverage the principle of neuroplasticity, an inherent property of the brain that allows the formation of new neural connections in response to external stimuli. Electrical Muscle Stimulation (EMS) has been proven to amplify the effects of rehabilitation as it adds new stimuli in the form of suitable electric pulse-trains directly to the neuromuscular system. Certain rehabilitation protocols incorporate functional exercises that mimic natural movements, which can in turn benefit from the application of synchronized electric pulses. This process, known as Functional Electrical Stimulation (FES), has been demonstrated to be beneficial with respect to the nature and longevity of neuromuscular adaptations as well as brain reorganization. This paper considers techniques for the optimization of these parameters and presents preliminary in vivo experimental results demonstrating the proposed methodology. Keywords—Medical devices, Denervation, Stroke, Spinal cord injury (SCI), Functional Electrical Stimulation (FES), Func- tional Electrical Stimulation Therapy (FEST), Medical instrumentation, Neurorehabilitation, Physical rehabilitation, Machine learning, Artificial intelligence (AI), Biomedical engineering, Central Nervous System (CNS), Peripheral Nervous System (PNS). Copyright © 2024. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY): Creative Commons - Attribution 4.0 International - CC BY 4.0. The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduc- tion is permitted which does not comply with these terms. http://www.globalce.org http://globalce.org http://globalce.org mailto:sl_arsenis@hotmail.com https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/ J Global Clinical Engineering Vol.6 Special Issue 6: 2024 46 INTRODUCTION The synaptic connections between corticospinal axons and motor neurons in the spinal cord play a crucial role in transmitting signals essential for coordination, move- ment, and sensory functions. Spinal Cord Injuries (SCIs) can damage the descending corticospinal axons, leading to the disruption or attenuation of nerve signals between the central nervous system (CNS) and the peripheral nervous system (PNS).1 In the event of a stroke, an obstruction (ischemic stroke) or breakage of a blood vessel (hemorrhagic stroke) may result in brain damage to regions governing movement or sensation by inhibiting the production or transmission of neural signals. The weakening or interruption of neural connections in both cases is a condition known as denervation. Affected limbs or organs may experience a range of symptoms, from weakness and numbness to loss of sensory function and complete paralysis.2 Denervation and its symptoms can be mitigated through rehabilitation protocols designed for cortical reorganiza- tion. These protocols are grounded in the principles of Hebbian learning and leverage the brain’s inherent capacity for adaptation, a phenomenon known as neuroplasticity.2 Neuroplasticity is a term used to describe the CNS’s neurodevelopmental capability to experience alterations in structure and function, following exposure to both ex- ternal and internal stimuli. This capacity is not exclusive to a specific time frame of human life. Hence, neuroplasticity is crucial, in that it facilitates healing in response to CNS injury and trauma for the entire duration of human life.3 Hebbian learning is based on the hypothesis that gains in synaptic efficacy are realized following the exertion of repeat stimulation of a postsynaptic cell by a presynaptic cell. It is a model of associative learning which proposes that synchronous neural activity produces increased synaptic strength in the cells involved.4 Electrical Muscle Stimulation (EMS) encompasses a wide array of therapeutic interventions. In general terms, electrical pulses are applied to the neuromuscular system offering additional stimuli for Nervous System activation and reorganization. The electric pulses elicit action poten- tials that bring about muscle contractions capable of being synchronized with the functional movements and tasks performed during a rehabilitation session, a methodol- ogy known as Functional Electrical Stimulation (FES).1,2 FES constitutes a tool capable of stimulating the neu- romuscular system, thus occasioning neuromuscular and central nervous system plasticity.2 Due to the precise tim- ing, it further leverages the principles of Hebbian learning enhancing synaptic connections and the formation of neural pathways. Employed in response to both strokes and spinal cord injuries, FES has been found to produce better outcomes with regard to patient mobility, spastic- ity, walking speed, and spinal cord function recovery.1,3,4 The significant parameters affecting the quality of muscular contractions and cortical reorganization are pulse intensity and width, frequency, as well as the time delay between pulses. Notably, these parameters are session- and subject-specific because they are affected by factors such as the type of waveform, the placement of electrodes, electrolyte concentration in the targeted muscle, the cleanliness of the skin area where the elec- trode is placed, the adaptation of FES parameters across different rehabilitation sessions, and the synchronization between voluntary command and the muscular contraction which is actually induced.1,2 Small variations in param- eter values can substantially alter the quality of induced muscular contractions as well as the longevity of cortical reorganization.2 It is important to note that although higher pulse intensities and frequencies elicit stronger contrac- tions they may also introduce pain, discomfort, and skin irritation.2 Consequently, there’s a pressing need for an automated calibration process at each sessions’ outset, determining optimal parameter values while considering patient comfort. MATERIALS AND METHODS Hardware The system consists of a commercially available PC, two microcontrollers, a gyroscoping accelerometer, a programmable waveform generator, an operational ampli- fier, electrodes, and an oscilloscope for data acquisition. http://www.globalce.org http://globalce.org http://globalce.org 47 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 Software The 8-bit microcontrollers were programmed by use of the C programming language. The first microcontroller managed the MPU6050 gyroscoping accelerometer to monitor the magnitude of the acceleration produced by the stimulated muscle in real time, providing constant feedback to the system. The second of the two controlled the AD9833 program- mable signal generator enabling real-time adjustments for every stimulation parameter such as intensity, frequency, pulse width, shape of the waveform, and more. An AI expert system tuned on accelerometry data is being used for optimization purposes. Frequency is be- ing swept across a preset range while monitoring muscle responses. Data transfer from microcontrollers to PC was facili- tated via a USB connection. All results were visualized by use of appropriate Matlab scripts. Experimental Set up The interconnectivity of components is illustrated in the block diagram of Figure 1. FIGURE 1. Block diagram of the experimental setup. The AD9833 waveform generator produces the electrical stimulation pulses, which are adjusted and controlled by the 8-bit microcontroller. The signal is amplified and then transmitted to the left-hand bicep muscle via electrodes. The electrodes are always identical and consistently positioned at the muscle belly after the implementation of a standard cleaning protocol. This procedure ensures repeatable and uniform measurements. The amplification process utilizes a conventional non-inverting operational amplifier circuit. The microcontrollers feature the Atmega328P single chip by Atmel, run on an 8-bit AVR processor core, and incorporate a 16 MHz quartz crystal oscillator. The chip is designed with 6 analog inputs, and 14 digital input/ output pins and offers 32 KB flash memory, 2 KB SRAM, 1 KB EEPROM and a wired USB interface for program- ming purposes. The MPU6050 gyroscoping accelerometer integrates a 3-axis gyroscope and a 3-axis accelerometer to endow low noise and precise 6-axis motion tracking. It operates within a supply voltage range of 2.375–3.46 V, has an adjustable range of ± 16 g, comes equipped with a Digital Motion Processor, and supports an I2C interface. AD9833 programmable waveform generator operates within a supply voltage range of 2.3–5.5 V and consumes 20 mW. The device is capable of producing sinusoidal waveforms with peak-to-peak amplitude of 0.6 V as well as triangular and square pulses with peak-to-peak ampli- tude equal to the supply voltage. The frequencies of the generated waveforms span from 0–12.5 MHz with 0.1 Hz accuracy. The chip supports communication via several protocols, including SPI (utilized in this instance), QSPI, and MICROWIRE. The OPA462IDDA SMT high voltage operational am- plifier operates within a supply voltage range of ± 6 to ± 90 V and can provide 30 mA current. It incorporates protection mechanisms against overheating and current overloads, is unity stable with a gain-bandwidth product of 6.5 MHz, a slew rate of 32 V/μs, and has a high output load drive of ± 45 mA. A set of commercially available rectangular-shaped (dimensions: 4.5 × 3.5) pre-gelated, self-adhesive trans- cutaneous electrodes. The Picoscope 2000 series was used to monitor the waveforms generated by the AD9833. The device offers several triggering options, and boasts 200 MHz bandwidth, 12-bit resolution, and 128 MS memory capacity. While the Picoscope has an integrated function generator, it wasn't employed in these particular experiments. http://www.globalce.org http://globalce.org http://globalce.org J Global Clinical Engineering Vol.6 Special Issue 6: 2024 48 The other microcontroller oversees the MPU6050 tracking the magnitude of acceleration of the stimulated muscle contraction during its concentric phase. The chip is affixed to a glove consistently worn on the left palm. The maximum magnitude of acceleration generated dur- ing the concentric phase of each movement is captured and subsequently visualized in a graph to be utilized for optimization. The waveform employed is a symmetric biphasic square pulse maintaining a stable peak-to-peak voltage of 35 V. The muscle’s physical movement is assessed across varying frequencies, starting from a threshold of 10 Hz and incrementing in steps of 5 Hz up to a ceiling of 140 Hz. Then, the maximum magnitude of acceleration for each contraction is plotted against its corresponding frequency. Higher frequencies (and peak-to-peak volt- ages) stimulate more motor units, resulting in stronger muscle contractions. However, there’s a threshold beyond which no additional motor units are engaged. It’s crucial to recognize that pushing these parameters to their limits isn’t the best approach as it leads to patient’s pain and discomfort, which can hinder the rehabilitation process. Examining the magnitude of acceleration as a function of frequency and determining the peaks of that function can provide optimal values of frequency that elicit stronger movements than higher frequencies. These frequencies can later be used for a better rehabilitation session by taking patients’ pain and discomfort levels into account. RESULTS The results showcased in Figures 2, 3, and 4 are derived from the implementation of the previously described optimization algorithm on the same subject over differ- ent EMS sessions. Examination of the peaks of the maximum acceleration to frequency graph in Figure 3 reveals possible optimal frequencies at 70 Hz and at 120 Hz. In case of pain at higher frequencies, 70 Hz emerges as a more fitting re- placement of the function’s global maximum at 120 Hz. It can be characterized as an optimal value for the specific rehabilitation session as it elicits comparatively stronger contractions than higher frequencies. FIGURE 2. Normalized Maximum Acceleration against frequency at a voltage differential of 35 V (session A). Upon analyzing the peaks in the maximum acceleration to frequency graph in Figure 4, potential optimal frequen- cies at 60 Hz, 80 Hz, 125 Hz, and 135 Hz are identified. Should higher frequencies induce pain, 60 Hz becomes the preferred choice. Conversely, 125 Hz can be utilized as optimal frequency adhering to the same logic. FIGURE 3. Normalized Maximum Acceleration of the electri- cally stimulated muscle against frequency at a voltage of 35 V (session B). Following the same reasoning and after analyzing the graph in Figure 4, potential optimal frequencies are identified at 50 Hz, 90 Hz, 110 Hz, 120 Hz, and 135 Hz. http://www.globalce.org http://globalce.org http://globalce.org 49 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 intramuscular electrolyte concentration, adaptive re- sponses to stimuli, alterations in strength and coordination, and fat percentage in the adjacent area, among others. This underscores the necessity for an automated, short calibration process which computes the optimal value for frequency, voltage, and other EMS parameters at the beginning of each EMS session. Another challenge stemming from the variability of responses to EMS across sessions is the ability to com- pare results both between subjects and across sessions. One potential solution is to highlight deviations from the mean response at varying frequencies by normalizing the y-axis of the graphs in units of standard deviation. In certain instances, determining an optimal frequency using this method may be challenging, especially if the data does not exhibit distinct local maxima. We expect this issue to be addressed by considering more parameters for optimization and by integrating Machine Learning techniques into our approach. DISCUSSION It should be highlighted that all results are preliminary. Experimentation with more subjects is required in order to draw more definitive conclusions. All necessary steps were taken to ensure compliance with the General Data Protection Regulation and appli- cable national law. Any future development of products for commercial or other use stemming from this research will be governed by and will have to adhere to Regulation (EU) 2017/745 on medical devices and the General safety and performance requirements it establishes. CONCLUSION AND FUTURE WORK The results seem promising although preliminary. Both conventional and AI-facilitated optimization methods demonstrate the potential to mitigate discomfort and muscle fatigue experienced during FES sessions and multiple optimization methods should be explored and compared. By addressing these challenges, FES will become usable outside of clinical trials as a tool for daily tasks, FIGURE 4. Maximum Acceleration against frequency at a volt- age of 35 V (session C). Considering the data as depicted in the graphs above, it becomes evident that the optimal value for frequency, as well as other parameters, as mentioned in the literature, is not only subject but also session-specific. Sensitivity to EMS stimulation, each subject’s perception of pain at different frequencies, and the muscle’s response vary between sessions. This is apparent both when examining optimal frequencies as well as when comparing the mean value and standard deviation of maximum acceleration for each session. Results are summarized in Table 1. TABLE 1. Session Mean Max Acceleration Std Deviation A 19.59m/s^2 2.15m/s^2 B 17.91m/s^2 3.02m/s^2 C 18.88m/s^2 2.48m/s^2 We interpret higher average maximum acceleration in session A as higher sensitivity to EMS for that particular session. The higher value of Standard Deviation in session B shows a higher sensitivity in frequency fluctuations, again for that particular session. The variation in values may depend on various factors, including skin cleanliness, http://www.globalce.org http://globalce.org http://globalce.org J Global Clinical Engineering Vol.6 Special Issue 6: 2024 50 improving quality of life. Additionally, the rehabilitation process can reap significant benefits, paving the way for a swifter and pain-free recovery. In our future work, we plan to increase our number of subjects. We aim to incorporate Machine Learning Techniques into our Expert System AI, add an electrode array to our setup, and study different electrode activation patterns, positions, and parameter settings. REFERENCES 1. Karamian, B.A., Siegel, N., Nourie, B., et al. The role of electrical stimulation for rehabilitation and regeneration after spinal cord injury. J Orthop Traumatol. 2022;23(1):2. https://doi.org/10.1186/s10195-021-00623-6. 2. Milosevic, M., Marquez-Chin, C., Masani, K., et al. Why brain-controlled neuroprosthetics matter: mechanisms underlying electrical stimulation of muscles and nerves in rehabilitation. BioMed Eng OnLine. 2020;19:81. https://doi.org/10.1186/s12938-020-00824-w. 3. Christiansen, L. and Siebner, H.R. Tools to explore neuroplasticity in humans: Combining interventional neurophysiology with functional and structural mag- netic resonance imaging and spectroscopy. Handb Clin Neurol. 2022;184:105–119. https://doi.org/10.1016/ B978-0-12-819410-2.00032-1. 4. Jo, H.J., Kizziar, E., Sangari, S., et al. Multisite Hebbian Plasticity Restores Function in Humans with Spinal Cord Injury. Ann Neurol. 2023;93(6):1198–1213. https://doi.org/10.1002/ana.26622. http://www.globalce.org http://globalce.org http://globalce.org https://doi.org/10.1186/s10195-021-00623-6 https://doi.org/10.1186/s12938-020-00824-w https://doi.org/10.1016/B978-0-12-819410-2.00032-1 https://doi.org/10.1016/B978-0-12-819410-2.00032-1 https://doi.org/10.1002/ana.26622 Editor’s Corner Biomedical Technology and Clinical Engineering in Greece after the Pandemic: Highlighted Works from the Panhellenic Conference of Biomedical Technology Aris Dermitzakis1,2,*, Vasiliki Zilidou1,3, Eleftheria Vellidou1,4, Alkinoos Athanasiou1,3 Digital Transformation Management in Health Services: Health Professionals Perceptions as an Implementation Factor Theodoros S. Tanis*, Chryssoula Chatzigeorgiou, Ioanna Simeli, and Evangelia Stalika Validating the ID-GAMING e-Training Toolkit for People with Intellectual Disabilities in Greece Niki Pandria*, Anastasia Barboudi, Vasileia Petronikolou, Panagiotis Antoniou and Panagiotis D. Bamidis Novel Functional Electrical Stimulation Parameter Optimization for Neurorehabilitation Using Both Conventional and AI Techniques Arsenios Arsenidis1, Alexandros Moraitopoulos2, Alkinoos Athanasiou2, Alexandros Vildiridis3, Panagiotis Bamidis2, Petros Stefaneas4 and Alexandros Astaras5 Leveraging Web Scraping and API Integration for Efficient Medical Device Data Management Agapi Konstantina Liontou1,*, Spilios Zisimopoulos2 and Aris Dermitzakis1 Human Muscle State Machine Using Electromyography Classification with Machine Learning George Lyssas1,*, Konstantinos Mitsopoulos1, Dimitris Zantzas2, Anestis Kalfas2, Panagiotis D. Bamidis1 Kinematic and Dynamic Analysis of Lower Limb Movement: Towards the Design of a Wearable Rehabilitation Assistant Device Filippos Margaritis1,*, Konstantinos Mitsopoulos1, Kostas Nizamis2, Alkinoos Athanasiou1 and Panagiotis D. Bamidis1 A Novel Dermatological Diagnosis Support Device Based on Electrical Impedance Spectroscopy Alexandros Moraitopoulos1,*, Konstantinos Mitsopoulos1, Christina Kemanetzi2, Panagiotis Bamidis1 and Alexandros Astaras3 Software Skills Identification: A Multi-Class Classification on Source Code Using Machine Learning Dimitris Bamidis, Ilias Kalouptsoglou, Apostolos Ampatzoglou, Alexandros Chatzigeorgiou* Improvement of Aortic Valve Stenosis Classification in Patients Through Computational Fluid Dynamics Model Ioannis Makropoulos, Dimitris Zantzas, Vasilis Gkoutzamanis, Anestis Kalfas* Kinematic and Dynamic Analysis of the Human Hand’s Articulation for Wearable Soft-Robotic Device Applications Paschalina-Danai Sarra, Vasiliki Fiska, Konstantinos Mitsopoulos, Diamanto Mylopoulou, and Panagiotis D. Bamidis* Deep Learning Classification of Epileptic Magnetoencephalogram Andreas Stylianou1, Lefteris Koumakis2, Maria Hadjinicolaou3, Adam Adamopoulos1,* and Alkinoos Athanasiou4