**4.2 Multivariate time series-based kinetics generation of Virtual Limbs**

Adaptive and full-body-driven virtual limb generation can (1) engage various individuals with limited mobility in regular physical activities, (2) accelerate the rehabilitation of patients, and (3) release users' phantom limb pain.

#### **Figure 8.**

*(a) The flowchart of the proposed adaptive virtual limb generation based on multi-correlation hierarchical autoencoder; (b) Snapshot of virtual limb generation – walking by moving arms (online video [90]).*

*VIGOR: A Versatile, Individualized and Generative ORchestrator to Motivate the Movement… DOI: http://dx.doi.org/10.5772/intechopen.96025*

Virtual limb generation is a generative time series problem. **Figure 9** shows the pipeline of kinetics generation (a multivariate time-series) and correction of kinetic sequence of the virtual limbs.


As illustrated in **Figure 6**, we can generate the the kinetics of the wheel-chaired Tai-Chi practitioner according to the movement of his/her arms, which are functional and healthy. This work employs deep neural network to generate **Y***virtual t* using **Y***measured <sup>t</sup>* :

$$\mathbf{Y}\_t^{virtual} = f\left(\mathbf{Y}\_t^{measured}, \boldsymbol{\theta}\right) \tag{2}$$

where *f* **Y***measured <sup>t</sup>* , *<sup>θ</sup>* � � is the output of deep neural network.

### *4.2.1 Loss function for the Generation of virtual limbs' kinetics*

In this work, a musculoskeletal biomechanics guided loss function is used to formulate the objective of generated virtual limbs' kinetics:

$$\mathcal{L}(\boldsymbol{\theta}) = L\left(\mathbf{Y}^{\text{virtual}}, \mathbf{Y}\right) + \boldsymbol{\varrho}\mathcal{R}(\boldsymbol{\theta}) + L\_{\text{binochaus}}\left(\mathbf{Y}^{\text{virtual}}\right). \tag{3}$$

In Eq. (3), (**Y***virtual,* **Y**) indicates labelled training data; **Y***virtual* is the expected kinetic of virtual limbs; *θ* ∈ ℜ*<sup>n</sup>* indicates the parameters (weight and bias) of neural network; Rð Þ*<sup>θ</sup>* : <sup>ℜ</sup>*<sup>n</sup>* ! <sup>ℜ</sup> is the regularizer, whose importance is controlled by regularization strength ϱ∈ ℜ; *Lbiomechanics* **Y***virtual* � � denotes the bio-mechanics violation of generated kinetics with weigh *γ* ∈ ℜ and this work uses kinetic imbalance of human body to measure *Lbiomechanics*; and Lð Þ*<sup>θ</sup>* : <sup>ℜ</sup>*<sup>n</sup>* ! <sup>ℜ</sup> is actually regularized loss.

#### *4.2.2 Correction of generated kinetics using time-series prediction model*

The kinetic sequence of virtual limbs does not behave smoothly. This work corrects **Y***virtual <sup>t</sup>* using Auto-Regressive Integrated Moving Average (ARIMA) [44] time-series prediction model. ARIMA model is fitted to time series data for pattern recognition and forecasting. The AR part of ARIMA indicates that the evolving variable of interest is regressed on its prior (or historical) values. The MA part

**Figure 9.**

*Generation and correction of the kinetics of virtual limbs.*

indicates that the regression error is actually a linear combination of error terms whose values occurred contemporaneously and at various times in the past. The I (for "integrated") indicates that the data values have been replaced with the difference between their values and the previous values. ARIMA is defined as:

$$\mathbf{Y}\_t^{virtual\*} = \mathbf{c} + \sum\_{k=1}^p \phi\_k \mathbf{Y}\_{t-k}^{virtual} + \sum\_{k}^q \boldsymbol{\nu}\_k \boldsymbol{\varepsilon}\_{t-k} + \boldsymbol{\varepsilon}\_t \tag{4}$$

where **Y***virtual <sup>t</sup>* is the differenced series (it may have been differenced more than once). The "predictors" on the right hand side include both lagged values of **Y***virtual t* and lagged errors. Eq. (4) is also called ARIMA(*p, d, q*) model, where *p* is the order of the autoregressive part; *d* is the degree of first differencing involved; *q* is the order of the moving average part.

Any time series may be split into the following components: base Level, trend, seasonality and error. The coefficient of the ARIMA model is determined through autocorrelation [44] and the correlation of the series with its previous values.
