August 7th, 2026
Multi-chamber social preference tasks have been adapted from rodents to zebrafish, facilitating the study of social behavior in model organisms. This protocol validates a low-cost 3-chamber open-tank task using webcams and open-source software to measure zebrafish social preference, making it accessible to undergraduate research and teaching.
This protocol validates a low cost and open source 3-chamber open tank free swim task investigating social preference in zebrafish. This protocol can be used with various species and allows undergraduate researchers to investigate social preference with minimal resources. To begin, prepare the open tank apparatus with a central experimental chamber and two flanking stimulus chambers.
Install the backlighting system. Opaque dividers and polarizing filters to optimize visual isolation and video contrast. Mount and align the cameras in front of the chambers using the camera support frame.
Draw the blackout curtains and maintain stable holding conditions before initiating the experiment. Download the Open Broadcaster Software and install it on a Windows operated local computer. After launching the software, run the auto configuration wizard to optimize the settings for the specific recording needs, hardware resources, and network conditions.
Verify the basic settings before camera configuration. Set the base canvas resolution to match the display resolution and set the appropriate output scaled resolution. Then, create a scene by right clicking in the scenes box and selecting Add Scene.
Assign a name to the scene and use it to define the stream layout. Add a new source and select Video Capture Device to add a webcam. Assign each camera a distinct name, such as Camera Center, and repeat the process for the additional camera.
Position and resize the sources in the preview window. Ensure that the camera is listed in the sources list. Bring the camera view to the center of the canvas by pressing control plus D.Apply fit to screen by pressing control plus F, or stretch the screen by pressing control plus S.Crop the source by holding the alt key, while dragging the bounding box.
Next, double click on the selected camera and click on Configure Video. Adjust the video's brightness and contrast in the property's menu. Fill all three chambers with water from the housing tanks and adjust the water temperature before introducing the fish.
Ensure that the opaque barriers between the chambers are in place throughout the acclimation period. Transfer one adult Danio rerio to the central chamber and allow it to acclimate for at least one hour. Place the artificial social stimuli in the flanking left stimulus chamber.
Then, transfer a small shoal of four fish, consisting of two males and two females of similar size, age, and familiarity to the right stimulus chamber. During acclimation, supply all chambers containing live animals with a submersible heater set at 26 degrees Celsius, a bubbler stone connected to the aquarium air pump, and a tank lid to maintain stable holding conditions. Remove the heaters and bubbler stones before initiating the experimental session.
Start the single camera on the center tank. Launch the software and resize the central camera view to fill the screen by clicking and dragging the video corners. Then, select Start Recording under controls.
Immediately remove the opaque barriers. After 10 minutes, end the session by selecting Stop Recording under controls. Access the recorded sessions by selecting File in the top left menu, and choosing Show Recordings from the dropdown menu.
Load four to five videos into a motion analysis software application, such as DeepLabCut, and extract 20 to 30 frames from each video. Define at least three primary tracking points, such as the head, tail, and trunk. Train the network to track these points across the frames.
Use a ResNet-101 based neural network to train the model. Determine the number of iterations required to complete training. Next, deploy the fully trained DeepLabCut model on the remaining experimental videos, and extract positional data for each trial following the user guide.
Then, use a coding software such as Python to define and analyze movement across the three vertical arena zones of equal width to quantify preference. Measure the time in each zone using at least two body points within the identified zone to reduce tracking noise. Calculate the total time in each zone by dividing the total frames in the zone by the total frame count.
Use the same coding software to define and measure the time spent motionless, such as freezing. Define the movement threshold at 2 to 5 pixels per frame with a minimum consecutive frame count of 15 frames. Finally, compile and export the measurements for statistical analysis and visualization.
Subjects spent significantly more session time in the right zone closest to the live shoal, than in the middle zone or the left zone closest to the artificial mobile stimulus. The difference in time spent between the middle zone and the left zone was not statistically significant. Subjects spent significantly less session time motionless in the middle zone than in the right zone closest to the live shoal or the left zone closest to the mobile.
This protocol can be used by researchers to investigate a zebrafish's tendency to visually engage with two different social stimuli and determine which stimulus is preferred. Researchers can use different species or stimulus configurations, as well as investigate other responses, such as darting or erratic swimming. The system offers a platform to study translational models for social functionability and could explore pharmacological and environmental manipulations.
View the full transcript and gain access to thousands of scientific videos
This article presents a protocol for assessing social behavior in zebrafish using the 3-chamber open-tank free-swim task (OTFST). The method utilizes a cost-effective setup with USB webcams and common materials, combined with DeepLabCut for markerless pose estimation and behavioral tracking. The approach is validated through pilot sessions and is designed to be accessible for both research and teaching laboratories.
Quantitative assessment of social behavior in zebrafish is increasingly relevant for neurobehavioral target validation and early-stage CNS drug discovery. The 3-chamber open-tank free-swim task (OTFST) with markerless video tracking enables scalable, reproducible behavioral phenotyping, supporting predictive confidence in translational models. This accessible, low-cost platform facilitates robust pipeline integration for teams prioritizing mechanistic de-risking and cross-study comparability.
The OTFST with DeepLabCut tracking fits within the early discovery to lead identification continuum, supporting hypothesis testing and quantitative behavioral analysis in zebrafish models.