Figures and data

The sensorimotor model.
(A) Figure 2: The sensorimotor model. (A) Top view of the cave with three bats’ trajectories. The focal bat is shown in black. All bats’ flight trajectories are displayed while the bats’ moment-to-moment decisions are represented by the colored lines: blue – random flight, yellow – collision avoidance, light green – wall-following, turquoise – movement toward a wall gap (see panel D for details). Green squares depict reflectors detected by the focal bat along its route. (B) A zoomed-in view of the marked rectangular area in Panel A, where the focal bat (black) emitted one echolocation call (black) and received echoes from the cave walls (green) and from two other bats (blue). It also received conspecifics’ calls (red) and their reflection from the cave walls (orange), as well as the reflections from other bats (pink). Green squares indicate points that were detected by the focal bat from this call and red x’s indicate missed points due to acoustic masking (i.e., jammed reflectors). The locations of the detected reflectors (green squares) are marked according to their localization by the bat (with simulated errors). The lines near the bats depict their flight direction. (C) The acoustic scene received by the focal bat is as depicted in B, including the emitted call and all received signals (colors as in panel B). (C1) The time-domain plot displays the envelope of signals, encompassing the emitted call and the received signals: the desired echoes from the walls and conspecifics; the calls of other bats; the echoes returning from conspecific calls and reflected off the walls and off other bats. Notably, in this example, some of the desired wall-echoes are jammed by stronger self-echoes reflected from nearby conspecifics. (C2) The spectrogram of all the received signals presented in C1; for clarity, the emitted call is not depicted. (C3) The responses of the active channels of the cochlear filter bank (FB channel) after de-chirping. Each channel is represented by its central frequency on the y-axis. Each black dot represents the timing of a reaction that was above the detection threshold in each channel. Note that early reactions in low-frequency channels (marked by a yellow arrow) result from the stimulation of those channels caused by the higher frequencies of the downward FM chirp. However, most of these stimulations do not reach the detection threshold and are therefore not detected (see Methods). (C4) The detections of each channel are convolved with a Gaussian kernel, summed, and compared with the detection threshold (dotted red line). Colored asterisks mark peaks that were classified as successful detections—those identified in both the interference-free and full detection conditions (see Methods for details). Other peaks may originate from masking signals or overlapping echoes that did not meet the detection criteria (colors of the sources are as defined above). Panel D depicts the pathfinding algorithm used by the bat. The algorithm involves a correlated-random flight during the search phase (blue), collision avoidance (yellow), flying along the wall at a constant distance (green), and flying toward the center of a gap between obstacles as an indicator of a possible exit (cyan). After each echolocation call, the bat awaits an IPI (Inter Pulse Interval) period before processing the detections, adjusting flight and echolocation parameters, and emitting the next call. Based on the received signals, it then modifies its next call design and adjusts its direction and speed accordingly. For a detailed diagram of the complete sensorimotor process see Supplementary Figure 1.

Key model parameters and their effects on performance metrics.
The table presents the key parameters tested, their ranges, default values, and effect sizes on various performance metrics: exit probability, time-to-exit, jamming probability, and collision rate with obstacles. The parameters comprised the number of bats, bat species (PK-Pipistrellus kuhlii, RM –Rhinopoma microphyllum), integration window, nominal flight speed, call level, echo mis-identification with multi-call clustering (yes/no), masking (yes/no), wall target strength, and conspecific target strength. In each scenario, all parameters except the tested one were set to the default value. Call levels are reported in dB-SPL, referenced at 0.1 m from the source. Effect sizes for each parameter are explicitly listed for all four-performance metrics, expressed as the change per unit of the tested parameter (e.g., per bat or per 10 dB). For flight speed, a non-monotonic relationship was observed, and values are reported both before and after the peak performance (see Results, Fig. 3B). Square brackets present the minimum and maximum values of the metric across the tested range, with the maximal effect size in 100 or 40 bats densities. Asterisk (*) indicates a significant impact. Each scenario was tested using Generalized Linear Models (GLMs) with number-of-bats and the tested parameters set as fixed explaining variables. Exit probability and jamming probability were treated as binomially distributed, collision rate was treated as a Poisson distributed, and all other variables were considered normally distributed. Explaining variables were set as fixed factors. The number of repetitions for each scenario was as follows: 1 bat: 240; 2 bats: 120, 5 bats: 48; 10 bats: 24; 20 bats: 12; 40 bats: 12; 100 bats: 6. ѱ A significant difference in call intensity was found only for a bat density of 100 bats/3m2, and between the group with a level of 100dB-SPL and all other groups. α see Supplementary Figure 3. β see Supplementary Figure 4.

Exit performance of P. Kuhlii (PK) and R. Microphyllus) RM.
((A) Sensory interference significantly impaired the probability of exiting the cave (compare dashed lines with continuous lines). The probability of a successful exit also declined as the number of bats increased, with no significant difference observed between the species when masking interference was applied. The insert shows the spectrograms of the echolocation calls of PK (top) and RM (bottom). (B) The time-to-exit, which was calculated for successful trials only, and (C) the collision rate with the walls both increased as a function of the number of bats. (D) The probability of jamming significantly increased to about 55% and 63% with 100 bats for PK and RM, respectively. (E) The detection probability of a wall reflector at one meter or less in front of a bat decreased as a function of the number of bats. In panels (A-E), circles represent means and bars represent standard errors (see details in Table 1). Asterisks indicate significant differences between the lines in each panel.

Exit performance as a function of key sensorimotor parameters.
(A) The effect of the integration window on the probability of exiting the roost, the time-to exit, the rate of collisions with the walls, and the probability of jamming (from left to right, respectively). Each colored line shows the trend as a function of the window-size for different bat densities, with each color representing a specific density. Note that a window size of 0 indicates that only the most recent call is used in the bat’s decision-making, without integrating detections from previous calls. (B) The effect of the nominal flight speed of the bats, with panels and line-colors as in panel A. An optimal speed of approximately 6 to 8 m/sec can be observed for all densities above one bat. (C) The effect of call intensity on exit performance, panels as in (A). In all panels, circles represent means and bars represent standard errors. Error bars depicting standard errors are presented but are very small due to the large number of simulation repetitions. See Table 1 for the number of simulated bats.

The impact of confusion on performance.
The figure illustrates the impact of classification confusion on roost-exit performance under various conditions. Blue lines depict trials with masking, while assuming that bats can distinguish between echoes from their own calls and those of conspecifics (referred to as “No Confusion”). Red lines depict performance where confusion between echoes is assumed. Yellow lines depict performance under the confusion condition, with the added capability of multi-call clustering in a short-term working memory (referred to as “confusion with mitigation”, see text for further details). In all panels, circles represent means and bars indicate standard errors. (A) The probability of exiting the roost significantly decreased with masking and confusion. In conditions with confusion and no aggregation process, only 15% of bats successfully exited the roost, at a density of 40 bats/3m2. Multi-call clustering partially mitigated the confusion effect but did not eliminate it. (B) Bats with the ability to distinguish between echoes demonstrated significantly shorter exit times than those experiencing confusion. Note that time-to-exit refers only to successful attempts. (C) The collision rate with walls was highest for bats experiencing both masking and confusion but decreased significantly when without confusion. Multi-call clustering restored performance to the “No Confusion” condition, reducing collision rates accordingly, at densities between 1 to 40 bats/3m2.

Echolocation parameters.
The table presents the echolocation parameters of the two bat species we simulated during the specified flight phases (i.e., search, approach, buzz, and final buzz). In each phase, except for the search phase, in which the parameters remain constant, the parameters for each call are determined by the distance to the closest detected object.

Decision-making in echolocation-based pathfinding
This diagram illustrates the sensorimotor decision-making process based solely on echolocation. The process starts with the emission of an echolocation call (1) and the reception of echoes and interfering signals (2), followed by sensory processing for detection, range estimation, and direction of arrival (DOA) (3). After integrating detections over a 1–10 call window (4), the bat engages in crash avoidance (5) by evaluating the proximity of conspecifics and obstacles directly ahead. If either is too close, the bat turns in the opposite direction of the detected obstacle, by applying maximum angular velocity away from it (e.g., if the obstacle is on the right, the bat turns left). If no immediate threat is detected, the bat proceeds to pathfinding (6). During pathfinding, it checks for obstacles and, if an opening is detected, flies toward the gap’s center. Without the optional multi-call clustering process (green), the bat simply integrates detections and flies toward the farthest detected obstacle, interpreting it as a wall edge. If the multi-call clustering is included (9), a one-second short memory aids in clustering detections, estimating wall edges, and identifying openings, while also allowing the bat to follow walls at a constant distance. Throughout, the bat continuously adjusts echolocation parameters (8) and controls flight direction and velocity (7) based on ongoing sensory information and decision-making.

Multi-Call Integration
This figure demonstrates the effect of multi-call integration under non-confusing conditions. The upper-right panel shows the position of the focal bat (black) and nine conspecifics (red) within the roost corridor, with a zoomed-in view of the gray rectangle provided in Panels A–C. (A) When the integration window is set to zero calls (no memory), the bat relies solely on the latest call. Green circles and squares represent detected reflectors, while red Xs indicate missed (jammed) detections. Notably, the left wall of the corridor remains undetected due to jamming. (B, C) Increasing the integration window to five calls (magenta squares) and ten calls (black squares) accumulates detections from prior calls, improving coverage of the environment. In this basic integration model, each detection is treated independently, without clustering. (D1, D2) Magnified views of the grey regions indicated in Panel C, comparing detections across 0, 5, and 10-call windows (green, magenta, and black, respectively), illustrating how extended memory improves detection robustness. Note that the X-Y aspect ratios in D1 and D2 differ from the main panels to enhance visibility of spatial distributions.

Multi-Call Clustering Example
This figure illustrates the multi-call clustering algorithm under full-confusion conditions. (A) A focal bat (black) and four conspecifics (red) are shown in the lower corridor. (B) A zoom-in of the gray rectangle in (A). Black ovals represent detections from the last call; red X’s indicate jammed echoes; black squares represent all detections stored across the integration window (before clustering), each subject to localization error. When not applying multi-call clustering – the bat would rely on all of these dots as reflectors. Under full confusion, the bat cannot distinguish self-echoes from conspecific echoes, leading to false detections (red diamonds). Detections are clustered when a reflector is detected twice or more within a 10 cm radius (green squares). The clustered reflectors are used to estimate wall directions (blue dashed line) and detect possible gaps (not shown). As a result of to the multi-call clustering algorithm, most false detections are removed as outliers, except for one erroneous cluster (Panel A). Collision avoidance maneuvers are based on both the clustered obstacles and the raw detections from the latest call (empty black ovals).

Sensitivity of exit performance to obstacle target strength
This figure shows how changes in the acoustic target strength of the cave walls affect navigation performance across five bat densities (1, 5, 10, 40, and 100 bats/3 m²). Target strength values ranged from –33 dB to –3 dB, corresponding to spherical reflectors with approximate radii from 0.05 m to 1.5 m. Overall, increasing obstacle target strength significantly influenced exit performance, primarily by reducing the probability of obstacle jamming and thereby improving detection. (A) Exit Probability increased with obstacle target strength across all densities, with a maximal increase of 64% for a density of 100 bats (p << 10⁻¹⁰, t = 28.5, DF = 8157, GLM). (B) Time to Exit decreased significantlywith increasing obstacle target strength, with a maximal reduction of approximately 2.8 seconds at a density of 10 bats (p << 10⁻¹⁰, t = –22.2, DF = 6920, GLM). (C) Conspecific Collision Rate increased slightly with stronger obstacle echoes (p << 10⁻¹⁰, t = 27.6, DF = 8157, GLM). (D) Obstacle Collision Rate decreased significantly with increasing target strength (p << 10⁻¹⁰, t = –10.7, DF = 8157, GLM), reflecting better detection of walls and structures. (E) Obstacle Jamming Probability decreased consistently (p << 10⁻¹⁰, t = –19.8, DF = 8157, GLM). (F) Conspecific Jamming Probability increased with obstacle target strength (p << 10⁻¹⁰, t = 27.6, DF = 8157, GLM). These results suggest that stronger wall echoes improve environmental awareness at the cost of slightly increased masking of conspecific echoes. Despite this, the overall performance— particularly exit probability and reduced obstacle collisions—improves significantly. In all panels, circles represent means and bars represent standard errors. The error bars are present but very small due to the large number of simulation repetitions, and thus may not be visually noticeable at the plotted scale. See Table 1 for the number of simulated bats.

Sensitivity of exit performance to conspecific’s target strength
This figure shows how changes in the acoustic target strength of conspecifics affect navigation performance across four bat densities (1, 5, 10, and 40 bats/3 m²). Overall, our results indicate that target strength has a relatively minor impact on performance, likely because it affects both desired echo signals and masking signals equally. Interestingly, this analysis also suggests that our model is more sensitive to the bat’s response to nearby conspecifics than to the physical collision impact itself. (A) Exit probability was not significantly affected by conspecific target strength (p=0.28, t=-1.09, DF=5757, GLM, see details in Table 1). Note that the performance curves for densities of 1 and 5 bats overlap almost completely. (B) Time-to-exit increased with target strength at high density, with a maximal effect size of ∼1 second at 40 bats (p = 0.003, t = 3.02, DF = 5578). (C, D) Collision rates with conspecifics decreased significantly with stronger target strength (p = 0.0002, t = –3.7, DF = 5757), while collisions with obstacles remained statistically unchanged (p = 0.23, t = 1.18, DF = 5757). (E, F) Jamming probability was not significantly affected for either conspecific or obstacle echoes (p = 0.6, t = –0.51, DF = 4762; p = 0.19, t = 1.31, DF = 5757, respectively). This aligns with the notion that both useful and interfering signals scale similarly with target strength. Importantly, the probability of detecting a conspecific located within 1 meter increased substantially with higher target strength, improving from 25% to 43% at 40 bats (p < 10⁻¹⁰, t = 6.45, DF = 4162). In all panels, circles represent means and bars represent standard errors. The error bars are present but very small due to the large number of simulation repetitions, and thus may not be visually noticeable at the plotted scale. See Table 1 for the number of simulated bats.

Angles and distances for two bats and two reflecting objects.
Bat1 receives a reflected echo from Prey1 or a stationary obstacle located at a distance of D from it, with an angle ϕtarget relative to its flight direction (red arrow 1). Prey1 is also within the detection range of Bat1, depicted by the green shaded piston area. Bat1 also receives masking sounds from Bat2. The echolocation signals emitted by Bat2 arrive at the ear of Bat1 at an angle ϕtxrx relative to its flight direction and from a distance of Dtxrx (red arrow 2). Additionally, the echolocation signals of Bat2 are reflected by Prey2, before being received by Bat 1. These reflected signals act as masking signals at a relative angle of angle ϕrx, and from a distance of Drx from Bat1.