Research
RodEpil: A Video Dataset of Laboratory Rodents for Seizure Detection and Benchmark Evaluation
Overview Research area: Computer vision applied to preclinical neuroscience — specifically video-based behavioral classification of laboratory rodents for convulsive seizure detection. Technical level

- arXiv
- 2511.10431
- Published
- 2025-11-13
- Authors
- Daniele Perlo, Vladimir Despotovic, Selma Boudissa, Sang-Yoon Kim, Petr V. Nazarov, Yanrong Zhang, Max Wintermark, Olivier Keunen
AI summary
Overview
- Research area: Computer vision applied to preclinical neuroscience — specifically video-based behavioral classification of laboratory rodents for convulsive seizure detection.
- Technical level: Intermediate. Readers should be comfortable with video classification architectures, transfer learning, and cross-validation, though the paper explains its pipeline in accessible terms.
- Scope: The paper releases a labeled rodent video dataset (10,101 normal-activity clips and 2,952 seizure clips from 19 subjects) along with a TimeSformer baseline trained and evaluated under strict subject-wise five-fold cross-validation.
What This Paper Is About
Preclinical epilepsy research typically relies on EEG monitoring and manual review of long video recordings, both of which are labor-intensive and, in the case of EEG, invasive. The authors address this by curating a labeled dataset of short rodent video clips and asking whether a purely visual, transformer-based classifier can distinguish convulsive seizures from normal activity. Their goal is to provide both a reproducible benchmark and evidence that video alone carries enough information for this task when evaluated honestly across unseen animals.
Key Contributions
- A curated, labeled dataset (RodEpil) with a detailed description of its structure, acquisition setup, and annotation protocol — 19 subjects, 10,101 negative clips, 2,952 positive clips, 10-second clips at 30 FPS, released under DOI 10.5281/zenodo.17601357.
- A reproducible evaluation framework using subject-wise five-fold cross-validation, where each animal is assigned to exactly one fold so no subject appears in both training and test sets, preventing leakage from subject-specific motion or appearance patterns.
- Comprehensive TimeSformer baseline experiments including full preprocessing and training recipes, comparing input modalities (RGB, Absolute Differences, Optical Flow), pretraining regimes, image resolutions, and frame counts.
- Public release of the dataset and baseline code to enable transparent comparison and standardized benchmarking of future automated behavioral phenotyping work.
Main Findings
- Strong baseline performance: The best configuration — TimeSformer pretrained on Kinetics-400/600 and fine-tuned on 16-frame RGB clips with SGD — achieved an average accuracy of 98.55% and an F1-score of 97.00% across five subject-wise folds, with sensitivity 97.81%, specificity 99.12%, and precision 96.31%.
- Fold variability: Per-fold F1 ranged from 94.09% (fold 4, which had the lowest sensitivity at 90.56%) to 99.15% (fold 2). Fold 1 reached 100.00% sensitivity.
- RGB beats explicit motion representations: RGB input (87.20% F1 with 8 frames) substantially outperformed Optical Flow (71.69% F1, 88.01% accuracy) and Absolute Differences (67.16% F1, 85.84% accuracy) under otherwise matched settings, suggesting posture and contextual appearance matter beyond motion alone.
- Kinetics pretraining is critical: With 224×224 RGB and 16 frames plus SGD, Kinetics pretraining reached 97.00% F1 versus 38.57% F1 when training without it. The paper reports that Kinetics-pretrained models consistently outperform those trained from scratch by over 25% in accuracy.
- Resolution and temporal coverage matter: Reducing resolution from 224×224 to 112×112 dropped F1 from 97.00% to 64.39%, and halving frames from 16 to 8 dropped F1 to 87.20%.
- Optimizer choice matters: AdamW with Kinetics pretraining produced 34.06% F1 versus 97.00% for SGD in the same 224×224, 16-frame RGB setting.
- Class imbalance: The dataset has roughly three times as many negative clips as positive clips, which is why precision, recall, and F1 are emphasized over accuracy.
Methodology in Plain English
The videos came from an experiment testing a non-invasive surgery approach for epilepsy treatment. Nineteen rats with pilocarpine-induced epilepsy were recorded 10 hours per day for 30 days before treatment (January 14 to February 19) and again after treatment (May 9 to June 8), with each recording covering 3 to 6 cages.
Trained operators marked the start and end times of convulsive seizures in the full recordings using standard operational criteria, and a medical researcher with experimental epilepsy experience peer-reviewed the annotations; only clips with high inter-rater agreement were kept. Because a single camera captured multiple cages, the researchers manually drew a bounding box around each cage on the first frame and applied it to the rest — deliberately excluding the visible cage identification tag to avoid introducing bias. Each full cage recording was then split into 10-second clips, labeled positive if a complete or partial seizure overlapped that period. From seizure-free clips, only those where classical computer vision methods detected motion were retained, excluding periods where the animals were simply lying still.
Frames were resized and center-cropped to 224×224, with augmentation via random horizontal flips, translations, small rotations, and jittering; 16 frames were sampled uniformly per clip and divided into 16×16 non-overlapping patches. The classifier was a TimeSformer with 12 transformer blocks, an embedding dimension of 768, and the "divided attention" variant (temporal attention first, then spatial within each block). Weights were initialized from a Kinetics-pretrained checkpoint, and training used SGD with an initial learning rate of 0.005, weight decay of 1×10⁻⁴, a step-decay schedule, mini-batches of 8 clips per GPU, 20 epochs, weighted cross-entropy to handle class imbalance, gradient clipping, and deterministic seeding. Experiments ran on eight NVIDIA RTX A6000 GPUs with 48 GB each, implemented in PyTorch with distributed data parallelism.
The paper states that three training regimes are evaluated — training from scratch initialized from ImageNet-pretrained ViT weights, and Kinetics pretraining followed by fine-tuning — although only these two are enumerated in the text. Evaluation used five-fold subject-wise cross-validation with accuracy, precision, recall (sensitivity), and F1-score as metrics.
Why This Matters
This work matters because it provides an openly released, curated benchmark for a task — automated seizure detection in rodents — where progress has been slowed by the absence of shared, rigorously evaluated data. The subject-wise cross-validation protocol is a methodological contribution in itself: it gives realistic estimates of generalization to unseen animals rather than inflated numbers produced by leakage between training and test sets, a frequent problem when animals are the unit of replication. The finding that RGB appearance features beat explicit motion representations also challenges the intuition that seizure detection is purely a motion problem.
Real-world applications:
- Preclinical drug screening: Automated, non-invasive seizure counting could increase throughput in large studies where EEG monitoring is impractical for every animal.
- Behavioral phenotyping: The same video classification pipeline could be adapted to score other motor phenotypes in laboratory models.
- Reduced manual review burden: Operators currently spend large amounts of time reviewing hours of footage; clip-level classifiers can triage recordings.
- Refinement of animal research: A non-invasive monitoring approach aligns with efforts to reduce invasiveness in experimental protocols.
Industry relevance spans pharmaceutical research and contract research organizations conducting preclinical epilepsy and neurotoxicity studies, providers of laboratory video-monitoring and vivarium analytics platforms, and developers of video foundation models seeking domain-specific benchmarks in biomedical video.
Future Directions
- Extend temporal context: The paper notes that 10-second clips constrain the available history and may limit detection of early pre-convulsive or prodromal signs; longer windows could support earlier detection.
- Add complementary modalities: The authors propose integrating EEG or piezo sensors to capture electrographic seizures that lack obvious motor manifestations, which the current dataset does not include.
- Combine video with pose estimation: Merging raw video with skeleton outputs from tools such as DeepLabCut or SLEAP could improve interpretability of what the model is responding to.
- Broaden recording conditions: Expanding the dataset across diverse lighting, background contrast, camera placements, and experimental protocols would test and improve robustness beyond the current laboratory setup.
Target Audience
This paper is most useful to computer vision researchers working on video classification and biomedical video, preclinical epilepsy and neuroscience researchers seeking automated behavioral quantification tools, and machine learning practitioners building reproducible benchmarks in small-data domains where transfer learning is essential. Researchers specifically interested in evaluation methodology — particularly subject-wise or group-wise cross-validation — will also find the protocol design instructive.
Authors’ abstract
We introduce a curated video dataset of laboratory rodents for automatic detection of convulsive events. The dataset contains short (10~s) top-down and side-view video clips of individual rodents, labeled at clip level as normal activity or seizure. It includes 10,101 negative samples and 2,952 positive samples collected from 19 subjects. We describe the data curation, annotation protocol and preprocessing pipeline, and report baseline experiments using a transformer-based video classifier (TimeSformer). Experiments employ five-fold cross-validation with strict subject-wise partitioning to prevent data leakage (no subject appears in more than one fold). Results show that the TimeSformer architecture enables discrimination between seizure and normal activity with an average F1-score of 97%. The dataset and baseline code are publicly released to support reproducible research on non-invasive, video-based monitoring in preclinical epilepsy research. RodEpil Dataset access - DOI: 10.5281/zenodo.17601357