Summary of the invention
All have consumptive material loaded down with trivial details in order to solve existing identification with detection method, environmental requirement is harsh, and suitable extensive the use do not suit in the technical problem of the drawback of daily life popularization, and the present invention provides a kind of human motion state detection system and detection method.
For realizing above-mentioned purpose, technical scheme of the present invention is following:
A kind of human motion state detection system is characterized in that comprising: the system data interface, and API provides by corresponding mobile phone operating system, can obtain corresponding data through programming; The mobile phone sensor assembly; The human body movement data acquisition module, said human body movement data acquisition module with the human body movement data acquisition module that the system data interface is connected with the mobile phone sensor assembly, is used to obtain the associ-ated motion parameters of human body; Data processing module, the data that are used for the human body movement data acquisition module is got access to are carried out interpolation, guarantee that there are unique time corresponding point in accekeration and direction value that pick off gets access to; The data normalization mapping block is used for through the trigonometric function relational expression, handles the three-dimensional coordinate that post-acceleration value and direction value be mapped to standard to data processing module and fastens; The kinestate matching module, sample storehouse training module that is connected with the kinestate matching module and kinestate discrimination module; Be used for that data normalized mapping module is mapped to the data that the three-dimensional coordinate of standard fastens and analyze, through with the sample database contrast, judge the current kinestate of human body;
Comprise acceleration transducer and direction sensor on the mobile phone terminal as the said human body movement data acquisition module of the further improvement of technique scheme.
Further improvement as technique scheme; Said data processing module comprises: the data interpolating module; Utilize the acceleration parameter and the approximation of directioin parameter on corresponding time point of interpolation algorithm estimation human motion state, thereby obtain more complete kinematic parameter; Time quantum is divided module, according to predefined length time division time period unit.
Further improvement as technique scheme; Said kinestate matching module comprises: state sample storehouse training module; Through confirming specific kinestate, as fall, kinestate such as running, each specific kinestate is carried out the acceleration sequential sampling; Utilize the SVM algorithm acceleration sequence is classified and to detect, thereby train a standard sample database; The kinestate discrimination module matees the input of the acceleration sequence in each special time period sample storehouse, finds out and original the most similar kinestate of kinestate, further judges the kinestate of current slot.
As the further improvement of technique scheme, the acceleration information that said acceleration transducer gets access to comprises x axle acceleration value, y axle acceleration value and z axle acceleration value.
As the further improvement of technique scheme, the direction that said direction sensor gets access to comprises angle and the projection on the mobile phone y axle horizontal face and the angle of direct north of angle, mobile phone y axle and the horizontal plane of mobile phone x axle and horizontal plane.
Except that the system that provides, the present invention also provides a kind of human motion state detection system method, it is characterized in that comprising:
Step 1, the human body movement data acquisition process is obtained human body movement data through the mobile phone pick off, and when body state changed, pick off will write down accekeration and direction value automatically;
Step 2, exercise data are handled: the data that get access in the step 1 carried out interpolation make the data homogenization, utilize the trigonometric function relational expression that the acceleration information of all directions is mapped to standard coordinate again and fasten, and with this parameter as condition discrimination;
Step 3, physical training condition sample storehouse are handled, and each specific kinestate is carried out the acceleration sequential sampling, utilize the SVM algorithm acceleration sequence is classified and to detect;
Step 4, the kinestate discriminating processing according to the parameter that the standard coordinate that obtains in the step 2 is fastened, is mated with the sample storehouse that obtains in the step 3), thereby confirms the current kinestate of human body.
Further improvement as technique scheme; In the said step 2 data that get access to being carried out interpolation is to utilize the acceleration parameter and the approximation of directioin parameter on corresponding time point of interpolation algorithm estimation human motion state, thereby obtains more complete kinematic parameter.
As the further improvement of technique scheme, it is the process of a machine learning that the said SVM of utilization algorithm is classified to the acceleration sequence, between learning accuracy and learning capacity, matees best classification according to limited sample information.
A kind of human motion state detection system and the detection method of embodiment of the present invention have following beneficial effect:
1) the present invention can be carried on mobile phone, and is easy to carry, environment for use do not had harsh, has convenient easy-to-use characteristics; Make human motion state detect and to abandon former laboratory condition, accomplish really and can in the schedule life, use that really accomplishing can large-scale promotion and utilization.
2) the present invention is based on the existing acceleration transducer of mobile phone, direction sensor, not only the DATA REASONING result is accurate, and the testing result accuracy is high; And possessed communication capacity, the locomotivity of mobile phone, and the potentiality that can continue to develop are big, and application scenarios is wide.
3) the present invention creatively applies to artificial intelligence's learning algorithm SVM in the classification to the accekeration sequence on detection algorithm, and classify accuracy is high, and testing result is steadily and surely efficient.And SVM algorithm process characteristics of high efficiency, make its performance on mobile phone have the advantages that speed is fast, power consumption is low.
The specific embodiment:
Along with popularizing of smart mobile phone; And the continuous development of the hardware technologies such as pick off on smart mobile phone, through the various pick offs on the combined with intelligent mobile phone, technological means such as application mode identification are handled, are analyzed the data that from pick off, obtain; It is more and more lower that cost becomes; And such method is simple, to special equipment require low.Not only can not cause too perturbation to user's behavior act, and can be in real time, quickly and accurately user's kinestate is made judgement, and make corresponding processing, as detect the old people and fall, will send warning message etc. automatically.Shown in accompanying drawing 1, a kind of human motion state detection system provided by the invention comprises human body movement data acquisition module, data processing module, data normalization mapping block, kinestate matching module; The human body movement data acquisition module comprises acceleration transducer and the direction sensor on the mobile phone terminal, is used to obtain the associ-ated motion parameters of human body; The data that data processing module is used for pick off is got access to are carried out interpolation, guarantee that there are unique time corresponding point in accekeration and direction value that pick off gets access to; The data normalization mapping block utilizes the trigonometric function relational expression, and the three-dimensional coordinate that is mapped to existing accekeration and direction value standard is fastened; The kinestate matching module is analyzed data, through contrasting with sample database, judges the current kinestate of human body.Data processing module comprises data interpolating module, time quantum division module; The data interpolating module is utilized the acceleration parameter and the approximation of directioin parameter on corresponding time point of interpolation algorithm estimation human motion state, thereby obtains more complete kinematic parameter; Time quantum is divided module according to predefined length time division time period unit.The data normalization mapping block utilizes the trigonometric function relational expression, and the acceleration information on all directions is decomposed predefined conventional coordinates.The kinestate matching module comprises state sample storehouse training module, kinestate discrimination module; State sample storehouse training module is at first confirmed specific kinestate; As fall, kinestate such as running; Each specific kinestate is carried out the acceleration sequential sampling, utilize the SVM algorithm acceleration sequence is classified and to detect, thereby train a standard sample database; The kinestate discrimination module matees the input of the acceleration sequence in each special time period sample storehouse, finds out and original the most similar kinestate of kinestate, further judges the kinestate of current slot.The acceleration information that acceleration transducer gets access to comprises x axle acceleration value, y axle acceleration value and z axle acceleration value; The direction that direction sensor gets access to comprises angle and the projection on the mobile phone y axle horizontal face and the angle of direct north of angle, mobile phone y axle and the horizontal plane of mobile phone x axle and horizontal plane.Wherein interpolation algorithm must all carry out interpolation to the accekeration on each coordinate axes, must all carry out interpolation to the angle value on all directions angle simultaneously, thereby guarantee that the accekeration on each time point is corresponding with the direction value.It is the process of a machine learning that the SVM algorithm is classified, and between learning accuracy and learning capacity, matees best classification according to limited sample information.
Wherein the date processing processing module shown in accompanying drawing 2, mainly is that the data that some mobile phone pick off of solution obtains not are to be the problem of even interval.For example, the sensing data that obtains from the API of Andoird SDK is that the time is heterogeneous.The current performance of quantity and pick off and CPU of obtaining data is closely bound up.Therefore, the data volume that each second obtains is different, and the data in a second also are heterogeneous.Follow-up for ease normalized processing, we need merge data or interpolation.If packing density surpasses threshold values (threshold values is generally 50 sampled points of per second, interval 0.02), we carry out the data merging, if packing density is lower than threshold values, we use cubic spline interpolation to carry out data extending.Selecting cubic spline interpolation, is that to make error amount drop to minimum as far as possible because can obtain smooth curve through segmentation cubic interpolation multinomial.We all can add time tag the sensing data that obtains each time, and carry out the constant duration interpolation through these time tags.The data normalization mapping block mainly is the acceleration with different angles, and normalizing is to the accekeration of three directions of conventional coordinates xyz.Through above step, the parameter of we are known uniform acceleration of time and direction sensor.Through the relevant knowledge of solid geometry, we carry out decomposition of coordinate to the vector acceleration of former mobile phone subsequently, and vector is decomposed conventional coordinates and adds up; Can obtain conventional coordinates X, Y, the accekeration of Z axle (X axle: point to the positive north; Y axle: point to positive west; Z axle: upwards) is respectively x, y, z with respect to self acceleration when mobile phone perpendicular to the earth horizontal plane; Deflection, the inclination angle, the anglec of rotation is respectively α, beta, gamma, then this moment X, Y, the acceleration of Z axle is respectively:
X=x(cosγcosα-sinγsinβsinα)+ycosβsinα-z(sinγcosα+cosγsinβsinα)
Y=-x(cosγsinα+sinγsinβcosα)+ycosβcosα+z(sinγsinα-cosγsinβcosα)
Z=zcosγcosβ+xsinγcosβ+ysinβ
Through above-mentioned a series of conversion, then just with non-normalizing, sensing data heterogeneous is mapped as normalizing, uniformly the conventional coordinates accekeration.
The kinestate matching module need be used the libsvm storehouse of increasing income, and this storehouse is a machine learning algorithm storehouse, can be used for data are clocklike classified.The interface that provides according to libsvm; Wherein kinestate matching module storehouse also is divided into sample storehouse training module and kinestate discrimination module; Wherein sample storehouse training module all writes down M group sequence to known N kind kinestate after the sequence that obtains the data normalization mapping, then can obtain N*M group accekeration sequence; And this sequence imported all libsvm, will generate a sample storehouse.And the kinestate discrimination module is at any time in the section, collects one group of acceleration sequence, through processing and normalization after, compare with the sample storehouse, can judge any kinestate that this sequence belongs to the sample storehouse.
As shown in Figure 2, a kind of human motion state detection method provided by the invention may further comprise the steps:
The first step, the human body movement data collection, the user with on the mobile phone of above-mentioned human motion state detection system is housed, such as an android mobile phone that our software is housed, it is movable naturally that mobile phone is taken a walk, gone upstairs etc. with the user.Open pick off, mobile phone just begins to collect instant acceleration and bearing data through pick off.
In second step, exercise data is handled, and is as shown in Figure 3; The human motion meeting brings the change of acceleration, judges the interval between the adjacent accekeration, if density surpassed threshold values; Directly merge; Otherwise carry out merging after the cubic spline interpolation, thereby obtain the identical acceleration sequence of interval, be converted into the acceleration sequence of these different directions through the normalization formula acceleration sequence of conventional coordinates at last.
The 3rd step, physical training condition sample storehouse, shown in accompanying drawing 4, that we will set up is the data base of the common kinestate of M kind, like running, stroll, static etc.Move to the M kind from first kind and move, 1 ~ N time motion carried out in each motion, and collects the acceleration sequence of standard by top method.At last, the M*N group sample input svm that obtains is built the storehouse.
In the 4th step, kinestate is differentiated, behind the acquisition sample database; Can begin formal detection, continue as shown in Figure 2, with the detected acceleration sequence of certain random motion (handle back); Be input among the Libsvm and go;, thereby can think that current motion is exactly the sort of type of sports in the sample with the type of sports that obtains mating most with this acceleration sequence in the sample storehouse.
Wherein, the date processing processing module shown in accompanying drawing 2, mainly is that the data that some mobile phone pick off of solution obtains not are to be the problem of even interval.For example, the sensing data that obtains from the API of Andoird SDK is that the time is heterogeneous.The current performance of quantity and pick off and CPU of obtaining data is closely bound up.Therefore, the data volume that each second obtains is different, and the data in a second also are heterogeneous.Follow-up for ease normalized processing, we need merge data or interpolation.If packing density surpasses threshold values (threshold values is generally 50 sampled points of per second, interval 0.02), we carry out the data merging, if packing density is lower than threshold values, we use cubic spline interpolation to carry out data extending.Selecting cubic spline interpolation, is that to make error amount drop to minimum as far as possible because can obtain smooth curve through segmentation cubic interpolation multinomial.We all can add time tag the sensing data that obtains each time, and carry out the constant duration interpolation through these time tags.
Wherein, the data normalization mapping block mainly is the acceleration with different angles, and normalizing is to the accekeration of three directions of conventional coordinates xyz.Through above step, the parameter of we are known uniform acceleration of time and direction sensor.Relevant knowledge through solid geometry subsequently; We carry out decomposition of coordinate to the vector acceleration of former mobile phone, and vector is decomposed conventional coordinates and adds up, and can obtain conventional coordinates X; Y; The accekeration of Z axle (X axle: point to the positive north, Y axle: point to positive west, the Z axle: upwards) perpendicular to the earth horizontal plane
When mobile phone is respectively x, y, z with respect to self acceleration; Deflection, the inclination angle, the anglec of rotation is respectively α, beta, gamma, then this moment X, Y, the acceleration of Z axle is respectively:
X=x(cosγcosα-sinγsinβsinα)+ycosβsinα-z(sinγcosα+cosγsinβsinα)
Y=-x(cosγsinα+sinγsinβcosα)+ycosβcosα+z(sinγsinα-cosγsinβcosα)
Z=zcosγcosβ+xsinγcosβ+ysinβ
Through above-mentioned a series of conversion, with non-normalizing, sensing data heterogeneous is mapped as normalizing, uniformly the conventional coordinates accekeration.
The kinestate matching module need be used the libsvm storehouse of increasing income, and this storehouse is a machine learning algorithm storehouse, can be used for data are clocklike classified.According to the interface that libsvm provides, our kinestate matching module storehouse also is divided into two sub-module, sample storehouse training module and kinestate discrimination module.Wherein sample storehouse training module after the sequence that obtains the data normalization mapping, all writes down M group sequence to known N kind kinestate, then can obtain N*M group accekeration sequence, imports all libsvm to these sequences, will generate a sample storehouse.And the kinestate discrimination module is at any time in the section, collects one group of acceleration sequence, through processing and normalization after, compare with the sample storehouse, can judge any kinestate that this sequence belongs to the sample storehouse.
Above content is to combine concrete preferred implementation to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to these explanations.For the those of ordinary skill of technical field under the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.