A Biohybrid Interaction Framework for the Integration of Robots in Animal Societies

The collective behavior of animals has been traditionally studied through observation, quantitative models of behavior, and devices of low intelligence. Nowadays, the advancements in the field of robotics allow for closed-loop experiments that occur in real-time, and for artificial agents that intelligently and autonomously blend into hybrid groups of animals and robots (i.e., biohybrid groups). Such systems provide scientists with the opportunity to study the social interactions that govern collective behavior from within the group of animals, either by mimicking them or by introducing precise stimuli to elicit and study their response. In this work, we introduce an open source Biohybrid Observation and Interaction (BOBI) platform for small animals, which consists of 3 main components: 1) an experimental setup; 2) a wheeled mobile robot called LureBot; 3) their software. We demonstrate the software and hardware design aspects that make BOBI stand out compared to our previous system and similarly purposed systems. Finally, we demonstrate our methodologies and the new robot’s agility, by conducting a set of preliminary experiments with rummy-nose tetra (Hemigrammus rhodostomus) fish, where we study: 1) the response of one fish swimming with a biomimetic and a non-biomimetic lure; 2) the robot behavior when the robot interacts biomimetically and in closed loop with the wall alone, with 1 fish, and with 4 fish. The experiments show that fish strongly prefer biomimetic lures, and that the robot is consistently successful in engaging in social interactions with the fish.


I. INTRODUCTION
The use of robots and lures to interact with living animals has become more common and appealing among scientists, with the premise of precisely eliciting and studying their response [34], [47]. Advancements in computer hardware and algorithms have facilitated the development of smaller The associate editor coordinating the review of this manuscript and approving it for publication was Yang Tang . and more agile robotic systems that can be operated with improved perception systems and increasingly sophisticated motion models. Over the years, the combination of these advances, along with a continued interest in deciphering the rules that govern collective behavior, has led to the design of a plethora of biohybrid systems, spanning from groups of fish [2], [5], [7], [18], [33], [35], [42], [45], [48], [49], [50], [52], [59], bees [1], [23], [37], [58], insects [24], [46], rats [55], and birds [19], [21], [22], [28], [56]. While these systems primarily serve as a means to examine animal behavior, they also offer a glimpse into potential strategies for preserving ecosystems, thereby contributing to environmental conservation efforts [26], [53].
In the first approach, the robotic system boasts the advantage of indefinite operation and high responsiveness. However, these robots require more sophisticated animal tracking solutions due to the robot's end effector, and can potentially induce more visual and sonic stimuli on the fish [45], [48] due to mechanical components. While positioning the Cartesian robot below the tank [18], [50] mitigates some visual constraints, such systems are limited to operating a single lure at a time. On the contrary, wheeled mobile robots [5], [7], [33], [35], [42], [59] can function as autonomous units in larger numbers, but require more sophisticated power delivery solutions. Since cables are unsuitable, there are two primary means of supplying power: i.e., with batteries [33], [35], [59] or conductive surfaces positioned above and below the robot [5], [7], [10], [42]. Whereas batteries offer a simpler implementation that does not require external equipment, they considerably constrain the duration of experiments. For instance, as fish are generally very agile and can perform very rapid movements for extended periods, a small robot operating at similar speeds will typically exhaust its battery life quickly. Conversely, employing conductive surfaces can substantially prolong experimentation duration, potentially enabling indefinite operation in the absence of mechanical failures.
Nonetheless, even in the latter approach, which combines many of the advantages of Cartesian and wheeled robots, more nuanced factors can impede performance. Specifically, mechanical, electronic, and software components may not readily translate their specifications into real-world performance capable of replicating the spontaneous movements of live fish. For instance, our previous robotic system, the FishBot v4.4 [5], [10], featured a conductive power supply system comprising wires at the top and bottom of the robot, which connected to positive and negative poles, respectively. However, in practice, these wires tended to lose contact in prolonged experiments (approximately 1 h). Moreover, the motors of the FishBot v4.4 lacked sufficient torque to reproduce the entire spectrum of fish speeds, effectively only approximating the average speed.

B. A ROBOTIC SYSTEM FOR DEMANDING EXPERIMENTS
Nearly a decade after the initial iteration of the FishBot v4 and other similar platforms [33], [35], [59], advancements in algorithms and precision construction methodologies have enabled significant improvement. This progress also extends to the ancillary hardware and software that supports the robot's operation, such as cameras and communication protocols. In this work, we introduce a novel Behavioral Observation and Biohybrid Interaction (BOBI) framework, comprising: 1) an experimental setup; 2) a wheeled mobile robot, the LureBot; 3) a lure-building methodology, primarily designed to study fish interactions, as well as small animals or insects in general; 4) an open source distributed codebase utilizing Robot Operating System (ROS) 1 [57] packages to manage various aspects of the setup and robot.
This new experimental framework facilitates and considerably extends continuous experiments (exceeding 3 h), at robot speeds that can reproduce or even surpass the motion profiles of multiple fish species (e.g., Rummy-nose Tetra -Hemigrammus rhodostomus -and zebrafish -Danio rerio), with potential for applications to other small animal species. Additionally, BOBI incorporates significant upgrades over the FishBot v4.4 [5], [10] and the Control and Control And Tracking Software (CATS) [6], in terms of real-time robot control, individual detection and identification algorithms, and hardware components such as cameras for capturing more precise data. In addition, in the context of the present work where the LureBot is interacting with rummy-nose tetra fish (Hemigrammus rhodostomus), the LureBot is commanded by a data-driven model which was shown in simulations to faithfully reproduce the collective behavior of this species [12], [38].
Furthermore, we have designed the new experimental platform to be mobile, compact, and user-friendly for nonengineering personnel, a feature that, to the best of our knowledge, has not been addressed in similar works. Finally, we demonstrate two sets of control experiments with groups of H. rhodostomus and a lure manipulated by the LureBot. We validate its operational stability and confirm its acceptance by the fish.

C. MANUSCRIPT OUTLINE
The remainder of the article is organized as follows: • in Sec. II, we describe the design aspects of the experimental setup that includes the fish tank, recording equipment, and the robot; VOLUME 11, 2023 • in Sec. III, we introduce our new robot, the LureBot, and provide a description of its mechanical and electronics design; • in Sec. IV, we detail our software architecture that allows the interplay of the experimental setup and robot; • in Sec. V, we present our lure design methodology; • in Sec. VI, we describe 3 trajectory generation methodologies that we used to control the robot, and in particular, to test its acceptance by the fish; • in Sec. VII, we detail the handling conditions of the fish and provide a step-by-step procedure that we have followed during our experiments (see also the ethics statement in Sec. XI); • in Sec. VIII, we describe some data-related postprocessing operations; • in Sec. IX, we present the results of our experiments. We first focus on assessing the acceptance of the robot by the fish by exploiting open-loop trajectory generators with a biomimetic lure and a disc-shaped lure. Then, we quantify the behavior of a single fish and of the robot alone and of a fish swimming with the robot. Finally, we present preliminary results for a group of 4 fish interacting with the LureBot; • in Sec. X, we highlight the main contributions of our work and also discuss some of its limitations and potential areas for future exploration.

II. EXPERIMENTAL SETUP
The proposed behavioral setup, depicted in Fig. 1, measures 810 mm × 810 mm × 1810 mm (w × d × h), which is smaller than the previous one [6], [10], which measured 1000 mm × 1000 mm × 2100 mm (w × d × h). All aluminum beams are indented in the middle to allow for mounting external attachments. Therefore, all the necessary equipment (e.g., lights, cameras. . . ) can be directly attached to it for use and storage. Conversely, in [6] and [10] some equipment (e.g., lights) was permanently fixed to the experimental room walls. Consequently, it was particularly difficult to move it and proved rather restricting for maintenance and experimental procedures alike, and it was almost impossible to use the setup in different experimental facilities, even if those were located in the same building. The proposed setup stands on omnidirectional wheels (equipped with brakes) attached to each corner of the frame, which allows the experimenter to move with great ease, even when the full equipment is mounted on its frame. In the current setup configuration, a 10 mm thick glass tank of 720 mm × 720 mm × 140 mm (w × d × h) is fixed on the outer frame, and is used to bound the experimental area. The tank's bottom surface is fitted with a white polytetrafluoroethylene layer (PTFE) due to its small friction coefficient, which allows for smooth motion of the lure (see Sec. V-A). Inside the tank, we use the same circular shaped arena that was used in our previous setup [42]. An additional inox plate is glued on the outer bottom part of the tank and connected to the positive pole of an external power supply. A second plate is placed below the glass tank, on four spring-loaded supports (see Fig. 1) that are attached to the frame. This space is where the wheeled robot(s) operate. The plate consists of a perforated inox layer glued on transparent plexiglass. The holes in the inox layer allow for light to pass through, and the plexiglass serves two purposes: 1) maintain the inox layer flat, and 2) diffuse the light passing through the perforated surface. Our previous setup entirely lacked those two characteristics. The distance of this plate to the tank bottom is regulated by the mounting location of the springs on the frame and support elements (gauge blocks) in between. The adjustable springs and support elements also serve as means to fine-tune the magnetic coupling strength between the lure and robot, by adjusting the distance between them. Additionally, the springs allow the experimenter to easily add or remove robots by momentarily compressing the springs, instead of the external crank lift system used in our previous setup.
We attach two cameras of different specifications in two aluminum beams at the top and bottom of the outer frame, for each camera respectively (see Figs. 1a, b). The top camera, which is used to monitor the contents of the glass tank, is a monochrome high resolution (4024 pixels × 3036 pixels) Basler acA4024-29uc fitted with a low distortion lens. The camera is capable of delivering frames at 30 Hz, twice the rate of the camera used in [6] and [10], with added resolution. The bottom camera is the same full high-definition (1920 pixels × 1080 pixels) color webcam (ELP-USBFHD01M-L170) from [6] and [10]. It is capable of retrieving frames at 30 Hz and is equipped with a fisheye lens that can keep the second plate in frame even when it is mounted at a low position (close to the camera in Fig. 2e). The bottom part of the frame, which includes the plate where robots operate, is enclosed by Medium-density fiberboard (MDF) boards. This eliminates environmental light sources and allows for easier detection of the LED lights located at the bottom part of the robot's chassis.

A. MECHANICS
A full depiction of the LureBot's mechanical design 1 is presented in Fig. 2, and can be generally summarized as a two-part design that consists of its chassis and cover. The robot's outer dimensions are 49 mm × 50 mm × 42.7 mm (w×d×h), not including the magnets (Fig. 2a) and ball casters (Fig. 2i) [5].
The LureBot's chassis is roughly equal to the bottom half of its height and houses two motors symmetrically placed in its center. We explicitly designed it in a differential drive configuration to allow for rapid direction changes, including rotations in-place thanks to the motor placement symmetry, much like the U-turn movements exhibited in fish schools [16]. We use two independent Faulhaber Sample frame depicting the fused information from the top and bottom cameras after executing the trajectory assignment routine. The red marker signifies that the individual is the artificial robot; blue markers correspond to all other individuals; the orange marker represents the robot's desired position; and the two green circular markers are the two most influential neighbors of the lure (see [38] for more details).
AM1524-0450 stepper motors (Fig. 2h), that are capable of producing speeds up to 100 cm/s and accelerations of 175 cm/s 2 , which are more than adequate to express the motion profile of fish species like H. rhodostomus or Danio rerio [43]. The motors are directly attached to an aluminum frame (Fig. 2f), a material we explicitly chose to dissipate the large amounts of heat (up to 90 ℃) generated by the motors during long experiments. Furthermore, to facilitate the transfer of heat, we apply thermal paste between surfaces that come into contact with the motor's outer shell (e.g., the aluminum frame). We attach two brass parts (Fig. 2g) to the sides of the aluminum frame, primarily to add weight and improve traction during operation. As a result, the LureBot weighs 300 g and is significantly heavier than the FishBot v4.4's 80 g. A recessed area on each brass component accommodates two rubber wheels (Fig. 2h), each one directly attached to a motor.
In comparison, the FishBot v4.4 was unstable in high-speed movements (primarily angular), and for the majority of our past experiments, its maximum speed was limited to 20 − 25 cm/s [7], [42]. Hence, it was unable to reproduce the entire spectrum of speeds observed in fish schools. Increasing its speed required that we: 1) increase the torques (i.e., using new motors), and 2) decrease the operating distance of the robot to the top plate to ensure sufficient magnetic coupling in faster movements. However, the latter reduces traction in the wheels, and while this could be partially solved by adding weight, the motors on the FishBot v4.4 did not produce enough torque to support this choice. VOLUME 11, 2023 67643 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. On the lower part of the LureBot's chassis, there exist two ball casters extending the LureBot's length by 18 mm, that serve a dual purpose, namely: 1) they support the robot during its movement, and 2) have recessions made of light diffusive material for the LED lights ( Fig. 2j) facilitating its detection by the bottom camera. Finally, we place a conductive link, depicted in (Fig. 2a) below and along the center axis of the robot, to limit the effect of uneven friction forces when the link is touching the conductive plate located below the robot.
The second part of the LureBot's mechanical design, the cover, is designed to house two neodymium magnets (Nd-Fe-B) measuring at 8 mm × 8 mm × 4 mm (w × d × h) with a magnetic strength of 14.7 N (1.5 kg), depicted in Fig. 2b, used to magnetically move the lure within the tank (Fig. 2b). The magnets protrude by half their size (i.e., 4 mm) above the cover to allow for easier replacement if necessary, while remaining firmly fixed in a symmetric arrangement during operation. Additionally, we attach a conductive link along the center axis of the cover (Fig. 2a), similarly to the bottom one, that makes contact with the inox plate located below the glass tank. The cover is also used to enclose and protect the robot's electronics (discussed in the following section). Similarly to the FishBot v4.4, and unlike battery powered robots [33], [35], [59], the two conductive links allow for continuous access to a power source during operation, i.e., the robot can operate normally for extended periods of time (≫3 h).

B. ELECTRONICS
The LureBot is driven by two main components, the Arduino Nano 33 IoT (see Fig. 2n) connected on a custom circuit board (see Fig. 2m). We use the Arduino as an endpoint (see Fig. 1l) that communicates with the high-level interface (see Fig. 1k) and receives motor commands. We use those commands, i.e., the desired motor speeds, to time-schedule the step signals of the two Faulhaber motors at 100 Hz. The resulting signals are propagated to the custom circuit board that eventually powers and drives the two Faulhaber motors. The motors have a nominal voltage of 2 V, but we power them at 5.3 V to ensure that they have sufficient current to achieve the desired holding 67644 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
torques. However, this means that the motors produce more heat than intended. In addition to the heat dissipation measures described in the previous section, we use a Pulse-Width modulation (PWM) signal operating at a 70-30% ratio at 1 A and 0.2 A, respectively, to limit the amount of time the motors spend on high currents, and effectively reduce the heat they produce. Therefore, the ratio choice is a tradeoff between producing sufficient torques and low temperatures, and we extensively tested the robot to obtain one that yields a good balance. The circuit board also houses and powers two LED lights (see Fig. 2j) and three TCRT1000 infrared (IR) sensors (see Fig. 2k). Finally, we add two supercapacitors (charging at 3 V with 10 F capacity, each), on two sides of the board (see Fig. 2l). Their role is to ensure that temporary loss of power (e.g., conductive link not making good contact with the plate or voltage drops) does not cause a complete power down or lead to dimmed LED lights, which are critical for the robot(s)' detection and control.

IV. BEHAVIORAL OBSERVATION AND BIOHYBRID INTERACTION FRAMEWORK
The experimental setup and robot/lure is operated by the Behavioral Observation and Biohybrid Interaction (BOBI) software framework, for which, modules are implemented as ROS 1 packages. 2 We use ROS because of its: 1) widespread use and support in the robotics community; 2) packagebased architecture that allows modules to be easily replaced, maintained, adapted, or extended; 3) distributed architecture that allows programs (nodes) to be run on different machines to balance the computational load; 4) support of many common programming languages, e.g., C++ and Python, which makes it easier to alter high-level operational aspects (e.g., the behavioral model generating trajectories) for people with limited knowledge or interest in systems programming.
In comparison, our previous Control And Tracking Software (CATS) [6], was packaged as a single C++ software suite, with explicit dependencies to external libraries (e.g., GStreamer 0.1 [60]). These choices shortened its life span and proved rather limiting: 1) for experimenters with little programming know-how, as it required good knowledge of C++ programming; 2) for maintenance, as GStreamer has since moved to a newer version that is not backwards compatible; 3) for software and hardware upgrades, because newer operating systems present dependency conflicts with CATS' external libraries which have been considerably updated and often do not support newer hardware (e.g., GStreamer 0.1 with USB Basler cameras).
As depicted in Fig. 1, BOBI is currently comprised of 4 main packages for vision, control, logging tasks, and interfacing with the robot (orange, green, blue, and red color, respectively). Additionally, there are 2 supporting packages that hold ROS message and service definitions, i.e., the definitions of communications that allow the system to distribute information in real-time, and, finally, simulation models 2 Code available at https://doi.org/10.5281/zenodo.7796357 for the LureBot. In the following subsections, we detail the implementation of the three operationally fundamental modules, namely, vision, control, and robot interface. Supplementary Video S1 includes a depiction of a single operational cycle within the framework.

A. VISION
Similarly to our previous work [6], we utilize two cameras installed at the top and bottom of the experimental setup (see Figs. 1a, b and Sec. II) to track the individuals (including the lure, if any) and robot, respectively. The cameras operate at their maximum rate of 30 Hz, twice the rate used in our previous setups [6], [42], which allows for tracking even the very rapid and fine movements of fish or other rapidly moving animals.
Both camera streams are downsampled at source from their original resolution to 512 pixels × 512 pixels and 640 pixels × 480 pixels for the top and bottom camera, respectively, to reduce the computational load. Operating the cameras at their highest resolution is computationally demanding and not required for fish individuals, but the extra resolution could prove useful for smaller animals, e.g., ants. At the beginning of an operational cycle, we obtain two frames, one from each of camera stream. The two frames are subject to distortion caused by each camera's lens, therefore, in the modules depicted in Fig. 1f and g, we first undistort them, and optionally apply a mask to retain user-defined regions of interest (i.e., to further reduce the computational load and assist the detection). Then, we run two routines for each frame in parallel.
For the bottom camera frame, we apply a color threshold twice, once to isolate the light blob produced by the front LED and once for the light blob produced by the back LED. The two LED lights have been purposely given different colors to indicate the heading of the robot instantly, unlike the single LED color used in [6] which requires that the heading is inferred from the robot's movement.
For the top camera frame, we use the first 500 frames to train a Mixture of Gaussians background subtractor variant (namely, MOG2) [29] with a learning rate λ = 0.05 using the implementation provided by OpenCV [11]. Once the training is complete, we instead start by subtracting the background from the frame to remove static objects (e.g, the tank's walls) from following operations. Then, we run a blob detection algorithm to extract regions of interest that could potentially be identified as individuals. We directly remove small blobs with size much smaller than the animals being tracked. We use the remaining blobs to create a masked frame which contains black pixels outside their boundaries and the original pixel intensities inside, substantially reducing the computational load of subsequent operations. We apply a corner detection algorithm, namely, the Shi-Tomasi [54], on the masked frame to extract candidate pixel positions of the individuals' heads. These two pieces of information, that is, the coordinates of the head and the centroid of the blob, give a good estimate of the individuals' instantaneous heading directions and positions at any time, without the use of past frames.
Finally, we convert all coordinates from their pixel values to their actual coordinates in meters. To achieve this, we designed an auto-calibration routine that uses the robot and a lure to traverse a grid of points, while recording the positions of the robot and lure separately. After the grid is traversed, we use the two resulting matrices to solve a Perspective-n-Point system [39] and to retrieve the roto-translation matrices that allow for converting coordinates between the two cameras' different coordinate systems. This allows for precisely fusing information from the top and bottom cameras to identify which individual is indeed the lure, an important feature for the computation of behavioral models. In Fig. 1n, we depict an example of what this result looks like, where the individual in red color has been identified to be the lure.
In our experiments with up to 25 individuals, the described processes were completed in approximately half the time it takes for a new frame to arrive (i.e., at ≈60 Hz), using a computer equipped with an AMD Ryzen Threadripper 2970wx 24-core processor and an NVIDIA GeForce RTX 2080 Ti graphics card. We take advantage of the remaining time to apply a trajectory assignment routine (see Fig. 1h). More specifically, within the routine we apply operations to account and correct for missing individuals in frames (i.e., in case of overlapping or very small distances between individualswhich is particularly common in fish groups). More importantly, we attempt to maintain unique identifiers (IDs) for each individual across different frames in real-time. Whereas there exist many solutions to solve this problem offline [20], [44], [51], those methodologies are not fit for real-time systems, as they depend on past and future trajectory points to discern between individuals. Instead, real-time systems, like CATS [6], often bypass this problem by using behavioral models that, by design, do not require trajectory information or work under the assumption that errors are small. In BOBI, we formulate the ID assignment as a combinatorial optimization problem and apply a Hungarian method [32] to solve it. That is, we solve the minimization problem that follows in real-time: where P is a permutation matrix and C a cost matrix of size m × n. Assuming that there is no overlapping between individuals of two subsequent frames (our algorithm is able to automatically correct overlapping coordinates in some cases), then m = n. Otherwise, the minimization problem (1) is solved for the cost matrix C m×n and the missing individual coordinates are directly copied from past observations. In some cases, if prior observations are also uncertain, our algorithm allows the system to return a vector of coordinates smaller than the actual number of individuals, but still guarantees the smallest possible assignment cost. We experimentally parametrize and define the cost matrix as and where p i (t), p j (t − 1) are the Cartesian position vector of the individuals with ID i and j, at time t and t −1, respectively. Similarly, φ denotes the heading direction of individuals, and a, b are weighing parameters. For fish experiments, we found that a = 0.95 and b = 0.08 yields good ID assignments results.

B. CONTROL
We semantically separate the robot control into two types of controllers, namely, behavioral and motion controllers.
The former often consist of decision-making models or any general purpose trajectory generator, while the latter translate the desired trajectories into motor velocities. Our motion control routine, depicted in Fig. 1j, comprises a pair of proportional-integral-derivative (PID) controllers to regulate the linear and angular speed of the robot. The output of these controllers is subsequently converted into two motor speed commands, one for each motor. Specifically, the PID variant we utilized incorporates a priori knowledge of the desired speed, since most of our behavioral models generate decisions in the form of velocities.
The mathematical expression for the speed PID controller used in our study can be expressed as follows: where u(t) is the new motor speed, K p , K i , K d , and K a correspond to the proportional, integral, derivative gains, and an optional a priori speed gain, respectively. The e function denotes the error signal, which represents the difference between the desired and actual speed, while V a refers to the desired or a priori speed that can be explicitly specified in the behavioral control module. For the linear speed PID, we use (4), and define the error function as e linear (t) = ∥p(t) − p(t − 1)∥, i.e., the Euclidean distance between the current and goal position. Similarly, for the angular speed PID, we use the error function e angular (t) = φ(t)−φ(t −1) mod π. We typically find that when using the additional a priori component, the robot has smoother acceleration and deceleration phases, and simultaneously accounts for the loss of speed (due to the phase smoothing) with the proportional gain, and effectively maintains the desired average speed V a over short durations of time.
We denote V ′ and ω ′ the linear and angular speed generated by the two PIDs, respectively. Then, the left and right motor speeds for the differential drive, denoted as V l and V r , respectively, are computed as follows: where L = 0.0451 m the distance between the center point of the two wheels.

C. ROBOT INTERFACE
We currently offer support for 3 robots in BOBI, namely, the LureBot, the FishBot v4.4 used in our previous studies [6], [9], [42] and the Thymio II [41]. In the remaining of this section, we focus on the LureBot, our latest hardware addition that is presented here for the first time.
To interface with the LureBot we use the BLE protocol, which offers a publish-subscribe communication model. 3 More specifically, the high-level interfacing routine, depicted in Fig. 1k, is responsible for three tasks: 1) to send the motor commands to the corresponding BLE characteristic; 2) to react to notifications from the LureBot which include information about the robot state (e.g., current motor speeds, IR sensor values, etc.), and to communicate those back to the motion control module (see Fig. 1j); 3) to verify the stability of the communication link. In fact, the latter is a safety procedure we devised on both ends of the communication, the robot, and the computational machine running the highlevel routine, and can be summarized as an abrupt motor stop in case there has not been any incoming message for more than 0.5 s, or one of the two ends is detecting largely desynchronized communication. In the last part of Supplementary Video S1, we illustrate how the LureBot operates in a closed loop and ultimately interacts with the fish.

V. LURES
In our previous studies [7], [8], [13], [42], we made use of commercially available fishing lures, with a body length of 4.0 cm. They were factory-painted, and their tail was specifically designed to oscillate passively to attract attention. However, this presented two problems: 1) small-sized lures (length < 4 cm) are hard to find in commercial stores, and more importantly, 2) they rarely replicate the color patterns of actual fish in detail, especially those that are primarily lab animals, like rummy-nose tetra or zebrafish. In this section, we present the methodology we developed to construct two lures, a visually biomimetic and a non-biomimetic discshaped, with equipment that is readily available in most laboratories.

A. BIOMIMETIC (BM) LURE
To construct a biomimetic (BM) lure replicating the color patterns of H. rhodostomus, we first obtained a high quality 3D model of an actual H. rhodostomus. We built the replicas out of plastic, namely, PLASTIBAITS® Low Shore, which 3 Robot code (low level; see  is rated at 22 Shore hardness. We empirically found that this hardness index provides enough flexibility in-water to allow for sufficient deformation when in contact with objects (e.g., the tank wall or neighboring fish), and for passive tail movements due to water flow. The plastic, which is initially in liquid form, contains a hardener that is activated at high temperature, approximately 150 • . Therefore, we built the molds out of high-temperature tolerance resin material (see Fig. 3b). Then, we replicated the color patterns of H. rhodostomus in a 4-step process: 1) we introduced a small amount of silver pearl color pigment in the liquid plastic before pouring it into the mold; 2) we let the lures dry completely (usually a few hours) (see Fig. 3c); 3) we hand-painted the lures with consumer-level, alcohol-based markers and let them dry; 4) we coated the painted lures with varnish to protect the color. The final result is the lure depicted in Fig. 3d.

B. DISC-SHAPED (DS) LURE
For validation purposes, we also built a disc-shaped (DS) lure (see Fig. 3e) with the same process as described in the previous section. The DS lure was painted matte black using the same alcohol-based markers used for the biomimetic lure. Additionally, we molded the disc-shaped lure to have the same exact volume as the biomimetic, such that the only difference between them lies in their color and shape.

VI. TRAJECTORY GENERATORS
In this section, we describe the three trajectory generators that we have implemented on the robot to validate its capabilities. In the first two cases, the robot is passive and does not react to the fish, and it follows a predetermined circular trajectory or an eightfold rose trajectory. We specifically designed these non-biomimetic trajectories to study the extent to which actual fish interact with the two different lures, BM and DS. In the third case, the robot decisions are commanded by means of a state-of-the-art behavioral model [12] that generates realistic trajectories for H. rhodostomus.

A. CIRCULAR TRAJECTORY (CT)
The robot performs a clockwise circular trajectory of radius R ′ = 22.5 cm (see Fig. 4a; Supplementary Video S1). During this movement, the robot uses the PID controller summarized in (4) to track circular trajectory waypoints. Individual waypoints are generated every 0.2 s and advance the goal position by 0.1 rad, i.e., which corresponds to a theoretical constant speed movement of V = 11 cm/s, similar to the average speed exhibited by H. rhodostomus [43]. In this case, the robot follows a trajectory similar to what an actual single fish would do, by staying very close to the tank wall. This model is open-loop, in the sense that the robot does not react to the movements of the fish or to its relative position to the wall.

B. EIGHTFOLD ROSE TRAJECTORY (R8T)
We have designed a second open-loop trajectory generator, where the robot is instructed to perform a trajectory with an eightfold symmetry, similar to a so-called rose in mathematics (see Fig. 4b; Supplementary Video S1). Contrary to the previous case of a circular trajectory, the robot now spends long periods in the innermost area of the experimental tank. In fact, the interest of this trajectory lies in the fact that it allows us to explore whether a fish is willing to follow a DS or BM lure into areas of the tank that it would not normally visit.

C. BIOMIMETIC INTERACTION MODEL (BIM)
We have also implemented a closed-loop behavioral model describing the social interactions exhibited by H. rhodostomus, as defined in [12]. This model has been shown to reproduce the actual fish interaction dynamics with great accuracy, in numerical simulations [12], [43] and by implementing the model in groups of CUBOID robots [38] (these CUBOID robots were moving on a disc in open air and were not interacting with any fish). Here, we implement the model in the LureBot to conduct preliminary experiments with fish interacting with a lure (biomimetic or disc-shaped) propelled by the robot.
The model is constructed through a computational methodology [17] for fish species that perform a burst-and-coast swimming mode [12], like rummy-nose tetra (H. rhodostomus) and zebrafish (Danio rerio). Indeed, their motion consists in a succession of short and sudden acceleration phases (kick or burst), each followed by a longer deceleration period, almost in a straight-line (gliding or coasting phase). The updated heading and speed of a focal agent are decided during the kick phase and depend on its heading and distance with respect to the tank wall, and on its relative heading, relative position and distance to neighboring agents [12], [38]. We exploit the tracking features presented in previous sections to obtain real-time information and plan the robot's motion at time t + t, where t = 1/30 s, the smallest possible duration between two image frames. During the kick phase, the robot computes its target position and rapidly accelerates towards it. Subsequently, during the gliding phase, the robot attempts to maintain a straight-line movement with the speed profile computed at kick time. We also use the a priori component of the PID in (4) to approximate the speed profile that the model computes.

VII. EXPERIMENTAL PROCEDURE
Hemigrammus rhodostomus (rummy-nose tetras) were purchased from Amazonie Labège in Toulouse, France. Fish were kept in 16 L aquariums on a 12-12 hour, dark:light photoperiod, at 27 • C with a 30 min dimming period between phases and were fed ad libitum with fish flakes. The average body length of the fish used in these experiments is 35 mm. A trained technician feeds and verifies the housing conditions every day between 8:30 am and 9:30 am.
All behavioral experiments presented in the following sections were conducted within a circular arena of radius R = 25 cm. We filled the experimental arena in such a way that the water level inside the circular arena was approximately 5 cm. The water is supplied by the same water filtering system used for housing the fish. Therefore, it has the same salinity and conductivity conditions. Similarly, the temperature inside the tank is maintained at an average temperature of 27 • , to match the one in the rearing tanks. The behavioral setup presented in previous sections is housed in a separate room to the one containing the rearing tanks. Experiments were performed with fish that have been fed and only during the fully lit periods, between 9:00 am and 20:30 pm.
For all experiments, we follow the same procedure, summarized below: 1) Fish are randomly selected from a rearing tank that has not been used during the previous day, and placed in the circular arena. 2) They are subsequently given an acclimatization period of 15 minutes. During this period, if a fish is exhibiting a high-stress level (belly up; floating without moving at all. . .), we return it to its rearing tank and randomly pick another fish. 3) Each fish or fish group is left to interact with a lure for 1 hour and is then returned to its corresponding tank.
67648 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
For biohybrid experiments we adapt our procedure as follows: a) we first introduce the BM lure and conduct the experiment for 1 hour; b) we remove the BM lure and let the fish rest for 15 minutes; c) we introduce the DS lure and conduct another 1hour experiment with the same fish. 4) We return all fish to their rearing tank. This procedure ensures that no fish is tested twice in the same day, nor two days in a row, to avoid the fish getting accustomed to the lure or to specific patterns it exhibits.

VIII. DATA FILTERING
We use idtracker.ai (v4) [51] with a high-resolution recording (1500 × 1500 pixels) of the experiment to track the movements of all agents and extract their 2D trajectories offline. The software reports an average tracking success rate greater than 99.5%, a result that is further validated by manual inspection. Additionally, we run a post-processing procedure that checks for and corrects any remaining instances where agents' identities are misclassified or missing (e.g., when idtracker.ai cannot detect all individuals at a specific video frame). Analyses of later sections focus on the interaction of the lure with the fish, therefore, long periods during which the fish are barely moving are removed. More specifically, given the 35 mm average body length of H. rhodostomus, we remove intervals during which the fish or the lure speed is less than 1 BL/s. This procedure also removes instances where the magnetic coupling between the robot and lure is lost, and the lure is stationary. The percentage of the experiment that corresponds to those periods is further discussed hereafter, and is referred to as the ''inactivity percentage'', for brevity. Finally, all trajectories are resampled with a timestep of t = 0.1 s instead of the original 1/30 s. The new timestep is carefully selected to reduce the random noise introduced between subsequent frames and the dimensionality of the dataset, but is still small enough to study the interactions of fish and lure.

IX. RESULTS
We validate our robotic system software and hardware by conducting experiments first focusing on the impact of the choice of lure (DS or BM), and then, studying the behavior of the robot, in particular, when interacting with 1 or 4 actual fish. 4 Furthermore, we consider 5 observables to evaluate the robot's ability to move similarly to a fish and validate the importance of the visually biomimetic lure: 1) a qualitative comparison of the agents' trajectories by means of density heatmaps indicating the areas of the circular experimental tank visited by the robot and the fish during a given experiment; 2) the probability density function (PDF) of an agent's speed V ; 4 Data available at https://doi.org/10.5281/zenodo.7796158 3) the PDF of an agent's acceleration α; 4) for N > 1 agents, the probability density function of the group's interindividual distance: where i is the focal agent and the index j runs over its N − 1 neighbors; 5) for N > 1 agents, the inactivity percentage, i.e., the percentage of time when the focal agent is barely moving, as detailed in the Sec. VIII. Moreover, in order to quantify the (dis)similarity between the PDF produced by the fish and the DS/BM lures, we have also considered the Hellinger distance between these PDF (see APPENDIX and Tables 1 to 4 there).
In the first set of experiments, we study the impact on the behavior of a fish of using a biomimetic (BM) lure compared to a disc-shaped (DS) lure. We test each lure in 2 separate open-loop cases: 1) the lure is performing a circular trajectory (CT; see Sec. VI); 2) the lure is performing an eightfold rose trajectory (R8T; see Sec. VI). Hence, in this first series of experiments, the robot/lure is passive and does not react to the fish.
The second set of experiments consists of 3 closed-loop cases, where the robot is now commanded by the biomimetic interaction model (BIM): 1) without any fish in the setup, and generating realistic velocity commands when the robot is interacting with the tank wall alone (a baseline to validate that the robot can reproduce the basic motion profile of a single H. rhodostomus); 2) in presence of a single H. rhodostomus fish, and for both the BM and DS lure, and comparing the results to the spontaneous motion of a pair of H. rhodostomus; 3) with 4 H. rhodostomus, and comparing the results to the spontaneous motion of 5 actual H. rhodostomus.
Supplementary Video S1 shows side-by-side comparisons of all experiments.
A. EXPERIMENT NO 1: OPEN-LOOP DYNAMICS 1) CIRCULAR TRAJECTORY Fig. 5a and b display a short excerpt of the circular passive trajectory of the DS and BM lures, along with that of the fish interacting with the lure (see also Supplementary Video S1). More quantitatively, Fig. 6 presents the results corresponding to a 1-hour-long circular trajectory of the robot and the resulting trajectory of a single fish interacting with the DS lure (insets a-d) or the BM lure (insets e-h). Fig. 6i shows that when the fish swims with the DS lure in the tank, it maintains a typical distance of 46 cm from the lure, almost the maximum possible distance from the robot's predefined trajectory of radius R ′ = 22.5 cm. Remarkably, when the DS lure is replaced by the BM lure, the same fish maintains a much smaller typical distance of 3 cm. The DM lure is hence unable to capture the fish's attention. In fact, in the presence of the DS lure, the fish remains inactive for long periods, with an inactivity percentage (see Sec. VIII) of 71.1% (see   . 6j). However, in the presence of the BM lure, the fish is only inactive for 6.4% of the experiment's duration.
The robot typically moves at 11.3 cm/s (see the red and green PDF peak and median value that match in Fig. 6c, g), regardless of the lure choice, which matches the intended speed for this motion (see Sec. VI). When the fish swims with the DS lure, the speed of the fish is typically 4 cm/s, much lower than that of the lure, and rarely reaches more than 10 cm/s (see the PDF of the fish speed in Fig. 6c). However, when the same fish swims with the BM lure, its typical speed is now 11.4 cm/s (see PDF peak in Fig. 6g), very similar to the typical speed of the lure, and the speed PDF of the fish and the lure are also fairly similar (see Fig. 6g). Note that the speed PDF of the DS and BM lures display a ±2 cm/s fluctuation around the median speed, which naturally occurs when the robot slips or deviates from the circular trajectory momentarily and the PID controller (see Sec. IV-B) tries to compensate for it.
In terms of acceleration, the robot produces typical values of 17.5 cm/s 2 (see the peak of the red and green PDF in Fig. 6d, h), regardless of the lure choice. The PDF of the robot's acceleration is relatively narrow, as the robot is producing higher accelerations for compensatory movements alone. When the fish swims with the DS lure, its typical acceleration is 9 cm/s 2 (see the PDF peak in Fig. 6d), but when the same fish swims with the BM lure, the typical acceleration is 3 cm/s 2 higher (see the PDF peak in Fig. 6h). In the DS case, we recorded more instances where the fish had a low acceleration than in the BM case.
We have also computed the Hellinger distance between the PDF of speed and acceleration of the fish and that of the DS and BM lures. The Hellinger distance is a quantifier of the (dis)similarity of 2 PDF and is precisely introduced in the APPENDIX. The results of Table 1 confirm that the PDF of speed and acceleration for the BM lure are in much better agreement with the corresponding PDF for the fish, than for the DS lure. Fig. 5c and d display a short excerpt of the eightfold rose passive trajectory of the DS and BM lures, along with that of the fish interacting with the lure (see also Supplementary Video S1). More quantitatively, a 1-hour-long eightfold rose trajectory of the robot results in the pattern shown in Fig. 7a, e. When the fish swims with the DS lure, it qualitatively appears to follow the lure, but not enough to reproduce the clear pattern performed by the robot (see Fig. 7b). However, when the BM lure is in the tank with the same fish, the fish trajectory reproduces the eightfold rose pattern with a much better contrast than with the DS lure (compare Fig. 7b  and f). Fig. 7i shows the PDF of the interindividual distance for the pair. In the DS lure case, the pair typically moves at a distance of 4 cm, but also at greater distances, up to 15 cm. Notably, the PDF shows that the pair never swims closer than 3 cm (see the head of the red PDF in Fig. 7i). The fish typically swims at a distance of 3 cm from the BM lure, and can get as close as 1 cm (see the green PDF head and peak in Fig. 7i). In addition, the tail of the PDF of the distance between the fish and the lure is notably thinner than in the case of the DS lure. When the fish swims with the DS lure, it is inactive 27.9% of the experiment's duration. On the other hand, when the same fish swims with the BM lure, it practically does not stop moving (inactive 0.2% of the time; see Fig. 7j).

2) EIGHTFOLD ROSE TRAJECTORY
The robot's PDF of speed for both lures are marginally different, with typical speed of 11.3 cm/s and 11.7 cm/s for the DS and BM lure, respectively (see the peaks of the speed PDFs in Fig. 7c, g). The median speed for the two lure variants coincides with their corresponding peak speed. For both lures, the speed PDF of the fish is markedly narrower than that of the robot. In the DS case, the fish moves at a typical speed of 9.5 cm/s (see Fig. 7c). When swimming with the BM lure, the same fish moves slightly faster (see Fig. 7g), with a typical speed of 10 cm/s, and with a narrower speed PDF than in the DS case.
The acceleration PDF of the robot for the two lures are marginally different, with peak values of 15 cm/s 2 and 17 cm/s 2 for the DS and BM lure, respectively. This is due to more frequent slipping and trajectory deviation instances in the BM's case, which are caused by the forces applied by the water on its larger footprint. The fish accelerated in an almost identical manner in both cases with a typical acceleration of 12 cm/s 2 (see the peaks of the PDF in Fig. 7d, h), although, in the BM case, the fish acceleration PDF presents a slightly thicker tail, also observed in the BM lure's PDF.
Again, the results of Table 2 in the APPENDIX for the Hellinger distance confirm that the PDF of speed and acceleration for the BM lure are in better agreement with the corresponding PDF for the fish, than for the DS lure. However, Table 2 also points to the fact the PDF of the speed for the BM lure does not reproduce that of the fish as well as for circular trajectories (see Table 1).
In conclusion, the results of our first series of experiments indicate that a rummy-nose tetra fish interacts much strongly with our biomimetic lure than with the disc-shaped lure. For a circular trajectory, the DS lure is totally unable to capture the attention of the fish, whereas the fish faithfully follows the BM lure, staying at close distance. For the eightfold rose trajectory, the fish follows the DS lure, but without precisely matching the trajectory of the lure. When swimming with the BM lure, the fish remains closer to the lure, and reproduces much more faithfully the complex trajectory of the lure. Finally, for both types of trajectory, the fish is much more active when interacting with the BM lure than with the DS lure.  Fig. 8a and Fig. 8d depict the 1-hour-long trajectory of the robot and fish, respectively (see also Supplementary Video S1). The fish and the robot (driven by the BIM) both stay close to the tank wall -a consequence of the burst-and-coast dynamics [12] -although the robot is on average slightly closer to the wall than the fish.
The fish typically moves at a speed of 7 cm/s (see the peak of the PDF in Fig. 8b), but also exhibits faster movements of up to 30 − 35 cm/s. On the lower end, the fish does not move below 2 cm/s very often. The robot moves at a marginally different typical speed of 7.5 cm/s (see the peak of the PDF in Fig. 8e) and produces a narrower speed PDF tail in Fig. 8e), and maximum speeds in the range 25 − 30 cm/s, but also moves more often with a speed between 0 and 2 cm/s. The differences at the head and tail of the two PDFs are also reflected in the difference between the robot's median speed of 9.6 cm/s and the fish's median speed of 11.6 cm/s. The robot and the fish move with a typical acceleration of 9.5 − 10 cm/s 2 (see the peaks of the PDFs in Fig. 8c, f). Overall, the PDF of the acceleration of the robot and the fish are in excellent agreement (Fig. 8c), although the PDF for the robot displays a slightly fatter tail, which results in a slightly higher median acceleration for the robot (21.7 cm/s 2 ) than for the fish (18.5 cm/s 2 ).
Finally, the results of Table 3 in the APPENDIX for the Hellinger distance confirm that the PDF of speed and acceleration for the BM lure are in good agreement with the corresponding PDF for the fish.   and of the same fish interacting with the BM lure (see also Supplementary Video S1). More quantitatively, in Fig. 10, we show the full trajectories and the corresponding PDF for pairs of H. rhodostomus fish (insets a-d), the DS lure and a fish (insets e-h), and the BM lure and a fish (insets i-l). We use one fish (with ID 0) across all 3 cases to obtain  Fish 0). Note that fish 0 is the same across the 3 experiments. On all trajectories, a dot is shown every second, and the X marker represents the start of a trajectory. Again, the fish responds more faithfully to the motion of the BM lure than to the DS lure (see also Fig. 10 for a more quantitative assessment). a direct comparison. In both the biohybrid pair interaction experiments, the trajectories follow a similar trend, where the pair usually stays close to the wall, and only rarely swims away from it. This is in line with what is observed in actual groups of H. rhodostomus (see Fig. 10a, b). However, in the case of the DS, the actual fish tends to swim markedly closer to the wall than the fish-only pair and the biohybrid pair with the BM lure.
The PDF of the speed of both H. rhodostomus agents are almost identical, and shows that they typically swim at a speed of 4 cm/s, but at times reach higher speeds of order 27 − 30 cm/s (see the peaks and tails of the speed PDFs in Fig. 10c). The typical swimming speed for the biohybrid group with the DS lure, is 3.5 cm/s (see the peaks of the speed PDFs in Fig. 10g), with the two agents having an almost identical distribution of speed. The width of the speed PDF in the DS case is also marginally different from the ones from the fish-only case. In the biohybrid group with the BM lure, the speed PDF of the two agents are once again marginally different, and their typical speed is 4 cm/s and 4.8 cm/s for the fish and lure, respectively (see the peaks of the PDFs in Fig. 10k). Furthermore, the two speed PDFs show that the agents swim generally slower, almost always below 19 cm/s. Similar results are obtained for the PDFs of acceleration.
Indeed, the two fish acceleration PDFs are almost identical, with typical accelerations of 8 cm/s 2 (see the peaks of the PDFs in Fig. 10d) and at times as high as 75 cm/s 2 (see the tails of the PDFs in Fig. 10d). In the biohybrid group with the DS lure, the robot's typical acceleration is 9 cm/s 2 , while the fish typical acceleration is 4 cm/s 2 (see the peaks of the PDFs in Fig. 10h). The two agents do not often accelerate with high values (>50 cm/s 2 ). For the biohybrid group with the BM lure, the acceleration profile is marginally different from the DS case (see the PDF of acceleration in Fig. 10l).
The pair of H. rhodostomus tend to swim at a distance of 5 cm from each other (see the peak and median of the PDF of interindividual distance in Fig. 10m). In the DS case, the pair swims on average at a smaller distance of 3 cm, and sometimes as far as 10 cm. When the same fish swims with the BM lure, their typical distance is 4 cm, but as shown in Fig. 10m, the PDF of interindividual distances is wider than in the other two cases, meaning that the fish swim more often far from each other, as far as 17 cm. However, when the robot is following trajectories generated by BIM, it is by design attracted to its neighbor(s), regardless of its movement. Therefore, the interindividual distance is effectively coupled with the inactivity percentages shown in Fig. 10n. As shown in Fig. 10n, the fish-only pair does not move for 74.9% of the experiment's duration. When the DS lure replaces one of the agents, then, the pair is inactive less often, only 45.2% of the time. However, the lowest inactivity percentage out of the three cases is reported when the same fish is swimming with the BM lure. Then, the pair is inactive for 8.9% of the experiment's duration, which potentially explains the wider PDF of interindividual distance in Fig. 10m.
The results of Table 4 in the APPENDIX for the Hellinger distance show that the PDF of speed and acceleration for the BM and DS lures are in comparable and fair agreement with the corresponding PDF for the fish (Hellinger distances ≲0.2). However and as noted above, for both lures, the PDF of the distance to the fish is markedly different from the PDF of the distance between 2 fish, resulting in Hellinger distance values of 0.455 and 0.411 for the DS and BM lures, respectively.
Finally, in all our experiments presented up to now, we find that the biomimetic lure has a stimulating effect on the fish, resulting in the fish having a higher activity than when it interacts with the disc-shaped lure, or even when it interacts with a conspecific (see Supplementary Video S1).

3) BIOHYBRID GROUP OF 5 AGENTS
A qualitative assessment of the density heatmaps of Fig. 11a and d reveals that the biohybrid group (the robot and 4 fish) and the 5-fish group both tend to move close to the wall, although the radial dispersion of the biohybrid group appears to be larger. Yet, the robot radial dispersion is, in fact, very similar to that of fish 0 and 1 in the fish-only group. Furthermore, in both cases, we observe that the robot and the fish tend to adopt a similar trajectory radius throughout the experiment (in particular, see the atypical low radial dispersion of fish 3 in   Fig. 11d).
The group of 5 fish swims at synchronized speeds, as shown by their speed PDFs in Fig. 11b. All fish typically swim at a speed of 14 − 15 cm/s and not faster than 25 cm/s (see the peak and tail of the PDF of speed, respectively). In the biohybrid group, all agents swim typically faster than the 5 fish-only group, with typical speeds in the range 17 − 19 cm/s for the fish and 23 cm/s for the robot (see the peaks of the corresponding speed PDFs in Fig. 11e). They also reach higher speeds than the fish-only group, up to 30 cm/s for the fish and 35 cm/s for the robot. In other words, the robot commanded by the BIM swims faster, and the fish adjust their speed profile accordingly. Fig. 11c shows that agents in the 5 fish-only group have almost identical acceleration PDFs, with a typical acceleration of 16 cm/s 2 ), and less frequent high values up to 60 cm/s 2 ). In the biohybrid group case, the PDF of acceleration for the robot is wider, with a typical value of 35 cm/s 2 , but also producing higher acceleration, up to 90 cm/s 2 (see the peak and tail of the PDF of acceleration for the robot in Fig. 11f). The fish in the biohybrid group also tend to produce higher accelerations, in the range 20 − 25 cm/s 2 , but rarely going above 75 cm/s 2 .
The group of 5 H. rhodostomus typically swims in close formation with a typical interindividual distance d ∼ 5 cm (see the PDF of interindividual distance in Fig. 11g). The group does not often swim with a distance greater than 9 cm or smaller than 2.5 cm (see the tail and head of the PDF of interindividual distance). Despite the speed and acceleration differences, the biohybrid group also swims in close formation, with a typical d ∼ 6 cm (see the peak of the PDF of interindividual distance in Fig. 11g). Similarly to the fishonly group, the interindividual distance does not get larger than 9 cm, but is remaining above 4 cm (see the tail and head of the PDF of interindividual distance; Fig. 11g). The median interindividual distance is very similar in both cases (see the white points in Fig. 11g). Both groups of agents remained very active throughout the experiment (see Fig. 11h), with an inactivity percentage of 2.6% and 1.6% for the biohybrid and fish-only group, respectively.
Despite the higher radial dispersion observed in the biohybrid group, and the higher typical robot speed compared to that of its 4 companion fish, the most important conclusion of this experiment is that the biohybrid group remains essentially as compact as the fish-only group. In particular, not only is the robot able to participate in the collective dynamics, but its presence does not lead to the dislocation of the group (see Supplementary Video S1). This, along with our experiments with one fish interacting with a passive biomimetic lure (see Sec. IX-A) or in closed-loop with the BIM robot (see the previous section), shows that the robot is fairly well accepted by the fish, which respond to its presence in a way consistent with their response to the presence of one or four conspecifics.

X. DISCUSSION AND CONCLUSION
The study of social interactions in animal groups has traditionally relied on a combination of controlled experiments with numerical simulations of mathematical behavioral models [12], [17], [27] and machine learning approaches [15], [25], [42]. However, robotics offers an alternative avenue for investigation, utilizing autonomous agents capable of infiltrating animal groups to elicit responses from within the group [31]. These robots can serve as autonomous or precisely controlled units to probe the reactions of the animals. In the specific context of fish social interactions, numerous robotic systems have been proposed, and various behavioral models have been employed to facilitate interaction with the fish. Nonetheless, the complexity of such systems often necessitates experimentation with small groups of animals, simplified behavioral models, and limited durations. The latter constraint is particularly limiting when studying long-term interactions that emerge within fish groups [43].
In this work, we have introduced a versatile framework for behavioral experiments and open-sourced its hardware and software components. Our new and improved tools enable the execution of real-time, highly precise biohybrid animal experiments while maintaining a minimal physical footprint in the experimental space. This aspect, to our knowledge, has not been explicitly addressed in similar studies, but we believe it significantly enhances both the experimenter's experience and laboratory conditions. Furthermore, we present a new robotic system, the LureBot, which demonstrates increased agility, precision, and extended operation duration compared to our former system, the FishBot v4.4. Our findings show that, with the robot's augmented torque and new perception and control algorithms, it can effectively interact with up to four H. rhodostomus, a very demanding task for any miniature robot. Additionally, we showcase our procedures for constructing biomimetic lures, emphasizing that, in many contexts, such as for fish groups, their visual appearance plays a critical role in facilitating interactions.
More specifically, using this system, we show that fish exhibit a strong preference for biomimetic lures over nonbiomimetic ones. Once this has been established, we deploy our robots with a closed-loop behavioral model to interact with groups of fish. This data-driven behavioral model exploits the reconstructed social interactions of H. rhodostomus [12] and has been shown in simulations to faithfully reproduce the collective behavior of groups of 1, 2, and 5 fish [12], [38]. First, we demonstrate that the LureBot can express the entire motion profile spectrum of the species under study (e.g., H. rhodostomus), when interacting with the tank wall alone. Next, we present the results of experiments involving one fish and a lure, showing that the fish reacts to the robot similarly as when swimming with another fish. Notably, the biohybrid experiment consistently exhibits high activity, indicating that the robot can continuously engage in interactions. This finding holds significant potential for experiments requiring the collection of large, reproducible datasets. We also conduct experiments with larger groups, consisting of one lure and four fish, and show that the biohybrid group behaves comparably to fish-only experiments. However, in the five-agent experiments, the robot moves faster than individual fish in either the biohybrid group or fish-only experiments. Despite this, group cohesion is maintained, suggesting that although the biohybrid does not perfectly reproduce fish-only experiments, the fish in the group do not seem adversely affected, unlike when non-biomimetic models are used [42].
This research not only contributes to the development of more efficient and sophisticated biohybrid systems, but also paves the way for future studies to explore the intricacies of animal behavior and social interactions. The open-source nature of the framework should encourage further advancements and adaptations within the field, thereby fostering a deeper understanding of the mechanisms underlying the collective behavior of various animal species.
Limitations and Future Work: While significant progress has been made in comparison to existing platforms, certain aspects of our robotic platform still warrant further exploration and development. Narrowing the gap between the spontaneous movements of fish and those generated by biohybrid groups depends on the continuous development of motion models and the hardware supporting them.
The inherent limitations of mechanical devices, such as the LureBot, which lack the plasticity of living organisms, pose a challenge. For instance, fish, including H. rhodostomus, can execute extremely rapid directional changes that the LureBot can only approximate. In particular, the LureBot cannot fully express the burst-and-coast dynamics (sudden acceleration followed by a gliding period) observed in several fish species. Moreover, due to the inherent design of the BOBI and LureBot, the lure effectively moves in two dimensions. While the majority of fish experiments in the context of the study of collective phenomena consider fish swimming in shallow water (an effective two-dimensional setup), let us mention that some fish robotic platforms have the ability to move in 3D [2], [52]. In many cases, such as in this study, the biomimetic lure, while visually very similar to the considered fish, is passive: it does not actively beat its tail or bend its body, nor can one control its posture. Whereas lures with an actively beating tail have been proposed [8], such lures are bound to be larger than the considered species, to accommodate the necessary electronics and mechanics.
Future research will explore improved motors and LureBot configurations that could potentially allow it to perform a true burst-and-coast motion. While transitioning to an alternative robotic system, such as a Cartesian arm, could provide solutions in certain aspects (e.g., increased reactivity), it would significantly hinder the possibility of conducting multi-robot experiments. In addition, a comprehensive analysis is needed to assess the extent to which the social interactions expressed  by the LureBot are realistic and whether fish truly interact with the LureBot like with a conspecific. This analysis, currently underway, will involve multiple experimental replicates, shedding light on the finer aspects of the biohybrid system. More specifically, we plan to measure and reconstruct the interactions between the LureBot and the fish (as done for fish only in [12]) in order to assess the similarities and differences between the fish-LureBot and fish-fish social interactions.

XI. ETHICS STATEMENT
All H. rhodostomus experiments were conducted at the Centre de Recherches sur la Cognition Animale, Centre de Biologie Intégrative, CNRS, Université de Toulouse -Paul Sabatier. Experiments were approved by the local ethical committee for experimental animals and were performed in an approved fish facility (A3155501) under permit APAFIS#27303-2020090219529069 v8 in agreement with the French legislation.

APPENDIX
To quantify the (dis)similarity of the PDF presented in the Results section, we consider the Hellinger distance D(F|G) between two PDF F(x) and G(x) for the same observable x [3], [4]: where we have used the normalization of the PDF, F(x) dx = G(x) dx = 1, to obtain the last equality. The first definition of D(F|G) makes clear that it measures the overall difference between F(x) and G(x), while the second equivalent definition has a nice interpretation in terms of the overlap of both PDF. Indeed, the second definition measures the distance from unity of the scalar product of √ F(x) and √ G(x) seen as vectors of unit Euclidean norm (a consequence of the normalization, √ F(x) 2 dx = 1).  The Hellinger distance is zero if and only if F(x) = G(x), and it always satisfies D(F|G) ≤ 1. The upper bound D(F|G) = 1 is reached whenever the supports of the two PDF are not intersecting, so that F(x) × G(x) = 0, for all values of x. In practice, a value of D(F|G) ≥ 0.2 points to the two PDF being markedly dissimilar.
In Tables 1 to 4 below, we have computed the Hellinger distance for the PDF for the two open-loop experiments (circular and eightfold rose trajectory for the DS and BM lures), for a fish or a BM lure alone in the tank, and for the closed-loop experiments for pairs of individuals (2 fish; fish 0 and DS lure; fish 0 and BM lure).

SUPPLEMENTARY MATERIAL
Supplementary Video S1: Video segments of experiments and overview of BOBI. GUY THERAULAZ received the Ph.D. degree from Aix-Marseille University and the Habilitation degree from Paul Sabatier University, Toulouse. He is currently a Senior Research Fellow with the National Center for Scientific Research (CNRS), Centre de Recherches sur la Cognition Animale, Toulouse, France. He is an expert in the study of collective animal behavior and a pioneering researcher in the field of swarm intelligence. He is the author of more than 100 publications and five books, among which Swarm Intelligence: From Natural to Artificial Systems (Oxford University Press, 1999) and Self-Organization in Biological Systems (Princeton University Press, 2001) are considered as reference textbooks. He received the Bronze Medal of the CNRS.
CLÉMENT SIRE received the Ph.D. degree from ENS Paris. He was a Postdoctoral Researcher with AT&T Bell Labs. He is currently a Senior Research Fellow with the National Center for Scientific Research (CNRS), Laboratoire de Physique Théorique (LPT), Toulouse, France, where he was the Head of the LPT, from 2007 to 2015. He became an expert in out-of-equilibrium statistical physics and its applications in physics, but also in the understanding of collective phenomena in animal and human groups. He is the author of 100 publications in physics and biology journals. He received the Bronze Medal of the CNRS. He is an Outstanding Referee of the American Physical Society.
FRANCESCO MONDADA (Member, IEEE) received the master's and Ph.D. degrees from École Polytechnique Fédérale de Lausanne (EPFL), Switzerland. He led the design of many miniature mobile robots, commercialized and used worldwide in thousands of schools and universities. He co-founded several companies selling these robots or other educational tools. He is currently a Professor with EPFL. He is the author of more than 100 publications in the field of robot design. He received several awards, including the Swiss Latsis University Prize, the Best Young Researcher from EPFL, and the Credit Suisse Award for Best Teaching as the Best Teacher from EPFL.