Method for training gait recognition model, gait recognition method and related device
Patent Information
- Application Number
- CN202310547846.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-05-15
AI Technical Summary
然而,目前主要采用一些传感器设置于足底,对异常步态进行检测,准确率较低
[0042] The beneficial effects of this application's embodiments are as follows: Unlike existing technologies, the method for training a panicked gait recognition model provided in this application first acquires multiple gait samples. These samples include acceleration and angular velocity signal waves collected by an inertial measurement unit (IMU) from the walking steps of the feet. Each gait sample is labeled with either a panicked gait or a normal gait. Based on the periodicity of the gait samples, they are divided into multiple gait periodic bands. Using these divided gait periodic bands, a binary classification algorithm model is iteratively trained to obtain a panicked gait recognition model. In this embodiment, each gait sample is divided according to its periodicity, ensuring that each obtained gait periodic band reflects the motion data of a complete step and conforms to the walking cycle. Therefore, by using these gait periodic bands to train the binary classification algorithm model, the resulting panicked gait recognition model, based on the analysis and mining of the potential features of each gait periodic band, can accurately identify panicked gait. Furthermore, deploying this panicked gait recognition model on electronic devices such as microcontrollers can effectively reduce computational burden, decrease data transmission latency, enable real-time detection and recognition, improve algorithm accuracy, and enhance model robustness and generalization ability.
Smart Images

Figure CN116682171B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gait recognition technology, and in particular to a method for training a panicked gait recognition model, a gait recognition method, and related apparatus. Background Technology
[0002] Parkinson's disease is a chronic neurological disorder that commonly affects the elderly. In the early stages of the disease, gait abnormalities are mainly manifested in changes in stride length and walking rhythm. Festinating gait is one of the most typical and unique gait disturbances in Parkinson's patients. Festinating gait is characterized by slight flexion of the hip and knee joints throughout the gait cycle, a forward shift of the center of gravity, a downward tilt of the neck, reduced upper limb swing, and a small, short stride length with the toes or the entire foot striking the ground during each step. The initial movement is slow, gradually accelerating towards a point of near collapse. As the disease progresses, it gradually develops into frozen gait. Frozen gait is more common in the middle and late stages of the disease and is mainly characterized by transient stagnation of movement, difficulty lifting the foot, and difficulty taking a step.
[0003] Parkinson's disease often has insidious onset in its early stages, making it difficult to detect. Many patients are diagnosed only when the disease has progressed to the middle stage, making early detection crucial. However, current methods primarily rely on sensors placed on the soles of the feet to detect abnormal gait, which have relatively low accuracy. Summary of the Invention
[0004] The main technical problem solved by the embodiments of this application is to provide a method for training a panicked gait recognition model, a gait recognition method and related apparatus, and the trained panicked gait recognition model can accurately identify panicked gait.
[0005] In a first aspect, embodiments of this application provide a method for training a panicked gait recognition model, including:
[0006] Multiple gait samples were acquired. The gait samples included acceleration signal waves and angular velocity signal waves obtained by the inertial measurement unit from the walking steps of the feet. Each gait sample was labeled with a tag, which included panicked gait or normal gait.
[0007] Based on the periodicity of the gait samples, the gait samples are divided to obtain multiple gait periodic bands;
[0008] By using several gait periodic bands obtained from the division, the binary classification algorithm model is iteratively trained to obtain the panicked gait recognition model.
[0009] In some embodiments, the gait samples are divided according to their periodicity to obtain multiple gait periodic bands, including:
[0010] Obtain the peak of the acceleration signal wave in the direction of motion;
[0011] Based on each wave peak, determine the start and end indices of each gait cycle wave band;
[0012] Based on the start and end indices of each gait periodic band, the gait samples are truncated to obtain multiple gait periodic bands.
[0013] In some embodiments, determining the start and end indices of each gait cycle band based on each peak includes:
[0014] Slide the middle position of the sliding window to each wave crest in sequence, and determine the start and end indices of the step-state periodic waveband based on the target waveband covered by the sliding window located at a wave crest.
[0015] In some embodiments, determining the start and end indices of a step-state periodic band based on the target band covered by a sliding window located at a wave crest includes:
[0016] For the target band, perform first-order difference processing to obtain the difference sequence;
[0017] Based on the difference sequence, determine the index corresponding to the first stationary band to the left of the peak in the target band, and determine the starting index of the gait cycle band based on the index corresponding to the first stationary band.
[0018] Based on the difference sequence, determine the index of the second stationary band located to the right of the peak in the target band, and then determine the end index of the gait cycle band based on the index of the second stationary band.
[0019] In some embodiments, determining the index corresponding to the first stationary band to the left of the peak in the target band based on the difference sequence includes:
[0020] The indices whose absolute values in the difference sequence located to the left of the peak are less than or equal to a preset threshold are selected as the first candidate index set.
[0021] The k consecutive indices in the first candidate index set are used as the indices corresponding to the first stationary band.
[0022] In some embodiments, determining the start index of the gait cycle band based on the index corresponding to the first stationary band includes:
[0023] Based on the index corresponding to the first stationary band, determine the first stationary band from the target band; obtain the maximum value of the signal value in the first stationary band, and use the index corresponding to the maximum value as the starting index of the gait period band.
[0024] In some embodiments, the aforementioned determination of the index corresponding to the second stationary band located to the right of the peak in the target band based on the difference sequence, and the determination of the end index of the gait cycle band based on the index corresponding to the second stationary band, includes:
[0025] The indices whose absolute values in the difference sequence located to the right of the peak are less than or equal to a preset threshold are selected as the second candidate index set.
[0026] The g consecutive indices in the second candidate index set are used as the indices corresponding to the second stationary band;
[0027] Based on the index corresponding to the second stationary band, the second stationary band is determined from the target band. The minimum value of the signal in the second stationary band is obtained, and the index corresponding to the minimum value is used as the end index of the gait period band.
[0028] In some embodiments, before the aforementioned step of iteratively training the binary classification algorithm model using several gait periodic bands to obtain the panicked gait recognition model, the method further includes:
[0029] Adjust the length of each gait cycle band to the target length.
[0030] In some embodiments, adjusting the length of each gait cycle band to a target length includes:
[0031] Linear interpolation is used to adjust the length of each gait cycle band to the target length.
[0032] In some embodiments, before the aforementioned step of dividing the gait samples according to their periodicity to obtain multiple gait periodic bands, the method further includes:
[0033] The gait samples were normalized.
[0034] Secondly, this application provides a gait recognition method, including:
[0035] Acquire test gait samples, which include acceleration and angular velocity signal waves obtained by the inertial measurement unit from the walking steps of the feet;
[0036] Based on the periodicity of the test gait samples, the test gait samples are divided to obtain multiple test gait periodic bands;
[0037] Multiple test gait periodic bands are input into the panic gait recognition model, which outputs the gait category of each step. The panic gait recognition model is trained using the method described in the first aspect.
[0038] Thirdly, this application provides an electronic device, including:
[0039] At least one processor; and
[0040] A memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, the instructions being executed by at least one processor to enable at least one processor to perform the method of the first aspect.
[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing a computer device to perform the method of the first aspect.
[0042] The beneficial effects of this application's embodiments are as follows: Unlike existing technologies, the method for training a panicked gait recognition model provided in this application first acquires multiple gait samples. These samples include acceleration and angular velocity signal waves collected by an inertial measurement unit (IMU) from the walking steps of the feet. Each gait sample is labeled with either a panicked gait or a normal gait. Based on the periodicity of the gait samples, they are divided into multiple gait periodic bands. Using these divided gait periodic bands, a binary classification algorithm model is iteratively trained to obtain a panicked gait recognition model. In this embodiment, each gait sample is divided according to its periodicity, ensuring that each obtained gait periodic band reflects the motion data of a complete step and conforms to the walking cycle. Therefore, by using these gait periodic bands to train the binary classification algorithm model, the resulting panicked gait recognition model, based on the analysis and mining of the potential features of each gait periodic band, can accurately identify panicked gait. Furthermore, deploying this panicked gait recognition model on electronic devices such as microcontrollers can effectively reduce computational burden, decrease data transmission latency, enable real-time detection and recognition, improve algorithm accuracy, and enhance model robustness and generalization ability. Attached Figure Description
[0043] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0044] Figure 1 This is a schematic diagram of the gait recognition system in some embodiments of this application;
[0045] Figure 2 This is a schematic diagram of the structure of an electronic device in some embodiments of this application;
[0046] Figure 3This is a flowchart illustrating the method for training a panicked gait recognition model in some embodiments of this application;
[0047] Figure 4 This is a schematic diagram of the normalized gait period bands in some embodiments of this application;
[0048] Figure 5 This is a schematic diagram of the acceleration signal wave in the direction of motion in some embodiments of this application;
[0049] Figure 6 This is a flowchart illustrating the gait recognition method in some embodiments of this application. Detailed Implementation
[0050] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. In addition, the terms "first," "second," and "third" used herein do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0053] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0054] Furthermore, the technical features involved in the various embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0055] To facilitate understanding of the methods provided in the embodiments of this application, the terms used in the embodiments of this application will first be introduced:
[0056] (1) Neural Network
[0057] A neural network can be composed of neural units, specifically understood as a neural network with input layers, hidden layers, and output layers. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. Neural networks with many hidden layers are called deep neural networks (DNNs). The work of each layer in a neural network can be described by the mathematical expression y = a(W·x + b). From a physical perspective, the work of each layer in a neural network can be understood as transforming the input space (the set of input vectors) to the output space (i.e., from the row space to the column space of a matrix) through five operations on the input space: 1. Dimensionality increase / decrease; 2. Magnification / scaling; 3. Rotation; 4. Translation; 5. "Bending". Operations 2 and 3 are performed by "W·x", operation 4 by "+b", and operation 5 by "a()". The term "space" is used here because the objects being classified are not individual things, but a class of things; space refers to the set of all individuals within that class. W is the weight matrix of each layer in the neural network, where each value represents the weight of a neuron in that layer. This matrix W determines the spatial transformation from the input space to the output space, as described above; that is, the W of each layer of the neural network controls how the space is transformed. The purpose of training the neural network is to ultimately obtain the weight matrices of all layers of the trained neural network. Therefore, the training process of a neural network is essentially learning how to control spatial transformation, more specifically, learning the weight matrix.
[0058] It should be noted that in the embodiments of this application, the models used for machine learning tasks are essentially neural networks. Common components in neural networks include convolutional layers, pooling layers, and normalization layers. By assembling these common components in neural networks, a model is designed. When the model parameters (weight matrices of each layer) are determined so that the model error meets a preset condition or the number of model parameters is adjusted to reach a preset threshold, the model converges.
[0059] Before introducing the embodiments of this application, a brief introduction to gait recognition methods known to the inventors of this application will be given to facilitate the understanding of the embodiments of this application.
[0060] In some solutions, gait detection sensors are used to detect a patient's gait. A time-domain analysis module then analyzes the detected signal to obtain time-domain indices, and a frequency-domain analysis module analyzes the signal to obtain frequency-domain indices. A frequency-domain calculation module determines the patient's gait based on the obtained frequency-domain indices and outputs the frequency-domain judgment result when an abnormal gait is detected. The time-domain calculation module, based on the time-domain indices obtained from the time-domain analysis module and preset parameters, determines the patient's gait and outputs the abnormal gait detection result in real time, ensuring high real-time performance. A correction module generates a correction factor based on the calculation results from the time-domain and frequency-domain calculation modules to correct the preset parameters of the time-domain calculation module. This allows the time-domain calculation module to correct the preset parameters according to the correction factor, thereby improving the accuracy of the output from the time-domain calculation module and meeting the detection requirements.
[0061] In this approach, manually setting the threshold results in low accuracy. Furthermore, when the feature space has high dimensionality, threshold adjustment becomes extremely cumbersome, leading to a lack of accuracy in gait detection.
[0062] To address the aforementioned problems, this application provides a method for training a panicked gait recognition model. First, multiple gait samples are acquired, including triaxial acceleration and angular velocity signal waves collected by an inertial measurement unit (IMU) from the walking steps of the feet. Each gait sample is labeled with either "panicked gait" or "normal gait." Based on the periodicity of the gait samples, they are divided into multiple gait periodic bands. Using these divided gait periodic bands, a binary classification algorithm model is iteratively trained to obtain the panicked gait recognition model. In this embodiment, each gait sample is divided according to its periodicity, ensuring that each obtained gait periodic band reflects the motion data of a complete step and conforms to the walking cycle. Therefore, by using these gait periodic bands to train the binary classification algorithm model, the resulting panicked gait recognition model, based on the analysis and mining of the potential features of each gait periodic band, can accurately identify panicked gait. Furthermore, deploying this panicked gait recognition model on electronic devices such as microcontrollers can effectively reduce computational burden, decrease data transmission latency, enable real-time detection and recognition, improve algorithm accuracy, and enhance model robustness and generalization ability.
[0063] The following describes exemplary applications of the electronic devices provided in this application for training a panicked gait recognition model or for gait recognition. The electronic devices provided in this application may be servers, such as servers deployed in the cloud. Some embodiments of this application may provide electronic devices of various types, such as laptops, desktop computers, or mobile devices.
[0064] As an example, see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of the gait recognition system provided in this embodiment. Terminal 10 connects to server 20 via a network, which can be a wide area network (WAN), a local area network (LAN), or a combination of both.
[0065] Terminal 10 can be used to acquire training data and build a binary classification model. For example, those skilled in the art can download prepared training data to the terminal and build the network structure of the binary classification model. The training data includes several gait samples reflecting foot walking steps. It is understood that terminal 10 can also be used to acquire test samples. For example, the inertial measurement unit (IMU) sends the collected test data to terminal 10, thereby allowing terminal 10 to acquire the test data. In some embodiments, when terminal 10 is used to detect gait, terminal 10 can be integrated with the IMU. In some embodiments, terminal 10 is configured as a device worn on the foot, integrating the IMU, thereby wearing the IMU on the foot. After the IMU acquires the test data, it sends it to the microcontroller in terminal 10, whereby the microcontroller uses a built-in panicked gait recognition model to detect the test data and acquire the detection results. In this embodiment, the entire device has a simple structure, is lightweight, easy to wear, and can be used outdoors or indoors. In some embodiments, the device is also connected to a mobile terminal (such as a smartphone or tablet) and sends the results of the frantic gait detection to the mobile terminal in real time, facilitating daily monitoring of gait abnormalities.
[0066] In some embodiments, terminal 10 locally executes the method for training a panicked gait recognition model provided in this application embodiment to train a pre-designed binary classification model using training data, determine the final model parameters, and then configure the binary classification model with the final model parameters to obtain the panicked gait recognition model. In some embodiments, terminal 10 may also send training data and a pre-constructed binary classification model stored on the terminal by those skilled in the art to server 20 via a network. Server 20 receives the training data and the binary classification model, trains the binary classification model using the training data, determines the final model parameters, and then sends the final model parameters to terminal 10. Terminal 10 saves the final model parameters, and the binary classification model is configured with the final model parameters to obtain the panicked gait recognition model.
[0067] The structure of the electronic device in the embodiments of this application is described below. Figure 2This is a schematic diagram of the structure of an electronic device 500 in an embodiment of this application. The electronic device 500 includes at least one processor 510 and a memory 550. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 2 The general labeled all buses as Bus System 540.
[0068] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0069] Memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory. Memory 550 may optionally include one or more storage devices physically located away from processor 510.
[0070] In some embodiments, memory 550 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, as illustrated below. Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks; network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0071] In some embodiments, the electronic device further includes an inertial measurement unit (IMU). The electronic device is wearable or can be placed on the user's foot. After acquiring test data, the IMU sends it to a processor, which then calls a panicked gait recognition model stored in its memory to detect the test data and obtain the detection results. In this embodiment, the electronic device has a simple and lightweight structure, is easy to wear, and can be used outdoors or indoors. In some embodiments, the electronic device also communicates with a mobile terminal (e.g., a smartphone or tablet), and sends the panicked gait detection results to the mobile terminal in real time, facilitating daily monitoring of gait abnormalities.
[0072] As can be understood from the above, the method for training a panicked gait recognition model provided in this application embodiment can be implemented by various types of electronic devices with processing capabilities, such as being executed by the processor of an electronic device or by other devices with computing capabilities. Other devices with computing capabilities can be smart terminals or servers that are communicatively connected to the electronic device.
[0073] The following describes the method for training a panicked gait recognition model provided in this application, using exemplary applications and implementations of the electronic devices provided in the embodiments of this application. Please refer to... Figure 3 , Figure 3 This is a flowchart illustrating the method for training a panicked gait recognition model provided in an embodiment of this application. It is understood that the execution entity of this training method can be one or more processors of an electronic device.
[0074] Please refer to it again. Figure 3 The method S100 may specifically include the following steps:
[0075] S10: Obtain multiple gait samples.
[0076] The gait samples include triaxial acceleration signal waves and triaxial angular velocity signal waves obtained by inertial measurement units collecting walking steps of the feet. The gait samples are labeled with tags, including panicked gait or normal gait.
[0077] In some embodiments, the inertial measurement unit includes a three-axis accelerometer and a three-axis gyroscope, which can acquire acceleration signals and angular velocity signals of a moving object along the x, y, and z axes, respectively. In some embodiments, one inertial measurement unit is positioned on the left foot and one inertial measurement unit is positioned on the right foot, thereby acquiring acceleration and angular velocity signals of the left foot along the x, y, and z axes, and acceleration and angular velocity signals of the right foot along the x, y, and z axes, respectively.
[0078] Understandably, an inertial sensor can be integrated with a microcontroller to form a monitoring device, which is then mounted on a shoe upper. Several participants, wearing the monitoring device, walk along a prescribed path. In some embodiments, referring to standard testing in the field of Parkinson's disease, the participants walk forward in a straight line for 5 meters, then turn around and walk back in a straight line for 5 meters to return to the starting point.
[0079] After the monitoring device collects multiple gait samples, it sends them to the electronic device. It is understood that in some embodiments, the gait categories of these participants are not entirely the same; some exhibit a panicked gait, while others have a normal gait, i.e., a non-Parkinsonian gait. Therefore, the electronic device can acquire multiple gait samples. Each gait sample corresponds to a gait category. That is, each gait sample is labeled, with the label including either a panicked gait or a normal gait.
[0080] Gait samples are obtained by inertial measurement units (IMUs) collecting three-axis acceleration and three-axis angular velocity signals of the feet over a period of time. Therefore, a gait sample contains signal waves in six dimensions, such as: left foot x-axis acceleration, left foot y-axis acceleration, left foot z-axis acceleration, left foot x-axis angular velocity, left foot y-axis angular velocity, and left foot z-axis angular velocity. Another example is: right foot x-axis acceleration, right foot y-axis acceleration, right foot z-axis acceleration, right foot x-axis angular velocity, right foot y-axis angular velocity, and right foot z-axis angular velocity.
[0081] In some embodiments, if the y-axis aligns with the walking direction, the z-axis is perpendicular to the ground, and the x-axis represents the inward direction of the foot, then the y-axis acceleration signal wave reflects the foot's acceleration in the walking direction. Based on walking characteristics, the inward direction of the foot has no acceleration or its acceleration is chaotic and unreliable; therefore, in this embodiment, the x-axis acceleration signal wave can be discarded. Thus, a gait sample includes signal waves in five dimensions.
[0082] In some embodiments, at least 100 gait samples labeled as panicked gait are selected from the collected gait samples as a positive training set, and at least 100 gait samples labeled as normal gait are selected as a negative training set. Then, at least 20 gait samples labeled as panicked gait are selected as a positive test set, and at least 20 gait samples labeled as normal gait are selected as a negative test set.
[0083] In some embodiments, the method further includes normalizing the gait samples before step S20.
[0084] For example, if a gait sample includes signal waves in five dimensions: y-axis acceleration signal wave, z-axis acceleration signal wave, and angular velocity signal waves along three axes, where the y-axis represents the walking direction (i.e., the direction of movement) and the z-axis represents the direction perpendicular to the ground, then in this embodiment, the signal waves in each of the five dimensions of the gait sample are normalized.
[0085] In some embodiments, the gait samples are normalized using the following formula to scale the signal values of each signal wave to the [0,1] interval.
[0086]
[0087] Where X is any signal value in the signal band before normalization processing, X norm X is the normalized signal value. max X is the signal value with the largest value in the signal band. min It is the signal value with the smallest numerical value in the signal band.
[0088] Please see Figure 4 , Figure 4 This is a schematic diagram of the signal wave after normalization. Scaling the signal wave value to the [0,1] interval can reduce the impact of excessive data differences on the model, which is beneficial to improving the model's accuracy.
[0089] In this embodiment, normalizing the signal waves of each dimension of each gait sample can effectively reduce the adverse effects of singular sample data on subsequent training and accelerate model convergence.
[0090] S20: Based on the periodicity of the gait samples, the gait samples are divided to obtain multiple gait periodic bands.
[0091] Dividing each gait sample according to its periodicity ensures that each gait period band reflects the motion data of a complete step, conforming to the walking cycle. This facilitates the subsequent binary classification model in learning the features of each step, thereby improving classification accuracy.
[0092] In some embodiments, the aforementioned step S20 specifically includes:
[0093] S21: Obtain the peak of the acceleration signal wave in the direction of motion.
[0094] S22: Determine the start and end indices of each gait cycle band based on each wave peak.
[0095] S23: Based on the start and end indices of each gait periodic band, the gait samples are truncated to obtain multiple gait periodic bands.
[0096] In some embodiments, the direction of motion can be the y-axis direction of the inertial measurement unit, i.e., acquiring the y-axis signal wave. Due to the periodicity of walking, the acceleration signal wave also exhibits periodicity in the direction of motion, with one cycle corresponding to the acceleration signal of one step. In the acceleration signal wave along the direction of motion, the acceleration signal fluctuates up and down within each cycle, exhibiting a peak value, which is typically located at the highest point of the foot leaving the ground during the process from takeoff to landing.
[0097] In this embodiment, to accurately segment the gait cycle bands, the peak values of the acceleration wave in the direction of motion are first obtained. Since each peak falls within a gait cycle band, the start and end indices of each gait cycle band can be determined based on these peaks. It is understood that the signal waves in each dimension of the gait sample have temporal sequence, and their indices can be timestamps. Here, the start and end indices of the gait cycle bands are determined based on the timestamps corresponding to each cycle of the acceleration signal wave in the direction of motion. Finally, the gait sample is truncated based on the start and end indices of each gait cycle band to obtain multiple gait cycle bands.
[0098] In this embodiment, based on the acceleration signal wave of the direction of motion, with the characteristics of the foot leaving and landing, each peak is located at the highest point of leaving the ground during the process from foot leaving to landing, and each peak falls on a gait cycle wave segment. Thus, the start index and end index of each gait cycle wave segment are determined according to each wave peak, making the divided gait cycle wave segments more accurate.
[0099] In some embodiments, the aforementioned step S22 specifically includes:
[0100] S221: Slide the middle position of the sliding window to each wave crest in sequence, and determine the start index and end index of the step-state periodic waveband based on the target waveband covered by the sliding window located at a wave crest.
[0101] The sliding window is a virtual data partitioning window. It is understood that in some embodiments, the length of the sliding window can be 2 seconds. In some embodiments, the inertial measurement unit's sampling frequency is 50 Hz, and a 2-second sliding window can cover 100 data points.
[0102] After locating each peak, a sliding window moves along the acceleration signal wave in the direction of motion. Each time the sliding window reaches a peak, the start and end indices of the gait periodic band are determined based on the target band covered by the window at that peak. It is understood that the target band is larger than the gait periodic band; therefore, by analyzing the trend of signal value changes in the target band, the start and end indices can be determined.
[0103] In this embodiment, the start and end indices of the gait periodic band are determined by analyzing the target bands on both sides of the wave crest, making the start and end indices more accurate, which in turn helps improve the accuracy of the gait periodic band.
[0104] In some embodiments, the aforementioned "determining the start and end indices of a step-state periodic band based on the target band covered by the sliding window located at a wave crest" includes:
[0105] (1) Perform first-order difference processing on the target band to obtain the difference sequence.
[0106] (2) Based on the difference sequence, determine the index of the first stationary band located to the left of the peak in the target band, and determine the starting index of the gait period band based on the index of the first stationary band.
[0107] (3) Based on the difference sequence, determine the index of the second stationary band located to the right of the peak in the target band, and determine the end index of the gait period band based on the index of the second stationary band.
[0108] In this embodiment, first-order difference processing refers to subtracting the previous signal value from the next signal value at the timestamp in the target band. Performing first-order difference processing on the target band yields a difference sequence. Thus, the difference sequence reflects the trend of signal value changes in the target band. For example, if the signal value fluctuation is small, the corresponding difference is relatively small; if the signal value fluctuation is large, the corresponding difference is relatively large.
[0109] The first stable band is the band in the target band where the signal value fluctuates little to the left of the peak. In this first stable band, the acceleration signal value fluctuates relatively little, corresponding to the pause after the foot lands. Therefore, based on the difference sequence, the index corresponding to the first stable band in the target band, located to the left of the peak, can be determined.
[0110] In some embodiments, the aforementioned "determining the index corresponding to the first stationary band located to the left of the peak in the target band based on the difference sequence" includes: selecting indices in the difference sequence located to the left of the peak whose absolute values are less than or equal to a preset threshold, as a first candidate index set; and selecting k consecutive indices from the first candidate index set as the index corresponding to the first stationary band.
[0111] Understandably, the portion of the difference sequence located to the left of the peak is determined based on the peak index. Within this portion, if the absolute value of the difference is less than or equal to a preset threshold, it indicates that the corresponding signal value fluctuates little and is relatively stable. The preset threshold is a pre-set empirical value, for example, 100. The indices of these differences with absolute values less than the preset threshold constitute the first candidate index set. If there are k consecutive indices in the first candidate index set, these k indices are used as the indices corresponding to the first stable band. Here, k is a pre-set empirical value, for example, k could be 5.
[0112] It's understandable that if k consecutive indices exist in the first candidate index set, it indicates that the acceleration signal bands corresponding to these k indices are stable with minimal fluctuations, corresponding to the stationary phase when the foot lands. Therefore, using the k consecutive indices in the first candidate index set as the indices corresponding to the first stable band makes the first stable band more accurate. Furthermore, by setting k, the possibility of consecutive sequence numbers appearing during motion can be effectively eliminated.
[0113] Once the index corresponding to the first stationary band is obtained, the starting index of the gait periodic band can be determined based on this index. For example, one of the indices corresponding to the first stationary band can be used as the starting index of the gait periodic band.
[0114] In some embodiments, the aforementioned "determining the start index of the gait periodic band according to the index corresponding to the first stationary band" includes: determining the first stationary band from the target band according to the index corresponding to the first stationary band; obtaining the maximum value of the signal value in the first stationary band, and using the index corresponding to the maximum value as the start index of the gait periodic band.
[0115] In this embodiment, based on the index corresponding to the first stationary band, the signal values included in the first stationary band are found and determined from the target band. The index corresponding to the largest signal value in the first stationary band is used as the starting index of the gait periodic band. Figure 5 As shown, the index corresponding to point B to the left of peak A is the starting index.
[0116] Understandably, the largest signal value is the last signal value when the foot lands and is in a stationary phase; it can be understood as the signal value corresponding to the moment the foot begins to leave the ground. From this moment onwards, the last signal value of the stationary phase begins, and the next signal value will fluctuate significantly as the foot begins to move. Therefore, the index corresponding to the largest signal value in the first stable waveband serves as the starting index of the gait cycle waveband, which aligns with foot characteristics and makes the starting index more accurate.
[0117] In some embodiments, the aforementioned "determining the index corresponding to the second stationary band located to the right of the peak in the target band based on the difference sequence, and determining the end index of the gait periodic band based on the index corresponding to the second stationary band" includes: selecting indices in the difference sequence located to the right of the peak whose absolute values are less than or equal to a preset threshold, as a second candidate index set; selecting g consecutive indices from the second candidate index set as indices corresponding to the second stationary band; determining the second stationary band from the target band based on the index corresponding to the second stationary band, obtaining the minimum value of the signal value in the second stationary band, and using the index corresponding to the minimum value as the end index of the gait periodic band.
[0118] Understandably, the portion of the difference sequence located to the right of the peak is determined based on the peak index. Within this portion, if the absolute value of the difference is less than or equal to a preset threshold, it indicates that the corresponding signal value fluctuates little and is relatively stable. The preset threshold is a pre-set empirical value, for example, 100. The indices of these differences with absolute values less than the preset threshold constitute a second candidate index set. If there are g consecutive indices in the second candidate index set, these g indices are used as the indices corresponding to the second stable band. Here, g is a pre-set empirical value, for example, g could be 4.
[0119] It's understandable that if there are g consecutive indices in the second candidate index set, it indicates that the acceleration signal bands corresponding to these g indices are stable with minimal fluctuations, corresponding to the stationary phase when the foot lands. Therefore, using the g consecutive indices in the second candidate index set as the indices corresponding to the second stable band makes the second stable band more accurate. Furthermore, by setting g, the possibility of consecutive sequence numbers appearing during motion can be effectively eliminated.
[0120] Once the index corresponding to the second stationary band is obtained, the end index of the gait periodic band can be determined based on this index. For example, one of the indices corresponding to the second stationary band can be used as the end index of the gait periodic band.
[0121] Based on the index corresponding to the second stationary band, locate and determine the signal values included in the second stationary band from the target band. Use the index corresponding to the smallest signal value in the second stationary band as the end index of the gait periodic band. For example... Figure 5 As shown, the index corresponding to point C to the right of peak A is the end index.
[0122] Understandably, the minimum signal value corresponds to the moment the foot lands, after which the foot enters a stationary phase. Therefore, the index corresponding to the minimum signal value in the second stationary band serves as the end index of the gait cycle band, which aligns with foot characteristics and makes the end index more accurate.
[0123] By obtaining accurate start and end indices through the above methods, gait samples can be truncated based on the start and end indices of each gait cycle band, thus obtaining accurate gait cycle bands.
[0124] In some embodiments, the method further includes the following steps prior to step S30:
[0125] S40: Adjust the length of each gait cycle band to the target length.
[0126] It is understandable that gait cycle bands are determined based on the characteristics of the acceleration signal wave reflected in the direction of movement, and the lengths of these gait cycle bands may vary. In this embodiment, a target length is preset, which is understood to be an empirical value set by those skilled in the art based on actual stride length. Specifically, the signal waves in all five dimensions of the gait cycle bands are adjusted to the target length.
[0127] The lengths of each gait cycle band are standardized and adjusted to the target length. This helps reduce the interference caused by inconsistent lengths in subsequent binary classification models.
[0128] In some embodiments, the aforementioned step S40 specifically includes: using linear interpolation to adjust the length of each gait period band to the target length.
[0129] Linear interpolation uses an interpolation function, such as a first-order polynomial, to insert new signal values with zero error at each interpolation node, based on the original signal values. It is understood that linear interpolation is an existing technology, and its interpolation process will not be described in detail here.
[0130] For any dimension of the signal band in the gait period band, such as the acceleration signal band in the direction of motion, linear interpolation is used to adjust its length to the target length.
[0131] Understandably, linear interpolation, within a certain allowable error range, can approximate the original signal wave and effectively preserve its original waveform characteristics. For example, if someone's single-step time is particularly short, the corresponding signal wave length is also short. Through linear interpolation, while basically maintaining the original waveform characteristics, the shorter signal wave can be filled in to form a signal wave of a self-defined target length.
[0132] In this embodiment, by unifying the length of each gait period band to a target length, on the one hand, it helps to reduce the interference caused by length discrepancies to the subsequent binary classification model and accelerate model convergence; on the other hand, it can effectively maintain the original waveform characteristics without introducing new interference.
[0133] S30: Using the divided gait periodic bands, the binary classification algorithm model is iteratively trained to obtain the panicked gait recognition model.
[0134] Understandably, in some embodiments, these gait cycle bands are gait cycle bands of uniform length. Since each gait sample is labeled, each gait cycle band is also labeled, with labels including panicked gait or normal gait. That is, some gait cycle bands belong to panicked gait, labeled with 1, where 1 represents panicked gait. Other gait cycle bands belong to normal gait, labeled with 0, where 0 represents normal gait.
[0135] Here, several gait cycle bands are used as the training set for the binary classification algorithm model. The pre-set binary classification algorithm model is trained by continuously adjusting its parameters. Under the constraint of the loss function, the predicted gait category output by the binary classification algorithm model will become closer and closer to the true gait category (label). When the loss calculated by the loss function fluctuates within a certain range or reaches a certain value, the binary classification algorithm model converges. The parameters at convergence are used as the model parameters to obtain the gait recognition model.
[0136] In some embodiments, the binary classification algorithm model can be a logistic regression model. That is, the logistic regression model is used to train the training set. The logistic regression model has the following conditional probability distribution;
[0137]
[0138]
[0139] Where x is the feature vector obtained after feature mapping of a gait period band, w is the weight vector, and b is the bias. It can be understood that w and b are the model parameters of the logistic regression model.
[0140] The logistic regression model uses the following activation function to predict labels;
[0141]
[0142] The basic form of linear regression is y = w T x+b;
[0143] Replacing x with y yields the logistic regression model:
[0144]
[0145] Here, x is the feature vector obtained after feature mapping extraction of a gait period band. It can be understood that if x = 0, then y = 0.5; if x < 0, then y < 0.5, indicating that feature vector x is classified into one class; if x > 0, then y > 0.5, indicating that feature vector x is classified into another class. Therefore, the predicted label can be obtained through the above formula.
[0146] A loss function is used to calculate the loss between each predicted label and the true label. Based on the loss, the model parameters of the logistic regression model are adjusted. If the loss fluctuates within a certain range or reaches a certain value, the logistic regression model converges. By configuring the model parameters at convergence, the panicked gait recognition model can be obtained.
[0147] In some embodiments, a test set including positive and negative samples is used to evaluate the accuracy and similarity of the converged logistic regression model (panicked gait recognition model). In some embodiments, the false positive rate of the negative sample test set reaches 96.77%, while the accuracy of the positive sample test set reaches 100%. It is evident that the panicked gait recognition model trained in the above manner has high accuracy.
[0148] In summary, in some embodiments of this application, multiple gait samples are first acquired. These gait samples include triaxial acceleration and triaxial angular velocity signal waves collected by an inertial measurement unit (IMU) from the walking steps of the feet. Each gait sample is labeled with a tag, including "hurried gait" or "normal gait." Based on the periodicity of the gait samples, they are divided into multiple gait periodic bands. Using these divided gait periodic bands, a binary classification algorithm model is iteratively trained to obtain a hurried gait recognition model. In this embodiment, each gait sample is divided according to its periodicity, ensuring that each obtained gait periodic band reflects the motion data of a complete step and conforms to the walking cycle. Therefore, by using these gait periodic bands to train the binary classification algorithm model, the resulting hurried gait recognition model, based on the analysis and mining of the potential features of each gait periodic band, can accurately identify hurried gait. Furthermore, deploying this panicked gait recognition model on electronic devices such as microcontrollers can effectively reduce computational burden, decrease data transmission latency, enable real-time detection and recognition, improve algorithm accuracy, and enhance model robustness and generalization ability.
[0149] After training the panicked gait recognition model using the method provided in this application embodiment, the panicked gait recognition model can be applied to recognize panicked gaits. The gait recognition method provided in this application embodiment can be implemented by various types of electronic devices with computing capabilities, such as smart terminals, servers, or monitoring devices with inertial measurement units.
[0150] The gait recognition method provided in this application is described below with reference to exemplary applications and implementations of the monitoring device provided in the embodiments of this application. Specifically, the monitoring device includes an inertial measurement unit and a microcontroller, and the gait recognition method is deployed in the microcontroller in the form of a program. The monitoring device is small in size and can be worn on the foot, such as on the upper of a shoe. The microcontroller receives test gait samples sent by the inertial measurement unit, analyzes potential features, and obtains the gait category.
[0151] See Figure 6 , Figure 6 This is a flowchart illustrating the gait recognition method provided in an embodiment of this application. Method S200 includes the following steps:
[0152] S201: Acquire test gait samples, which include triaxial acceleration signal waves and triaxial angular velocity signal waves obtained by the inertial measurement unit from the walking steps of the feet.
[0153] Understandably, test gait samples are the triaxial acceleration and triaxial angular velocity signal waves obtained by the inertial measurement unit (IMU) during actual application scenarios, specifically by collecting data on the walking steps of the feet, such as the left and / or right feet. The IMU sends the test gait samples to the microprocessor, which then acquires the test gait samples.
[0154] S202: Based on the periodicity of the test gait samples, the test gait samples are divided to obtain the test gait periodic bands.
[0155] Referring to the method for dividing gait samples in step S20, the test gait samples are divided into multiple test gait periodic bands. For the specific division method, please refer to the detailed description of step S20; it will not be repeated here.
[0156] S203: Input multiple test gait cycle bands into the panicked gait recognition model and output the gait category of each step.
[0157] The panicked gait recognition model is trained using the method described in any of the above embodiments.
[0158] It is understood that the microprocessor has a built-in gait recognition application, and the panicked gait recognition model is encapsulated within this application. The panicked gait recognition model is called to perform gait recognition on each of the aforementioned test gait periodic bands. After a series of calculations, the gait category corresponding to each test gait periodic band is output. This gait recognition model is trained using the method described in any of the above embodiments for training the panicked gait recognition model, and has the same structure and function as the panicked gait recognition model in the above embodiments; therefore, it will not be described in detail here.
[0159] In this embodiment, based on the test gait periodic band reflecting the motion characteristics of each step, the panicked gait recognition model can identify the gait category of each step taken by the user. In some embodiments, a recognition result of 1 indicates a panicked gait, and a recognition result of 0 indicates a normal gait. If the recognition result is a probability, for example, the probability of outputting a panicked gait is 0.8, then the similarity of this step's panicked gait is 80%. By recognizing each step of the user and determining the gait category or similarity, panicked gait can be accurately detected, which is helpful in reminding users to detect Parkinson's syndrome in a timely manner.
[0160] In some embodiments, the microcontroller and inertial measurement unit are integrated into a small monitoring device that can be worn on the foot, such as on a shoe upper. The microcontroller can receive test gait samples sent by the inertial measurement unit in real time, analyze potential features, and obtain gait categories. On the one hand, this reduces computational burden and data transmission latency, enabling real-time detection. On the other hand, it offers high detection accuracy, strong algorithm robustness, and generalization ability.
[0161] This application also provides a computer-readable storage medium storing computer-executable instructions for causing an electronic device to execute the method for training a panicked gait recognition model provided in this application, for example, such as... Figure 3-5 The method for training a panicked gait recognition model shown, or the virtual try-on method provided in the embodiments of this application, for example, Figure 6 The gait recognition method is shown.
[0162] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0163] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0164] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborative files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0165] As an example, executable instructions can be deployed to execute on a single computing device (including devices such as smart terminals and servers), or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0166] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When executed by a computer, the program instructions cause the computer to perform the method or gait recognition method for training a panicked gait recognition model as described in the foregoing embodiments.
[0167] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for training a panicked gait recognition model, characterized in that, include: Multiple gait samples are acquired, including acceleration signal waves and angular velocity signal waves obtained by inertial measurement unit collecting the walking steps of the feet. Each gait sample is labeled with a tag, which includes panicked gait or normal gait. Based on the periodicity of the gait samples, the gait samples are divided to obtain multiple gait periodic bands; The binary classification algorithm model is iteratively trained using the several gait periodic bands obtained from the division to obtain the panicked gait recognition model. The step of dividing the gait samples according to their periodicity to obtain multiple gait periodic bands includes: Obtain the peak of the acceleration signal wave in the direction of motion; The middle position of the sliding window is slid sequentially to each of the wave peaks, and the start index and end index of the gait cycle wave band are determined according to the target wave band covered by the sliding window located at a wave peak; wherein, the start index and the end index are determined based on the difference sequence of the target wave band. Based on the start and end indices of each gait periodic band, the gait sample is truncated to obtain the multiple gait periodic bands; The step of determining the start and end indices of the gait cycle band based on the target band covered by the sliding window located at a wave crest includes: The target band is subjected to first-order difference processing to obtain the difference sequence; Based on the difference sequence, determine the index corresponding to the first stationary band located to the left of the peak in the target band, and determine the starting index of the gait cycle band based on the index corresponding to the first stationary band. Based on the difference sequence, determine the index of the second stationary band located to the right of the peak in the target band, and determine the end index of the gait cycle band based on the index of the second stationary band. The step of determining the index of the second stationary band located to the right of the peak in the target band based on the difference sequence, and determining the end index of the gait cycle band based on the index of the second stationary band, includes: The indices whose absolute values in the difference sequence located to the right of the peak are less than or equal to a preset threshold are selected as the second candidate index set. Take the g consecutive indices in the second candidate index set as the indices corresponding to the second stationary band; Based on the index corresponding to the second stationary band, the second stationary band is determined from the target band, the minimum value of the signal value in the second stationary band is obtained, and the index corresponding to the minimum value is used as the end index of the gait period band.
2. The method according to claim 1, characterized in that, The step of determining the index corresponding to the first stationary band located to the left of the peak in the target band based on the difference sequence includes: The indices whose absolute values in the difference sequence located to the left of the peak are less than or equal to a preset threshold are selected as the first candidate index set. Take the k consecutive indices from the first candidate index set as the indices corresponding to the first stationary band.
3. The method according to claim 2, characterized in that, Determining the start index of the gait cycle band based on the index corresponding to the first stationary band includes: Based on the index corresponding to the first stationary band, the first stationary band is determined from the target band; the maximum value of the signal value in the first stationary band is obtained, and the index corresponding to the maximum value is used as the starting index of the gait period band.
4. The method according to claim 1, characterized in that, Before the step of iteratively training the binary classification algorithm model using the divided gait periodic bands to obtain the panicked gait recognition model, the method further includes: The length of each of the gait cycle bands is adjusted to the target length.
5. The method according to claim 4, characterized in that, The step of adjusting the length of each of the gait cycle bands to the target length includes: Linear interpolation is used to adjust the length of each gait cycle band to the target length.
6. The method according to claim 1, characterized in that, Before the step of dividing the gait sample into multiple gait periodic bands based on the periodicity of the gait sample, the method further includes: The gait samples are normalized.
7. A gait recognition method, characterized in that, include: Acquire test gait samples, which include acceleration signal waves and angular velocity signal waves obtained by inertial measurement unit collecting walking steps of the feet; Based on the periodicity of the test gait samples, the test gait samples are divided to obtain multiple test gait periodic bands; The multiple test gait periodic bands are input into the panic gait recognition model, and the gait category of each step is output. The panic gait recognition model is trained using the method described in any one of claims 1-6.
8. An electronic device, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer device to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Gait recognition method based on inertial sensor
CN104729507A