1 Introduction

Robotic lures offer several advantages in the study of animal behavior (Garnier 2011): they can be built and modulated as required; they can be controlled in a closed loop according to the animal behavior; and they are physical entities and can therefore have real physical interactions with the animals. In addition, the development of these robots allows researchers to verify the communication channels that the animals use and that trigger social behaviors among conspecifics. Finally, robots are appropriate tools for testing models of behavior, as, in comparison with simulators, they can reproduce the same dynamics and actions as the animals in the environment (Krause et al. 2011).

It is for these reasons that the use of mobile robotic devices to study the behavior of animals in their natural environments (Maho et al. 2014) and in laboratory research is increasing. The behavior of animals can be observed by such robots and, depending on their design, can also be influenced by them. In Vaughan et al. (2000), a robotic sheepdog able to gather a flock of ducks was introduced. This was the first example of a robotic device exploiting and controlling animal behavior in a closed loop, due to the sheepdog’s effect on the ducks. In contrast to the research to be presented in this article, the robot was not perceived as a conspecific by the animals, but as an external agent that was able to control their behavior. The first project to deal with mixed animal–robot societies involving multiple robots and animals, and where the robots were accepted by the animals as society members, was the European project LEURRE (Halloy et al. 2007). During this project, a mixed society of cockroaches and robots was created, where specially designed autonomous mobile robots were able to interact with the cockroaches, to participate in social decision making as members of the society. To the best of our knowledge, since LEURRE, no other projects have achieved a mixed animal–robot society with multiple robots being socially integrated and interacting in a closed loop with the animals.

‘Robotic tools are currently widely used in behavioral studies of various species, such as honeybees (Griparic et al. 2015; Landgraf et al. 2010), rats (Shi et al. 2010; Laschi et al. 2006), crickets (Kawabata et al. 2013), squirrels (Rundus et al. 2007), tungara frogs (Taylor et al. 2008) and cows (Correll et al. 2008), and most likely many others, with some of them also providing closed-loop control of the robotic agents, which allows the robot to adapt to the animal behavior. In the past decade, researchers in the field of animal–robot interaction have tried to extend this field of study to fish. Four major types of robotic devices have been created for fish–robot interaction studies: a two-dimensional moving platform underneath a tank to transmit the two-dimensional motions to a lure inside the tank using magnetic coupling, as shown in Faria et al. (2010); robotic arms that steer lures inside aquariums, as shown in Phamduy et al. (2014), Polverino and Porfiri (2013a, b), Kopman et al. (2013), Abaid et al. (2012), Butail et al. (2014a), Cianca et al. (2013), Ladu et al. (2015a, b), Polverino et al. (2012), Spinello et al. (2013), Bartolini et al. (2016), Donati et al. (2016), Ruberto et al. (2016, 2017), and Romano et al. (2017); wheeled mobile robots that move below a tank and steer lures inside the tank using magnetic coupling, as shown in Swain et al. (2012), Rashid et al. (2012), and Landgraf et al. (2013, 2016); robotic lures that swim autonomously underwater, as shown in Abaid et al. (2013), Butail et al. (2013), and Butail et al. (2014b). While these studies have demonstrated the potential to develop artificial devices able to interact with fish, there is no solution involving multiple robots that move independently and reproduce the same trajectory and locomotion patterns as the fish being studied, which would show how a group of robotic agents would integrate and be able to modulate the collective decision-making process of the animals, as was the case in the LEURRE project. In addition, changes in fish collective behavior have not been clearly observed, often due to the type of experimental setup used.

In this research, we design and validate a framework to conduct experiments with mixed societies of fish and robots in which the robots interact in a closed loop with the fish. We selected the zebrafish Danio rerio as a model of social vertebrate to perform experiments to qualify our system. The zebrafish is a social species that prefers to swim in groups and shoal most of the time. This shoaling behavior is believed to be innate and starts soon after hatching (Spence et al. 2008). It is also a model organism commonly used in fish–robot interaction studies, such as the one previously presented. The group of robots consists of miniature wheeled mobile robots that steer fish lures in a tank using magnetic coupling; preliminary versions are described in Bonnet et al. (2012, 2014). The robots are able to mimic the collective behavior of the zebrafish and influence it. We used a constrained environment, a circular corridor, to obtain clear metrics regarding the agents’ collective choices. The environment was also modified so that it biased the collective choice of the fish, and we showed that the fishes’ response to the robotic agents would also depend on the environmental conditions. This paper demonstrates the application of an already existing methodology to build mixed societies of robots and animals (Mondada et al. 2011) and its effects on a society composed of zebrafish and robots, which is promising for animal interaction studies.

2 Materials and methods

Our approach is based on a methodology similar to the one used in the LEURRE project, where the authors succeeded in implementing a mixed society of living and artificial agents (cockroaches and robots) (Halloy et al. 2007). The goal behind this methodology is twofold: first, to show that the artificial agents behave like the group of animals and second to show that the mixed society can behave in the same way as if the society was composed of only real animals (Mondada et al. 2011). Once we have shown that the artificial agents are integrated into the society, we can show that they can also influence the society in its collective decisions, just as some members of the animal society make decisions for the collective (Krause et al. 2000; Ward et al. 2013).

2.1 Experimental setup

To conduct the experiments with mixed groups of zebrafish and robots, we built a \(100\times 100\times 25\) cm\(^3\) experimental tank made of glass. The bottom surface was covered with white Teflon plates to avoid the reflection of images on the glass and to have a smooth surface for the motion of the fish lure module inside the aquarium (Fig. 1). The tank was placed on a supportive structure 60 cm in height and made of aluminum legs connected by horizontal bars. This structure leaves sufficient space below the tank to place a support on which wheeled mobile robots are move. The tank was filled with water up to a level of 6 cm, and the temperature was set to \(26\,^{\circ }\mathrm{C}\). This level of water does not cause more stress for the fish, and the fish lure, the height of which was fixed at 3 cm and could not vary, would be more visible to the fish swimming around. The whole setup was confined behind white sheets to isolate the experiments from the rest of the room and to ensure consistent luminosity. A 110-W fluorescent lamp was placed at each side of the tank and oriented toward the white sheets to provide indirect daylight lighting of the tank. The robots moved underneath the aquarium, and the motion was transmitted to fish lures by using magnets, as in Swain et al. (2012), and Landgraf et al. (2013, 2016).

Fig. 1
figure 1

Left: the experimental setup used. a Basler camera used to grab high-definition frames to track the agents from the top. b Lure inside the aquarium linked to the wheeled mobile robot FishBot using magnetic coupling. c Zebrafish. d Circular corridor arena that constrains the agents. e Aquarium of \(100 \times 100 \times 25\) cm\(^3\). f Water layer of 6 cm depth. g FishBot mobile robot moving under the aquarium. h Copper conductive plates to power the mobile robot (VCC). i Perforated stainless steel plates to serve as ground contact for the FishBot (GND) and to observe the FishBot LEDs from below. j The control station that runs CATS tracking and control software. k 180 degrees Fisheye camera to track the FishBot from below. Right: top view of the setup, where the binary choice is the swimming direction of the mixed society of fish and robots with the result of the online tracking performed on the low-resolution frames grabbed by the camera placed on top of the experimental setup. The position of the three zebrafish (purple dots) and the lure (orange dots) is retrieved, and the swimming direction of the fish is estimated using the position of the fish groups. The setup is cut into four quadrants during the analysis to estimate the fishes’ direction of swimming. The number of fish inside each quadrant is compared between the frames to determine how the fish majority is moving (Color figure online)

2.2 Arena

In order to constrain the zebrafish movements, the arena was composed of an outer circular wall and an inner circular wall that forms a circular corridor inside the tank (Fig. 1). This is a common setup to study the collective behavior of fish (Abaid and Porfiri 2010; Jiang et al. 2017) and offers a binary choice for the fish, as they can either move in a clockwise direction (CW) or a counterclockwise (CCW), which will be used to evaluate the effect of the robots on the collective decisions of the fish. The dimensions of the corridor were as follows: an external diameter of 58 cm, an internal diameter of 38 cm, and a corridor’s width of 10 cm. The choice of the 10 cm width is a good trade-off, allowing the zebrafish to have continuous motion without being stressed. Indeed, in a large area, the zebrafish will tend either to move along the walls or to stay in one place due to stress, but, in a very narrow corridor, they will move faster because they are stressed by the lack of room.

In order to voluntarily bias the experimental setup so that the fish would have a preference to swim in one direction more than the other, we designed an apparatus that can be placed in the center of the setup to create an inner wall for the circular corridor equipped with a rotating pattern made of black and white stripes (Fig. 2). The visual behavior of zebrafish has already been extensively studied (Fleisch and Neuhauss 2006), and some studies have shown that zebrafish can react differently to black and white stripes moving at different speeds (Maaswinkel and Li 2003). We used this mechanism as an environmental parameter to bias the collective choice of the fish without using the robotic agents to assess whether the robots were able to force the zebrafish to swim in the direction that they would collectively not preferred.

The designed system consists of a cylinder of 38 cm outer diameter and 12 cm high made of Plexiglas. Inside the cylinder, a DC motor with a ratio gearbox (Faulhaber, Croglio, Switzerland) rotates a circular pattern consisting of black and white stripes. A Raspberry Pi board is used to control the rotation speed of the motor in a closed loop, using the optical encoder of the motor as a measurement of the speed. The device can reach speeds between 0 and 30 rotations per minute (rpm). The motorization is quiet and can barely be heard by the a human ear. The system can be remotely controlled via Bluetooth, and the operator can select the speed and the direction of rotation during the experiment.

We performed preliminary tests to determine the rotational speed and the width of stripes that could affect the collective behavior of the fish. Of the different values tested, we selected a speed of 12 rpm and 3 cm wide black and white stripes, which resulted in a clear bias in terms of the swimming direction of the zebrafish, as shown in Sect. 3.1.

Fig. 2
figure 2

Left: 3D CAD design of the rotating stripes machine. A coaxial motor is rotating a rotor on which a circular sheet of black and white stripes is attached. Right: the rotating stripes machine installed in the circular arena. The system is powered by a rechargeable LiPo battery and is controlled by a Raspberry PI. The Raspberry PI can be remotely controlled from a computer via Bluetooth

2.3 Animals

The experiments performed in this study were conducted under the authorization N\(^\circ \)2778 delivered by the Department of Consumer and Veterinary Affairs of the Canton de Vaud (Switzerland) after approval by the state ethical board for animal experiments.

For the experiments, we used 100 wild-type zebrafish Danio rerio, with short fins. These zebrafish were acquired from a pet shop and were stored in a 60-L housing aquarium. The average total length of our zebrafish was \(\sim \) 4 cm. The water temperature of the housing aquarium was 26 \(^\circ \)C. The fish were fed twice a day with commercial food using a food distributor. The aquarium environment was enriched with plastic plants, Cladophora, gravel, rocks, and aquatic snails.

2.4 Mixed society size

We conducted preliminary experiments to determine the optimal number of fish required to obtain a clear collective decision response of the shoal. With a shoal size smaller than five individuals, the group was very homogenous. However, due to the low number of fish, there was a lower chance that one of them would be attracted by the robot and therefore a decreased possibility of seeing an effect on the whole group. There was also a high chance that the fish would freeze, probably because they usually live with other fish in their housing aquarium and feel stressed when there are few fish in an open area. For the case of shoals composed of more than eight fish, we observed that the effect of the robot on individuals is increased. However, the homogeneity of the group decreased with the increased number of fish. We observed that the best trade-off between observed effect and homogeneity was to have shoals of five or six individuals; therefore, we performed the experiments with groups of only six agents composed of either six zebrafish, or three robots and three fish.

2.5 Robot design and control

We used three miniature wheeled mobile FishBot robots, the preliminary design of which is described in Bonnet et al. (2012, 2014). These robots can achieve the required speeds and accelerations to reproduce the fish displacements underwater (Fig. 3, left). The robots are continuously powered using brushes that acquire power from two conductive plates and that are controlled via a wireless Bluetooth link. Therefore, it is possible to run long-duration experiments. In addition, due to their small width, two FishBots could cross inside the circular corridor without colliding and thus are able to achieve the same types of movements as the fish in this setup, reducing the risk of collisions.

In order to determine the swimming direction of the fish, we separated the experimental setup into four quadrants (Fig. 1, right). Every second, the algorithm determines the quadrant in which the majority of fish is currently swimming. This is then compared with the result in the next frame, and the majority of fish are counted as turning CW or CCW, depending on their new estimated position. The estimate of the shoal swimming direction is given to the robots’ controllers, which will make the robots rotate in the same direction as the fish.

The three FishBots were controlled using a proportional–integral–derivative (PID) control for the rotational speed, while maintaining a constant linear speed of 8 cm s\(^{-1}\). The targeted positions that the robots had to reach were generated 10 degrees in the CW direction of each FishBot location in the direction of the movement (CW or CCW). This resulted in the FishBots rotating either CW or CCW. A Braitenberg-based obstacle avoidance mechanism (Braitenberg 1986) that retrieved the signals from the infrared proximity sensors of the robots allowed the FishBots to avoid the walls and each other. The robots thus mimicked the fish swimming behavior in the narrow corridor, with the robots swimming along the corridor walls and with little oscillation between the two walls.

Fig. 3
figure 3

Left: FishBot, the mobile robot for which the design steps are described in Bonnet et al. (2012) and (Bonnet et al. 2014) that is used for reproducing the 2D motion patterns of zebrafish. The robot is equipped with infrared proximity sensors to avoid obstacles and other robots. The powering of the robot is continuously done using the electric brushes that acquire power from two conductive plates. The length is 4.3 cm, the width is 2.2 cm, and the height is 6.7 cm. Right: lure mimicking the zebrafishes’ shape and the tail-beating movements while moving underwater. The lure is mounted on a carbon stick glued on an iron plate on which two magnets are attached. The lure module is coupled with the FishBot via magnetic coupling

2.6 Lures

For this experiment, we used a soft fish lure with a length of 4.5 cm that mimicked the morphology of the zebrafish and passively beat its tail when moving underwater (Fig. 3, right). This lure was used in the preliminary experiments described in Bonnet et al. (2014), and we already showed that it obtained a strong acceptance by zebrafish. The lure was mounted on a carbon stick 3 cm high that was glued on an iron plate to which two magnets were attached. The lure supports were painted white to make them blend with the white background of the setup. The lures that were coupled with the FishBots were all identical.

2.7 Tracking and data analysis

The detection of the agents’ positions (fish and lures) was performed using low-resolution (\(500 \times 500\) pixels) video stream. All operations were processed using the OpenCV library (Bradski 2000). First, a background subtraction preprocessing step is applied on each frame, by using the Gaussian mixture-based background/foreground segmentation method described in KaewTraKulPong and Bowden (2002). The position of the agents was detected using a corner detection method (Shi and Tomasi 1994) on the resulting foreground frame, as the heads of the fish and lures have a distinctive sharp corner. This tracking was performed at 15 Hz to estimate the swimming direction of the agents.

The robots were tracked using light-emitting diodes (LEDs) placed below their chassis. Each FishBot was equipped with six LEDs of the same color, three located in the front and three in the back (Fig. 1g). A blob detector was used on the hue–saturation–value (HSV) color space image grabbed by a Fisheye camera placed underneath the tank (Fig. 1k) to localize the position of the LEDs, and the position of the robot was defined as the point in the middle of the two blobs. Each robot could be identified by its corresponding LED color.

In addition to the online detection of the agents, we also recorded high-resolution (\(2048\times 2048\) pixels) videos in order to process them offline using the software idTracker (Pérez-Escudero et al. 2014). This allowed us to retrieve the individual trajectory of each agents separately. This process is time-consuming and computationally intensive (idTracker tracks and identifies six agents in 30-min high-definition videos in 1 day) but reliable. There are no false positives and no propagation of identification errors, and fish are identified correctly in 95% of the time steps on average.

We extracted four different parameters from the data obtained using the tracking in order to assess the impact of the robots on the fishes’ collective behavior:

  • Collective decision The swimming direction of the group, thus the percentage of time that the agents were swimming CW or CCW during the experiment.

  • Linear speed The individual speed of the agents during the experiment. This parameter can be used to measure the change in the stress of the fish in the presence of robotic agents (Bartolini et al. 2016).

  • Number of transitions The number of time that an agent changes its direction of swimming during the experiment.

  • Inter-individual distances The distance between the agents, that is, the fish and the robots. This metric can be used to characterize the cohesion of the group (Séguret et al. 2016).

2.8 Experiment design

In both the biased and non-biased setups, we tested three conditions:

  • Control (CT) Six zebrafish were placed in the circular arena without any robots and were free to move either CW or CCW. The zebrafish were therefore only influenced by the environment; that is, any bias in the swimming direction could be ascribed to the rotating stripes machine. This experiment is the reference that is compared with the two other conditions, implying mixed groups of robots and fish.

  • Robots swimming with fish (RW) In this experiment, groups of three robots and three zebrafish were tested. The robots were following the decisions made by the shoal of fish. The robots were controlled to always swim in the direction of the group’s movement; therefore, if the majority of fish decided to swim in one direction, the three robots were controlled to swim in the same direction. This experiment was used to assess whether the robots can be controlled in a closed loop according to the fishes’ decisions and was compared with the control experiment CT to determine whether the introduction of robots had an impact on the collective group decisions.

  • Robots imposing a choice (RI) In this experiment, three robots were placed with three zebrafish, and the robots were controlled to turn only in one direction in the circular corridor. Hence, it was an extreme case that measured the impact of three robots going in one direction in a shoal of three fish. This experiment determined whether the robots were able to modulate the fishes’ collective behavior. In the experiments with the biased setup, the robots were programmed to move only in the opposite direction of the rotating stripes, in order to assess whether the robots could influence the fish to rotate in the direction that they do not collectively prefer.

The experiments lasted for 40 min. In the first 10 min, we let the fish acclimatize to the new environment similarly to what was done in Séguret et al. (2016), with the robots and lures already placed in the setup but immobile. Then, we started the movements of the robotic agents as well as the recording of the experiment. We repeated each condition eight times. One hundred zebrafish were used to perform these experiments. The zebrafish were randomly selected from their housing aquarium in the morning to perform a set of five to seven trials. We also varied the bias, that is, the swimming direction of the robots for the condition RI, and the direction of rotation of the rotating stripes for randomization to avoid other biases.

3 Results and discussion

In this section, we explain the results for the two species separately (robots and fish) as well as of the mixed group (fish with robots). For instance, we will describe the second condition RW by mentioning the whole group of six agents (RW6A), only the three fish without taking the robots into account (RW3F), and only the three robots without taking the fish into account (RW3R). For Figs. 4, 6 and 7, we tested the distributions using Kruskal–Wallis tests completed by a post hoc test: Tukey’s honest significant difference criterion. The Kruskal–Wallis was chosen due to the fact that the variance of the data varies depending on the condition.

Fig. 4
figure 4

Mixed society swimming direction preference for the three tested conditions in a non-biased (left) and biased setup (right). CT stands for control experiment condition, RW stands for robots swimming with fish, and RI stands for robots imposing a choice, in the opposite direction of the rotating stripes in the biased setup. We also make the distinction between the group of six agents (6A) and the subgroups of three fish (3F) and three robots (3R) for the second and third conditions. Eight trials were performed for each condition, and the duration of each trial was 30 min

3.1 Collective decision

3.1.1 Non-biased setup

Figure 4a shows the percentage of swimming direction for the entire shoal (six agents) in the non-biased setup. In the first condition, the control (CT), the group consists of six zebrafish, and in the two other conditions (RW6 and RI6), the group consists of mixed groups of three fish and three robots. The three distributions are significantly different (Kruskal–Wallis \(p<0.05\)), and a post hoc analysis shows that the mean ranks of the distribution of conditions CT and RW6 are significantly different from that of condition RI6, while conditions CT and RW6 have no significantly different distributions. We can observe that the collective decision of the mixed group of three fish and three robots is the same for condition RW as for condition CT with six fish. We can conclude that the three robots did not influence the collective decisions of the group of six agents. However for the third condition (RI6), we can observe that, by swimming in only one direction, the three robots modified the swimming direction preference of the whole mixed group compared to the RW6 condition.

Indeed, if we look at the two species separately for conditions RW and RI (Fig. 4c, e), we can observe that for condition RW, the zebrafish behaved in the same way as in condition CT by swimming half of the time in each direction, as the two distributions do not significantly differ. This influences the robots to behave as programmed and to follow the estimated collective decision of the zebrafish. This result shows that the zebrafish were not affected in their collective decision in this condition. Figure 5, left, shows the percentage of swimming direction for each trial separately for the RW condition. It shows that the robots were able to follow the decisions of the zebrafish in the non-biased setup most of the time.

Concerning the separation of both species for condition RI (Fig. 4e), the swimming direction preference of the zebrafish changed, and they preferred to swim in the same direction as the robots (Kruskal–Wallis \(p<0.05\)). This result is very promising, as it shows that the robots were able to influence the collective behavior of the fish shoal in a binary choice setup. Concerning the control of the robots in RI, even though they were programmed to move in only one direction, in some cases they were not turning in the same direction 100% of the time, as they sometimes collided with each other, which could cause one or two robots to move in the wrong direction for a short amount of time. However, as we obtained a common direction 95% of the time, we assumed that they were mostly moving in one direction.

Fig. 5
figure 5

Mixed society swimming direction preference for each of the eight trials in the non-biased (left) and biased (right) experimental setups for the second condition of RW, for which the three robots were programmed to follow the collective decision of the zebrafish. In orange, the collective preference of the three zebrafish, and in blue, the collective preference of the three robots (Color figure online)

3.1.2 Biased setup

Figure 4b shows the percentage of swimming direction for the entire shoal (six agents) for the three conditions in the biased setup. We can observe that the setup induced a bias in the collective choice of the zebrafish, with the group of six zebrafish (CT) swimming in the opposite direction of the rotating stripes 60% of the time in average, compared to (CT) in the non-biased setup (Kruskal–Wallis \(p<0.05\)). The bias had also a strong influence on the variance of this decision when compared with the variance of the fishes’ collective choice shown in Fig. 4a. Indeed, the zebrafish seemed to be sometimes highly affected by the rotating stripes and sometimes almost unaffected.

When comparing the mixed society of three robots and three fish for conditions RW and RI with condition CT in Fig. 4b, it can be seen that the robots have an effect on the group decisions (Kruskal–Wallis \(p<0.05\)). Using a post hoc analysis, we can state that conditions CT and RW do not differ significantly, and they have significantly different distributions compared with condition RI. Therefore, we can assume that we can build a mixed group composed of three fish and three robots that on the one hand behaves based on collective decisions like a shoal of six fish in a biased setup and on the other hand, that the robots are able to modify the whole mixed society by influencing the decision.

For condition RW, for which the robots were programmed to follow the collective decisions of the fish, the three distributions CT, RW3F, and RW3R significantly differ (Kruskal–Wallis \(p<0.05\)) (Fig. 4d), and a post hoc analysis shows that the mean ranks of the distribution of condition RW3F is significantly different from that of condition CT, while conditions RW3F and RW3R have no significantly different distributions. However, when looking at the trials separately for condition RW in the biased setup (Fig. 5, right) we see that the robots had more difficulties to follow the direction of the zebrafish compared to the experiment in the non-biased setup. This can be explained by the fact that, in the biased setup, the zebrafish moved with more abrupt movements that are difficult to mimic for the closed-loop control of the robots. The fish are thus adapting to the robot movements and seems less affected by the bias induced by the setup as it can be seen in Fig. 4d, when looking at the average of the collective decisions.

For the third condition in which the robots imposed a direction on the fish (RI), Fig. 4f shows that the decision of the zebrafish was not significantly modified compared with the first condition, CT. Thus, the influence of the robots was not enough to completely change the swimming direction preference of the shoal of fish compared to the equivalent experiment performed in the non-biased setup. Therefore, the robots have more difficulties to modulate the decisions of the zebrafish in such an environment, even though this is practically the case in RW condition, when the robots are programmed to follow the decisions of the zebrafish. Indeed, for the third condition, RI, the robots ignored the decisions of the fish and move on their own. The result is that the zebrafish seem to be less attracted to the robots’ decision compared to the second condition, RW.

3.2 Collective decision over time

In order to measure the potential of our system for long-duration experiments, we analyzed how the collective choices of the zebrafish shoal varied during the experiments. For that, we sampled the experiments in periods of 5 min and computed the average swimming direction percentage of the three fish for conditions RW and RI. Figure 6 shows the results of these measurements. For both conditions, there are no significant differences between the periods. This means that the effect of the robots on the collective behavior of the zebrafish seemed constant for experiments of 30 min.

Fig. 6
figure 6

Mixed society swimming direction preference over time for two conditions involving mixed societies of robots and fish: the robot swimming with fish (RW) and robot imposing a choice (RI) (a and b, respectively) in the non-biased setup. For both conditions, there are no statistical differences between the periods. We measured the average speed based on the eight trials completed for each condition in the non-biased setup

3.3 Linear speed

Here, we present the average linear speed of all the agents in the non-biased and biased setups (Fig. 7). For the non-biased setup (Fig. 7a), the distributions of the mean linear speed of the shoal of six agents do not significantly differ between the three conditions, which indicates that the global speed of the societies in the three conditions is the same.

However, when looking at the two species of agents separately (Fig. 7c, e), we can observe that for the second condition, RW, the robots were moving with a mean speed lower than that of the fish. This can be explained by the fact that the robots often turned in the setup due to the frequent change in fishes’ swimming direction. The three distributions (CT, RW3F, and RW3R) are significantly different (Kruskal–Wallis \(p<0.05\)), and a post hoc analysis shows that the mean ranks of the distribution of conditions RW3F and RW3R are not significantly different from that of condition CT, while conditions RW3R and RW3F have significantly different distribution. The speed of the fish for RW3F is faster than that for the CT. This effect might be due to the fact that by introducing robots that are usually slower than the fish into the group, the fish tend to move faster in order to maintain the same linear speed as they have in condition CT. For the third condition (Fig. 7e), however, we can observe that the robots are moving at 8 cm s\(^{-1}\) on average, as they were programmed to, and the speed of the fish is statistically the same as that of the controls, CT.

Fig. 7
figure 7

Mean speed of the mixed society for the three tested conditions in a non-biased (left) and biased setup (right). CT stands for control experiment condition, RW stands for robots swimming with fish, and RI stands for robots imposing a choice, in the opposite direction of the rotating stripes in the biased setup. We also make the distinction between the group of six agents (6A) and the subgroups of three fish (3F) and three robots (3R) for the second and third conditions. Eight trials were performed for each condition, and the duration of each trial was 30 min

Fig. 8
figure 8

Number of transitions of the mixed society for the three tested conditions in a non-biased (left) and biased setup (right). CT stands for control experiment condition, RW stands for robots swimming with fish, and RI stands for robots imposing a choice, in the opposite direction of the rotating stripes in the biased setup. We also make the distinction between the group of six agents (6A) and the subgroups of three fish (3F) and three robots (3R) for the second and third conditions. Eight trials were performed for each condition, and the duration of each trial was 30 min

3.4 Number of transitions

Figure 8 shows the average number of transitions of the agents; thus, the number of time an agent reversed its swimming direction during the experiment. For the non-biased condition (Fig. 8a), the three distributions (CT, RW6A, and RI6A) are significantly different (Kruskal–Wallis \(p<0.05\)), and a post hoc analysis shows that the mean ranks of the distribution of conditions RW6A and RI6A are not significantly different from that of condition CT, while conditions RW6A and RI6A have significantly different distributions. This can be explained by the fact that, for condition RI, the robots are not programmed to change directions, which is confirmed by the results obtained for RI3R in the biased and non-biased conditions.

Fig. 9
figure 9

Mean inter-individual distances of the mixed society for the three tested conditions in a non-biased (left) and biased setup (right). CT stands for control experiment condition, RW stands for robots swimming with fish, and RI stands for robots imposing a choice, in the opposite direction of the rotating stripes in the biased setup. We also make the distinction between the group of six agents (6A), and the subgroup of three fish (3F) and three robots (3R) for the second and third conditions. Eight trials were performed for each conditions, and the duration of each trial was 30 min

When comparing the mixed group of three robots and three fish for conditions RW and RI with condition CT in Fig. 8b, it can be noticed that there is a significant difference in the distributions of CT and RW3F and RW3R (Kruskal–Wallis \(p<0.05\)). A post hoc analysis shows that the mean ranks of the distribution of conditions RW3F and RW3R are not significantly different from that of condition CT, while conditions RW3F and CT have significantly different distributions. This shows that the behavior of the robots increases the number of transitions of the fish for this condition. As it was shown with the linear speed, the increase in transitions by the fish could be explained by the fact that the linear speed of the robots was slower than the one of the fish; thus, the fish had a tendency to make more transitions in their directions in order to adapt their behavior to the robots. Indeed, as it was the case for the linear speed, the number of transitions in RI3F is statistically similar to the number of fish transitions in CT.

It can also be observed that the rotating stripes do not to affect the number of transitions made by the fish when comparing the condition CT in the biased and non-biased setup, as the distribution does not statistically differ. The behavior of the mixed group seems globally similar in terms of transitions compared with the non-biased setup, except for RI3F where the fish make more transitions in average in the biased setup compared to the non-biased one. This can be explained by the fact that the fish, in this condition, were oscillating more as they were influenced both by the biased setup and by the robots that rotated in the opposite direction of the rotating pattern.

3.5 Inter-individual distance

We computed three types of inter-individual distances for the three conditions:

  1. 1.

    Inter-individual distance between all the agents for CT, RW, and RI.

  2. 2.

    Inter-individual distance between the three fish only for RW3F and RI3F.

  3. 3.

    Inter-individual distance between the robots only for RW3R and RI3R.

In order to compute the inter-individual distance, we computed at each time step, for each agent, the average of the distance that separates it from the other two or five agents, and then computed the mean for all agents at the end of the experiment. Figure 9 shows the mean inter-individual distance for the experiment in the non-biased and biased setups. First, the inter-individual distance of the robots is larger than that of the fish. This is because we do not control the inter-individual distances between the robots. This could be done for further analyses, by adding controllers that make the robots swim in shoals in this experiment.

Regarding the fish inter-individual distance, it does not vary significantly between experiments involving robots and experiments involving only fish, as there are no significant differences between the distribution CT and RW3F or CT and RI3F. The presence of the robots moving in the groups probably affects the cohesion of the zebrafish slightly, as it was demonstrated with the increase in linear speed, but not significantly. Therefore, we can assume that the robots did not cause a drastic change in the social behavior of the fish in terms of inter-individual distances.

4 Conclusions

The control experiment showed that the zebrafish move half of the time CW and CCW the rest of the time in the circular corridor arena, which shows that this setup is non-biased. When a device placed in the inner wall of the corridor rotated black and white stripes in one direction, it biased the swimming direction of the fish significantly over the entire duration of the experiment, as it was already described in Fleisch and Neuhauss (2006) and Maaswinkel and Li (2003).

In the non-biased setup, we built a mixed group composed of three animal agents and three robots in a circular corridor, with the robots able to modulate the choices of the zebrafish. When the robots were programmed to follow the collective fish movement, the mixed group of robots and fish did not appear significantly different from a group of six free-swimming zebrafish in terms of their collective decisions. While it is likely that the robots influenced fish behavior even though they were programmed to follow them, it is difficult to estimate the direction and degree of influence in this condition. In the case where the robots were programmed to only swim in one direction, they influenced the swimming direction of the fish, and thus, the collective choices of the whole mixed group changed, showing that the robots were able to modulate the fishes’ behaviors. Further analysis could be made in the future to quantify the interactions between the artificial and the living agents using information theoretic methods as it is shown in Butail et al. (2014a).

Finally, we showed that, in a setup biased by the rotating stripes device, the robots were able to modulate the collective decisions of the fish. However, due to the bias induced by the rotating stripes, the modulation was weaker compared to that which occurred in the non-biased setup. We showed that the collective decisions of the zebrafish were similar to the ones of the robots when the robots were programmed to follow their decisions instead of imposing a decision. This indicates that, in order to integrate robots into a group of zebrafish, the robots need to adapt and swim with the fish to increase their ability to modulate their decisions. This is a strong motivation for continuing efforts to build accurate controllers for the robots to mimic the behavior of fish and swim with them in the shoal.

The measures of the fish linear speed, number of transitions and inter-individual distances confirmed that the robots were not inducing stress in the fish, as, for instance, the linear speed and the number of transitions did not change significantly between the control experiment and the condition RI. However, the linear speed as well as the number of transitions of the fish increased in experiments in which the robotic agents were controlled to follow the choices of the zebrafish (RW). We suppose that this is due to the fact that the control of the robots was not totally mimicking the fish behavior, as the robots were moving with a lower linear speed than the fish due to the fact that the robots took more time to perform a U-turns in the corridor than the zebrafish, which could explain that the fish increased their speed and change of directions to compensate the low movements induced by the robots. Therefore, improvements could still be made in terms of the control of the robots to achieve complete integration of the robots into the group of fish as it was achieved for robots and cockroaches in Halloy et al. (2007). However, these experiments also showed adaptation of the fish to the robotic agents in terms of behavior, which shows the potential of the developed system to study mixed groups of robots and fish.

Previous researches already succeeded in closing the loop of interaction between a robotic agent and fish, such as in Kopman et al. (2013), Swain et al. (2012), Landgraf et al. (2016), and Cazenille et al. (2017). However, to our knowledge, the research presented in this article is the first example of the development of a mixed group composed of fish and several robotic agents that are controlled in a closed loop according to the fish behavior and are moving independently with fish shoals. The robots can also influence the fish decisions and show signs of integration into the fish groups when observing the collective decisions of the fish only. Finally, we have compared between a non-biased and biased setup, highlighting the potential of using robotic agents inserted into animal societies to sense environmental changes through changes in animal behavior.

To summarize, the results of this paper are very promising for the field of fish–robot interaction. Despite the fact that the design of the experiments involved a constrained environment for the fish, i.e., a circular corridor, in order to obtain a clear collective response, these results can be extended in further studies in more complex environments, involving societies composed of more agents, in order to study in more detail how information propagates between the agents such as shown in Jiang et al. (2017), how the robots can accurately modulate the behaviors of the fish, and, possibly, how the robots can automatically adapt to these behaviors.