Skip to main content
BioMedical Engineering OnLine logoLink to BioMedical Engineering OnLine
. 2018 Nov 20;17(Suppl 1):134. doi: 10.1186/s12938-018-0565-6

Modeling hind-limb kinematics using a bio-inspired algorithm with a local search

S Ivvan Valdez 1, Josué González-Sandoval 2, Sergio Dueñas-Jiménez 3, Nancy Elizabeth Franco Rodríguez 4, Sulema Torres-Ramos 2, Gerardo Mendizabal-Ruiz 2,
PMCID: PMC6245690  PMID: 30458788

Abstract

Background

Laboratory rats play a critical role in research because they provide a biological model that can be used for evaluating the affectation of diseases and injuries, and for the evaluation of the effectiveness of new drugs and treatments. The analysis of locomotion in laboratory rats facilitates the understanding of motor defects in many diseases, as well as the damage and recovery after peripheral and central nervous system injuries. However, locomotion analysis of rats remains a great challenge due to the necessity of labor intensive manual annotations of video data required to obtain quantitative measurements of the kinematics of the rodent extremities. In this work, we present a method that is based on the use of a bio-inspired algorithm that fits a kinematic model of the hind limbs of rats to binary images corresponding to the segmented marker of images corresponding to the rat’s gait. The bio-inspired algorithm combines a genetic algorithm for a group of the optimization variables with a local search for a second group of the optimization variables.

Results

Our results indicate the feasibility of employing the proposed approach for the automatic annotation and analysis of the locomotion patterns of the posterior extremities of laboratory rats.

Conclusions

The adjustment of the hind limb kinematic model to markers of the video frames corresponding to rat’s gait sequences could then be used to analyze the motion patterns during the steps, which, in turn, can be useful for performing quantitative evaluations of the effect of lesions and treatments on rats models.

Keywords: Genetic algorithm, Local search, Hind limb, Laboratory rats, Kinematics analysis

Background

Laboratory rats play a critical role in research because they provide a biological model that can be used for evaluating the affectation of diseases and injuries, and for the evaluation of the effectiveness of new drugs and treatments [13]. In particular, the analysis of locomotion in laboratory rats allows us to understand the motor defects in diseases such as osteoarthrosis [4], Parkinson’s disease, Huntington’s disease, and amyotrophic lateral sclerosis [5, 6], as well as the damage and recovery after peripheral and central nervous system injury [7].

Current methodologies for the analyses of laboratory rats’ locomotion can be categorized as “forced” when the speed of march is imposed on the rat by means of a treadmill (e.g., [8]), or “unforced” when the rat is free to move at any speed on the ground or an activity wheel [7]. In general, forced analysis have the advantage of allowing to perform direct comparisons between the recollected gait variables, since all of the subjects will be moving at similar speeds. However, for some research cases, these strategies may be unsuitable, since the movement of the rats could be different from their normal locomotion patterns [9]. For these cases, unforced methods may be a better option with the main disadvantage that the comparison of the gait variables would require a more elaborated metric, exclusion of samples, or a normalization of the data.

There currently are qualitative methods for the assessment of locomotion variables, such as the Tarlov scale [10] and the inclined plane test [11], and the Basso, Beattie and Bresnahan (BBB) rating [12]. BBB is the most widely accepted method for assessing locomotion on unforced-open field tests. The BBB rating consists of a semi-quantitative scale which takes values ranging from zero to twenty one, based on the opinion of an observer regarding the hindlimb movements, joint movements, forelimb and hindlimb coordination, stepping, trunk position and stability, paw placement and tail position. The scale score is divided into three stages: (i) Early stage (score of 0–7): composed of isolated joint movements with little or no hindlimb movement; (ii) Intermediate stage (score of 8–13): intervals of uncoordinated stepping, and (iii) Late stage (score of 14–21): forelimb and hindlimb coordination.

Since the BBB score is determined by a person based on his own experience and expertise, the major limitation of the this and other qualitative methodologies is the reduced reproducibility and non-satisfactory sensitivity for some cases of locomotion studies [13].

To overcome this challenge, an automated gait analysis method based on the analysis of paw-floor contact was developed by Hammers et al. [14], which allows the quantification of a number of locomotion variables regarding the step cycle, pressure applied, and stance phases.

Another approach consists of performing an analysis of the patterns generated by the configuration of the rat’s extremity joints during their movement, either using a forced or an unforced methodology (e.g., [1518]. These approaches rely on the use of video sequence recording at high speed (i.e., in general above 90 frames per second) that are analyzed through the inspection of the angles between the joints of the extremity of interest obtained by manual annotations of the extremity along the recorded frames. The curves corresponding to changes of the joint angles with respect to time can then be used to compare the gait patterns of different experimental rat groups [7].

However, the great challenge of this approach is the significant amount of effort required for the manual annotation of the frames of the videos. The person who does the annotations may also perform poorly due to lack of experience or fatigue.

Therefore, it is necessary to the automate the annotation process and the subsequent computation of angle variations with respect to time. In this work, we present a method that is based on the use of a bio-inspired algorithm that fits a kinematic model of the hind limb of rats to a binary image corresponding to the segmented marker of an image of the rat while walking. The bio-inspired algorithm combines a genetic algorithm for a group of the optimization variables with a local search for a second group of the optimization variables. Our results indicate the feasibility of employing the proposed approach for the automatic annotation and analysis of the locomotion patterns of the posterior extremities of laboratory rats.

Methods

The proposed method is based on the adjustment of a rat hind limb kinematic model to a frame in a rat’s gait video sequence, where the hind limb of the rat has been marked with line-marks corresponding to the the rat’s leg bones ( Fig. 1a). The model consists of points representing the joints named as P1,,P5, the lengths of each element of the leg l1,,l4, and the angle of each element by θ1,,θ4. Although leg widths are meaningless for the kinematic model, there are useful for the sake of fitting the virtual model to the video frames. Thus, they are marked with wi in Fig. 2.

Fig. 1.

Fig. 1

a Example of marks placed on the skin of the hind limb of a laboratory rat, and b the binary image corresponding to the marks

Fig. 2.

Fig. 2

Kinematic model of the rat hind limb

Given the upper-most point P1=(x1,y1), the rest of the points can be obtained by:

xn=xn-1+ln-1(cos(θn-1)) 1
yn=yn-1+ln-1(sin(θn-1)) 2

for n=2...5.

Thus, the hind limb model for a given position can be represented as a fourteen-dimensional vector:

X=[x1,y1,l1,l2,l3,l4,θ1,θ2,θ3,θ4,w1,w2,w3,w4] 3

where li, with i{1..4}, are the lengths of the leg elements, and θi and wi are angles and widths of the elements, respectively (Fig. 2).

Therefore, the problem consist of finding a vector of parameters X which produces a binary image E(xy) which fits the most (i.e., is the most similar) to a binary image S(xy) representing the hind limb marks on a given frame (Fig. 1b). A fitting score f(X) can be obtained by:

f(X)=TP+TNP+N. 4

Where TP is the number of true positives, which are the number of white pixels in E(xy) that are white in S(xy). TN is the number of true negatives, negatives, which are the number of black pixels in E(xy) that are black in S(xy). P and N are the total number of positives and negatives in S(xy). This measure is known, in the context of binary classifiers, as accuracy. The maximum value of the objective function is 1.

In this work, we propose to compute the solution X using a two-step method that consists of a genetic algorithm for finding the values of the initial point (x1,y1) and lengths and a local search algorithm for the other variables.

Genetic algorithm

We implemented the Elitist Non-Dominated Sorting Genetic Algorithm II (NSGA-II) [19], since it has demonstrated outstanding performance and is currently one of the most widely used evolutionary algorithms. The initial population Zz=0 is generated using aleatory values for the uppermost point P1 and lengths li of the kinematic model. P1 is selected from the uppermost white pixels. Therefore, we use a single optimization variable (the index of the pixel), A local search is then performed to find the best angles (θi) and widths (wi) for the given uppermost point and section lengths. Each individual of the population Xcz is evaluated on the objective function and the result is established as the fitness score F. Notice that the evaluation procedure is, actually, the local search procedure. The genetic algorithm provides the initial point and length, while the local search find angles and widths. In contrast with most hybrid algorithms, our global and local procedures affect different optimization variables. After evaluating the population, the best individual Xz is selected to be incorporated into the next generation population Zz+1 (elitism). The rest of the individuals are selected for reproduction using binary tournament [20], which consists of several comparisons of objective function value (“tournaments”) among a set of individuals chosen at random from the population. The winner of each tournament (the one with the best fitness) is selected for reproduction.

The reproduction of two selected individuals Xc1z and Xc2z is performed using the simulated binary cross-over(SBX) method [19], which consists of the generation of a random number u in the range of [0, 1] that is is used for determining the contribution β¯ of the characteristics from each parent to each children as:

β¯=(2·u)1nc+1ifu<0.512(1-u)1nc+1otherwise 5

where nc=1. A pair of children Xc1z+1 and Xc2z+1 are then generated according to the following equations:

Xc1z+1=12(Xc1z+Xc2z)-β¯(Xc2z-Xc1z)Xc2z+1=12(Xc1z+Xc2z)+β¯(Xc2z-Xc1z) 6

Finally, to prevent the population from getting stuck in local minimums and maintain diversity in the exploration of the solution space, we employed the polynomial mutation method [21] on which the value of an element of an individual may change with a probability m. The new value is determined by a polynomial probability distribution: P(δ)=0.5(ηm+1)(1-|δ|)ηm; xiU and xiL are the lower and upper bound of xi respectively. The mutated children together with the elite individual (best-known solution) become the new population. The loop of evaluation, elitism, selection, reproduction and mutation are repeated until a stopping criterion is met. In this work, the stopping criterion depends on the consecutive number of generations Nmaxelite in which the elite individual is not improved.

Algorithm 1 list the steps of the first part of the proposed approach based on the genetic algorithm.

graphic file with name 12938_2018_565_Figa_HTML.jpg

Local search

The local search method intends to find the optimal values of θi and wi for each hind limb segment by searching in a given range of angular values θiinf and θisup, using the objective function in Eq. 4. The method consists of two stages of refinement, where in each of these, the search is performed with a higher precision in a reduced range.

The first step starts with an initial width of w0=10. The method performs a search every four degrees of the angle in which the overlap of the line drawn in the image DiI and the image S(xy) is maximized, according to Eq. 4. The best angle found is stored in the variable θI.

A second search is performed around this last value, every one degree. For each angle in the second search, we intend to improve the width of the segment looking for a new width. The best angle found is stored in the variable θI, and the best width in the variable wn-1II. Finally, the values of the width and the angle are stored and the limits updated. The procedure is repeated until all angles and widths are estimated. Algorithm 2 lists the steps of the proposed local search method.

graphic file with name 12938_2018_565_Figb_HTML.jpg

Leg pendulum-like movement computation

A possible way to quantitatively evaluate the gait properties of rats is by comparing the curves that are generated by the movement of the extremities during the steps. One of the curves that can be employed to perform a comparison of hind limbs locomotion is the leg pendulum-like movement (PLM) of the hind limb which corresponds to the angle between the the 5th lumbar vertebra and fifth metatarsophalangeal joint (first and last points) [7]. In this work, we computed this angle for each frame, interpolated missing angles in case of non convergence of the algorithm, and then applied a robust weighted moving average filter with an outliers parameter of 6σ.

Results

Six hundred frames corresponding to steps from fourteen laboratory rats marked on their hind limb using a red water-based non-toxic marker were obtained from video sequences recorded at 90 frames per second at a resolution of 640 x 480 pixels. Segmentation of the marked region during the steps were obtained automatically by converting each frame into an HSV color space and then applying a threshold over the Hue channel of the image.

The genetic algorithm with local search is applied on each frame using a population size of 400, mutation probability of 0.11, crossover probability of 0.9, number of elite individuals preserver through a generation is 3, and value of Nmaxelite=8 as stopping criterion. Figure 3 depicts an example of the best adjusted model on 21 frames corresponding to a step of a rat. Note that the kinematic model adjusted by the proposed method is very similar to the segmented marked region.

Fig. 3.

Fig. 3

Examples of the kinematic model adjustments over the binary images corresponding to the hind limb marks of a rat employing the proposed method

Table 1 depicts the statistics of the variation of the results of five independent executions of the proposed method on 100 randomly selected frames using Bootstrapping and a re-sampling parameter of N=1000. Figure 4 depicts an example of the computed angles for the four angles in five independent executions (dots), along with a weighted mean (gray line), and a cubic spline interpolation (green line). Note that the computed angles have a small dispersion, which indicates that the algorithm is robust with respect to the variability of the rat’s hind limbs.

Table 1.

Statistics of the variation of the results of the adjusted kinematic model employing the proposed method five times on 100 randomly selected frames using Bootstrapping and a re-sampling parameter of N=1000

Variable Mean difference (std) 95% Confidence interval
l1 (pixels) 2.39 (4.87) 1.95–3.02
l2 (pixels) 1.86 (3.56) 1.56–2.35
l3 (pixels) 3.32 (6.27) 2.65–4.12
l4 (pixels) 12.59 (10.48) 11.41–13.79
θ1 (rad) 0.02 (0.06) 0.018–0.034
θ2 (rad) 0.01 (0.03) 0.013–0.022
θ3 (rad) 0.01 (0.02) 0.013–0.019
θ4 (rad) 0.36 (1.58) 0.210–0.582

Fig. 4.

Fig. 4

From up to down, left to right angles. Dots are θ1,θ2,θ3 and θ4 estimated values from five executions per frame. The gray line is a weighted mean, each value is weighted by the normalized objective function (the normalized objective function values from the five executions sums to one) . The green line is a cubic-spline interpolation of the weighted mean

The feasibility of the proposed method to be used to perform the quantitative analysis is evaluated by comparing the PLM of the hind limb of each rat’s step obtained with the proposed method (A), with the corresponding curve obtained from the annotations of two observers (O1 and O2) on the image sequences (Fig. 5). Note that, in general the three curves are very similar in the pattern they describe, with exception of some localized differences.

Fig. 5.

Fig. 5

Examples of the the leg pendulum-like movement of the hind limb obtained with the proposed method (A), and with the annotations of two observers (O1 and O2)

The similarity of the PLM curves for each rat step obtained with the proposed method and with the observer’s annotations was assessed by the computation of the Frechet distance [22], which is a measure of similarity between curves that takes into account the location and ordering of the points along the curves. The mean difference between A and O1 was 0.453 ± 0.147, the difference between A and O2 was 0.544 ± 0.25, while the difference between the O1 vs O2 was 0.298 ± 0.093. We performed a two-sample T-test with a significance level of 0.05 to determine if the differences in the performance between the automatic method and the human observers was comparable. The results for the comparison of A vs O1 and O1 vs O2, the null-hypothesis was rejected with a value of p=0.068, which indicate that there are not statistically significant differences between the performance of the proposed method and Observer one. However, for the case of the comparison comparison of A vs O2 and O1 vs O2, there was not enough statistical evidence to reject the null-hypothesis (p=0.00524) which suggests that the differences of the proposed method with respect to the annotations of O2 are greater than the differences of O1 and O2.

Discussion

The obtained results indicate the feasibility of employing the proposed method for the adjustment of the hind limb kinematic model to markers of the video frames corresponding to rat’s gait sequences. The obtained joint configuration could then be used to analyze the motion patterns during the steps, which, in turn, can be useful for performing quantitative evaluations of the effect of lesions and treatments on rats models.

In our experiments, we noted that the lengths and widths of the hind limb segments vary with respect to the step cycle instant. For instance, for all executions on frames in Fig. 3, the length’s means and standard deviations are μl={67.2,108.09,94.35,101.56} and σl={5.69,5.493,16.00,16.82} for {l1,l2,l3,l4} respectively, and the width’s means and standard deviations are μw={15.71,15.56,15.35,14.57} and σw={1.67,1.62,1.67,2.48} for {w1,w2,w3,w4}, respectively. All measurements are in pixels. This variation could be explained by the three dimensional movement of the leg which occurs in the direction of the cameras. We believe that it could be possible to estimate the characteristics of this motion by comparing the obtained lengths and widths with the real proportions of these features. Another option could be to employ more than one camera at different known positions, then perform the model fitting, and finally estimate the 3D motion by triangulation of the known corresponding points.

Future work includes the addition of a kinematic model for the forelimbs, and the comparison of the results obtained with the proposed method with manual annotations performed by an observer over the same video sequences.

Conclusion

We have presented a method that is based on the use of a bio-inspired algorithm that fits a kinematic model of the hind limb of rats to binary images corresponding to the segmented marker of images corresponding to rats’ gait. The obtained results indicate the feasibility of employing the proposed approach for the automatic annotation and analysis of the locomotion patterns of the posterior extremities of laboratory rats.

Declarations

Authors' contributions SV, JS, and ST performed the coding of the proposed method. SV and GM designed the proposed algorithm and were major contributors in writing the manuscript. SD and NEFR participated in the delimitation of the problem, the conception of the solution, and the training and management of the laboratory rats and acquisition of the data. All authors read and approved the final manuscript.

Acknowledgements

The authors thanks CONACYT and PROMEP for the provided support. Any opinions, findings, conclusions or recommendations expressed in this material are of the authors and may not reflect the views of the sponsors.

Competing interests

The authors declare that they have no competing interests.

Availability of data and materials

Not applicable

Consent for publication

Not applicable

Ethics approval and consent to participate

All procedures were performed in accordance with the ethical considerations guidelines of the Mexican Official Norm (NOM-062-ZOO-1999) and the National Institute of Health Guide NIH Publication No. 8023 (revised in 1996) for the Care and Use of Laboratory Animals.

Funding

Publication costs were funded by Universidad De Guadalajara.

About this supplement

This article has been published as part of BioMedical Engineering OnLine Volume 17 Supplement 1, 2018: Selected articles from the 5th International Work-Conference on Bioinformatics and Biomedical Engineering: biomedical engineering. The full contents of the supplement are available online at https://biomedical-engineering-online.biomedcentral.com/articles/supplements/volume-17-supplement-1.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Sandi C, Venero C, Guaza C. Novelty-related rapid locomotor effects of corticosterone in rats. Eur J Neurosci. 1996;8(4):794–800. doi: 10.1111/j.1460-9568.1996.tb01264.x. [DOI] [PubMed] [Google Scholar]
  • 2.Delfs J, Schreiber L, Kelley A. Microinjection of cocaine into the nucleus accumbens elicits locomotor activation in the rat. J Neurosci. 1990;10(1):303–310. doi: 10.1523/JNEUROSCI.10-01-00303.1990. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Stephan FK, Zucker I. Circadian rhythms in drinking behavior and locomotor activity of rats are eliminated by hypothalamic lesions. Proc Natl Acad Sci. 1972;69(6):1583–1586. doi: 10.1073/pnas.69.6.1583. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Clarke K, Heitmeyer S, Smith A, Taiwo Y. Gait analysis in a rat model of osteoarthrosis. Physiol Behav. 1997;62(5):951–954. doi: 10.1016/S0031-9384(97)00022-X. [DOI] [PubMed] [Google Scholar]
  • 5.Amende I, Kale A, McCue S, Glazier S, Morgan JP, Hampton TG. Gait dynamics in mouse models of parkinson’s disease and huntington’s disease. J Neuroeng Rehabil. 2005;2(1):20. doi: 10.1186/1743-0003-2-20. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Hampton TG, Amende I. Treadmill gait analysis characterizes gait alterations in parkinson’s disease and amyotrophic lateral sclerosis mouse models. J Motor Behav. 2009;42(1):1–4. doi: 10.1080/00222890903272025. [DOI] [PubMed] [Google Scholar]
  • 7.Osuna-Carrasco L, López-Ruiz J, Mendizabal-Ruiz E, De la Torre-Valdovinos B, Bañuelos-Pineda J, Jiménez-Estrada I, Dueñas-Jiménez S. Quantitative analysis of hindlimbs locomotion kinematics in spinalized rats treated with tamoxifen plus treadmill exercise. Neuroscience. 2016;333:151–161. doi: 10.1016/j.neuroscience.2016.07.023. [DOI] [PubMed] [Google Scholar]
  • 8.Beare JE, Morehouse JR, DeVries WH, Enzmann GU, Burke DA, Magnuson DS, Whittemore SR. Gait analysis in normal and spinal contused mice using the treadscan system. J Neurotrauma. 2009;26(11):2045–2056. doi: 10.1089/neu.2009.0914. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Batka RJ, Brown TJ, Mcmillan KP, Meadows RM, Jones KJ, Haulcomb MM. The need for speed in rodent locomotion analyses. Anat Rec. 2014;297(10):1839–1864. doi: 10.1002/ar.22955. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Tarlov I. Spinal cord compression studies: III. Time limits for recovery after gradual compression in dogs. AMA Arch Neurol Psychiatry. 1954;71(5):588–597. doi: 10.1001/archneurpsyc.1954.02320410050004. [DOI] [PubMed] [Google Scholar]
  • 11.Rivlin AS, Tator CH. Objective clinical assessment of motor function after experimental spinal cord injury in the rat. J Neurosurg. 1977;47(4):577–581. doi: 10.3171/jns.1977.47.4.0577. [DOI] [PubMed] [Google Scholar]
  • 12.Basso DM, Beattie MS, Bresnahan JC. A sensitive and reliable locomotor rating scale for open field testing in rats. J Neurotrauma. 1995;12(1):1–21. doi: 10.1089/neu.1995.12.1. [DOI] [PubMed] [Google Scholar]
  • 13.Barros Filho TEPd, Molina AEIS. Analysis of the sensitivity and reproducibility of the Basso, Beattie, Bresnahan (bbb) scale in wistar rats. Clinics. 2008;63(1):103–108. doi: 10.1590/S1807-59322008000100018. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Hamers FP, Lankhorst AJ, van Laar TJ, Veldhuis WB, Gispen WH. Automated quantitative gait analysis during overground locomotion in the rat: its application to spinal cord contusion and transection injuries. J Neurotrauma. 2001;18(2):187–201. doi: 10.1089/08977150150502613. [DOI] [PubMed] [Google Scholar]
  • 15.Kunkel-Bagden E, Dai H-N, Bregman BS. Methods to assess the development and recovery of locomotor function after spinal cord injury in rats. Exp Neurol. 1993;119(2):153–164. doi: 10.1006/exnr.1993.1017. [DOI] [PubMed] [Google Scholar]
  • 16.Santos P, Williams S, Thomas S. Neuromuscular evaluation using rat gait analysis. J Neurosci Methods. 1995;61(1):79–84. doi: 10.1016/0165-0270(95)00026-Q. [DOI] [PubMed] [Google Scholar]
  • 17.Cheng H, Almström S, Giménez-Llort L, Chang R, Ögren SO, Hoffer B, Olson L. Gait analysis of adult paraplegic rats after spinal cord repair. Exp Neurol. 1997;148(2):544–557. doi: 10.1006/exnr.1997.6708. [DOI] [PubMed] [Google Scholar]
  • 18.Möller KÄ, Kinert S, Størkson R, Berge O-G. Gait analysis in rats with single joint inflammation: influence of experimental factors. PloS one. 2012;7(10):46129. doi: 10.1371/journal.pone.0046129. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.DEH K, Agrawal S, Pratap A, Meyarivan T A fast elitist non-dominated sorting genetic algorithm for multi-objective optimization: NSGA-II. In: Lecture notes in computer science. Berlin: Springer; 2000. p 849–858.
  • 20.Miller BL, Goldberg DE. Genetic algorithms, tournament selection, and the effects of noise. Complex Syst. 1995;9(3):193–212. [Google Scholar]
  • 21.Deb K, Goyal M. A combined genetic adaptive search (geneas) for engineering design. Comput Sci Inf. 1996;26:30–45. [Google Scholar]
  • 22.Aronov Boris, Har-Peled Sariel, Knauer Christian, Wang Yusu, Wenk Carola. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg; 2006. Fréchet Distance for Curves, Revisited; pp. 52–63. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

Not applicable


Articles from BioMedical Engineering OnLine are provided here courtesy of BMC

RESOURCES