Motion Data Recognition Method, Device, Electronic Device and Storage Medium
By using the motion type recognition model and the connectionist time classification CTC loss function in wearable devices, the motion data is classified and identified and decoded, which solves the problem of insufficient motion data recognition in the prior art, and achieves higher recognition accuracy and user experience.
Patent Information
- Application Number
- CN202011205238.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-02
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2040-11-02
AI Technical Summary
Existing wearable devices are difficult to accurately identify complex motion data, resulting in insufficient identification of motion information.
The motion type identification model is adopted, and the acceleration data and angular velocity data are collected, and the connectionist time classification CTC loss function is used for classification and identification, and the output information is divided and merged, and decoded information is generated to identify the motion type and number of times.
It improves the accuracy and versatility of motion data recognition, reduces the difficulty of sample annotation, enhances the function of motion recognition, and improves the user experience.
Smart Images

Figure CN114528891B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wearable devices, and in particular, to a method, device, electronic device, and storage medium for identifying motion data. Background Art
[0002] In recent years, wearable devices have been widely popularized due to their rich functions and portability, and people's requirements for the intelligence of wearable devices are also getting higher and higher. In particular, for wearable devices with motion data detection functions, since they can detect the motion status of the wearer and facilitate people to understand their own motion status at any time, they have attracted more extensive attention.
[0003] In related technologies, wearable devices can only detect and identify simple motions of the wearer, such as walking, running, etc. However, fitness exercises are complex and diverse. How to accurately identify the motion information of the wearer has become one of the important research directions. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems in the related technologies to some extent.
[0005] To this end, the first object of the present invention is to propose a method for identifying motion data to accurately identify the type of motion data and the number of occurrences of each motion type.
[0006] The second object of the present invention is to propose a device for identifying motion data.
[0007] The third object of the present invention is to propose a wearable device.
[0008] The fourth object of the present invention is to propose a computer device.
[0009] The fifth object of the present invention is to propose a non-transitory computer-readable storage medium.
[0010] To achieve the above object, an embodiment of the first aspect of the present invention proposes a method for identifying motion types, including: collecting a plurality of motion data to be classified and identified; inputting the plurality of motion data into a motion type identification model for classification and identification to obtain a set of output information output by the motion type identification model, where the output information includes type tags output after the motion type identification model performs classification and identification; dividing the output information into information segments, where each divided information segment includes at least one type tag, and merging the same and continuously appearing type tags in the information segment to generate first decoded information; and obtaining the motion types involved in the plurality of motion data and the number of times of each motion type corresponding thereto according to the first decoded information.
[0011] According to an embodiment of the present application, the same and continuously occurring type tags in the information segment are merged to generate first decoded information, including: for each information segment, obtaining a character group that carries the same type tag and is consecutive within the information segment, and using one character in the character group to represent the character group during decoding; splicing the remaining characters and the representative character of the character group according to the positions of the characters in the information segment to form second decoded information corresponding to the information segment; splicing the second decoded information to obtain the first decoded information.
[0012] According to an embodiment of the present application, splicing the second decoded information to obtain the first decoded information, including: splicing the second decoded information corresponding to each information segment in the order of the positions of the information segments in the output information to obtain the first decoded information.
[0013] According to an embodiment of the present application, obtaining the motion types involved in multiple motion data and the number of times of each motion type, including: obtaining the values of the characters in the first decoded information, and determining the motion types involved in the multiple motion data according to the values of the characters; counting the number of characters with the same value in the first decoded information, where the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
[0014] According to an embodiment of the present application, dividing the output information into information segments, including: identifying the interval identifiers in the output information; extracting the characters between adjacent interval identifiers to form an information segment.
[0015] According to an embodiment of the present application, the interval identifier includes a blank character.
[0016] According to an embodiment of the present application, the motion data includes at least acceleration data and angular velocity data.
[0017] The motion data recognition method of the embodiment of the present application uses a motion type recognition model to perform type recognition on multiple motion data and can obtain the number of times of the motion type, effectively improving the recognition accuracy and versatility of the motion data.
[0018] To achieve the above object, an embodiment of the second aspect of the present invention provides a motion data recognition device, including: a collection module, configured to collect a plurality of motion data that needs to be classified and recognized; a first acquisition module, configured to input the plurality of motion data into a motion type recognition model for classification and recognition, so as to obtain a set of output information output by the motion type recognition model, where the output information includes type labels output after the motion type recognition model performs classification and recognition; a decoding module, configured to divide the output information into information segments, where the divided information segments include at least one type label, and merge the same and continuously appearing type labels in the information segments to generate first decoded information; a second acquisition module, configured to obtain the motion types involved in the plurality of motion data and the number of times of each motion type according to the first decoded information.
[0019] According to an embodiment of the present application, the decoding module is further configured to: for each information segment, obtain a character group that carries the same type label and is continuous within the information segment, and use one character in the character group to represent the character group during decoding; splice the remaining characters and the representative character of the character group according to the positions of the characters in the information segment to form second decoded information corresponding to the information segment; splice the second decoded information to obtain the first decoded information.
[0020] According to an embodiment of the present application, the decoding module is further configured to: splice the second decoded information corresponding to each information segment according to the position order of the information segments in the output information to obtain the first decoded information.
[0021] According to an embodiment of the present application, the second acquisition module is further configured to: obtain the value of the character in the first decoded information, and determine the motion types involved in the plurality of motion data according to the value of the character; count the number of characters with the same value in the first decoded information, where the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
[0022] According to an embodiment of the present application, the decoding module is further configured to: recognize the interval identifiers in the output information; extract the characters between adjacent interval identifiers to form an information segment.
[0023] According to an embodiment of the present application, the interval identifier includes a blank character.
[0024] According to an embodiment of the present application, the motion data includes at least acceleration data and angular velocity data.
[0025] To achieve the above object, an embodiment of the third aspect of the present invention provides a wearable device, including the motion data recognition device described in the second aspect above.
[0026] To achieve the above object, an embodiment of the fourth aspect of the present invention provides an electronic device, including a memory and a processor; wherein, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the motion data recognition method described in the first aspect above.
[0027] To achieve the above object, an embodiment of the fifth aspect of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the motion data recognition method described in the first aspect above.
[0028] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of the embodiments in conjunction with the drawings, wherein:
[0030] Figure 1 is a flowchart of a motion data recognition method according to an embodiment of the present application;
[0031] Figure 2 is a flowchart of a motion data recognition method according to another embodiment of the present application;
[0032] Figure 3 is a schematic diagram of the principle of the information segment decoding process according to a specific embodiment of the present application;
[0033] Figure 4 is a flowchart of a motion data recognition method according to still another embodiment of the present application;
[0034] Figure 5 is a schematic diagram of the decoding result of motion data according to a specific embodiment of the present application;
[0035] Figure 6 is a block diagram of a motion data recognition device according to an embodiment of the present application;
[0036] Figure 7 is a schematic diagram of the structure of a wearable device provided by an embodiment of the present application;
[0037] Figure 8 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where like or similar reference numerals denote like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present invention, and should not be construed as limiting the present invention.
[0039] The motion data recognition method, device, electronic device and storage medium according to embodiments of the present invention will be described below with reference to the accompanying drawings.
[0040] Figure 1 The flowchart of the motion data recognition method according to an embodiment of the present application is shown. It should be noted that the execution subject of the motion data recognition method in this embodiment is a motion data recognition device, and the motion data recognition device can be specifically a hardware device or software in a hardware device. Among them, the hardware device can be a terminal device, a wearable device, a server, etc. As Figure 1 shown, it specifically includes the following steps:
[0041] Step 101, collect a plurality of motion data to be classified and recognized.
[0042] It should be noted that the present application is mainly applied to the recognition of motion data, and can be collected by sampling devices such as acceleration sensors and gyroscopes provided in wearable devices that can detect motion information.
[0043] Optionally, the data collected by the acceleration sensor can be acceleration data, specifically three-axis acceleration information, and the data collected by the gyroscope can be angular velocity data, specifically three-axis gyroscope information.
[0044] Step 102, input the plurality of motion data into a motion type recognition model for classification and recognition to obtain a set of output information output by the motion type recognition model, where the output information includes type labels output after the motion type recognition model performs classification and recognition.
[0045] In the related art, when annotating model recognition samples, in order to achieve the recognition of motion categories and the statistics of the number of runs, it is usually necessary to mark the start time and end time of each action. Such a marking method is not only difficult but also has a huge workload. Specifically, since the detection signals of acceleration sensors and gyroscopes are very abstract, it is not only difficult to mark the start position and end position of each action on the signal curve due to the influence of curve quality, but also the start and end positions selected may be different due to different annotators' understandings of motion, that is, there are deviations in the marked positions.
[0046] Therefore, a motion type recognition model using the Connectionist Temporal Classification (CTC) loss function is proposed. Specifically, the motion type recognition model can adopt a neural network model with a structure of CNN or a combination of CNN and RNN, and use the Connectionist Temporal Classification (CTC) function as the loss function. Thus, by using the Connectionist Temporal Classification (CTC) loss function, the annotation scope is relaxed. Only the entire motion needs to be annotated as a whole, and the annotation includes the start time, end time, motion type, and number of motions of the entire motion. There is no need to refine each action, and for the annotated time, it is not necessary to be completely aligned. That is, the annotated start time can be slightly earlier than the actual start, and the annotated end time can be slightly later than the actual end time, thereby greatly reducing the difficulty of annotating the sample set during the model training process.
[0047] For example, the motion type recognition model adopts a neural network structure of CNN or a combination of CNN and RNN. That is, features can be directly extracted by the convolutional structure, or temporal features can be further extracted by RNN on the basis of convolutional feature extraction. Further, 2 - 3 layers of convolution can be connected after the neural network to act as a classification layer. Suppose there are currently 20 motion categories, such as skipping rope, jumping jacks, etc. The type labels of each category obtained by the motion type recognition model can be marked as i, where i ∈ [1, 20] and i is a positive integer. That is, when multiple motion data are input into the motion type recognition model to classify and recognize the multiple motion data through the model, a set of output information expressing the recognition results through type labels can be obtained.
[0048] It should also be noted that the motion type recognition model can adopt either an offline inference method or an online inference method. When using offline inference, multiple motion data collected over a period of time can be input into the motion type recognition model as a whole. Among them, the multiple motion data collected over a period of time are in a 6×t dimension. Through the classification and recognition of the motion type recognition model, a one-dimensional output with a length of t / a can be obtained, where t is the time and a is the downsampling factor. When using online inference, the length of the data input each time is s, and the step is a, where s is the size of the receptive field and a is the downsampling factor. Each time, an output information with a length of 1 can be obtained. Arranging the output information each time in order can obtain a one-dimensional output with a length of t / a.
[0049] Step 103: Divide the output information into information segments, where the divided information segments include at least one type label, and merge the same and continuously appearing type labels in the information segments to generate the first decoded information.
[0050] It should be noted that since the motion type recognition model adopted in this application outputs the type identifications of multiple motion data, when there is a large amount of motion data, by dividing the output information into information segments and then analyzing multiple information segments simultaneously, the decoding efficiency of the output information can be effectively improved, and the speed and efficiency of motion data type recognition can be effectively enhanced.
[0051] Since it is the recognition of an entire motion, the output information may include multiple motion segments. The length of each motion segment may be the same or different, and the motion types to which they belong (i.e., the type tags they have) may be the same or different. There may be motion gaps between multiple motion segments. Therefore, this application can utilize the motion gaps to divide the output information into segments, that is, divide an entire motion into multiple motion actions, and then decode and analyze each motion action. It should be understood that a motion action may include an independent action or multiple coherent actions.
[0052] It should be noted that a motion action can be continuously executed multiple times to form a type of motion. When the motion data corresponding to this group of motions is input into the motion type recognition model for recognition, there are often repeated and consecutive type tags in the recognition result. However, in fact, this repeated and consecutive type tag does not mean that the same type of motion has been repeated and consecutive in a standard manner. It only indicates that the same action of this type of motion has been continuously executed. Therefore, in this application, the same and continuously appearing type tags in the information segment are merged to generate the first decoded information, that is, the multiple actions of the same motion are essentially merged, which can avoid double-counting the consecutive same actions in the motion and improve the accuracy of counting.
[0053] Step 104: According to the first decoded information, obtain the motion types involved in the multiple motion data and the number of times each motion type occurs.
[0054] After obtaining the first decoded information corresponding to the motion data, the first decoded information can be parsed to extract the carried type tags, so that the motion types involved in the motion data can be determined. Further, the same type tags can be counted, and then the number of times each motion type occurs can be determined.
[0055] Therefore, the motion data recognition method according to the embodiments of the present application analyzes multiple motion data through a motion type recognition model, and can determine the motion type to which the motion data belongs according to the motion data, effectively improving the accuracy and generality of the recognition of the motion data type. At the same time, the connectionist temporal classification CTC is used as the loss function, which greatly reduces the difficulty of sample annotation, effectively improves the generalization ability of the motion type recognition model, and can count the number of times the motion type appears during the entire motion process, increasing the recognition function of motion recognition and improving the user experience.
[0056] As a feasible embodiment, the division of the output information into information segments includes: identifying the interval identifiers in the output information, and extracting the characters between adjacent interval identifiers to form an information segment.
[0057] Among them, the interval identifier includes a blank character, such as "0".
[0058] It should be noted that the role of the blank character is to separate two identical actions. For example, when the user does jumping jacks, the following may occur: (1) The user completes one jumping jack action in three seconds; (2) The user completes one jumping jack action in one second and then rests for 1 s and then does the next jumping jack action in one second. At this time, in order to prevent the action in (2) from being misidentified as the slow action in (1), blank characters are added to the output information of the motion type recognition model to separate the same multiple actions. For example, if the type label of jumping jacks is assumed to be 1 and 1 character is output per second, the output information of (1) can be expressed as 111 to indicate that the same jumping jack action is completed within three seconds, while the output information of (2) can be expressed as 101 to indicate that two jumping jack actions are completed within three seconds. Thus, according to the interval identifier, it can be determined that the two identical type labels before and after are two actions, effectively avoiding misjudging continuous multiple actions as a slow action of one action and greatly improving the accuracy of action counting.
[0059] It should be understood that the blank character can also be used to separate any two adjacent actions. For example, when a push-up action is followed by a jumping jack, assuming that the type label of the jumping jack is 1 and the type label of the push-up is 2 at this time, the output result can be 201. Thus, the interval identifier can be used to separate one action from the actions before and after, facilitating the counting of actions.
[0060] Among them, the same and continuously appearing type labels in the information segment are merged to generate the first decoded information corresponding to the output information, as Figure 2 shown, specifically including:
[0061] Step 201: For each information segment, obtain a character group that carries the same type of tag and is continuous within the information segment, and use one character in the character group to represent the character group during decoding.
[0062] For each information segment, identify each character in the information segment and extract the value of each character. Among them, different values represent different type tags. For example, if the character values carried in the first information segment are i = 1 and i = 2, it means that the multiple motion data corresponding to the first information segment involve two motion types. If the character values carried in the second information segment are i = 2 and i = 3, it means that the multiple target data motion data corresponding to the second information segment involve two motion types.
[0063] After obtaining the output information using the motion type recognition model, although the one-dimensional output information is divided into multiple segments using the interval identifier, at this time, the information segment may still contain the interval identifier. By identifying each character, only the type tags carried in the segment can be extracted, that is, the interval identifier inside the segment is removed to reduce the data processing volume of subsequent type recognition.
[0064] Furthermore, when identifying each type tag in the information segment, it can be further determined whether the current type tag is the same as the previous type tag. If so, use the current type tag or the previous type tag to represent the current type and the previous type tag, that is, the previous type tag and the current type tag are represented as one type tag. If not, retain the two type tags of the previous type tag and the current type tag.
[0065] For example, as Figure 3 shown, a character group of three consecutive type tags of the same type "111" can be represented by "1", a character group of two consecutive type tags of the same type "22" can be represented by "2", and a single type tag "1" is represented by itself because there are no connected and identical type tags before and after it.
[0066] It should be understood that since the operation of representing with one character occurs within the information segment, that is, although multiple characters are sequentially connected, they are essentially part of one action. Therefore, representing them with one character can effectively reduce the redundant data in one action, that is, using one character to represent one action.
[0067] Step 202: Concatenate the remaining characters and the representative characters of the character groups according to the positions of the characters in the information segment to form the second decoded information corresponding to the information segment.
[0068] That is to say, as Figure 3As shown, after using a single character to represent multiple type identifiers within a piece of information respectively, the multiple characters used for representation are concatenated to obtain the second decoded information corresponding to the piece of information.
[0069] Step 203: Concatenate the second decoded information to obtain the first decoded information.
[0070] It should be understood that for multiple pieces of motion data originally input into the motion type recognition model, which have multiple pieces of information. Optionally, after decoding each piece of information as described above, in order to avoid multiple statistics, it is also necessary to concatenate the second decoded information of multiple pieces of information to obtain the first decoded information corresponding to the multiple pieces of motion data.
[0071] Among them, since two identical actions separated by the interval identifier do not belong to the same piece of information, adjacent identical actions will not be misrepresented together. That is, each character after concatenation identifies one action.
[0072] As a possible implementation method, according to the position order of the pieces of information in the output information, for the second decoded information corresponding to each piece of information, the first decoded information corresponding to the output information is obtained. As Figure 3 shown, after sequentially concatenating multiple pieces of second decoded information "1", "2", "1", "1", the first decoded information "1211" can be obtained. As a possible implementation method, according to the first decoded information, the motion types and the number of occurrences of the multiple pieces of motion data are obtained. As Figure 4 shown, it specifically includes:
[0073] Step 301: Obtain the values of the characters in the first decoded information, and determine the motion types involved in the multiple pieces of motion data according to the values of the characters.
[0074] After obtaining the first decoded information, each character carried in the first decoded information can be recognized to obtain the value of each character. Among them, different values represent different motion types, as detailed in the records of the above embodiments. After obtaining the values of each character, the motion types involved in each piece of motion data can be determined.
[0075] Step 302: Count the number of characters with the same value in the first decoded information. Among them, the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
[0076] Optionally, count the number of characters with the same value carried in the first decoded information, that is, count the number of occurrences of the motion type represented by the same type label.
[0077] That is to say, through the decoding operation, the same action expressed by multiple type identifiers is extracted, and the type identifier of this action is used to continue to represent this action. Thus, by only counting the type identifiers in the first decoding information, the statistics of the types and occurrences of multiple motion data responses can be realized.
[0078] For example, as Figure 3 shown, after decoding the output information, it can be known that it means that the user performed a motion of the first type identifier once and then a motion of the second type identifier once, and then continuously performed two motions of the first type identifier. As Figure 4 shown, it represents the data of jumping jacks - rest - push - ups - rest - jumping jacks.
[0079] In summary, the motion data recognition method of the embodiment of the present application analyzes multiple motion data through a motion type recognition model, can determine the motion type to which the motion data belongs according to the motion data, and effectively improves the accuracy and generality of the recognition of the motion data type. At the same time, using the Connectionist Temporal Classification (CTC) as the loss function greatly reduces the difficulty of sample annotation, effectively improves the generalization ability of the motion type recognition model, and can count the number of times the motion type appears in the entire motion process, increasing the recognition function of motion recognition and improving the user experience.
[0080] To implement the above embodiment, the present invention also proposes a motion data recognition device.
[0081] Figure 5 It is a block diagram of the motion data recognition device of the embodiment of the present application. As Figure 5 shown, the motion data recognition device 10 of the embodiment of the present application includes: a collection module 11, a first acquisition module 12, a decoding module 13, and a second acquisition module 14.
[0082] Among them, the collection module 11 is used to collect multiple motion data that need to be classified and recognized.
[0083] The first acquisition module 12 is used to input multiple motion data into the motion type recognition model for classification and recognition to obtain a set of output information output by the motion type recognition model, where the output information includes the type labels output after the motion type recognition model performs classification and recognition.
[0084] The decoding module 13 is used to divide the output information into information segments, where the divided information segments include at least one type label, and merge the same and continuously appearing type labels in the information segments to generate the first decoding information.
[0085] The second acquisition module 14 is configured to obtain the motion types involved in multiple motion data and the number of times of each corresponding motion type according to the first decoding information.
[0086] Further, the decoding module 13 is further configured to: for each information segment, obtain a character group that carries the same type of tag and is consecutive within the information segment, and use one character in the character group to represent the character group during decoding, and splice the remaining characters and the representative character of the character group according to the positions of the characters in the information segment to form the second decoding information corresponding to the information segment; splice the second decoding information to obtain the first decoding information.
[0087] Further, the decoding module 13 is further configured to: splice the second decoding information corresponding to each information segment in the order of the positions of the information segments in the output information to obtain the first decoding information.
[0088] Further, the second acquisition module 14 is further configured to: obtain the values of the characters in the first decoding information, determine the motion types involved in the multiple motion data according to the values of the characters, and count the number of characters with the same value in the first decoding information, where the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
[0089] Further, the decoding module 13 is further configured to: identify the interval identifiers in the output information, and extract the characters between adjacent interval identifiers to form one information segment.
[0090] Further, the interval identifier includes a blank character.
[0091] Further, the motion data at least includes acceleration data and angular velocity data.
[0092] It should be noted that the foregoing explanations of the embodiments of the motion data recognition method also apply to the motion data recognition device of this embodiment, and will not be elaborated here.
[0093] In summary, the motion data recognition device of the embodiment of the present application can parse multiple motion data through a motion type recognition model, determine the motion types to which they belong according to the motion data, and effectively improve the accuracy and generality of motion data type recognition. At the same time, using the connectionist temporal classification CTC as the loss function greatly reduces the difficulty of sample annotation, effectively improves the generalization ability of the motion type recognition model, and can count the number of times the motion type appears in the entire motion process, increasing the recognition function of motion recognition while improving the user experience.
[0094] To implement the above embodiments, the present application also proposes a wearable device 100, such as Figure 6As shown, it includes a motion data recognition device 10 to implement the aforementioned motion data recognition method.
[0095] To implement the above embodiments, the present application also proposes an electronic device 200, such as Figure 7 As shown, it includes a memory 21, a processor 22, and a computer program stored on the memory 21 and executable on the processor 22. When the processor executes the program, it implements the aforementioned motion data recognition method.
[0096] To implement the above embodiments, the present application also proposes a non-transitory computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the aforementioned motion data recognition method.
[0097] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0098] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present invention, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0099] Any process or method description shown in a flowchart or described in other ways herein can be understood as representing a module, segment, or part of code including one or more executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0100] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.
[0101] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0102] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above-described embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0103] In addition, in each embodiment of the present invention, each functional unit can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0104] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for identifying motion data, characterized in that, it includes: Obtaining a plurality of motion data segments that need to be classified and identified; Inputting the plurality of motion data segments into a motion type recognition model for classification and identification, and obtaining a set of output information output by the motion type recognition model, wherein the output information includes a plurality of characters corresponding to type labels representing motion type recognition results and at least one interval identifier located between the plurality of characters, and the interval identifier is used to separate two adjacent identical actions; Dividing the output information into information segments to obtain at least one information segment, wherein each of the divided information segments includes characters corresponding to at least one of the type labels; Merging the characters that correspond to the same type label and appear continuously in each of the at least one information segment to generate first decoded information; According to the first decoded information, obtaining at least one motion type involved in the plurality of motion data segments and the number of times of each motion type.
2. The method according to claim 1, characterized in that, the merging of the labels that correspond to the same type label and appear continuously in each of the at least one information segment to generate first decoded information includes: For each of the information segments, obtaining a character group that corresponds to the same type label and appears continuously within the information segment, and using one character in the character group to represent the character group during decoding; Concatenating the remaining characters in each of the information segments and the representative character of the character group according to the positions of the characters in the information segment to form second decoded information corresponding to the information segment; Concatenating the second decoded information corresponding to the at least one information segment to obtain the first decoded information.
3. The method according to claim 2, characterized in that, the concatenating of the second decoded information corresponding to the at least one information segment to obtain the first decoded information includes: Concatenating the second decoded information corresponding to each of the information segments in the order of the positions of each of the information segments in the output information to obtain the first decoded information.
4. The method according to any one of claims 1-3, characterized in that, the obtaining of the motion type involved in the plurality of motion data segments and the number of times of each motion type according to the first decoded information includes: Determining at least one motion type involved in the plurality of motion data segments according to the values of at least one character included in the first decoded information; Counting the number of characters with the same value in the first decoded information, wherein the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
5. The method according to any one of claims 1-3, characterized in that, the dividing of the output information into information segments includes: Identifying the interval identifiers in the output information; Extracting the characters between adjacent interval identifiers to form one of the information segments.
6. The method according to claim 5, wherein, the interval identifier includes a blank character.
7. The method according to any one of claims 1 - 3, wherein, the motion data at least includes acceleration data and angular velocity data.
8. A motion data recognition device, wherein, comprising: an acquisition module, configured to obtain a plurality of motion data segments to be classified and recognized; a first acquisition module, configured to input the plurality of motion data segments into a motion type recognition model for classification and recognition, and obtain a set of output information output by the motion type recognition model, wherein the output information is used to represent a plurality of characters corresponding to type labels of motion type recognition results and at least one interval identifier, and the interval identifier is used to separate two adjacent identical actions; a decoding module, configured to divide the output information into information segments, obtain at least one information segment, wherein the characters included in the divided information segment correspond to at least one of the type labels, and merge the characters with the same type label and continuously appearing in each of the at least one information segment to generate first decoded information; a second acquisition module, configured to obtain at least one motion type involved in the plurality of motion data segments and the number of times of each motion type corresponding thereto according to the first decoded information.
9. The device according to claim 8, wherein, the decoding module is further configured to: for each of the information segments, obtain a character group corresponding to the same type label and continuously appearing within the information segment, and use one character in the character group to represent the character group during decoding; concatenate the remaining characters in each of the information segments and the representative character of the character group according to the positions of the characters in the information segment to form second decoded information corresponding to the information segment; concatenate the second decoded information corresponding to the at least one information segment to obtain the first decoded information.
10. The device according to claim 9, wherein, the decoding module is further configured to: concatenate the second decoded information corresponding to each of the information segments according to the position order of each information segment in the output information to obtain the first decoded information.
11. The device according to any one of claims 8 - 10, wherein, the second acquisition module is further configured to: determine at least one motion type involved in the plurality of motion data segments according to the values of at least one character included in the first decoded information; count the number of characters with the same value in the first decoded information, wherein the number of characters with the same value is the number of occurrences of the motion type represented by the same value.
12. The device according to any one of claims 8 - 10, wherein, the decoding module is further configured to: recognize the interval identifier in the output information; extract the characters between adjacent interval identifiers to form one of the information segments.
13. The device according to claim 12, wherein, The interval identifier includes whitespace characters.
14. The device according to any one of claims 8-10, wherein, the motion data at least includes acceleration data and angular velocity data.
15. A wearable device, wherein, it includes a motion data recognition device according to any one of claims 8-14.
16. An electronic device, wherein, it includes a memory and a processor; wherein, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the motion data recognition method according to any one of claims 1-7.
17. A computer-readable storage medium storing a computer program, wherein, when the program is executed by a processor, it implements the motion data recognition method according to any one of claims 1-7.
Citation Information
Patent Citations
Body posture recognition method and device based on LSTM and storage medium
CN110705390A
User activity identification method and device, storage medium and electronic equipment
CN111797655A