The Effect of Face Masks on Physiological Data and the Classification of Rehabilitation Walking

Gait analysis and the assessment of rehabilitation exercises are important processes that occur during fitness level monitoring and the treatment of neurological disorders. This paper presents the possibility of using oximetric, heart rate (HR), accelerometric, and global navigation satellite systems (GNSSs) to analyse signals recorded during uphill and downhill walking without and with a face mask to find its influence on physiological functions during selected walking patterns. The experimental dataset includes 86 signal segments acquired under different conditions. The proposed methodology is based on signal analysis in both the time and frequency domains. The results indicate that face mask use has a minimal effect on blood oxygen concentration and heart rate, with the average mean changes of these parameters being less than 2%. The support vector machine, a Bayesian method, the ${k}$ -nearest neighbour method, and a two-layer neural network showed very good separation abilities and successfully classified different walking patterns only in the case when the effect of face mask wearing was not included in the classification process. Our methodology suggests that artificial intelligence and machine learning tools are efficient methods for the assessment of motion patterns in different motion conditions and that face masks have a negligible effect for short-duration experiments.

, [3]. The associated exercises moreover may be affected by wearing face masks [4]. The evaluation of the influence of masks on dyspnoea and cardiorespiratory parameters has been extensively studied using specific sensors for the analysis of the blood oxygen concentration [5] and peak heart rate data. Some results show that in healthy adults, face masks have a minimal impact on dyspnoea during short exercise tests [6], [7]. Other papers [8] based on studies of the use of protective surgical facial masks during clinical practice point to the reduction of the blood oxygen concentration, an increase in the frequency of the heartbeat, and the sensation of shortness of breath.
Gait assessment involves the analysis of data recorded by different microelectromechanical sensor units (MEMS), camera systems, depth sensors, thermal cameras, oximeters, heart rate sensors, and accelerometers. Specific wearable devices [9], [10], [11], [12], [13], [14] and sensor systems can warn wearers that their face mask is leaking, and these sensors can simultaneously record the wearer's heart rate and breathing frequency using sensitive accelerometers [15]. Accelerometers, global navigation satellite systems (GNSSs), and wireless communication links can be applied to more general gait analysis in real conditions [16].
Applications of gait and motion analysis include early diagnostics in neurology [17], [18], [19], COVID diagnosis [20], physical therapy, rehabilitation, and the monitoring of sport activities. The ataxic gait assessment of patients with multiple sclerosis is a very important problem in this area. This paper is devoted to the analysis of the blood oxygen concentration, heart rate changes, and accelerometric data processing during walking with and without a face mask. Figure 1 presents the walking route in the mapping environment and the acquired data, including the altitude profile, blood oxygen concentration, heart rate data, and accelerometric signals. Figure 2 presents the oximeter and the mobile phone screen, which contains information from the accelerometric and GNSS sensors used by Matlab Mobile to record positioning and motion data.
General numerical methods are commonly used to process data from sensors in the time, frequency, or scale domains. Initial signal processing steps include de-noising, time synchronisation using timestamps, and resampling. Selected statistical methods are often used to analyse data in the time domain. Spectrograms and scalograms are then used for the detection of signal features in the frequency and scale domains [21].
Complex datasets with repeated cluster observations and event-related signals can be analyzed by linear mixed Fig. 1. Presentation of (a) the walking route in the mapping environment labelled to show the minutes during a selected experiment, and acquired data, including (b) the altitude profile, (c) blood oxygen concentration, (d) heart rate data, and (e) accelerometric data. Fig. 2. Physiological data acquisition using oximeter, accelerometric, and GNSS sensors to make measurements during motion and using a mobile phone and Matlab Mobile, which were connected to the MathWorks cloud for recording. models [22], [23] and algorithmic blocks available in Matlab [24]. Additional methods include the use of computational intelligence tools for the classification of walking patterns by the support vector machine (SVM), a Bayesian method, the k-nearest neighbour (k-NN) method, and the two-layer neural network (NN) [25]. Further, a more sophisticated approach could be based on artificial intelligence and deep multilayer neural network models [26], [27], [28].
The goal of the present study is to contribute to the analysis of the effect of face masks on physiological functions during a walk along a real route recorded by the GNSS. This effect is studied through the analysis of selected physiological data (blood oxygen concentration and heart rate). The evaluation of walking segments is performed through the frequency domain analysis of accelerometric data recorded by a mobile phone in the optimal position [19] on the body. From a more general point of view, the whole methodology contributes to the classification of motion patterns [1], [29], rehabilitation, and human activity monitoring.

A. Data Acquisition
Physiological signals observed during walks on the route presented in Fig. 1 were recorded using simultaneous data acquisition by oximetric, heart rate, accelerometric, and GNSS sensors. Figure 3(a) presents the route segment and the set of five downhill and uphill walks; the altitude profile is shown in Fig. 3(b) and was recorded by the mobile phone's GNSS sensor. The blood oxygen concentration and heart rate data were recorded by the wrist oximeter with a sampling frequency of 1 Hz during each set of experiments (Figs. 3(e) and 3(f)). The associated accelerometric data shown in Fig. 3(c) were recorded by the mobile phone's sensors with a sampling frequency of 100 Hz. The locations of the accelerometric sensors on the spine were selected according to previous studies [19]. All experiments were performed both without any face cover and with the five layer FFP2 face mask (FFP2 NR premium, Promedor24 manufacturer).
The time synchronisation of all sensors was performed using the mobile phone and the time stamps associated with all the data, which were recorded in comma-separated values (CSV) and transmitted to the mobile phone and computer using the Bluetooth short-length wireless technology standard and wireless communication links. Matlab Mobile and the MathWorks cloud were used to record the GNSS and accelerometric data.
The set of all 86 segments of a selected individual recorded during different weather conditions included the following: 1) Downhill walking without (class A, 25 segments) and with (class C, 25 segments) a face mask; 2) Uphill walking without (class B, 18 segments) and with (class D, 18 segments) a face mask. For the analysis of accelerometric data, classes A and C, and B and D were joined to form classes AC and B D, respectively. The project was approved by the local ethics committee in accordance with the 1964 Declaration of Helsinki.
All of the data segments related to individual classes were randomly divided into training and testing sets with 90 % and 10 % of the observations, respectively. A comparison of classification accuracies was then performed for both the training and testing sets.

B. Feature Extraction and Classification
Data sets of oximetric, heart rate, positioning, and accelerometric signals included timestamps for each observation that enabled their time synchronisation. The segmentation process was based on GNSS altitude data. As the observed values are affected by noise components, the digital filtering of these signals was performed first. The finite impulse low-pass impulse filter (FIR) of order M = 60 with a normalised cutoff frequency of 0.05 was used to transform initial altitude values k=0 . Time delay compensation was used in the final algorithmic process.
Statistical analysis was then applied to the oximetric and heart rate signals. Signal segments with different altitude profiles and slopes were analysed separately for walks taken without and with a face mask.
Accelerometric data recorded by the three-axis sensor formed three sequences {s x (n), s y (n), s z (n)} L n=1 , and their modulus, for n = 1, 2, . . . , L, was used for further processing. Signals were analysed in the frequency domain using the short-time discrete Fourier transform after the removal of the mean valuē s = mean({s(n)} L−1 n=0 ) of each segment: Then, the following spectrogram evaluation was performed. The signal features of accelerometric data can be evaluated in both the time and scale domains using either the discrete Fourier or wavelet transforms [30]. The use of spectral domain features requires the evaluation of the relative energy E w in the frequency band where w is the set of indices for the frequency components f k ∈ f c 1 (w), f c 2 (w) . In the given case two frequency bands for the relative energy evaluation were used: B 1 = 0, 6 Hz and B 2 = 6, 12 Hz to define the first (F1) and the second (F2) feature, respectively. The classification of both accelerometric and physiological data involved the use of the pattern matrix P R,Q and the target vector T 1,Q . The value of Q stands for the number of column pattern vectors specified for each segment and R is equal to the number of features. The associated target vector T 1,Q specifies the classes corresponding to each experiment. The following classification process was performed by different machine learning algorithms [1], [28], [31], [32], including the k-nearest neighbour method, support vector machine (SVM), Bayesian method, and two-layer neural network model. Both the accuracies and the cross-validation errors were then evaluated to select the best algorithm for a given application. More sophisticated methods could use a selected deep learning strategy.
The proposed two-layer neural network model used the sigmoidal transfer function f 1 in the first layer and the probabilistic softmax transfer function f 2 in the final layer. The values of the output layer, which are based on Bayes' theorem [33], provided the probabilities for each class.
The confusion matrix was used as an efficient tool to evaluate the classification results. The confusion matrix shows, for each class c(k) C k=1 out of C classes, the number of correctly (T C(k)) and incorrectly (FC(k)) classified experiments. The final accuracy ACC of Q experiments is then evaluated according to the following relation: Cross-validation errors were then evaluated to measure the generalisation abilities of classification models using the leaveone-out method.

III. RESULTS
The physiological and GNSS data recorded during walking experiments on the route presented in Fig. 3 were time synchronised at first. The altitude signals were then preprocessed by digital filtering to reduce additional noise components. The FIR low-pass filtering with its normalized cutoff frequency of 0.05 simplified the use of altitude signals for automatic detection of altitude extremal values and the separation of signal segments for uphill and downhill walking. All evaluations were performed in Matlab 2022a. Figure 4 shows the time evolution of oximetric data and heart rate signals from experiments without and with a face mask for both downhill and uphill walking and the mean values of the set of experiments.
Mean values of oximetric and heart rate data during last 4 minutes of each segment were used as features for further processing. Owing to the measurements errors, the whole set of measurement was reduced by 3 segments (3.5%) from 86 to 83 ones. Figure 5 presents the distribution of the walking patterns in terms of the mean values of the blood oxygen concentration and mean heart rate values for segments of uphill and downhill walking without and with a face mask, with limits showing 0.5, 1, and 1.5 times the standard deviation. These results show that the face mask has a minimal influence on physiological functions for short-duration exercises; this is in agreement with several previous papers [6]. Table I presents the associated statistical parameters. The two-sample t-test was evaluated to test the decision for the null hypothesis that data of the blood oxygen concentration (and the heart rate) for walking with and without the face masks comes from independent random samples with equal means. All tests accepted this hypothesis on the 5 % significance level.  The classification of statistical features related to individual walking segments was performed by different classification methods. The pattern matrix P R,Q has the mean blood oxygen concentration and heart rate in its first and second row, respectively, associated with each segment q = 1, 2, . . . , Q and Q = 83 standing for the number of segments used during the classification process. Figure 6(a) presents the results of the pattern matrix processing by the two-layer R − S1 − S2 neural network. Its structure includes R = 2 input elements, S1 = 10 neurons  6. Classification by the two-layer neural network of physiological walking patterns (mean oxygen concentration and mean heart rate) (a) into four classes that stand for walking downhill/uphill with and without a face mask and (b) into two classes that represent walking downhill/uphill without distinguishing between wearing and not wearing a face mask.
in its first layer, and S2 = 4 output elements that provide probabilities of the class affiliation. The sigmoidal and softmax transfer functions were applied in the first and the second layer, respectively. Due to the overlapping clusters of walking without and with a face mask, the classification accuracy was only 79.5 %, as presented in Table II. Similar results with slightly lower accuracies were achieved by the support vector machine, Bayes method, and the 3-nearest neighbour method. Results show the highest accuracy and the lowest cross-validation errors for the two-layer neural network for the given set of experiments. Figure 6(b) presents the results of the two-layer neural network classification into two classes, without distinguishing between wearing and not wearing a face mask. Class AC is formed by classes A/C, and class B D by classes B/D of the previous classification. The feature values form well-separated clusters in this case, allowing very reliable classification. Table III presents the confusion matrix of the two-layer neural network model (Fig. 6(a)), and results of physiological data classification into four classes: A -HillDown walking without face mask (CA), B -HillUp walking without face mask (CB), C -HillDown walking with face mask (CC), D -HillUp walking with face mask (CD). It presents true values on the matrix diagonal (in bold), true rates (T R(k)), prediction values (PV (k)), and accuracy (ACC). Due to the compact clusters in Fig. 6(b), the classification accuracy is 100%. Similar compact clusters occur for the accelerometric data recorded by the sensor on the spine. Figure 7(a,b) presents the spectral components of walking downhill and uphill during the selected set of experiments. The features, which are evaluated according to the mean values of energy in the frequency bands 0, 6 and 6, 12 , are presented in Fig. 7(c); they form compact clusters when no distinction is made between wearing and not wearing a face mask, allowing a simple classification. The two-sample t-test was evaluated to test the decision for the null hypothesis that accelerometric data for walking up and down comes from independent random samples with equal means. All tests rejected this hypothesis on the 5 % significance level.

IV. DISCUSSION
The evaluation of gait patterns based on the analysis of different motion, physiological sensors, and video cameras is a very wide research area with many applications. Common approaches include the analysis of spatial domain features based on stepping characteristics [34] and the performance of accelerometric data processing [17], [19], [35], [36] to form clinical biomarkers. The relationship between blood oxygen concentration and heart rate and the wearing of face masks is a widely studied topic that has yielded different conclusions. The present paper makes a contribution to these studies. Its results are based on downhill and uphill walking without and with a face mask and the analysis of the associated datasets. The mean blood oxygen concentration decreased from 94.88 % to 94.82 % and from 94.63 % to 94.26 % for downhill and uphill walking, respectively (less than 0.4 %). The mean heart rate increased from 107.03 bpm to 109.28 bpm and from 126.55 bpm to 126.90 bpm for downhill and uphill walking, respectively (less than 2 %).
It seems that the effect of face mask wearing is minimal and can be neglected for short-duration experiments. These results correspond with recent papers [6], [37], [38] that focused on making measurements of physiological functions without and with mask wearing. No significant difference was detected in these studies. The experiments in this study that make similar contributions included downhill and uphill walking for about 6 minutes.
The medical explanation of the statistical results achieved is related to aerobic and anaerobic work. The face mask increases the air resistance during the inhale, it increases the pressure difference inside the lungs and the surrounding air, and it increases the breathing work. The oxygen turnover in the lungs is compensated by a higher and deeper breathing rate. This compensation mechanism can keep the blood oxygen concentration inside normal limits for lower-level and timelimited physical activities.
The simultaneous recording of accelerometric data was done by a sensor located on the spine according to previous studies [17], [19]. No changes in the walking patterns were observed for walking without and with a face mask. However, the resulting analysis of accelerometric data confirmed the possibility of downhill and uphill walking having different frequency components for different altitude profiles. Results of the present paper correspond with previous observations of accelerometric data during cycling experiments [1], [28].
Recent tests [39] were done for the set of 16 individuals (11 males and 5 females of their age between 24 and 48 years) during their physical training on a home exercise bike. Data of separate segments (load and rest periods) were recorded for the uncovered face and with the face mask, and acquired by sensors identical with those used for walking experiments. Data evaluation of these 128 segments proved nearly no effect of face masks on the blood oxygen concentration and the heart rate. These conclusions are in the agreement with results of the present paper for uphill and downhill walking and analysis of 86 signal segments acquired under different conditions.
Both physiological and accelerometric data acquisition using wireless mobile sensors showed the usefulness of these sensors in motion data processing and the usefulness of performing analyses in both the time and frequency domains. The use of timestamps associated with each observation has shown the importance of these timestamps for the synchronisation of signals recorded by different sensors with different sampling rates.

V. CONCLUSION
This paper has used selected mathematical and machine learning methods for gait analysis to study the effect of wearing face masks during walking in different conditions. The whole database included 86 signal segments and data acquired with sampling frequencies of 1 Hz (for oximetric and heart rate data), 100 Hz (for accelerometric data) and the mean sampling frequency of 1 Hz for positioning data acquired by the global navigation satellite system.
The results show that the effect of face masks use is negligible for short-duration walking experiments. These conclusions correspond with some papers [6], [7] presenting that face masks have a minimal impact on dyspnoea and the expected decrease of the blood oxygen concentration is compensated by the increase of the breathing frequency and its depth. On average, the use of a face mask decreased the blood oxygen concentration by about 0.4 % and increased the heart rate by about 2 % only for the given set of experiments.
Additional results demonstrate the usefulness of physiological and accelerometric data in recognising different walking patterns for uphill and downhill walking with and without a face mask. Neural network systems can be used for the classification of the associated features in both the time and frequency domains. The standard classification tools used included the SVM, Bayesian method, k-nearest neighbour method, and two-layer neural network.
The analysis of motion patterns and face mask wearing has many applications in neurology, surgery, rehabilitation, and fitness level assessment during various sport activities. Future studies will be devoted to the use of further sensors, including video-and thermal-based systems for the analysis of different body motion activities. More extensive experiments will allow the use of efficient deep learning methods and artificial intelligence as well.
This paper constructs a multidisciplinary approach to motion data processing by using computational intelligence to contribute to the more reliable monitoring of rehabilitation exercises and the diagnosis of neurological disorders in a clinical environment. It describes how wearable sensors and appropriate data processing tools can be used in the detection of motion patterns and it contributes to the study of the effect of face mask wearing on physiological data changes. The general background of this research suggests that it may be possible to use similar mathematical methods [29] for motion pattern classification in many different fields.