Machine learning reveals the control mechanics of an insect wing hinge
Abstract
Insects constitute the most species-rich radiation of metazoa, a success that is due to the evolution of active flight. Unlike pterosaurs, birds and bats, the wings of insects did not evolve from legs1, but are novel structures that are attached to the body via a biomechanically complex hinge that transforms tiny, high-frequency oscillations of specialized power muscles into the sweeping back-and-forth motion of the wings2. The hinge consists of a system of tiny, hardened structures called sclerites that are interconnected to one another via flexible joints and regulated by the activity of specialized control muscles. Here we imaged the activity of these muscles in a fly using a genetically encoded calcium indicator, while simultaneously tracking the three-dimensional motion of the wings with high-speed cameras. Using machine learning, we created a convolutional neural network3 that accurately predicts wing motion from the activity of the steering muscles, and an encoder–decoder4 that predicts the role of the individual sclerites on wing motion. By replaying patterns of wing motion on a dynamically scaled robotic fly, we quantified the effects of steering muscle activity on aerodynamic forces. A physics-based simulation incorporating our hinge model generates flight manoeuvres that are remarkably similar to those of free-flying flies. This integrative, multi-disciplinary approach reveals the mechanical control logic of the insect wing hinge, arguably among the most sophisticated and evolutionarily important skeletal structures in the natural world.
Copyright and License
© The Author(s), under exclusive licence to Springer Nature Limited 2024.
Acknowledgement
The authors thank W. Dickson for extensive expertise in instrumentation, programming, data analysis, formatting all the data and code for public repositories, and creating the animations of free flight data in Supplementary Videos 3–8; T. Lindsay for assistance in the design of the epifluorescence microscope and data acquisition software used for muscle imaging; A. Erickson for helpful comments on the manuscript and Supplementary Information; A. Huda for assistance in the construction of genetic lines; J. Omoto for collecting confocal images of wings to visualize resilin using autofluorescence; J. Tuthill and T. Azevedo for a tomographic dataset of the Drosophila wing hinge that was collected at the European Synchrotron Radiation Facility in Grenoble, France; S. Whitehead for analysis of this tomography data to provide a preliminary reconstruction of the hinge sclerites, and for critical feedback on the manuscript text and data presentation; and B. Fabian and R. G. Beutel for providing μ-CT data from their publication on the morphology of the adult fly body. The research reported in this publication was supported by the National Institute of Neurological Disorders and Stroke of the NIH (U19NS104655). I.S. was supported through the AniBody Project Team at HHMI’s Janelia Research Campus for this work.
Contributions
J.M.M. collected all the data presented in the manuscript and developed the software for data analysis. J.M.M. and M.H.D. collaborated on planning the experiments, preparing figures, and writing the manuscript. I.S. collected the high-resolution morphological images of the Drosophila thorax and created Supplementary Video 1.
Data Availability
The data required to perform the analyses in this paper and reconstruct all the data figure are available in the following files: main_muscle_and_wing_data.h5, flynet_data.zip, robofly_data.zip, which are available from the Caltech Data website: https://doi.org/10.22002/aypcy-ck464. main_muscle_and_wing_data.h5 contains the time series of muscle activity and wing kinematics used to train the muscle-to-wing motion CNN and the encoder–decoder used in the latent variable analysis. flynet_data.zip contains a series of data files for training and running Flynet: (1) camera/calibration/cam_calib.txt (example camera calibration data); (2) movies/session_01_12_2020_10_22 (folder containing example movies); (3) labels.h5 and valid_labels.h5 (data for training); and (4) weights_24_03_2022_09_43_14.h5 (example weights). robofly_data.zip contains the MATLAB data files with force and torque data acquired using the dynamically scaled robotic fly.
Extended Data Fig. 2 Flynet workflow and definitions of wing kinematic angles.
Extended Data Fig. 3 CNN-predicted wing motion for example flight sequences.
Extended Data Fig. 4 Correlation analysis of steering muscle fluorescence and wingbeat frequency.
Extended Data Fig. 5 Aerodynamic force measurements and inertial force calculations.
Code Availability
The code required to perform the analyses in this paper and reconstruct all the data figures are available at https://github.com/FlyRanch/mscode-melis-siwanowicz-dickinson. The software is organized into seven submodules: flynet, flynet-kalman, flynet-optimizer, latent-analysis, mpc-simulations, robofly and wing-hinge-cnn. The installation instructions, system requirements and dependency information are given separately in their respective folders. flynet is a neural network and GUI application that requires the dataset flynet_data.zip, and may be used to create Extended Data Fig. 2. An example demonstrating how to train the network can be found in the examples sub-directory and is called train_flynet.py. flynet-kalman is a Kalman filter Python extension used by Flynet. flynet-optimizer is a particle swarm optimization extension module used by Flynet. latent-analysis is a Python library and Jupyter notebook for performing latent variable analysis that requires the dataset main_muscle_and_wing_data.h5, and may be used to create Fig. 6 and Extended Data Fig. 8. mpc-simulations is a Python library and Jupyter notebook for MPC simulations, and may be used to create Fig. 5 and Extended Data Fig. 7. robofly is a Python library and Jupyter notebook for extracting force and torque data from the robotic fly experiments and plotting forces superimposed on 3D wing kinematics. It requires dataset robofly_data.zip, and may be used to create Extended Data Figs. 5 and 6. wing-hinge-cnn is a Python library and Jupyter notebook for creating the muscle-to-wing motion CNN. It requires main_muscle_and_wing_data.h5, and may be used to create Figs. 3 and 4 and Extended Data Fig. 3. An example demonstrating how to train the network can be found in the examples sub-directory as is called train_wing_hinge_cnn.py. The files containing the raw videos of the muscle Ca2+ images and high-speed videos of wing motion are too large to be hosted on a publicly accessible website. Example high-speed videos are provided in the folder movies/session_01_12_2020_10_22 mentioned in Data availability. Additional sequences are available upon request by contacting the corresponding author.
Conflict of Interest
The authors declare no competing interests.
Files
Name | Size | Download all |
---|---|---|
md5:b56038d870b608d7782c42996a3acb52
|
754.6 kB | Preview Download |
md5:bf6ee4eabcfa7f2270dc7ceb16655f55
|
77.9 kB | Preview Download |
md5:aa63296f9b15cf96e4d2383feacca349
|
357.8 kB | Preview Download |
md5:a5dc86d4396e7efd7df8810d7672932e
|
12.9 MB | Download |
md5:29569255046ac2fe400feba1129b485c
|
13.0 MB | Download |
md5:d393b238a37e55d3cdf251321449b1e6
|
30.6 MB | Download |
md5:265e6cd5560992155ce1aa6c26f93843
|
22.0 MB | Download |
md5:168ea2396013a81a13657acf970453b2
|
398.6 kB | Preview Download |
md5:d49b732cd176e2d03f8033b98607a558
|
19.0 MB | Download |
md5:51d4bb435c4cdc0a29bdff7b38ea0656
|
490.0 kB | Preview Download |
md5:c1f1ab33a76f5540d0f446c9294c1535
|
185.9 kB | Preview Download |
md5:f7bf75a090496868c8563561799f54a8
|
287.2 kB | Preview Download |
md5:61b5cfc46a185509fdcc4d686c92a78e
|
12.5 MB | Download |
md5:be9d62f22cffa05320d34e2586472757
|
267.2 kB | Preview Download |
md5:c5593743452be5628446872ea46c9bdf
|
100.6 kB | Preview Download |
md5:e10c36278bb36db60f472f3f227ed240
|
33.6 MB | Download |
md5:cf1690abe8989dd0572ef0633941cf30
|
331.1 kB | Preview Download |
md5:bcc006bdbde5c2459ca0e591b574e149
|
2.7 MB | Download |
md5:28fd8abf8992300bc007420589017f6f
|
1.4 MB | Preview Download |
Additional details
- ISSN
- 1476-4687
- National Institutes of Health
- U19NS104655
- Howard Hughes Medical Institute
- Caltech groups
- Division of Biology and Biological Engineering, GALCIT, Tianqiao and Chrissy Chen Institute for Neuroscience