This application claims priority to Taiwan Application Serial Number 109110644 filed Mar. 27, 2020, which is herein incorporated by reference.
The present disclosure relates to an exercise scoring method in which a score is calculated based on an exercise type.
With the rise of fitness in recent years, more and more people are willing to establish their own exercise habits. In today's information-rich environment, many people search for fitness-related instructional videos through resources such as the Internet and imitate the movements in the videos to exercise. However, since a person generally does not have the ability to perform the required action correctly by imitation, he or she may be injured by doing the wrong action before the exercise effect is achieved. In addition, in the absence of a couch to assist in the assessment, the person does not know whether he has gradually improved during the exercise, so he may not be willing to continue exercising due to lack of accomplishment.
A common motion assessing system uses a multi-lens photographing device with computer vision technology to analyze the user's motion posture, but this system costs a lot with respect to hardware or the production of digital content, causing difficulty in promotion. A conventional way is to use a wearable inertial sensor which includes an accelerometer and a gyroscope to record acceleration and angular velocity of the sensor in three-dimensional space. Thus, the motion trajectory can be calculated, analyzed, and compared. However, different exercise types have different characteristics, so how to properly analyze different exercise types is an issue for those skilled in the art.
Embodiments of the present disclosure provide a scoring method for a system including a wearable device which includes an inertial measurement unit. The scoring method includes: playing a course video, obtaining coach exercise data corresponding to the course video, and obtaining a coach window from the coach exercise data; obtaining user exercise data from the inertial measurement unit, and obtaining a user window from the user exercise data in which a length of the user window is longer than that of the coach window; searching a user segment from the user window that is most similar to the coach window; for a first exercise type, calculating an exercise score according to stabilities of the user segment and the coach window; and for a second exercise type, calculating the exercise score based on a difference between the user segment and the coach window by a deduction mechanism.
In some embodiments, a beginning point of the user window precedes a beginning point of the coach window, and an end point of the user window follows an end point of the coach window. The step of searching the user segment from the user window that is most similar to the coach window includes: performing an open-begin-end dynamic time warping algorithm to the user window and the coach window to obtain the user segment.
In some embodiments, the step of calculating the exercise score according to the stabilities of the user segment and the coach window includes: calculating a mean absolute deviation of forces at sample points of the user segment as a user stability; calculating a mean absolute deviation of forces at sample points of the coach window as a coach stability; and calculating a stability ratio between the user stability and the coach stability.
In some embodiments, the step of calculating the exercise score according to the stabilities of the user segment and the coach window further includes: transforming the stability ratio into a stability score based on a log it function; calculating the corresponding coach stability for each window of the coach exercise data, counting times of the coach stabilities falling within a first range as a first number of times, and counting times of the coach stabilities falling within a second range as a second number of times; dividing the first number of times by a sum of the first number of times and the second number of times to obtain a stability weight; and calculating the exercise score according to the stability score and the stability weight.
In some embodiments, the step of calculating the exercise score according to the stability score and the stability weight is based on an equation (1).
Score=Sstability×w+(1−w)×S1 (1)
Score is the exercise score, Sstability is the stability score, w is the stability weight, and S1 is a real number.
In some embodiments, the step of calculating the exercise score based on the difference between the user segment and the coach window by a deduction mechanism includes: calculating a force difference and an angular difference between the user segment and the coach window; setting a force weight and an angular weight, and when larger one of the force difference and the angular difference is greater than an error threshold, increasing one of the force weight and the angular weight that corresponds to the larger one of the force difference and the angular difference; and calculating the exercise score based on the force difference, the angular difference, the force weight, and the angular weight.
In some embodiments, the force difference is based on differences between L2 norms of the user segment and L2 norms of the coach window at matched sample points. The angular difference is based on cosine similarities between the user segment and the coach window at the matched sample points.
In some embodiments, the step of calculating the exercise score based on the force difference, the angular difference, the force weight, and the angular weight is based on the following equation (2).
Score=100−(Da×wa+Dm×wm) (2)
Score is the exercise score, Da is the angular difference, wa is the angular weight, Dm is the force difference, and wm is the force weight.
From another aspect, embodiments of the present disclosure provide a system including a wearable device and a smart device. The wearable device includes an inertial measurement unit configured to obtain user exercise data. The smart device is communicatively connected to the wearable device for receiving the user exercise data and configured to play a course video corresponding to the course video through a display. The smart device is configured to perform multiple steps or transmit the user exercise data and coach exercise data to a computation module for performing the steps. The steps includes: obtaining a coach window from the coach exercise data, obtaining a user window from the user exercise data, in which a length of the user window is longer than that of the coach window; searching a user segment from the user window that is most similar to the coach window; for a first exercise type, calculating an exercise score according to stabilities of the user segment and the coach window; and for a second exercise type, calculating the exercise score based on a difference between the user segment and the coach window by a deduction mechanism.
The disclosure can be more fully understood by reading the following detailed description of the embodiment, with reference made to the accompanying drawings as follows.
Specific embodiments of the present disclosure are further described in detail below with reference to the accompanying drawings, however, the embodiments described are not intended to limit the present disclosure and it is not intended for the description of operation to limit the order of implementation. Moreover, any device with equivalent functions that is produced from a structure formed by a recombination of elements shall fall within the scope of the present disclosure. Additionally, the drawings are only illustrative and are not drawn to actual size.
The usage of “first”, “second”, “third”, etc. in the specification should be understood for identifying units or data described by the same terminology, but are not referred to a particular order or sequence.
A combination of a smart device and a cloud application service is provided in a scoring method for an exercise course. When a user exercises according to an exercise course video, movement data of several body portions of the user is acquired. The movement data of the user is compared with movement data of a coach with respect to the body portions so as to assess the exercise result of the user. Accordingly, the user can know whether he is exercising correctly to improve the exercise effect and the willingness to exercise. In particular, different approaches will be used to calculate the score for different exercise types, and for some exercise types or fast actions that are not important in gesture, a greater tolerance will be given.
The wearable device 110 is, for example, a sports bracelet worn by a user 112. However, the wearable device 110 may also be a watch, a belt, or any device that can be worn by the user. The wearable device 110 includes an inertial measurement unit (IMU) which at least includes a tri-axial gravity sensor for sensing an X-axis acceleration value, a Y-axis acceleration value, and a Z-axis acceleration value. In some embodiments, the IMU further includes an angular velocity sensor and/or a magnetometer. The data measured by the IMU is referred to as user exercise data. The wearable device 110 may also include a wireless communication module such as Bluetooth module, a wireless fidelity (Wi-Fi) module or any other suitable low power wireless communication module. In some embodiments, the wearable device 110 also includes a display panel and some other units that are not limited in the disclosure. The display 120 displays a course video in which a coach is demonstrating actions.
The smart device 130 includes a processor 131, a memory 132, and a wireless communication module 133. The memory 132 stores instructions which are executed by the processor 131. The processor 131 is, for example, a central processing unit, a microprocessor, a microcontroller, a digital signal processor, an image processing chip, an application-specific integrated circuit which is not limited in the disclosure. The wireless communication module 133 is, for example, a Bluetooth module, a Wi-Fi module or any other suitable low power wireless communication module for communicatively connecting to the wearable device 110 and receiving the user exercise data from the wearable device 110.
In step 152, post-production for the course video is performed, in which the coach exercise data is synchronized with the course video through a time code such as Society of Motion Picture and Television Engineers (SMPTE), but any other format of time code may be adopted in another embodiment which is not limited in the disclosure. Accordingly, it can be known which sample point of the coach exercise data corresponds to which clip or frame of the course video through the time code. For example, if a sample frequency of the IMU of the wearable device 110 is for example but not limited to 25 Hz, then the coach exercise data corresponding to a minute of video will have 60×25=1500 sample points. Next, the course video and the coach exercise data are stored in a cloud database 140.
When a user is about to exercise, the smart device 130 obtains the course video and the coach exercise data form the cloud database 140, and plays the course video through the display 120. Meanwhile, in step 153, the smart device 130 obtains user exercise data from the wearable device 110 worn by the user. In some embodiments, the smart device 130 obtains the user exercise data from the wearable device 110 before the course video is played, but some of these data will be discarded until the course video is played, and then the remaining data are stored as the user exercise data. As a result, the obtained user exercise data completely corresponds to the course video. It can be known which sample point of the user exercise data corresponds to which frame of the course video.
In step 154, the user exercise data is collected along with the exercise course goes. Since the corresponding relationship between the user exercise data and the course video is obtained in the step 153 and the corresponding relationship between the course video and the coach exercise data is obtained by the SMPTE time code, the corresponding user exercise data and coach exercise data can be obtained according to a frame number of the course video. In other words, it can be known which sample point of the user exercise data corresponds to which sample point of the coach exercise data according to the frame number.
In step 155, the coach exercise data is split into multiple coach windows, and an exercise score 121 is calculated for each coach window. In step 156, the exercise score 121 is displayed, and consequently the user 112 can be aware whether he or she is doing the movement correctly, resulting in improving the exercise effect and willingness to exercise. The exercise scores are calculated by the processor 131 in some embodiments, but the exercise scores may be calculated by a server on the cloud or any other electric device in other embodiments. For example, in
In some embodiments, if the IMU further includes the angular velocity sensor, an algorithm for fusing six-axis data will be applied to obtain the vectors Fc[i] and Fs[i]. The fusion data can be used to properly distinguish the gesture of the action, determine more various exercise types, and provide a better discrimination rate. If the IMU further includes a three-axis magnetometer, an algorithm for fusing nine-axis data may be applied to obtain the vectors Fc[i] and Fs[i]. The algorithm may be an attitude and heading reference system (AHRS) algorithm which is not limited in the disclosure.
A coach window 211 is obtained from the coach exercise data 210. The length of the coach window 211 may be in a range from 2 seconds to 10 seconds that is not limited in the disclosure. In some embodiments, the length of the coach window 211 is determined based on an exercise type. On the other hand, a user window 221 is obtained from the user exercise data 220. The length of the user window 221 is longer than that of the coach window 211. For example, the beginning point of the user window 221 may precede the beginning point of the coach window 211, and the end point of the user window 221 follows the end point of the coach window 211 because user's actions may be too late or too early when he imitates the coach, and longer length of the user window 221 can provide greater tolerance. If the length of the coach window 211 is 4 seconds and the sample frequency is 25 Hz, then the coach window 211 will have M=4×25=100 sample points. If the beginning point of the user window 221 is one second earlier than that of the coach window 211, the end point of the user window 221 is one second later than that of the coach window 211, and the sample frequency of the user window 221 is also 25 Hz, then the user window 221 will have total of N=100+2×25=150 sample points.
A user segment 230 of the user window 221 that is most similar to the coach window 211 is searched. In some embodiments, an open-begin-end dynamic time warping (OBE-DTW) algorithm is performed to the user window 221 and the coach window 211 to obtain a user segment 230. People in the art should be able to understand the OBE-DTW algorithm which will be not described in detail herein. The OBE-DTW algorithm releases the constraints of identical beginning points and identical end points so as to find a partially matched segment in the user window 221. The algorithm can be represented as the following equations (1) to (3). The coach window 211 is written as Fc in the following equations for simplification.
Fs(d,e) is a subset (i.e. segment) of the user window 221 that includes the dth sample point to the eth sample point where d and e are positive integers. The length of the segment Fs(d,e) may be identical or shorter from that of the user window 221 since 1≤d≤e≤N. In other words, the dth sample point to the eth sample of the user window 221 constitute the user segment 230 which is matched to the sample points of the coach window Fc. The algorithm is to find the positive integers d and e so that the difference D(Fc,Fs(d,e)) is minimized. CostOBE-DTW is the average of the errors between the matched sample points determined by the OBE-DTW algorithm. For example, a sample point 231 of the user segment 230 is matched to a sample point 232 of the coach window 211 by the OBE-DTW algorithm. Note that one sample point of the user segment 230 may be matched to multiple sample points of the coach window 211. In addition, the matched sample points of the user window 221 may not be continuous (i.e. some sample points of the user window 221 are not matched to the coach window 211). Different measurement of the difference may be adopted for different exercise types. If the exercise type is mainly related to postures, then CostOBE-MW may be the average of cosine similarities of the matched sample points. If the exercise type is mainly related to forces, then CostOBE-DTW may be the average of L2 norm (i.e. Euclidean distance) between the matched sample points. Moreover, Nmatched is the length of the found user segment 230 and a is a real number such as 2. The equation (3) is different from the conventional OBE-DTW to adjust the difference D(Fc,Fs(d,e)) based on the length of the user segment 230. The user segment 230 having the length close to the length of the coach window 221 is preferred. As shown in
After the user segment 230 is found, an exercise type is determined to adopt the corresponding approach to calculate an exercise score. At least two exercise types are set herein. The first exercise type is related to stable movement, and the second exercise type is related to general or fast movement.
In some embodiments, the absolutes of the acceleration values of the X, Y and Z axes are summed up to obtain a force x[i] at the ith sample point which is written as the following equation (4).
x[i]=|ai,x|+|ai,y|+|ai,z| (4)
The acceleration values ai,x, ai,y, and ai,z may belong to the coach exercise data or the user exercise data. The forces of the coach exercise data are adopted when determining the exercise type. Next, the average, stand deviation, or mean absolute deviation of all forces x[i] is calculated to classify the exercise type. For example, when the mean absolute deviation is less than a threshold, it is determined to be the first exercise type, or otherwise the second exercise type. In some embodiments, the exercise type is determined based on the sports of the coach exercise data such as boxing, Latin dance, interval strength training, and yoga. In some embodiments, the exercise type is determined based on the length of the coach window 211 or the user window 221. In some embodiments, a weight (e.g. in a range from 0 to 1) of the first exercise type and a weight (e.g. in a range from 0 to 1) of the second exercise type are calculated for the user window 221. Two scores corresponding to the first and second exercise types are calculated and summed based on the weights. In some embodiments, different user windows may have different exercise types or different weights. The classification of the exercise type is not limited in the disclosure. The calculation of the exercise score with respect to each exercise type is described as follows.
The aforementioned mean absolute deviation may be represented as the following equation (5). The mean absolute (MAD) is also referred to as stability.
μ is the mean of all forces x[i]. The equation (5) may be used to calculate the stability of the user exercise data that is referred to as user stability MADuser herein. The equation (5) may also be used to calculate the stability of the coach exercise data while the positive integer N is replaced with M, and the result is referred to as coach stability MADref. The exercise score is calculated according to the user stability MADuser and the coach stability MADref. The closer the two stabilities are, the higher the exercise score is. In some embodiments, a stability ratio r of the user stability MADuser to the coach stability MADref is calculated as the following equation (6).
Then, the stability ratio is shifted, resized, and flipped based on a log it function so that the stability ratio is transformed into a stability score as the following equations (7)-(9).
Sstability(r) is the stability score. Sbase is a real number for indicating the score when r=1. rbound is a real number for defining a boundary of the stability ratio r. In the example of rbound=5, a score of 100 is obtained when the user stability is one fifth of the coach stability (i.e. r=⅕) and a score of zero is obtained when the user stability is five times of the coach stability (i.e. r=5). q is a real number for controlling the trend of the equation (8). In some embodiments, the log it function is implemented as a lookup table.
In response to the diversity of exercise situations, if the scoring conditions are too strict, it will cause many actions that are seen as static to be classified as dynamic actions, and will also cause too many false judgments. In order to solve this problem, a double threshold method is used to divide static motion into true static and fuzzy static. To be specific, an upper bound threshold th and a true static threshold t are set herein, and the former is greater than the latter. These two thresholds define a first range [0,t] and a second range (t, th). The coach exercise data is divided into multiple windows, and the coach stability MADref is calculated for each window. Times of the coach stabilities MADref falling within the first range [0,t] are counted as a first number of times. Times of the coach stabilities MADref falling within the second range (t, th) are counted as a second number of times. The first number of times is divided by a sum of the first number of times and the second number of times to obtain a stability weight w as the following equation (10).
countunder is the first number of times. countfuzzy is the second number of times. Last, the exercise score is calculated according to the stability score Sstability(r) and the stability weight w as the following equation (11).
Score=Sstability×w+(1−w)×S1 (11)
Score is the exercise score. S1 is a real number such as 90.
The exercise score is calculated based on a difference between the user segment and the coach window by a deduction mechanism for the second exercise type. First, a force difference between the user segment and the coach window is calculated. The force difference is shifted and resized based on a sigmoid function. To be specific, the sigmoid function is represented as the following equation (12).
m and q are parameters. In some embodiments, the sigmoid function is implemented as a lookup table. The force of each sample point of the coach window is represented as the following equation (13).
mag
c[i]=∥Fc[i]∥,i=1,2, . . . M (13)
∥⋅∥ is L2 norm. M is the length of the coach window. A dynamic factor for the coach exercise data is calculated as the following equation (14).
mag
upper[i]=std(magc,i,w)+mean(magc,i,w),i=1,2, . . . ,length(magc) (14)
w is the size of the window. std (magc, i, w) is the stand deviation of a set from the ith sample point to the (i+w)th sample point of the force magc[ ]. mean(magc, i, w) is the mean of the set from the ith sample point to the (i+w)th sample point of the force magc[ ]. The transformation of the sigmoid function is written as the following equation (15).
P is a set including the matched sample point pairs between the user segment and the coach window that are determined by the OBE-DTW algorithm. For example, the sample point 231 and the sample point 232 of
In addition, an angular difference is calculated according to the following equation (16).
ma and qa are real numbers for controlling the tolerance of the angular difference. Da is the angular difference and also is the score to be deducted. From another aspect, the angular difference Da is based on the cosine similarities between the user segment and the coach window at matched sample points. The force difference Dm is used to determine if the force of the movement is correct, and the angular difference Da is used to determine if the orientation of the movement is correct. When the user follows the coach correctly, the force and angular differences are small, and thus the score to be deducted is small. When the movement of the user significantly differs from that of the coach, one of the force and angular difference may still be small, and a high score should not be given in this case. Therefore, two weights are set herein to mix the force difference Dm and the angular difference Da.
To be specific, a force weight wm and an angular weight wa are set in the embodiment. When a larger one of the force difference wm and the angular difference wa is greater than an error threshold (i.e. indicating that the movement difference is great), one of the weights that corresponds to the larger difference is increased, and the other weight is decreased. Accordingly, a high score will not be given. In some embodiments, the step of increasing the weight is based on the sigmoid function as the following equation (17).
The sum of the force weight wm and the angular weight wa is equal to 1. The force weight wm and the angular weight wa may be determined according to the following pseudo codes.
In the equation (17), q is a real number for deciding the increasing magnitude, and m is a real number for deciding the shift of the sigmoid function. The real number m is also referred to the said error threshold. For example, when the angular difference Da is the larger difference, the angular difference Da will be inputted to the sigmoid function. The angular weight wa will increase quickly if the angular difference Da is greater than the error threshold m or otherwise the angular weight wa does not change a lot.
Last, the exercise is calculated according to the force difference, the angular difference, the force weight, and the angular weight as the following equation (18).
Score=100−(Da×wa+Dm×wm) (18)
Referring to
In some embodiments, the aforementioned L2 norm may be replaced with L1 norm, max norm, histogram distance, or any suitable distance. In some embodiments, the OBE-DTW may be replaced with other types of DTW or similarity algorithms such as longest common subsequence (LCS).
Although the present disclosure has been described in considerable detail with reference to certain embodiments thereof, other embodiments are possible. Therefore, the spirit and scope of the appended claims should not be limited to the description of the embodiments contained herein. It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present disclosure without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the present disclosure cover modifications and variations of this disclosure provided they fall within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
109110644 | Mar 2020 | TW | national |