Duration: 5 Days
Prerequisites: Entry-level knowledge of Python syntax is desirable, but not mandatory.
This practical course provides an introduction to modern approaches in computational ethology. We will cover the main methodological approaches to the quantitative analysis of animal behavior (flies, fish, rodents, and humans) through the discussion of key publications. Students will gain practical skills in using Python to perform basic analyses of diverse behavioral data, including methods from computer vision, kinematic feature extraction, behavioral segmentation, and unsupervised classification.
To avoid local installation issues and GPU bottlenecks, all coding sessions will be run using Google Colab. We will use Google Drive to store and access large datasets (like tracking output and videos).
Before starting the coding sessions:
- Log into your Google account.
- Click the shared Google Drive link provided by the instructor.
- Right-click the shared
Behavioral_Course_Datafolder and select "Add shortcut to Drive". - In the first cell of every Colab notebook, run the following code to connect your Drive:
from google.colab import drive drive.mount('/content/drive')
Focus: Transitioning from manual observation to automated machine vision, and setting up our computational environment.
- Morning: Theory & Concepts
- Introduction to Computational Ethology: From stopwatches to machine vision. The "observability problem" (behavior is latent, we only observe kinematics).
- Hierarchical Organization: Defining behavior across scales (movemes → actions → activities).
- Space: Understanding Egocentric vs. Allocentric reference frames.
- 📝 Slides: TBA
- Afternoon: Python Warm-Up (Hands-on)
Focus: Extracting pose data from raw video using modern deep learning tools.
- Morning: DeepLabCut (DLC) Theory & Demo
- Markerless Tracking: Introduction to DeepLabCut, transfer learning, and ResNet backbones.
- Workflow: Creating a project, extracting frames, and labeling strategies.
- Live Demo: Instructor walk-through of evaluating a pre-trained model.
- 📝 Slides: TBA
- Afternoon: Working with Tracking Data (Mini-Project)
- Data Import: Loading pre-analyzed DLC output data (CSV/HDF5).
- Quality Control: Handling low-confidence points (likelihood scores), interpolating missing data, and applying smoothing (e.g., rolling averages).
- Feature Extraction: Calculating distances between body parts (e.g., nose-to-tail base) and angular velocity.
- 💻 Code: TBA
- debug: git config --global --add safe.directory /storage/share/git/ria-store/alias/tutorial-deeplabcut
Focus: Analyzing spatial trajectories and finding change-points in continuous movement.
- Morning: Spatial Trajectories & Autocorrelation
- Path Characteristics: Measuring path tortuosity (straightness index, sinuosity).
- The Autocorrelation Problem: Dealing with high-frequency tracking data and continuous-time movement modeling.
- Path Segmentation: Methods for detecting behavioral changes in movement patterns.
- 📝 Slides: TBA
- Afternoon: Change-Point Detection (Hands-on)
- Library Setup: Introduction to the
rupturesPython library. - Coding Task: Feeding the cleaned speed and turning-angle data from Day 2 into the PELT algorithm to segment the trajectory into distinct movement bouts.
- 💻 Code: TBA
- Library Setup: Introduction to the
Focus: Finding hidden behavioral states. The whole day will cover two-three mini project covering differnet methods and species.
- Project 1: Mice behavior interpretation based on the body markers.
- Project 2: C. elegans (Markovian dynamics on body curvature)
- Project 3: Moseq application (TBD)
- 📝 Slides: TBD
- 💻 Code: TBD
Focus: Connecting lower-level behavioral motifs to high-level cognitive goals.
- Morning: High-Level Strategies & Grammar
- Navigation Strategies: The Morris Water Maze as a case study for spatial cognitive strategies (thigmotaxis, scanning, directed search).
- Behavioral Grammar: How sub-second "syllables" transition into complex sequences using Hidden Markov Models (HMMs).
- 📝 Slides: TBA
- Afternoon: Capstone Integration
- Choose an integration project based on your comfort level:
- Transition Matrices: Use the
hmmlearnlibrary to build a transition matrix of the clusters found on Day 4. - Strategy Classification: Write a rule-based algorithm to classify a trajectory into Morris Water Maze strategies.
- Own Data: Apply the basic kinematics and segmentation pipeline to your own lab's data.
- Transition Matrices: Use the
- 💻 Code: TBD
- Choose an integration project based on your comfort level:
Papers are categorized by how we will use them in the workshop:
- 🔴 Red (Hands-on / Applied): Essential methodology applied directly in our coding tutorials.
- 🟠 Orange (Core Discussion): Theoretical foundations for our morning lectures.
- 🟢 Green (Optional): Supplemental material for further reading.
Day 1
Day 2
- 🔴 Mathis 2018 - DeepLabCut: markerless pose estimation
- 🔴 Nath 2019 - Using DeepLabCut for 3D markerless pose estimation across species and behaviors: more practical guidance for using DLC
- 🟠 Mathis 2020 - Deep learning tools for measurement of behavior
Day 3
- 🔴 Edelhoff 2016 - Path segmentation for beginners
- 🟠 Benhamou 2004 - How to reliably estimate the tortuosity
Day 4
- 🔴 Costa 2024 - A Markovian dynamics for C. elegans
- 🔴 Weinreb 2024 - Keypoint-MoSeq
- 🟠 Berman 2016 - Predictability and hierarchy in Drosophila
- 🟠 Findley 2021 - Sniff-synchronized, gradient-guided olfactory search
- 🟢 Wiltschko 2015 - Mapping Sub-Second Structure in Mouse Behavior
Day 5
Created for the Python for Animal Behavioral Analysis Workshop.