A deep inverse-mapping model for a flapping robotic wing
Authors: Hadar Sharvit
Raz Karl
Tsevi Beatus
Venue: ICLR 2025 Poster (2025)
Keywords: robotics
control
flapping drones
deep learning
time series
inverse mapping
sequence to sequence
Primary area: applications to robotics, autonomy, planning
TL;DR: We solved an inverse-mapping problem of robotic, flapping-wing systems, by learning the input wing motion required to generate a desired aerodynamic force outcome. This framework is expected to simplify the control of such complex systems.

Abstract: In systems control, the dynamics of a system are governed by modulating its inputs to achieve a desired outcome. For example, to control the thrust of a quad-copter propeller the controller modulates its rotation rate, relying on a straightforward mapping between the input rotation rate and the resulting thrust. This mapping can be inverted to determine the rotation rate needed to generate a desired thrust. However, in complex systems, such as flapping-wing robots where intricate fluid motions are involved, mapping inputs (wing kinematics) to outcomes (aerodynamic forces) is nontrivial and inverting this mapping for real-time control is computationally impractical. Here, we report a machine-learning solution for the inverse mapping of a flapping-wing system based on data from an experimental system we have developed. Our model learns the input wing motion required to generate a desired aerodynamic force outcome. We used a sequence-to-sequence model tailored for time-series data and augmented it with a novel adaptive-spectrum layer that implements representation learning in the frequency domain. To train our model, we developed a flapping wing system that simultaneously measures the wing's aerodynamic force and its 3D motion using high-speed cameras. We demonstrate the performance of our system on an additional open-source dataset of a flapping wing in a different flow regime. Results show superior performance compared with more complex state-of-the-art transformer-based models, with 11\% improvement on the test datasets median loss. Moreover, our model shows superior inference time, making it practical for onboard robotic control. Our open-source data and framework may improve modeling and real-time control of systems governed by complex dynamics, from biomimetic robots to biomedical devices.

Published as a conference paper at ICLR 2025
A DEEP INVERSE-MAPPING MODEL FOR A FLAPPING ROBOTIC WING
Hadar Sharvit Raz Karl & Tsevi Beatus 122.3
1 School of Computer Science and Engineering
2 The Institute of Life Sciences
3 Center for Bioengineering
The Hebrew University of Jerusalem, Israel 9190401
(hadar. sharvitl, raz.karl tsevi beatus) @mail. thail.hue hwj..ujiii......
ABSTRACT
In systems control, the dynamics a system are governed by modulating its inputs achieve desired outcome. For example, control the thrust of quad-copter propeller the controller modulates its rotation rate, relying on a straightforward mapping between the input rotation rate and the resulting thrust. This mapping can be inverted to deternine the rotation rate needed to generate a desired thrust, However, in complex systems, such flapping-wing robots where intricate fluid motions are involved, mapping inputs (wing kinematics) to outcomes (acrodynamic forces) is nontrivial and inverting this mapping for real-time control is computa- tionally impractical. Here, we report a machine-learning solution for the inverse mapping of a flapping- wing system based on data from an experimental system we have developed. Our model learns the input wing motion required to generate de- sired aerodynamic force outcome. We used sequence-to to- sequence model tailored for time-series data and augmented it with novel adaptive-spectrut implements representation learning in the frequency domain. To train our model, we developed flapping wing system that simultancously measures the wing's s aerodynamic force and its 3D motion using high-speed cameras. We demonstrate additional open-source dataset of flapping
sequence-to-seqqeecc
layer that
the performance of our system wing in a different flow regime. Results show superior performance compared with more complex state-of-the-ard transformer-based models, with 11 improvement on the test datasets median loss Moreover, our model shows superior inference time, making it practical for onboard robotic control. Our open-source data and framework may improve modeling and real-tima control of systems governed by complex dynamics, from biomimetic robots biomedical devices.
INTRODUCTION
In machine learning frameworks that model causal relationships, e.g., for prediction, causes are typically mapped their effects. This forward mapping serves a wide range of applications, for example, predicting the motion of mechanical system based on the forces acting on it (Dearden & Demiris 2005), or weather forecasting (Yu et al., 2024), in which data on previous atmospheric conditions are used to forecast future weather. In other cases, though, rather than predicting system's 's response to set of conditions or inputs, it is required to control the system by modulating its inputs to achieve a desired outcome. Hence, systems control would benefit from an inverse mapping, which flips the causal relationship by mapping the desired outcome to the input that would have led to this outcome. Such inverse mapping would enable the design of controller that applies these inferred inputs to achieve desired behaviors. If the relationship between causes and their effects can be readily inverted, then inverse-mapping control approach is useful and simple implement. For example, in many robotic systems, a desired mechanical motion (outcome) can be directly mapped to the forces and torques that can generate (cause) (Nguyen-Tuee Pruyen-Tuong & Peters 2011).
"Webpage: https://www.hett www.bbaattaba.cc.o
Frammewrk, models, and data publicly available httthhhwww//aaaaaa/33//sssssseem

---

Published as a conference paper at ICLR 2025
Here, in contrast, address the case where the forward mapping between inputs and outcomes is nontrivial and difficult to calculate and invert. Examples of such systems include the mapping
between pacemaker signals and desired heart activity (iimantirakis et al. (2009), and the mapping
from injected insulin dosage to the resulting blood glucose level in a specific patient (Thomms & Heinemann (022). An additional noteworthy class of such systems is systems involving complex fluid motion, such as a flapping wing of an insect or flapping-wing
micro-air-vehicle (FW-MAV)
(Dickinson al. 1999] Sann & Dickinson 2002; Tu al., 2020; Bayiz & Cheng [ Keennon et al. 2012 Ma et al. 2013]Jafferis Jafferis et al. 2019; Karásek et al.) 2018) Coleman et al. 2015] Nguyen
Chan 2018), illustrated in Fig. | and Supplementary Movie 1. The fluid dynamics in these systems
are highly nonlinear and complex (Sane 2003 Ellington et al. 1996): the wing induces intricate vortex structures that determine the aerodynamic forces; during flapping the wing interacts with its own, previously generated, flow field, which introduces complex time dependencies; and, finally, flapping wings often deform due to their clasticity and interaction with the flow, which then effeets back on the flow itself, and on, resulting in a complex fluid-structure interaction (Shyy et al.
2010; Nakata & Liu 2012 Miller& & Peskin 2009| Young et al., 2009). Therefore, the forward mapping from wing motion (cause) to the aerodynamic force (outcome) often requires either using mechanical, scaled-up flapping-wing analog (Dickinson et al. 1999 Bayiz & Cheng 2021b W Whitney
& Wood 2010 Ellington al. 1996; Muijres et al., 2014 Hsu et al. 2019 Melis al. 2024). or
numerical solution of the Stoier-Stokes flow equation, which is highly computationally intensive and impractical for online system control. Quasi-steady-stee
approximations of the acrodynamic force are available and relatively simple to invert (Dickinson et al. 1999 Sane & Dickinson 22022] W Whitey Wood, 2010; Nakata et al. (013), however, they might become less accurate on sub-wingheat resolution and are, hence, typically used for evaluating wingheat-averagee forces (Bomphrey et al.)
2017 Dickinson et al. 1999 [Brunton et al. 2013).
Current FW-MAV designs circumvent the complexity of fluid dynamics by using a set of single- axis linear controllers based on insect-inspired control heuristics with manually-tuned parameters
(Keennon et al. 2012) Ma et al., 2013 Coleman et al., 2015 Karásek et al., 2018: Nguyen & Chan
et al. 2019: Tu et al.) 2020). Although this simplified approach has made stable flight and maneuvers possible, it might be sub-optimal in allowing these vehicles to exploit their full performance envelope and achieve the remarkable agility and robustness of flying insects and hummingbirds. The aerodynamics of flapping wing is, therefore, an appealing and practical test-bed for modeling the inverse mapping of complex system. In this work, we address this complex inverse- maperssg problem using deep-learning tools. To the best of our knowledge, there has been limited exploration of this approach in the existing literature.
(a) "Forward"
(b) "Inverse" Problem
Flapping-Wing System
Left camera
Right camera
Problem
Input Bliding
Windows
Steree High-Spead Cameras
Desired Outooms Dynamics
Dynamica
Wing
(+)
50
I fod
Desired Dutcom
Motor
[mm]
Sensor
Sensor
100
Input Sliding Windows
Forte Reswers Hol
ocoo
Sansor
Sansor
150
100
50
0
50
[mm]
y [mm]
Figure 1: Forward inverse mapping of physical system. (a) In forward mapping, model frwed (t) predicts system outcomes based on the tracked system dynamics, e.g., Given the history of the wing motion, predicting the current lift force generated by the wing. (b) In inverse mapping, model fiv (t) takes in futurc/desired system outcomes to infer the inputs that generate them. For the wing, using the future lift force to predict what wing motion created this force. (c) A diagram of a wing driven by a motor, with force and camera sensors. (d) Experimental setup: sample images from the two fast cameras, showing the wing and its markers. (e) The 3D position of the wing in motion. The yellow triangle represents the triangulation of the three markers and colored lines indicate the markers' trajectories. Two black arrows show the cameras' viewpoint.
2

---

Published as a conference paper at ICLR 2025
Here, we present machine-learinng model for the inverse mapping of experimental flapping- wing systems that learns the input wing motion required to generate a desired aerodynamic force outcome. We use -ooeennee-----uueeee model (Bahdanau et al., 2014) that we tailored for time-series data. Our framework employs a bidirectional recurrent neural network (RNN) backbone (Schuster & Paliwal| (997) combined with time-attention mechanism and Adaptive Spectrum Layer (ASL), which uses both amplitude and phase information to capture the intricate dependencies between motion and resulting forces in both the time and frequency domains. To generate a dataset of wing kinematics and aerodynamic forces for training and testing our model, we developed a mechanical flapping- wing system. Our system controls wing motion, measures it in 3D using two fast cameras, and simultaneously measures the forces generated by the wing. We trained and tested our model also on an open-source dataset of a flapping wing operating in a different flow regime (Bayiz & Cheng 2021b a). Our approach demonstrates comparable and even superior performance when compared with totte-of-theart transformer-based models (Vaswani et al. 2023), with 1 11% improvement on the test datasets. The ASL performs representation learning in Fourier space, allowing for the mitigation of noise and amplification of important frequencies, which becomes especially helpful in analyzing periodic systems such as flapping wings. Learning such inverse- mapping problems may directly improve the control of systems governed by complex dynamics, such as fluid motion. In FW-MAVs, for example, integrating such a trained network into the flight controller would enable efficiently calculating the wing kinematics required for exerting desired forces and torques on the vehicle, thereby exploiting its full performance envelope. We believe that this framework can apply to other complex domains, from robotics to biomedical devices.
2 RELATED WORK
2.1 FORWARD-MAPPIN MODELING
Several approaches have been used for forward mapping modeling of flapping wing systems, that is, finding the aerodynamic forces resulting from given wing motion. One direct method is measuring the aerodynamic forces on a scaled-up wing model flapping in a fluid and mimicking the motion of, for example, experimentally measured kinematics of an insect's wing (Dickinson et al. 1999
Bayiz& & Cheng 20216 Whitney & Wood 2010: Ellington et al.) 1996, Muijres et al. 2014 Hsu al. 2019). With proper scaling of the wing motion and fluid viscosity, the forces measured on the scaled-up model can be rescaled back to the corresponding insect forces. Another method is Computational Fluid Dynamics (CFD), where the Stoier-Stokes flow equation is numerically solved on a spatial grid and the aerodynamic forces on the wing are then calculated from the solved flow. While CFD has been instrumental in understanding the fluid dynamics of flapping wings (Dickinson
& Muijres 2016 Nakata et al.) 2015), insect stability(Gao et al.] 2011] Sun 2014 |Perl et al. [023)
and complex fluid-structure interaction: Young et al.) (2009): [Shyy et al. (210); Nakata & Liu (0112
Miller & Peskin (2009), this class of methods is computationally intensive and, hence, impractical
for inverse modeling in a real-time flight controller. A dramatic simplification offered by quasi- steady-state (QS) aerodynamic models, which approximate the aerodynamin force of wing
function of its instantaneous motion Dickinson et al. (1999); Sane & Dickinson (2002); Wogs-Fogh (1973); Whitney & Wood (2010). For specific wing geometry, QS models can be calibrated and tuned based on a scaled-up up mechanical wing model Dickinson et al.] (1999); [hhinnyy & Wood (2010) or CFD simulation&Nakatte et al. (2015). Because these models provide an analytical form of the aerodynamic force, they can, in principle, be inverted and used for real-time control. Yet, QS models neglect complex flow-related features, for example, wing vorticity, wing interaction with its previously generated flow, and fluid-structure interaction, which may be important for utilizing the full capabilities of FW-MAV.
Deep learning models have been applied for problems in fluid dynamics, such as turbulence and flow contro/Ling et al. (2016); |Buntoo et al. (2016); Duraisamy et al. (2119) and for mitigating windy conditions and structural damage in quad-copter control O' Connell et al. (202)). The impressive achievements in quad-copter control do not require significant inverse modeling due to the relatively simple mapping between desired forces and torques and rotor speed. This is markedly different than the complex aerodynamics of flapping wings. For a flapping wing, deep learning models enable capturing the complex forward mapping from wing motion to aerodynamic forces without simplifying assumptions. In this approach, a model is trained on a dataset of measured or calculated forces obtained from a scaled-up mechanical model or CFD, respectively, based on set of predefined
3

---

Published as a conference paper at ICLR 2025
wing kinematics. A trained model can potentially prediet these forces for given input kinematics and do so much faster than CFD models and potentially more accurately than QS models. The applicabilitt of such a model depends, naturally, the quality and breadth of the dataset it has been trained on. In 2021, Bayiz and Cheng introduced a state-space deep learning approach that accurately predicted aerodynamic forces using data from scaled-up mechanical wing [Bayiz & Cheng (2021b). Their model, trained and tested with 548 diverse wing kinematics, demonstrated the predictability of aerodynamic forces based on a half-wingbeat look-back window of the previous wing kinematics. Here, we invert this dataset to model the system's 's inverse aerodynamics.
Beyond aerodynamics, forward mapping modeling applies to simulating diverse mechanical systems, such as humanoid robot motion Tassa et al. (2012). In these simulations, the state of the system encompasses generalized positions and velocities, governed by equations of motion incorporating inertia tensors, external forces, and control inputs. Using a semi-implicit Fuler integration scheme enables the iterative calculation of the system's 's state based on applied actions.
2.2 TIME SERIES MODELING AND FOURIER ANALYSIS
Time-series modeling has been fundamental across various disciplines, including climate modeling Mudelsee (019)). biological sciences Stoffer & Ombao (2012). and finance [öse et al. (017)) Traditional methods such as auto-regressive and exponential smoothing rely on domain expertise
Box et al. (2015), but modern machine learning techniques are increasingly adopted owing to their data-driven nature and scalability [Lim& & Zohren (202T). Recent architectures that use FFT (Fast Fourier Transform) include the following: AutoFormer features distinct architecture: the encoder emphasizes modeling the data periodicity, while the decoder includes accumulation structures for trend-cyclical components and stacked auto-correlation mechanisms for periodic components. This mechanism replaces traditional self-attention methods and efficiently computes auto-correlation using FFT Wu et al. (2021). Similarly, FedFormer introduces low-rank approximated transformation in the frequency domain to expedite attention mechanisms in time series forecasting Zhou et al. (2022). Adaptive Temporal- FrequerlyFre Networks utilize FFT to extract trend and periodie features for improved forecasting accuracy| Yang et al. (2022). StemGNNN employs Graph Fourier Transform (GFT) and Fourier transform capture inter-series correlations and temporal dependencies effectively Cao et al. 2020)). Notably, StemGNN automatized the learning of inter-series correlations from data, leveraging spectral representations for prediction.
In Fourier Neural Operator (FNO), a parameterized low-pass filter in Fourier space facilitates the learning of mappings from functional parametric dependencies to solutions, thus enabling the exploration of a broad family of partial differential equations Li et al. (2020). Additionally, the random Fourier method and random Fourier softmax (RF-softmax) technique offer efficient and accurate random sampling, exploiting frequency-space features Rawat et al. (2019).
The adaptive spectrum layer (ASL) reported here uses both the magnitude and phase of the Fourier spectra for representation learning, weighs frequency bins accordingly. and functions representation layer. In contrast, other approaches often rely on FFT for efficient computation in Fourier space, well as overlook the comprehensive information provided by the Fourier transform, or lack a gated weighing mechanism that considers all information from other frequency bins.
standalone
METHODS
We developed flapping wing system (Fig. [T] in which we measured the wing kinematics using high-speed cameras. The wing degrees of freedom were characterized by Mx=3 Euler angles (Fig. 2): the stroke angle o, elevation angle 6, and wing pitch angle tb. The aerodynamic forces were measured in sync with the wing kinematics using My=4 vertical force sensors. The essence of mapping modeling in this system lies in learning the relationship between desired output acrodynamic forces and the input wing kinematics that generate them. Intuitively, the input to the system is a time sequence of desired aerodynamic forces that the wing should generate. The output is the full wing kinematics that, when applied to the wing, would result in the desired forces. The system learns the inverse mapping in two parallel backbones: learning the imeedependent (Seq2Seq) and frequency-depentn and frequencies that are relevant for the mapping are learned.
(ASL) relationships between the forces. As a result, both the timestamps
4

---

Published as a conference paper at ICLR 2025
2
Elevation
Pitch
Stroke
Figure 2: Wing degrees-of-freedom The three angles of wing rotation: elevation angle 0 (left, shown in side view), sing-pitch angle v (middle, shown in a front view), and wing-stroke angle ø (right, shown in top view). The it y: vectors represent the Cartesian lab frame of reference.
3.1 MULTI-VARIATE MULTI-TARGET TIME SERIES FRAMEWORK
Problem Definition
We reformat the generalized time series formalism to our inverse-mapping modeling framework of (desired future o (requiree input kinematics). Without loss of generality, consider wing kinematics (Fig. 2 as required system input, and system- measured forces, provided from set of sensors (Fig TT as desired future outcomes. given N distinct time-series events that represent data
where Ft E 1 indicates the force values of the j'th sensor the i'th dataset at times 1, 1,2,...,ty Our goal is to predict the corresponding N distinct wing kinematics { {K J. N where Kij. 1:to E RRo,, indicates the kinematic values of the j'th degree 1=t
from MF (force) sensors { (1r 1=tg]j=11 1 [=1
LMp 1
of freedom in the i'th event at times 1, to. To simplify our notation, we will mostly describe the kinematics terms of three angles (M { fiit Voxte J where di, 8% vi represent the stroke, elevation, and pitch angle at time in the i'th event, respectively (Fig. 2 Formally, we aim model the following conditional probability distribution:
ploi=ont: Oizo vi tosto+ 1===1
Mr
(1)
This is the probability of wing kinematics at times tE [0, to] given the set of future forces at times ('E(to,4, to + - 1] at fixed future window of size т that they generated. These, alongside the learnable parameters Φ. are optimized to minimize loss using an SGD-like process. In practice, we reduce the problem to learning one-step-aheet prediction model, for any iE[N]
p p( fg. Vil (P Mr b);
where an optimal model f for which Φ5 04 w/ f (1 Mr) } explored, predict the distribution of wing kinematics at time given the measured forces at time t.
3.2 SEQUENCE-TO- -EQUENCC
We instantiate our model f as a Seq2Seq model [Bhhdanau et al. (2014), adjusted for time series. More precisely, we utilize an RNN (Recurrent Neural Network) encoder embedding alongside an RNN decoder intertwined with an attention mechanism to predict the next time step given all previous window values (Fig. 3}. The encoder transforms the input time series data into an embedded representation using an Adaptive Spectrum Layer (see below), followed by bidirectional GRU (Gater Residual Network). The final hidden states from both forward and backward passes are concatenated and reshaped through linear layer to serve the initial state for the decoder. Crucially, an attention mechanism computes attention weights based on the decoder's 's current hidden state and all the encoder's 's outputs. This ensures the decoder focuses relevant time steps from the encoder when predicting subsequent values. The decoder starts with the last value the input sequence and, guided by the attention mechanism, iteratively generates predictions for the forecast horizon.
5

---

Published as a conference paper at ICLR 2025
81
M/A
IFFT
((
9+
$1-1
GRU
Despout
FOjB
(FC)
co0 sin
GRU Encoder
Sooking Nagniaade
By to T.
Bpy
Tay
Low Filter
Adaptive Spectrum Layer (ASL)
Figure 3: System architecture: Seq2Seq with ASL. The input sequence is encoded by adaptive spectrum layer (ASL). ASL conducts representation learning in Fourier space, assigning weights to each frequency bin using the entire complex signal, and then reverting to the time domain via IFFT. skip connection is added from input to representation. Subsequently, a GRU encoder generates a fixed-size representation. Following this, the attention (fully connected, FC) mechanism utilizes the current decoder hidden state and encoder context vector to compute attention weights Wt. The last encoder state employed instead of the (non-existent) decoder state in the initial iteration. These attention weights adjust the encoder context vector based on the current decoder hidden state. Finally, the resulting weighted tensor passes through a GRU-based decoder to predict the next step ft, with T representing the prediction window size.
Adaptive Spectrum Layer. Motivated by the potential benefits of frequency domain analysis, introduced the Adaptive Spectrum Layer (ASL.) layer, shown in Fig. 3 The ASI. takes in the raw input signal and applies representation learning in Fourier space. It then combines the new representation and the signal via skip connection and propagates this output to the intermediate layers of the neural network in which it is encapsulated.
The forward pass begins by applying a real-valued (symmetric) Fourier transform (FFT) the raw input signal æ. Then, a low-pass filter is used to retain relevant frequency information below set frequency. The magnitudes ry, and phases 0,, of each Fourier component (the i'th bin) are then concatenated to form a new complex tensor é, in which every entry consists of the respective magnitude and the phase represented by its sine and cosine values. We then use fully connected layer (FC) with additional non-linearity to derive a new representation from â. Subsequently. dropout layer is applied to the stacked hidden representation hu,..., h after which fully connected layer transforms the representation mechanism. In this vector, every entry corresponds to the weight associated with its respective frequency bin in Fourier space. Lastly, the learned weights are point-wise multiplied with the original complex vector, and an inverse Fourier transform (IFFT) is used to convert the new signal back to the time domain.
bounded weight vector Wi, ..., Wfx using simple gating
4 DATASETS
4.1 OUR MEASURED DATASET: A WING FLAPPING IN AIR
A Flapping Wing System. We developed a flapping wing system (Fig. - Supplementary Movie 1) that can move with predetermined stroke angle profile Φ(t), and with passively-determing elevation (t) and pitch (t) angles. That is, ((t) and (+)) are outcomes of the dynamic interactions between the wing and the surrounding air, wing inertia, and wing elasticity Beatus & Cohen (2015).

---

Published as a conference paper at ICLR 2025
The wing consisted of a 12.7pm thick Mylar sheet, with leading edge made of carbon-fiber rod Imm in diameter. Wing span was 7cm and its maximum chord was 3cm. A 3D-printed hinge connected the wind to a brushless DC motor (Maxon ECXSP06M BL KL-A-HP-I2V with built-in 15:1 gear ratio and an angular position encoder. Thus, the motor was driving the wing directly by following predetermined stroke angle profile (t) using designated controller we developed.
Measurement Setup. The measurement setup consisted of two modules: a fast-imaging setup that measured wing kinematics (input), and force sensors that measured the vertical force generated by the wing (outcome). The imaging setup included two high-speed cameras (Phantom v2012, Vision Research) in stereo configuration (Fig. [ Supplementary Movie 1) with parallel optical axes. The cameras were mutually calibrated to find their intrinsic and extrinsic matrices. In each experiment, the two cameras recorded the flapping wing and operated in syne at 10,000 frames per second. To track the wing. we attached three white circular markers onto the wing's camera-facinn surface and tracked the markers' positions in each camera view using basic segmentation and optical flowHHrrn & Schunck (198T). Subsequently, we used the 2D markers' trajectories from both cameras to triangulate the position of the markers in 3D the lab frame of reference based on the cameras' calibration. Finally, under the verified assumption that the wing maintained a flat shape during its motion, we converted the three 3D marker coordinates into the standard Euler angle description for flapping wings of é(t), ((t), (t).
The second experimental module for force measurement - consisted of four force sensors (SI-USB4, Interface Inc.) arranged in symmetric cross configuration, with the motor attached at its center (Fig. -e). The sensors measured in sync at 5,000 samples per second, and their four readouts of vertical forces represent the aerodynamic force output generated by the wing. Treating all readouts as separate signals, rather than, for example, summing them, is relevant for torque calculation and phase-related feature extraction. Finally, the two data streams of the wing angles and forces were synchronized and combined to form single event in our dataset.
Data Collection. We measured a total of - events that span different wingbeat frequencies and ((() profiles. This dataset is publicly available. Each event corresponds to a wing trajectory and force data, 2-6 wing-beats, or 0.75 seconds, long. The range of profiles was obtained by using a parameterization for (tt) Berman & Wang (2007) that provides a continuum of profiles from sinusoidal triangular as a function of single parameter [0 1]:
sin (K sin(2x 2 d
(t)) =
sin
K
where f is the wingbeat frequency and & is the stoke peak-to-pest tokkkkk amplitude. Our dataset included events with fe(o, 20) Hz and bE[T/66 x/3 r3rrd. Due to the range of wing speeds in the dataset, the wing's Reynolds number was 1,000 50,000, which covers the flow regimes of medium to large insects, small birds, and FW-MAVs.
The resulting dataset (Table Fig. 4 is formulated as D - (Pi. Mr. {K1 MM N
J==1 [ For i=1
each event 2=1, ..., N there are Mr force signals with to entries and Mx kinematic signals with to entries. We use 4 (four force sensors) and Mr = for stroke, pitch, and elevation angles. The upper scripts [Mr] and & [Mx] represents the f'th force sensor and k'th kinematics respectively. Also, note that fo; is not the same for all i, allowing events of different duration.
Dataset
No. of Samples per
Input dim.
Output dim.
Total samples
Sample Rate
Events
event
Our
153
550-3787
3
438,552
5,000 Hz
Open Source
548
480
263,040
25 Hz
Table 1: Datasets. The two datasets used in the comparative analysis. "Our" dataset is the experimen- tal flapping- wing dataset measured in our system, and "Open Source" represents the flapping-win wing dataset reported in Bayiz & Cheng (2021a). Each event represents an individual wing kinematic profile. Event duration counted in samples.
7

---

Published as a conference paper at ICLR 2025
Prediction
Our Flapping-Wing
Open Source Flapping Pattern
Eesopla
Dample
Exampla
Fooce TaaeeToupss poy
92
Aeglo Tagpie Preetabiee Eaat
3
53
Number
Figure 4: Prediction examples. Four pairs of onput- scenarios from our dataset (left, described
in 4.1) and the open source dataset Bayiz & Cheng (2021a) (right, described in 4.2p. The upper section displays force/torque inputs representing the desired system outcome. In our dataset, these are Fi, F2, F3, F1 as depicted in experimental setup (see Fig. -)) In the open source dataset, the outcome is represented by set of three measured forces Fa, y. and Fg, and two measured torques My. Ms. In both experiments, the targets are similar and represented in the lower section as the corresponding true angle labels and predicted angles, generated by our adapted Seq2Seq+ASL model trained model the inverse mapping. Different system outcomes (top) result from different system dynamics (bottom) in each event. The events shown span various wing kinematics.
4.2 OPEN SOURCE DATASET: WING FLAPPING IN VISCOUS FLUID
The second dataset we used (Table Fig. has been published by Bayiz & Cheng (222b)) who measured the wing kinematics and aerodynamic forces of a like wing flapping in mineral oil. Wing kinematics {o, } controlled by step-motors and the aerodynamic forces by three forces- and two torque-sensors. The Reynolds number of the system was 1000, modeling medium-sized insects. This dataset included 548 events with various kinematics, each having 480 samples of synchronized kinematics-fore data taken at 25Hz. Bayiz and Cheng used this dataset to develop deep-learning system that learned the nowward-mapping from wing kinematics forces and torques. Here, we used this dataset in reverse to learn the inverse mapping.
measured
5 RESULTS
We trained an individual model on the two datasets, infer the wing kinematics that generated given force time-series. The input signals in the two datasets have different dimensionality, units (force vs. force and torque), and sampling rates. Both datasets were randomly divided such that 75% of the events were used as training set, 10% reserved for validation, and 15% for testing. Throughout the training process, standard syper-paramettr tuning loop was used search through hyperparameter space including model parameters (e.g., the number of attention heads, and the size of the hidden representation vector) and input window characteristies (history size, batch size, learning rate, normalization schemes, etc.). For further technical details see Appendix A.3
Model performance was evaluated on the test set using the Mean Absolute Error (MAE) loss of the predicted wing angles. The MAE for each angle was calculated per event, averaged across the three predicted angles per event, and then averaged across each test set. The resulting model architectures relatively small, with few hundred to ~00. 000 parameters. Hence, training model took <3min on a single Nvidia RTX 3090 GPU with 24 GB RAM, and an exhaustive hyperparameter search took 55hr the same hardware.
8

---

Published as a conference paper at ICLR 2025
Methods
Linear AutoFormer FedFormer Seq2Seq+ASL Seq2Seq
Transformer NLinear
Mean
0.26662
0.2380
0.3049
0.1323
0.1471
0.1476
0.2800
Ours
Median 0.2643
0.2271
0.2920
0.1216
0.1236
0.1430
0.2836
Mean 0.3223
0.3626
0.3003
0.1130
0.1206
0.1123
0,3258
OpenSre
Median 0.3070
0.3379
0.2875
0.0908
0.1058
0.1021
0.3131
Table 2: Results. Comparison of Mean Absolute Error (MAE) in radians between various models on both Ours and the open source datasets, aggregated across all test events using Mean or Median. Best- and
models are highlighted in bold and underscore, respectively.
Ours
Open Source
0.6
MAE Test
0.4
0.3
0.2
0.1
0.0
Seq25eq
Transformer
AutoFormer
FedFormer
+ASL
Figure 5: Comparison with state-of-the-art models. The distributions of test loss across seven models for two datasets: Our dataset and the open-source dataset [Baii datasetBBayiz Cheng (2021b). Inside each box, the horizontal line represents the median MAE, the colored box represents the 2nd and 3rd quartiles, and the whiskers represent the Ist and 4th quartiles. Outliers are indicated by open circles. adapted Seq2Seq+ASL model demonstrates superior performance, particularly evident in its median values, outperforming other models. Interestingly, Seq2Seq+ASL has more outliers than the Transformer, which explains the difference between their mean and median metries.
The performance of our models, with and without ASL, the two test sets are shown in Table 2 and Fig. [5] with examples of representative events in Fig. 4 Additionally, these results are compared with the performance of several state-of-the-an oftthe-rtt models both datasets (implemented in Zeng et al. (2023) ) Transformer Vaswani et al. (2023), AutoFormer Wu et al. 2. FedFormer "Zhou et al. (2022) NLinear ZZen al. (202)). and a Linear model represented fully connected layer that is applied on the flattened input (see the Appendix for further details).
Inference accuracy. Our results show that the inverse dynamics problem of a flapping wing system can be well-approximated by deep learning models. First, the data in Table 2 shows that the ASL is consistently improving performance by 11.2%, 1.7%. 6.7% and 16.5% compared with Seq2Seq alone. The improvement offered by the ASL frequency-space representation layer demonstrates the benefit of using such representations, especially for periodic signals. Second, Seq2Seq+ASL is consistently the first- or second- best model within the tested models and metrics. On our dataset with MAR metrics, Seq2Seq+ASt ASL outperforms the Transformer signed rank test Pvalue=0.00 and is the hest-tested model, improving by 10% concerning standard Seq2Seq and with 10.4% compared with Transformer. On the same dataset but using the median metrics, Seq2Seq+ASII and standard Seq2Seq show equivalently best performance, improving by 13.6% compared with Transformer. On the Open Source dataset Seq2Seq+ ASL and Transformer perform equally well under the MAE metric, (Seq2Seq+ASL outperforms the Transformer in 54% of the test set, Wilcoxon signed rank test 0058). Under the median-MAF metric. Seq2Seq+ASL is the best-tested model, improving Transformer by 1 %. In most tested cases, the performance of the Seq2Seq+ASI. model suggested here is superior to more sophisticated state-of-the-an models.
2/3 of the test set (Wilcoxon
Inference time. even though Seq2Seq+ASL has x4 more parameters (~200k) compared with the Transformer model (~50k, Appendix), The inference time of Seq2Seq is x 10 shorter

---

Published as a conference paper at ICLR 2025
compared with Transformer (2.00=0.13ms vs. 19.53=5ms). This difference makes Seq2Se++ASL more practical for integration in onboard flight controllers of FW-MAVs, while the transformer latency is too long with respect to the typical wingbeat period of the existing prototypes. The scaling of the inference time with the number of parameters of each of these two models shows that Seq2Seq+AS inference time is practically constant with the number of parameters, while the Transformer inference time increases significantly with the number of parameters (Appendix)
Ablation tests. To characterize the functionality of the ASL, we performed a suite of ablation tests on all of its building blocks. We tested the sine/cosine vs. angular representation, low-pass filter cutoff frequency, ASI. gating mechanism, ASI. per-frequency layer (combining different frequency bins after FFT not), and learning new complex number representation from the FFT vector or not. The full results are given in Supplementary Table 1. Briefly, encoding the phase data as sine/cosine was slightly, but not conclusively better than an angular representation (probably due to the improved encoding of periodicity of sine/cosine). Other attributes, such as the tow-pass filter cutoff frequency, were highly significant. Testing three different frequencies: 20, 100, and 210Hz, we see that all of the top-11 10 models had a cutoff frequency 2 2100Hz.
6 CONCLUSION
We presented an inverse-mapping modeling framework, in which the required system inputs (wing kinematics) are predicted given the desired system outcomes (aerodynamic forces). A specific realization of such a model was explored using an experimental flapping wing system from which we collected dataset capturing the relationship between wing kinematics and the resulting forces. The task was then formulated as inverse mapping from the output forces of the system to the wing kinematics that generate them. To model this problem, we proposed deep learning architecture based on sequence-to- sequence (Seq2Seq) model with an Adaptive Spectrum Layer (ASL). The ASL performs representation learning in the Fourier domain, using both amplitude and phase information. As such, the ASL captures important frequency patterns, which is particularly beneficial for periodic signals like those in flapping wing systems, and filters out undesired noise. On both datasets, which represent two flow regimes, model demonstrated superior performance compared with other state-of-the-aar models, achieving up to ~11% improvement. These results support the current view that Transformer- models not necessarily optimal for time-series analysis ZZng et al. (2023). Further, our RNN implementation is expected to be significantly more computationally efficient than Transformer models, which would benefit deployment in onboard systems.
Interestingly, on the current task, our model outperformed FedFormer, which also uses frequency data. This may be explained by the fact that FedFormer is forecasting model in which the input and output dimensions are identical, unlike in our use case. To apply FedFormer to such cases, one had to change output dimension, which might have hindered its performance. More crucially, to implement an attention mechanism in linea--iime complexity, FedFormer implements random frequency sampling on which it builds its frequency-domain representation. Yet, in our case, because attention, we could use a frequency-domain representation
we did not use computationally-expee on the entire spectrum, without data loss.
Limitations. First, due the challenges of developing a fully operational flapping robotic device, our model was demonstrated on bench-top device with a single wing. The model could be incorporated into FW-MAVs by training in a similar bench-top configuration and then including it as a module in the onboard controller that converts force and torque commands into wing actuation. Second, due to the limits of our datasets, our system was not trained to generalize on arbitrary wing forms and Reynolds numbers. Further, the the repertoire of wing motions, compared, for example, with better-controlled wing models. Yet, this simple actuation may, in fact, fit with current FW-MAV designs, since all of them use a similar single-axis drive, relying on fluid-structure interaction to yield complex insect-like wing kinematics.
in our system has a single axis, which might limit
In summary, despite these limitations, we believe that the proposed awerse-mapping framework could be seamlessly integrated into a wide range of applications and improve the modeling and control of complex systems, from biomimetic robots to biomedical devices.
This work was supported by the Israel Ministry of Science and Technology Grant No. 3-17400.
10

---

Published as a conference paper at ICLR 2025
REFERENCES
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint 0r9iv:/409.047.. 2014.
Yagiz Bayiz and Bo Cheng. Flapping wing acrodynamics with prssm [dataset]. https:/ /
202 URL
Yagiz E Bayiz and Bo Cheng. State-space aerodynamic model reveals high force control authority and predictability in flapping flight. Journal of the Royal Society Interface, 18(111):20210222, 2021b.
Tsevi Beatus and Itai Cohen. Wing-pitch modulation in maneuvering fruit flies is explained by an interplay between aerodynamics and a torsional spring. Physical Review E, 92(2):022712, 2015.
Gordon Berman and Z Jane Wang. seergy-mnnmizzigg kinematics in hovering insect flight. Journal of fluid mechanics, 582: 102-113311,,,- 2007.
Richard J Bomphrey, Toshiyuki Nakata, Nathan Phillips, and Simon M Walker. Smart wing rotation and trailing-edge vortices enable high frequency mosquito flight. Nature, 544(7648):92-95, 2017.
Joos-Hendrik Böse, Valentin Flunkert, Jan Gasthaus, Tim Januschowski, Dustin Lange, David Salinas, Sebastian Schelter, Matthias Seeger, and Yuyang Wang. Probabilistic demand forecasting at scale. Proceedings of the VLDB Endowment, 10(12):1694-1700 1705, 2017.
George EP Box, Gwilym M Jenkins, Gregory C Reinsel, and Greta M Ljung. Time series analysis: forecasting and control. John Wiley & Sons, 2015.
Steven L Brunton, Clarence W Rowley, and David R Williams. Reduced-order unsteady aerodynamic models at low reynolds numbers. Journal of Fluid Mechanics, 724:203-233, 2013.
Steven L. Brunton, Joshua Proctor, and Nathan Kutz. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 1 113 3937, 2016. doi: 10. 1tt33/pa...1173841111 URL http:: /www pnas. wttp://///////////////// /tt.oo//abss//e 1073/ pnass 151738417
Defu Cao, Yujing Wang, Juanyong Duan, Ce Zhang. Xia Zhu, Congrui Huang, Yunhai Tong, Bixiong Xu, Jing Bai, Jie Tong, et al. Spectral temporal graph neural network for multivariate time-series forecasting, Advances in neural information processing systems, 33:17766-17778, 2020.
David Coleman, Moble Benedict, Vikram Hrishikeshavan, and Inderjit Chopra. Design, development and flight-testing of a robotic hummingbird. In AHS 7/st annual forum, pp. 5-7, 2015.
Anthony Dearden and Yiannis Demiris. Learning forward models for robots. In IJCAI, volume 5, pp. 1440, 2005.
Michael H Dickinson and Florian T Muijres. The aerodynamics and control of free flight manoeuvres in Drosophila. Phil. Trans. R. Soc. B, 371((104):20155338 2016.
Michael H. Dickinson, Fritz-Olaf Lehmann, and Sanjay P. Sane. Wing rotation and the aerodynamic basis of insect flight. Science, 1954 1999, doi: 10. 2etp///ccenne.2..544757 1954. URL https:: wwwp://wwww//..../ wwtp://nnn.....ooo//eee/e///e//e
284. 5422
1954
Karthik Duraisamy, Gianluca Iaccarino, and Heng Xiao. Turbulence modeling in
the age of data. Annual Review of Fluid Mechanics, 51(1):357-377, 2019. doi:
10. 10.11146a 1tta://ammnee--nii-000055555 Audd-ii0idi-001110000055 Ciruueev-fuuidd-0011--------
URL
CP Ellington. vandenBerg, AP Willmott, and ALR Thomas. Leading-edge vortices in insect flight.
Nature, 384(6610):666-6330 December 1996. ISSN 0028-0836. doi: 10. 1038//36466....
11

---

Published as a conference paper at ICLR 2025
Na Gao, Hikaru Aono, and Hao Liu. Perturbation analysis of 6DoF flight dynamics and passive dynamic stability of hovering fruit fly Drosophila melanogaster. Journal of Theoretical Biology, 270(1):98-111, 2011.
Berthold K.P. Horn and Brian G. Schunck. Determining optical flow. Artificial Intelliggeee,, 17(1))185- 203, 1981. ISSN 0004-3702. doi: http:://obbuug////oooooo00001110 URL https
/ www. sci encedi rect. com/ /ttpc///s..eeeeeeeeeeeeeeaee/aa/ 90040000000477020800022222
Shih-Jung Hsu, Neel Thakur, and Bo Cheng. Speed control and force-vectoring of bluebottle flies in
a magnetically levitated flight mill. Journal of Experimental Biology, 222(4);jeb1872111 2019.
Noah Jafferis, E. Helbling, Michael Karpelson, and Robert Wood. Untethered flight of an insect- sized flapping-wing microscale aerial vehicle. Nature, 570:491-4999 06 2019. doi: 10.1038/ 1115660019-132-00
Matěj Karásek, Florian T. Muijres, Christophe De Wagter, Bart D. W. Remes, and Guido C. H. de Croon. A tailless acrial robotic flapper reveals that flies torque coupling in rapid banked turns. Science, (6000):1089-1111))) September 2018. ISSN 0036-8075, 1095-9203. doi: 10. 1126/science.aat0350. URL http:/ www. wtt.:e/...nccmm.....oo/oooo/////
SCi www.ennccaaa.... 0335
Matthew Keennon, Karl Klingebiel, Henry Won, and Alexander Andriukov. Development of the Nano Hummingbird: A Tailless flapping wing micro air vehicle. In 50th AIAA Aerospace Sciences Meeting including the New Horizons Forum and Aerospace Exposition, pp. 1-24, 2012.
Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.0889) 2020.
Bryan Lim and Stefan Zohren. Time-series forecasting with deep learning: survey. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 379 (2194):20200209, February 2021. ISSN 1471-2962, doi: (0.1098/sta.2222.00000 URL http
wcdx.doo.org///1/ 1098 099 rsta 2020. 0209
Julia Ling, Andrew Kurzawski, and Jeremy Templeton. Reynolds averaged turbulence modelling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 807:155-166, 2016. doi: 10. 20.1017/ffm.2166.615
Kevin Y. Ma, Pakpong Chirarattananon, Sawyer B. Fuller, and Robert J. Wood. Controlled Flight of Biologically Inspired, Insect-Scale Robot. Science, 340(6132):603-607,, 2013. doi: 10.1126. science. 1231806.
Johan M Melis, Igor Siwanowicz, and Michael H Dickinson. Machine learning reveals the control mechanics of an insect wing hinge. Nature, pp. 1-9, 2024.
Laura A Miller and Charles S Peskin. Flexible clap and fling in tiny insect flight. Journal of Experimental Biology, 212(19):3066-3000 2009.
Manfred Mudelsee. Trend analysis of climate time series: A review of methods. Ecrth-science reviews, 190:310-322, 2019.
Florian T Muijres, Michael J Elzinga, Johan M Melis, and Michael H Dickinson. Flies evade looming targets by executing rapid visually directed banked turns. Science, 344(6180) 2014. doi: 10.1 1..112///cieece. 1248955.
Toshiyuki Nakata and Hao Liu. A fluid-structure interaction model of insect flight with flexible wings. Journal of Computational Physics, 231(4): 1847, 2012. ISSN 0021-9991. doi: https:// Moi.org//0.1001//.jp...000 2011. 10005. URL http::ttt/://ttt sci enceidiiiiiccccccc rect cwm/scieccee.o..cooc.o / article/p 9910211999991111177771 11006474
Toshiyuki Nakata, Hao Liu, and Richard J. Bomphrey, A efd-informed quasi-steady model of flapping- wing aerodynamics. Journal of Fluid Mechanics, 783:323-343, 2015. doi: 10.1017/jfm.2011 sttiffm..21555377
12

---

Published as a conference paper at ICLR 2025
Quoc-Viet Nguyen and Woei Leong Chan. Development and flight performance of biologically-
inspired tailless flapping-wan wing micro air vehicle with wing stroke plane modulation. Bioinspiration & Biomimetics,, 14(1)001 dec 2018. doi:
URL httpss:///
doi oailorgg/100 10. 1
31 90/ aaefa(
Duy Nguyen-Tuong and Jan Peters. Model learning for robot control: a survey. Cognitive processing, 12:319-340, 2011.
Michael O'Connell, Guanya Shi, Xichen Shi, Kamyar Azizzadenesheli, Anima Anandkumar, Yisong Yue, and Soon-Jo Chung. Neural-fly enables rapid learning for agile flight in strong winds. Science Robotics, 7(66):eabm6597, 2022.
Illy Perl, Roni Maya, Oron Sabag, and Tsevi Beatus. Lateral instability in fruit flies is determined by wing-wwing interaction and wing elevation kinematics. Physics of Fluids, 35(4):041904, 04 2023. ISSN 1070-6631. doi: 10.1063/5.0138255. 0138255
httpp::// 100333. 1063/5
Ankit Singh Rawat, Jiecao Chen, Felix Xinnan X Yu, Ananda Theertha Suresh, and Sanjiv Kumar. Sampled softmax with random fourier features. Advances Neural Information Processing Systems, 32, 2019.
Sanjay P Sane. The aerodynamics of insect flight. Journal of experimental biology, 206(23): 4191-4208, 2003.
Sanjay P Sane and Michael H Dickinson. The aerodynamic effects of wing rotation and revised quasi-steady model of flapping flight. Journal of experimental biology, 205(9);1087-1096 2002.
Mike Schuster and Kuldip K Paliwal. Bidirectional recurrent neural networks. IEEE transactions on Signal Processing, 45(11):2673-266 1997.
Wei Shyy, Hikaru Aono, Satish Kumar Chimakurthi, Pat Trizila, C-K Kang, Carlos ES Cesnik, and Hao Liu. Recent progress in flapping wing aerodynamics and aeroelasticity. Progress in Aerospace Sciences, 46(7):284-32 2010.
Emmanuel N. Simantirakis, Eva G. Arkolaki, and Panos E. Vardas. Novel pacing algorithms: do they represent a beneficial proposition for patients, physicians, and the health care system? Europace, 11(10)):272--288) 08 2009, ISSN 1099-5129, doi: 10. 1000093/europpcc/eup204,, URL
David S. Stoffer and Hernando Ombao. Editorial: Special issue on time series analysis in the biological sciences. Journal of Time Series Analysis, 33(5):701-703, September 2012. ISSN 0143-9782. doi: http::///...../0//eooaaoo//////p
288222012200000
Mao Sun. Insect flight dynamics: stability and control. Reviews of Modern Physics, 86(2):615, 2014.
Yuval Tassa, Tom Erez, and Emanuel Todorov. Synthesis and stabilization of complex behaviors through online trajectory optimization. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 1906-491.3 2012. doi: 10. N0.1109/RROS.2012.6388
Thomas and I. Heinemann. Algorithms for automated insulin delivery: An overview. J Diabetes Sci Technol,
1238, Sep 2022. doi: 10. 10.117711322982211000 10008442 URL https
Zhan Tu, Fan Fei, and Xinyan Deng. Untethered flight of an at-scale dual-motor hummingbird robot with bio-inspired decoupled wings. IEEE Robotics and Automation Letters, 5(3):4194-420.) 2020. doi: 10. 10.11099LRA.2000.2972
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need, 2023.
Torkel Weis-Fogh. Quick Estimates of Flight Fitness in Hovering Animals, Including Novel Mecha- nisms for Lift Production. Journal of Experimental Biology, 59(1); 230, 08 1973. ISSN 0022- 0949. doi: 10.1 12422eeb.5. 1.69. URL TRRltttps: /doi www.:/i.ooro./... 1ttp///11.122... 12e. 59. 1.169
13

---

Published as a conference paper at ICLR 2025
J. P. Whitney and R. J. Wood. Aeromechanics of passive rotation in flapping flight. Journal Fluid Mechanics, 660:197-220, 2010. doi: 10.007750022110110026xxxx
Haixu Wu, Jiehui Xu, Jianmin Wang, and Mingsheng Long. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. Advances in neural information processing systems, 34:22419-22430, 2021.
Zhangjing Yang. Weiwu Yan, Xiaolin Huang, and Lin Mei. Adaptive temporal-frquenne, network for time-series forecasting. IEEE Transactions on Knowledge and Data Engineering, 34(4):
1576-1587, 2022. doi: 10.1100/KKDE..2000000444
John Young. Simon M Walker, Richard Bomphrey, Graham K TTyloo, and Adrian LR Thomas. Details of insect wing design and deformation enhance aerodynamic function and flight efficiency. Science, 325(5947):1549 1552, 2009.
Sungduk Yu al. Climsim: A large multi-scale dataset for hybrid physics-ml climate emulation, 2024.
Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? Proceedings of the AAAI conference on artificial intelligence, 37(0)11 2023.
Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun, and Rong Jin. Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting. In International conference on machine learning, pp. 27268-27286 PMLR, 2022.
14

---

Published as a conference paper at ICLR 2025
A APPENDIX
A.1 ARCHITECTURE
For completeness, the full architecture is provided in Fig.
171
602
FC
(PO(L))
RC
Srack Dropeur
PC Aid
con min(
coo (x)
FC
FC
FC
Stacking Magnitude and Phase
4 :=
f F/ to
%f
%
of
RFFT Low Filter
Decoder
Decoder
Decoder
Rp-1
Boer
Adaptive Spectrum Layor
8
FC
Attention (FC)
Attention (FC)
Attention (FC)
T oerr
GRU Encoder
GRU Encoder
GRU Encoder
FC
Adaptive Spectrum
Adaptive Spectrum
Adaptiiv Spectrum
FC
2:
Ptp1
Zir
Figure 6: Seq2Seq with ASL: Full Architecture. Complementary to the high-level description in
Fig. 3 the complete description of the framework is shown. The ASL layer (Purple), is also provided in detail in the top right. the full architecture, the propagation of the hidden decoder states and the inner workings of the simple attention mechanism are also shown.
15

---

Published as a conference paper at ICLR 2025
A.2 ADAPTIVE SPECTRUM LAYER (ASL)
We extended the Seq2Seq model with ASL, layer that performs representation learning of the input signal in the frequency domain, enhancing the model's ability capture the underlying dynamics The ASL. algorithm is described by the following pseudo-code:
(Section 3.2
Algorithm Adaptive Spectrum Layer (ASL)
Require: Tensor with shape H, F] (or batched with shape [B, H, F)),
Require: fmaxs the maximal frequency to consider, and f. the sampling frequency
Require: dropout rate p E (0, 1)
N f 1. H/2 - 1, H/ (H)
< =fft(()) [. y
Real valued Fast Fourier Transform Stacking phase and magnitude Hidden representation in Fourier space
- [ cos (Zi), sin (<+)
H ReLU (FFullCConnctee(())
t < Sequential
(drooouut(==p(())
f FullyConneeted(()
< H x sigmciid))))
* H t sigmoid(H)
> Gating Mechanism > Results in reconstruction of the same shape
< Padding($ x w) with H Ny zeros <- irfft(f)
A.3 HYPER-PARAMETER TUNING
In our framework, we offer the flexibility to explore larger set of muining-relates hyperparameters, specified in Tab. A.3
Hyperparameter train_percent
Description
Percentage of data for training
pal_percent
Percentage of data for validation
feature_wis win
Size of input window for temporal span
intersect
Intersection between feature and target window
batch_size
Number of samples in each mini-batch
model_args
Model-specific architecture arguments
optimizer_name
Choice of Py ToTcc optimizer
critericn_name
Loss and regularization criterion
patience
Epochs without validation improvement before stopping
patience_tolerrnce
Threshold for validation loss improvement
n_epochs
Total number of training epochs
Yeatures_nonn method
Normalization scheme for features Normalization scheme for target values
targets_norm_ metthe_ethodd
featuree_glloal__nmmaiizze
Global per-dataset features normalization
targgeta_global_normalll
Global per-dataset target values normalization Regularization factor (A)
reqularitation_factoo
Table 3: Training Hyperparameters. Various training parameters offered as part of training process
These hyperparameters collectively contribute to optimizing our model during the training process. In our experimental setup, we conducted an exhaustive search, particularly focusing on the hy- perparameters of the Seq2Seq model, but not only. The parameters explored during this search included:
16

---

Published as a conference paper at ICLR 2025
Seq2Seq model args:
embedding_sipe Varied from 5 to 50 to assess its impact on feature representation.
hidden_sized Varied to explore the influence of different hidden dimensions.
n_layers: Investigated different numbers of RNN layers (I-3 layers).
attn_heads: Explored different numbers of attention heads (1-10).
batch size: Explored values ranging from few dozen few thousand.
feature window size: Varied (128-512) to assess sensitivity to temporal span.
normalizer schemes: every possible pair of normalization schemes for the features and the targets, namely, every pair in {z-score, min- min-max, none) {z-score, min-max, none)
With the new Adaptive Spectrum Layer (ASL, sec. 3.2 we explored the following hyperparameters:
hi dden_ss s ze: determines the size of the magnitude and phase representation learned by the ASL. It is typically set to a value similar size to the hidden size of the Seq2Seq model, for convenience purposes.
Dropout is applied the stacked hidden representations in the ASL to prevent overfitting. The dropout rate a hyperparameter that controls the proportion of units to drop during training. We explored values ranging from 0.05 to 0.15, with 0.1 (10%) dropout being the most commonly used value.
dropout_rate:
use use_freqs: controls whether the static frequencies are concatenated to the input features. We initially explored using static frequencies but eventually decided not to use them as they did not change per window, which would introduce a constant bias.
represents an additional layer that computes the mean value of the Fast Fourier Transform (FFT) of the cross-correlation between force features. While this approach seemed promising, we ultimately did not use it in our final model.
cross lass___pectrra_e_eeeee
frequency eecquuncy__theehhheee threshold: sets the maximum frequency consider. acting as low pass filter. We typically did not surpass 200Hz, and the choice of this threshold should be determined by observing the data and understanding its overall underlying frequencies. which can provide an inductive bias for our system.
scmppeexie eexify: fy: This boolean hyperparameter controls whether a new complex vector is learned from scratch. If set to true, two designated layers are used to map the hidden representation to new magnitude and phase values. However, after experimentation, we decided not to use this addition did not improve our results and introduced unnecessary complexity to the model.
Concretely, the best-performing parameters are specified in Tab. Furthermore, each model we evaluated has gone through similar hyperparameter tuning. Concretely:
Transfornerr/AuooFrrmrt Model Arguments
d_ model: Dimension of the model, varied from to 64 to assess the impact on feature representation capacity
n heads: Number of attention heads explored from 1 to 16
d d_ff: Dimension of feed-forward network, typically set to 2-64
ff:
e layers, d_layers: The number encoder and decoder layers, varied from to
moving_avgy Kernel size explored in range 4-96
activation: GeLU
FEDFormer Model Arguments
modes: Selection method set to random
version: Fixed "fourier" as per model specification
Other arguments: similar Transformer
17

---

Published as a conference paper at ICLR 2025
Inference Paramaters
Loss Scalling: Validation Loss vs Model Parameters
045
A11
Validatton Loss
Inferenca Tima
04.-
22005
LMK03
1.0000
22.00
Paramatera
Parameters
Figure 7: Scaling Analysis: (Left) Inference Time Model Parameters; (Right) Validation Loss vs. Model Parameters; The Seq2Se++ASL model demonstrates consistent improvements MAE and significantly reduced inference time compared to the Transformer baseline.
Informer Model Arguments
factor: ProbSparse attention factor tested in range [3,
distil: Boolean parameter for encoder distilling mechanism
Other arguments: similar to Transformer
Linear/NLinear Model Arguments
individual: Boolean parameter for feature-specific linear layers
All other parameters (e.g batch size, normalization scheme, etc...) are similar to the ones examined for Seq2Seq
A.4 SCALING ANALYSIS OF THE PROPOSED MODEL
To further evaluate the scalability of our model, we include two additional plots showcasing its performance with respect validation loss and inference time as the number of parameters increases.
The first plot examines the inference time versus model size. The Seq2Seq+ASL model achieves orders-of-magninude lower inference times compared to the Transformer baseline, highlighting its computational efficiency, crucial when intended to be used on an edge device
Inference Time Scaling:
The second plot demonstrates how the validation mean absolute eиror (MAE) scales with model size. Notably, the Seq2Seq+ASL model consistently shows improved MAE performance as the number of parameters increases, generally outperforming the Transformer baseline validation loss across all configurations.
Validation Loss Scaling:
A.5 COMPARISON TO CURRENT STATE-OF-ART METHODS
We compare the following five models: Sey2Seq is a sequence-to-sequence model introduced by Bahdanau et al. (2014) Bahdanau et al. (2014). which is widely used for sequence prediction tasks. Transformer, introduced by Vaswani et (2017) Vaswani al. (023).. powerful architecture based on self-attention mechanisms, showing promising results in various sequence modeling tasks. AutoFormer Wu et al.] (202I) and FedFormer Zhou et al. (2022) are recent advancements in transformer models, designed
top of the transformer architecture suggesting auto-correlation layers, etc. However, the input and output dimensions of these models must match, which was not the case in study (kinematic output size 3, input forces 4), requiring additional linear layer to adjust the dimensions. This adjustment may have affected the performance these models. NLinear, proposed by Zeng et al. (2023) ZZng al. (2023). is linear layer that incorporates normalization,
18

---

Published as a conference paper at ICLR 2025
Seq2Seq +ASL Parameter
Our Dataset
Open Source Dataset
train_percent
0.75
0.75
val_percent
0.1
0.1
feature_win
512
256
tazget_win
intersect
1
model_class_name
"Seq2Seq" "Adam" "L1Loss"
"Seq2Seq"
optimizer_name
"Adam"
exiterion_name
"LILoss" "
patience
10
10
patience_tolerang
0.005
0.005
n_epochs
30
30
seed
3407
3407
features_rorn_metiidd
"zscore" "identity"
"zscore"
targets_norm_metinee
"identity"
[aatures_glcca__nomaalll
true
taxpetss_global__ommlleeess
true
true
oode__agge__nnc_elleellnnn..___
10
30
modal_argg_ennn_htteeee_ssiss
110
100
model__arg__enn_nm__laayrrrr
mode_aatss.ennobldiirereioonss
false
false
model_argg__eee__utttttt...1
3
model_arggs_us__a___
true true
model_argg__oncat__aa!
false false
model_arggs_commleexfff
false false
model_args__atee
true
true
model_srgg__ultiddn__fff
false
false
model_args_dropoutt
0.1
0.1
modelLarge_ffeetthhehhhhk.
210
200
model_argg__er__fee__laaee
true
false
motel_arg__ccosss_peect....mm
false
false
modelLargg_.de__hcddenssiie
110
100
model_argg__de__mmtbddnnng_giii
10
30
model_argee lesss_nnut__ii__ batch_size
[512, 512, 4]
[512, 256, 5]
512
512
Table 4: Hyperparameters of the best models. The hyper-parameters used to train the Seq2Seq+ASL model on the validation set of each dataset
aiming to improve the stability and convergence of the model while utilizing nothing but linear layer and non- non-linear activation.
A.6 DATA ALIGNMENT
To align the force and angle measurements, we first smoothed the force signal and identified the onset of the force measurement by checking the force difference between consecutive timestamps. Second, we smoothed the 3D trajectory signal from the camera tracking system and identified the onset of the wing motion by checking if the position of each marker on the wing in 3D space exceeded predefined threshold. Once the start times the force and wing motion were identified, we aligned the two vectors in time. This procedure also verified manually for each event.
A.7 MOVIE
Movie shows a representative event measure in our experimental system. Similarly to Figs. Dp.d, the movie shows the images taken from the two fast cameras, well representation of the 3D triangulated positions of the three markers on the wing.
19


Reviews:
[{"review_id": "1yD1p9p4yU", "reviewer": "Reviewer_Qmqi", "summary": "This paper releases a deep learning architecture to model inverse dynamics of a flapping wing which addresses the challenge of controlling such complicated and intricate systems. They also developed an experimental setup to collect data on the wing motion using high speed cameras. Their model uses a sequence-to-sequence framework enhanced with a frequency domain layer for adaptive learning, outperformed baseline models on author collected test data.", "questions": "1. Around 1000 experiments were performed for the hyperparameter search of the Seq-2-Seq ASL model. Was the same search conducted for other models in Table 2 ?\n2. What is the effect of scaling this model on the MAE ? Considering the goal of this effort is to deploy on highly compute constrained platforms, it would be interesting to see if this model scales better than a transformer.", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "1. Extensive hyperparameter search to get optimal results.\n2. Data collection is commendable.\n3. Valid ablation and limitation sections have been provided.", "weaknesses": "1. The results present in Table 2 does not present more significant information than what is present in figure 5. Instead the ablation results can be moved to the main manuscript from the supplementary material\n2. The Seq-2-Seq ASL model does not outperform the transformer on the open source dataset. But does perform better on the authors dataset. An explanation for this would greatly help the contribution of this paper. \n3. The abstract should clarify that the 11% improvement is over the median since over mean the model performs worse than the baselines.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "zbm8EEzb13", "reviewer": "Reviewer_9m96", "summary": "This paper introduces a machine learning approach to control flapping-wing robots by developing a model that determines how wings should move to achieve desired forces. The key innovation is combining a sequence-to-sequence neural network with a new Adaptive Spectrum Layer (ASL) that better handles periodic motions. Tested on experimental data, the approach shows 11% improvement over existing methods and provides practical real-time control capabilities.", "questions": "One of the contribution is the whole pipeline to collect the data. As for the ASL structure, I am not sure the necessity of the complex network structure. One core aspect of the paper is modeling aerodynamics, and similar work exists in the UAV field, such as NeuralFly. Therefore, this core contribution or novelty needs to be better clarified by the authors.", "limitations": "", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "**Originality:**\n- Novel inverse mapping approach for flapping wing control\n- Creative integration of frequency domain processing (ASL) with sequence learning\n- New experimental setup combining force and motion measurements\n- Innovative application of deep learning to fluid dynamics control\n\n**Quality:**\n- Rigorous experimental validation:\n  * Two different datasets (air and viscous fluid)\n  * Comprehensive ablation studies of ASL components\n  * Clear performance metrics and comparisons\n- Thorough implementation details:\n  * Full hyperparameter specifications\n  * Clear architectural choices\n  * Reproducible results\n\n**Clarity:**\n- Well-structured presentation\n- Clear problem formulation and motivation\n- Detailed technical explanations with supporting figures\n- Comprehensive supplementary materials\n- Open-source data and framework\n\n**Significance:**\n- Practical impact:\n  * Real-time capable control system\n  * Improved performance (11% over state-of-art)\n  * Direct application to existing robotic systems\n- Broader implications:\n  * Framework applicable to other complex dynamic systems\n  * Potential applications in biomedical devices\n  * Open datasets for future research\n- Technical contributions:\n  * New insights into frequency domain processing\n  * Improved understanding of flapping wing dynamics\n  * Efficient model architecture design", "weaknesses": "- typo L418: (forces vs. force and torque) \n- paper mentions different measurement types between datasets without explaining impact on model or justification\n- What is the sim2real gap for the real wing-driven robot? How to narrow the sim2real gap to make the research more useful.\n- Can you scale to multiple degrees of freedom? how to evaluate the scaling?\n- Can you scale to different geometry and material? How to evaluate?\n- What are the flight conditions?\n- Any analysis of frequency selection? Why 100Hz/210Hz?\n- More implementation details could be provided: synchronization for different sensors, delay?\n- How is the sensor data aligned between cameras (10,000 fps) and force sensors (5,000 samples/sec)?\n- What's the real-time performance on actual hardware? Processing delays?\n- Any stability analysis or guarantees for the control system?\n- How does the system handle disturbances or noise?\n- Is there any theoretical justification for the model architecture choices?\n- How generalizable is this approach across different Reynolds numbers?\n- How about the performance of some basic NN structures, like MLP/LSTM/RNN?", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "ADaXAu0EI1", "reviewer": "Reviewer_kJ1A", "summary": "This paper presents a novel method for mapping the complex dynamics of a wing flapping to output thrust. The method employs a sequence to sequence model with a GRU encoder and decoder. The authors present a novel layer dubbed the Adaptive Sequence Layer (ASL) to attend to features across the frequency spectrum of the input sequence. The authors use two datasets: one is created by building a mechanical flapping wing and the second is an open source wing flapping dataset. The Seq2Seq+ASL method outperforms baseline methods such as Seq2Seq without ASL and a Transformer. The paper makes a clear and useful contribution to literature.", "questions": "There are a few questions I have for the authors and these are included below. \n\nPlease would the authors perform the statistical test to compare the statistical differences between MAE of their method against the baselines. \n\nSince ASL is a novel contribution of the authors, I would emphasise this to a greater degree in the abstract and the introduction. Is there a reason for not doing this?\n\nPlease could you point me to where you state the size of the dataset and evaluation sets used to compare results against the baselines.\n\nI have a further optional suggestion for authors. Can the authors comment on the frequency spectrum present in the data? \n\nThis question is more one of curiosity, but may be of interest to other readers: I have a question about the RFFT and the IRFFT. How do you implement this in practice? I had assumed that most “fast” implementations are non-differentiable and I am curious which implementation you used.", "limitations": "", "rating": 8, "confidence": 4, "soundness": 4, "presentation": 3, "contribution": 3, "strengths": "The paper has a number of strengths. The experimental setup is unique and interesting to the robotics community. The authors present a novel layer Adaptive Spectrum Layer (ASL), which in the experiments section is shown to improve the overall prediction performance. The choice of baselines are appropriate. The paper is well presented and clear to follow. The paper is significant.", "weaknesses": "Despite the strengths of the paper, there are a few weaknesses, but these should be easily addressed. Some of the key figures such as Fig. 1 and 2 are quite small. A recommendation would be to increase the size of these at the expense of some of the text of by resizing Fig. 5. For example, the abstract and introduction are a little on the verbose side. Nevertheless, these paragraphs are clear. \n\nThere are many comparisons between different baseline methods, which is good. However, it would be beneficial to have a statistical test to show that the improvement in performance between Seq2Seq+ASL and the other baseline methods is statistically significant. In Figure 5, there is not that much difference between the Seq2Seq and Transformer models. A statistical test such as Mann Whitney U-test to compare the differences between the MAE losses. I leave the choice of statistical test to the authors discretion.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "DUbuCpsqxu", "reviewer": "Reviewer_uvVA", "summary": "This paper presented an adaptive spectrum layer enhanced seq2sep deep learning framework to learn the inverse-mapping model of a flapping robotic wing. The employed adaptive spectrum layer is found to have the advantage of learning the periodic features in the frequency domain. Overall, the presentation is clear, and a real experimental test is conducted. However, some important improvements are further needed, mainly including the theoretical contributions and more practical tests.", "questions": "1. The equation (2) is called the one-step-ahead prediction model. Does \\tau refer to the one-step size? However, \\tau in equation (1) is defined as a period. It is confused.\n\n2. Through the learned inverse model, the desired attitude can be obtained from the desired force. In real application, how to plan the desired force and how to implement the obtained attitude?  A special control framework can be provided to illustrate the implementation of the learned inverse model. It is wondered if the uncertainty that exists in the control loop would influence the learning performance.", "limitations": "", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. Adaptive spectrum layer enhanced seq2sep learning framework.\n2. Real experimental tests.\n3. Clear presentation.", "weaknesses": "1. It seems the main contribution of this paper is the introduction of the adaptive spectrum layer in seq2sep prediction missions. Empirical effects are provided in the results (although the improvement provided in Table 2 seems not very promising). The innovation is relatively weak. The theoretical principle and intuitive explanation behind the learning architecture should be further abstracted and discussed.\n\n2. The implemented experiments are relatively simple. The real applied scenarios are usually more complicated, such as external disturbance, unknown dynamic model, and actuator uncertainty. The generalization problem of the developed learning architecture is not considered.  To improve contributions, it is highly recommended to further include the learned inverse model in the online control framework, not just offline demonstration on the dataset of a flapping wing. Moreover, a comparison with a traditional control method (e.g., MPC) is needed.\n\n3. Some presentation errors. Every abbreviation that appears first in an article should be given its full name, such as FFT. All symbols employed in Fig 3 should be illustrated.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)