DeepEthogram, a machine learning pipeline for supervised behavior classification from raw pixels

  1. James P Bohnslav
  2. Nivanthika K Wimalasena
  3. Kelsey J Clausing
  4. Yu Y Dai
  5. David A Yarmolinsky
  6. Tomás Cruz
  7. Adam D Kashlan
  8. M Eugenia Chiappe
  9. Lauren L Orefice
  10. Clifford J Woolf
  11. Christopher D Harvey  Is a corresponding author
  1. Harvard Medical School, United States
  2. Boston Children's Hospital, United States
  3. Massachusetts General Hospital, United States
  4. Champalimaud Center for the Unknown, Portugal

Abstract

Videos of animal behavior are used to quantify researcher-defined behaviors-of-interest to study neural function, gene mutations, and pharmacological therapies. Behaviors-of-interest are often scored manually, which is time-consuming, limited to few behaviors, and variable across researchers. We created DeepEthogram: software that uses supervised machine learning to convert raw video pixels into an ethogram, the behaviors-of-interest present in each video frame. DeepEthogram is designed to be general-purpose and applicable across species, behaviors, and video-recording hardware. It uses convolutional neural networks to compute motion, extract features from motion and images, and classify features into behaviors. Behaviors are classified with above 90% accuracy on single frames in videos of mice and flies, matching expert-level human performance. DeepEthogram accurately predicts rare behaviors, requires little training data, and generalizes across subjects. A graphical interface allows beginning-to-end analysis without end-user programming. DeepEthogram's rapid, automatic, and reproducible labeling of researcher-defined behaviors-of-interest may accelerate and enhance supervised behavior analysis.

Data availability

Code is posted publicly on Github and linked in the paper. Video datasets and human annotations are publicly available and linked in the paper.

The following previously published data sets were used

Article and author information

Author details

  1. James P Bohnslav

    Neurobiology, Harvard Medical School, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  2. Nivanthika K Wimalasena

    F.M. Kirby Neurobiology Center, Boston Children's Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  3. Kelsey J Clausing

    Molecular Biology, Massachusetts General Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  4. Yu Y Dai

    Molecular Biology, Massachusetts General Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  5. David A Yarmolinsky

    F.M. Kirby Neurobiology Center, Boston Children's Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  6. Tomás Cruz

    Champalimaud Neuroscience Programme, Champalimaud Center for the Unknown, Lisbon, Portugal
    Competing interests
    The authors declare that no competing interests exist.
  7. Adam D Kashlan

    F.M. Kirby Neurobiology Center, Boston Children's Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  8. M Eugenia Chiappe

    Champalimaud Neuroscience Porgramme, Champalimaud Center for the Unknown, Lisbon, Portugal
    Competing interests
    The authors declare that no competing interests exist.
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0003-1761-0457
  9. Lauren L Orefice

    Molecular Biology, Massachusetts General Hospital, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  10. Clifford J Woolf

    Department of Neurobiology, Harvard Medical School, Boston, United States
    Competing interests
    The authors declare that no competing interests exist.
  11. Christopher D Harvey

    Neurobiology, Harvard Medical School, Boston, United States
    For correspondence
    harvey@hms.harvard.edu
    Competing interests
    The authors declare that no competing interests exist.
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0001-9850-2268

Funding

National Institutes of Health (R01MH107620)

  • Christopher D Harvey

National Science Foundation (GRFP)

  • Nivanthika K Wimalasena

Fundacao para a Ciencia ea Tecnologia (PD/BD/105947/2014)

  • Tomás Cruz

Harvard Medical School Dean's Innovation Award

  • Christopher D Harvey

Harvard Medical School Goldenson Research Award

  • Christopher D Harvey

National Institutes of Health (DP1 MH125776)

  • Christopher D Harvey

National Institutes of Health (R01NS089521)

  • Christopher D Harvey

National Institutes of Health (R01NS108410)

  • Christopher D Harvey

National Institutes of Health (F31NS108450)

  • James P Bohnslav

National Institutes of Health (R35NS105076)

  • Clifford J Woolf

National Institutes of Health (R01AT011447)

  • Clifford J Woolf

National Institutes of Health (R00NS101057)

  • Lauren L Orefice

National Institutes of Health (K99DE028360)

  • David A Yarmolinsky

European Research Council (ERC-Stg-759782)

  • M Eugenia Chiappe

The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.

Reviewing Editor

  1. Mackenzie W Mathis, EPFL, Switzerland

Ethics

Animal experimentation: All experimental procedures were approved by the Institutional Animal Care and Use Committees at Boston Children's Hospital (protocol numbers 17-06-3494R and 19-01-3809R) or Massachusetts General Hospital (protocol number 2018N000219) and were performed in compliance with the Guide for the Care and Use of Laboratory Animals.

Version history

  1. Received: September 23, 2020
  2. Preprint posted: September 25, 2020 (view preprint)
  3. Accepted: September 1, 2021
  4. Accepted Manuscript published: September 2, 2021 (version 1)
  5. Version of Record published: September 21, 2021 (version 2)

Copyright

© 2021, Bohnslav et al.

This article is distributed under the terms of the Creative Commons Attribution License permitting unrestricted use and redistribution provided that the original author and source are credited.

Metrics

  • 11,766
    views
  • 1,141
    downloads
  • 84
    citations

Views, downloads and citations are aggregated across all versions of this paper published by eLife.

Download links

A two-part list of links to download the article, or parts of the article, in various formats.

Downloads (link to download the article as PDF)

Open citations (links to open the citations from this article in various online reference manager services)

Cite this article (links to download the citations from this article in formats compatible with various reference manager tools)

  1. James P Bohnslav
  2. Nivanthika K Wimalasena
  3. Kelsey J Clausing
  4. Yu Y Dai
  5. David A Yarmolinsky
  6. Tomás Cruz
  7. Adam D Kashlan
  8. M Eugenia Chiappe
  9. Lauren L Orefice
  10. Clifford J Woolf
  11. Christopher D Harvey
(2021)
DeepEthogram, a machine learning pipeline for supervised behavior classification from raw pixels
eLife 10:e63377.
https://doi.org/10.7554/eLife.63377

Share this article

https://doi.org/10.7554/eLife.63377

Further reading

    1. Biochemistry and Chemical Biology
    2. Neuroscience
    Maximilian Nagel, Marco Niestroj ... Marc Spehr
    Research Article

    In most mammals, conspecific chemosensory communication relies on semiochemical release within complex bodily secretions and subsequent stimulus detection by the vomeronasal organ (VNO). Urine, a rich source of ethologically relevant chemosignals, conveys detailed information about sex, social hierarchy, health, and reproductive state, which becomes accessible to a conspecific via vomeronasal sampling. So far, however, numerous aspects of social chemosignaling along the vomeronasal pathway remain unclear. Moreover, since virtually all research on vomeronasal physiology is based on secretions derived from inbred laboratory mice, it remains uncertain whether such stimuli provide a true representation of potentially more relevant cues found in the wild. Here, we combine a robust low-noise VNO activity assay with comparative molecular profiling of sex- and strain-specific mouse urine samples from two inbred laboratory strains as well as from wild mice. With comprehensive molecular portraits of these secretions, VNO activity analysis now enables us to (i) assess whether and, if so, how much sex/strain-selective ‘raw’ chemical information in urine is accessible via vomeronasal sampling; (ii) identify which chemicals exhibit sufficient discriminatory power to signal an animal’s sex, strain, or both; (iii) determine the extent to which wild mouse secretions are unique; and (iv) analyze whether vomeronasal response profiles differ between strains. We report both sex- and, in particular, strain-selective VNO representations of chemical information. Within the urinary ‘secretome’, both volatile compounds and proteins exhibit sufficient discriminative power to provide sex- and strain-specific molecular fingerprints. While total protein amount is substantially enriched in male urine, females secrete a larger variety at overall comparatively low concentrations. Surprisingly, the molecular spectrum of wild mouse urine does not dramatically exceed that of inbred strains. Finally, vomeronasal response profiles differ between C57BL/6 and BALB/c animals, with particularly disparate representations of female semiochemicals.

    1. Neuroscience
    Kenta Abe, Yuki Kambe ... Tatsuo Sato
    Research Article

    Midbrain dopamine neurons impact neural processing in the prefrontal cortex (PFC) through mesocortical projections. However, the signals conveyed by dopamine projections to the PFC remain unclear, particularly at the single-axon level. Here, we investigated dopaminergic axonal activity in the medial PFC (mPFC) during reward and aversive processing. By optimizing microprism-mediated two-photon calcium imaging of dopamine axon terminals, we found diverse activity in dopamine axons responsive to both reward and aversive stimuli. Some axons exhibited a preference for reward, while others favored aversive stimuli, and there was a strong bias for the latter at the population level. Long-term longitudinal imaging revealed that the preference was maintained in reward- and aversive-preferring axons throughout classical conditioning in which rewarding and aversive stimuli were paired with preceding auditory cues. However, as mice learned to discriminate reward or aversive cues, a cue activity preference gradually developed only in aversive-preferring axons. We inferred the trial-by-trial cue discrimination based on machine learning using anticipatory licking or facial expressions, and found that successful discrimination was accompanied by sharper selectivity for the aversive cue in aversive-preferring axons. Our findings indicate that a group of mesocortical dopamine axons encodes aversive-related signals, which are modulated by both classical conditioning across days and trial-by-trial discrimination within a day.