OSCR

GrimACE: automated, multimodal cage-side assessment of pain and well-being in mice.

Code ↔ Paper

11 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 11 matches · 3 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › MGS network ↔ GrimaceModelTraining/model/grimace_full_model.py, lines 8–62 · score 0.84 · IMAGENET1K_V1, ReLU, hidden layers, vit_b_16, dropout, PyTorch
  2. [2] § Methods › MGS network ↔ GrimaceModelTraining/big_grimace_loao_bb.py, the whole file · a weak match · score 0.84 · cross entropy loss, weight decay, SGD, momentum, PyTorch, optimization
  3. [3] § Methods › MGS network ↔ GrimaceRecorder/grimace/grimace_scorer_model.py, the whole file · a weak match · score 0.74 · ReLU, hidden layers, vit_b_16, dropout, PyTorch, linear
  4. [4] § Methods › MGS network: training data preprocessing and augmentation ↔ GrimaceModelTraining/big_grimace_loao_bb.py, the whole file · a weak match · score 0.73 · bounding box, brightness, flipped, nearest, bilinearly, rotation
  5. [5] § Results › The GrimACE app and machine learning algorithm overview ↔ GrimaceModelTraining/model/grimace_full_model.py, lines 8–62 · score 0.67 · ReLU, hidden layers, vit_b_16, PyTorch, linear, head
  6. [6] § Methods › Frame-quality detection network ↔ GrimaceRecorder/grimace/frame_quality_model.py, lines 8–31 · score 0.64 · mobilenetv3_large_100, frame quality, sigmoid, PyTorch, pretrained, model
  7. [7] § Methods › MGS network ↔ GrimaceModelTraining/criterion/grimace_cross_entropy.py, lines 4–20 · score 0.59 · cross entropy loss, PyTorch, module, training
  8. [8] § Results › The GrimACE app and machine learning algorithm overview ↔ GrimaceRecorder/app/recording/recording_manager.py, lines 409–490 · score 0.55 · front video, top video, grimace scores, interval, duration, pipelines
  9. [9] § Methods › Frame selection ↔ GrimaceRecorder/app/analysis/grimace_analyzer_v1.py, lines 17–139 · score 0.54 · highest score, frame quality, threshold, min
  10. [10] § Methods › MGS network: validation data preprocessing ↔ GrimaceModelTraining/generate_loao_bb_scores.py, lines 1–62 · score 0.53 · bounding box, bilinear, padding, squared, resized, cropped
  11. [11] § Methods › Pose estimation and BehaviorFlow analysis ↔ analysis_scripts.zip/Analysis_GrimaceBoxData_AllExperiments_10Clusters.Rmd, lines 246–253 · score 0.50 · behavior flow, grimace box, clustering, transition

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 62 lines · 2.4 KB · AGPL-3.0 · 2 matches

  1. from typing import List, Tuple
  2. import timm
  3. import torch
  4. from torchvision.models import vit_b_16, ViT_B_16_Weights, vit_b_32, ViT_B_32_Weights
  5. class GrimaceFullModel(torch.nn.Module):
  6. def __init__(self, base_model_name: str, input_size: Tuple[int, int], num_channels: int = 3, hidden_layer_sizes: List[int] = None, dropouts: List[float] = None):
  7. super(GrimaceFullModel, self).__init__()
  8. if base_model_name == 'vit_b_16':
  9. self.base_model = vit_b_16(weights=ViT_B_16_Weights.IMAGENET1K_V1)
  10. self.base_model.heads = torch.nn.Identity()
  11. elif base_model_name == 'vit_b_16_swag':
  12. self.base_model = vit_b_16(weights=ViT_B_16_Weights.IMAGENET1K_SWAG_E2E_V1)
  13. self.base_model.heads = torch.nn.Identity()
  14. elif base_model_name == 'vit_b_32':
  15. self.base_model = vit_b_32(weights=ViT_B_32_Weights.IMAGENET1K_V1)
  16. else:
  17. self.base_model = timm.create_model(base_model_name, in_chans=num_channels, pretrained=True, num_classes=0, global_pool='avg')
  18. base_model_output = self.base_model(torch.zeros(1, num_channels, input_size[0], input_size[1]))
  19. num_features = base_model_output.shape[1]
  20. if hidden_layer_sizes is None:
  21. hidden_layer_sizes = [128]
  22. if dropouts is None:
  23. dropouts = [0.0] * len(hidden_layer_sizes)
  24. input_size = num_features
  25. self.hidden_layers = torch.nn.Sequential()
  26. for hidden_layer_size, dropout in zip(hidden_layer_sizes, dropouts):
  27. self.hidden_layers.append(torch.nn.Sequential(
  28. torch.nn.Dropout(dropout),
  29. torch.nn.Linear(input_size, hidden_layer_size),
  30. torch.nn.ReLU(),
  31. ))
  32. input_size = hidden_layer_size
  33. self.au_heads = torch.nn.ModuleList()
  34. if len(hidden_layer_sizes) == 0 and len(dropouts) == 1:
  35. for _ in range(5):
  36. self.au_heads.append(torch.nn.Sequential(
  37. torch.nn.Dropout(dropouts[0]),
  38. torch.nn.Linear(input_size, 4)
  39. ))
  40. else:
  41. for _ in range(5):
  42. self.au_heads.append(torch.nn.Sequential(
  43. torch.nn.Linear(input_size, 4)
  44. ))
  45. def forward(self, x):
  46. out = self.base_model(x)
  47. out = self.hidden_layers(out)
  48. out = [head(out) for head in self.au_heads]
  49. out = torch.concat(out, dim=1)
  50. return out

grimace_full_model.py at commit 765eb42, under AGPL-3.0 · at the source

Overview

Authors: Oliver Sturman1,2,3, Marcel Schmutz1,2,3, Tom Lorimer1,2,3, Runzhong Zhang1,2, Mattia Privitera1,2, Fabienne K Roessler1,2, Justine Leonardi1,2, Rebecca Waag1,2, Alina-Mariuca Marinescu1,2, Clara Bekemeier4,5, Katharina Hohlbaum6, Johannes Bohacek1,2,3
  1. Laboratory of Molecular and Behavioral Neuroscience, Institute for Neuroscience, Department of Health Sciences and Technology, ETH, Zurich, Switzerland
  2. Neuroscience Center Zurich, ETH Zurich and University of Zurich, Zurich, Switzerland
  3. ETH Zurich 3R Hub, ETH, Zurich, Switzerland
  4. Institute of Animal Welfare Animal Behavior and Laboratory Animal Science School of Veterinary Medicine Freie Universitat Berlin, Berlin, Germany
  5. Science of Intelligence, Research Cluster of Excellence, Berlin, Germany
  6. German Centre for the Protection of Laboratory Animals (Bf3R) German Federal Institute for Risk Assessment (BfR), Berlin, Germany
Institutions: University of Zurich (Switzerland); ETH Zurich (Switzerland); Institute for Neuroscience (Switzerland); Freie Universität Berlin (Germany); Federal Institute for Risk Assessment (Germany)
Journal: Lab animal, volume 55, issue 4, pages 137-146
Dates: received 10 March 2025; accepted 30 January 2026; published online 5 March 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41684-026-01695-9 · PMID 41787090 · PMCID PMC13043301 · OpenAlex W7133873415
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), pain (population)
Methods: Machine learning, Statistics
Keywords: Neuroscience, Animal behaviour, Animal physiology
MeSH: Animal Welfare*, Pain Measurement*, Postoperative Pain*, Analgesics, Opioid, Animals, Anti-Inflammatory Agents, Non-Steroidal, Buprenorphine, Male, Meloxicam, Mice, Thiazines, Thiazoles (* major topic)
Topic: Veterinary Pharmacology and Anesthesia (Small Animals, Veterinary), according to OpenAlex
Funding: Swiss National Science Foundation (310030_204372, 310030, 204372, 219119)
Citations: cited by 5 papers (Europe PMC); 61 references in the paper

Abstract

Pain and welfare monitoring is essential for ethical animal testing, but current cage-side assessments are qualitative and subjective. Here we present the GrimACE, a fully standardized and automated cage-side monitoring tool for mice, the most widely used animals in research. The GrimACE uses computer vision to provide automated mouse grimace scale (MGS) assessment together with pose estimation in a safe, dark environment. We validated the system by analyzing pain after brain surgeries (craniotomies) with head implants under two analgesia regimes. Human-expert and automated MGS scores showed very high correlation (Pearson’s r = 0.87). Both expert and automated scores revealed that a moderate increase in pain can be detected for up to 48 h after surgeries, but that both a single dose of meloxicam (5 mg/kg subcutaneuously) or three doses of buprenorphine (0.1 mg/kg) + meloxicam (5 mg/kg subcutaneuously) provide adequate and comparable pain management. Simultaneous pose estimation demonstrated that mice receiving buprenorphine + meloxicam showed increased movement 4 h after surgery, indicative of hyperactivity, a well-known side effect of opioid treatment. Significant weight loss was also detected in the buprenorphine + meloxicam treatment group compared with the meloxicam-only group. In addition, detailed BehaviorFlow analysis and automated MGS scoring of control animals suggests that habituation to GrimACE is unnecessary, and that measurements can be repeated multiple times, ensuring standardized postoperative recovery monitoring.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 11 matches between paragraphs and lines of code.

Zenodo 15119195

License: apgl-v3
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 6 files
Software Heritage: not checked
Found in: the references
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: data.table (3 files), cowplot (2 files), ggplot2 (2 files), reticulate (2 files), tidyverse (2 files)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
5 files
At the source:

ETHZ-INS/GrimACE_manuscript

License: AGPL-3.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 765eb426dcc13b383334cb77f838774725cdb500, 4 November 2025
Languages: Python (115)
Size: 188 files, 115 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, license file, environment (GrimaceModelTraining/requirements.txt, GrimaceRecorder/requirements.txt, GrimaceModelTraining/training/setup.py)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (25 files), PyTorch (25 files), OpenCV (13 files), h5py (4 files), pandas (2 files)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
117 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 118 scripts, each with its path and the digest of its content;
  • 11 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

All data, software and hardware designs are available via GitHub at https://github.com/ETHZ-INS/GrimACE_manuscript and via Zenodo at 10.5281/zenodo.15119195 (ref. 61) or upon request. Please note that the GrimACE software is compatible only with the GrimACE hardware.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 12 authors, 3 keywords, 12 MeSH terms, 1 funder, 55 references.

Cite

This paper

Sturman, O., Schmutz, M., Lorimer, T., Zhang, R., Privitera, M., Roessler, F. K., Leonardi, J., Waag, R., Marinescu, A.-M., Bekemeier, C., Hohlbaum, K., & Bohacek, J. (2026). GrimACE: automated, multimodal cage-side assessment of pain and well-being in mice. Lab animal, 55(4), 137-146. https://doi.org/10.1038/s41684-026-01695-9

BibTeX

@article{sturman2026grimace,
author = {Sturman, Oliver and Schmutz, Marcel and Lorimer, Tom and Zhang, Runzhong and Privitera, Mattia and Roessler, Fabienne K and Leonardi, Justine and Waag, Rebecca and Marinescu, Alina-Mariuca and Bekemeier, Clara and Hohlbaum, Katharina and Bohacek, Johannes},
title = {{GrimACE: automated, multimodal cage-side assessment of pain and well-being in mice}},
journal = {Lab animal},
year = {2026},
month = mar,
volume = {55},
number = {4},
pages = {137--146},
publisher = {Springer Nature},
issn = {0093-7355},
doi = {10.1038/s41684-026-01695-9},
url = {https://doi.org/10.1038/s41684-026-01695-9},
pmid = {41787090},
pmcid = {PMC13043301}
}

RIS

TY - JOUR
AU - Sturman, Oliver
AU - Schmutz, Marcel
AU - Lorimer, Tom
AU - Zhang, Runzhong
AU - Privitera, Mattia
AU - Roessler, Fabienne K
AU - Leonardi, Justine
AU - Waag, Rebecca
AU - Marinescu, Alina-Mariuca
AU - Bekemeier, Clara
AU - Hohlbaum, Katharina
AU - Bohacek, Johannes
TI - GrimACE: automated, multimodal cage-side assessment of pain and well-being in mice
T2 - Lab animal
J2 - Lab Anim (NY)
PY - 2026
DA - 2026/03/05
VL - 55
IS - 4
SP - 137
EP - 146
SN - 0093-7355
PB - Springer Nature
DO - 10.1038/s41684-026-01695-9
UR - https://doi.org/10.1038/s41684-026-01695-9
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41684-026-01695-9",
"type": "article-journal",
"title": "GrimACE: automated, multimodal cage-side assessment of pain and well-being in mice",
"container-title": "Lab animal",
"author": [
{
"family": "Sturman",
"given": "Oliver"
},
{
"family": "Schmutz",
"given": "Marcel"
},
{
"family": "Lorimer",
"given": "Tom"
},
{
"family": "Zhang",
"given": "Runzhong"
},
{
"family": "Privitera",
"given": "Mattia"
},
{
"family": "Roessler",
"given": "Fabienne K"
},
{
"family": "Leonardi",
"given": "Justine"
},
{
"family": "Waag",
"given": "Rebecca"
},
{
"family": "Marinescu",
"given": "Alina-Mariuca"
},
{
"family": "Bekemeier",
"given": "Clara"
},
{
"family": "Hohlbaum",
"given": "Katharina"
},
{
"family": "Bohacek",
"given": "Johannes"
}
],
"container-title-short": "Lab Anim (NY)",
"volume": "55",
"issue": "4",
"page": "137-146",
"DOI": "10.1038/s41684-026-01695-9",
"PMID": "41787090",
"PMCID": "PMC13043301",
"ISSN": "0093-7355",
"publisher": "Springer Nature",
"URL": "https://doi.org/10.1038/s41684-026-01695-9",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
5
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.21203/rs.3.rs-9676637/v1 [code]
A Comprehensive Benchmarking of Spatial Deconvolution and Domain Detection Methods across Diverse Tissues and Spatial Transcriptomic Technologies
Journal: Research Square (preprint)
In common: reticulate, OpenCV, cowplot, 7 other tools
[2] doi:10.1038/s41467-026-74753-y [code]
A human-specific microRNA controls the timing of excitatory synaptogenesis.
Journal: Nature communications
In common: reticulate, cowplot, data.table, 2 other tools, author Johannes Bohacek
[3] doi:10.1038/s41467-026-71803-3 [code]
Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain.
Journal: Nature communications
In common: reticulate, cowplot, h5py, 6 other tools, mouse
[4] doi:10.1038/s41593-026-02262-8 [code]
Cheese3D enables sensitive detection and analysis of whole-face movement in mice.
Journal: Nature neuroscience
In common: OpenCV, h5py, pandas, 1 other tool, mouse, 4 references
[5] doi:10.1371/journal.pcbi.1014327 [code]
Supervised deep learning with gene functional annotation for cell classification.
Journal: PLoS computational biology
In common: reticulate, cowplot, h5py, 6 other tools
[6] doi:10.1038/s44320-026-00208-7 [code]
Interpretable deep generative ensemble learning for single-cell omics with Hydra.
Journal: Molecular systems biology
In common: reticulate, cowplot, h5py, 6 other tools
[7] doi:10.1261/rna.080954.126 [code]
Neuronal subtype-specific ribosomal protein mRNA expression.
Journal: RNA (New York, N.Y.)
In common: reticulate, cowplot, h5py, 5 other tools, mouse
[8] doi:10.1038/s44318-026-00818-9 [code]
FAM134B-mediated ER-phagy degrades APP and suppresses Alzheimer's disease pathology.
Journal: The EMBO journal
In common: reticulate, cowplot, h5py, 5 other tools, mouse
[9] doi:10.1038/s41467-026-76939-w [code]
HIPPIE: a generative model for electrophysiological analysis across species, technologies, and modalities.
Journal: Nature communications
In common: reticulate, cowplot, h5py, 5 other tools, mouse
[10] doi:10.1038/s41586-026-10444-4 [code]
A brain reward circuit inhibited by next-generation weight-loss drugs in mice.
Journal: Nature
In common: OpenCV, h5py, ggplot2, 3 other tools, mouse, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.