Gait Analysis

THE BLACKBOX GAIT ANALYSIS PIPELINE Blackbox Bio Logo

Gait Example GIF

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
  1. About The Gait Analysis Suite
  2. Gait Analysis Features
  3. Gait-Aligned Palmreader Features
  4. Code Structure
  5. Planned Features
  6. References
  7. Contact

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.

(back to top)


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 lfpaw and subsequent rfpaw share a footstep in the symmetry calculations (the next contralateral for lfpaw is rfpaw and the previous contralateral for rfpaw is that first lfpaw).

  • Duty Factors
  • Temporal Symmetry
  • Limb Phase
  • Stride Length
  • Step Width
  • Spatial Symmetry
  • Velocity

  • 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 UsedReferenceSystemInjury ModelResults
    Duty FactorJacobs & Allen, 2014GAITORUnilateral pain models (carrageenan or adjuvant injection and sciatic nerve constriction)Cited shifts toward contralateral in multiple injury models
    Duty CycleCrosio & Huang, 2024CatWalkUnilateral Achilles TransectionDecreased post-injury and compared to contralateral (day 3 post-op)
    Percentage of Stance TimeParvathy & Masocha, 2013CatWalkCFA-induced monoarthritisDecreased in injured limb (day 2 post-op) and rescued by treatment
    Percent Stance/StrideBerryman & Bagi, 2009DigigaitCarrageenan injection in the knee jointIncreased in healthy contralateral (4 hours post-op)
    Duty FactorMendes & Man, 2015MouseWalkerMethod developmentInverse 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 UsedReferenceSystemInjury ModelResults
    Temporal SymmetryJacobs & Allen, 2014GAITORMethods/Review paper, explains and summarizes usesReported as frequently used by author but did not provide citations
    Gait SymmetryAllen & Setton, 2010Custom Arena Similar to GAITORInterleukin-1 Beta overexpression OA modelIncreased in injured limb
    Temporal SymmetryPavey & Lake, Thesis, 2025Modified GAITORUnilateral Partial Achilles TransectionIncreased in injured limb experimental genotype
    Temporal Alternation RatioBroom & VanderHorst, 2018Custom Arena Similar to GAITORUnilateral (6-OHDA) and Bilateral (MPTP) ParkinsonismNo 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 UsedReferenceSystemInjury ModelResults
    Limb PhaseLakes & Allen, 2016GAITORMethods PaperLimb 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 UsedReferenceSystemInjury ModelResults
    Stride LengthLakes & Allen, 2016GAITORMethods PaperStride length assymetry indicates turning
    Stride LengthAllen & Setton, 2009Custom Arena Similar to GAITORSystemic 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 UsedReferenceSystemInjury ModelResults
    Step WidthPavey & Lake, Thesis, 2025Modified GAITORUnilateral Partial Achilles TransectionDecreased with injury, likely indicative of shielding behavior
    Step WidthAllen & Setton, 2009Custom Arena Similar to GAITORSystemic 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 UsedReferenceSystemInjury ModelResults
    Spatial SymmetryPavey & Lake, Thesis, 2025Modified GAITORUnilateral Partial Achilles TransectionNo significant difference
    Spatial Alternation RatioBroom & VanderHorst, 2018Custom Arena Similar to GAITORUnilateral (6-OHDA) and Bilateral (MPTP) ParkinsonismDecreased 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 UsedReferenceSystemInjury ModelResults
    VelocityCrosio & Huang, 2024CatWalkUnilateral Achilles TransectionValues between 0.01 and 0.02, potential increase with acclimation
    VelocityBroom & VanderHorst, 2017Custom Arena Similar to GAITORUnilateral (6-OHDA) and Bilateral (MPTP) ParkinsonismMany features are velocity dependent
    VelocityAllen & Setton, 2010Custom Arena Similar to GAITORSystemic upregulation of IL-1Beta with IL1Ra TreatmentSignificant 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 featuresPaw-independent features
    Per PawPaw Independent

    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 timeseriesAggregatedAggregated Normed
    SimpleAggregatedAggregated Normed

    NOTES:

    • Plots represent median and 95% confidence intervals for all features.
    • Features undergo mild smoothing to enhance consistency

    (back to top)


    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 NameFull NameDescription
    sdpaw_duty_factorDuty Factor of PawRatio of a paw’s contact time versus its stride time
    s1s2d or sd1d2 + _duty_factorDuty Factor ImbalanceDifference in duty factors, either contralaterals for a direction or ipsilaterals for a side
    d or s + _duty_factorDuty Factor of DirectionAverage duty factor for a direction (fore or hind) or side (left or right)
    sdpaw_temporal_symmetryTemporal SymmetryTiming of foot-strike compared to surrounding contralaterals
    sdpaw_limb_phaseLimb PhaseTiming of foot-strike compared to surrounding ipsilaterals
    sdpaw_step_widthStep WidthStep width at paw compared to the line joining surrounding contralaterals
    sdpaw_stride_lengthStride LengthDistance between preceding and following contralateral footsteps
    sdpaw_spatial_symmetrySpatial SymmetryParallel distance between footstep and preceding contralateral divided by the stride length
    velocityVelocityAverage velocity in SI units
    quadrupedQuadrupedal GaitTrue (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 NameFull NameDescription
    bout_numberBout ID NumberThe bout number assigned before filtering. Will be in order but many numbers are skipped
    number_of_footstepsNumber of Valid FootstepsThe number of footsteps that were processed in the bout
    cycleCycle ID NumberThe cycle number for a given row (within the bout, so always starting at 1)
    footstep_idxFootstep IndicesThe start and end footstep indices for the bout (pulled from a data frame where each row is a detected footstep for the whole video
    frameFrame IndicesThe 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 NameFull NameDescription
    cycleNumber of Valid CyclesThe 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 NameFull NameDescription
    number_of_boutsNumber of Valid BoutsThe number of bouts that were processed by the analysis pipeline
    number_of_footstepsNumber of Valid FootstepsThe number of footsteps that were processed by the analysis pipeline
    cycleNumber of Valid CyclesThe number of cycles that were processed by the analysis pipeline

    (back to top)


    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 NameDescription
    bout_lengthBouts (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_basedBouts 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_basedThis is currently an empty wrapper which will eventually house logic for handling turning behavior
    trim_irregular_pawsExclude footsteps that last much longer or shorter than the average footstep for a given paw
    trim_unmatched_diagonalsThis method will remain the penultimate filter, and simply removes footsteps that do not have a matched diagonal
    bout_lengthA 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.

    (back to top)


    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 NameReferenceComments
    Toe-out angle[Jacobs & Allen, 2014]During valid cycles
    More angle featuresN/ACurrently using those in features, but more can be calculated…
    More granular gait outputsN/AStance time, swing time, swing speed; initially suppressed in favor of more processed features
    Trunk stabilityN/AMultiple possible stability and trajectory measurements

    Please request any other features that would make Blackbox worth your investment!

    (back to top)


    References

    1. 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-x

    2. B.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-1

    3. G. 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.19

    4. S.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-e084

    5. S.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-14

    6. E.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.pdf

    7. E.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

    8. K.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.24783

    9. K.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.0447

    10. C.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-0

    11. L. 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-6

    12. L. 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-1

    13. E.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

    (back to top)