Leg amputation modifies coordinated activation of the middle leg muscles in the cricket Gryllus bimaculatus

Insects alter their walking pattern in order to respond to demands of an ever-changing environment, such as varying ground surface textures. They also exhibit resilient and flexible ability to retain the capacity to walk even after substantial changes in their body properties, e.g. leg amputation. While the motor control paradigm governing the inter-leg coordination in such adaptive walking has been extensively described in past studies, the mechanism remains unknown. Here, we examined this question by using the cricket (Gryllus bimaculatus), which shows a tetrapod/tripod gait on a flat surfaces, like many other insects. We performed leg amputation experiments to investigate modifications of leg movements and coordination of muscle activities. We simultaneously recorded (1) the leg movements, locomotion velocity, and body rotation and (2) the leg movements and leg muscles activities before and after leg amputation. Crickets displayed adaptive coordination of leg movement patterns in response to amputations. The activation timings of levator muscles in both middle legs tended to synchronize in phase when both legs were amputated at the coxatrochanteral joint. This supports the hypothesis that an intrinsic contralateral connection within the mesothoracic ganglion exists, and that mechanosensory feedback from the legs override this connection, resulting in the anti-phase movement of a normal gait.

Insects have evolved many sophisticated behaviours which have enabled them to spread widely and become the most abundant animal group on Earth. One of the most crucial and fundamental functions that promotes insect fitness is locomotion. Through locomotion, insects are able to explore and find resources such as food, mating partners, optimal habitats for laying eggs, and so on. Although insects may sustain various damages, such as to their appendages, from dangerous encounters with their environments, motility continues to be central to the survival of most species. The loss of an appendage changes body balance of insects, thus altering ordinary walking movements. However, some insects have been shown to continue to exhibit resilient and flexible locomotion despite a drastic change in their body structure, e.g. leg amputation [1][2][3] . In this study, we seek to understand the mechanisms underlying the resilience and flexibility of insect locomotion by considering the cricket (Gryllus bimaculatus), which is frequently used to investigate topics as varied as locomotion, auditory taxis 4-6 , aggressive behavior [7][8][9] , learning and memory [10][11][12] , etc. Crickets, along with many other insects [13][14][15] , show a well-coordinated tetrapod/tripod walking pattern on flat ground. Previous studies have suggested that the inter-leg coordination of locomotion is controlled in part by distributed neural networks located in the thoracic ganglia known as leg central pattern generators (leg CPGs) [16][17][18][19][20][21] . The coordinated patterns are modulated by a higher motor centre, the subesophageal ganglion (SEG) 22,23 . Although it is also known that sensory feedback affects leg coordination [24][25][26] , it remains unclear how insects enact adaptive walking patterns after losing one or more legs. This aspect has been the focus of study of several biologists as well as robotics engineers, who have attempted to develop multilegged robots that can display adaptive locomotion even if they lose one or more legs. With the advancement in technology, a high-performance CPU has aided in controlling the movement of robots; however, the complex and adaptive behaviours of insects can be exhibited only negligibly by the robots. The insect nervous system is comprised of approximately 10 5 to 10 6 ) 27,28 neurons; hence, it is necessary to take into account the role of the intrinsic neural circuits that influence the adaptations of insects under unfavourable circumstance, as well as the sensory feedback mechanisms, which reflect their body characteristics and physical interactions with the environment. Therefore, it is essential to clarify the mechanisms underlying adaptive locomotion, which will be beneficial to the fields of both biology and robotics, and aid in designing robust and resilient multi-legged robots that can adapt to physical damage similar to insects.
One useful approach to elucidating the adaptive inter-leg coordination mechanism that insects recourse to upon loss or damage of a leg is an amputation experiment, which reduces the effect of afferent information from sensory organs in insect legs. Behavioural studies have reported adaptive spatiotemporal coordination patterns after leg amputation in the cockroach 1 , the stick insect 2,3 , the desert ant 29,30 , and the fruit fly 31 . We focused on the changes in electromyographic (EMG) signals of the leg muscles responsible for locomotion before and after leg amputation. Such a focus, which has not been previously examined, is advantageous because: (1) EMG signals indirectly reflect the neural activities of thoracic ganglia and lower motor neurones involved in leg coordination; and (2) we can measure EMG signals during natural locomotion without disrupting the insect sensory-motor loop.
We aim to elucidate the adaptive inter-leg coordination mechanism of the crickets (G. bimaculatus), which respond to leg amputation patterns similarly to other insects. Simultaneous recording of leg movements, velocity in the walking direction, and angular velocity of body rotation showed invariant and variant patterns in remaining leg coordination before and after amputation. Simultaneous recordings of EMG signals and leg movements during walking both before and after leg amputation showed that the activation timing of levator muscles in both midleg muscles synchronised in phase when the legs were amputated at coxatrochanteral (CTr) joint, whereas the timing showed both anti-phase and in-phase synchronisation when only one leg or one leg and a femur remained. These results suggest that an intrinsic contralateral connection exists within the mesothoracic ganglion 21,32-34 , and mechanoreceptive informational feedback from the campaniform sensilla 26,[35][36][37] of the legs overrides the centrally generated patterns, resulting in the anti-phase leg movements of a normal gait.

Results
Walking gait pattern in the cricket. We simultaneously measured leg movements, locomotion speed, and moving direction (body rotational velocity) during treadmill walking (See "Methods" and Supplemental Materials for details) for evaluation of the coordination pattern between legs before and after leg amputations. Figure 1 shows representative gait patterns for the conditions (A) intact walking, (B) both middle legs amputated at the FTi joints, and (C) both middle legs amputated at the CTr joints. In this section, we focus on the coordination between remaining legs, and we focus on the amputated leg's muscle activation patterns in the next subsection.
To clearly define the starting point of this study, we first focused on the leg coordination during the intact walk in Fig. 1A. In the representative low speed walk (2.85 BL(Body Length)/s (blue) in Fig. 1A), the intact cricket exhibited a tetrapod gait, where phase differences between fore and hind legs were approximately 0.75 π . In contrast, in the high speed walk (6.22 BL/s (red) in Fig. 1A), the gait approached a tripod gait, but it was not a "strict" tripod gait because the phase differences between fore and hind legs stayed at approximately 0.25π , which was not in-phase with the typical tripod. We found similar trends in all intact walk data for more than 10,000 periods for all legs in six crickets (N = 6) (Fig. 2B). It should be noted here that phase differences between contralateral legs, i.e., LF (left fore)-RF (right fore), LM (left middle)-RM (right middle), and LH (left hind)-RH (right hind), show anti-phase synchronization, where phase differences were approximately π , independent of the locomotion speed.
During the experiments, we measured rotational angular velocities of the spherical treadmill in the three directions (yaw, roll, and pitch) by using two 2-D optical flow sensors attached to the treadmill base 31,38 (see "Methods" section and the Supplemental Materials). We can calculate locomotion speed in the walking direction and body rotational angular velocity with the sensor values. Additionally, pose estimation algorithms with deep learning, i.e., DeepLabCut 39,40 , for measured two dimensional camera images during the walk facilitated the detection of the body and head angles of the cricket on the absolute coordinates as well as leg movements for the gait analysis. The third panels from the left in Fig 1 show the locomotion speed (top), rotational angular velocity (middle), and head angles (bottom) for each condition. The far right panels show the calculated trajectories of the cricket walk using the optical flow sensor values and estimated body angles (See "Methods" for details) for 2 s in each condition. The locomotion trajectories obtained indicated that the cricket walked almost in a straight direction in our experimental setup. Figure 2A shows the statistical analysis of the effect of body rotation on gait patterns. Each panel shows a phase difference between the corresponding legs, for example, LF-RF, depending on the body rotation and locomotion speed. The colour difference in each panel represents direction of the walk: Straight = − 1.0 to 1.0 rad/s, Left > 1.0 rad/s, Right < − 1.0 rad/s. For the phase differences of the middle and hind legs (LM-RM and LH-RH), we found the effect of body rotation, meaning that the phase difference exceeded π for right rotation (< − 1.0 rad/s), whereas the phase difference did not exceed π for left rotation (> 1.0 rad/s). However, for the other phase relationships, we could not find any trends. Furthermore, phase differences for higher locomotion speeds were not significantly different depending on body rotation direction. The facts suggest that effect of turning was small on gait patterns in our experimental setups. We used all data including more than 1.0 rad/s and less than − 1.0 rad/s for the leg coordination and muscle activation analysis in this study (Fig. S9 show the results on more narrow range of angular velocity for the straight walk (− 0.5 to 0.5 rad/s), suggesting the independent of the body rotation).
The gait patterns of the crickets that underwent amputation varied depending on which legs had been removed. The movements of the remaining femur of the amputated middle legs were synchronized anti-phase and in-phase (( Fig. 1B;  www.nature.com/scientificreports/ legs remained in anti-phase synchronization similar to the intact walking. Phase difference between fore and hind legs (LF-LH and RF-RH) was approximately 0.75π , like a tetrapod gait not depending on the locomotion speed. We found similar trends in leg coordination as shown in the statistical data of Fig. 2B (Fig. S10 shows the circular statistics). For crickets with amputations of the both middle legs at the CTr joints, the gait pattern was a so-called 'trot' gait, in which diagonal pairs of legs (RF-LH or LF-RH) contacted the ground almost simultaneously (Fig. 1C). Moreover, Fig. 2B (Fig. S10) statistically indicates the modified leg coordination pattern after leg amputation, with no significant effect of locomotion speed.
Activation of leg muscles. We measured leg movements and EMGs under four conditions: (a) Intact walking; (b) Right middle leg amputated at the femur-tibia (FTi) joint; (c) Right middle leg amputated at the coxatrochantecral (CTr) joint; and (d) Both middle legs amputated at the CTr joint. Figure 4A (b), in which the right midleg is amputated at the femur-tibia (FTi) joint, shows a double-period stance phase in the amputated leg www.nature.com/scientificreports/ (b-2). Upon contact with the ground, the truncated midleg moved as the stance leg in the condition. However, as the shortened leg was unable to support the body, it immediately shifted to a swing phase, resulting in a reduced stance phase. The leg then touched the ground again, and cycled once more through a shortened stance phase, leading to a double period stance phase. For an amputated leg that was able to support the body upon contact with the ground, a period stance phase consistent with the tripod gait occurred, as shown in the first period on (b-2) of Fig. 4A. This fact preserves the consistency with the gait analysis on remaining legs. Figure 4A shows the measured EMGs and gait diagrams for the four conditions of leg amputation (a) to (d). The lower graphs in Fig. 4A illustrates activation of the levators in the LM and RM legs and the retractor in RH leg with highlights during 4 periods. These graphs clearly show that the levator activation begins at the pre-swing phase while the retractor activation begins at the early stance phases. Spike train, which is defined as a list of the times where spikes have occurred, was generated by using a threshold for each EMG signal (0/1 for less/greater than the thresholds). Gait cycle period and frequency were calculated using the obtained gait diagrams. Power spectrum density analysis was conducted to detect the characteristic frequencies of raw EMGs and spike trains with respect to gait patterns. Figure 4B shows gait cycle period, frequency, and power spectrum density for raw EMGs and their spike trains in Fig. 4A(a). The graphs also indicate that peak EMG signal frequency occurs between 3 and 4 Hz, corresponding to gait cycle frequency.
To quantify changes in EMG patterns before and after leg amputation, we analysed changes in relative activation timing between muscles (LM-RM and RM-RH) in conditions (a)-(d). Walking during more than 5 periods was analysed as one trial for each condition. To calculate the phase relationship between muscle activities (e.g. the RM and LM levators) in the corresponding trial, we conducted cross-spectrum analysis 41 (Fig. 4C, see "Methods" for details). Data obtained from cross-spectrum analysis are angles, thus, we applied circular statistics (see "Methods"). Figure 3 shows the phase relationship of leg muscle activation between the LM and RM levators (left middle panels) and between the RM levator and RH protractor (left bottom panels) in the conditions (a)-(d) using circular histogram plots. For each cricket (N = 5), we measured EMGs and leg movements in order from conditions (a) to (d) by amputating cricket legs at 3 different positions as shown in the left upper panels in Fig. 3. n indicates the trial number. The bold line in the left bottom panels shows average phase; the line length represents its standard deviation (0 to 1, with a larger deviation approaching 0 and a smaller deviation approaching 1) of the phase relationships of muscle activation over all trials. The colours are indices representative of degrees of in-phase/anti-phase synchronisation I sync (see "Methods" section). The right panels show changes in the average phase and standard deviations on the RM-LM and RM-RH muscles over the four conditions. The results indicate that the timing of muscle activities between the LM and RM are modulated from anti-phase to in-phase synchronisation throughout the course of the experimental conditions (a) to (d), whereas the timing between RM and RH significantly changes between the conditions (c) and (d).

Discussion
We investigated changes in leg coordination patterns of the cricket (G. bimaculatus) using two experimental setups: (1) simultaneous recordings of leg movements, walking velocity and body rotation, and (2) simultaneous recordings of muscle activations and leg movements. The gait analysis for remaining leg coordination indicated that phase difference of the foot contact timing between fore and hind legs were changed from almost in-phase (0.25 π ) to anti-phase ( π ) synchronization before and after amputations, resulting in the change from a tetrapod/ tripod gait to a four legged trot gait. The EMG analysis indicated that amputation of the midlegs changes the coordination patterns of leg muscle activations according to the residual function of the amputated legs. Activation timing of the midleg muscles synchronised in phase when both legs were completely amputated, whereas the activation timing showed both anti-phase and in-phase synchronisation when one leg remained or one leg and a femur remained, which preserve the consistency with the gait analysis on remaining legs.
Previous studies have reported adaptive locomotion after leg amputation in other insects as well as crickets we here showed. For example, cockroaches exhibited adaptive modulation of leg tip trajectories after one-or two-leg amputation 1 . Altered gait patterns, dependent on which leg(s) were amputated, have also been reported in the stick insect, suggesting that afferent information from the legs affects coordination 2,3 . Studies on the desert ant which provide evidence of a step counter that measures distance travelled during navigation 29 also suggest that gait patterns remain unchanged despite imposed alterations in leg length 30  Our results also suggested consistent insights with previous works, showing invariant and variant patterns in remaining leg coordination before and after leg amputation: phase differences between contralateral legs were invariant on anti-phase synchronization, whereas phase difference between ipsilateral legs, e.g., fore and hind legs was variant.
Speed and direction dependency of gait patterns are essential in defining the starting point of the discussion. In our experiments in Setup 1, the intact walking transition from a tetrapod gait to a tripod-like gait in which contralateral legs remain in anti-phase synchronization, whereas the phase difference between the fore and hind legs mainly shifts from 0.5 π (tetrapod) to 0.25 π ('quasi' tripod). The relatively small modification of gait patterns could be related to the narrow bandwidth (around 3-5 Hz in Fig. S8B) of walking frequency in cricket locomotion. Studies 13,15,42 on gait modification that depend on speed have shown the variant walking period and the invariant swing phase (recovery stroke) period. Our gait analysis also indicated the same trends in the walking period and swing phase period (Fig. S8A-C). The movements of the remaining femur of the amputated middle legs (Fig. 1B) were synchronised in anti-phase and in-phase, and then, with the increase in locomotion speed, the average phase difference between the middle legs shifted to in-phase synchronization (Figs. 2B, S10), suggesting a strong connection in leg coordination in the high speed walk reported in 31  www.nature.com/scientificreports/ on our experimental setup, we found that the rotational effect was not significant on gait pattern ( Fig. 2A) due to the small curvature of the walking trajectories: the curvature was not turning 42 per se. Our experiments indicated that the muscle activation timing of the midlegs was synchronised in phase after both legs were completely amputated. Some crustaceans, including crayfish, lobster, and shrimp use swimmerets, which are paired appendages on each segment of abdomen, to swim and to ventilate eggs. The movement of swimmerets has been found to be a contralateral in-phase synchronised pattern 32 . Moreover, crickets placed on the surface of water 43,44 , exhibit a breast-stroke-like swimming gait, in which the left and right legs move in phase. Knebel et al. found that pro-and mesothoracic ganglia of the locust exhibit in-phase synchronisation patterns in vitro in the absence of any sensory information or descending commands 21 . These previous studies suggest the existence of intrinsic contralateral connections within ganglia that coordinate the in-phase contralateral movement patterns of the midlegs. Potential advantages of in-phase synchronisation between contralateral legs are: (1) energetic efficiency 34 , and (2) stability of the in-phase oscillating mode from the viewpoint of a dynamical system 45 .
Recent in vitro studies have reported the significant contribution of the subeshophageal ganglion (SEG) to leg coordination in insect locomotion. Headless insects with neither brain nor SEG do not exhibit spontaneous walking, except only briefly under tactile stimulation. In headless crickets, for example, defecation initiates walking, although the tripod walking pattern is never achieved 46 . In comparison, headless insects left with an intact SEG walk spontaneously absent any external stimulation. Knebel et al. investigated the functional connections between leg CPGs and the SEG in the locust 23 . They found that the SEG not only activates leg CPGs, but it also modulates all bilateral inter-CPG connections, resulting in the in-phase oscillation of the ganglia. The in-phase synchronisation of midleg muscle activation that we observed in in vivo amputation experiments also Walking during more than 5 periods was analysed as one trial for each condition. To calculate the phase relationship of muscle activations in the corresponding trial, we conducted cross-spectrum analysis 41 . The bold line in the left panels shows average phase; the line length represents the standard deviation (0 to 1, with a larger deviation approaching 0 and a smaller deviation approaching 1) of the phase relationships of muscle activations over all trials. The colours (histogram and bar) are indices representative of degrees of in-phase/anti-phase synchronisation I sync (see "Methods" section). The right panels show changes in the average phase and standard deviations on the RM-LM and RM-RH muscles over the four conditions. The phase relationship between the LM and RM leg muscles gradually changes from anti-phase synchronisation in (a) to in-phase synchronisation in (d). For the RH and RM muscles, the phase relationship shifts to in-phase synchronisation in condition (d). The Waston-William F test was used to reveal differences in phase relationships between the conditions. A p-value of 0.005 was set as the criterion for statistical significance. www.nature.com/scientificreports/ suggests a contribution of the SEG to in-phase coordinated walking patterns. Furthermore, the SEG modulates inter-leg sensory-motor interaction through a contralateral pathway 22 . The study by Knebel reported that insect In each panel, the upper (e.g. a-1), middle (e.g. a-2), and lower (e.g. a-3) graphs shows the EMG and gait diagram in the left middle (LM, blue), right middle (RM, red), and right hind (RH, green) legs, respectively. The gait diagrams were drawn by visually measuring the duration of the stance phase, which is the period during which legs contact the treadmill. In the gait diagrams, the coloured regions represent the stance phases. The lower graphs illustrate activation of the levators in the LM and RM legs and the retractor in RH leg with highlights during 4 periods. (B) Gait cycle period, frequency, and power spectrum density for raw EMGs and their spike trains in A(a). The upper, middle, and lower graphs shows the data from the LM (a-1), RM (a-2), and RH (a-3) legs, respectively. The three graphs on the left show the gait cycle period (light blue, red, and green) and frequency (dark blue, red, and green) that we calculated using the gait diagrams. The three graphs on the right represent the power spectrum density of raw EMGs (dark blue, red, and green) and their spike trains (light blue, red, and green). (C) Cross-spectrum analysis for intact walking (A)(a) over 21 gait cycles. Cross-spectrum analysis extracts a common frequency component and its phase relationship (relative activation timing) between two EMG signals. The upper and lower graphs in the middle region show the results of the analysis for EMG signals of LM-RM (a-1 and a-2, magenta) and RM-RH (a-2 and a-3, yellow), respectively. The upper panels in each graph show magnitude-squared coherence, and the lower panels show the cross-spectrum phase for each frequency. The right circles indicate polar plots of the obtained phase relationship between RM-LM and RM-RH EMGs. The dotted lines in RM-RH polar plots show 'virtual' protractor muscle activation timing in the RH leg by hypothesising ' quasi' anti-phase activation against the retractor muscle. www.nature.com/scientificreports/ leg sensory-motor loops consist of a contralateral pathway to the head and an ipsilateral descending pathway, in which the SEG plays a crucial role in processing and transforming sensory information. Sensory feedback plays an essential role in leg coordination during insect locomotion by modulating the timing and magnitude of centrally-generated patterns 22,26,34 . The exteroceptive and proprioceptive mechanoreceptors that cover the insect body, including the legs 47 respectively comprise stretch receptors, e.g. chordotonal organs 18 , and the trichoid sensilla (hair plate located near the joints 48 ) along with the campaniform sensilla (load receptors [35][36][37] ). In the legs, these receptors contribute the following two sensory mechanism: (1) loading and unloading of the legs, and (2) leg movements 26 . The leg amputation experiments, which silence the campaniform sensilla by eliminating contact between the legs and the ground, indicate the significant contribution of campaniform sensilla to leg movement patterns; the receptors on the coxa and trochanter monitor the magnitude of the load on the legs [35][36][37] . The desert ant exhibits a robust walking gait despite changes in the leg length 30 , suggesting the contribution of the remaining campaniform sensilla of the coxa and trochanter. The four conditions of our experiments represent a spectrum of reduced effects of the campaniform sensilla on leg coordination, with anti-phase synchronisation reflecting the greatest effect, and in-phase synchronisation reflecting the least. This suggests that feedback from the mechanoreceptive campaniform sensilla overrides the centrally-generated coordination patterns of leg CPGs and the SEG, leading to the normal walking gait of intact insects. This finding is consistent with our previous studies pertaining to robotics 49,50 , in which we proposed a load-dependent leg coordination rule that exploits load sensory information from each leg.
The reason why we chose middle leg amputations in this study was that the middle legs play an essential role as an "ipsilateral mediator" by mainly supporting the body in hexapedal leg coordination: the fore legs have a role in probing (sensing environments) 25,42,51 and the hind legs have a role in propulsion of the body for locomotion 51 , thus amputations of these legs would have a more significant impact on leg coordination for other functions, like sensing or generating forces for locomotion. Therefore, as a first step in the discussion of adaptive mechanisms, we consider that middle leg amputation was suitable for effective extraction of the underlying mechanism. Furthermore, mounting direction of the hind legs are opposite to the fore legs. Additionally, from the viewpoint of EMG measurement, leg segments in the fore legs are relatively small, making measurements increasingly difficult to perform, hence the second reason for middle leg amputation . Investigation of the fore and hind legs is quite interesting and meaningful for the complete understanding of the leg coordination mechanism, and we consider them imperative in future research.
The main contribution of our study is to show that the change in in vivo EMG patterns before and after leg amputation indicates the change from anti-phase to in-phase synchronisation based on the residual function of the amputated legs. This suggests a significant contribution on the part of the mechanoreceptive campaniform sensilla to leg coordination. A limitation of our study was that we did not measure neural activities, e.g., interneurones that participate in CPGs or motoneurones, during locomotion. Instead, we analysed only muscle activation patterns and the movements of legs before and after leg amputation. One potential future direction would entail additional experiments using a prosthetic leg corresponding to the amputated leg, as in previous studies 29,30,52 . A study that models leg CPGs, the SEG, and the sensory feedback mechanism would be useful for designing a decentralised controller for an insect-like six-legged robot.

Methods
Animals. The crickets (Gryllus bimaculatus) were raised in a laboratory colony. They were reared on a 14h:10h light and dark cycle at 28 ± 2 °C (lights on at 6:00). They were fed a diet of insect food pellets (Oriental Yeast Co., Tokyo, Japan) and water ad libitum. Adult crickets that had molted within the previous 2 weeks were used in this study.
Behavior experiments. The crickets used were randomly selected from our colony. Each cricket was anaesthetised using CO 2 gas before it was placed on a treadmill to observe its walking gait pattern. The handmade treadmill was composed of a Styrofoam sphere ( φ 100 mm) that hovers above a stream of air flowing beneath it. The tip of a plastic rod ( φ 2 mm) that was printed using a 3D printer (FORTUS250mc, Stratasys Ltd., Eden Prairie, MN, USA) was attached to the cricket thorax using an insect pressure-sensitive adhesive (Cockroach trap, Earth Corporation, Hyogo, Japan). The rod was attached to a ring that was fixed on a manipulator, by which the cricket was placed on the exact desired position of the Styrofoam sphere. A cricket on the treadmill was able to walk and change its orientation and ground clearance freely.
After the walking gait pattern of the intact cricket was recorded as a control, it was removed from the treadmill for surgical treatment. The cricket was anaesthetised again using CO 2 gas, and then a leg was amputated using fine scissors. To investigate how leg amputation modifies the walking gait pattern, we amputated cricket legs at two different positions (for Setup 1): the both middle legs at the FTi joints; and the both middle legs at the CTr joints and at three different positions (for Setup 2): the right middle leg at the FTi joint; the right middle leg at the CTr joint; and both middle legs at the CTr joint. After leg amputation, the cricket was placed on the treadmill again to observe the walking gait pattern.
Setup 1: Simultaneous recording of walking pattern and velocity. As the first step in the experiments, it was necessary to define the starting point of the discussion on gait modification before and after leg amputation. We quantified the relationship between leg coordination patterns, locomotion velocity, and body rotation before and after leg amputations. To this end, we used a high-speed camera (GC-P100, JVCKENWOOD Corporation, 120 fps) and two-dimensional optical flow sensors (PMW3901, Pimoroni, 50 Hz) (Supplementary Video S1). The cricket motion data (movies) were stored on an SD memory card in the camera. We measured rotational angular velocities of the spherical treadmill in three directions (yaw, roll, and pitch) using two optical

Setup 2: Simultaneous recording of electromyogram and walking pattern.
Electrophysiological experiments were performed in order to record changes in the EMGs of leg muscles before and after leg amputation. We used a pair of enamel-coated copper wires ( φ50 µm) as electrodes. The tips of the wire electrodes were implanted into the coxal levator muscles of the right and left middle legs and the retractor muscles of the right hind legs. The retractor muscles were chosen due to the difficulty in getting EMG data from protractor muscles due to muscle arrangement in the cricket (Fig. S1 in the Supplementary Materials). To implant the wire electrode, two fine holes were made in the cuticle using a sharpened insect pin. The tip of the wire electrodes were inserted through the hole into the target muscles and the wires were fixed on the surface of the cuticle with glue (Aron Alpha Jelly-like, Konishi, Japan). The electrodes were connected with amplifiers (DAM80, World Precision Instruments), and the signals of the EMGs were recorded using a data logger (GL900, GRAPHTEC, 5000 Hz) for later analysis. The walking patterns of the crickets were recorded using a high-speed camera (HAS-L1, DITECT, Japan, 640 × 480 pixels, 500 fps), and the images were saved as sequential tiff files on Windows PC for later analysis. For simultaneous recording of EMGs and leg movements, we used the high-speed camera (HAS-L1) and the data logger (GL900), which was controlled by software (DIPP-ADII, DITECT, Japan) that enabled us to synchronise EMG signals with a high-speed movie of the walking cricket (Supplementary Video S2). To analyse gait patterns of the crickets, gait diagrams were drawn by visually measuring the duration of the stance phase, i.e. the period when the legs are in contact with the treadmill.
Gait data analysis. To quantify leg coordination patterns for the measured 2-D high speed camera images (640 × 320 pixels at 120 fps), we used a pose estimation algorithm with deep learning, i.e. DeepLabCut 39,40 . By marking training data(50-200 frames for each condition) for pose estimation, the algorithm automatically estimate 21 positions (Head, Pro, Meso, Meta, LF1, LF2, LM1, LM2, LH1, LH2, RF1, RF2, RM1, RM2, RH1, RH2, Bar, Axis, Fix, LED1, and LED2) during one trial ( Fig. S2 and Supplementary Video S3). The average of the estimated position error for test data on each condition was 1.643 ± 0.345 pixels. For the estimated position data, we numbered the leg movements during the power and recovery strokes (stance and swing phases), leading to the quantification of the gait diagram. Phase differences between legs, e.g., LF-RF, were calculated by using the following equation: where T period(i) LF represents time duration of (i)th LF leg period and t TD(i) RF represents touch down (TD) timing of the RF leg during (i)th period. By using the cricket body positions (Head, Pro, Meso, Meta) and the frame positions of the treadmill base (Bar, Axis, and Fix), head and body angles ( θ cricket head and θ cam body ) were calculated during walking as shown in Fig. S2 on the Supplementary Materials. Blinking LED positions on camera images (LED2) were used for the synchronization with optical flow sensor values (Fig. S3).
By using two 2-D optical flow sensor values ( dx 1 , dy 1 , dx 2 , dy 2 ), the rotational angular velocities of the spherical treadmill in the yaw, roll, and pitch directions were calculated using the following equations 38 : where σ x 1 , σ y 1 , σ x 2 , σ y 2 denote the scale parameters for changing millimetre length scale [mm/s] to radian angle scale [rad/s] (see Fig. S4 and Supplementary Materials for details). Then, according to the definition of the coordinate on the camera frame, the locomotion velocities in the x and y direction on the frame were calculated using the sphere radius ( l s = 50 mm) as follows: To normalize the length and velocity data depending on the body length of crickets, we divided the length and velocity data by using the corresponding cricket's body length (BL) in Table S1, resulting in the unit transformation from mm or mm/s to BL or BL/s.
EMG data analysis. To quantify changes in EMG patterns before and after leg amputation, we analysed changes in relative activation timing between muscles (LM-RM and RM-RH) in conditions (a)-(d). Accordingly, cross-spectrum analysis 41 was conducted in order to detect common frequency components and their phase relationship (relative activation timing) between two EMG signals. By using this analysis, we were able to detect changes in the relative muscle activation timings between the LM and RM, or the RM and RH EMG signals and observe their effects on gait cycle frequency (3-4 Hz) before and after leg amputation (Fig. 4C). We selected a frequency for the cross-spectrum analysis based on the power spectrum density of each EMG signal. The peak frequency around the appropriate walking period was chosen for the analysis. Data obtained from cross-spectrum analysis are angles, which represent the phase relationship between the activation timings of two corresponding EMGs. Thus, we applied circular statistics for statistical analysis using a circular statistics toolbox 53 for MATLAB (Mathworks Inc., Natick, MA, USA) in order to calculate means and standard deviations of the relative phase relationship of two EMGs (LM-RM/RM-RH) for each condition. The colours in Fig. 3 represent the degree of in-phase/anti-phase synchronisation index I sync : red indicates the anti-phase ( I sync = −1 ) and blue indicates the in-phase synchronisation ( I sync = 1 ), which is calculated by the following equation: where θ represents the average phase. The Waston-William F test was used to reveal differences in phase relationships between the conditions. A p-value of 0.005 was set as the criterion for statistical significance.