Multimodal engagement estimation in paediatric robot-assisted gait training: integrating physiological sensing and biomechanical interaction Authors: Elena Campilii, Francesco Romano, David Perpetuini, Lorenzo Mancini, Teresa Paolucci, Emanuele Francesco Russo, Maria Teresa Gatta, Marta Di Nicola, Giovanni Morone, Irene Ciancarelli, Antimo Moretti, Francesca Gimigliano, Sara Moccia, Arcangelo Merla, Daniela Cardone Published: 2026 ABSTRACT BackgroundPatients’ engagement plays a crucial role in the effectiveness of robot-assisted gait training (RAGT), particularly in paediatric neurorehabilitation, where motivation and active participation strongly influence functional outcomes. Despite its clinical relevance, engagement assessment is still largely based on subjective observation, limiting objectivity and scalability. Objective modelling of engagement in children with cerebral palsy remains underexplored, especially when relying on physiological signals acquired during therapy, due to logistical, ethical, and technological challenges that constrain multimodal data collection and cohort sizes. This study proposes a novel multimodal framework to automatically estimate engagement in a paediatric cerebral palsy population undergoing RAGT, capturing clinically relevant variability across patients.MethodsA cohort of 20 paediatric patients with cerebral palsy undergoing RAGT with the Hocoma Lokomat® system was monitored across multiple therapy sessions. Heart rate variability (HRV), facial infrared thermography (IRT), and exoskeleton-derived biomechanical features were acquired to capture complementary physiological and behavioural responses related to engagement. Signals were segmented into time windows and processed to extract statistical, spectral, and complexity features. Engagement was annotated by an expert clinician using a three-class scale (not engaged, neutral, engaged). A supervised multiclass machine-learning framework was then developed to estimate engagement from multimodal data, evaluating several ensemble-based classifiers under strict training–testing separation with repeated stratified splits and class-weighted learning to tackle class imbalance.ResultsThe combination of multimodal features with the Extra Trees classifier achieved the best performance, with a macro-F1 score of 0.658 ± 0.027. Class-wise analysis showed higher performance for extreme engagement levels (not engaged and engaged), with most misclassifications occurring between adjacent classes, particularly involving the neutral state. Feature selection and explainability analyses identified exoskeleton-derived torque features as the most influential predictors, with thermal and HRV features providing complementary autonomic and emotional information.ConclusionsThis study presents a novel multimodal machine learning approach for automatic engagement estimation during RAGT in children with cerebral palsy. Beyond classification performance, it demonstrates the feasibility of objective engagement modelling in a complex clinical population by integrating physiological and robotic interaction data. The results highlight the potential of multimodal sensing to support adaptive rehabilitation systems for continuous monitoring and personalized human–robot interaction. Introduction Cerebral palsy (CP) is a lifelong, non-progressive neurological disorder that originates from insults occurring before, during, or shortly after birth. Its underlying causes include prenatal factors, often unidentified, as well as perinatal complications such as birth asphyxia and postnatal events like intracranial haemorrhage or trauma [1]. Children with CP commonly present motor and cognitive impairments, including muscle weakness, spasticity, postural instability, reduced gait velocity, and poor endurance, all of which profoundly affect daily functioning and overall quality of life. Rehabilitation in children with CP is primarily aimed at preserving and improving functional abilities, preventing secondary musculoskeletal complications, supporting motor development, and promoting autonomy and participation in daily life. For many years, rehabilitative interventions in CP have mainly focused on limiting the consequences of motor impairment, preventing secondary complications, and reducing the risk of functional deterioration over time. This perspective has progressively evolved toward more active, intensive, and task-oriented approaches, designed not only to preserve existing abilities but also to promote motor learning, functional independence, and participation. Within this evolving rehabilitation framework, technologies capable of delivering repetitive, intensive, and task-specific training have gained increasing attention as complementary tools in paediatric neurorehabilitation. Among these, robotic-assisted gait training (RAGT) has emerged as a technological adjunct to conventional therapy, providing controlled and adjustable locomotor practice and enabling clinicians to tailor training parameters to the child’s functional abilities and therapeutic goals [2]. Several studies have reported that RAGT may support gait-related rehabilitation outcomes in individuals with neurological impairments, particularly by enabling intensive, repetitive, and task-specific locomotor practice under controlled conditions [3]. One proposed neurophysiological rationale is the stimulation of central pattern generators (CPGs), spinal networks involved in rhythmic locomotor activity, which may be activated through passive or guided limb mobilization[4] [5]. RAGT has been applied across multiple clinical populations, including stroke, spinal cord injury, multiple sclerosis, and paediatric CP, yielding measurable improvements in gait quality, balance, and mobility [6–10]. However, robot-guided movement should not be assumed to correspond automatically to physiological or clinically beneficial motor adaptation, as robotic assistance may modify movement execution and muscle activation patterns even in healthy subjects [11, 12]. Therefore, RAGT-related motor adaptations should be interpreted in relation to the individual patient’s functional profile, the specific device constraints, and the therapeutic goals. Among available technologies, exoskeleton-based systems such as the Lokomat® are widely used in paediatric neurorehabilitation and allow intensive, repetitive, and adjustable gait training within a controlled therapeutic environment [13]. In addition to biomechanical performance, patients’ engagement and emotional involvement play a decisive role in the overall effectiveness of rehabilitation. Engagement encompasses behavioural and psychological dimensions, including willingness to participate, motivation, and consistency in adhering to the therapeutic pathway [14, 15]. More precisely, the use of these specific terms has different shades of meaning: motivation reflects an internal psychological construct, engagement is linked to an observable behavioural expression during task performance, and participation as the broader functional outcome reflecting involvement in meaningful activities [16]. Greater engagement is typically associated with better emotional states, reduced negative affect, and enhanced perseverance during therapy [17]. Monitoring engagement in real time is therefore essential to optimize the personalization of treatment and to detect moments in which the patient becomes less cooperative. In paediatric rehabilitation, maintaining engagement is particularly challenging because therapeutic exercises are often repetitive, physically demanding, and prolonged over time. This challenge is further amplified in children with CP, whose heterogeneous motor impairment, spasticity, fatigue, possible discomfort, and variable cognitive–communicative abilities may make overt behavioural signs of engagement difficult to interpret through observation alone. To address this issue, several technology-assisted strategies have been introduced to enrich conventional rehabilitation settings and increase the level of stimulation provided to the patient. These include robotic devices [18], augmented feedback [19], virtual reality environments [20], serious games [21] and interactive task-oriented platforms [22], all of which aim to sustain attention, motivation, and active participation during therapy. However, the effectiveness of these strategies may vary substantially across patients and sessions, making objective engagement monitoring particularly relevant for adapting therapeutic tasks to the child’s actual psychophysiological state. Computational physiology offers non-invasive tools capable of providing continuous estimates of engagement by tracking autonomic nervous system (ANS) activity. Beyond behavioural observation and self-report measures, increasing attention has been devoted to the use of physiological signals for the objective assessment of user engagement. Engagement is known to manifest through coordinated autonomic and neuromuscular responses, reflecting variations in cognitive effort, emotional involvement, and sustained attention [23]. Accordingly, several studies have investigated the use of physiological markers to infer engagement-related states across a wide range of task conditions [24]. Complexity-based metrics, including entropy measures, have proven especially sensitive to subtle changes in physiological dynamics, supporting their use as proxies for internal states that are not directly observable [25]. Within this methodological framework, previous works have shown that physiological signals when analysed through non-linear and machine learning (ML) approaches, can effectively encode relevant information about the subject’s functional condition, providing a solid basis for the extension of these methods toward the continuous estimation of engagement [26]. Among the most informative markers, heart rate variability (HRV) and infrared thermography (IRT) offer complementary insights into sympathetic–parasympathetic balance. HRV quantifies beat-to-beat fluctuations in heart activity and represents a widely validated indicator of emotional and physiological regulation [27–29]. IRT, by measuring subtle temperature variations across facial regions, captures autonomic-driven vasomotor dynamics associated with stress, motivation, and attentional states [30, 31]. Taken together, these physiological signals support the development of adaptive human–robot interaction models in which training intensity may be dynamically modulated according to the child’s real-time autonomic responses. The objective estimation of engagement requires computational methods capable of modelling complex and potentially nonlinear relationships between physiological signals and clinically observed behavioural states. In this context, machine learning (ML) provides a suitable framework for learning data-driven associations and performing prediction or classification tasks on unseen observations. Accordingly, this study adopted a supervised feature-engineering-based ML pipeline, in which informative descriptors are explicitly extracted from the acquired signals before model training. This differs from deep learning pipelines, where discriminative representations are typically learned automatically from raw or minimally processed data within the model architecture. Such a feature-based strategy is particularly suitable for clinical studies involving relatively small and heterogeneous cohorts, as it preserves the physiological interpretability of the predictors and reduces the need for large-scale training datasets. In rehabilitation research, ML approaches have been increasingly explored to infer engagement-related states from physiological signals, with the aim of providing more objective alternatives to purely observational or self-report assessments [26, 32]. Previous work has shown that autonomic nervous system responses, analysed through ML classifiers, can be used to estimate engagement during rehabilitation tasks, supporting the feasibility of physiological signal-based engagement assessment [33]. However, most available studies have been conducted in different populations or rehabilitation settings, and automatic engagement estimation during paediatric RAGT remains underexplored, particularly when integrating autonomic physiological signals with robotic interaction measures acquired during Lokomat® therapy sessions. In this context, the clinical translation of ML-based engagement estimation requires not only predictive performance, but also interpretable information on the factors driving model decisions. Explainable artificial intelligence (XAI) provides methods to increase model transparency by identifying the variables that most contribute to predictions, allowing the role of autonomic, thermal, and patient–robot interaction features to be examined in relation to their physiological and biomechanical meaning. Within the current state of the art, only a limited number of studies have directly investigated engagement during robot-assisted gait training. Di Tommaso et al. evaluated engagement in an adult population with spinal cord injury undergoing Lokomat® training under different feedback conditions. However, engagement was operationalized exclusively through the analysis of interaction forces between the patient and the robotic device, thus providing a partial representation of this multifaceted construct. Notably, the authors emphasized the critical role of augmented feedback in modulating and potentially enhancing patients’ engagement during therapy [34]. Similarly, Chiappini et al. explored the emotional and cognitive experiences of 42 children and adolescents undergoing Lokomat-based rehabilitation. Their findings suggested that higher levels of cognitive engagement and improved emotional regulation were associated with behavioural profiles characterized by increased confidence, calmness and cooperation [35]. Building on this multimodal physiological framework, the present work focuses on the development of a patient-centred, feature-engineering-based ML model aimed at automatically estimating patients’ engagement during paediatric RAGT. Physiological signals, including HRV and IRT, acquired during Lokomat® sessions were processed to extract a comprehensive set of features capturing autonomic and thermoregulatory dynamics. Engagement was annotated by a trained operator who observed each child throughout the rehabilitation sessions and assigned qualitative ratings on a three-level scale (0 = non-cooperative, 1 = neutral, 2 = actively engaged) at three-minute intervals. These labelled datasets were used to train and evaluate several ML classifiers, with the objective of predicting the child’s engagement level directly from engineered multimodal features extracted from physiological and biomechanical signals. This approach was conceived to address the specific challenges of engagement monitoring in paediatric CP during RAGT, where heterogeneous motor abilities and complex patient–robot interactions make participation difficult to quantify objectively. By integrating physiological and robotic interaction data, the proposed framework may support time-resolved, data-driven monitoring of engagement in this clinical setting and providing a methodological basis for future adaptation to other technology-assisted rehabilitation contexts. The remainder of the paper is organized as follows. Sect. "Methods" details the study population, robotic rehabilitation protocol, multimodal data acquisition, feature extraction, engagement annotation, and machine learning pipeline. Sect. "Results" presents the classification performance, feature selection results, and explainability analyses. Sect. "Discussion" discusses the findings in relation to clinical relevance, methodological limitations, and future perspectives. Finally, Sect. "Conclusions" summarizes the main conclusions of the study. Methods Participants This study leverages a multimodal dataset designed for the quantitative assessment of patients’ participation and engagement during RAGT sessions conducted using the Lokomat® exoskeleton system (Fig. 1). The dataset was collected within a structured rehabilitation program and initially included 22 paediatric patients diagnosed with CP. During the protocol, two participants withdrew, resulting in a final study cohort of 20 patients (12 males and 8 females; age = 9.6 ± 3.8 years]). The enrolled population was characterized by a high degree of clinical heterogeneity, encompassing different motor impairment patterns, including tetraplegia, diplegia, and hemiplegia (both right- and left-sided). The spastic subtype was predominant, with one patient presenting dyskinetic CP. Functional impairment was assessed using the Gross Motor Function Classification System (GMFCS) [36], with participants spanning all five levels of severity (levels I–V), as shown in Fig. 2. In the final cohort of 20 patients, the distribution across GMFCS levels was as follows: 1 patient at level I, 4 patients at level II, 2 patients at level III, 4 patients at level IV, and 9 patients at level V. This wide distribution allowed the inclusion of subjects with markedly different residual motor abilities, ranging from mild to severe impairment. Such clinical and functional variability makes the dataset highly representative of the paediatric CP population and provides a suitable basis for investigating rehabilitative engagement across a broad spectrum of motor conditions and interaction modalities with the robotic system.Fig. 1Example of a Robot-Assisted Gait Training session performed with the Lokomat® systemFig. 2GMFCS level distribution for each patient included in the study Example of a Robot-Assisted Gait Training session performed with the Lokomat® system GMFCS level distribution for each patient included in the study Robotic platform and rehabilitation protocol RAGT was performed using the Lokomat® system (Hocoma AG, Volketswil, Switzerland), an exoskeleton-based robotic gait orthosis widely employed in paediatric neurorehabilitation [13]. Robotic systems for gait rehabilitation are typically categorized into end-effector devices and exoskeleton-based platforms; among the latter, the Lokomat® combines a body-weight support system, a treadmill, and programmable robotic drives at the hip and knee joints [37]. The system guides lower-limb movements according to predefined physiological gait trajectories and allows clinicians to adjust training parameters, including body-weight support, treadmill speed, guidance force, and task difficulty, according to the child’s functional abilities and therapeutic goals. Training sessions were implemented through the Augmented Performance Feedback (APF) module of the Lokomat® system. The APF module provides interactive visual feedback during gait training with the aim of promoting attention, motivation, and active participation in the rehabilitation task. APF exercises were not predefined across all participants but were selected and adapted by the clinical team according to each patient’s needs, abilities, and therapeutic objectives, in line with routine clinical practice. During training, the Lokomat® system records biomechanical variables related to patient–robot interaction, most notably joint torque at the hip and knee joints. In the present study, joint torque signals from both lower limbs were exported from the Recorded Signals module of Lokocontrol V6.5 at a sampling frequency of 250 Hz. According to the manufacturer’s documentation, joint torque represents the current torque acting on the corresponding Lokomat joint, calculated from force and position sensors in the drives. These signals provide information on the mechanical exchange between the patient and the robot and were used to derive biomechanical features summarizing the cumulative magnitude of patient–robot interaction during each analysis window. In this context, torque-derived measures were considered indirect indicators of motor involvement during RAGT, since variations in interaction torque may reflect differences in robotic assistance, the patients’ contribution, spasticity, or cooperation with the guided movement [38]. Data acquisition For each patient, three longitudinal acquisitions were performed within one month, referred to as T0, T1, and T2, corresponding to the first (RAGT1), sixth (RAGT6), and twelfth (RAGT12) sessions of the rehabilitation protocol, respectively. According to the rehabilitation schedule, approximately two weeks elapsed between T0 and T1 and between T1 and T2, with the complete acquisition protocol being completed within approximately one month. The timing of the acquisition sessions was defined to follow the routine clinical RAGT schedule adopted at the rehabilitation centre, thereby avoiding modifications to the standard therapeutic pathway. These three time points were selected to characterize early, intermediate, and final phases of the rehabilitation cycle, allowing longitudinal monitoring of physiological, biomechanical, and behavioural responses throughout the therapeutic pathway. This schedule was consistent with paediatric RAGT protocols reported in the literature, which are characterized by heterogeneous treatment durations and frequencies but commonly include repeated sessions distributed over approximately 3–5 weeks [39, 40]. At each acquisition time point, physiological and biomechanical signals were recorded during the Lokomat® session. This longitudinal design was adopted to assess therapy-induced physiological and behavioural changes over time. The multimodal acquisition strategy was clinically motivated by the need to account for both autonomic responses and patient–robot interaction, which may vary according to the child’s functional and physiological profile in paediatric CP rehabilitation [15, 41]. Each recorded Lokomat® walking trial lasted approximately 30 min, with minor variations depending on the patient’s tolerance and clinical needs. The analysed recording included the walking phase from the beginning to the end of the Lokomat® trial, whereas setup procedures and patient positioning were not included. HRV was continuously monitored throughout the RAGT sessions using a Garmin Vivosmart 5® smartwatch, based on photoplethysmography (PPG) technology, to assess autonomic nervous system activity and sympathetic–parasympathetic dynamics associated with physical effort and engagement state. In parallel, facial IRT was employed to capture information related to peripheral autonomic responses and the patient’s emotional state. Thermal images were acquired using a FLIR A400® digital camera (FLIR, Wilsonville, OR, USA), equipped with an uncooled microbolometer with a spatial resolution of 320 × 240 pixels, a thermal sensitivity of 30 mK, and a field of view of 42°, operating at a sampling rate of 10 Hz. The camera was positioned at an approximate distance of 150 cm from the patient’s face and oriented to frame the entire facial region. To ensure the reliability and reproducibility of thermal measurements, each participant entered the rehabilitation environment 15 min prior to data acquisition, allowing for cutaneous temperature stabilization under controlled environmental conditions. Room temperature was maintained at a constant 23 °C throughout all recording sessions. Finally, kinematic and robotic data from the Lokomat® system were acquired in parallel, providing quantitative measures of patient–robot mechanical interaction and active motor contribution during assisted gait. Multimodal synchronization was performed offline by a dedicated operator using the common timestamps associated with the HRV, IRT/RGB, and Lokomat® recordings, to ensure temporal alignment across physiological, thermal, and robotic-derived signals. The synchronized acquisition of these multimodal signals enabled a comprehensive characterization of the patient’s physiological and behavioural state during rehabilitation, forming the basis for subsequent feature extraction and ML–based analysis. Data extraction The raw signals acquired during the Robot-Assisted Gait Training sessions were processed using a standardized feature extraction pipeline, aimed at enabling a multimodal assessment of the physiological and motor responses associated with the patient’s participation state. After multimodal synchronization, all signals were segmented into consecutive, non-overlapping 30-s windows. No overlap was applied between adjacent windows, and no specific portions of the recordings were excluded. Lokomat® signals were acquired after device calibration and patient setup; therefore, calibration, positioning, and preparation phases were not included in the analysed data. Within each window, a structured and homogeneous set of descriptive numerical features was computed, designed to capture statistical, temporal, and physiological characteristics relevant to the objectives of the study. For HRV, standard time- and frequency-domain features commonly employed to assess autonomic nervous system activity were extracted. Specifically, mean RR, representing the average duration of inter-beat intervals, SDNN, reflecting overall heart rate variability, and RMSSD, which is sensitive to short-term variations predominantly mediated by parasympathetic activity, were computed. In addition, spectral features were derived, including low-frequency (LF) power, high-frequency (HF) power, and the LF/HF ratio, which is commonly interpreted as an index of sympatho–vagal balance (Table 1). Facial IRT analysis was performed on five regions of interest (ROIs): nose, nostrils, chin, perioral area, and corrugator region. To ensure accurate and consistent ROI positioning over time, an RGB camera was simultaneously used during data acquisition to record the patient’s face. These videos were subsequently processed using the OpenFace software for automatic detection of facial landmarks [42]. Since RGB and thermal images were acquired from two distinct optical sensors, a spatial co-registration between the visible and thermal views was first performed. For this purpose, a set of corresponding calibration points was selected on a representative RGB–thermal frame pair and used to estimate an affine geometrical transformation between the two image planes. This transformation was independent of the facial landmarks used for ROI tracking. Let \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\widetilde{{\boldsymbol{p}}}}_{T}= {[{x}_{T}, {y}_{T}, 1]}^{T}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\widetilde{{\boldsymbol{p}}}}_{V}= {[{x}_{V}, {y}_{V}, 1]}^{T}$$\end{document} denote the homogeneous coordinates of a point in the thermal and visible image planes, respectively. The affine transformation from the thermal to the visible image plane was define as:1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\widetilde{{\boldsymbol{p}}}}_{V}= {{\boldsymbol{T}}}_{T\to V}{\widetilde{{\boldsymbol{p}}}}_{T}$$\end{document}where:Table 1Summary, mathematical definition, and interpretation of the features extracted from IRT, HRV and torque signalsDomainFeatureMathematical definitionInterpretationHRVMean RR\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}R{R}_{i}$$\end{document}Mean duration of consecutive RR intervalsHRVSDNN\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}{(R{R}_{i}-\overline{RR })}^{2}}$$\end{document}Overall variability of RR intervalsHRVRMSSD\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N-1}{(R{R}_{i+1}-R{R}_{i})}^{2}}$$\end{document}Short-term beat-to-beat variability, mainly related to parasympathetic modulationHRV/IRTLF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} mean\left( {PSD\left( f \right)} \right), \hfill \\ 0.03 \le f \le 0.15Hz \hfill \\ \end{gathered} $$\end{document}Mean spectral power in the low-frequency bandHRV/IRTHF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} mean\left( {PSD\left( f \right)} \right), \hfill \\ 0.15 \le f \le 0.35Hz \hfill \\ \end{gathered} $$\end{document}Mean spectral power in the high-frequency bandHRV/IRTLF/HF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{LF}{HF}$$\end{document}Ratio between low- and high-frequency spectral componentsIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{mean}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}{T}_{i}$$\end{document}Mean temperature of the facial ROI over the analysis windowIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{std}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}{({T}_{i}-\overline{T })}^{2}}$$\end{document}Temperature variability within the facial ROIIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{skew}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}(\frac{{T}_{i}-\overline{T}}{\sigma T }{\left(\frac{{T}_{i}-\overline{T}}{\sigma T }\right)}^{3}$$\end{document}Asymmetry of the temperature distribution within the ROIIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{kurt}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}(\frac{{T}_{i}-\overline{T}}{\sigma T }{\left(\frac{{T}_{i}-\overline{T}}{\sigma T }\right)}^{4}$$\end{document}Peakedness/heaviness of the temperature distribution within the ROIIRTSampEn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} {\mathrm{ln}}\left( {\frac{{B_{m} (r)}}{{A_{{m + 1}} (r)}}} \right), \hfill \\ m = 2,r = 0.2 \cdot SD, \hfill \\ \end{gathered} $$\end{document} Temporal irregularity and complexity of the ROI thermal signalEXOHipLeft_AUC, HipRight_AUC, KneeLeft_AUC, KneeRight_AUC\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\int}_{{t}_{0}}^{{t}_{1}}\left|{\tau}_{j}(t)\right|dt$$\end{document}Cumulative measure of patient–robot mechanical interaction2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\boldsymbol{T}}}_{T\to V}=\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {b}_{x}\\ {a}_{21}& {a}_{22}& {b}_{y}\\ 0& 0& 1\end{array}\right]$$\end{document} Table 1Summary, mathematical definition, and interpretation of the features extracted from IRT, HRV and torque signalsDomainFeatureMathematical definitionInterpretationHRVMean RR\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}R{R}_{i}$$\end{document}Mean duration of consecutive RR intervalsHRVSDNN\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}{(R{R}_{i}-\overline{RR })}^{2}}$$\end{document}Overall variability of RR intervalsHRVRMSSD\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N-1}{(R{R}_{i+1}-R{R}_{i})}^{2}}$$\end{document}Short-term beat-to-beat variability, mainly related to parasympathetic modulationHRV/IRTLF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} mean\left( {PSD\left( f \right)} \right), \hfill \\ 0.03 \le f \le 0.15Hz \hfill \\ \end{gathered} $$\end{document}Mean spectral power in the low-frequency bandHRV/IRTHF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} mean\left( {PSD\left( f \right)} \right), \hfill \\ 0.15 \le f \le 0.35Hz \hfill \\ \end{gathered} $$\end{document}Mean spectral power in the high-frequency bandHRV/IRTLF/HF\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{LF}{HF}$$\end{document}Ratio between low- and high-frequency spectral componentsIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{mean}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}{T}_{i}$$\end{document}Mean temperature of the facial ROI over the analysis windowIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{std}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}{({T}_{i}-\overline{T })}^{2}}$$\end{document}Temperature variability within the facial ROIIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{skew}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}(\frac{{T}_{i}-\overline{T}}{\sigma T }{\left(\frac{{T}_{i}-\overline{T}}{\sigma T }\right)}^{3}$$\end{document}Asymmetry of the temperature distribution within the ROIIRT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${T}_{kurt}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{N}\sum_{i=1}^{N}(\frac{{T}_{i}-\overline{T}}{\sigma T }{\left(\frac{{T}_{i}-\overline{T}}{\sigma T }\right)}^{4}$$\end{document}Peakedness/heaviness of the temperature distribution within the ROIIRTSampEn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \begin{gathered} {\mathrm{ln}}\left( {\frac{{B_{m} (r)}}{{A_{{m + 1}} (r)}}} \right), \hfill \\ m = 2,r = 0.2 \cdot SD, \hfill \\ \end{gathered} $$\end{document} Temporal irregularity and complexity of the ROI thermal signalEXOHipLeft_AUC, HipRight_AUC, KneeLeft_AUC, KneeRight_AUC\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\int}_{{t}_{0}}^{{t}_{1}}\left|{\tau}_{j}(t)\right|dt$$\end{document}Cumulative measure of patient–robot mechanical interaction Summary, mathematical definition, and interpretation of the features extracted from IRT, HRV and torque signals Therefore, for each landmark detected in the visible frame at time t, the corresponding thermal coordinates were obtained by applying the inverse affine transformation:3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\widetilde{{\boldsymbol{p}}}}_{T}(t)= {{{\boldsymbol{T}}}^{-1}}_{T\to V}{\widetilde{{\boldsymbol{p}}}}_{V}(t)$$\end{document} For each thermal frame, the temporally corresponding visible frame was identified by minimizing the absolute time difference between the RGB and thermal time vectors. The mapped thermal landmarks were then used to initialize and dynamically update the facial ROIs. Circular ROIs with a fixed diameter of 9 pixels were centred on selected thermal landmarks for the nose, right nostril, and left nostril regions, whereas the chin ROI was centred on the midpoint between the corresponding chin and lower-lip landmarks. Polygonal ROIs were defined for the perioral and corrugator regions using the corresponding landmark contours (Fig. 3). Specifically, the nose, right nostril, and left nostril ROIs were centred on landmarks 31, 33, and 35, respectively; the chin ROI was centred on the midpoint between landmarks 9 and 58; the perioral ROI was defined using landmarks 32–36 and 49–55; and the corrugator ROI using landmarks 22–23 and 28. Thermal features were extracted separately from the right and left nostril ROIs and subsequently averaged feature-wise, yielding a single nostril-related feature set used in the machine-learning analysis. Importantly, this procedure was used only for landmark and ROI coordinate transfer; no pixel-wise warping or deformation of the thermal frames was applied for feature extraction. From each ROI, several features were extracted to characterize both the statistical dynamics and autonomic modulation of the thermal signals. These included mean temperature (T_mean), indicating overall thermal level; standard deviation (T_std), as a measure of local variability; skewness (T_skew) and kurtosis (T_kurt), describing the shape of the temperature distribution; and sample entropy (SampEn), used as an index of temporal complexity and irregularity. Furthermore, to investigate autonomic components of the thermal response, frequency-domain features were computed, including LF and HF components and the LF/HF ratio (Table 1). In addition to physiological signals, kinematic information was extracted from the torque signals provided by the Lokomat ®. Before feature extraction, torque signals were pre-processed by applying a second-order polynomial detrending procedure to remove slow-varying offsets, followed by fourth-order low-pass filtering with a cut-off frequency of 8 Hz. For each window, the absolute value of each joint torque signal was numerically integrated using the trapezoidal rule:4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${AUC}_{j}={\int}_{{t}_{0}}^{{t}_{1}}\left|{\tau}_{j}(t)\right|dt$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\tau}_{j}(t)$$\end{document} is the joint torque signal for joint j, with j corresponding to left hip, right hip, left knee, or right knee, and [\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${t}_{0},{t}_{1}$$\end{document}] denotes the 30-s analysis window.Fig. 3Facial infrared thermography and corresponding RGB image used for region-of-interest (ROI) definition and tracking. Left: thermal image highlighting the selected facial ROIs (nose, nostrils, chin, perioral area, and corrugator region). Right: RGB image processed for automatic facial landmark detection, used to dynamically align thermal ROIs during data acquisition Facial infrared thermography and corresponding RGB image used for region-of-interest (ROI) definition and tracking. Left: thermal image highlighting the selected facial ROIs (nose, nostrils, chin, perioral area, and corrugator region). Right: RGB image processed for automatic facial landmark detection, used to dynamically align thermal ROIs during data acquisition The resulting features, namely HipLeft_AUC, HipRight_AUC, KneeLeft_AUC, and KneeRight_AUC, quantify the cumulative magnitude of patient–robot mechanical interaction at each joint over time, independently of the flexion/extension sign (Table 1). The use of integrated joint-torque measures is also consistent with previous Lokomat-based biofeedback approaches, in which torque-related quantities were integrated over gait phases to obtain robust summary indicators of patient’s activity and interaction with the robotic device [43]. These features provide an indirect estimate of the mechanical assistance delivered by the device and, consequently, of the patient’s active motor contribution during gait training. The complete set of features extracted from the four considered domains provided a multidimensional and multimodal representation of the patient’s physiological and motor state during rehabilitation. This compact yet informative representation constituted the basis for training supervised ML models aimed at the automatic estimation of patients’ participation levels. Engagement evaluation Engagement labels were assigned by an expert clinician (at least five clinical years of experience with paediatric Lokomat®) based on direct observation during the Lokomat® rehabilitation sessions. To minimize interference with routine clinical practice and avoid excessively frequent evaluations during therapy, the annotation procedure was performed over consecutive 3-min observation windows. For each window, the clinician assessed engagement by observing the degree of compliance between the motor activity required by the task and the patient’s actual task-related performance. Engagement was rated on a three-level scale: 0 (“not engaged”), when no task-consistent participation was observed; 1 (“neutral”), when participation was partial or intermittent; and 2 (“engaged”), when the patient showed continuous and task-consistent participation throughout the observation window. Given the broad GMFCS range of the cohort, engagement was not rated according to absolute motor performance, but through a clinically contextualized assessment based on each child’s functional profile and expected abilities. This choice was clinically motivated by the fact that, in children with CP, the same observable motor output may reflect different levels of effort and participation depending on functional severity, motor phenotype, spasticity, and residual voluntary control. The expert clinician considered behavioural cues such as attention to the task, responsiveness to verbal or visual stimuli, cooperation with the guided movement, tolerance of the session, and attempts to actively participate. These observed behaviours were not encoded as separate quantitative behavioural outcomes; rather, they were integrated into a clinically contextualized judgement of engagement and operationalized through the three-level scoring system described in Table 2. The resulting categorical engagement labels represented the quantitative outcome of the annotation procedure and were used as the ground truth for supervised learning. This engagement scale was designed to capture meaningful differences in the level of active involvement exhibited by the patient during RAGT, encompassing aspects such as voluntary motor contribution, responsiveness to task instructions, and overall interaction with the robotic system. Although inherently observer-dependent, this form of expert-driven annotation represents a clinically relevant reference standard, providing an interpretable and ecologically valid ground truth for supervised learning. The use of a three-level discrete scale further facilitates robustness against inter-session variability and labelling noise and remains suitable for automatic classification tasks aimed at estimating patients’ engagement. Physiological, thermal, and torque-derived features were extracted from consecutive 30-s windows to better capture short-term variability in the recorded signals. Each 30-s feature window was then associated with the engagement label assigned to the corresponding 3-min clinical observation window. This procedure allowed the supervised learning ground truth to remain grounded in expert clinical observation and preserved a finer temporal resolution for multimodal feature extraction.Table 2Behavioural criteria for engagement scoringEngagement levelClass labelObserved behavioural criteriaNot engaged0Absent task-consistent participation, poor responsiveness, and low cooperationNeutral1Intermittent participation, fluctuating attention, and variable cooperationEngaged2Continuous participation, sustained attention, and active cooperation Table 2Behavioural criteria for engagement scoringEngagement levelClass labelObserved behavioural criteriaNot engaged0Absent task-consistent participation, poor responsiveness, and low cooperationNeutral1Intermittent participation, fluctuating attention, and variable cooperationEngaged2Continuous participation, sustained attention, and active cooperation Behavioural criteria for engagement scoring Machine learning modelling and performance evaluation Feature configurations and preprocessing Based on the pre-processed dataset, a supervised multiclass classification framework was implemented to automatically estimate the patient’s engagement level during RAGT using exclusively physiological predictors. The target variable consisted of three clinically assigned engagement levels (not engaged, neutral, engaged), as described previously. Four alternative feature configurations were investigated: (i) HRV-derived features, (ii) IRT features extracted from predefined facial regions, (iii) exoskeleton-derived biomechanical features and (iv) the full multimodal configuration integrating HRV, IRT, and exoskeleton features. The dataset exhibited an imbalanced class distribution, with 602 instances belonging to class 0 (“not engaged”), 372 to class 1 (“neutral”), and 624 to class 2 (“engaged”). To mitigate potential bias toward majority classes without artificially modifying the empirical distribution of samples, a cost sensitive learning strategy based on per-sample weighting was adopted. For each training split, class-specific weights were computed according to the balanced formulation:5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{c}= \frac{N}{K\cdot {n}_{c}}$$\end{document}where N denotes the number of training samples in the current split, K is the number of classes (here K=3), and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{c}$$\end{document} represents the number of training samples belonging to class c. Each training instance i was assigned a weight \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{{y}_{i}}$$\end{document} corresponding to its class label \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${y}_{i}$$\end{document}. These weights were provided to the classifier during the optimization phase, thereby increasing the penalty associated with misclassification of minority-class samples and promoting a more balanced decision boundary. Importantly, this approach preserves the original structure and avoids the introduction of synthetic observations or random re-sampling procedures, which could distort the underlying physiological variability [44]. To assess model generalization, a repeated stratified 80/20 train–test split was adopted, ensuring that the marginal class distribution was preserved across partitions. This strategy provides an estimate of classification performance under a conventional independent and identically distributed assumption. The modelling pipeline followed a strict train-only fitting procedure within each outer split. First, the dataset was divided into training and held-out test partitions. Missing-value imputation was then fitted on the training data using the median strategy (SimpleImputer, scikit-learn Python) [45] and applied to the corresponding validation or test data. Feature ranking was performed after imputation and exclusively within the training data. Within the inner cross-validation loop, ranked features were used to identify the optimal number of retained predictors. Class weights were computed only from the training labels of each split. Feature scaling (StandardScaler, scikit-learn Python) [45] was included in the general pipeline only for scale-sensitive classifiers. Classifiers and validation strategy Three supervised ensemble classifiers were evaluated within a unified and reproducible pipeline framework implemented in Python using the scikit-learn library, namely Extra Trees [46], Random Forest [47], and Gradient Boosting [48]. These models were selected because they represent complementary tree-based ensemble strategies that can capture nonlinear decision boundaries and interactions among input features through recursive partitioning and ensemble aggregation, without requiring explicit assumptions of linearity [46–48]. Their use was further supported by previous physiological-signal-based studies on psychophysiological state and engagement prediction, including recent work on three-level engagement prediction during robot-assisted gait rehabilitation, where supervised classifiers were applied to engineered physiological features from patients with neuromotor disorders [49–51]. Based on this rationale, the three selected ensemble classifiers were compared within the same experimental framework: for each feature configuration and validation scheme, the three classifiers were trained and evaluated on identical data partitions to enable a fair and controlled comparison. For Extra Trees and Random Forest, the number of trees in the ensemble was set to 500, whereas the remaining model hyperparameters were kept at the default scikit-learn settings. For Gradient Boosting, default scikit-learn hyperparameters were used. A fixed random seed was adopted to ensure reproducibility. Classification performance was quantified on held-out test data using standard metrics for multiclass problems, including overall accuracy, balanced accuracy, and class-wise as well as macro-averaged precision, recall, and F1-score. The mathematical definitions of the classification metrics are reported in Appendix A. Confusion matrices were computed for every split to characterize the distribution of classification errors across engagement levels and to evaluate potential asymmetries in misclassification patterns. Nested feature selection To reduce model complexity, enhance interpretability, and maintain strict separation between training and test data, a nested feature selection procedure was embedded within each outer validation split. Specifically, for every outer training partition, an inner cross-validation loop was performed exclusively on the training data to identify the optimal number of retained features. Within each inner fold, features were ranked using the impurity-based feature importance scores, corresponding to Mean Decrease in Impurity (MDI). Permutation importance was used as a model-agnostic measure of feature relevance. For each trained model, the values of one feature at a time were randomly shuffled in the held-out test set, whereas all other features were left unchanged. The decrease in macro-F1 score after permutation was then computed; larger decreases indicated a stronger contribution of that feature to model performance. In this study, permutation importance was computed on the test set of each outer split using macro-F1 as the scoring metric and 20 permutation repeats. Let \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F= \left\{{f}_{1}, \dots , {f}_{P}\right\}$$\end{document} denote the full feature set of dimensionality P. The ranking procedure produced an ordered sequence \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left({f}_{(1)}, \dots , {f}_{(P)}\right)$$\end{document} according to decreasing importance scores derived from the model. For each candidate value \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$K \in \left\{1, \dots , P\right\}$$\end{document}, the classifier was trained using only the top-K ranked features and evaluated on the corresponding inner-validation fold using the macro-averaged F1-score. The optimal feature subset size was defined as6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${K}^{*}={argmax}_{k\in \left\{1,\dots ,P\right\}}{\overline{F1} }_{macro}^{inner}\left(K\right)$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\overline{F1} }_{macro}^{inner}\left(K\right)$$\end{document} denotes the mean macro-F1 score across inner folds for a given K. After identifying \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${K}^{*}$$\end{document}, features were re-ranked on the full outer-training partition, and the final model was retrained using the corresponding top-\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${K}^{*}$$\end{document} subset. The resulting model was then evaluated on the held out outer test set. Importantly, feature ranking, subset selection, class-weight computation, and model fitting were always confined to the training data of the respective split, ensuring that no information from the test partition influenced model selection. This nested procedure provided a leakage-free estimate of model performance within the adopted validation scheme and enabled dimensionality reduction and interpretability. For the best-performing model, permutation importance was additionally used as a model-agnostic measure of feature relevance. For each trained model, the values of one feature at a time were randomly shuffled in the held-out test set, whereas all other features were left unchanged. The decrease in macro-F1 score after permutation was then computed; larger decreases indicated a stronger contribution of that feature to model performance. In this study, permutation importance was computed on the test set of each outer split using macro-F1 as the scoring metric and 20 permutation repeats. Results Overall classification performance The classification performance obtained with the different feature configurations and machine learning models is summarized in Table 3. Overall, the multimodal configuration integrating HRV, facial thermal features, and exoskeleton-derived biomechanical variables achieved the highest predictive performance across all evaluated metrics. Among the evaluated classifiers, the Extra Trees algorithm provided the best results, reaching a macro-F1 score of 0.658 ± 0.027 and a balanced accuracy of 0.654 ± 0.026. In contrast, unimodal configurations showed lower predictive performance. The HRV-only configuration exhibited limited discriminative capability, with macro-F1 scores ranging between 0.453 and 0.469 depending on the classifier. The thermal configuration achieved substantially higher performance, reaching a macro-F1 score of 0.610 ± 0.027 using Extra Trees. The exoskeleton-only configuration yielded intermediate results, with a macro-F1 score of 0.586 ± 0.027 for the same classifier. These results suggest that each sensing modality captures complementary physiological and biomechanical aspects of patients' engagement during RAGT. The integration of multimodal information therefore provides a more comprehensive representation of the interaction between the patient and the rehabilitation device.Table 3Overall classification performance across feature configurations under repeated stratified 80/20 validationFeature configurationModelMacro-F1 (mean ± SD)Balanced accuracy (mean ± SD)HRVExtraTrees0.46 ± 0.0280.46 ± 0.027HRVRandomForest0.453 ± 0.0310.457 ± 0.031HRVGradientBoosting0.469 ± 0.0290.469 ± 0.028THERMOExtraTrees0.61 ± 0.0270.607 ± 0.026THERMORandomForest0.557 ± 0.0290.558 ± 0.029THERMOGradientBoosting0.589 ± 0.0280.586 ± 0.027EXOExtraTrees0.586 ± 0.0270.584 ± 0.026EXORandomForest0.529 ± 0.0290.532 ± 0.029EXOGradientBoosting0.580 ± 0.0270.578 ± 0.027MULTIMODALExtraTrees0.658 ± 0.0270.654 ± 0.026MULTIMODALRandomForest0.589 ± 0.0250.590 ± 0.025MULTIMODALGradientBoosting0.647 ± 0.0260.644 ± 0.024 Table 3Overall classification performance across feature configurations under repeated stratified 80/20 validationFeature configurationModelMacro-F1 (mean ± SD)Balanced accuracy (mean ± SD)HRVExtraTrees0.46 ± 0.0280.46 ± 0.027HRVRandomForest0.453 ± 0.0310.457 ± 0.031HRVGradientBoosting0.469 ± 0.0290.469 ± 0.028THERMOExtraTrees0.61 ± 0.0270.607 ± 0.026THERMORandomForest0.557 ± 0.0290.558 ± 0.029THERMOGradientBoosting0.589 ± 0.0280.586 ± 0.027EXOExtraTrees0.586 ± 0.0270.584 ± 0.026EXORandomForest0.529 ± 0.0290.532 ± 0.029EXOGradientBoosting0.580 ± 0.0270.578 ± 0.027MULTIMODALExtraTrees0.658 ± 0.0270.654 ± 0.026MULTIMODALRandomForest0.589 ± 0.0250.590 ± 0.025MULTIMODALGradientBoosting0.647 ± 0.0260.644 ± 0.024 Overall classification performance across feature configurations under repeated stratified 80/20 validation Given its superior overall performance, the multimodal Extra Trees classifier was further analysed to evaluate class-wise predictive performance. The results are summarized in Table 4 in terms of precision, recall, and F1-score for each engagement level. The model achieved high performance for the not engaged and engaged classes, with F1-scores of 0.727 ± 0.032 and 0.735 ± 0.028, respectively. These classes also showed relatively high recall values (0.754 ± 0.044 and 0.780 ± 0.036), indicating that the classifier correctly identified most samples belonging to these engagement states. In contrast, the neutral class proved more difficult to discriminate, with a lower F1-score (0.511 ± 0.047) and recall (0.428 ± 0.055). This result suggests that intermediate engagement levels may present less distinct physiological and biomechanical patterns, making them inherently more challenging to separate from adjacent states.Table 4Class-wise performance of Extra Trees classifierCLASSF1PRECISIONRECALLNot engaged0.727 ± 0.0320.703 ± 0.0340.754 ± 0.044Neutral0.511 ± 0.0470.638 ± 0.0450.428 ± 0.055Engaged0.735 ± 0.0280.696 ± 0.0340.780 ± 0.036 Table 4Class-wise performance of Extra Trees classifierCLASSF1PRECISIONRECALLNot engaged0.727 ± 0.0320.703 ± 0.0340.754 ± 0.044Neutral0.511 ± 0.0470.638 ± 0.0450.428 ± 0.055Engaged0.735 ± 0.0280.696 ± 0.0340.780 ± 0.036 Class-wise performance of Extra Trees classifier The confusion matrix aggregated across all evaluation splits and normalized by row is shown in Fig. 4. This representation summarizes the overall distribution of predictions for each true engagement class across all repetitions of the evaluation procedure. The classifier correctly identified 75.4% of the not engaged samples and 78.0% of the engaged samples, confirming a strong discriminative capability for the extreme engagement states. In contrast, the neutral class showed a lower correct classification rate (42.8%). Misclassifications mainly occurred between adjacent engagement levels: 27.5% of neutral samples were classified as not engaged, whereas 29.7% were classified as engaged. This pattern suggests that the neutral engagement state may represent a transitional condition between disengagement and active participation, which can lead to greater ambiguity in the physiological and biomechanical signals recorded during the rehabilitation task.Fig. 4Confusion matrix of the multimodal Extra Trees classifier aggregated across all evaluation splits and normalized by row. Percentages represent the proportion of predictions within each true engagement class Confusion matrix of the multimodal Extra Trees classifier aggregated across all evaluation splits and normalized by row. Percentages represent the proportion of predictions within each true engagement class Model optimization The nested feature selection procedure was further analysed to investigate the number of predictors required to achieve optimal classification performance. Across the 30 outer evaluation splits, the optimal number of selected features showed moderate variability, with a mean of 17.23 ± 6.98 features and a median of 16.5. Although the full feature space contained 50 candidate predictors, the optimal subset size selected by the nested procedure ranged between 10 and 47 features across outer splits. This range reflects the data-driven nature of the feature selection process: for each split, the optimal number of features was determined by maximizing the macro-F1 score during the inner cross-validation stage. In practice, the maximum subset size never reached the full feature set, indicating that including all predictors did not lead to improved classification performance. The aggregated performance curve obtained during the inner cross-validation procedure (Fig. 5) showed that the macro-F1 score increased rapidly as the first features were introduced and reached its maximum around K ≈ 13 features. Beyond this point, performance tended to stabilize, with only minor fluctuations despite the inclusion of additional predictors. This behaviour indicates that a relatively small subset of informative features captures most of the discriminative information required to estimate engagement levels, whereas larger feature sets provide only marginal improvements.Fig. 5Relationship between the number of selected features (K) and macro-F1 score during the nested feature selection procedure. The thick line represents the mean performance across outer splits, whereas shaded areas indicate ± 1 standard deviation Relationship between the number of selected features (K) and macro-F1 score during the nested feature selection procedure. The thick line represents the mean performance across outer splits, whereas shaded areas indicate ± 1 standard deviation Explainable AI To further interpret the model behaviour, feature importance was first analysed using the intrinsic importance scores provided by the Extra Trees classifier and aggregated across outer splits (Fig. 6a). The analysis revealed that exoskeleton-derived biomechanical features were consistently among the most influential predictors, particularly the area under the torque curves of the hip and knee joints (HipRight_AUC, KneeRight_AUC, and KneeLeft_AUC). Thermal features extracted from facial regions also contributed substantially to the classification, with variables such as perioral_T_mean, chin_T_mean, and nostril_T_mean appearing among the most important predictors. In contrast, HRV-derived features showed comparatively lower importance scores, although variables such as MeanRR, RMSSD, and LF still contributed to the model as complementary physiological indicators.Fig. 6Explainability analysis of the multimodal Extra Trees classifier. (a) Model-based feature importance. (b) Permutation importance. (c) Feature selection frequency across outer splits Explainability analysis of the multimodal Extra Trees classifier. (a) Model-based feature importance. (b) Permutation importance. (c) Feature selection frequency across outer splits To validate the relevance of the identified predictors, a permutation importance analysis was performed on the trained models and aggregated across outer splits (Fig. 6b). The results largely confirmed the ranking obtained from the model-based importance analysis. Exoskeleton-derived variables again emerged among the most influential predictors, particularly KneeRight_AUC, HipRight_AUC, and KneeLeft_AUC. Facial thermal features, including perioral_T_mean and chin_T_mean, also demonstrated high permutation importance values, indicating that variations in facial temperature dynamics are strongly associated with engagement levels during robot-assisted gait training. HRV features showed smaller but non-negligible contributions, suggesting that cardiac variability provides complementary physiological information that improves engagement estimation when combined with biomechanical and thermal signals. The stability of the feature selection process was further evaluated by analysing the frequency with which each feature was selected across outer splits (Fig. 6c). Several predictors were consistently included in the optimal feature subsets, particularly biomechanical variables derived from the exoskeleton (e.g., HipRight_AUC and KneeRight_AUC) and thermal features from the perioral and nasal regions. This stability indicates that the multimodal framework captures reproducible physiological and biomechanical patterns associated with patients’ engagement, supporting the robustness of the proposed modelling approach. Discussion The present study investigated the feasibility of automatically estimating patients’ engagement during RAGT using multimodal physiological and biomechanical data combined within a machine learning framework. The results demonstrate that integrating heterogeneous sensing modalities substantially improves the reliability of engagement estimation compared with unimodal approaches. In particular, the multimodal configuration combining HRV, facial thermal features derived from infrared thermography, and exoskeleton-derived biomechanical variables achieved the highest predictive performance across all evaluated models, with the Extra Trees classifier reaching a macro-F1 score of 0.658 ± 0.027 (Table 3). This result indicates that engagement during rehabilitation cannot be fully captured by a single physiological signal but rather emerges from the interaction between multiple behavioural and physiological processes occurring during RAGT. In this context, biomechanical interaction with the robotic device provides direct information about the patient’s active participation in the task, whereas physiological signals reflect complementary aspects related to cognitive and emotional involvement. The class-wise analysis further revealed that the model achieved higher performance for the extreme engagement states (“not engaged” and “engaged” with average accuracies of 75.4% and 78.0% respectively) compared with the intermediate “neutral” class (Table 4). This behaviour was also evident in the confusion matrix (Fig. 4), where misclassifications occurred predominantly between adjacent engagement levels. Such a pattern is consistent with the ordinal nature of engagement, where the neutral state represents a transitional condition between disengagement and active participation. Consequently, physiological and behavioural signals associated with this intermediate state may be less distinct and therefore more difficult to separate. The obtained performance should also be interpreted considering the size and structure of the available clinical dataset. A 30-min Lokomat® trial theoretically yielded approximately 60 non-overlapping 30-s windows; however, the actual number of usable windows could vary across patients and sessions depending on the effective duration of the trial, which was adapted to each child’s tolerance and clinical needs. Therefore, although window-based segmentation allowed a time-resolved characterization of engagement, the overall number of observations remained constrained by the limited number of participants, acquisition sessions, and usable windows. This may have influenced downstream classification performance, particularly in a clinically heterogeneous three-class engagement prediction task. Previous work on three-level engagement prediction during robot-assisted gait rehabilitation showed that downstream performance can be substantially influenced by dataset preparation strategies, including feature reduction and data augmentation [50]. Notably, before the application of advanced dataset preparation procedures, the reported classification performance was in a range comparable to that obtained in the present study, whereas higher performance was achieved after applying data augmentation and related preprocessing strategies. This highlights the relevance of dataset size, windowing strategy, and preprocessing choices in this type of task. Therefore, the exploration of advanced dataset preparation strategies, such as feature reduction and data augmentation, represents a relevant direction for future work to improve model robustness and assess their impact on downstream classification performance. The nested feature selection analysis provided additional insight into the dimensionality of the engagement estimation problem. Although the original feature space contained 50 candidate predictors, the highest inner cross-validation macro-F1 scores were typically obtained using a substantially smaller subset of variables, with a mean of approximately 17 selected features and a performance plateau reached with around 13 predictors (Fig. 5). This finding suggests that the engagement classification task is driven by a limited set of highly informative physiological and biomechanical features. Consistently, both the model-based and permutation importance analyses identified exoskeleton-derived variables among the most influential predictors (Figs. 6a and 6b). In particular, the area under the torque curves of the hip and knee joints emerged among the top-ranked features and was selected across all outer splits in the feature-selection frequency analysis (Fig. 6c), highlighting the quantitative relevance of biomechanical interaction metrics within the proposed engagement estimation framework. This interpretation is consistent with the use of robot-derived feedback signals in robotic gait rehabilitation [43] and is further supported by previous Lokomat® evidence showing that interaction torques can be used to characterize patient–robot biomechanical interaction and active participation during robot-aided gait training [52]. During Lokomat® training, the robotic device guides the lower limbs along predefined trajectories, and the child may contribute actively to the movement, follow the imposed trajectory with different degrees of cooperation, or generate additional interaction forces due to spasticity, resistance, or poor motor coordination. Therefore, torque-related features quantify the mechanical interaction occurring between the patient and the device during the task. In the present study, the exoskeleton-only configuration also retained predictive information on the engagement labels; however, the best-performing model was obtained when exoskeleton-derived features were integrated with HRV and IRT features in the multimodal configuration. Previous evidence in children with CP further showed a reduction in torque-related measures across the RAGT cycle, supporting the sensitivity of these variables to rehabilitation-related changes in patient–robot interaction [25]. Taken together, these findings suggest that torque-derived AUC features should be interpreted as indirect biomechanical descriptors of motor involvement and patient–robot interaction, rather than as direct measures of engagement itself. The higher relevance of right-side torque features may partly reflect a cohort-related bias due to the clinical heterogeneity of the enrolled population. In particular, the distribution of motor impairment profiles, asymmetry patterns, and affected sides may have influenced the relative importance of left- and right-side torque measures. Future studies should evaluate torque-derived predictors in relation to affected side, motor asymmetry, and clinical phenotype to determine whether side-specific feature importance reflects true biomechanical differences or sample-specific effects. At the same time, facial thermal features also played a substantial role in the prediction process. Variables derived from facial regions such as the perioral, nasal, and chin areas were frequently selected among the most relevant predictors and exhibited high importance values in both model-based and permutation analyses (Figs. 6a, 6b, 6c). These findings are consistent with previous evidence suggesting that facial temperature variations are associated with autonomic nervous system responses linked to emotional and cognitive states, potentially reflecting changes in attention, effort, or motivation during rehabilitation tasks [15]. However, facial thermal features, particularly those extracted from perioral and nasal regions, should be interpreted within the broader physiological context of paediatric CP. Thermal variations in these areas may also be influenced by respiratory patterns, physical effort, fatigue, and possible orofacial dysfunctions during prolonged RAGT sessions. Therefore, these features should not be considered specific markers of cognitive engagement alone, but rather indirect physiological indicators reflecting the combined contribution of autonomic regulation, breathing-related dynamics, and task-related physical demand. HRV features showed comparatively smaller importance values but were still consistently selected in the optimal feature subsets (Fig. 6c), suggesting that cardiac variability provides complementary information about the physiological state of the patient, likely capturing aspects of cognitive load or stress associated with the rehabilitation task. The relatively limited performance of the HRV-only configuration suggests that cardiac autonomic features alone were not sufficient to discriminate engagement levels reliably in this cohort. From a clinical perspective, this may be partly related to the autonomic alterations reported in children with CP, who may present reduced HRV, higher resting heart rate, and atypical autonomic responses to postural or movement-related stimuli compared with typically developing children [41, 53]. Nevertheless, HRV should not be interpreted as merely introducing noise into the multimodal framework. Although its standalone discriminative power was modest, HRV features were retained in the selected feature subsets and contributed complementary information when combined with thermal and exoskeleton-derived variables. This suggests that HRV may capture subtle autonomic components of engagement that are not fully represented by facial thermal responses or torque-related interaction measures. Taken together, these results highlight the complementary nature of the three sensing modalities and support the idea that engagement during RAGT emerges from the interaction of biomechanical participation, autonomic physiological responses, and behavioural involvement. An additional element of originality of the present work lies in the application of machine learning techniques to a highly heterogeneous and clinically complex population. Paediatric patients undergoing RAGT often present substantial variability in terms of age, clinical condition, and functional impairment, as reflected by the broad distribution of GMFCS levels included in the study. Demonstrating the feasibility of engagement estimation in such a heterogeneous cohort is therefore particularly relevant from a clinical perspective, as it suggests that the proposed framework may generalize across diverse rehabilitation contexts. More broadly, this work contributes to the growing effort toward objective and continuous monitoring of patients’ engagement during RAGT, a dimension that remains largely assessed through subjective clinical observation in current practice. From a translational perspective, the integration of multimodal sensing and machine learning approaches opens promising opportunities for the development of adaptive and patient-centred rehabilitation systems capable of dynamically responding to patients’ engagement levels. Within this context, the present study extends previous research by adopting a comprehensive, patient-centred approach to engagement assessment. Specifically, the main strengths of this work are fourfold. First, the proposed framework aims to enhance the effectiveness of robotic training sessions by explicitly incorporating engagement as a measurable and optimizable dimension. Second, this approach is applied to a particularly vulnerable and clinically complex population, namely children with CP, in whom engagement is inherently difficult to assess and may also reflect discomfort or pain during therapy. For this reason, engagement in this population should not be reduced to overt motor performance alone but should be interpreted in relation to the child’s functional abilities, tolerance to the task, autonomic regulation, and cooperation with the robot-assisted movement. Third, engagement estimation is based on the integration of multiple complementary signals, including biomechanical interaction, physiological responses, and expert clinical observation, thus enabling a more holistic characterization of the patient’s state. Finally, this work contributes to the more effective integration of RAGT within paediatric rehabilitation programs by supporting the fine-tuning of therapy parameters according to the patient’s engagement profile [54]. Future developments may include the implementation of personalized engagement models that progressively adapt to the physiological and behavioural characteristics of individual patients. Furthermore, the integration of robotic interaction metrics may enable the development of closed-loop human–machine interaction paradigms in which biomechanical signals derived from the rehabilitation device are used both as input variables for engagement estimation and as feedback signals to modulate therapy parameters. In such a scenario, the robotic system could automatically adapt assistance levels, task difficulty, or motivational stimuli in response to the patient’s engagement state, with the goal of maintaining optimal participation throughout the therapy session and maximizing rehabilitation outcomes. Limitations Several limitations should be acknowledged. First, the sample size remains relatively limited, which is a common constraint in studies involving paediatric neurorehabilitation and intensive RAGT protocols. However, studies investigating engagement during robot-assisted gait training using multimodal physiological monitoring typically involve relatively small cohorts due to the complexity of clinical data acquisition. In this context, the dataset analysed in the present study represents one of the largest cohorts reported so far for multimodal engagement analysis in RAGT. Nevertheless, the study population was limited to children with CP, and no healthy control group was included. Therefore, the generalizability of the proposed framework to healthy subjects, other clinical populations, or different rehabilitation settings remains to be demonstrated. Future studies should validate the proposed approach in larger cohorts and investigate its applicability across different populations and rehabilitation contexts. In addition, although window-based segmentation enabled time-resolved engagement modelling, the overall number of observations remained constrained by the number of participants, acquisition sessions, and usable windows, which depended on the effective duration of each Lokomat® trial. This aspect may have influenced downstream classification performance and should be considered when interpreting the generalizability of the results. Future studies should include larger cohorts, additional acquisition sessions, and advanced dataset preparation strategies, including correlation-based feature selection, PCA-based dimensionality reduction, and data augmentation, to reduce feature redundancy, improve model robustness, and assess their impact on classification performance. The enrolled cohort was also clinically heterogeneous, including children with different GMFCS levels and motor impairment profiles. Although this heterogeneity reflects the complexity of real paediatric RAGT practice, it may introduce baseline differences in physiological, thermal, and biomechanical signals. For instance, a child with severe motor impairment may exert substantial effort but produce autonomic, thermal, or torque-related responses that differ from those of a child with milder impairment. In a pooled model, these functional-level-related baseline shifts may influence the learned decision boundaries and affect performance across GMFCS strata. Since the present sample size did not allow a robust stratified performance analysis by GMFCS level, this aspect remains to be investigated in larger cohorts. Future studies should explore subject- or severity-aware modelling strategies and evaluate model performance across functional severity strata. Although repeated stratified splitting allowed class proportions to be preserved across evaluation runs, the split was not performed at the subject level. Therefore, windows from the same participant could be present in both training and test partitions. This may lead to an optimistic estimate of generalization to entirely unseen patients. Subject-wise validation was not adopted in the present study because of the limited number of participants and the heterogeneous distribution of engagement labels across subjects, which could have produced highly unbalanced folds. Future studies with larger cohorts should include subject-level validation to assess generalization to new patients. Moreover, no downstream k-fold cross-validation procedure followed by formal statistical comparisons among classifiers was performed. Although repeated train–test evaluations were used to estimate performance variability, the observed differences between models should be interpreted descriptively rather than as statistically confirmed superiority. Future studies should adopt nested or repeated k-fold cross-validation schemes with appropriate paired statistical tests to compare classifiers more rigorously. Another limitation concerns the absence of a baseline Lokomat® condition without APF or other engagement-oriented stimuli. In the present protocol, APF was part of the standard clinical rehabilitation setting, and the study was not designed to isolate the specific effect of APF on engagement-related physiological or biomechanical responses. Therefore, the present data do not allow a direct comparison between feedback-enhanced and non-feedback training conditions. Future controlled studies should compare APF and non-APF conditions to quantify the specific contribution of feedback-based stimulation to engagement during RAGT. Engagement labels were assigned by a single expert clinician based on direct clinical observation. Although this approach reflects routine clinical practice and benefits from specific expertise in paediatric Lokomat® rehabilitation, it inevitably introduces observer dependency. The absence of multiple independent raters prevented the assessment of inter-rater reliability and may have contributed to subjectivity in the ground-truth labels. Future studies should include at least two independent annotators, inter-rater agreement analysis, and consensus-based scoring procedures to improve label reliability. Moreover, model predictions were compared with clinician-assigned engagement labels derived from observed behaviour, but no additional independent behavioural validation or external test dataset was available. Future studies should compare ML-estimated engagement with independent behavioural measures, multiple-rater consensus annotations, video-based behavioural coding, or prospective validation on newly acquired sessions. Although the proposed framework was developed and evaluated offline, its time-resolved structure may represent a preliminary step toward future real-time engagement monitoring systems. Inference time, feature-extraction time, and end-to-end processing latency were not quantified in the present study. These aspects should be specifically assessed in future implementations to determine the computational feasibility of the approach under clinically realistic acquisition and processing conditions. Camera-based acquisition represents an additional limitation of the study. Although facial thermal ROIs were dynamically aligned using RGB-based facial landmark detection, this procedure may be affected by head movements, partial face occlusions, changes in facial orientation, and variability in the quality of RGB landmark tracking. Illumination changes may influence the RGB channel used for landmark detection, whereas thermal recordings may be affected by partial occlusions of the face or temporary loss of ROI visibility. These factors may introduce residual variability in the extracted IRT features. In addition, thermal features extracted from perioral and nasal regions may reflect not only emotional or attentional components of engagement, but also respiratory patterns, physical effort, and possible orofacial dysfunctions commonly observed in children with CP. Finally, the explainability analysis focused on global feature relevance, using model-based feature importance, permutation importance, and feature-selection frequency. Local explanation methods, such as LIME and SHAP, were not applied in the present study. Future work should compare global feature-importance approaches with instance-level explanations to assess whether patient or window-specific interpretations can provide additional clinically meaningful information. Conclusions This study investigated the feasibility of automatically estimating patients’ engagement during RAGT using a multimodal machine learning framework integrating physiological and biomechanical signals. The results demonstrate that combining heterogeneous sensing modalities significantly improves engagement classification compared with unimodal approaches. In particular, the multimodal configuration including HRV, infrared thermography features, and exoskeleton-derived biomechanical variables achieved the best predictive performance, with the Extra Trees classifier reaching a macro-F1 score of 0.658 ± 0.027. Feature selection and explainability analyses further revealed that a relatively compact subset of predictors is sufficient to capture the most informative patterns associated with engagement, with exoskeleton-derived torque features emerging as the most influential variables, followed by thermal and HRV features providing complementary physiological information. These findings highlight the potential of integrating physiological monitoring and robotic interaction metrics to obtain an objective and continuous estimation of patients’ engagement during RAGT. Overall, the proposed multimodal framework represents a promising step toward the development of intelligent rehabilitation systems capable of supporting clinicians in monitoring patients’ participation and potentially enabling adaptive human–robot interaction strategies aimed at maximizing rehabilitation outcomes.