Skip to main content

Advertisement

Log in

Bidirectional dynamic neural networks with physical analyzability

  • Original Paper
  • Published:
Nonlinear Dynamics Aims and scope Submit manuscript

Abstract

The rapid growth in research exploiting deep learning to predict mechanical systems has revealed a new route for system identification; however, the analytic model as a white box has not been replaced in applications because of its open physical information. In contrast, the models generated by end-to-end learning usually lack the ability of physical analysis, which makes them inapplicable in many situations. Consequently, high-accuracy modeling with physical analyzability becomes a necessity. In this paper, we introduce bidirectional dynamic neural networks, a deep learning framework that can infer the dynamics of physical systems from control signals and observed state trajectories. Based on forward dynamics, we train the neural ordinary differential equations in a trajectory backtracking algorithm. With the trained model, the inverse dynamics can be calculated and based on \(\textit{Lagrangian}\) \(\textit{Mechanics}\), the physical parameters of the mechanical system can be estimated, including inertia, Coriolis and centrifugal forces, and gravity. As a result, the model can seamlessly incorporate prior knowledge, learn unknown dynamics without human intervention, and provide information as transparent as analytic models. We demonstrate our method on simulated 2-axis and 6-axis robots to evaluate model accuracy, including physical parameters and verified its applicability on real 7-axis robots. The experimental results show that this method is superior to the existing methods. This framework provides a new idea for system identification by providing interpretable, physically consistent models for physical systems.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Data availability

Enquiries about data availability should be directed to the authors.

References

  1. de Wit, C.C., Siciliano, B., Bastin, G. (eds.): Theory of Robot Control. Springer Science & Business Media, New York (2012)

    Google Scholar 

  2. Featherstone, R.: Rigid Body Dynamics Algorithms. Springer, New York (2014)

    MATH  Google Scholar 

  3. Jazar, R.N.: Advanced Dynamics: Rigid Body, Multibody, and Aerospace Applications. John Wiley & Sons, New York (2011)

    Book  MATH  Google Scholar 

  4. Fu, L., Li, P.: The research survey of system identification method. In: IHMSC ’13 Proceedings of the 2013 5th International Conference on Intelligent Human–Machine Systems and Cybernetics, vol. 2, pp. 397–401 (2013)

  5. Pinkus, A.: Approximation theory of the MLP model in neural networks. Acta Numer 8, 143–195 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  6. Greydanus, S., et al.: Hamiltonian neural networks. Adv. Neural Inf. Process. Syst. 32, 15353–15363 (2019)

    Google Scholar 

  7. Zhong, Y.D., et al.: Extending Lagrangian and Hamiltonian neural networks with differentiable contact models. In: Annual Conference on Neural Information Processing Systems, pp. 21910–21922 (2021)

  8. Chen, R.T., Rubanova, Y., Bettencourt, J., Duvenaud, D.K.: Neural ordinary differential equations. Adv. Neural Inf. Process. Syst. 31, 6571–6583 (2018)

    Google Scholar 

  9. Lutter, M., Ritter, C., Peters, J.: Deep Lagrangian networks—using physics as model prior for deep learning. In: International Conference on Learning Representations (2019)

  10. Zhong, Y.D., Dey, B., Chakraborty, A.: Symplectic ODE-net: learning Hamiltonian dynamics with control. In: International Conference on Learning Representations (2020)

  11. Finzi, M., Wang, K.A., Wilson, A.G.: Simplifying Hamiltonian and Lagrangian neural networks via explicit constraints. Adv. Neural Inf. Process. Syst. 33, 13880–13889 (2020)

    Google Scholar 

  12. Masarati, P.: Computed torque control of redundant manipulators using general-purpose software in real-time. Multibody Syst. Dyn. 32, 403–428 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  13. Magrini, E., Flacco, F., De Luca, A.: Estimation of contact forces using a virtual force sensor. In: Intelligent Robots and Systems, pp. pp. 2126–2133 (2014)

  14. Magrini, E., Flacco, F., De Luca, A.: Control Of generalized contact motion and force in physical human–robot interaction. In: International Conference on Robotics and Automation, vol. 2015, pp. 2298–2304 (2015)

  15. Lu, Y., Zhong, A., Li, Q., Dong, B.: Beyond finite layer neural networks: bridging deep architectures and numerical differential equations. In: International Conference on Learning Representations, pp. 3276–3285 (2018)

  16. Krishnan, R., Shalit, U., Sontag, D.: Structured inference networks for nonlinear state space models. In: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 2101–2109 (2017)

  17. Chen, Z., Zhang, J., Arjovsky, M., Bottou, L.: Symplectic recurrent neural networks. In: International Conference on Learning Representations (2020)

  18. Rangapuram, S.S., et al.: Deep state space models for time series forecasting. Adv. Neural Inf. Process. Syst. 31, 7796–7805 (2018)

    Google Scholar 

  19. Lillicrap, T.P., et al.: Continuous control with deep reinforcement learning. In: International Conference on Learning Representations, ICLR Poster (2016)

  20. Perrusquía, A., Wen, Yu.: Identification and optimal control of nonlinear systems using recurrent neural networks and reinforcement learning: An overview. Neurocomputing 438, 145–154 (2021)

    Article  Google Scholar 

  21. Wang, Y.-J., Lin, C.-T.: Runge–Kutta neural network for identification of dynamical systems in high accuracy. IEEE Trans. Neural Netw. Learn. Syst. 9(2), 294–307 (1998)

    Article  MathSciNet  Google Scholar 

  22. Gupta, J.K., Menda, K., Manchester, Z., Kochenderfer, M.J.: A general framework for structured learning of mechanical systems. arXiv:1902.08705 (2019)

  23. Lutter, M., Listmann, K., Peters, J.: Deep Lagrangian networks for end-to-end learning of energy-based control for under-actuated systems. In: Intelligent Robots and Systems, pp. 7718–7725 (2019)

  24. Lefebvre, M., Keeler, R.K., Sobie, R., White, J.: Propagation of errors for matrix inversion. Nucl. Instrum. Methods Phys. Res. Sect. A Accel. Spectrom. Detect. Assoc. Equip. 451(2), 520–528 (2000)

    Article  Google Scholar 

  25. Zhong, Y.D., Dey, B., Chakraborty, A.: Benchmarking energy-conserving neural networks for learning dynamics from data. In: Learning for Dynamics and Control, pp. 1218–1229 (2021)

  26. Zheng, H., Yang, Z., Liu, W., Liang, J., Li, Y.: Improving deep neural networks using softplus units. In: International Joint Conference on Neural Network, pp. 1–4 (2015)

  27. Misra, D.: Mish: a self regularized non-monotonic neural activation function. arXiv:1908:08681 (2019)

  28. Negrini, E., Citti, G., Capogna, L.: System identification through Lipschitz regularized deep neural networks. J. Comput. Phys. 444, 110549 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  29. Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: International Conference on Learning Representations, ICLR (Poster) (2015)

Download references

Funding

This work was supported by the National Natural Science Foundation of China [Grant numbers 52175029] and the Key Project of Shaanxi Province [Grand numbers 2018ZDCXL-GY-06-07].

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Fei Zhao.

Ethics declarations

Conflict of interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix A: The key steps in backpropagation of BDNN

Define \(\varvec{\theta }^{(1)}\), \(\varvec{\theta }^{(2)}\) and \(\varvec{\varepsilon }^{(1)}\), \(\varvec{\varepsilon }^{(2)}\) as weights of input and output layer of H and R net in BDNN, define \({\varvec{i}}^{(1)}\) and \({\varvec{i}}^{(2)}\) as the inputs of hidden and output layer neurons, \({\varvec{o}}^{(1)}\) and \({\varvec{o}}^{(2)}\) as inputs of the whole net and outputs of the hidden neurons respectively. In addition, define \(\varphi \) as the activation function. Then the key to Algorithm 1 is \(\frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial {\varvec{x}}^\top }\), \({\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\theta }}\) and \({\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\varepsilon }}\). According to Eq. (2), the gradient of f to \({\varvec{x}}\) can be derived as:

$$\begin{aligned} \begin{aligned} \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial {\varvec{x}}^\top }&{=}\frac{\partial ({\textbf{H}}({\varvec{u}}{-}{\textbf{R}})) }{\partial {\varvec{x}}^\top }{=}\frac{\partial {\textbf{H}}}{\partial {\varvec{x}}^\top }({\varvec{u}}{-}{\textbf{R}}){-}{\textbf{H}}\frac{\partial {\textbf{R}}}{\partial {\varvec{x}}^\top }\\&=\begin{bmatrix} \frac{\partial {\textbf{H}}}{\partial {\varvec{q}}^\top }({\varvec{u}}-{\textbf{R}})&{\varvec{0}} \end{bmatrix}-{\textbf{H}}\frac{\partial {\textbf{R}}}{\partial {\varvec{x}}^\top } \end{aligned}\nonumber \\ \end{aligned}$$
(11)

The backpropagation for computing \(\frac{\partial {\textbf{H}}}{\partial {\varvec{q}}^\top }({\varvec{u}}-{\textbf{R}})\) with function \({\mathscr {D}}\) has been showed in Eq. (4).

The adjoint sensitivity in neural ODEs is expressed as \({\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\theta }}\) and \({\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\varepsilon }}\). For H net in BDNN, the gradient related to the weight of the output layer is directly determined by function \({\mathscr {P}}^{-1}\):

$$\begin{aligned} \begin{aligned} {\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\theta }^{(2)}}&={\mathscr {A}}^\top \frac{\partial {\textbf{H}}}{\partial \varvec{\theta }^{(2)}}({\varvec{u}}-{\textbf{R}})\\&={\mathscr {P}}^{-1}({\mathscr {A}}_{s} \cdot ({\varvec{u}}-{\textbf{R}}) )^\top \odot \varphi ^{'}({\varvec{i}}_{H}^{(2)}){\varvec{o}}_{H}^{(2)\top }\\&=\varvec{\delta }_{H}^{(2)}{\varvec{o}}_{H}^{(2)\top } \end{aligned} \end{aligned}$$
(12)

Note that \({\mathscr {A}}_{s}\) represents the N.th to \(2 \times N.th\) elements of adjoint sensitivity \({\mathscr {A}}\). Thus for the hidden layer we have:

$$\begin{aligned} {\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\theta }^{(1)}} =\varvec{\theta }_{nb}^{(2)\top }\varvec{\delta }_{H}^{(2)}\odot \varphi ^{'}({\varvec{i}}_{H}^{(1)}){\varvec{o}}_{H}^{(1)\top } \end{aligned}$$
(13)

Where \(\varvec{\theta }_{H,nb}^{(2)}\) means the weight matrix without elements related to bias, and \({\varvec{i}}\) and \({\varvec{o}}\) with subscript H means elements of the tensor produced by H net. Similar expressions are also used in R net:

$$\begin{aligned} \begin{aligned} {\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\varepsilon }^{(2)}}&=-{\mathscr {A}}_{s}^\top {\textbf{H}} \frac{\partial {\textbf{R}}}{\partial \varvec{\varepsilon }^{(2)}} =-{\textbf{H}}{\mathscr {A}}_{s} \odot \varphi ^{'}({\varvec{i}}_{R}^{(2)}){\varvec{o}}_{R}^{(2)\top }\\&=\varvec{\delta }_{R}^{(2)}{\varvec{o}}_{R}^{(2)\top } \end{aligned} \end{aligned}$$
(14)

and:

$$\begin{aligned} {\mathscr {A}}^\top \frac{\partial f({\varvec{x}},{\varvec{u}})}{\partial \varvec{\varepsilon }^{(1)}} =\varvec{\varepsilon }_{nb}^{(2)\top }\varvec{\delta }_{R}^{(2)}\odot \varphi ^{'}({\varvec{i}}_{R}^{(1)}){\varvec{o}}_{R}^{(1)\top } \end{aligned}$$
(15)

Appendix B: Gradients

State estimation is considered as a constrained optimization problem in BDNN:

$$\begin{aligned}&\displaystyle \min _{{\varvec{w}}} L({\varvec{x}}): \ L({\varvec{x}})=\int _{0}^{T}l({\varvec{x}}_t)dt \nonumber \\&\displaystyle \mathrm {s.t.} \ \varvec{\dot{x}}_t-f({\varvec{x}}_t,{\varvec{u}}_t)=0 \\&\displaystyle {\varvec{x}}_t\Big |_{t=0}={\varvec{x}}_0\nonumber \end{aligned}$$
(16)

Define \({\varvec{w}}\in {\{\varvec{\theta },\varvec{\varepsilon }\}}\). According to NODE, the Gradients of BDNN can be derived using \(\textit{Lagrange Multiplier}\):

$$\begin{aligned}{} & {} \min _{{\varvec{w}}} {\mathscr {J}}: \ {\mathscr {J}}=\int _{0}^{T}\{l({\varvec{x}}_t)+\varvec{\alpha }_{t}^\top [\varvec{\dot{x}}_t-f({\varvec{x}}_t,{\varvec{u}}_t)]\nonumber \\{} & {} \quad \quad \quad \quad \quad \quad \quad \quad \;\; +\varvec{\mu }^\top {\varvec{x}}_0\}dt \end{aligned}$$
(17)

Then the gradient is:

$$\begin{aligned} \begin{aligned} \frac{dL}{d{\varvec{w}}}&=\frac{d{\mathscr {J}}}{d{\varvec{w}}} \\&=\int _{0}^{T}\{[\frac{dl({\varvec{x}}_t)}{d{\varvec{x}}_t^\top }-\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{x}}_t^\top }-\varvec{{\dot{\alpha }}}_{t}^\top ]\frac{d{\varvec{x}}_t}{d{\varvec{w}}}\\&\quad \;\;-\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}}\}dt \\&\quad \;\;+\varvec{\alpha }_{t}^\top \frac{d{\varvec{x}}_t}{d{\varvec{w}}}\Big |_{t=T}+(\varvec{\mu }^\top -\varvec{\alpha }_{t}^\top )\frac{d{\varvec{x}}_t}{d{\varvec{w}}}\Big |_{t=0} \end{aligned} \end{aligned}$$
(18)

There is obviously a solution:

$$\begin{aligned} \begin{aligned} \varvec{\alpha }_{0}&=\varvec{\mu } \\ \varvec{\alpha }_{T}&=0 \\ \varvec{{\dot{\alpha }}}_{t}^\top&=\frac{dl({\varvec{x}}_t)}{d{\varvec{x}}_t^\top }-\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{x}}_t^\top } \\ \frac{dL}{d{\varvec{w}}}&=-\int _{0}^{T}\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}}dt \end{aligned} \end{aligned}$$
(19)

Let:

$$\begin{aligned} {\varvec{G}}_t=-\int _{t}^{T}\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}}dt \end{aligned}$$
(20)

we have:

$$\begin{aligned} \varvec{\dot{G}}_t=\frac{d}{dt}\Big (\int _{T}^{t}\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}}dt\Big )=\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}}\nonumber \\ \end{aligned}$$
(21)

then there is the gradient of Algorithm 1:

$$\begin{aligned} \begin{aligned} {\varvec{G}}_T&=0 \\ \varvec{\dot{G}}_t&=\varvec{\alpha }_{t}^\top \frac{df({\varvec{x}}_t,{\varvec{u}}_t)}{d{\varvec{w}}} \\ \frac{dL}{d{\varvec{w}}}&={\varvec{G}}_0 \end{aligned} \end{aligned}$$
(22)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Li, C., Zhao, F., Lan, X. et al. Bidirectional dynamic neural networks with physical analyzability. Nonlinear Dyn 111, 16309–16324 (2023). https://doi.org/10.1007/s11071-023-08672-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11071-023-08672-8

Keywords

Mathematics Subject Classification

Navigation