Gait Analysis
THE BLACKBOX GAIT ANALYSIS PIPELINE


An automated pipeline for extracting and analyzing gait bouts from Blackbox's Palmreader outputs
Jump to Current Features
·
Jump to Code Outputs
·
Request Feature
Table of Contents
About The Gait Analysis Suite
Introduction
The gait analysis suite calculates specialized gait parameters using outputs from palmreader_analysis. It
automatically detects usable gait bouts and analyzes them to extract commonly published gait features. This pipeline is
perfect for evaluating a variety of injury models and provides rich functional outcomes to bridge the gap between
mechanistic and clinical outcomes for treatment studies.
Pipeline Outputs
Current outputs include duty factors, temporal symmetry, limb_phase, spatial symmetry, step width, stride length, velocity etc… Many of these outputs will be familiar to users of the GAITOR analysis suite ([Jacobs & Allen, 2014], [Jacobs & Allen, 2018]), and the number of features will continue to grow as we assess user needs and explore ways to further capitalize on the richness of Blackbox’s data pipeline. This pipeline also enhances existing palmreader outputs by mapping them to gait cycles, which allows both filtering palmreader features by gait bouts and visualization of variation throughout a typical gait cycle.
Gait Analysis Features
Broadly speaking, currently implemented features can be broken up into temporal and spatial parameters (implicitly organized respectively in this document). Some variables used to compute more complex features (or computed from them) don’t have full sections below but their definition and use can be deduced from the following information.
NOTE: Others often define a start paw for a gait cycle and exclusively report outputs with rigid left/right definitions [Lakes & Allen, 2016]. In order to maximize our valid gait cycles and enhance interpretation, we report spatial symmetry, temporal symmetry, duty-factor imbalance, stride length and other similar parameters for each footstep. So a
lfpawand subsequentrfpawshare a footstep in the symmetry calculations (the next contralateral forlfpawisrfpawand the previous contralateral forrfpawis that firstlfpaw).
Duty Factors
Definition
Duty factors are the ratio between the stance (or contact) time of a paw and the duration of a cycle (current to next foot-strike).
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Duty Factor | Jacobs & Allen, 2014 | GAITOR | Unilateral pain models (carrageenan or adjuvant injection and sciatic nerve constriction) | Cited shifts toward contralateral in multiple injury models |
| Duty Cycle | Crosio & Huang, 2024 | CatWalk | Unilateral Achilles Transection | Decreased post-injury and compared to contralateral (day 3 post-op) |
| Percentage of Stance Time | Parvathy & Masocha, 2013 | CatWalk | CFA-induced monoarthritis | Decreased in injured limb (day 2 post-op) and rescued by treatment |
| Percent Stance/Stride | Berryman & Bagi, 2009 | Digigait | Carrageenan injection in the knee joint | Increased in healthy contralateral (4 hours post-op) |
| Duty Factor | Mendes & Man, 2015 | MouseWalker | Method development | Inverse correlation with velocity, 4-paw average of 0.5 defined as a threshold for walk/run |
Duty Factor Imbalance
Duty factor imbalance is simply the difference in duty factors for the current paw and the contralateral, though this pipeline also reports imbalance with the ipsilateral paw as well. While the user will especially want to normalize duty factors by velocity, duty factor imbalances are a bit more ready-to-use since they include some of their own normalization. Similarly, temporal symmetry and spatial symmetry can be more independent of velocity, though it is still a good idea to perform statistical analysis for yourself. Combined these features form a powerful trio to detect imbalances in the timing, location, and duration of footsteps.
Average Fore and Hind Duty Factors
Lastly, while many output parameters from this pipeline compare contralateral paw behaviors, the average fore and hind duty factors provide an avenue for detecting fore-hind shifts, though again this feature should be normalized by velocity.
Feature Extraction Pipeline
Temporal Symmetry
Definition
Temporal symmetry of a paw is defined as the time between its foot-strike and the previous contralateral foot-strike divided by the stride time of the contralateral (previous to next foot-strike). It should be 0.5 if the paw in question strikes the ground exactly between the foot-strikes of the previous and next contralateral. If it is delayed it will be higher than 0.5 (e.g. 0.7), which is commonly seen in injured paws as an indication of hesitancy to make contact with the ground [Jacobs & Allen, 2014].
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Temporal Symmetry | Jacobs & Allen, 2014 | GAITOR | Methods/Review paper, explains and summarizes uses | Reported as frequently used by author but did not provide citations |
| Gait Symmetry | Allen & Setton, 2010 | Custom Arena Similar to GAITOR | Interleukin-1 Beta overexpression OA model | Increased in injured limb |
| Temporal Symmetry | Pavey & Lake, Thesis, 2025 | Modified GAITOR | Unilateral Partial Achilles Transection | Increased in injured limb experimental genotype |
| Temporal Alternation Ratio | Broom & VanderHorst, 2018 | Custom Arena Similar to GAITOR | Unilateral (6-OHDA) and Bilateral (MPTP) Parkinsonism | No significant differences |
Feature Extraction Pipeline
Limb Phase
Definition
Limb Phase of a paw is defined as the time between its foot-strike and the previous ipsilateral foot-strike divided by the stride time of the ipsilateral (previous to next foot-strike). It should be 0.5 if the paw in question strikes the ground exactly between the foot-strikes of the previous and next ipsilateral. If it is delayed it will be higher than 0.5 (e.g. 0.7). This is essentially temporal symmetry but connecting fore and hind limbs instead of contralaterals.
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Limb Phase | Lakes & Allen, 2016 | GAITOR | Methods Paper | Limb Phase, along with most of the base features of this pipeline, is one of the recommended fundamental features (not redundant) |
Feature Extraction Pipeline
Stride Length
Definition
Stride length is defined as the distance between successive foot-strikes for a given paw. This should never be asymmetric for averaged outputs of mice walking in a straight line. If asymmetries are detected, this would indicate a preference for turning in one direction. If one is not specifically studying this type of behavior, stride length can be useful for detecting overall mobility differences, and checking for unexpected asymmetry can be a quality check for automated detection of valid bouts of gait.
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Stride Length | Lakes & Allen, 2016 | GAITOR | Methods Paper | Stride length assymetry indicates turning |
| Stride Length | Allen & Setton, 2009 | Custom Arena Similar to GAITOR | Systemic Arthritis, Col9a1-/- | Decreased in injured mice (less reaching) |
Feature Extraction Pipeline
Step Width
Definition
Step width is defined as the perpendicular distance of a paw to the line joining the previous and next contralaterals. Situationally, lower step widths could indicate shielding behavior, higher values could indicate an attempt to increase stability; changes in fore step widths may indicate different underlying mechanisms than changes in hind step width.
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Step Width | Pavey & Lake, Thesis, 2025 | Modified GAITOR | Unilateral Partial Achilles Transection | Decreased with injury, likely indicative of shielding behavior |
| Step Width | Allen & Setton, 2009 | Custom Arena Similar to GAITOR | Systemic Arthritis, Col9a1-/- | Increased with injury, potentially increasing stability |
Feature Extraction Pipeline
Spatial Symmetry
Definition
Similarly to temporal symmetry, spatial symmetry is defined as the ratio between the parallel distance between a paw and its previous contralateral and the stride length of the contralateral (previous to next foot-strike). It should be 0.5 if the paw in question strikes the ground at a position that forms an isosceles triangle with the previous and next contralateral. If the paw strikes closer to the following contralateral than the previous one, spatial symmetry will be higher than 0.5 (e.g. 0.7). Note that unlike temporal symmetry (after valid gait bout filtering), this calculation could yield a number greater than 1 if the mouse is turning, though for now these are filtered out by the analysis pipeline.
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Spatial Symmetry | Pavey & Lake, Thesis, 2025 | Modified GAITOR | Unilateral Partial Achilles Transection | No significant difference |
| Spatial Alternation Ratio | Broom & VanderHorst, 2018 | Custom Arena Similar to GAITOR | Unilateral (6-OHDA) and Bilateral (MPTP) Parkinsonism | Decreased in 6-OHDA injured limb? (Unclear reporting of side injury and measurement) |
Feature Extraction Pipeline
Velocity
Definition
Velocity is calculated using the average positions of sternumhead and sternumtail. In this pipeline it is defined
as the cumulative distance travelled (frame to frame) divided by the gait bout time (number of frames / FPS).
Average cycle velocity is one of the more important exports due to its dual purpose. Not only is velocity a feature that can be compared across experimental groups, but it can also be used during statistical analysis to normalize other features which are affected by it during a bout, as discussed in [Jacobs & Allen, 2014].
Our velocities are exported in SI units of m/s, and in mice our test data set values range between 0.01 and 0.02, similarly to what has been reported in Appendix 2. from [Crosio & Huang, 2024].
| Name Used | Reference | System | Injury Model | Results |
|---|---|---|---|---|
| Velocity | Crosio & Huang, 2024 | CatWalk | Unilateral Achilles Transection | Values between 0.01 and 0.02, potential increase with acclimation |
| Velocity | Broom & VanderHorst, 2017 | Custom Arena Similar to GAITOR | Unilateral (6-OHDA) and Bilateral (MPTP) Parkinsonism | Many features are velocity dependent |
| Velocity | Allen & Setton, 2010 | Custom Arena Similar to GAITOR | Systemic upregulation of IL-1Beta with IL1Ra Treatment | Significant increase in velocity |
Feature Extraction Pipeline
Gait-Aligned Palmreader Features
Intro
The gait analysis pipeline also extracts Palmreader features during gait cycles. The included features are
specified in settings_gait.py, which can be edited through Palmreader or directly within the file if run locally.
How Different Features Are Processed
Features can be per-paw features or general features. Features such as luminescence exist for each paw, so they
are separated as such in the output csvs and figures. On the other hand, features such as chest_head_angle are not
bound to a paw, so their alignment is bound to the start paw specified in settings_gait.py. Data is produced within
each bout and for the whole video.
| Per-paw features | Paw-independent features |
|---|---|
![]() | ![]() |
Output Figures
Three versions of the gait-aligned Palmreader features are produced in the figures:
- Simple: time series for inspection
- Aggregated: not time-normalized (in seconds); relative timing is not conserved (zero-aligned)
- Aggregated normed: time-normalized and interpolated (0-1 scale); relative timing is conserved
| Simple timeseries | Aggregated | Aggregated Normed |
|---|---|---|
![]() | ![]() | ![]() |
NOTES:
- Plots represent median and 95% confidence intervals for all features.
- Features undergo mild smoothing to enhance consistency
Code Structure
Outputs
The outputs at the cycle, bout, and video level are roughly the same, but the values in each higher level are calculated from averages of the lower level values. This section reports overall variables, followed by level-specific unique outputs.
Table Of Variables
PAW CODES:
- “s”: Side (“l”: left, “r”: right)
- “d”: Direction (“f”: fore, “h”: hind)
| Variable Name | Full Name | Description |
|---|---|---|
sdpaw_duty_factor | Duty Factor of Paw | Ratio of a paw’s contact time versus its stride time |
s1s2d or sd1d2 + _duty_factor | Duty Factor Imbalance | Difference in duty factors, either contralaterals for a direction or ipsilaterals for a side |
d or s + _duty_factor | Duty Factor of Direction | Average duty factor for a direction (fore or hind) or side (left or right) |
sdpaw_temporal_symmetry | Temporal Symmetry | Timing of foot-strike compared to surrounding contralaterals |
sdpaw_limb_phase | Limb Phase | Timing of foot-strike compared to surrounding ipsilaterals |
sdpaw_step_width | Step Width | Step width at paw compared to the line joining surrounding contralaterals |
sdpaw_stride_length | Stride Length | Distance between preceding and following contralateral footsteps |
sdpaw_spatial_symmetry | Spatial Symmetry | Parallel distance between footstep and preceding contralateral divided by the stride length |
velocity | Velocity | Average velocity in SI units |
quadruped | Quadrupedal Gait | True (or 1) if quadrupedal analysis was possible, otherwise indicates the gait detection pipeline reverted to bipedal gait |
Cycle-Level Outputs
The analysis_bouts file contains a row for each cycle that was analysed. Some additional unique outputs at this level
are:
| Variable Name | Full Name | Description |
|---|---|---|
bout_number | Bout ID Number | The bout number assigned before filtering. Will be in order but many numbers are skipped |
number_of_footsteps | Number of Valid Footsteps | The number of footsteps that were processed in the bout |
cycle | Cycle ID Number | The cycle number for a given row (within the bout, so always starting at 1) |
footstep_idx | Footstep Indices | The start and end footstep indices for the bout (pulled from a data frame where each row is a detected footstep for the whole video |
frame | Frame Indices | The start and end frames from the video/tracking data |
Bout-Level Outputs
The analysis_bouts_summary file contains a row for each bout that was analysed. Additional unique entries at this
level compared to Cycle-Level Outputs are:
| Variable Name | Full Name | Description |
|---|---|---|
cycle | Number of Valid Cycles | The number of cycles that were processed in the bout |
Video-Level Outputs
The analysis_gait_summary file shows a single row average of the outputs from all valid bouts. Some additional unique
outputs at this level are:
| Variable Name | Full Name | Description |
|---|---|---|
number_of_bouts | Number of Valid Bouts | The number of bouts that were processed by the analysis pipeline |
number_of_footsteps | Number of Valid Footsteps | The number of footsteps that were processed by the analysis pipeline |
cycle | Number of Valid Cycles | The number of cycles that were processed by the analysis pipeline |
Pipeline Overview
Overall Structure
This pipeline consists of two main sections: gait detection and gait analysis.
Gait detection is hierarchical and mostly rules-based. First, footsteps are detected labeled with separate bout numbers for fore and hind paws. Next these bouts are consolidated to form the final bout numbers. Finally, bouts are filtered to form the definitive list of valid gait bouts. Outputs for each bout include start/end video indices, which makes it easy to add new features in the subsequent analysis section.
Gait analysis is built to be very modular. Similarly to gait detection, the outputs are also hierarchical, spanning from cycle, to bout, to video level reporting; and the dataframes which carries these outputs conveniently propagate and handle excluded values (features calculated from a NAN entries are also NAN, and averages ignore NAN entries).
Footstep Detection
Footsteps are detected using the paw area values from palmreader_analysis. Paw-area is a proxy for luminance-based
contact registration, and was chosen in case extra filtering is ever performed to compute paw-area. Footsteps that start
or end with the video are excluded, alongside footsteps that only last 1 frame.
Fore-Hind Bout Detection
Every footstep is labeled with a bout number which increments anytime contralateral paws don’t alternate, and this counter is initially kept separate for fore and hind limbs.
Quadrupedal Bout Detection
Previous fore- and hind-specific bout numbers are consolidated into a unified bout number which checks that all four paws are represented in chunks (they can be slightly out of order as diagonals may swap which paw contacts first, but the previous step ensures cycles don’t violate any obvious rules at this point). If the length of the fore or hind bout list is three times bigger for either the fore or hind limbs, the shorter list is dropped and the rest of the pipeline will assume bipedal locomotion to ensure studies which induce hind-limb paralysis at certain time points don’t break the analysis.
NOTE: Bipedal detection and processing are still in development. We may just let the user choose bipedal processing.
Bout Filtering
Bouts undergo multiple sequential filters stored in GaitDetection.BoutExclusion before being finalized. Order and
behavior may vary with future updates, but order is roughly as follows:
| Filter Name | Description |
|---|---|
bout_length | Bouts (input bouts from quadrupedal synchronization) are trimmed based on cycle length to ensure three gait cycles are present in each bout; this will be run again, but starting here reduces processing time for the subsequent filters |
velocity_based | Bouts are trimmed by keeping the largest valid region within which velocity is consistently higher than a percentage of the average bout velocity. This prevents jerky behavior from being included in the bout |
trajectory_based | This is currently an empty wrapper which will eventually house logic for handling turning behavior |
trim_irregular_paws | Exclude footsteps that last much longer or shorter than the average footstep for a given paw |
trim_unmatched_diagonals | This method will remain the penultimate filter, and simply removes footsteps that do not have a matched diagonal |
bout_length | A final exclusion of bouts that retained less than three full cycles after the rest of the filters |
Gait Analysis
Every valid footstep is analyzed to produce outputs as described in Gait Analysis Features. These are output at the cycle level, then averaged at the bout level, and finally reported as averages for the whole video.
Some Upcoming Features
This list is non-exhaustive and mostly features that won’t take long to implement. Some more innovative improvements and features that are not quite ready to share are also in development, so stay tuned!!
| Variable Name | Reference | Comments |
|---|---|---|
| Toe-out angle | [Jacobs & Allen, 2014] | During valid cycles |
| More angle features | N/A | Currently using those in features, but more can be calculated… |
| More granular gait outputs | N/A | Stance time, swing time, swing speed; initially suppressed in favor of more processed features |
| Trunk stability | N/A | Multiple possible stability and trajectory measurements |
Please request any other features that would make Blackbox worth your investment!
References
B.Y. Jacobs, H.E. Kloefkorn, K.D. Allen, Gait Analysis Methods for Rodent Models of Osteoarthritis.
Curr Pain Headache Rep (2014), vol. 18,
https://doi.org/10.1007/s11916-014-0456-xB.Y. Jacobs, K.D. Allen, et al., The Open Source GAITOR Suite for Rodent Gait Analysis.
Scientific Reports (2018), vol. 8,
https://doi.org/10.1038/s41598-018-28134-1G. Crosio, E.R. King, A.H. Huang, CatWalk XT Gait Parameters Associated with Mouse Achilles Tendon Injury and Healing.
Muscles, Ligaments, and Tendons Journal (2024), vol. 14,
http://dx.doi.org/10.32098/mltj.02.2024.19S.N. Pavey, S.P. Lake, The Effect of Fascicular Elastin on the Mechanical and Functional Properties of Healthy, Damaged, and Healing Tendon
Washington University in St. Louis, 2025, 163 pages
https://doi.org/10.7936/r7pg-e084S.S. Parvathy, W. Masocha, Gait analysis of C57BL/6 mice with complete Freund’s adjuvant-induced arthritis using the CatWalk system
Musculoskeletal Disorders (2013), vol. 14,
http://dx.doi.org/10.1186/1471-2474-14-14E.R. Berryman, R.L. Harris, M. Moalli, C.M. Bagi, Digigait™ quantitation of gait dynamics in rat rheumatoid arthritis model
Journal of Musculoskeletal and Neuronal Interactions (2009), vol. 9,
https://www.researchgate.net/profile/Emily-Berryman/publication/26282276_Digigait_quantitation_of_gait_dynamics_in_rat_rheumatoid_arthritis_model/links/5491d1590cf2991ff55605ba/Digigait-quantitation-of-gait-dynamics-in-rat-rheumatoid-arthritis-model.pdfE.H. Lakes, K.D. Allen, Gait analysis methods for rodent models of arthritic disorders: reviews and recommendations
Osteoarthritis and Cartilage (2016), vol. 24,
http://dx.doi.org/10.1016/j.joca.2016.03.008K.D. Allen, T.M. Griffin, R.M. Rodriguiz, W.C. Wetsel, V.B. Kraus, J.L. Huebner, L.M. Boyd, L.A. Setton, Decreased physical function and increased pain sensitivity in mice deficient for type IX collagen
Arhtritis and Rheumatology (2009), vol. 60,
https://doi.org/10.1002/art.24783K.D. Allen, S.B. Adams Jr., L.A. Setton, Evaluating Intra-Articular Drug Delivery for the Treatment of Osteoarthritis in a Rat Model
Tissue Engineering (2009), vol. 16,
https://doi.org/10.1089/ten.teb.2009.0447C.S. Mendes, I. Bartos, Z. Marka, T. Akay, S. Marka, R.S. Mann, Quantification of gait parameters in freely walking rodents
BMC Biology (2015), vol. 13,
https://doi.org/10.1186/s12915-015-0154-0L. Broom, A. Worley, F. Gao, L.D. Hernandez, C.E. Ashton, L.C. Shih, V.G. VanderHorst, Translational methods to detect asymmetries in temporal and spatial walking metrics in parkinsonian mouse models and human subjects with Parkinson’s disease
Scientific Reports (2019), vol. 9,
https://doi.org/10.1038/s41598-019-38623-6L. Broom, B.A. Ellison, A. Worley, L. Wagenaar, E. Sorberg, C.A. Ashton, D.A. Bennett, A.S. Buchman, C.B. Saper, L.C. Shih, J.M. Hausdorff, V.G. VanderHorst, A translational approach to capture gait signatures of neurological disorders in mice and humans
Scientific Reports (2017), vol. 7,
https://doi.org/10.1038/s41598-017-03336-1E.H. Lakes, K.D. Allen, Gait analysis methods for rodent models of arthritic disorders: reviews and recommendations
Osteoarthritis and Cartilage (2016), vol. 24,
http://dx.doi.org/10.1016/j.joca.2016.03.008











