Method for real-time analysis of spontaneous gait of mice in a narrow runway
By using a transparent narrow track, red and green light sources, and a high frame rate camera in combination with an improved YOLOv5 network, mouse gait parameters can be detected in real time, solving the problems of data redundancy and non-spontaneous movement in existing technologies, and achieving efficient mouse gait analysis.
Patent Information
- Application Number
- CN202211170673.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-09-23
AI Technical Summary
Existing technologies for analyzing mouse gait in narrow running tracks suffer from redundant data generation, insufficient data volume, and non-spontaneous mouse movement, resulting in wasted computer storage space and low experimental efficiency.
Using a transparent, narrow track, red and green light sources for illumination, a 100FPS high frame rate camera, and an improved YOLOv5 target detection network, the system can detect key points of mice in real time and calculate gait parameters, reducing the requirement for mice to run at a constant speed.
It enables real-time and accurate analysis of mouse gait parameters, reduces redundant data, improves experimental efficiency and data rigor, and is suitable for research on neuropathic pain and neurological diseases.
Smart Images

Figure CN115512439B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of machine vision and deep learning, and in particular to a real-time analysis method for mouse spontaneous gait in a narrow runway. BACKGROUND
[0002] Trauma or central nervous system lesions cause neuropathic pain, and the stimulation of touch can cause the body to behave accordingly. Mouse gene sequences have a high degree of similarity to humans, and play an important role in human behavioral research. Mice are placed in a narrow runway for spontaneous activity, with forward and backward movement as the main direction, making it easier to analyze mouse gait characteristics. The narrow space is more in line with the habits of mouse activity, and computer-aided analysis of gait characteristic parameters is more conducive to long-term observation and judgment.
[0003] Currently, computer-aided mouse gait analysis methods are based on recording mouse gait videos for gait feature analysis. This method has the following disadvantages:
[0004] (1) Long-time video recording produces a large amount of redundant data, wasting a large amount of computer storage space, and requiring manual selection of mouse video segments moving at a stable speed from one side of the runway to the other, which consumes a lot of effort and is not conducive to long-term observation.
[0005] (2) A small amount of data cannot well verify the correlation between gait characteristic parameters and speed.
[0006] (3) Based on platforms such as treadmills, mouse movement is not spontaneous.
[0007] Therefore, it is necessary to establish a real-time analysis method for mouse spontaneous gait in a narrow runway to analyze mouse gait characteristic parameters in real time. SUMMARY
[0008] The technical problem to be solved by the present application is to provide a real-time analysis method for mouse spontaneous gait in a narrow runway, which realizes long-time acquisition and analysis of gait parameters of mouse spontaneous behavior in a narrow environment, avoids the influence of accidental factors, improves the scientific nature of data, calculates the overall movement distance and speed of the mouse, the limb swing speed, the step length, the support time and swing time in a single cycle, and the support time ratio and other gait characteristic parameters, reduces the strict requirement for uniform speed running of the mouse, realizes real-time quantization and analysis of gait parameters of the mouse in the narrow runway, and has high application prospect and practical significance for the quantization research of gait parameters in behavioral experiments based on various characteristic models of mice.
[0009] To solve the above technical problems, the technical scheme adopted by the present application is:
[0010] A real-time analysis method for mouse spontaneous gait in a narrow runway, comprising the following steps:
[0011] Step 1, build a transparent narrow runway with a width sufficient for the mouse to move forward and backward, and place a plane mirror capable of completely reflecting the transparent narrow runway at 45° under the transparent narrow runway;
[0012] Step 2, place a narrow red background light source above the transparent narrow runway to provide illumination, so that the mouse is clearly distinguished from the background; use a narrow green runway light source to provide illumination on both sides of the transparent narrow runway to highlight the mouse's abdomen and footprint characteristics; use a high-frame-rate camera to acquire real-time mouse gait images reflected by the plane mirror and input them into a computer;
[0013] Step 3, build a target detection network model and train it, use the trained target detection network model to detect mouse targets and key points in each frame of image acquired by the high-frame-rate camera, and output mouse regression box coordinates and different key point coordinate information in real time, label them in the real-time picture of the main interface edited by LabVIEW to realize visualization;
[0014] Step 4, by calculating the coordinate relationship between the same key points between consecutive frames and the coordinate relationship between different key points within a single frame, the mouse gait parameters are quantified in real time and accurately.
[0015] 4, The further improvement of the technical scheme of the application is that in step 1, the top of the transparent narrow runway uses a transparent acrylic plate bonded with a diffusion plate as a background, and the bottom uses a transparent acrylic plate as a runway, with a length of 1200mm, a width of 100mm and a height of 200mm.
[0016] The further improvement of the technical scheme of the application is that in step 2, the frame rate of the high-frame-rate camera is 100FPS.
[0017] The further improvement of the technical scheme of the application is that in step 3, specifically, the network is improved based on YOLOv5 system, OKS loss function is introduced, the weighting factor of different mouse key points is modified, the target detection network model is constructed, the target detection network is trained using the pre-labeled mouse key point dataset, and the weight file is obtained;
[0018] According to the similarity of the key points of the mouse's four limbs, nose tip, mouth, abdomen and tail root, the weighting factor of different key points in the OKS loss function is modified, and the calculation formula of the OKS loss function is as follows:
[0019]
[0020] In the formula, d n represents the Euclidean distance between the predicted position and the true position of the nth key point, k na weighting factor representing the nth key point, s represents the scale of the current target, and δ(v n ) as a flag indicating whether each key point is visible.
[0021] Further improvements of the technical scheme of the present application are as follows: in step 4, the gait parameters include the overall moving distance of the mouse, the moving speed of the mouse, the limb swing speed, the step length, the support time in a single cycle, the swing time in a single cycle, and the support time ratio in a single cycle.
[0022] The overall moving distance D of the mouse is calculated according to the following formula:
[0023]
[0024] In the formula, G represents the conversion ratio of pixel distance to world distance, x n ,y n , x n-1 ,y n-1 represent the pixel coordinates of the center of the mouse trunk between the (n-1)th frame and the nth frame.
[0025] The moving speed V of the mouse is calculated according to the following formula:
[0026]
[0027] In the formula, D n represents the pixel distance of the trunk centroid coordinate movement between the (n-1)th frame and the nth frame, and ΔT represents the time interval between two consecutive frames.
[0028] Taking the swing speed V RF of the right front limb of the mouse as an example, the calculation formula is as follows:
[0029]
[0030] In the formula, x_RF n-1 , y_RF n-1 , x_RF n , y_RF n represent the pixel coordinates of the right front limb of the mouse between the (n-1)th frame and the nth frame; the swing speed calculation methods of the left front limb, the right rear limb, and the left rear limb are the same as formula (7).
[0031] Taking the step length L_RF n of the right front limb of the mouse as an example, the calculation formula is as follows:
[0032]
[0033] In the formula, x_RF n , y_RF n , x_RF' n , y_RF' nrecorded when the swing speed of the right forelimb is less than a threshold value V_thr twice RF coordinate positions;
[0034] the stance time T_stance of the right forefoot in a single gait cycle RF , and the calculation formula is as follows:
[0035] T_stance RF = n RF * ΔT (9)
[0036] In the formula, n RF represents the number of frames in which the right forelimb is stationary in a single gait cycle;
[0037] the swing time T_swing of the right forefoot in a single gait cycle RF , and the calculation formula is as follows:
[0038] T_swing RF = n' RF * ΔT (10)
[0039] In the formula, n' RF represents the number of frames in which the right forelimb swings in a single gait cycle;
[0040] the duty cycle DutyCycle in a single gait cycle, and the calculation formula is as follows:
[0041]
[0042] In the formula, T_stance RF is the stance time of the right forefoot in a single gait cycle, and T_swing RF is the swing time of the right forefoot in a single gait cycle.
[0043] Thanks to the above technical solutions, the present application has the following technical progress:
[0044] 1. The present application uses a non-invasive high-frame-rate camera to collect data in real time, places the mouse in a narrow runway, uses a high-frame-rate camera to improve the time resolution of gait characteristic parameters, and considers that the mouse lacks red-sensitive photoreceptor cells and the narrow runway environment, so a narrow red background plate is used to provide illumination and create an environment for the mouse to run spontaneously.
[0045] 2. The present application realizes more natural mouse gait data acquisition by acquiring mouse motion images and analyzing mouse gait information in real time, reduces the special requirements for the mouse to move stably forward, overcomes the demand in the prior art that the mouse runs at a stable speed from one end of the runway to the other end through a video gait analysis system, and significantly improves the experimental efficiency.
[0046] 3、The application is improved based on YOLOv5 system, according to the key point similarity of mouse limbs, nose tip, mouth, abdomen and tail root, the weighting factor of different key points in OKS loss function is modified, the function of simultaneously obtaining mouse regression frame and eight key point coordinate information of limbs, nose tip, mouth, abdomen and tail root is realized; compared with other key point detection networks, YOLOv5 network can significantly improve the real-time performance of mouse regression frame and key point detection of limbs under the condition of meeting the accuracy requirement, and compared with using traditional image processing method for gait analysis, the system robustness is significantly improved.
[0047] 4、The application obtains mouse regression frame coordinate parameters and eight key point coordinate parameters of limbs, nose tip, mouth, abdomen and tail root by using correlation algorithm, and rich coordinate parameters provide data support for subsequent mouse gait feature analysis.
[0048] 5、The application automatically distinguishes the moving and static behaviors of mice, records video when the mice run, and stops recording when the mice are static. Compared with other systems that analyze mouse gait by video, the efficiency is significantly improved, and a large amount of redundant data is avoided; it can be widely popularized in the field of mouse gait feature analysis. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor;
[0050] Figure 1 is a method flowchart in the embodiment of the application;
[0051] Figure 2 is a schematic diagram of the overall structure of the long and narrow runway in the embodiment of the application;
[0052] Figure 3 is a mouse key point real-time detection network structure diagram in the embodiment of the application;
[0053] Figure 4 is a LabVIEW editing main interface diagram in the embodiment of the application. DETAILED DESCRIPTION
[0054] It is to be understood that the terms "including", "comprising", "having" and "with" used in the specification and the aforementioned claims are used in the sense of "including" and are not used in the sense of "consisting of only" or "consisting of", for example, a process, method, system, product or apparatus that comprises a list of steps or elements as "including" but not limited to those specifically recited.
[0055] The application will be further described in detail below with reference to the accompanying drawings and examples:
[0056] As shown in the drawings, Figure 1 A real-time analysis method for spontaneous gait of mice in a narrow runway, the analysis method uses an analysis system including a narrow runway device module, a camera and light source module, a mouse key point real-time detection module and a gait feature parameter quantification module.
[0057] The narrow runway device module includes a transparent narrow runway designed with a width sufficient for the mouse to freely advance and retreat, and a plane mirror placed at 45° below the runway capable of completely reflecting the transparent narrow runway.
[0058] Further, the narrow runway device module includes a transparent narrow runway designed with a width sufficient for the mouse to freely advance and retreat, a plane mirror placed at 45° below the runway and a computer device. The mouse is placed in the transparent narrow runway, and in order to facilitate the high frame rate camera to obtain the mouse footprint image, the entire transparent narrow runway is built using transparent acrylic plates. In order to avoid the interference of the mouse non-linear running behavior on the experiment, the size of the transparent narrow runway is designed to be 1200mm*100mm*200mm, which is sufficient for the mouse to make a simple 180° turn and achieve free advance and retreat. Through the mirror reflection of the plane mirror placed at 45° below the runway, the high frame rate camera can obtain the mouse footprint information, and the computer device can control the image resolution and exposure time of the high frame rate camera and other parameter settings, real-time analyze the gait parameters in the image, and simultaneously quantify the gait features. The original data is archived by recording the video method.
[0059] The camera and light source module includes a high frame rate camera (frame rate is 100Hz), a narrow red background light source and a narrow green runway light source.
[0060] Further, the transparent narrow runway shape is special, and a specific size of narrow light guide plate is made as a background plate by bonding an acrylic plate and a diffusion plate. Considering that mice lack red-sensitive photoreceptor cells, a red light source is used to illuminate the longer side of the acrylic plate to make a narrow red background light source. In order to highlight the mouse footprint information, a green fluorescent light bulb is used to illuminate the longer side of the bottom acrylic plate to make a narrow green runway light source according to the principle of total internal reflection of the acrylic plate, so as to obtain clear paw print information. Select a light source with adjustable brightness, and the temperature of the narrow runway is stable at 21-25℃. In order to improve the resolution of the system, the frame frequency of the high frame frequency camera is 100FPS, the focal length of the lens is 6mm, and the relative aperture is 1:1.2. The image of the mouse paw print is acquired and transmitted to the computer.
[0061] The mouse key point real-time detection module is based on the YOLOv5 system to improve the network, introduce the OKS loss function, modify the weighting factor of different mouse key points to construct a target detection network model, use a pre-labeled mouse key point dataset to train the target detection network, and obtain a weight file; using the trained target detection network model, the mouse target detection and key point regression are performed on each frame of image acquired by the high frame frequency camera, and the regression box coordinates and four limbs, nose tip, mouth, abdomen and tail root key point coordinate information of the mouse are output in real time;
[0062] Further, the mouse key point real-time detection module includes improving the network based on the YOLOv5 system, introducing the OKS loss function, modifying the weighting factor of different key points in the OKS loss function according to the similarity of the mouse four limbs, nose tip, mouth, abdomen and tail root key points, using the trained target detection network model to perform mouse target detection and key point regression on each frame of image acquired by the camera, and outputting the regression box coordinates and four limbs, nose tip, mouth, abdomen and tail root key point coordinate information of the mouse in real time. YOLOv5 is a single-stage target detection network with short inference time, which can meet the real-time detection requirements. Some frames are randomly extracted from the video for mouse target box labeling and key point labeling. The labeled images are input into the algorithm for training to obtain a weight file. Finally, the images acquired by the high frame frequency camera are input into the network, and the network simultaneously outputs the regression box coordinates of the mouse and the coordinate parameters of the four limbs, nose tip, mouth, abdomen and tail root key points in real time. At the same time, the program main interface real-time picture is labeled to realize visualization.
[0063] The gait feature parameter quantification module includes quantifying gait parameters according to the regression box coordinates and key point coordinates of the mouse, and analyzing the gait characteristics of the mouse.
[0064] Further, the mouse gait characteristic parameter quantification module quantifies the mouse gait characteristic parameters by calculating the sum of the coordinates of the same key points between consecutive frames and the relationship between the coordinates of different key points within a single frame. This module can accurately quantify various gait parameters of the mouse, including the overall movement distance of the mouse, the movement speed of the mouse, the limb swing speed, the step length, the support time in a single cycle, the swing time in a single cycle, and the support time ratio in a single cycle, etc.
[0065] The technical solutions of the application will be further described below through specific embodiments.
[0066] As shown in the drawings, Figure 1 A real-time analysis method for spontaneous gait of mice in a narrow runway includes the following steps:
[0067] Step 1: Build a transparent narrow runway with a width sufficient for the mouse to move forward and backward, and place a plane mirror capable of completely reflecting the transparent narrow runway at 45° below the runway;
[0068] Specifically, as shown in the drawings, Figure 2 The top of the transparent narrow runway is provided with a narrow light guide plate made of acrylic plate and diffusion plate, and a red light source with adjustable brightness is used for illumination. A green fluorescent bulb is used to illuminate from the longer side of the bottom acrylic plate to obtain clear footprint information. In a dark room, when the mouse is in the narrow runway, the footprint image is reflected to the lens by the mirror placed at 45° below the runway.
[0069] Step 2: Place a narrow red background light source above the transparent narrow runway to provide illumination, so that the mouse is clearly distinguished from the background; use a narrow green runway light source on both sides of the transparent narrow runway to provide illumination and highlight the mouse's abdomen and footprint features; use a high-frame-rate camera to acquire real-time mouse gait images reflected by the plane mirror and input them into a computer;
[0070] Specifically, the industrial camera is installed at a distance of 700 mm from the mirror, the lens focal length is 6 mm, the relative aperture is 1:1.2, wide-angle image acquisition is achieved, the resolution of the industrial camera is 1280x1024, the frame rate is 100 frames / s, and when acquiring images, the lens angle is adjusted to include the entire narrow runway in the image, and the focal length, aperture, depth of field, and exposure time are adjusted to achieve clear imaging. The computer device mainly controls the brightness of the backlight plate, the parameter setting of the industrial camera, image recording, and real-time analysis of gait parameters.
[0071] Step 3: Build a target detection network model and train it, use the trained target detection network model to detect the mouse target and regress the key points for each frame of image acquired by the high-frame-rate camera, and output the regression box coordinates and coordinate information of different key points of the mouse in real time, label them in the real-time picture of the main interface edited by LabVIEW, and realize visualization;
[0072] In particular, as Figure 3As shown in the figure, the mouse key point real-time detection network structure diagram outputs the mouse regression box coordinates and eight key point coordinate parameters of the limbs, nose tip, mouth, abdomen and tail root according to the input image. First, 2000 frames of images are randomly extracted from the video, and the target box and eight key points of the mouse, including limbs, nose tip, mouth, abdomen and tail root, are marked. Among them, 1750 are used as the training set and 250 are used as the test set. After labeling, the image is input into the network model for training. YOLO is a single-stage target detection network with short inference time, which can meet the real-time detection requirements. The YOLOv5 network structure with shorter inference time and high accuracy is used as the basis for modification. The scaling size is set to 640*640*3. The scaled image is input into the backbone network part, which is convolved by a 3*3 convolution kernel with a channel of 32 and a step of 2. The output is sent to a 3*3 max pooling layer with a step of 2 and two convolution kernels with a channel of 16 and 8 respectively, a step of 1 and a size of 1*1 for continuous convolution operation. The outputs after pooling and two convolution are combined, and finally a convolution kernel with a channel of 32, a step of 1 and a size of 1*1 is used to output a feature map with a size of 320*320*64, complete the downsampling operation and realize the lightweight improvement of YOLOv5 network.The feature map is input into a bottleneck layer with an output channel number of 64 and a structure number of 1, and a feature map with an output size of 320*320*64 is output. After passing through a convolution layer with a channel number of 128, a step length of 2, and a size of 3*3, and a bottleneck layer with an output channel number of 128 and a structure number of 3, a feature map with a size of 160*160*128 is obtained. After passing through a convolution layer with a channel number of 256, a step length of 2, and a size of 3*3, and a bottleneck layer with an output channel number of 256 and a structure number of 3, a feature map with an output size of 80*80*256 is output. After passing through a convolution layer with a channel number of 512, a step length of 2, and a size of 3*3, spatial pyramid pooling with sizes of 3*3, 5*5, and 7*7, and a bottleneck layer with an output channel number of 512 and a structure number of 1, a feature map with an output size of 40*40*512 is output. The feature map is input into a convolution kernel with a channel number of 256, a step length of 1, and a size of 1*1, and up-sampling, and a feature map with an output size of 80*80*256 is output. The feature map is spliced with a feature map output by a bottleneck layer with an output channel number of 256 and a structure number of 3 in the depth direction, and a feature map with an output size of 80*80*512 is output. After passing through a bottleneck layer with an output channel number of 256 and a structure number of 1, a feature map with an output size of 80*80*256 is output. The feature map is input into a convolution kernel with a channel number of 128, a step length of 1, and a size of 1*1, and up-sampling, and a feature map with an output size of 160*160*128 is output. The feature map is spliced with a feature map output by a bottleneck layer with an output channel number of 128 and a structure number of 3 in the depth direction, and a feature map with an output size of 160*160*256 is output. After passing through a bottleneck layer with an output channel number of 128 and a structure number of 1, a feature map with an output size of 160*160*128 is output. After passing through a convolution layer with a channel number of 128, a step length of 2, and a size of 3*3, a feature map with an output size of 80*80*128 is output. The feature map is spliced with a feature map output by a convolution layer with a channel number of 128, a step length of 1, and a size of 1*1 in the depth direction, and a feature map with an output size of 80*80*256 is output after passing through a bottleneck layer with an output channel number of 256 and a structure number of 1. After passing through a convolution layer with a channel number of 256, a step length of 2, and a size of 3*3, a feature map with an output size of 40*40*256 is obtained. The feature map is spliced with a feature map output by a convolution layer with a channel number of 256, a step length of 1, and a size of 1*1 in the depth direction, and a feature map with an output size of 40*40*512 is output after passing through a bottleneck layer with an output channel number of 512 and a structure number of 1. The output channel number n is defined. o , the target category number is n c , the key point number is n p , the output channel number is defined as n o = n c + 5 + 2*n pThe output feature maps from bottleneck layers with 128 output channels and 1 structure, 256 output channels and 1 structure, and 512 output channels and 1 structure are fed into convolutional layers with 66 output channels, a stride of 1, and a size of 1x1. Each frame outputs four positional coordinates of the bounding box, category information, confidence score, and 16 keypoint coordinates. The network is trained using an adaptive gradient optimization algorithm with an initial learning rate of 0.001 and an exponential decay rate of 0.98. A target keypoint similarity loss function (OKS) is introduced into the YOLOv5 network for keypoint loss calculation. Based on the keypoint similarity of the mouse's limbs, nose tip, mouth, abdomen, and tail root, the weighting factors for different keypoints in the OKS loss function are modified. The OKS loss function calculation formula is as follows:
[0073]
[0074] In the formula, d n k represents the Euclidean distance between the predicted and actual positions of the nth keypoint. n Let δ(v) represent the weighting factor of the nth keypoint, s represent the scale of the current target, and δ(v) represent the weighting factor of the nth keypoint. n This serves as a marker indicating whether each key point is visible.
[0075] The process iterates 10,000 times to obtain training weights. Real-time images acquired by an industrial camera are transmitted into the network, and the coordinate parameters of the mouse bounding box and the coordinate parameters of eight key points are directly output. At the same time, annotations are made on the real-time screen of the main program interface to achieve visualization.
[0076] Step 4: By calculating the coordinate relationships of the same key points between consecutive frames and the coordinate relationships of different key points within a single frame, multiple gait parameters of the mouse are quantified in real time and accurately.
[0077] Specifically, such as Figure 4 As shown, the gait feature parameter quantification module acquires mouse gait feature parameters by calculating the coordinate relationships of the same key points between consecutive frames and the coordinate relationships of different key points within a single frame. This module can accurately acquire various gait parameters of the mouse, including the overall movement distance, movement speed, stride length, support time within a single cycle, swing time within a single cycle, and support time ratio within a single cycle, etc. The method for calculating the overall movement distance of the mouse involves placing a rectangular reference object with length and width of a mm and b mm in a narrow track. The pixel coordinates of the upper left corner of the rectangle are (m0, n0), and the pixel coordinates of the lower right corner are (m1, n1). The conversion ratio G between pixel distance and world distance is calculated, expressed as:
[0078]
[0079] Let the pixel coordinates of the center of the mouse trunk between the (n-1)th frame and the nth frame be A(x n-1 , y n-1 ) and B(x n , y n ), respectively. The pixel distance D n moved by the center of the trunk between the (n-1)th frame and the nth frame is calculated, and is represented as:
[0080]
[0081] The actual distance D of the overall movement of the mouse is obtained by continuously accumulating, and is represented as:
[0082]
[0083] The method for determining the moving speed of the mouse is that the time interval between two consecutive frames is ΔT, and the moving speed V of the mouse is calculated, and is represented as:
[0084]
[0085] In order to obtain the gait parameters with obvious characteristics, the mouse video data is further divided into four categories for storage, namely, static (speed less than 100 mm / s), low speed (speed between 100-200 mm / s), medium speed (speed between 200-280 mm / s), and high speed (above 280 mm / s). The speed maintained for more than 0.5 seconds is considered as valid stable data, and the data at that time is recorded. The method for calculating the moving distance of the four limbs of the mouse is taken the right front limb as an example. Let the pixel coordinates of the right front limb of the mouse between the (n-1)th frame and the nth frame be RF(x_RF n-1 , y_RF n-1 ) and RF(x_RF n , y_RF n ), respectively, and the speed threshold V_thr RF = 0.01 m / s. The behavior of the right rear limb placed on the ground of the narrow runway is determined, the pixel distance D_RF n moved by the right front limb of the mouse between the (n-1)th frame and the nth frame is calculated, and is represented as:
[0086]
[0087] The moving speed V RF of the right front limb of the mouse is calculated, and is represented as:
[0088] V RF = G*D_RF n / ΔT (7)
[0089] When V RF is less than the set speed threshold V_thr RFIt is considered that the right hind limb is placed on the narrow runway ground, the current coordinate position RF(x_RF n , y_RF n ) is stored in Landmarks RF (x_RF n , y_RF n , 1), otherwise, it is stored in Landmarks RF (x_RF n , y_RF n , 0), when V RF is less than the set speed threshold V_thr RF again, the coordinate position RF'(x_RF' n , y_RF' n ) at this time is calculated, and the step length L_RF n is obtained, which is expressed as:
[0090]
[0091] The calculation method of the support time in a single cycle, the swing time in a single cycle and the support time ratio in a single cycle of the mouse is taken as an example, the frame number of Landmarks RF marked as 1 in a single gait cycle is n RF , and the support time of the right forefoot in a single cycle is T_support , which is expressed as:
[0092]
[0093] The frame number of Landmarks RF marked as 1 in a single gait cycle is n' RF , and the swing time T_swing RF of the right forefoot in a single cycle is expressed as:
[0094] T_swing RF = n' RF * ΔT (10)
[0095] The support time ratio DutyCycle in a single cycle is expressed as:
[0096]
[0097] Through the obtained gait characteristic parameters, quantitative research can be carried out on animal models of nerve trauma, nerve diseases and pain symptom groups, and the problems of weak spontaneity and lack of real-time of mouse gait can be solved.
[0098] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for real-time analysis of spontaneous gait in mice in a narrow runway, characterized by: The method comprises the following steps: Step 1, a transparent narrow runway with a width sufficient for the mouse to freely advance and retreat is built, and a plane mirror capable of completely reflecting the transparent narrow runway is placed at 45° below the transparent narrow runway; Step 2, a narrow red background light source is placed above the transparent narrow runway to provide illumination, so that the mouse is clearly distinguished from the background; a narrow green runway light source is used to provide illumination on both sides of the transparent narrow runway, highlighting the mouse abdomen and footprint characteristics; A high-frame-rate camera is used to acquire mouse gait images reflected by the plane mirror in real time and input into a computer; Step 3, a target detection network model is constructed and trained, and the trained target detection network model is used to detect the mouse target and regress the key points of each frame of image acquired by the high-frame-rate camera, to output the regression box coordinates of the mouse and the coordinate information of different key points in real time, and to mark the real-time picture in the main interface edited by LabVIEW, so as to realize visualization; Specifically, the network is improved based on YOLOv5 system, an OKS loss function is introduced, the weighting factors of different mouse key points are modified, a target detection network model is constructed, a mouse key point data set pre-labeled is used to train the target detection network, and a weight file is obtained; According to the similarity of the key points of the mouse limbs, nose tip, mouth, abdomen and tail root, the weighting factors of different key points in the OKS loss function are modified, and the calculation formula of the OKS loss function is as follows: In the formula, d n represents the Euclidean distance between the predicted position and the real position of the nth key point, k n represents the weighting factor of the nth key point, s represents the scale of the current target, and δ(v n ) is a flag indicating whether each key point is visible. Step 4, by calculating the coordinate relationship between the same key points between consecutive frames and the coordinate relationship between different key points within a single frame, the mouse multiple gait parameters are quantified in real time and accurately.
2. The method for real-time analysis of spontaneous gait of mice in a narrow runway according to claim 1, characterized in that: In step 1, the top of the transparent narrow runway is bonded with a transparent acrylic plate and a diffusion plate as a background, and the bottom is a transparent acrylic plate as a runway, with a length* width* height of 1200mm*100mm*200mm.
3. The method according to claim 1, wherein the method is characterized by: In step 2, the frame rate of the high-frame-rate camera is 100FPS.
4. The method for real-time analysis of spontaneous gait of mice in a narrow runway according to claim 1, characterized in that: In step 4, the gait parameters include the overall movement distance of the mouse, the movement speed of the mouse, the limb swing speed, the step length, the support time in a single cycle, the swing time in a single cycle and the support time ratio in a single cycle; The calculation formula of the overall movement distance D of the mouse is as follows: where G represents the conversion ratio of pixel distance to world distance, x n ,y n ,x n-1 ,y n-1 represents the pixel coordinates of the center of the mouse trunk between the n-1th frame and the nth frame. The calculation formula of the movement speed V of the mouse is as follows: In the formula, D n represents the pixel distance of the trunk centroid coordinate movement between the n-1th frame and the n th frame, and ΔT represents the time interval between two continuous frames. The swing speed V of the mouse's right forelimb RF For example, the calculation formula is as follows: In the formula, x_RF n-1 y_RF n-1 x_RF n y_RF n represents the pixel coordinates of the right forelimb of the mouse between the n-1th frame and the nth frame; the swing speed calculation method of the left forelimb, the right hind limb, and the left hind limb is the same as formula (7); Using the stride length L_RF of the mouse's right forelimb n For example, the calculation formula is as follows: where x_RF n ,y_RF n ,x_RF n ′ ,y_RF n ′ is the coordinate position recorded when the speed of the right front leg is less than the threshold value V_thr RF for two consecutive right front leg swing. Support time T stance of the right foreleg in a single cycle RF The calculation formula is as follows: T stance RF = n RF * ΔT (9) wherein n RF represents the number of frames in which the right forelimb is stationary during a single gait cycle; Right foreleg swing time T_swing in a single cycle RF The calculation formula is as follows: T_swing RF = n ′ RF *ΔT (10) wherein n ′ RF represents the number of frames in which the right forelimb swings in a single gait cycle; The calculation formula of the support time ratio DutyCycle in a single cycle is as follows: In the formula, T stance RF is the stance time of the right foreleg in a single cycle, T swing RF is the swing time of the right foreleg in a single cycle.
Citation Information
Patent Citations
Video pedestrian re-identification method based on human body part learning and posture reconstruction
CN113807189A
Mouse video motion behavior analysis method in narrow space
CN114494957A