CN108981744A - A kind of cadence real-time computing technique based on machine learning and low-pass filtering - Google Patents
A kind of cadence real-time computing technique based on machine learning and low-pass filtering Download PDFInfo
- Publication number
- CN108981744A CN108981744A CN201810884041.XA CN201810884041A CN108981744A CN 108981744 A CN108981744 A CN 108981744A CN 201810884041 A CN201810884041 A CN 201810884041A CN 108981744 A CN108981744 A CN 108981744A
- Authority
- CN
- China
- Prior art keywords
- user
- cadence
- real
- data
- exercise data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C22/00—Measuring distance traversed on the ground by vehicles, persons, animals or other moving solid bodies, e.g. using odometers, using pedometers
- G01C22/006—Pedometers
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/103—Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
- A61B5/11—Measuring movement of the entire body or parts thereof, e.g. head or hand tremor, mobility of a limb
- A61B5/112—Gait analysis
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Heart & Thoracic Surgery (AREA)
- Surgery (AREA)
- Biophysics (AREA)
- Pathology (AREA)
- Dentistry (AREA)
- Biomedical Technology (AREA)
- Physiology (AREA)
- Medical Informatics (AREA)
- Molecular Biology (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Public Health (AREA)
- Veterinary Medicine (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
Abstract
The cadence real-time computing technique based on machine learning and low-pass filtering that the invention discloses a kind of, this method provides the real-time cadence that a kind of simple and effective approach knows running to vast running fan, determines by data preparation, model training, state, calculates four-stage in real time and accurately calculate cadence.The present invention greatly improves the case where calculating of current cadence is not real-time and easy miscalculation cadence, so that cadence calculating reaches reliable in real time, due to using machine learning method, therefore the case where reduce error statistics cadence.Meanwhile real-time display cadence of the present invention, the velocity for facilitating runner to draw oneself up, and cadence calculating is more accurate.
Description
Technical field
The invention belongs to motion detection technique fields, and in particular to a kind of based on the cadence of machine learning and low-pass filtering reality
When calculation method.
Background technique
With the fast development of economy and society, health is increasingly valued by people;Along with the increasingly general of mobile phone
And major mobile phone production manufacturer implants various posture detection sensors in mobile phone also to obtain the motion state number of user
According to.At the same time, many people can select running to keep a healthy physical condition, and for running, cadence is as one
The important Motion evaluation index of item, has very important significance to the fitness campaign state of evaluation user.
The software of present mobile phone record cadence is numerous, such as major motion software, day common social software, iPhone
Included healthy software has cadence tally function, these software statistics cadences have a feature, they be not in real time,
These softwares are all to count the step number that you walk in certain period of time.In addition, these step numbers statistics is generally not very accurately, all
It is a substantially step number, is not so accurate;Certainly, doing so is also to have certain reason, because some users are only concerned him
How many step walked in this day.A problem being also faced on the market there are also these softwares now is exactly false statistic, especially for
During user is riding, possible false statistic step number leads to the step number of the inadequate actual response user of step number.
In the prior art, as the Chinese patent of publication number CN104905794A provide a kind of pedestrian's cadence computing system and
Its method can also accomplish the cadence for calculating pedestrian in real time, and very accurate, but this method needs to wear a large amount of measurement
Equipment, therefore be not appropriate in routine use;The Chinese patent of publication number CN106310588A provides a kind of treadmill cadence
With impulse detection method and device thereof, this method is completely by means of the data of treadmill, and there is no in cadence calculation method
It is proposed new calculation.
Nowadays, machine learning has outstanding performance in numerous fields, and machine learning techniques are also applied to each neck
Domain, such as the proposed algorithm of e-commerce, find associated data mining algorithm in numerous data.The field calculated for cadence
Scape, machine learning can be used to differentiate whether user is the state in walking, not be on other vehicles.
Summary of the invention
It, can in view of above-mentioned, the cadence real-time computing technique based on machine learning and low-pass filtering that the present invention provides a kind of
It cannot be calculated in real time with solving the problem of that at present cadence statistical software statistics is inaccurate on the market.
A kind of cadence real-time computing technique based on machine learning and low-pass filtering, includes the following steps:
(1) using the sensor collection different motion state in mobile phone (as in taxi, bus, subway, voluntarily
Vehicle is slowly walked, the states such as normal cadence is walked, skelped, jogging, hurrying up) exercise data of user;
(2) using the exercise data obtained in step (1), training one for judging whether user is in ambulatory status
Discrimination model;
(3) exercise data real-time for user to be measured, judges it using the discrimination model: if it is determined that be measured
User is currently at ambulatory status, thens follow the steps (4), otherwise directly returns to the instruction of the current non-ambulatory status of user to be measured;
(4) according to the real-time exercise data of user to be measured, the current stride frequency of calculating in each second.
Further, the exercise data of user includes acceleration of gravity data, acceleration information, top in the step (1)
Spiral shell instrument data and magnetic induction data.
Further, the step (2) training discrimination model before for different motion status user exercise data,
It is also derived from the user of non-ambulatory status by the user that every group of exercise data of handmarking is derived from ambulatory status, to obtain
Great amount of samples;Each sample includes one group of exercise data and its corresponding label, and the label is indicated with 0 or 1, and 1 represents fortune
Dynamic data are originated from the user of ambulatory status, and 0 represents the user that exercise data is originated from non-ambulatory status.
Further, all samples are divided into training set in the step (2) and verifying collects, using training set sample as defeated
Enter and tri- kinds of random forest, support vector machines and XGBoost machine learning models are trained respectively, then utilizes verifying collection sample
This three kinds of model completed to training is tested, and is chosen the wherein highest model of accuracy rate and is carried out small parameter perturbations to it, from
And it obtains the discrimination model and saves.
Further, the nearest n group exercise data of user to be measured is obtained in the step (3), by this n group exercise data by
One is input to and obtains corresponding output in discrimination model as a result, if wherein corresponding output result judgement is the fortune in ambulatory status
Dynamic data are more than n/2 group, then determine that user to be measured is currently at ambulatory status.
Further, the step (4) the specific implementation process is as follows:
4.1 with the acceleration information and acceleration of gravity data of 30Hz frequency sampling user to be measured;
4.2 make the acceleration information of user to be measured and acceleration of gravity data do dot-product operation according to the following formula;
L=xu×xg+yu×yg+zu×zg
Wherein: xu、yu、zuRespectively component of the acceleration in X-axis, Y-axis, Z-direction, xg、yg、zgRespectively gravity adds
Component of the speed in X-axis, Y-axis, Z-direction, L are dot-product operation result;
4.3 are filtered denoising to dot-product operation result L using the low-pass filter of three ranks;
4.4 one threshold value of setting stop the dot-product operation result L after denoising greater than threshold value to less than threshold value
Whole process is calculated as a step, and then counts and share how many steps as user's current stride frequency to be measured in one second.
Based on the above-mentioned technical proposal, cadence real-time computing technique of the present invention has following advantageous effects:
(1) the case where reducing error statistics cadence present invention employs machine learning method.
(2) present invention compared to cadence software for calculation on the market is that cadence can be calculated in real time, and root is it was found that running
When best cadence be 180 or so preferably, running software in society can not real-time display cadence, real-time display step of the present invention
Frequently, the velocity for facilitating runner to draw oneself up.
(3) cadence of the invention calculates more accurate, accurately calculates cadence.
Detailed description of the invention
Fig. 1 is the step flow diagram of cadence real-time computing technique of the present invention.
Fig. 2 is the acceleration information waveform diagram under the state of jogging after filtering.
Fig. 3 is the acceleration information waveform diagram under the state of jogging without filtering.
Specific embodiment
In order to more specifically describe the present invention, with reference to the accompanying drawing and specific embodiment is to technical solution of the present invention
It is described in detail.
As shown in Figure 1, the present invention is in ambulatory status rather than at it using machine learning algorithm accurate judgement user
Above his vehicles, and then noise is filtered out with low-pass filter, finally reaches the purpose for calculating cadence in real time, specific steps are such as
Under:
S1. the mobile phone sensor data of user data preparation: are collected.
1.1 prepare a mobile phone, and mobile phone is a regular handset on the market, but to be accompanied with acceleration of gravity, use
The sensors such as family acceleration, gyroscope, magnetic field, all experiments in present embodiment are all based on iPhone 6s, the number of acquisition
According to format as shown in Table 1 is organized into, gauge outfit illustrates the number of respective sensor.
Table 1
1.2 collect the sensing data of user mobile phone, mainly include acceleration of gravity data, user's acceleration information, top
Spiral shell instrument data and magnetic induction data.The sensing data of mobile phone user's mobile phone is related to a sample frequency, and different mobile phones produce
The frequency of these raw data slightly has difference, and present embodiment is the experiment done on iPhone, sample frequency 30Hz.
1.3 by data preparation obtained in step 1.2 be model input data, and the handy family of handmarking whether be place
In ambulatory status, collect respectively user be in taxi, bus, subway, bicycle, slowly walk, normal cadence is walked, quick step
It walks, jog, the data for state of hurrying up.The data of one hour of data collection of each state, data source in different people,
It is assembled with data collector to them, facilitates the generalization ability for increasing model in this way.
S2. judge whether in ambulatory status: judging whether user is according to the model of the data training in step S1
Ambulatory status, if result, which whether, directly returns to user, is not currently in ambulatory status.After Data Preparation is completed,
Start training of the model on data set, specifically include the following steps:
2.1 training datas according to obtained in step S1 attempt random forest, tri- kinds of support vector machines, XGBoost mainstreams
Machine learning model is run under same data set respectively.
2.2 select a highest model of accuracy rate according to the result of three models, finally use in present embodiment
XGBoost model.
After 2.3 steps 2.2 are completed, make XGBoost model result as baseline, is adjusted in this step and choose mould
The parameter of type obtains the model of higher accuracy.The parameter configuration of the last Selection Model of present embodiment is as shown in table 2, in table 2
Important parameter is only listed, other parameters are all made of the parameter configuration of model default, will not enumerate herein.
Table 2
Parameter | Selectable value |
booster | gbtree |
maxdepth | 5 |
sub_sample | 0.7 |
2.4 save trained model in step 2.3, this model will be as the last mould for differentiating user movement state
Type.
S3. judge whether in ambulatory status: judging whether user is in ambulatory status according to the model of step S2 training,
If whether result, directly returns to user and is not currently in ambulatory status, detailed process is as follows:
3.1 obtain user mobile phone sensing data in real time, are organized into ten groups of data and are sent into the model that step S2 is finally obtained,
Ten groups of meaning is chosen to be to increase the accuracy rate of Model checking.
3.2 according to ten of step 3.1 differentiate results make user whether be in ambulatory status as a result, if in ten
Have and be more than or equal to five the result is that differentiation belongs to ambulatory status, otherwise differentiation user is not currently in ambulatory status.
We obtain a model after step S3, accuracy rate of these models on verifying collection be all it is very high,
But a good model must be the relatively good model of generalization ability, therefore we need to see the generalization ability of model,
It needs to come back to step S3 if generalization ability is very poor, otherwise enters step S4.
S4. cadence calculates in real time: if it is ambulatory status, then obtaining user mobile phone sensing data in real time, and count in real time
Cadence is calculated, the current stride frequency of calculating in each second, detailed process is as follows:
4.1 with the sensing data of the frequency collection user mobile phone of 30HZ, and model, which has differentiated, in this step belongs to
Ambulatory status only needs user's acceleration information and acceleration of gravity data at this time, other data can not have to.
Obtained user's acceleration information per second and acceleration of gravity data are done dot product, user's acceleration and gravity by 4.2
Acceleration is all divided into the data in tri- axial directions of XYZ, doing shown in the following formula of dot product here:
xu×xg+yu×yg+zu×zg
Wherein: xuRepresent the X value of user's acceleration, xgRepresent the X value of gravity acceleration, other and so on;After dot product
The result is that the fluctuation up and down on gravity direction of user itself, for example data of the cellie under the state of jogging are as schemed
Shown in 3.
4.3 realize the low-pass filter of three ranks, and present embodiment selects simple and easy to accomplish IIR
(Infinite Impulse Respone) filter, IIR's specific formula is as follows:
outputi=α0(inputiβ0+inputi-1β1+inputi-2β2-outputi-1α1-outputi-2α2)
Wherein: α and β is the coefficient of filter, these coefficients are fixed, inputiThe timing of input is represented as the number of i
According to outputiOutput timing is represented as the data of i, the coefficient that present embodiment uses is as shown in table 3:
Table 3
Coefficient | Value |
α0 | 1 |
α1 | -0.631042566328 |
α2 | 0.04623279 |
β0 | 0.4768836 |
β1 | 0 |
β2 | -0.4768836 |
4.4 filter the noise in the data after passing through dot product in step 4.2 with the third-order low-pass filter of step 4.3,
Noise mostly come from mobile phone in the hand or other positions of user's body rock it is indefinite, Fig. 2 show by filtering after
Data.
4.5 one threshold value of selection are greater than this threshold value to this threshold value is less than every time and calculate a step, calculate within one second in this way
How many step was exactly the current cadence of user divided by one second.The threshold value that present embodiment selects is 0.5, then each data are greater than
0.5, to less than 1 step is denoted as 0.5 this period, then calculates the step number in one second, and then obtain current cadence.
The above-mentioned description to embodiment is for that can understand and apply the invention convenient for those skilled in the art.
Person skilled in the art obviously easily can make various modifications to above-described embodiment, and described herein general
Principle is applied in other embodiments without having to go through creative labor.Therefore, the present invention is not limited to the above embodiments, ability
Field technique personnel announcement according to the present invention, the improvement made for the present invention and modification all should be in protection scope of the present invention
Within.
Claims (6)
1. a kind of cadence real-time computing technique based on machine learning and low-pass filtering, includes the following steps:
(1) exercise data of the sensor collection different motion status user in mobile phone is utilized;
(2) using the exercise data obtained in step (1), training one for judging whether user is in the differentiation of ambulatory status
Model;
(3) exercise data real-time for user to be measured, judges it using the discrimination model: if it is determined that user to be measured
It is currently at ambulatory status, thens follow the steps (4), otherwise directly returns to the instruction of the current non-ambulatory status of user to be measured;
(4) according to the real-time exercise data of user to be measured, the current stride frequency of calculating in each second.
2. cadence real-time computing technique according to claim 1, it is characterised in that: the movement of user in the step (1)
Data include acceleration of gravity data, acceleration information, gyro data and magnetic induction data.
3. cadence real-time computing technique according to claim 1, it is characterised in that: the step (2) differentiates mould in training
For the exercise data of different motion status user before type, ambulatory status is derived from by every group of exercise data of handmarking
User is also derived from the user of non-ambulatory status, to obtain great amount of samples;Each sample include one group of exercise data and its
Corresponding label, the label indicate that 1 represents the user that exercise data is originated from ambulatory status, and 0 represents exercise data source with 0 or 1
From the user of non-ambulatory status.
4. cadence real-time computing technique according to claim 3, it is characterised in that: by all samples in the step (2)
It is divided into training set and verifying collection, using training set sample as input respectively to random forest, support vector machines and tri- kinds of XGBoost
Machine learning model is trained, and is then tested, is chosen wherein using three kinds of models that verifying collection sample completes training
The highest model of accuracy rate simultaneously carries out small parameter perturbations to it, to obtain the discrimination model and save.
5. cadence real-time computing technique according to claim 1, it is characterised in that: obtain use to be measured in the step (3)
The nearest n group exercise data in family, this n group exercise data is input to one by one in discrimination model obtain it is corresponding output as a result, if
It is more than n/2 group that wherein corresponding output result judgement, which is the exercise data in ambulatory status, then determines that user to be measured is currently at
Ambulatory status.
6. cadence real-time computing technique according to claim 1, it is characterised in that: the specific implementation of the step (4)
Journey is as follows:
4.1 with the acceleration information and acceleration of gravity data of 30Hz frequency sampling user to be measured;
4.2 make the acceleration information of user to be measured and acceleration of gravity data do dot-product operation according to the following formula;
L=xu×xg+yu×yg+zu×zg
Wherein: xu、yu、zuRespectively component of the acceleration in X-axis, Y-axis, Z-direction, xg、yg、zgRespectively acceleration of gravity
Component in X-axis, Y-axis, Z-direction, L are dot-product operation result;
4.3 are filtered denoising to dot-product operation result L using the low-pass filter of three ranks;
4.4 one threshold value of setting stop entire dot-product operation result L after denoising greater than threshold value to less than threshold value
Process is calculated as a step, and then counts and share how many steps as user's current stride frequency to be measured in one second.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810884041.XA CN108981744B (en) | 2018-08-06 | 2018-08-06 | Step frequency real-time calculation method based on machine learning and low-pass filtering |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810884041.XA CN108981744B (en) | 2018-08-06 | 2018-08-06 | Step frequency real-time calculation method based on machine learning and low-pass filtering |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108981744A true CN108981744A (en) | 2018-12-11 |
CN108981744B CN108981744B (en) | 2020-07-07 |
Family
ID=64555814
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810884041.XA Active CN108981744B (en) | 2018-08-06 | 2018-08-06 | Step frequency real-time calculation method based on machine learning and low-pass filtering |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108981744B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115282573A (en) * | 2022-09-29 | 2022-11-04 | 山东布莱特威健身器材有限公司 | Treadmill intelligent control method and system combining internet of things and data analysis |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101226061A (en) * | 2008-02-21 | 2008-07-23 | 上海交通大学 | Method for locating walker |
CN101907467A (en) * | 2010-08-06 | 2010-12-08 | 浙江大学 | Method and device for personal location based on motion measurement information |
US20140172361A1 (en) * | 2012-12-19 | 2014-06-19 | Industrial Technology Research Institute | Multi-posture stride length calibration system and method for indoor positioning |
CN104296749A (en) * | 2014-11-03 | 2015-01-21 | 中国科学院深圳先进技术研究院 | Motion state perception-based low power consumption positioning method and system |
CN106289311A (en) * | 2016-08-04 | 2017-01-04 | 北京妙医佳信息技术有限公司 | A kind of motion duration and the detection method of distance |
CN108195395A (en) * | 2017-11-17 | 2018-06-22 | 捷开通讯(深圳)有限公司 | Mobile terminal and its step-recording method, storage device |
-
2018
- 2018-08-06 CN CN201810884041.XA patent/CN108981744B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101226061A (en) * | 2008-02-21 | 2008-07-23 | 上海交通大学 | Method for locating walker |
CN101907467A (en) * | 2010-08-06 | 2010-12-08 | 浙江大学 | Method and device for personal location based on motion measurement information |
US20140172361A1 (en) * | 2012-12-19 | 2014-06-19 | Industrial Technology Research Institute | Multi-posture stride length calibration system and method for indoor positioning |
CN104296749A (en) * | 2014-11-03 | 2015-01-21 | 中国科学院深圳先进技术研究院 | Motion state perception-based low power consumption positioning method and system |
CN106289311A (en) * | 2016-08-04 | 2017-01-04 | 北京妙医佳信息技术有限公司 | A kind of motion duration and the detection method of distance |
CN108195395A (en) * | 2017-11-17 | 2018-06-22 | 捷开通讯(深圳)有限公司 | Mobile terminal and its step-recording method, storage device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115282573A (en) * | 2022-09-29 | 2022-11-04 | 山东布莱特威健身器材有限公司 | Treadmill intelligent control method and system combining internet of things and data analysis |
Also Published As
Publication number | Publication date |
---|---|
CN108981744B (en) | 2020-07-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103323615B (en) | A kind of mobile terminal and method being calculated walking speed by acceleration transducer | |
CN103954295B (en) | A kind of step-recording method based on acceleration transducer | |
CN105872034B (en) | Tracking and system, the method and mobile communications device using it of record motion | |
CN104990562B (en) | Step-recording method based on auto-correlation computation | |
US20080275348A1 (en) | Monitor device and use thereof | |
CN103997572A (en) | Step counting method and device based on data of acceleration sensor of mobile phone | |
CN107854125A (en) | Real-time rhythm of the heart and motion analysis temper the system and method for monitoring to realize | |
CN110263870A (en) | Moving state identification method, apparatus, intelligent terminal and storage medium | |
CN112504295B (en) | Riding detection method, electronic device and computer readable storage medium | |
CN106256396A (en) | Motion assisting system and motion support method | |
JP6421475B2 (en) | Data analysis apparatus, data analysis method, and data analysis program | |
CN107270931A (en) | A kind of IOS and the general gait auto-correlation pedometer of Android platform | |
CN106030246A (en) | Device, method and system for counting the number of cycles of a periodic movement of a subject | |
CN113713358B (en) | Swimming monitoring method, device, storage medium and program product based on multi-sensor fusion | |
CN107727110A (en) | The statistical method and device of a kind of step number | |
Tran et al. | A high-accuracy step counting algorithm for iPhones using accelerometer | |
CN108888247A (en) | Aerobic capacity testing method, device and system and data acquisition equipment | |
CN105771224B (en) | A kind of locomotion evaluation system based on multisensor | |
US20240119860A1 (en) | Method and device for retrieving biomechanical parameters of a stride | |
CN105574471B (en) | The recognition methods of the method for uploading, user behavior of user behavior data and device | |
CN108827290A (en) | A kind of human motion state inverting device and method | |
CN106031824A (en) | A wearable device applicable for different motion types | |
CN108981744A (en) | A kind of cadence real-time computing technique based on machine learning and low-pass filtering | |
CN108072386B (en) | Step counting method and device | |
CN109063727A (en) | Calculate method, apparatus, storage medium and the electronic equipment of track frequency |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |