Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a gait recognition model establishing method based on electromyographic signals, which can more efficiently and accurately establish a data model for recognizing walking gait of a person.
The embodiment of the invention further aims to solve the technical problem of providing a gait recognition model establishing device based on electromyographic signals, which can more efficiently and accurately establish a data model for recognizing walking gait of a person.
The embodiment of the invention further aims to solve the technical problem of providing a gait recognition method based on electromyographic signals, which can more accurately recognize walking gait of a person.
The embodiment of the invention further aims to solve the technical problem of providing a gait recognition device based on electromyographic signals, which can more accurately recognize walking gait of a person.
In order to solve the technical problem, the embodiment of the invention firstly adopts the following technical scheme: a gait recognition model building method based on electromyographic signals comprises the following steps:
collecting myoelectric signals on muscles playing a key role in lower limb movement on the thigh;
carrying out noise reduction processing on the collected electromyographic signals;
adding a class label representing the corresponding human gait type to the data of the electromyographic signals subjected to noise reduction processing, and then extracting the following electromyographic signal characteristics: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
respectively calculating DBI indexes and SCAT indexes of the extracted electromyographic signal characteristics, and adding the DBI indexes and the SCAT indexes corresponding to the electromyographic signal characteristics to obtain a sum which is used as a comprehensive evaluation result of the electromyographic signal characteristics;
randomly dividing the extracted electromyographic signal characteristics as samples into a training sample group and a testing sample group according to a preset proportion, inputting data of the training sample group into a LightGBM model for training, inputting data of the testing sample group into the LightGBM model for testing, adjusting parameters in the LightGBM model according to training set errors and testing set errors, repeatedly performing the steps of randomly regrouping the samples into the training sample group and the testing sample group, inputting the training sample group and the testing sample group into the LightGBM model for training and testing respectively, and adjusting the parameters in the LightGBM model until obtaining a data model with testing result errors meeting a preset standard, and storing the corresponding relation between the human gait type and the comprehensive evaluation result into the data model.
Further, the critical muscles include at least: the vastus lateralis, vastus medialis, rectus femoris and biceps femoris.
Furthermore, the amplitude of the collected electromyographic signals is within 0-10mv, and the effective frequency is within the range of 10Hz-500 Hz.
Further, the performing noise reduction processing on the collected electromyographic signals specifically includes:
carrying out comb filtering on the collected electromyographic signals to reduce the superposition effect of the signals and noise; and
the comb filtered signal is filtered through an IIR band filter of 10Hz-500 Hz.
Further, the electromyographic signal characteristics are respectively obtained by the following formulas: in the following formula, N represents the number of electromyographic signal samples, χiRepresents the ith electromyographic signal sample,
equation 1: rate of change of slope
Wherein f (χ) ═ 0, if χ is more than or equal to T; 1, otherwise, wherein T is an index threshold value representing muscle contraction level, and the value range is 4-6 mv;
equation 2: williason amplitude
Equation 3: logarithm of variance
Equation 4: length of wave form
Equation 5: wavelet decomposition to obtain decomposition coefficient
Wherein the content of the first and second substances,
is the wavelet basis, b is the transformation parameter, a is the transformation function, a takes the value a 2k, k [1, 2, 3 … 7];
Equation 6: feature(s)
Wherein k is 7.
Further, the DBI index is used for evaluating the overall separability, and the calculation method is as follows:
equation 7:
wherein, the lambda is 6, which represents six human gait types, S
iAnd S
jIs the distribution of the ith and jth clusters, which refer to the set of data characteristics of each human gait type, D
i,jRepresents S
iAnd S
jThe distance between them;
the SCAT index is used for evaluating the separability between classes, and the calculation formula is as follows:
equation 8:
wherein S is
wIs a covariance matrix of all classes, S
BIs a covariance matrix between classes.
Further, the sum of the DBI index and the SCAT index corresponding to each electromyographic signal characteristic is larger than zero, the sum of the DBI index and the SCAT index of the slope change rate characteristic is smaller than 0.7, the sum of the DBI index and the SCAT index of the Williason amplitude characteristic is smaller than 1.3, the sum of the DBI index and the SCAT index of the logarithm of variance is smaller than 1.0, the sum of the DBI index and the SCAT index of the waveform length is smaller than 1.2, and the sum of the DBI index and the SCAT index of the characteristic DB7-MAV is smaller than 1.5.
On the other hand, an embodiment of the present invention further provides a gait recognition model establishing apparatus based on an electromyographic signal, including:
the signal acquisition module is used for acquiring myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
the noise reduction module is used for carrying out noise reduction processing on the collected electromyographic signals;
the feature extraction module is used for adding a class label representing the corresponding human gait type to the data of the electromyographic signals subjected to noise reduction processing and then extracting the following electromyographic signal features: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
the index evaluation module is used for respectively calculating DBI indexes and SCAT indexes of the extracted electromyographic signal characteristics, and adding the DBI indexes and the SCAT indexes corresponding to the electromyographic signal characteristics to obtain a sum which is used as a comprehensive evaluation result of the electromyographic signal characteristics;
the training and testing module is used for randomly dividing the extracted electromyographic signal characteristics into a training sample group and a testing sample group according to a preset proportion by taking the extracted electromyographic signal characteristics as samples, inputting data of the training sample group into the LightGBM model for training, inputting data of the testing sample group into the LightGBM model for testing, adjusting parameters in the LightGBM model according to training set errors and testing set errors, repeating the steps of randomly grouping the samples into the training sample group and the testing sample group again, inputting the training sample group and the testing sample group into the LightGBM model for training and testing and adjusting the parameters in the LightGBM model respectively until a data model with a testing result error meeting a preset standard is obtained, and storing the corresponding relation between the human body gait type and the comprehensive evaluation result into the data model.
In another aspect, an embodiment of the present invention further provides a gait recognition method based on an electromyographic signal, including the following steps:
collecting myoelectric signals on muscles playing a key role in lower limb movement on the thigh;
carrying out noise reduction processing on the collected electromyographic signals;
extracting the following five electromyographic signal characteristics from the electromyographic signals subjected to noise reduction treatment: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and DB7-MAV characteristics, wherein the DB7-MAV characteristics are obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and performing MAV function operation on the decomposition coefficient C;
respectively calculating DBI indexes and SCAT indexes of the extracted electromyographic signal characteristics, and adding the DBI indexes and the SCAT indexes corresponding to the electromyographic signal characteristics to obtain a sum which is used as a comprehensive evaluation result of the electromyographic signal characteristics;
and determining the human body gait type corresponding to the comprehensive evaluation result from the data model which is pre-established according to the method.
In another aspect, an embodiment of the present invention further provides a gait recognition device based on an electromyographic signal, including:
the signal acquisition module is used for acquiring myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
the noise reduction module is used for carrying out noise reduction processing on the collected electromyographic signals;
the feature extraction module is used for extracting the following electromyographic signal features from the electromyographic signals subjected to noise reduction processing: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
the index evaluation module is used for respectively calculating DBI indexes and SCAT indexes of the extracted electromyographic signal characteristics, and adding the DBI indexes and the SCAT indexes corresponding to the electromyographic signal characteristics to obtain a sum which is used as a comprehensive evaluation result of the electromyographic signal characteristics;
the operation module is used for determining the human gait type corresponding to the comprehensive evaluation result from a pre-established data model according to the comprehensive evaluation result; and
and the storage module is used for storing the pre-established data model.
By adopting the technical scheme, the embodiment of the invention at least has the following beneficial effects: according to the embodiment of the invention, through extracting the slope change rate, Williason amplitude, logarithm of variance, waveform length, characteristic DB7-MAV and other electromyographic signal characteristics of the electromyographic signals on the muscles playing a key role in lower limb movement and combining DBI indexes and SCAT indexes to carry out calculation and evaluation, a data model can be established more efficiently and accurately, and by applying the data model, when a human body walks at the speed of 3km/h, the gait recognition rate can reach 97.3%, and the recognition result is more reliable. Has great value in the fields of bionic legs, exoskeletons and the like. Meanwhile, the embodiment of the invention only needs to collect the myoelectric signals of muscles playing a key role in the lower limb movement on the thigh of the human body, and the collected signal data volume is relatively small, thereby being more convenient for practical operation.
Detailed Description
The invention is described in further detail below with reference to the figures and specific examples. It is to be understood that the following illustrative embodiments and description are only intended to illustrate the present invention, and are not intended to limit the present invention, and features of the embodiments and examples of the present invention may be combined with each other without conflict.
As shown in fig. 1, an alternative embodiment of the present invention provides a gait recognition model building method based on electromyographic signals, including the following steps:
step S11, collecting myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
step S12, carrying out noise reduction processing on the collected electromyographic signals;
step S13, adding a class label representing the human gait type corresponding to the data of the electromyographic signals subjected to noise reduction processing, and then extracting the following electromyographic signal characteristics: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
step S14, calculating DBI index and SCAT index of each extracted electromyographic signal characteristic, and adding the DBI index and the SCAT index corresponding to each electromyographic signal characteristic to obtain a comprehensive evaluation result of the electromyographic signal characteristic;
step S15, randomly dividing each extracted electromyographic signal characteristic as a sample into a training sample group and a testing sample group according to a preset proportion, inputting the data of the training sample group into a LightGBM model for training, inputting the data of the testing sample group into the LightGBM model for testing, adjusting the parameters in the LightGBM model according to the training set errors and the testing set errors, repeatedly performing the steps of randomly regrouping the samples into the training sample group and the testing sample group, inputting the samples into the LightGBM model for training and testing and adjusting the parameters in the LightGBM model respectively until obtaining a data model with the testing result errors meeting a preset standard, and storing the corresponding relation between the human body gait type and the comprehensive evaluation result into the data model.
In a specific embodiment, the parameters in the LightGBM model are mainly as shown in table 1 below:
TABLE 1
The parameters can be adjusted as necessary after each round of training and testing, so that the finally obtained model can achieve the test error result.
In one embodiment, the correspondence between the various human gait types and the overall assessment result is as follows:
TABLE 2
In specific application, comprehensive evaluation results of all the characteristics are obtained through detection and calculation, and then the corresponding human gait types can be inquired and determined in the relation table shown in the table 2 through the data model.
According to the embodiment of the invention, through extracting the slope change rate, Williason amplitude, logarithm of variance, waveform length, characteristic DB7-MAV and other electromyographic signal characteristics of the electromyographic signals on the muscles playing a key role in lower limb movement and combining DBI indexes and SCAT indexes to carry out calculation and evaluation, a data model can be established more efficiently and accurately, and by applying the data model, when a human body walks at the speed of 3km/h, the gait recognition rate can reach 97.3%, and the recognition result is more reliable. Has great value in the fields of bionic legs, exoskeletons and the like. Meanwhile, the embodiment of the invention only needs to collect the myoelectric signals of muscles playing a key role in the lower limb movement on the thigh of the human body, and the collected signal data volume is relatively small, thereby being more convenient for practical operation.
In an alternative embodiment of the invention, said critical muscles comprise at least: the vastus lateralis, vastus medialis, rectus femoris and biceps femoris. In the embodiment, only a few myoelectric signals of muscles playing a key role in lower limb movement on the thigh of the human body are required to be acquired, the acquired signal data volume is relatively small, and gait change characteristics can be reflected more accurately.
In another optional embodiment of the invention, the collected electromyographic signals have an amplitude within 0-10mv and an effective frequency within a range of 10Hz-500 Hz. According to the embodiment of the invention, the gait change characteristics can be more accurately reflected by collecting the electromyographic signals within the numerical range, invalid operation caused by a large amount of invalid data is avoided, and the data processing efficiency and accuracy are improved.
In another optional embodiment of the present invention, the performing noise reduction processing on the collected electromyographic signals specifically includes: carrying out comb filtering on the collected electromyographic signals to reduce the superposition effect of the signals and noise; and
the comb filtered signal is filtered through an IIR band filter of 10Hz-500 Hz.
In the embodiment, the comb filtering is performed firstly, and then the IIR band filter is used for filtering, so that invalid interference data can be effectively filtered, and the accuracy of the established model is improved.
In yet another alternative embodiment of the present invention, the electromyographic signal characteristics are respectively obtained by the following formulas: in the following formula, N represents the number of electromyographic signal samples, χiRepresents the ith electromyographic signal sample,
equation 1: rate of change of slope
Wherein f (χ) ═ 0, if χ is more than or equal to T; 1, otherwise, wherein T is an index threshold value representing muscle contraction level, and the value range is 4-6 mv;
equation 2: williason amplitude
Equation 3: logarithm of variance
Equation 4: length of wave form
Equation 5: wavelet decomposition to obtain decomposition coefficient
Wherein the content of the first and second substances,
is the wavelet basis, b is the transformation parameter, a is the transformation function, a takes the value a 2k, k [1, 2, 3 … 7];
Equation 6: feature(s)
Wherein k is 7.
In the embodiment, each electromyographic signal characteristic is obtained through calculation by the formula, and the processing efficiency and the accuracy are high.
In another optional embodiment of the present invention, the DBI index is used to evaluate overall separability, and the calculation method is as follows:
equation 7:
wherein, the lambda is 6, which represents six human gait types, S
iAnd S
jIs the distribution of the ith and jth clusters, which refer to the set of data characteristics of each human gait type, D
i,jRepresents S
iAnd S
jThe distance between them;
the SCAT index is used for evaluating the separability between classes, and the calculation formula is as follows:
equation 8:
wherein S is
wIs a covariance matrix of all classes, S
BIs a covariance matrix between classes.
According to the embodiment, the DBI index and the SCAT index can be calculated and obtained more accurately through the formula.
In another optional embodiment of the invention, the sum of the DBI index and the SCAT index corresponding to each electromyographic signal characteristic is greater than zero, the sum of the DBI index and the SCAT index corresponding to the slope rate characteristic is less than 0.7, the sum of the DBI index and the SCAT index corresponding to the Williason amplitude characteristic is less than 1.3, the sum of the DBI index and the SCAT index corresponding to the logarithm of variance is less than 1.0, the sum of the DBI index and the SCAT index corresponding to the waveform length is less than 1.2, and the sum of the DBI index and the SCAT index corresponding to the characteristic DB7-MAV is less than 1.5. In the embodiment, the range of the sum of the DBI index and the SCAT index is limited, and data outside the range can be excluded, so that the characteristics of the electromyographic signals can be more accurately reflected.
On the other hand, as shown in fig. 2, an embodiment of the present invention further provides a gait recognition model establishing apparatus based on an electromyographic signal, including:
the signal acquisition module 11 is used for acquiring myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
the noise reduction module 12 is configured to perform noise reduction processing on the acquired electromyographic signals;
the feature extraction module 13 is configured to add a class tag representing a human gait type corresponding to the data of the electromyographic signal subjected to noise reduction processing, and then extract the following electromyographic signal features: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
the index evaluation module 14 is used for calculating the DBI index and the SCAT index of each extracted electromyographic signal characteristic respectively, and adding the DBI index and the SCAT index corresponding to each electromyographic signal characteristic to obtain a comprehensive evaluation result of the electromyographic signal characteristic;
the training and testing module 15 is configured to randomly divide the extracted electromyographic signal features into a training sample group and a testing sample group according to a predetermined ratio, input data of the training sample group into the LightGBM model for training, input data of the testing sample group into the LightGBM model for testing, adjust parameters in the LightGBM model according to a training set error and a testing set error, repeat the steps of re-randomly grouping the samples into the training sample group and the testing sample group, inputting the training sample group and the testing sample group into the LightGBM model for training and testing, and adjusting the parameters in the LightGBM model until a data model is obtained, where an error of a testing result meets a predetermined standard, and store a corresponding relationship between a human gait type and the comprehensive assessment result in the data model.
According to the embodiment of the invention, the slope change rate, Williason amplitude, logarithm of variance, waveform length, characteristic DB7-MAV and other electromyographic signal characteristics of the electromyographic signals on muscles playing a key role in lower limb movement are extracted through the signal acquisition module 10, the corresponding electromyographic signal characteristics are extracted through the characteristic extraction module 14 after the noise reduction module 12 reduces noise, calculation and evaluation are carried out through the index evaluation module 16 in combination with DBI indexes and SCAT indexes, and finally, the training and testing module 18 can more efficiently and accurately establish a data model through mass data training and testing, and by applying the data model, when a human body walks at the speed of 3km/h, the gait recognition rate can reach 97.3%, and the recognition result is more reliable. Has great value in the fields of bionic legs, exoskeletons and the like. Meanwhile, the embodiment of the invention only needs to collect the myoelectric signals of muscles playing a key role in the lower limb movement on the thigh of the human body, and the collected signal data volume is relatively small, thereby being more convenient for practical operation.
In another aspect, as shown in fig. 3, an embodiment of the present invention further provides a gait recognition method based on an electromyographic signal, including the following steps:
step S21, collecting myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
step S22, carrying out noise reduction processing on the collected electromyographic signals;
step S23, extracting the following five electromyographic signal characteristics from the electromyographic signal subjected to noise reduction processing: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and DB7-MAV characteristics, wherein the DB7-MAV characteristics are obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and performing MAV function operation on the decomposition coefficient C;
step S24, calculating DBI index and SCAT index of each extracted electromyographic signal characteristic, and adding the DBI index and the SCAT index corresponding to each electromyographic signal characteristic to obtain a comprehensive evaluation result of the electromyographic signal characteristic;
and step S25, determining the human body gait type corresponding to the comprehensive evaluation result from the data model pre-established according to any one of the methods according to the comprehensive evaluation result.
According to the embodiment of the invention, the slope change rate, Williason amplitude, logarithm of variance, waveform length, characteristic DB7-MAV and other electromyographic signal characteristics of the electromyographic signals on the muscles playing a key role in lower limb movement are extracted, calculation evaluation is carried out by combining a DBI index and an SCAT index, finally, the gait type corresponding to comprehensive evaluation is obtained through a pre-established data model, the accuracy is high, the identification process is simple and easy to operate, when a human body walks at the speed of 3km/h, the gait identification rate can reach 97.3%, and the identification result is more reliable. Has great value in the fields of bionic legs, exoskeletons and the like. Meanwhile, the embodiment of the invention only needs to collect the myoelectric signals of muscles playing a key role in the lower limb movement on the thigh of the human body, and the collected signal data volume is relatively small, thereby being more convenient for practical operation.
In another aspect, as shown in fig. 4, an embodiment of the present invention further provides a gait recognition device based on electromyographic signals, including:
the signal acquisition module 21 is used for acquiring myoelectric signals of muscles playing a key role in lower limb movement on the thigh;
the noise reduction module 22 is configured to perform noise reduction processing on the acquired electromyographic signals;
the feature extraction module 23 is configured to extract the following electromyographic signal features from the electromyographic signals subjected to the noise reduction processing: the system comprises a slope rate, a Williason amplitude, a variance logarithm, a waveform length and a characteristic DB7-MAV, wherein the characteristic DB7-MAV is a characteristic obtained by performing DB7 wavelet decomposition on electromyographic signals of a 50hz-100hz frequency band to obtain a decomposition coefficient C and then performing MAV function operation on the decomposition coefficient C;
the index evaluation module 24 is configured to calculate a DBI index and an SCAT index of each extracted electromyographic signal feature, and add the DBI index and the SCAT index corresponding to each electromyographic signal feature to obtain a sum, which is a comprehensive evaluation result of the electromyographic signal feature;
the operation module 25 is used for operating a pre-established data model and determining a gait type corresponding to a comprehensive evaluation result according to the comprehensive evaluation result; and
a storage module 26, configured to store the pre-established data model.
According to the embodiment of the invention, the slope change rate, Williason amplitude, logarithm of variance, waveform length, characteristic DB7-MAV and other electromyographic signal characteristics of the electromyographic signals on muscles playing a key role in lower limb movement are extracted through the signal acquisition module 21, the corresponding electromyographic signal characteristics are extracted through the characteristic extraction module 23 after noise reduction is carried out through the noise reduction module 22, calculation and evaluation are carried out through the index evaluation module 24 in combination with DBI indexes and SCAT indexes, finally, the pre-established data model is operated through the operation module 25, gait can be identified more efficiently and accurately, when a human body walks at the speed of 3km/h, the gait identification rate can reach 97.3%, and the identification result is more reliable. Has great value in the fields of bionic legs, exoskeletons and the like. Meanwhile, the embodiment of the invention only needs to collect the myoelectric signals of muscles playing a key role in the lower limb movement on the thigh of the human body, and the collected signal data volume is relatively small, thereby being more convenient for practical operation.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.