Skip to content

Can Ordinary Video Detect Infantile Epileptic Spasms?

Medical Video Systems · action recognition · optical flow · 2021–2025

Motivation

Infantile epileptic spasms are difficult to capture during a clinical appointment. The research question was whether ordinary video and audio could support detection outside specialized sensing setups. There was no public dataset for the target pathology, long archive videos exceeded the available memory, and only a small fraction contained usable audio.

Problem

The work combined three hard constraints:

  • clinically useful events were rare and the source data was difficult to obtain;
  • videos could exceed 20 minutes on an air-gapped machine with limited RAM;
  • physicians needed evidence they could inspect, not only a black-box score.

Architecture

The system was split into acquisition, preparation, detection, and evaluation.

  1. A clinical collection layer connected iPad forms to Raspberry Pi recording nodes across five patient rooms.
  2. A streaming video layer decoded files in chunks and processed frames in parallel rather than loading complete videos.
  3. A learned path used X3D and I3D action-recognition models.
  4. A classical path combined DualTVL1 optical flow with Gaussian Mixture Models.
  5. Supporting models handled child detection, clustering of pre/post-ictal states, and limited audio experiments with YAMNet.
  6. MLflow retained experiment history; SHAP was used in related clinical explainability work.

The learned and classical detectors remained separate. Their agreement was useful evidence, but they did not become a single production model.

Implementation

The data-collection backend ran through Docker and Node.js on an internal server with no internet access. The research pipeline processed a 20-year video archive. A later evaluation pass replaced OpenCV decoding with PyAV and exported X3D-M inference to TensorRT on an RTX 3090 with batch size 128.

The distinction between infrastructure and research output matters: the collection application was deployed for clinicians; the seizure models stayed at research-prototype stage and were demonstrated rather than deployed for clinical decisions.

Results

System Recorded result
X3D-M action recognition 85% ROC AUC for infantile spasm detection
DualTVL1 + GMM 0.96 ROC AUC for infantile spasm detection
Classical pipeline, other events 85% epileptic absences; 80% generalized seizures; 80% pre/post-ictal states
Fine-tuned child detector 96.6% precision, against 59.5% for baseline YOLO
Evaluation pipeline About 10x faster end to end
Clinical collection More than 100 patients across six epilepsy centers; CNIL authorization

The deployed collection system recorded data from approximately 50 patients in five rooms. A separate scraping and labeling pipeline produced 1,928 child images.

Lessons Learned

Pipeline throughput is not model latency. The 10x result came from changing both decoding and inference, and is therefore reported as wall-clock evaluation speed rather than a TensorRT-only claim.

Classical motion features remained competitive on this constrained dataset. The optical-flow pipeline outperformed the recorded X3D-M result for spasm detection, which is a useful reminder that model complexity and task fitness are different questions.

Clinical infrastructure also has a different definition of completion from a research model: security approval, collection reliability, and explicit boundaries around prototype use were part of the system.

Future Work

No production deployment of the detection models is recorded. Any next version would need prospective clinical validation and a deployment protocol distinct from the completed data-collection system.