Skip to main content
Ctrl+K
The Annolid Book - Home The Annolid Book - Home
  • The Annolid Book

Start Here

  • Introduction
  • How Annolid Works (Technical Overview)
  • Installation Options
  • Quick Reference: Shortcuts, Files & Recipes
  • Example Code Recipes & Notebook Migration Guide
  • Troubleshooting & Frequently Asked Questions

Prepare Videos & Annotate

  • Preparing & Compressing Videos
  • Downsample and crop videos
  • Extracting Frames (Optional Workflow)
  • Labeling Instances, Keypoints & Zones
  • AI-Assisted Labeling: Point & Text Prompts
  • GUI Power Tips: Merging Shapes, Reordering Lists & Class Maps

Tracking, Segmentation & Pose

  • Featured Walkthrough: Resident-Intruder Social Assay (mouse083)
  • Tracking From One Frame with Cutie
  • Long-Video Tracking & Correction with SAM3
  • Segment-Based Batch Tracking & Long-Video Scale-Up
  • Hierarchical Instance Body-Part Segmentation
  • DINOv3 Keypoint Tracking
  • Point Tracking with TAPNext (ONNX) & CoWTracker
  • INSID3 Video Segmentation
  • Pose Estimation & DeepLabCut / SLEAP Interoperability
  • Video Depth Anything (Per-Frame Depth Estimation)

Behavior, Zones & Analysis

  • Spatial Zones & Place Preference
  • Behavior Scoring, Timelines & Ethograms
  • Polygon-Feature TCN Behavior Classification
  • Freezing & Dense Motion Assays
  • Inter-Instance Distances & Kinematics
  • Semantic Frame Search & Automated Identity Repair
  • Track QC, Statistics & HTML5 Reports

Train Models & Scale Up

  • Model Training & Pose Interoperability
  • Combining Models & Multi-Tool Pipelines
  • Data Formats & COCO / YOLO / NDJSON Cookbook
  • Running Annolid on Google Colab
  • Batch downsampling with sequential video review
  • Real-Time Wireless & Multi-Camera Live Detection

Microscopy & 3D Digital Twins

  • Large TIFF, Atlas Overlays & Brain 3D Reconstruction
  • 3D Digital Animal Twins & Sim-to-Real Studio

Automation, CLI & Annolid Bot

  • Annolid Bot & Guided Track Review
  • Integrations: MCP, Memory, Cloud Storage & Security
  • Power-User CLI (annolid & annolid-run)

Interactive Jupyter Notebooks

  • Extract Frames from a Video
  • Post-Processing: Inter-Instance Distances & Kinematics
  • Post-Processing: Fix Left/Right Label Switches & Gaps
  • Post-Processing: Mask Areas, Perimeters, IoU Merging & Batch Folders
  • Post-Processing: Digging Bout & ROI Overlap Analysis

Resources & Community

  • Behavioral Paradigm Model Zoo & Pretrained Models
  • Annolid on YouTube
  • Annolid Docs Portal
  • Community & Support
  • How to Cite Annolid
  • Publications & Posters Using Annolid
  • Contributing to Annolid
  • License
  • Repository
  • Suggest edit
  • Open issue
  • .md

Featured Walkthrough: Resident-Intruder Social Assay (mouse083)

Contents

  • Animated Multi-Animal Tracking & Behavior Preview
  • 1. Transparent Project Files on Disk
  • 2. Labeling & Review Inside the Desktop GUI
  • 3. Tracking Through Close Contact & Catching Occlusions With Track QC
  • 4. Ethogram Timeline, Social Proximity & Arena Trajectories
  • 5. Spatial Zone & Place-Preference Scoring
  • 6. One-Command Unified HTML5 + Inline SVG Report
  • 7. Pair Real Recordings With 3D Digital Twins

Featured Walkthrough: Resident-Intruder Social Assay (mouse083)#

This end-to-end walkthrough follows one real two-mouse home-cage recording (mouse083_task1_annotator1.mp4: 1024 × 570, 30 FPS, 4,881 frames, 162.7 s) from first GUI click to a publication-ready HTML5 + SVG report.

4,881 frames 162.7 s @ 30 FPS (1024 × 570)
2 masks + 14 keypoints resident & intruder · 7 landmarks each
39.1 s / 19.9 s investigation (25 bouts) · mount (7 bouts)
5-frame QC alert intruder occlusion flagged at 3361–3366
Open Live Interactive HTML5/SVG Report → Track QC & Reporting Guide Matching 3D Digital Twin

Animated Multi-Animal Tracking & Behavior Preview#

Animated resident-intruder tracking demo showing cyan resident and orange intruder polygons, 14 keypoints, trails, and live behavior banner

Fig. 15 Tethered black resident (resident, cyan contour + 7 keypoints) interacting with a white intruder (intruder, amber contour + 7 keypoints) on textured aspen bedding near a right-wall feeder port.#

1. Transparent Project Files on Disk#

Every stage stays human-readable and versionable in plain JSON and CSV files:

mouse083_task1_annotator1.mp4                  # Source 30 FPS video (1024 × 570, 4,881 frames)
mouse083_task1_annotator1/
  project.annolid.json                         # Shared ethogram schema (other, investigation, mount)
  mouse083_task1_annotator1_000000000.json     # Per-frame LabelMe JSON (2 polygons + 14 keypoints + flags)
  ...
  mouse083_task1_annotator1_000004880.json
mouse083_task1_annotator1_tracking.csv         # 78,091 rows: RLE masks, boxes, centroids for all 16 shapes
mouse083_task1_annotator1_tracked.csv          # 9,757 rows: per-animal centroids, motion index, timestamps

Each annotated frame contains:

  • 2 whole-animal polygons: resident and intruder

  • 14 anatomical keypoints (7 per mouse, linked by group_id): nose, left_ear, right_ear, neck, left_hip, right_hip, tail_base

  • Frame-level ethogram flags: other, investigation, or mount

2. Labeling & Review Inside the Desktop GUI#

Annolid desktop GUI open on mouse083_task1_annotator1 with polygons, keypoints, investigation overlay pill, Flags dock, and Label Instances dock

Fig. 16 The Annolid desktop workspace synchronizes polygons, keypoints, viewport-pinned behavior badges (• investigation), Flags, Label Instances, Video List, and Behavior Controls.#

To run this workflow on your own recording:

  1. Open your video directly (File → Open Video) — no frame extraction required.

  2. Seed Frame 0000 with whole-body polygons (Create AI-Polygon) and anatomical keypoints.

  3. Track polygons forward with Cutie, SAM3, or YOLO, and track keypoints with DINOv3 Keypoint Tracking.

  4. Score behaviors (investigation, mount, other) via Flags, the Timeline needle, or Annolid Bot 1-second segment labeling.

3. Tracking Through Close Contact & Catching Occlusions With Track QC#

Real social trials alternate between clear separation and heavy overlap where one mouse temporarily hides the other.

Four-panel storyboard of mouse083 showing Seed Frame, Social Investigation, Mounting Bout, and Track QC Occlusion Alert

Fig. 17 Four key moments across the trial: (A) clean seed frame (494 px separation), (B) nose-to-body investigation (143 px), (C) high-overlap mount (114 px), and (D) a 5-frame occlusion dropout automatically caught by Track QC at frames 3361–3366.#

Run automated Track QC to rank the highest-risk frames for targeted human review instead of guessing where errors occurred:

annolid-run track-qc mouse083_task1_annotator1_tracked.csv \
  --expected-instances 2 \
  --fps 30 \
  --review-csv mouse083_review_queue.csv \
  --out mouse083_track_qc.json

Double-clicking row #1 in Analysis → Analysis & Reporting Studio… → Track QC & Gaps jumps your canvas straight to frame 3361 so you can repair one anchor frame and re-propagate cleanly.

4. Ethogram Timeline, Social Proximity & Arena Trajectories#

Ethogram timeline raster, inter-animal centroid proximity curve, thigmotaxis trajectories, and behavior time budget for mouse083

Fig. 18 Scored ethogram bouts align tightly with sharp drops in inter-animal distance (< 100 px close-contact threshold), while full-session trajectories reveal clear wall-following thigmotaxis.#

Metric

resident

intruder

Observed Frames (Coverage)

4,881 / 4,881 (100.0%)

4,876 / 4,881 (99.9%)

Path Distance

27,173.4 px

20,957.8 px

Mean Speed

167.06 px/s

128.78 px/s

Freezing % (Bouts)

3.5% (7 bouts)

4.0% (9 bouts)

Inter-Animal Distance

Mean 280.5 px · Min 15.7 px

Close contact (< 100 px): 5.7%

Behavior time budget across the 162.7 s recording:

Behavior

Bouts

Total Duration

Mean Bout

Median Bout

% of Session

other

24

103.70 s

4.32 s

3.65 s

63.7%

investigation

25

39.07 s

1.56 s

0.63 s

24.0%

mount

7

19.90 s

2.84 s

2.57 s

12.2%

5. Spatial Zone & Place-Preference Scoring#

Define reusable arena zones once in Video Tools → Zones (mouse083_zones.json) and score occupancy and entries in one command:

annolid-run zone-analysis mouse083_task1_annotator1_tracked.csv \
  --zone-file mouse083_zones.json \
  --fps 30 \
  --mode zone_metrics \
  --output-dir ./mouse083_zone_out
Three home-cage zones overlaid on mouse083 alongside bar chart of occupancy durations and entry counts

Fig. 19 Spatial zone polygons (left_nest_zone, center_arena, right_port_zone) overlaid with tracked centroids and computed occupancy durations and entry counts.#

Both animals spend over 78% of the trial in the two end zones (left_nest_zone and right_port_zone) and transit quickly across center_arena (1.10–1.59 s mean visit).

6. One-Command Unified HTML5 + Inline SVG Report#

Combine Track QC, kinematics, spatial zones, body-part contact ethograms, and behavior time budgets into one shareable, offline HTML5 report:

annolid-run report mouse083_task1_annotator1_tracked.csv \
  --events-csv mouse083_events.csv \
  --zone-file mouse083_zones.json \
  --schema mouse083_task1_annotator1/project.annolid.json \
  --fps 30 \
  --title "mouse083_task1_annotator1 — Resident-Intruder Social Assay" \
  --output-dir ./mouse083_report
Preview of the self-contained HTML5 and inline SVG report generated by annolid-run report

Fig. 20 Preview of the generated self-contained HTML5/SVG report (open the live interactive report).#

7. Pair Real Recordings With 3D Digital Twins#

Want synthetic ground-truth pose, body-part masks, or controlled occlusion tests modeled on the same black C57BL/6 + white BALB/c paradigm? Continue to 3D Digital Animal Twins & Sim-to-Real Studio.

previous

GUI Power Tips: Merging Shapes, Reordering Lists & Class Maps

next

Tracking From One Frame with Cutie

Contents
  • Animated Multi-Animal Tracking & Behavior Preview
  • 1. Transparent Project Files on Disk
  • 2. Labeling & Review Inside the Desktop GUI
  • 3. Tracking Through Close Contact & Catching Occlusions With Track QC
  • 4. Ethogram Timeline, Social Proximity & Arena Trajectories
  • 5. Spatial Zone & Place-Preference Scoring
  • 6. One-Command Unified HTML5 + Inline SVG Report
  • 7. Pair Real Recordings With 3D Digital Twins

By Chen Yang, Jeremy Forest, Matthew Einhorn, Thomas Cleland

© Copyright 2020–2026 Computational Physiology Laboratory · Annolid Contributors.

Looking for the full reference portal? Visit Annolid Docs Portal or annolid.com.