Human motion recognition method based on TinyML and MATLAB multi-model deployment
Through the multi-model deployment method of TinyML and MATLAB, combined with CNN and SVM models, the human motion recognition of exoskeleton robots is optimized, and the problems of inaccurate identification and cumbersome data processing are solved, and higher recognition accuracy and robustness are achieved. Adapting to a variety of scenarios and gait recognition provides a wider range of application possibilities for exoskeleton equipment.
Patent Information
- Application Number
- CN202411407933.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-03
AI Technical Summary
Existing exoskeleton robots have problems with inaccurate recognition of human motion, especially in different scenarios, the recognition rate is low, and the multi-sensor method processes and trains data cumbersome and lacks robustness.
Using a multi-model deployment method based on TinyML and MATLAB, the CNN motion recognition model and SVM pattern recognition classifier model are constructed, combined with inertial sensor data, the recognition model is optimized and mixed deployment is carried out to the embedded platform, which improves the recognition accuracy and pre-data Processing and model optimization to adapt to different scenarios and gait recognition.
Improve the accuracy and robustness of human motion recognition, solve the problem of inaccurate recognition of traditional state machine transitions in different motion modes, enhance the accuracy of gait phase recognition, and provide flexible expansion and modification capabilities. , suitable for a variety of usage scenarios.
Smart Images

Figure CN119249235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning and model deployment, and in particular to a human motion recognition method based on TinyML and MATLAB multi-model deployment. Background Art
[0002] Exoskeleton robots have developed rapidly in recent years. They have strong human-machine coupling and can enhance human mobility. They are widely used in military, industrial, rescue and medical fields. They can reduce fatigue from repetitive work, provide explosive power, and reduce a large number of occupational injuries to the human body. Motion intention recognition technology plays a very important role in exoskeleton control. Exoskeleton is a wearable device with human-machine coupling in the control loop. The smooth and coordinated motion control of man and machine cannot be separated from accurate intention recognition of human motion. The accuracy and robustness of human motion recognition are very important when walking in an exoskeleton, which directly affects the stability of the wearer's wearing comfort.
[0003] Nowadays, exoskeleton algorithms are mainly based on multi-source information fusion and simple state machine conversion algorithms. Multi-source information fusion control algorithms need to collect data from many sensors, such as IMU (inertial sensor), EMG (surface electromyography signal), FSR (pressure sensor), etc. The many sensors used make it not very robust. Often these algorithms also need to add deep learning algorithms, and need to collect a large amount of data calculation and learning to improve the accuracy of recognition. The amount of learning data for different individuals will be larger. Simple state machine conversion algorithms can bring simple control logic. However, the recognition rate will be poor in different scenarios, such as running, walking on flat ground, going up and down slopes, and going up and down stairs.
[0004] Therefore, in view of the above-mentioned technical defects, the present invention proposes a human motion recognition method based on TinyML and MATLAB multi-model deployment. Summary of the invention
[0005] The purpose of the present invention is to provide a human motion recognition method based on TinyML and MATLAB multi-model deployment, which not only avoids the tediousness of multi-sensor methods in processing and training large amounts of data, but also has stronger robustness; the deployment of multiple models solves the inaccurate recognition of traditional state machine conversion in the face of different motion modes, and brings higher accuracy in gait phase recognition and conversion. In addition, the method can be flexibly expanded and modified by adding new scenes and gait recognition to adapt to different usage scenarios, bringing more possibilities for the use of equipment such as power exoskeletons.
[0006] To achieve the above object, the present invention provides a human motion recognition method based on TinyML and MATLAB multi-model deployment, comprising the following steps:
[0007] Step S1, collecting motion data of the wearer's inertial sensor IMU in different scenarios;
[0008] Step S2: Process the collected IMU motion data and label it according to different scenarios to form a data set;
[0009] Step S3, constructing a CNN motion recognition model, training the motion state in combination with the training set, obtaining a CNN motion recognition model of human motion in different scenarios, and optimizing the recognition rate of the model to the best state;
[0010] Step S4, constructing an SVM pattern recognition classifier model based on MATLAB, inputting data into the model for training, and adjusting the SVM pattern recognition classifier model to achieve the optimal accuracy;
[0011] Step S5: The CNN motion recognition model and the SVM pattern recognition classifier model generated above are mixed and deployed on the embedded platform to complete the recognition through the sensor data.
[0012] Preferably, in step S1, a data acquisition system is constructed, which includes three inertial sensors IMU, which are respectively distributed on the thigh and back above the knee joint; the three inertial sensors IMU are connected to the single-chip microcomputer via Bluetooth, and the acquisition frequency is 100 Hz. The single-chip microcomputer sends the data to the host computer PC for data processing;
[0013] The collected data include but are not limited to: three-axis acceleration, three-axis angular velocity and three-axis Euler angle data of walking, sit-stand conversion, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking.
[0014] Preferably, in step S2, the collected IMU motion data is processed and labeled according to different scenarios to form a data set. The specific process is as follows:
[0015] Step S21, preprocessing the data, firstly eliminating unnecessary data, and eliminating data with too many missing values, too small standard deviation, too small absolute value of the ratio of standard deviation to mean, and turning and stopping data in a mode;
[0016] Step S22: further process the pre-processed data through a low-pass filter, as shown below:
[0017] Y(n)=Y(n-1)+a*(X(n)-Y(n-1))
[0018] Among them, Y(n) is the value after filtering; a is the filtering coefficient; X(n) is the current sampling value; Y(n-1) is the previous filtering result;
[0019] Step S23, then normalize the filtered data, as shown below:
[0020]
[0021] Among them, x n To obtain the normalized sequence; x is the input sensor signal value; x max is the maximum value of the same type of signal; x min is the minimum value among signals of the same type;
[0022] Step S24, the processed data is used to form a data set, wherein the ratio of the training set to the test set is 4:1.
[0023] Preferably, in step S3, a CNN motion recognition model is constructed, the motion state is trained in combination with a training set, a CNN motion recognition model of human motion in different scenes is obtained, and the recognition rate of the model is optimized to an optimal state. The specific process is as follows:
[0024] Step S31, construct a CNN motion recognition model, extract data features through two convolutional layers, reduce the dimension of the data through two pooling layers, and reduce overfitting through a Dropout layer. The last layer is a fully connected layer with a softmax activation function to classify the data;
[0025] Step S32: Based on the CNN motion recognition model, the model is trained in combination with the training set, and the loss function of the data is adjusted to an appropriate position to optimize the accuracy of the CNN motion recognition model, and the CNN motion recognition model of human motion in different scenes is obtained;
[0026] Step S33, convert the CNN motion recognition model into a file that runs in an embedded environment, that is, use the NNOM framework to convert it into a weighted C language header file that runs on a single-chip microcomputer. When deploying, the library file provided by NNOM should be deployed together.
[0027] Preferably, the structure of the CNN motion recognition model is as follows:
[0028] The Input layer is the input layer. The input data should be a 70*9 matrix, and the value of BATCH_SIZE should be defined as 32.
[0029] The Convolution Layers layer consists of two convolution layers. The first convolution layer passes through 64 3*3 convolution kernels, which process the data and use the ReLU function as the activation function to activate the input matrix. Then, it passes through a 3*3 maximum pooling layer to convert the data into a matrix with a dimension of 64*23. The second convolution layer passes through 64 3*3 convolution kernels, which process the data and use the ReLU function as the activation function to activate the input matrix. Then, it passes through a 3*3 maximum pooling layer to convert the data into a matrix with a dimension of 64*7.
[0030] The Flatten layer is a flattening layer. After the data passes through the flattening layer, a 128*1 matrix is output;
[0031] The Full Connect layer is a fully connected layer, and the final output data is a 6*1 matrix;
[0032] The Output layer corresponds to the output layer, and the corresponding output data scenarios include sit-stand transition, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking, but are not limited to these scenarios.
[0033] Preferably, in step S4, an SVM pattern recognition classifier model is constructed based on MATLAB, data is input into the model for training, and the SVM pattern recognition classifier model is adjusted to achieve the best accuracy. The specific process is as follows:
[0034] Step S41: First, the original data is processed again to extract only the phase information during walking and discard the rest of the data;
[0035] Step S42: Secondly, the processed raw data is marked according to the gait phases in different scenarios;
[0036] Step S43, then, the above data is normalized again; the data set is divided into a training set and a test set, and the division ratio is 4:1.
[0037] Step S44, next, using MATLAB to construct an SVM pattern recognition classifier model and finite state machines of different phases, inputting the above-processed training set into the SVM pattern recognition classifier model for training, and adjusting the SVM pattern recognition classifier model to achieve the optimal accuracy;
[0038] Step S45: Finally, the recognition result of the SVM pattern recognition classifier model of the gait phase is mapped to the finite state machine conversion, converted into C language code through MATLAB Embeded coder, and deployed to the embedded platform.
[0039] Preferably, the gait phase markings include the right leg starting to step, the right foot supporting phase, the right leg swing phase, the left leg swing phase, the left leg supporting phase, the left leg starting to step, the left leg stopping to step, the right leg stopping to step and the initial state; other unknown data are marked as unknown states.
[0040] Preferably, a finite state machine is constructed on MATLAB to describe the walking state and the judgment of the walking state; the walking process is a cyclic process, and the state machine switching conditions in the cycle are as follows:
[0041] (1) Initial state: This state is the initial state, which is the static state after the IMU is powered on and calibrated. This state can be dynamically transferred to the left leg starting to swing and the right leg starting to swing;
[0042] (2) The left leg begins to step forward, from which it can transition to the left foot support phase;
[0043] (3) Left foot support phase, from which the state can be transferred to the right leg swing phase;
[0044] (4) right leg swing phase, from which the state can be transferred to the right foot support phase;
[0045] (5) Right foot support phase, from which the transition to the left leg swing phase can be achieved;
[0046] (6) left leg swing phase, from which the state can be transferred to the left foot support phase;
[0047] Similarly, in (2), start with the right leg and the sequence becomes (2) → (5) → (6) → (3) → (4) → (2) and repeat.
[0048] All state machine transitions jump to the unknown phase exception exit state when encountering an unknown identified phase.
[0049] Therefore, the present invention adopts the above-mentioned human motion recognition method based on TinyML and MATLAB multi-model deployment, which not only avoids the cumbersomeness of multi-sensor methods in processing and training large amounts of data, but also has stronger robustness; the deployment of multiple models solves the inaccurate recognition of traditional state machine conversion in the face of different motion modes, and brings higher accuracy in gait phase recognition and conversion. In addition, the method can be flexibly expanded and modified by adding new scenes and gait recognition to adapt to different usage scenarios, bringing more possibilities for the use of equipment such as power exoskeletons.
[0050] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A distribution diagram of sensor installation locations of the present invention;
[0052] Figure 2 This is a schematic diagram of the CNN model network structure of the present invention;
[0053] Figure 3 It is the walking phase finite state machine (FSM) conversion diagram of the present invention;
[0054] Figure 4 It is a flow chart of the overall algorithm deployment of the present invention;
[0055] Figure 5 It is a flow chart of a human motion recognition method based on TinyML and MATLAB multi-model deployment of the present invention. DETAILED DESCRIPTION
[0056] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0057] like Figure 5 As shown, the present invention provides a human motion recognition method based on TinyML and MATLAB multi-model deployment, comprising the following steps:
[0058] Step S1, collecting motion data of the wearer's inertial sensor IMU in different scenarios;
[0059] Step S2: Process the collected IMU motion data and label it according to different scenarios to form a data set;
[0060] Step S3, constructing a CNN motion recognition model, training the motion state in combination with the training set, obtaining a CNN motion recognition model of human motion in different scenarios, and optimizing the recognition rate of the model to the best state;
[0061] Step S4, constructing an SVM pattern recognition classifier model based on MATLAB, inputting data into the model for training, and adjusting the SVM pattern recognition classifier model to achieve the optimal accuracy;
[0062] Step S5: The motion recognition model and the SVM pattern recognition classifier model generated above are mixed and deployed on the embedded platform, and recognition can be completed through the sensor data.
[0063] Example
[0064] Step S1: Collect motion data of the wearer's inertial sensor IMU in different scenarios.
[0065] like Figure 1As shown in the figure, a data acquisition system is constructed, which includes three IMUs, which are distributed on the thigh and back above the knee joint. The three IMUs are connected to the microcontroller via Bluetooth, with an acquisition frequency of 100Hz. The microcontroller sends the data to the host computer (PC) for data processing.
[0066] The collected data include but are not limited to: three-axis acceleration, three-axis angular velocity and three-axis Euler angle data of walking, sit-stand conversion, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking.
[0067] Step S2: Process the collected IMU motion data and label it according to different scenarios to form a data set.
[0068] Step S21, preprocess the data, first remove unnecessary data, and remove data with too many missing values, too small standard deviation, too small absolute value of the ratio of standard deviation to mean, and turning and stopping data in a mode.
[0069] Step S22: further process the pre-processed data through a low-pass filter, as shown below:
[0070] Y(n)=Y(n-1)+a*(X(n)-Y(n-1))
[0071] Among them, Y(n) is the filtered value; a is the filter coefficient; X(n) is the current sampling value; and Y(n-1) is the previous filtering result.
[0072] Step S23, then normalize the filtered data, as shown below:
[0073]
[0074] Among them, x n To obtain the normalized sequence; x is the input sensor signal value; x max is the maximum value of the same type of signal; x min is the minimum value among signals of the same type.
[0075] Step S24, the processed data is used to form a data set, wherein the ratio of the training set to the test set is 4:1.
[0076] Step S3: construct a CNN motion recognition model, train the motion state in combination with the training set, obtain the CNN motion recognition model of human motion in different scenes, and optimize the recognition rate of the model to the best state.
[0077] Step S31: construct a CNN motion recognition model, the structure of which is as follows: Figure 2 shown.
[0078] The Input layer is the input layer. The input data should be a 70*9 matrix, and the value of BATCH_SIZE should be defined as 32.
[0079] The Convolution Layers layer consists of two convolution layers. The first convolution layer passes through 64 3*3 convolution kernels, which process the data and use the ReLU function as the activation function to activate the input matrix. Then, it passes through a 3*3 maximum pooling layer to convert the data into a matrix with a dimension of 64*23. The second convolution layer passes through 64 3*3 convolution kernels, which process the data and use the ReLU function as the activation function to activate the input matrix. Then, it passes through a 3*3 maximum pooling layer to convert the data into a matrix with a dimension of 64*7.
[0080] The Flatten layer is a flattening layer. After the data passes through the flattening layer, a 128*1 matrix is output.
[0081] The Full Connect layer is a fully connected layer, and the final output data is a 6*1 matrix.
[0082] The output layer corresponds to the output layer. The data scenarios corresponding to the output of the present invention include sit-stand conversion, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking, but are not limited to these scenarios.
[0083] Based on the CNN motion recognition model, data features are first extracted through two convolutional layers, then the data dimension is reduced through two pooling layers, and then a Dropout layer is used to reduce overfitting. The last layer is a fully connected layer with a softmax activation function to classify the data.
[0084] Step S32: Based on the CNN motion recognition model, the model is trained in combination with the training set, and the loss function of the data is adjusted to an appropriate position to optimize the accuracy of the CNN motion recognition model, thereby obtaining the CNN motion recognition model of human motion in different scenarios.
[0085] Step S33, convert the CNN motion recognition model into a file that can run in an embedded environment, that is, use the NNOM framework to convert it into a weighted C language header file that can run on a single-chip microcomputer. When deploying, the library file provided by NNOM should be deployed together.
[0086] Step S4: construct an SVM pattern recognition classifier model based on MATLAB, input data into the model for training, and adjust the SVM pattern recognition classifier model to achieve the best accuracy, such as Figure 4 As shown in FIG. 1 , the SVM pattern recognition classifier is used to identify the gait phase during walking.
[0087] Step S41: First, the original data is processed again to extract only the phase information during walking and discard the rest of the data.
[0088] Step S42: Secondly, the processed raw data is marked according to the gait phases in different scenarios, including the right leg starting to step, the right foot support phase, the right leg swing phase, the left leg swing phase, the left leg support phase, the left leg starting to step, the left leg stopping to step, the right leg stopping to step and the initial state; other unknown data are marked as unknown states.
[0089] Step S43: Then, the above data is normalized again. The data set is divided into a training set and a test set, and the division ratio is 4:1.
[0090] Step S44, next, use MATLAB to build an SVM pattern recognition classifier model and finite state machines (FSM) of different phases, input the training set processed above into the SVM pattern recognition classifier model for training, and adjust the SVM pattern recognition classifier model to achieve the optimal accuracy.
[0091] like Figure 3 As shown, a finite state machine (FSM) is constructed on MATLAB to further explain the walking state and the judgment of the walking state. The walking process is a cyclic process, and the state machine switching conditions in the cycle are as follows:
[0092] (1) Initial state (HOLD): This state is the initial state and is the static state after the IMU is powered on and calibrated. This state can be dynamically transferred to the left leg starting to swing and the right leg starting to swing;
[0093] (2) The left leg begins to step forward, from which the left foot can be transferred to the left foot support phase;
[0094] (3) the left foot support phase, from which the state can be transferred to the right leg swing phase;
[0095] (4) right leg swing phase, from which the state can be transferred to the right foot support phase;
[0096] (5) the right foot support phase, from which the state can be transferred to the left leg swing phase;
[0097] (6) left leg swing phase, from which the state can be transferred to the left foot support phase;
[0098] Similarly, in (2), start taking a step with the right leg, and the sequence becomes (2) → (5) → (6) → (3) → (4) → (2) and repeat.
[0099] All state machine transitions jump to the unknown phase exception exit state when encountering an unknown phase.
[0100] Step S45: Finally, the recognition result of the SVM pattern recognition classifier model of the gait phase is mapped to the finite state machine conversion, converted into C language code through MATLAB Embeded coder, and deployed to the embedded platform.
[0101] Step S5: The CNN motion recognition model and the SVM pattern recognition classifier model generated above are mixed and deployed on the embedded platform, and recognition can be completed through the sensor data.
[0102] like Figure 4 As shown in the figure, the generated motion recognition model and SVM pattern recognition classifier model are mixed and deployed on the embedded platform; the IMU is connected to the microcontroller via Bluetooth, and the IMU data is read through the driver code on the microcontroller at a frequency of 100HZ, and the data needs to be normalized.
[0103] Finally, the data is connected to the hybrid deployment model, and the CNN model is recognized first, that is, the highest priority. Therefore, the scene is recognized and output first, and then the gait phase is recognized and output. If the scene is not recognized, it will turn to recognize the phase and return to recognize the scene.
[0104] Therefore, the present invention adopts the above-mentioned human motion recognition method based on TinyML and MATLAB multi-model deployment, which not only avoids the cumbersomeness of multi-sensor methods in processing and training large amounts of data, but also has stronger robustness; the deployment of multiple models solves the inaccurate recognition of traditional state machine conversion in the face of different motion modes, and brings higher accuracy in gait phase recognition and conversion. In addition, the method can be flexibly expanded and modified by adding new scenes and gait recognition to adapt to different usage scenarios, bringing more possibilities for the use of equipment such as power exoskeletons.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A human motion recognition method based on TinyML and MATLAB multi-model deployment, characterized in that: The following steps are involved: Step S1, collecting motion data of the wearer's inertial sensor IMU in different scenarios; Step S2: Process the collected IMU motion data and label it according to different scenarios to form a data set; Step S3, constructing a CNN motion recognition model, training the motion state in combination with the training set, obtaining a CNN motion recognition model of human motion in different scenarios, and optimizing the recognition rate of the model to the best state; Step S4, constructing an SVM pattern recognition classifier model based on MATLAB, inputting data into the model for training, and adjusting the SVM pattern recognition classifier model to achieve the optimal accuracy; Step S5: The CNN motion recognition model and the SVM pattern recognition classifier model generated above are mixed and deployed on the embedded platform, and recognition is completed through the sensor data.
2. A human motion recognition method based on TinyML and MATLAB multi-model deployment according to claim 1, characterized in that: In step S1, a data acquisition system is constructed, which includes three inertial sensors IMU, which are respectively distributed on the thigh and back above the knee joint; the three inertial sensors IMU are connected to the microcontroller via Bluetooth, and the acquisition frequency is 100Hz. The microcontroller sends the data to the host computer PC for data processing; The collected data include but are not limited to: three-axis acceleration, three-axis angular velocity and three-axis Euler angle data of walking, sit-stand conversion, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking.
3. According to claim 1, a human motion recognition method based on TinyML and MATLAB multi-model deployment is characterized in that: In step S2, the collected IMU motion data is processed and labeled according to different scenarios to form a data set. The specific process is as follows: Step S21, preprocessing the data, firstly eliminating unnecessary data, and eliminating data with too many missing values, too small standard deviation, too small absolute value of the ratio of standard deviation to mean, and turning and stopping data in a mode; Step S22: further process the pre-processed data through a low-pass filter, as shown below: Y(n)=Y(n-1)+a*(X(n)-Y(n-1)) Among them, Y(n) is the value after filtering; a is the filtering coefficient; X(n) is the current sampling value; Y(n-1) is the previous filtering result; Step S23, then normalize the filtered data, as shown below: Among them, x n To obtain the normalized sequence; x is the input sensor signal value; x max is the maximum value of the same type of signal; x min is the minimum value among signals of the same type; Step S24, the processed data is used to form a data set, wherein the ratio of the training set to the test set is 4:
1.
4. According to claim 1, a human motion recognition method based on TinyML and MATLAB multi-model deployment is characterized in that: In step S3, a CNN motion recognition model is constructed, and the motion state is trained in combination with the training set to obtain a CNN motion recognition model of human motion in different scenes, and the recognition rate of the model is optimized to the best state. The specific process is as follows: Step S31, construct a CNN motion recognition model, extract data features through two convolutional layers, reduce the dimension of the data through two pooling layers, and reduce overfitting through a Dropout layer. The last layer is a fully connected layer with a softmax activation function to classify the data; Step S32: Based on the CNN motion recognition model, the model is trained in combination with the training set, and the loss function of the data is adjusted to an appropriate position to optimize the accuracy of the CNN motion recognition model, and the CNN motion recognition model of human motion in different scenes is obtained; Step S33, convert the CNN motion recognition model into a file that runs in an embedded environment, that is, use the NNOM framework to convert it into a weighted C language header file that runs on a single-chip microcomputer. When deploying, the library file provided by NNOM should be deployed together.
5. According to claim 4, a human motion recognition method based on TinyML and MATLAB multi-model deployment is characterized in that: The structure of the CNN motion recognition model is as follows: The Input layer is the input layer. The input data should be a 70*9 matrix, and the value of BATCH_SIZE should be defined as 32. The Convolution Layers layer consists of two convolution layers. The first convolution layer passes through 64 3*3 convolution kernels, which process the data; the ReLU function is used as the activation function to activate the input matrix; and then a 3*3 maximum pooling layer is used to convert the data into a matrix with a dimension of 64*23; the second convolution layer passes through 64 3*3 convolution kernels, which process the data; the ReLU function is used as the activation function to activate the input matrix; and then a 3*3 maximum pooling layer is used to convert the data into a matrix with a dimension of 64*7; The Flatten layer is a flattening layer. After the data passes through the flattening layer, a 128*1 matrix is output; The Full Connect layer is a fully connected layer, and the final output data is a 6*1 matrix; The Output layer corresponds to the output layer, and the corresponding output data scenarios include sit-stand transition, walking on flat ground, going up and down stairs, going up and down slopes, and fast walking, but are not limited to these scenarios.
6. A human motion recognition method based on TinyML and MATLAB multi-model deployment according to claim 1, characterized in that: In step S4, an SVM pattern recognition classifier model is constructed based on MATLAB, data is input into the model for training, and the SVM pattern recognition classifier model is adjusted to achieve the optimal accuracy. The specific process is as follows: Step S41: First, the original data is processed again to extract only the phase information during walking and discard the rest of the data; Step S42: Secondly, the processed raw data is marked according to the gait phases in different scenarios; Step S43, then, the above data is normalized again; the data set is divided into a training set and a test set, and the division ratio is 4:
1. Step S44, next, using MATLAB to construct an SVM pattern recognition classifier model and finite state machines of different phases, inputting the above-processed training set into the SVM pattern recognition classifier model for training, and adjusting the SVM pattern recognition classifier model to achieve the optimal accuracy; Step S45: Finally, the recognition result of the SVM pattern recognition classifier model of the gait phase is corresponded to the finite state machine conversion, converted into C language code through MATLAB Embeded coder, and deployed to the embedded platform.
7. A human motion recognition method based on TinyML and MATLAB multi-model deployment according to claim 6, characterized in that: Gait phase markers include the right leg starting to step, right foot support phase, right leg swing phase, left leg swing phase, left leg support phase, left leg starting to step, left leg stopping to step, right leg stopping to step and initial state; Other unknown data are marked as unknown.
8. The method for human motion recognition based on TinyML and MATLAB multi-model deployment according to claim 6, characterized in that: A finite state machine is built on MATLAB to describe the walking state and the judgment of the walking state; the walking process is a cyclic process, and the state machine switching conditions in the cycle are as follows: (1) Initial state: This state is the initial state, which is the static state after the IMU is powered on and calibrated. This state can be dynamically transferred to the left leg starting to swing and the right leg starting to swing; (2) The left leg begins to step forward, from which it can transition to the left foot support phase; (3) Left foot support phase, from which the state can be transferred to the right leg swing phase; (4) right leg swing phase, from which the state can be transferred to the right foot support phase; (5) Right foot support phase, from which the transition to the left leg swing phase can be achieved; (6) left leg swing phase, from which the state can be transferred to the left foot support phase; Similarly, in (2), start with the right leg and the sequence becomes (2) → (5) → (6) → (3) → (4) → (2) and repeat. All state machine transitions jump to the unknown phase exception exit state when encountering an unknown phase.
