arXiv:2609.04339cs.LGSep 2026

Manuscript Offprint

arXiv:2609.04339

Modular Deep Recurrent Neural Network: Application to Quadrotors

Nima Mohajerin, Steven L. Waslander

Nima Mohajerin

Dept. of Mechanical and Mechatronics Engineering University of Waterloo, Waterloo, ON, Canada nima.mohajerin@uwaterloo.ca

Steven L. Waslander

Dept. of Mechanical and Mechatronics Engineering University of Waterloo, Waterloo, ON, Canada stevenw@uwaterloo.ca

This paper was originally published in the Proceedings of the 2014 IEEE International Conference on Systems, Man, and Cybernetics (SMC), San Diego, CA, USA, 2014. The published version is available at https://doi.org/10.1109/SMC.2014.6974106.

Abstract—A modular deep Recurrent Neural Network (RNN) is introduced to facilitate the process of deploying various architectures of RNNs, and to automatically compute derivatives for gradient-based learning methods. The modularity leads to a set of new architectures, one of which includes feedforward inter-layer connections. By adding feedforward inter-layer connections in a multi-layer RNN, it is observed that the capability of the RNN to learn and model high-order dynamics and nonlinearities is significantly improved. The problem of vanishing/exploding gradient in space for a multilayer RNN is also alleviated using feedforward connections. These results are demonstrated using a quadrotor case study, for which a model of the altitude dynamics is learned with our particular network structure, while existing methods are unable to generalize as quickly or at all.

I. INTRODUCTION

Recurrent Neural Networks have been proposed for modelling dynamical systems using empirical data [1], [2]. Among various architectures, Nonlinear AutoRegressive with eXogenous input models (NARX) (and similar architectures, such as Nonlinear AutoRegressive Moving Average with eXogenous inputs - NARMAX) and Recurrent MultiLayer Perceptron (RMLP) have received a great amount of attention [3], [4], [5]. It has been shown that NARX is capable of learning dynamical systems [6]. In [3], the authors compare NARX with RMLP and a Memory Neuron Network (MNN) for identification of helicopter dynamics, and demonstrate that NARX is the most suitable method. However, the selection of number of delays poses a particular challenge in implementation [7], as a fairly good knowledge of the system to be modeled is required a priori in order to define sufficient delay units on a NARX input and output without over-specifying the network [3].

Other RNN architectures have also been explored for dynamic system modelling [8], [5], [9], [4]. Most of the architectures, however, are made of at most two hidden layers and feedback is used both inter and intra-layer. Although adding more layers to the RNN architecture will increase the capacity of the network to represent higher order and more complex nonlinearities, as in deep neural networks [10], [11], usually using multiple layers is avoided because of the so-called problem of vanishing/exploding gradient [12]. In fact, one of the main reasons to prevent the application of gradient-descent optimization methods to train RNNs is that as the

error gradient is propagated both back in time and towards former layers inside the network, it either explodes or vanishes, leading to an ill-conditioned Jacobian and numerical instability in the optimization. This problem exists both in the time and space domains of an RNN.

The motivation for our work stems from the need to identify accurate models for small unmanned aerial vehicles (UAVs), such as quadrotor helicopters. In recent years, quadrotors use has grown rapidly, both in research and industry, due to their ease of use, low maintenance requirements and agility of motion. Additionally, quadrotors possess interesting and complex dynamics which remain challenging to model accurately through all phases of flight. More accurate models are essential to enabling more precise flight control, which in turn will allow quadrotors to be used closer to objects in the environment and at higher speeds.

There have been quite a few successful attempts to capture the main dynamics of the quadrotor using physical properties of the system [13], [14]. However, modelling all aerodynamic effects, sensor and actuator uncertainties and all other nonlinearities using pure physical attributes of the vehicle is a very difficult task and requires wind tunnel testing to accurately assess aerodynamic coefficients. Therefore, a modelling approach based on empirical data collected from typical flight experiments may significantly reduce the effort required to define accurate models of quadrotor vehicles. Because quadrotors are dynamic systems, clearly this approach needs to be capable of capturing both dynamic characteristics and nonlinearities of the vehicle model.

In this paper, we aim at addressing the problem of vanishing/exploding gradient (in space) to add multiple layers to RNNs and make them capable of modelling high-order dynamical nonlinear systems such as a quadrotor. We will formulate a MODular DEep Recurrent Neural Network (MODERNN) architecture which covers a variety of recurrent architectures and facilitates the derivative calculation process. While this architecture can have multiple layers (hence the name deep), we will demonstrate that the presence of feedforward connections throughout a MODERNN contributes to decreasing the vanishing/exploding gradient problem in space, or equivalently the network output Jacobian will not be ill-conditioned even with multiple layers. Consequently, ordinary gradient descent training methods, such as the Levenberg-Marquardt algorithm (LM) are still applicable to train MODERNN. Through comparison with NARX and RMLP, we will assess the performance of MODERNN on modelling altitude of a quadrotor.

This work proceeds as follows. In the next section (Section II), our proposed RNN architecture is presented in detail. A modular method to obtain the derivatives of the network output(s) with respect to the network weights is presented afterwards in Section III. Then the learning algorithm for training MODERNN is described in Section IV. In Section V, the simulation results of MODERNN modelling the altitude of a quadrotor are presented and compared with NARX and regular Multilayer RNN (MRNN). Finally, Section VI will conclude the paper and outline future work.