6 min read
Jan 28, 2026
--
Press enter or click to view image in full size
Many of us have pet fish or know someone who does. Fish are bright, colorful, and fascinating creatures. Beyond their calming presence as they swim freely, certain species — particularly zebrafish — serve as important model organisms in biological research. Have you ever wondered what a fish kept in a beautifully decorated aquarium might be feeling? Understanding how the organism behaves under different conditions is a fundamental aspect of zebrafish research. Till now, this has been done manually: researchers would sit and watch hours of behavioural footage, noting patterns by hand. However, with the advancement of technologies like Artificial Intelligence, this process is undergoing a transformation. In this blog, we’ll explore how deep learning is automating behavioural analysis, making it faster, more accurate, and especially useful in studying anxiety in zebrafish.
The Setup: Why Zebrafish and Novel Tank Diving?
In recent years, particularly in neurodevelopment research, zebrafish (Danio rerio) have emerged as a model organism to study stress, anxiety, and other psychological states due to their genetic similarity to humans, external development, and well-characterized behaviours. One common method for assessing anxiety in zebrafish is the Novel Tank Diving (NTD) assay, in which fish are placed in a novel environment, and their tendency to remain near the bottom of the tank is noted as an indicator of anxiety.
Traditionally, analyzing the assay involves watching hours of video footage, timing fish movements, and classifying behaviour. This is a labour-intensive method that is prone to human error and subjective interpretation. Some tracking software is also available nowadays, but it is not specific to the assay and is very expensive, too. There was a huge gap that can be filled with a more efficient, accurate, and accessible solution, and AI might be it!
The Solution: Leveraging Deep Learning for Behavioural Tracking
Press enter or click to view image in full size
The emergence of deep learning has revolutionized many fields, especially image and video analysis, using powerful tools for classification and feature extraction. One of the tools that enables accurate, markerless tracking of animal body parts using deep neural networks is DeepLabCut. In zebrafish behavioural research, DLC plays a crucial role in capturing fine-scale movements, enabling researchers to assess social behaviour, motor functions, and stress-related responses.
DeepLabCut: Precise marker-less tracking
DLC is an advanced algorithm that estimates pose with high precision from lab animals with minimal training. Unlike conventional methods, which require physical markers on animals for identification, DLC offers marker-less pose estimation, making the process less invasive.
How it works for Zebrafish:
Press enter or click to view image in full size
A Small number of frames (~20 per 5 minutes) from high-resolution video recordings are manually labelled and used to train the deep learning model. Six anatomical landmarks of the fish, i.e., the head, two mid-dorsal points, two mid-ventral points, and the tail, are annotated. The labelled frames are then used to train the DLC network.
After training, DLC can efficiently track zebrafish movements across input videos and provide accurate positional data. Studies found that data obtained using DLC are comparable to those obtained with commercial software.
From Pose Tracking to Behavioural Insights: Quantifying Anxiety
The data obtained through DLC is then used to quantify key behavioural metrics associated with anxiety-like responses in Zebrafish. These parameters include time allocation in tank zones, locomotor activity, inactivity period, turning angles, latency (time to first entry into the top zone), and transitions between zones. These parameters reflect the subject’s adaptation, risk avoidance, and exploratory drive.
Bottom-dwelling is the primary indicator of stress in the Novel Tank Diving assay. Zebrafish, when introduced to a new environment, if anxious, tend to remain near the bottom of the tank. Time spent near the bottom of the tank is measured, and the subject is classified as anxious (>80% of time spent near the bottom) or non-anxious. Over time, as the fish habituates to the environment, an increase in movement towards the upper zone of the tank is observed, indicating a reduction in anxiety.
Automating Behavioural Diagnosis: Using AI to Quantify and Predict Zebrafish Anxiety
Press enter or click to view image in full size
After DLC annotates the behaviour based on fish movement, the dataset is used to train predictive models. Using Deep Learning and Machine Learning algorithms, behavioural patterns are automatically classified. After evaluating a diverse range of models, researchers have grouped them broadly into two categories:
Get Shrayansh’s stories in your inbox
Join Medium for free to get updates from this writer.
Remember me for faster sign in
Convolutional Neural Networks (CNNs): These models are very accurate at extracting complex hierarchical features from raw image frames. They are efficient for video-based behavioural analysis.
Traditional ML models : Algorithms such as Logistic Regression, Decision Tree, and Random Forest are trained on features derived from behavioural data, such as turning angles and time spent in different zones.
Benchmarking AI Performance: Assessing effectiveness in Behavioural Analysis
Across models, the findings validated AI's reliability as a powerful tool for interpreting behavioural data in Zebrafish.
CNNs Performance
Among the CNNs tested, researchers found that InceptionV3 emerged as the best model, achieving 97% accuracy and high F1 scores. Other models, such as DenseNet and custom CNNs, also showed strong performance.
ML models Performance
Among traditional Machine learning models, Decision Tree and Random Forest performed very well, achieving exceptional accuracy of up to 99% across both control and stressed groups. These models are effective for analyzing behavioural datasets due to their interpretability and resilience to noise.
Integrating AI into Neuroscience: Unlocking New Dimensions of Efficiency
These findings from recent research show advancement in quantifying behavioural neuroscience using AI models. In particular, deep learning and machine learning techniques offer an efficient alternative to traditional behaviour scoring methods. These models are reducing reliance on manual observation and expensive commercial software by enhancing reproducibility and efficiency.
These techniques can be extended beyond zebrafish to other model organisms as they are further developed. Moreover, as AI tools become more open source and accessible, the interdisciplinary collaborations between biologists, data scientists, and engineers will fuel a new era of innovation.
The future of neuroscience is computational, collaborative, and continuously evolving.
Tools & Resources
Official DLC Github Repository:
https://github.com/DeepLabCut/DeepLabCut
User guides & tutorials for DLC:
https://deeplabcut.github.io/DeepLabCut/docs/quick-start/single_animal_quick_guide.html
Multi-camera 3D pose estimation using 2-camera calibration:
GitHub Docs: DeepLabCut 3D
Complete DeepLabCut-based batch analysis for multi-well zebrafish videos:
GitHub: drconradlee/zfish_behavioural_pipeline
Tool for segmenting multi-well AVI videos into single-well clips:
GitHub: drconradlee/zfish_video_segmentation
References
Muralidharan, A., Swaminathan, A., and Poulose, A., 2025. Deep learning dives: Predicting anxiety in Zebrafish through novel tank assay analysis (vol 287, 114696, 2024). PHYSIOLOGY & BEHAVIOR, 289.
Vartika Srivastava, Anagha Muralidharan, Amrutha Swaminathan, Alwin Poulose, Anxiety in aquatics: Leveraging machine learning models to predict adult zebrafish behavior, Neuroscience, Volume 565, 2025, Pages 577–587
