Rapid, open-source, and automated quantification of the head twitch response in C57BL/6J mice using DeepLabCut and Simple Behavioral Analysis
Alexander D. Maitland, Nicholas R. GonzaleziD, Donna M. WaltheriD, Francisco Lucas F. PereiraiD, Michael H. BaumanniD, Grant C. GlatfelteriD
Abstract
Serotonergic psychedelics induce the head twitch response (HTR) in mice, an index of serotonin (5-HT) 2A receptor (5-HT2A) agonism and a behavioral proxy for psychedelic effects in humans. Existing methods for detecting HTRs include time-consuming visual scoring, magnetometer-based approaches, and analysis of videos using semi-automated commercial software. Here, we present a new automated approach for quantifying HTRs from experimental videos using the open-source machine learning-based toolkits, DeepLabCut (DLC) and Simple Behavioral Analysis (SimBA). Pose estimation DLC models were trained to predict X,Y coordinates of 13 body parts of C57BL/6J mice using historical experimental videos of HTRs induced by various psychedelic drugs. Next, a non-overlapping set of historical experimental videos was analyzed and used to train SimBA random forest behavioral classifiers to predict the presence of the HTR. The DLC+SimBA approach was then validated using a separate subset of visually scored videos. DLC+SimBA model performance was assessed at different video resolutions (50%, 25%, 12.5%) and frame rates (120, 60, 30 frames per second or fps). Our results indicate that HTRs can be quantified accurately at 50% resolution and 120 fps (precision = 95.45, recall = 95.56, F1 = 95.51) or at lower frame rates and resolutions (i.e., 50% resolution and 60 fps). The best performing DLC+SimBA model combination was deployed to evaluate the effects of bufotenine, a tryptamine derivative with uncharacterized potency and efficacy in the HTR paradigm. Interestingly, bufotenine only induced elevated HTRs (ED50 = 0.99 mg/kg, max counts = 24) when serotonin 1A receptors (5-HT1A) were pharmacologically blocked and activity at other sites of action may also impact its pharmacological effects (e.g., serotonin transporter). HTR counts for a subset of 21 videos from bufotenine experiments were strongly correlated for DLC+SimBA vs. visual scoring and semi-automated software detection methods (r = 0.98 and 0.99). Finally, the DLC+SimBA approach displayed high accuracy when compared to visual scoring of HTRs for three serotonergic psychedelic drugs with variable HTR frequencies (r = 0.99 vs. mean visual scores from 3 blinded raters). In summary, the DLC+SimBA approach represents a modular, noninvasive, and open-source method of HTR detection from experimental videos with accuracy comparable to magnetometer-based approaches and greater speed than visual scoring.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 5
- FWCI
- 5.91
- Field percentile
- top 4%
- Organism
- Assay
- Research Focus
- Approach
In-depth summary
Claude Sonnet 4.6 · xhigh effort · 8 Nov 2026 · from the full text of version 2 (16 Jul 2025) · CC0 1.0
Open-source DeepLabCut pose tracking plus SimBA random forest classifiers detect mouse head twitches from video at F1 95.51 (50% resolution, 120 fps), rivaling magnetometer methods.
Visual HTR scoring is slow and varies between raters, magnetometer methods need magnets implanted or clipped on the animal, and commercial video software is semi-automated and can be costly. This work offers a non-invasive, automated, open-source video pipeline, tested across several resolutions and frame rates.
Key results
ShownHTR detection accuracy depended on frame rate and resolution. The best combination was 50% resolution at 120 fps with a 0.25 discrimination threshold, on 38 hold-out videos.
F1 range 95.51 to 83.40 at 120 fps, 88.55 to 63.72 at 60 fps, 25.92 to 58.91 at 30 fps (58.91 - 25.92). Best model: precision 95.45, recall 95.56. 879 visually scored HTR events. 50% at 60 fps (F1 88.55) beat 12.5% at 120 fps (F1 83.40). · 2.2 HTR behavioral classifier evaluation; Abstract
ShownDLC+SimBA counts agreed closely with visual and commercial-software counts on bufotenine videos. They also tracked mean rater scores for psilocybin, DOI and LSD videos.
21 bufotenine videos: 331 DLC+SimBA vs 326 visual vs 284 commercial (TopScan). Correlations r = 0.98 and 0.99 vs visual and commercial. 12 videos vs mean of 3 raters: r = 0.99. Mean counts: DOI 120, LSD 52, psilocybin 34, vehicle 9. · 2.6 Comparing DLC+SimBA vs. visual and…; Abstract
ShownOn control videos with grooming and hyperlocomotion, the 0.25 threshold gave many false positives. Raising the threshold to 60% restored precision and recall to levels like the validation set.
28 videos (12 SKF38393 grooming, 16 d-amphetamine), 124 HTR events. At 0.25: precision 50.41, recall 100. At 60%: precision 93.65, recall 95.16, F1 94.4, with 8 false positives. · 2.4 Behavioral control experiments using…
ShownWith the DLC+SimBA counter, bufotenine was essentially inactive for HTR alone. Blocking 5-HT1A with WAY100635 revealed a modest HTR dose-response curve. Bufotenine was also a potent SERT releaser in rat synaptosomes.
With WAY100635: ED50 = 0.99 mg/kg, Emax = 24 counts, vs psilocin ED50 0.11 to 0.17 mg/kg (Emax ~23) and DMT ED50 1.54 mg/kg (Emax ~76). SERT release EC50 = 97 nM (MDMA 81 nM). n = 5 – 7 mice per data point. · 2.5 Psychedelic-like effects of bufotenine using…; Figure legends
ShownTraining needs mostly automated compute with little manual labeling. Processing 47 videos from one bufotenine experiment still took about 30 hours, mainly because of DLC inference.
DLC 50% model training (3 repeats) about 2,848.91 min (47.40 h); manual labeling of 600 frames about 206.64 min (3.44 h); SimBA training 105.91 min. 47 videos took 1,814.89 min, of which DLC inference took 1405.70 min. · 2.1 Mouse pose estimation model; 2.2 HTR behavioral classifier evaluation; 2.5 Psychedelic-like effects of bufotenine using…
Methods, data and reproducibility
DeepLabCut (ResNet-50) tracked 13 mouse body parts in videos downscaled to three resolutions and three frame rates. SimBA random forest classifiers (9 combinations) predicted HTR per frame, scored by precision, recall and F1 against visual annotation.
- Historical HTR videos used to train DLC pose models (600 labeled frames, 16 animals) · Mouse (C57BL/6J) · n = 30 videos
- Videos used to train SimBA HTR classifiers, containing annotated HTR events · Mouse (C57BL/6J) · n = 10 videos; 136 HTR events
- Hold-out validation videos across psychedelic drugs, doses and lighting · Mouse (C57BL/6J) · n = 38 videos; 879 HTR events
- Behavioral control videos: SKF38393 grooming and d-amphetamine hyperlocomotion · Mouse (C57BL/6J) · n = 28 videos (12 + 16); 124 HTR events
- Bufotenine dose-response experiments, with and without WAY100635 pretreatment · Mouse (C57BL/6J) · n = 5 – 7 mice per data point
- Bufotenine videos scored by DLC+SimBA, visual raters and TopScan · Mouse (C57BL/6J) · n = 21 videos
- Psilocybin, DOI and LSD validation experiments; a subset was visually scored by 3 raters · Mouse (C57BL/6J) · n = 5 – 6 mice per data point; 12 videos scored
- Monoamine transporter release assays on brain synaptosomes · Rat (Sprague-Dawley)
- Methods & tools
- DeepLabCut 2.3.10, SimBA 2.2.4, FFmpeg, ResNet-50, Random forest (2000 estimators), SHAP, Mean decrease in impurity (gini importance), TopScan (Clever Sys), Pearson correlation, ANOVA with Dunnett post hoc
- Reagents & environment
- DeepLabCut 2.3.10 (also given as version 2.3), SimBA 2.2.4, FFmpeg for downscaling; Windows 11 Pro. SimBA default hyperparameters listed.
- Assay conditions & compute
- Dell Precision T5820, Intel Xeon W-2223 3.6GHz, 32 GB RAM, NVIDIA RTX A100 GPU (as written). DLC 50% model training about 47.40 h.
- Reproducibility gaps
- No code, trained-model or video repository URL is given. SHAP value correlations are available only on reasonable request.
Limitations (5)
- Pipeline analysis takes hours, mostly DLC inference, whereas magnetometers give near-real-time data. It cannot yet resolve HTR subtypes or head-movement dynamics. · stated by the authors
- At the 0.25 threshold the control videos gave many false positives (precision 50.41), so a higher threshold was needed. Some remaining errors came from head turns during darting or rapid rearing. · stated by the authors
- Training-set construction was not tested, and the authors note that more training videos with HTR events may improve F1. They advise using 60 to 120 fps video at 25 to 50% resolution. · stated by the authors
- The best discrimination threshold was chosen on the same 38-video set used to report F1. The data come from one mouse strain, one lab and one camera setup, with no external-site validation. · noted in this summary
- Bufotenine HTR counts were low (max <20 per 30 min session) with 5 – 7 mice per data point. The SERT-release explanation for weak HTR is inferred, not tested directly in vivo. · noted in this summary
Who should read:Read this if you run mouse head-twitch assays and want an open-source, video-based HTR counter benchmarked against visual, commercial and magnetometer methods.
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Role of 5-HT2A, 5-HT2C, 5-HT1A and TAAR1 receptors in the head twitch response induced by 5-hydroxytryptophan and psilocybin: Translational implications.
Orr Shahar, Alexander Botvinnik, … Tzuri Lifschytz·International Journal of Molecular SciencesPeer-reviewed·Nov 16, 2022
- Activity of prefrontal cortex serotonin 2A receptor expressing neurons is necessary for the head-twitch response of mice to psychedelic drug DOI in a sex-dependent manner
Annika B. Ozols, Jing Wei, … Amelia L. Gallitano·bioRxiv·May 21, 2024
- Multidimensional characterization of the physiological and behavioral effects of TCB-2 in mice
Mizuki Yamamoto, Hiroto Inoue, … Koji Toda·bioRxiv·Aug 6, 2026
- Serotonin2A receptors in the medial prefrontal cortex do not drive DOI-induced head-twitch responses in rodents
Ratna Mahathi Vuruputuri, Vaishnavi Reghunath, … Vidita A. Vaidya·bioRxiv·Oct 11, 2026
- A suite of engineered mice for interrogating psychedelic drug actions
Yi-Ting Chiu, Ariel Y. Deutch, … Bryan L. Roth·Nature NeurosciencePeer-reviewed·Aug 6, 2026
- Deep learning based behavioral analysis enables high precision rodent tracking and is capable of outperforming commercial solutions
O. Sturman, L. M. von Ziegler, … J. Bohacek·bioRxiv·Jan 21, 2020