A 6-axis sensor-based smart dumbbell counting method

By using a smart dumbbell counting method based on a 6-axis sensor, data filtering and pulse sequence matching techniques are employed to dynamically adjust the signal threshold, identify valid pulses, and filter out interference. This solves the counting error of the smart dumbbell during small-amplitude and invalid movements, achieving more accurate counting.

CN117883764BActive Publication Date: 2026-04-21ZHUHAI YUNMAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI YUNMAI TECH CO LTD
Filing Date
2024-02-29
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing intelligent dumbbell counting methods are prone to missing or miscounting during small-amplitude and invalid movements, and the signal is weak and difficult to accurately identify.

Method used

An intelligent dumbbell counting method based on a 6-axis sensor is adopted. Through data acquisition, acceleration and angular velocity merging, bandpass filtering, integral filtering, pulse search, noise filtering, effective pulse sequence matching, and effective axis selection, the signal threshold is dynamically adjusted, and interference is filtered out by judging the similarity of repeated actions, thereby improving the counting accuracy.

Benefits of technology

It effectively solves the problem of missed counts for small movements, reduces miscounts, and improves the accuracy and reliability of counting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117883764B_ABST
    Figure CN117883764B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent dumbbell counting method based on a 6-axis sensor, comprising the following steps: data acquisition; acceleration data alignment; bandpass filtering; integral filtering; pulse search; noise filtering; valid pulse sequence matching; valid axis selection; and valid count determination. This invention utilizes noise recognition, dynamic adjustment of the valid signal threshold, and a valid axis selection mechanism to address the problem of missed counts for small-amplitude signals. Simultaneously, it uses repetitive motion similarity judgment to predict whether the user is currently performing similar back-and-forth movements, filtering out interference from invalid movements and reducing false counts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of technology, and in particular to an intelligent dumbbell counting method based on a 6-axis sensor. Background Technology

[0002] Using dumbbells for physical exercise is a common way for people to exercise. Most existing smart dumbbells have an automatic counting function, which makes it convenient for users to track their exercise progress. The most common technical means is to use a 6-axis sensor (accelerometer + angular velocity) to collect data during the movement, then filter and integrate the data, and finally count the number of peaks or troughs that exceed a threshold.

[0003] For example, patent CN 114534236A discloses a method for counting dumbbell movements based on motion sensors. It collects triaxial acceleration and triaxial angular velocity data from a six-axis sensor inside the dumbbell during movement, combining the x, y, and z-axis accelerations into a single acceleration. For linear movements, the combined acceleration is used as the primary detection curve, and the combined displacement is calculated to determine the movement cycle, with angular velocity used to filter out rotational swaying. For rotational movements, angular velocity is used as the primary detection curve, and the angle integral is calculated to determine the movement cycle, with the combined displacement used to filter out in-situ rotational swaying. By comprehensively judging the combined displacement and angle integral, swaying and invalid movements are filtered out. Peak points where the integral value exceeds a threshold are identified; the preceding peak and subsequent trough points are the start and end points of the movement cycle.

[0004] Similar methods have the following drawbacks: 1. For movements with small amplitude or slow speed, the signal will be relatively weak, easily failing to reach the threshold and resulting in missed counts. 2. False counts are also prone to occur when holding and playing with dumbbells in one's hand. Summary of the Invention

[0005] This invention aims to solve at least one of the technical problems existing in the prior art. To this end, this invention proposes an intelligent dumbbell counting method based on a 6-axis sensor.

[0006] One embodiment of the present invention addresses its technical problem by employing the following technical solution: an intelligent dumbbell counting method based on a 6-axis sensor, comprising the following steps:

[0007] S1: Data Acquisition; Acquire data on the triaxial acceleration and triaxial angular velocity of the dumbbell motion at the same sampling rate;

[0008] S2: Acceleration data merging; merges the three-axis acceleration data collected by S1 into combined acceleration data;

[0009] S3: Bandpass filtering; Bandpass filtering is performed on the triaxial acceleration and triaxial angular velocity data collected by S1, and the combined acceleration data of S2.

[0010] S4: Integral filtering; Perform integral filtering on the data after bandpass filtering for each axis in S3;

[0011] S5: Pulse search; Search for and capture pulses from the data after integral filtering in S4;

[0012] S6: Noise filtering; Analyze the pulse information in S5, distinguish between interference pulses and valid pulses; delete interference pulses and put valid pulses into the buffer for later use;

[0013] S7: Valid pulse sequence matching; capture a certain number of valid pulses cached in S6, then match them according to the pattern of positive and negative pulse occurrence, and determine whether the sequence of multiple valid pulses is a repetitive action; repetitive actions are valid motion identifiers;

[0014] S8: Valid axis selection. Valid pulse sequences can appear on multiple axes. The data saved from the valid sequences can be used for filtering.

[0015] S9: Valid count judgment, sum up all valid counts to get the count value of dumbbell movement.

[0016] Preferably, Acc_X, Acc_Y, and Acc_Z are defined to represent the acceleration data collected by the accelerometer.

[0017] Define Acc_XYZ as the combined acceleration axis data after merging the three acceleration axes; where

[0018] Preferably, in step S5, pulse search requires buffering 3 seconds of integrated and filtered data for each axis to calculate the pulse characteristics after finding the pulse. The search steps are as follows:

[0019] S51: The initial state is "idle". If a "peak" (the middle data is greater than the two side data) is encountered and the peak value is greater than "threshold H1", the state switches to "search for positive pulse". If a "valley" (the middle data is less than the two side data) is encountered and the valley value is less than "threshold H2", the state switches to "search for negative pulse".

[0020] Before switching states, it is necessary to backtrack the pulse starting point by using cached data. The starting point is defined as tracing back from the "peak" or "valley". When the first data point close to 0 is encountered (the absolute value is less than the "threshold H3"), it is recorded as the starting point.

[0021] S52: If the current state is "searching for positive pulse", if a new "peak" is encountered that is higher than the current "peak", update the "peak";

[0022] The first data point close to 0 encountered after "peak" is marked as the end point, and "peak" is marked as the apex. The type of buffer pulse is positive pulse; the state switches to "idle".

[0023] If the current state is "searching for negative pulses", if a new "valley" is encountered that is lower than the current "valley", the "valley" is updated; the first data point close to 0 encountered after the "valley" is recorded as the endpoint, the "valley" is recorded as the vertex, the type of the cached pulse is negative pulse, and the state is switched to "idle".

[0024] Preferably, in step S6 noise filtering, the following data of the pulses are statistically analyzed:

[0025] S61: Pulse width: End point - Start point;

[0026] S62: Pulse area: the sum of the absolute values ​​of all data between the start and end points;

[0027] S63: Average Energy of Current Axis in 2 Seconds: Only the current axis is considered, and the average of the absolute values ​​of all data between the end point and the end point is calculated in 2 seconds before the end point.

[0028] S64: Average Energy per Second Axis: Calculated once for each axis, the average of the absolute values ​​of all data during the time from the end point of the current axis to the end point, 1 second before the end point of the current axis;

[0029] S65: Number of noise points in bandpass filtering: The number of noise vertices between the start and end points of the current axis after bandpass filtering, where a noise vertex is defined as either the middle data being greater than the data on both sides, or the middle data being less than the data on both sides.

[0030] S66: Set the area threshold based on the number of noise vertices;

[0031] S67: Set the pulse amplitude threshold based on the number of noise vertices;

[0032] S68: The absolute value of the pulse's peak is used as the pulse's amplitude;

[0033] S69: If the area of ​​the pulse is less than the area threshold, or the amplitude is less than the amplitude threshold, then the pulse is considered interference and deleted; the remaining pulses that meet the conditions are considered valid pulses and put into the buffer for later use.

[0034] Preferably, the effective pulse sequence matching step in step S7 is as follows:

[0035] S71: Buffer the most recent N1 pulses, mark each pulse with the pulse type (positive pulse or negative pulse), and match according to the pattern of positive and negative pulse occurrence;

[0036] S72: When the number of pulses is greater than or equal to 4, matching begins. First, matching is performed on 4 pulses. The matching sequence is A1 B1 A2B2, where A1 and A2 are of the same type, and B1 and B2 are also of the same type. The subscripts indicate the order in which they appear.

[0037] When the first and third pulse types are the same, the second and fourth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold, it is considered to meet the matching condition and to identify whether it is a repetitive action.

[0038] S73: Each pulse records the following information: width (W), amplitude (V), area (A), average energy of the current axis over 2 seconds (P2), and average energy of all axes over 1 second (P1_AX, P1_AY, P1_AZ, P1_AXYZ, P1_GX, P1_GY, P1_GZ); the information of each pulse is represented by a vector.

[0039] S74: Combine A1 B1 A2B2 into a new vector, and normalize the vector column by column;

[0040] S75: Create two new vectors, Vector 1 = [A1, B1] and Vector2 = [A2, B2], using the normalized data. Calculate the cosine similarity and Euclidean distance between Vector 1 and Vector2.

[0041] S76: If the cosine similarity is greater than the threshold H4 and the Euclidean distance is less than the threshold H5, it is recorded as a valid sequence, indicating that the sequence has obvious repetitive actions;

[0042] S77: If the cosine similarity and Euclidean distance do not meet the requirements, then match other sequences.

[0043] Preferably, in step S72, the number of pulses matched is set to 6; when the number of pulses is equal to 6, the matching sequence is A1 B1 C1 A2B2C2, where A1 and A2 are of the same type, B1 and B2 are of the same type, and C1 and C2 are of the same type, and the subscripts indicate the order of appearance;

[0044] When the first and fourth pulse types are the same, the second and fifth pulse types are the same, the third and sixth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold, and the absolute value of the difference between (start point of C1 - end point of B1) and (start point of C2 - end point of B2) is less than the distance threshold, the matching conditions are met, and the identification of whether it is a repetitive action is performed.

[0045] Preferably, in step S8, the effective axis selection mechanism is as follows:

[0046] S81: Compare the average energy of each axis of the valid sequence record over 1 second;

[0047] S82: Among the three axes of angular velocity data, if the axis with the largest average energy per second is greater than the energy threshold H6, then that axis is the currently valid axis.

[0048] Otherwise, among the four axes of acceleration data, if the axis with the largest 1-second average energy among AccX, AccY, and AccZ is more than twice that of AccXYZ and greater than the energy threshold H7, then that axis is a valid axis.

[0049] Otherwise, if the 1-second average energy of the resultant axis AccXYZ of the acceleration is greater than the threshold H8, then the effective axis is AccXYZ.

[0050] S83: If the axis that generates the valid sequence is the same as the valid axis, then the valid sequence passes the filter and proceeds to the next step; otherwise, the valid sequence fails the filter and is ignored.

[0051] Preferably, the valid count determination in step S9 includes the following steps:

[0052] S91: The initial state is defined as "ineffective motion";

[0053] S92: If the current state is "invalid motion", after a valid sequence passes the filter, the valid count is incremented by 2, the state is changed to "valid motion", and the start and end points of this valid sequence are cached;

[0054] S93: If the current state is "valid movement", and a new valid sequence passes the screening, the intersection-union ratio of the cached valid sequence and the start and end points of the new valid sequence will be calculated to determine the proportion of overlap between the two sequences. If the intersection-union ratio is less than the threshold H9, the valid count will be incremented by 1, and the start and end points of this valid sequence will be recorded.

[0055] If the current state is "valid movement" and no new count is added after time T1, the state is changed to "invalid movement".

[0056] S94: Add up all valid counts to get the count value of the dumbbell movement.

[0057] The beneficial effects of this invention are as follows: It uses noise recognition, dynamic adjustment of the threshold of valid signals, and valid axis selection mechanism to solve the problem of small amplitude signals being easily missed in counting; at the same time, it uses the similarity judgment of repeated actions to predict whether the user is currently performing similar back-and-forth movements, filtering out the interference of invalid actions and reducing the occurrence of false counts.

[0058] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0059] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0060] Figure 1 This is triaxial acceleration data from one embodiment;

[0061] Figure 2 This refers to the three-axis angular velocity data in one embodiment;

[0062] Figure 3 This refers to the data for the triaxial acceleration and the combined acceleration axis in one embodiment;

[0063] Figure 4 This is the data for the triaxial acceleration and the resultant acceleration axis in another embodiment;

[0064] Figure 5 This is the data after bandpass filtering of triaxial acceleration, triaxial angular velocity, and the resultant acceleration axis in one embodiment;

[0065] Figure 6 To Figure 5 The data of triaxial acceleration, triaxial angular velocity, and acceleration resultant axis after integral filtering;

[0066] Figure 7 To Figure 6 A graph of Gyr o_Z data after pulse lookup processing;

[0067] Figure 8 for Figure 5 and Figure 6 Overlay plot of Gyr o_Z data after bandpass filtering and integral filtering respectively;

[0068] Figure 9 This is a schematic diagram for calculating the intersection-union ratio. Detailed Implementation

[0069] This section will describe in detail specific embodiments of the present invention. Preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and overall technical solution of the present invention, but they should not be construed as limiting the scope of protection of the present invention.

[0070] In the description of this invention, "multiple" means two or more; "greater than," "less than," and "exceeding" are understood to exclude the stated number; "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0071] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0072] In this invention, unless otherwise explicitly defined, the terms "setting," "installing," and "connecting" should be interpreted broadly. For example, they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to a fixed connection, a detachable connection, or an integrally formed connection; they can refer to a mechanical connection; they can refer to the internal connection of two components or the interaction between two components. Those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0073] Example

[0074] The present invention proposes an intelligent dumbbell counting method based on a 6-axis sensor, comprising the following steps:

[0075] S1: Data Acquisition; Acquire data on the triaxial acceleration and triaxial angular velocity of the dumbbell motion at the same sampling rate;

[0076] S2: Acceleration data merging; merges the three-axis acceleration data collected by S1 into combined acceleration data;

[0077] S3: Bandpass filtering; Bandpass filtering is performed on the triaxial acceleration and triaxial angular velocity data collected by S1, and the combined acceleration data of S2.

[0078] S4: Integral filtering; Perform integral filtering on the data after bandpass filtering for each axis in S3;

[0079] S5: Pulse search; Search for and capture pulses from the data after integral filtering in S4;

[0080] S6: Noise filtering; Analyze the pulse information in S5, distinguish between interference pulses and valid pulses; delete interference pulses and put valid pulses into the buffer for later use;

[0081] S7: Valid pulse sequence matching; capture a certain number of valid pulses cached in S6, then match them according to the pattern of positive and negative pulse occurrences, and determine whether the valid pulses are repetitive actions; repetitive actions are valid motion identifiers;

[0082] S8: Valid axis selection. Valid pulse sequences can appear on multiple axes. The data saved from the valid sequences can be used for filtering.

[0083] S9: Valid count judgment, sum up all valid counts to get the count value of dumbbell movement.

[0084] In one embodiment of this invention, the sensor is mounted on a dumbbell and collects acceleration and angular velocity at a sampling rate of 50Hz, as shown below. Figure 1 and Figure 2 As shown;

[0085] Define Acc_X, Acc_Y, and Acc_Z to represent the acceleration data collected by the accelerometer, with the horizontal axis representing the sampling point number and the vertical axis representing the acceleration, in mg.

[0086] Gyro_X, Gyro_Y, and Gyro_Z are defined as angular velocity data collected by the gyroscope. The horizontal axis represents the sampling point number, the vertical axis represents the angular velocity, and the unit is dps (degrees per second).

[0087] Define Acc_XYZ as the combined acceleration axis data after merging the three acceleration axes; where

[0088] Dumbbell training involves many exercises. For some exercises, using data from combined acceleration axes yields better results, while for others, using data from a single acceleration axis is more effective. Including combined acceleration data here simplifies the calculation logic for selecting the effective axis in subsequent steps. For example... Figure 3 As shown, in some embodiments, the data patterns after axis coupling are not obvious; for example... Figure 4 As shown, the data in some embodiments exhibits clear patterns. Therefore, some existing solutions that only use the combined data for counting are insufficient.

[0089] The original 6-axis data, plus one combined axis data, for a total of 7 axes data, will proceed to the next calculation.

[0090] Subsequently, in step S3, bandpass filtering: for

[0091] Acc_X, Acc_Y, Acc_Z, Acc_XYZ, Gyro_X, Gyro_Y, and Gyro_Z are bandpass filtered from 0.3 to 3 Hz to remove DC components and high-frequency interference. The results are as follows: Figure 5 As shown;

[0092] Then, in the S4 integral filtering process, each axis performs integral filtering on the bandpass filtered data. The data obtained by integral filtering is the cumulative sum of the data collected for that axis. After integral filtering, the data becomes smoother and the features are more obvious, thus reducing the difficulty of feature extraction. The processing results are as follows: Figure 6 As shown;

[0093] In this invention, pulse search is performed in step S5. The following explanation uses data from one axis to illustrate how pulse search is performed. The same method will be used for all seven axes. Each axis requires a 3-second buffer of integrated and filtered data to calculate the pulse's characteristics after it is found. The search steps are as follows:

[0094] S51: The initial state is "idle". If a "peak" (the middle data is greater than the two side data) is encountered and the peak value is greater than "threshold H1", the state switches to "search for positive pulse". If a "valley" (the middle data is less than the two side data) is encountered and the valley value is less than "threshold H2", the state switches to "search for negative pulse".

[0095] Before switching states, it is necessary to backtrack the pulse starting point by using cached data. The starting point is defined as tracing back from the "peak" or "valley". When the first data point close to 0 is encountered (the absolute value is less than the "threshold H3"), it is recorded as the starting point.

[0096] S52: If the current state is "searching for positive pulse", if a new "peak" is encountered that is higher than the current "peak", update the "peak";

[0097] The first data point close to 0 encountered after the "peak" is marked as the end point, and the "peak" itself is marked as the apex. The buffer pulse type is a positive pulse, with a start point, apex, and end point. The state switches to "idle".

[0098] If the current state is "searching for negative pulses", if a new "valley" is encountered that is lower than the current "valley", the "valley" is updated; the first data point close to 0 encountered after the "valley" is recorded as the endpoint, and the "valley" is recorded as the vertex. The type of the buffered pulse is negative pulse, with start point, vertex, and endpoint. The state switches to "idle".

[0099] Processing structure such as Figure 7 As shown, the triangle symbol indicates the found pulse vertices. Some pulses correspond to valid actions, while others correspond to interference. The interference needs to be filtered out, leaving only the valid pulses.

[0100] In this embodiment, in step S6 noise filtering, the following data of the statistical pulses are calculated (each axis is calculated separately):

[0101] S61: Pulse width: End point - Start point;

[0102] S62: Pulse area: the sum of the absolute values ​​of all data between the start and end points;

[0103] S63: Average Energy of Current Axis in 2 Seconds: Only the current axis is considered, and the average of the absolute values ​​of all data between the end point and the end point is calculated in 2 seconds before the end point.

[0104] S64: Average Energy per Second Axis: Calculated once for each axis, the average of the absolute values ​​of all data during the time from the end point of the current axis to the end point, 1 second before the end point of the current axis;

[0105] S65: Number of noise points in bandpass filtering: The number of noise vertices between the start and end points of the current axis after bandpass filtering, where a noise vertex is defined as either the middle data being greater than the data on both sides, or the middle data being less than the data on both sides.

[0106] like Figure 8 As shown, the solid line represents the data after bandpass filtering, x represents the noise vertices on the bandpass filtered data, the dashed line represents the data after integral filtering, and the pulse is found based on the data after integral filtering. Between the start and end points of the pulse, the more noise vertices corresponding to the bandpass filtering, the greater the interference.

[0107] S66: Set the area threshold based on the number of noise vertices; the area threshold for acceleration is different from that for angular velocity. For example, the default area threshold for acceleration is 40,000, and the default area threshold for angular velocity is 50,000. When the number of noise vertices is less than or equal to 2, the area threshold is multiplied by 0.7. When the number of noise vertices is greater than 2 and less than or equal to 4, the area threshold is multiplied by 0.85.

[0108] S67: Set the pulse amplitude threshold based on the number of noise vertices; the amplitude thresholds for acceleration and angular velocity are different. For example, the default amplitude threshold for acceleration is 2000, and the default amplitude threshold for angular velocity is 2500. When the number of noise vertices is less than or equal to 2, the amplitude threshold is multiplied by 0.7. When the number of noise vertices is greater than 2 and less than or equal to 4, the amplitude threshold is multiplied by 0.85.

[0109] S68: The absolute value of the pulse's peak is used as the pulse's amplitude;

[0110] S69: If the area of ​​the pulse is less than the area threshold, or the amplitude is less than the amplitude threshold, then the pulse is considered interference and deleted; the remaining pulses that meet the conditions are considered valid pulses and put into the buffer for later use.

[0111] In this invention, the effective pulse sequence matching step in step S7 is as follows:

[0112] S71: Buffer the most recent N1 pulses (taking 6 as an example), mark each pulse with the pulse type (positive pulse or negative pulse), and match them according to the pattern of positive and negative pulse occurrence;

[0113] S72: When the number of pulses is greater than or equal to 4, matching begins. First, matching is performed on 4 pulses. The matching sequence is A1 B1 A2B2, where A1 and A2 are of the same type, and B1 and B2 are also of the same type. The subscripts indicate the order in which they appear.

[0114] When the first and third pulse types are the same, the second and fourth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold (e.g., 50 sampling points, indicating that the action is continuous), it is considered to meet the matching condition and to identify whether it is a repetitive action.

[0115] S73: Each pulse records the following information: width (W), amplitude (V), area (A), average energy of the current axis over 2 seconds (P2), and average energy of all axes over 1 second (P1_AX, P1_AY, P1_AZ, P1_AXYZ, P1_GX, P1_GY, P1_GZ); the information of each pulse is represented by a vector.

[0116] A1=[W1, V1, A1, P21, P1_AX1, P1_AY1, P1_AZ1, P1_AXYZ1, P1_GX1, P1_GY1, P1_GZ1];

[0117] B1=[W2, V2, A2, P22, P1_AX2, P1_AY2, P1_AZ2, P1_AXYZ2, P1_GX2, P1_GY2, P1_GZ2];

[0118] A2=[W3, V3, A3, P23, P1_AX3, P1_AY3, P1_AZ3, P1_AXYZ3, P1_GX3, P1_GY3, P1_GZ3];

[0119] B2=[W4, V4, A4, P24, P1_AX4, P1_AY4, P1_AZ4, P1_AXYZ4, P1_GX4, P1_GY4, P1_GZ4];

[0120] S74: Combine A1 B1 A2B2 into a new vector, and normalize the vector column by column; (normalize data of the same type by dividing each column by the maximum value of that column), unifying data of different dimensions to the same scale.

[0121] S75: Create two new vectors using the normalized data, Vector 1 = [A1, B1] and Vector2 = [A2, B2]. Calculate the cosine similarity and Euclidean distance between Vector 1 and Vector2.

[0122] The formula for calculating cosine similarity is:

[0123]

[0124] The Euclidean distance is calculated using the following formula:

[0125]

[0126] S76: If the cosine similarity is greater than the threshold H4 (e.g., 0.9) and the Euclidean distance is less than the threshold H5 (e.g., 1), it is recorded as a valid sequence, indicating that the sequence has obvious repetitive actions;

[0127] The user is highly likely to have performed the action twice. In dumbbell counting applications, repeated actions are a clear indicator of valid movement. Record the start point of A2 and the end point of B2 as the start and end points of the valid sequence. Record the axis that generated the valid sequence, as well as the average energy of all axes of the last pulse of Vector2, which is the B2 pulse, over 1 second. Delete A1 and B1 from the pulse buffer.

[0128] S77: If the cosine similarity and Euclidean distance do not meet the requirements, then match other sequences.

[0129] In this invention, for example, when the number of pulses is 6...

[0130] In step S72, the number of pulses matched is set to 6; when the number of pulses is equal to 6, the matching sequence is A1 B1 C1 A2B2C2, where A1 and A2 are of the same type, B1 and B2 are of the same type, and C1 and C2 are of the same type, and the subscripts indicate the order of appearance;

[0131] When the first and fourth pulse types are the same, the second and fifth pulse types are the same, the third and sixth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold (e.g., 50 sampling points), and the absolute value of the difference between (start point of C1 - end point of B1) and (start point of C2 - end point of B2) is less than the distance threshold (e.g., 50 sampling points), the matching conditions are met, and the identification of whether it is a repetitive action is performed.

[0132] S73: Each pulse has the following information: width (W), amplitude (V), area (A), average energy of the current axis over 2 seconds (P2), and average energy of all axes over 1 second (P1_AX, P1_AY, P1_AZ, P1_AXYZ, P1_GX, P1_GY, P1_GZ); the information of each pulse is represented by a vector.

[0133] A1=[W1, V1, A1, P21, P1_AX1, P1_AY1, P1_AZ1, P1_AXYZ1, P1_GX1, P1_GY1, P1_GZ1]

[0134] B1=[W2, V2, A2, P22, P1_AX2, P1_AY2, P1_AZ2, P1_AXYZ2, P1_GX2, P1_GY2, P1_GZ2]

[0135] C1=[W3, V3, A3, P23, P1_AX3, P1_AY3, P1_AZ3, P1_AXYZ3, P1_GX3, P1_GY3, P1_GZ3]

[0136] A2=[W4, V4, A4, P24, P1_AX4, P1_AY4, P1_AZ4, P1_AXYZ4, P1_GX4, P1_GY4, P1_GZ4]

[0137] B2=[W5, V5, A5, P25, P1_AX5, P1_AY5, P1_AZ5, P1_AXYZ5, P1_GX5, P1_GY5, P1_GZ5]

[0138] C2=[W6, V6, A6, P26, P1_AX6, P1_AY6, P1_AZ6, P1_AXYZ6, P1_GX6, P1_GY6, P1_GZ6]

[0139] S74: Combine A1 B1 C1 A2B2C2 into a new vector, and normalize the vector column by column (normalize data of the same type by dividing each column by the maximum value of that column), unifying data of different dimensions to the same scale.

[0140] S75: Create two new vectors using the normalized data, Vector 1 = [A1, B1, C1] and Vector2 = [A2, B2, C2]. Calculate the cosine similarity and Euclidean distance between Vector 1 and Vector2.

[0141] S76: If the cosine similarity is greater than the threshold H4 (e.g., 0.9) and the Euclidean distance is less than the threshold H5 (e.g., 1), it is recorded as a valid sequence. The start point of A2 and the end point of C2 are recorded as the start and end points of the valid sequence. The axis that generates the valid sequence is recorded, as well as the average energy of all axes of the last pulse of Vector2, which is the C2 pulse, over 1 second. A1, B1, and C1 are then removed from the pulse buffer.

[0142] This example illustrates the matching of 4-pulse and 6-pulse sequences. If more complex actions need to be identified, the number of pulse buffers can be increased, and more target sequences can be added. This will not be elaborated further here.

[0143] Similarity matching is used to find duplicate actions and filter out irregular and distracting actions, thereby improving the accuracy of counting.

[0144] In this invention, in step S8, the valid sequence may appear on multiple axes, requiring a valid axis selection mechanism to use the data from the axis with the best signal. The following describes the valid axis selection mechanism using the data saved from the valid sequence:

[0145] S81: Compare the 1s average energy of each axis recorded in the valid sequence (the 1s average energy of each axis recorded in the last pulse of the valid sequence);

[0146] S82: Among the three axes of angular velocity data, if the axis with the largest average energy per second is greater than the energy threshold H4 (e.g., 500), then that axis is the currently valid axis.

[0147] Otherwise, among the four axes of acceleration data, if the axis with the largest 1-second average energy among AccX, AccY, and AccZ is more than twice that of AccXYZ and is greater than the energy threshold H5 (e.g., 700), then that axis is a valid axis.

[0148] Otherwise, if the 1-second average energy of the resultant axis AccXYZ of acceleration is greater than the threshold H8 (e.g., 1000), then the effective axis is AccXYZ.

[0149] S83: If the axis that generates the valid sequence is the same as the valid axis, then the valid sequence passes the filter and proceeds to the next step; otherwise, the valid sequence fails the filter and is ignored.

[0150] In this invention, the valid count determination in step S9 includes the following steps:

[0151] S91: The initial state is defined as "ineffective motion";

[0152] S92: If the current state is "invalid motion", after the valid sequence passes the filter, the valid count is incremented by 2. This is because the valid sequence is determined by two consecutive repeated actions. If there was no movement before, which is the "invalid motion" state, and the movement changes from "invalid motion" to "movement", then the valid count should be incremented by 2, and the state should be changed to "valid motion". The start and end points of this valid sequence are cached.

[0153] S93: If the current state is "valid movement", and a new valid sequence passes the filter, the intersection-union ratio of the cached valid sequence and the start and end points of the new valid sequence will be calculated to determine the proportion of overlap between the two sequences. If the intersection-union ratio is less than the threshold H9 (e.g., 20%), the valid count will be incremented by 1, and the start and end points of this valid sequence will be recorded.

[0154] If the current state is "valid motion" and no new count is added after time T1 (e.g., 5 seconds), the valid pulses cached before T1 are deleted, and the state is changed to "invalid motion".

[0155] The calculation method for the intersection-union ratio is defined as: (start of the current sequence – end of the cached sequence) / (end of the current sequence – start of the cached sequence). If the start of the current sequence is greater than the end of the cached sequence, the two sequences have no intersection. The result calculated by the above formula is negative, which also satisfies the condition of being less than the intersection-union ratio threshold.

[0156] S94: Add up all valid counts to get the count value of the dumbbell movement.

[0157] The beneficial effects of this invention are as follows: It uses noise recognition, dynamic adjustment of the threshold of valid signals, and valid axis selection mechanism to solve the problem of small amplitude signals being easily missed in counting; at the same time, it uses the similarity judgment of repeated actions to predict whether the user is currently performing similar back-and-forth movements, filtering out the interference of invalid actions and reducing the occurrence of false counts.

[0158] Of course, the present invention is not limited to the above-described embodiments. Those skilled in the art can make equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications and substitutions are all included within the scope defined by the claims of this application.

Claims

1. A smart dumbbell counting method based on a 6-axis sensor, characterized in that, Includes the following steps: S1: Data Acquisition; Acquire data on the triaxial acceleration and triaxial angular velocity of the dumbbell motion at the same sampling rate; S2: Acceleration data merging; merges the three-axis acceleration data collected by S1 into combined acceleration data; S3: Bandpass filtering; Bandpass filtering is performed on the triaxial acceleration and triaxial angular velocity data collected by S1, as well as the combined acceleration data of S2. S4: Integral filtering; Perform integral filtering on the data after bandpass filtering for each axis in S3; S5: Pulse search; Search for and capture pulses from the data after integral filtering in S4; S6: Noise filtering; Analyze the pulse information in S5, distinguish between interference pulses and valid pulses; delete interference pulses and put valid pulses into the buffer for later use; S7: Valid sequence matching; A certain number of valid pulses are captured and marked in the S6 buffer. Then, they are matched according to the pattern of positive and negative pulses and it is determined whether the sequence of multiple valid pulses is a repetitive action. Repetitive actions are the identifier of valid motion. A valid sequence is a pulse sequence that conforms to the pattern of repetitive actions after noise filtering. S8: Valid axis selection. Valid sequences can appear on multiple axes, and the data saved from the valid sequences is used for filtering. The valid axis filtering mechanism is as follows: S81: Compare the average energy of each axis of the valid sequence record over 1 second; S82: Among the three axes of angular velocity data, if the axis with the largest average energy per second is greater than the energy threshold H6, then that axis is the currently valid axis. Otherwise, among the four axes of acceleration data, if the axis with the largest 1-second average energy among AccX, AccY, and AccZ is more than twice that of AccXYZ and greater than the energy threshold H7, then that axis is a valid axis. Otherwise, if the 1-second average energy of the resultant axis AccXYZ of the acceleration is greater than the threshold H8, then the effective axis is AccXYZ. S83: If the axis that generates the valid sequence is the same as the valid axis, then the valid sequence passes the filter and proceeds to the next step; otherwise, the valid sequence fails the filter and is ignored. Among them, the 1-second average energy refers to the average of the absolute values ​​of all data from the current axis, from 1 second before the endpoint to the endpoint. S9: Valid count judgment. All valid counts are summed to obtain the count value for the dumbbell movement; the judgment steps are as follows: S91: The initial state is defined as "ineffective motion"; S92: If the current state is "invalid movement", after a valid sequence passes the filter, the valid count is incremented by 2, the state is changed to "valid movement", and the start and end points of this valid sequence are cached; S93: If the current state is "valid motion", and a new valid sequence passes the screening, the intersection-union ratio of the cached valid sequence and the start and end points of the new valid sequence will be calculated to determine the proportion of overlap between the two sequences. If the intersection-union ratio is less than the threshold H9, the valid count will be incremented by 1, and the start and end points of this valid sequence will be recorded. If the current state is "valid movement" and no new count is added after time T1, the state is changed to "invalid movement". S94: Add up all valid counts to get the count value of the dumbbell movement.

2. The intelligent dumbbell counting method based on a 6-axis sensor according to claim 1, characterized in that: Define Acc_X, Acc_Y, and Acc_Z to represent the acceleration data collected by the accelerometer. Define Acc_XYZ as the combined acceleration axis data after merging the three acceleration axes; where .

3. The intelligent dumbbell counting method based on a 6-axis sensor according to claim 2, characterized in that: In step S5, pulse search requires buffering 3 seconds of integrated and filtered data for each axis to calculate pulse characteristics after pulse detection. The search steps are as follows: S51: The initial state is "idle". If a "peak" is encountered where the middle data is greater than the data on both sides, and the peak value is greater than "threshold H1", the state switches to "search for positive pulse". If a "valley" is encountered where the middle data is less than the data on both sides, and the valley value is less than "threshold H2", the state switches to "search for negative pulse". Before switching states, it is necessary to backtrack the pulse starting point by using cached data. The starting point is defined as tracing back from the "peak" or "valley". When the first data that is close to 0 and whose absolute value is less than the "threshold H3" is encountered, it is recorded as the starting point. S52: If the current state is "searching for positive pulse", if a new "peak" is encountered that is higher than the current "peak", update the "peak"; The first data point close to 0 encountered after "peak" is marked as the end point, and "peak" is marked as the apex. The type of buffer pulse is positive pulse; the state switches to "idle". If the current state is "searching for negative pulses", if a new "valley" is encountered that is lower than the current "valley", the "valley" is updated; the first data point close to 0 encountered after the "valley" is recorded as the endpoint, the "valley" is recorded as the vertex, the type of the buffered pulse is negative pulse, and the state is switched to "idle".

4. The intelligent dumbbell counting method based on a 6-axis sensor according to claim 3, characterized in that: In step S6, noise filtering, the following data about the pulses are statistically analyzed: S61: Pulse width: End point - Start point; S62: Pulse area: the sum of the absolute values ​​of all data between the start and end points; S63: Average Energy of Current Axis in 2 Seconds: Only the current axis is considered, and the average of the absolute values ​​of all data between the end point and the end point is calculated in 2 seconds before the end point. S64: Average Energy per Second Axis: Calculated once for each axis, the average of the absolute values ​​of all data during the time from the end point of the current axis to the end point, 1 second before the end point of the current axis; S65: Number of noise points in bandpass filtering: The number of noise vertices between the start and end points of the current axis after bandpass filtering, where a noise vertex is defined as either the middle data being greater than or less than the data on either side. S66: Set the area threshold based on the number of noise vertices; S67: Set the pulse amplitude threshold based on the number of noise vertices; S68: The absolute value of the pulse's peak is used as the pulse's amplitude; S69: If the area of ​​the pulse is less than the area threshold, or the amplitude is less than the amplitude threshold, then the pulse is considered interference and deleted; the remaining pulses that meet the conditions are considered valid pulses and put into the buffer for later use.

5. The intelligent dumbbell counting method based on a 6-axis sensor according to claim 4, characterized in that: The steps for valid sequence matching in step S7 are as follows: S71: Buffer the most recent N1 pulses, the pulse type is either positive pulse or negative pulse, mark each pulse with the pulse type, and match according to the pattern of positive and negative pulse occurrence; S72: When the number of pulses is greater than or equal to 4, matching begins. First, matching is performed on 4 pulses. The matching sequence is A1B1A2B2, where A1A2 are of the same type and B1B2 are of the same type. The subscripts indicate the order in which they appear. When the first and third pulse types are the same, the second and fourth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold, it is considered to meet the matching condition and perform the identification of whether it is a repetitive action. S73: Each pulse records the following information: width (W), amplitude (V), area (A), average energy of the current axis over 2 seconds (P2), and average energy of all axes over 1 second (P1_AX, P1_AY, P1_AZ, P1_AXYZ, P1_GX, P1_GY, P1_GZ); the information of each pulse is represented by a vector. S74: Combine A1B1A2B2 into a new vector, and normalize the vector column by column; S75: Create two new vectors, Vector1=[A1,B1] and Vector2=[A2,B2], using the normalized data. Calculate the cosine similarity and Euclidean distance between Vector1 and Vector2. S76, if the cosine similarity is greater than the threshold H4 and the Euclidean distance is less than the threshold H5, it is recorded as a valid sequence, indicating that the sequence has obvious repetitive actions; S77. If the cosine similarity and Euclidean distance do not meet the requirements, then other sequences will be matched.

6. The intelligent dumbbell counting method based on a 6-axis sensor according to claim 5, characterized in that: In step S72, the number of pulses matched is set to 6; when the number of pulses is equal to 6, the matching sequence is A1B1C1A2B2C2, where A1A2 are of the same type, B1B2 are of the same type, and C1C2 are of the same type, and the subscript indicates the order of appearance; When the first and fourth pulse types are the same, the second and fifth pulse types are the same, the third and sixth pulse types are the same, and the absolute value of the difference between (start point of B1 - end point of A1) and (start point of B2 - end point of A2) is less than the distance threshold, and the absolute value of the difference between (start point of C1 - end point of B1) and (start point of C2 - end point of B2) is less than the distance threshold, the matching conditions are met, and the identification of whether it is a repetitive action is performed.

Citation Information

Patent Citations

  • Intelligent skipping rope and skipping rope counting method and device

    CN108721826A

  • Intelligent dumbbell action counting method based on motion sensor

    CN114534236A