The content of the invention
For the disadvantages described above or Improvement requirement of prior art, the invention provides a kind of based on mobile phone inertial sensor
User's input recognition method, it is intended that attitude angle information is generated by merging accelerometer and gyro data first, and
The characteristic of division for identifying user's input is extracted from attitude angle information, multiple different types of graders is then trained, adopts
With the construction of strategy assembled classifier of combination ballot, posture feature is classified using assembled classifier in cognitive phase, known
Do not go out single character, finally establish HMM, using the sampling interval of accelerometer as observation sequence, rejecting is not inconsistent
The potential password combination of observation sequence is closed, can only identify that the technology of English text is asked so as to solve existing user's input recognition method
Topic.
To achieve the above object, according to one aspect of the present invention, there is provided a kind of use based on mobile phone inertial sensor
Family input recognition method, comprises the following steps:
(1) the attitude angle θ of mobile phone curve is obtained using attitude algorithm algorithm:
(2) acceleration information and acceleration signature value during collection user click mobile phone screen, counts acceleration information
Feature distribution scope, mobile phone is clicked in the range of feature distribution to detect user by judging whether acceleration signature value falls
Beginning and ending time point;
(3) user obtained according to step (2) clicks on the attitude angle that the beginning and ending time point that mobile phone occurs obtains in step (1)
Curve on obtain attitude angle characteristic value;
(4) the attitude angle characteristic value obtained using assembled classifier to step (3) is classified, to obtain user point hitter
Prediction result corresponding to the region of machine;
(5) all areas on mobile phone are clicked on for user, repeat the above steps (1) to (4), to obtain user point hitter
Prediction result corresponding to all areas of machine, and prediction result is handled using hidden Markov model, it is final to obtain
Recognition result.
Preferably, the posture clearing algorithm used in step (1) is complementary filter algorithm.
Preferably, attitude angle θ is obtained by below equation:
Wherein,For high-pass filter,For low pass filter, τ is high-pass filter and low pass filter
Time constant, dt are the sample frequency of high-pass filter and low pass filter, θaTo be calculated according to the axle relation of accelerometer three
The attitude angle arrived, θgThe attitude angle being calculated for gyroscope with quaternary number.
Preferably, step (2) includes following sub-step:
(2-1) obtains multiple 3-axis acceleration quadratic sum ASSs of the user in signal window by accelerometer:
ASS=ax 2+ay 2+az 2
Wherein axRepresent that the user that accelerometer is got clicks on the acceleration collected during mobile phone screen in X-direction
Value, ayRepresent that the user that accelerometer is got clicks on the acceleration magnitude collected during mobile phone screen in Y direction, azRepresent to add
The user that speedometer is got clicks on the acceleration magnitude collected during mobile phone screen in Z-direction;
Multiple characteristic values in the 3-axis acceleration quadratic sum ASS that (2-2) extraction step (2-1) obtains;
(2-3) repeats the above steps (2-1) and (2-2) up to T times, to obtain distribution I corresponding to each characteristic valuei,
Wherein i represents the sequence number of characteristic value, LiRepresent the lower limit of characteristic value, UiRepresent the higher limit of characteristic value:
Ii={ Li, Ui}
(2-4) extracts all 5 characteristic values, and extracting using sliding window from 3-axis acceleration quadratic sum ASS
Characteristic value and step (2-3) in the distribution I that getsiContrasted, divided if the All Eigenvalues of extraction all fall
Cloth scope IiIt is interior, then judge to detect click event, step (2-5) is then transferred to, if had in 5 characteristic values extracted
One does not fall within distribution IiIt is interior, then judge not detecting click event, sliding window is then pushed ahead one
Step-length, then repeat this step;
(2-5) is as a reference point with the position of current sliding window mouth, is counted forward with above-mentioned step-length, close enough by first
g2Position as time starting point, length N of the time starting point plus signal window is obtained into time terminating point;
Preferably, specific following five characteristic values of extraction in step (2-2):
P1:ASS maximum subtracts g in signal window2, wherein g expression gravitational constants;
P2:ASS minimum value subtracts g in signal window2;
P3:ASS maximum and the difference of minimum value;
P4:The sampling interval of P1 and P2 positions;
P5:ASS standard deviation Std (ASS) in signal window, it is specifically equal to:
Wherein N represents the length of signal window, and μ represents average values of the ASS in signal window.
Preferably, the attitude angle of mobile phone includes the angle of pitch that is rotated along carrier coordinate system X-axis of mobile phone, and mobile phone is along carrier
The angle roll angle of coordinate system Y-axis rotation.
Preferably, the characteristic value of extraction is in step (3):Difference of the roll angle from time starting point to flex point, roll angle
From flex point to standard deviation in signal window of the difference of time terminating point, roll angle, roll angle in signal window and, it is horizontal
Difference of mean difference, the angle of pitch of the roll angle in signal window between sampled point from time starting point to flex point, the angle of pitch from
Flex point to the standard deviation in signal window of difference, the angle of pitch of time terminating point, the angle of pitch in signal window and, pitching
Mean difference of the angle in signal window between sampled point.
Preferably, the assembled classifier that step (5) uses include K- arest neighbors sorting algorithm, Naive Bayes Classifier with
And SVMs.
In general, by the contemplated above technical scheme of the present invention compared with prior art, it can obtain down and show
Beneficial effect:
(1) present invention due to adding HMM, its using the sampling interval of accelerometer as observation sequence,
The potential password combination for not meeting observation sequence is rejected, and reduces the hunting zone of password, so as to reduce needed for decryption
Time, and realize the identification to account number cipher;
(2) by the present invention in that with assembled classifier, it is possible to increase the recognition accuracy of single character)
(3) present invention passes through the research to smart mobile phone inertial sensor and dummy keyboard input behavior, it is proposed that a kind of
Input identifying schemes using accelerometer and gyroscope as wing passage.
(4) present invention improves the accuracy of identification of single character by increasing characteristic of division and using assembled classification algorithm.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.As long as in addition, technical characteristic involved in each embodiment of invention described below
Conflict can is not formed each other to be mutually combined.
The basic ideas of the present invention are, collection, training, detection and the knowledge of data are realized in the case where user is without discovering
Other purpose.The program generates attitude angle information by merging accelerometer and gyro data first, and from attitude angle information
The middle characteristic of division extracted for identifying user's input, then trains multiple different types of graders, using combination ballot
Construction of strategy assembled classifier, posture feature is classified using assembled classifier in cognitive phase, identifies single character,
HMM is finally established, using the sampling interval of accelerometer as observation sequence, rejecting does not meet observation sequence
Potential password combination, it can only identify that the technology of the account password of English text is asked so as to solve existing user's input recognition method
Topic.
As shown in figure 1, user's input recognition method of the invention based on mobile phone inertial sensor comprises the following steps:
(1) the attitude angle θ of mobile phone curve is obtained using complementary filter algorithm:
Wherein,For high-pass filter,For low pass filter, τ is high-pass filter and low pass filter
Time constant, dt are the sample frequency of high-pass filter and low pass filter, θaTo be calculated according to the axle relation of accelerometer three
The attitude angle arrived, θgThe attitude angle being calculated for gyroscope with quaternary number;
As shown in Fig. 2 it shows the model for the complementary filter that the present invention uses, accelerometer plays main make in low-frequency range
With gyroscope plays a major role in high band, can change filter cutoff frequency by changing timeconstantτ, is adjusted with this
The proportion of whole accelerometer and gyroscope in attitude algorithm.
In addition to complementary filter algorithm, conventional attitude algorithm algorithm also has gradient descent method, expands Kalman filtering method
Deng.The complementary filter algorithm of the present invention is based on gyroscope and accelerometer, although its precision does not have above two algorithm
Height, but advantage, which is that amount of calculation is small, can reduce system resources consumption, be a kind of simple effective method.So the present invention is using mutual
Filtering algorithm is mended to resolve the attitude angle of mobile phone, Fig. 3 is the result of attitude algorithm, and Fig. 3 (a) is the data of accelerometer,
Fig. 3 (b) is gyro data, and Fig. 3 (c) is click on attitude angle variation diagram (the wherein hand when mobile phone screen upper right corner and the lower left corner
The angle of pitch of machine is pitch, and roll angle is Roll) because the present invention has only used roll angle and the angle of pitch, only depict
The two angles.It can be seen that complementary filter algorithm can successfully calculate according to acceleration information and gyro data
The change procedure and change details of mobile phone attitude angle are gone out.
(2) acceleration information and acceleration signature value during collection user click mobile phone screen, counts acceleration information
Feature distribution scope, mobile phone is clicked in the range of feature distribution to detect user by judging whether acceleration signature value falls
Beginning and ending time point;
This step includes following sub-step:
(2-1) is multiple within the duration (i.e. signal window) for clicking on mobile phone screen by accelerometer acquisition user
3-axis acceleration quadratic sum (Acceleration Square Sum, abbreviation ASS):
ASS=ax 2+ay 2+az 2
Wherein axRepresent that the user that accelerometer is got clicks on the acceleration collected during mobile phone screen in X-direction
Value, ayRepresent that the user that accelerometer is got clicks on the acceleration magnitude collected during mobile phone screen in Y direction, azRepresent to add
The user that speedometer is got clicks on the acceleration magnitude collected during mobile phone screen in Z-direction.
Multiple characteristic values in the 3-axis acceleration quadratic sum ASS that (2-2) extraction step (2-1) obtains;
Specifically, this step specifically extracts following five characteristic values:
P1:ASS maximum subtracts g in signal window2, i.e. ASSmax-g2, wherein g expression gravitational constants;
P2:ASS minimum value subtracts g in signal window2, i.e. ASSmin-g2;
P3:ASS maximum and the difference of minimum value, i.e. ASSmax-ASSmin;
P4:The sampling interval of P1 and P2 positions, i.e. Tp1-Tp2;
P5:ASS standard deviation in signal window, i.e. Std (ASS), it is specifically equal to:
Wherein N represents the length of signal window, and μ represents average values of the ASS in signal window;
(2-3) is repeated the above steps, and (2-1) and (2-2) (T span is greater than or equal to 20 times, its numerical value up to T times
Bigger, then the result finally given more tends to be accurate), to obtain distribution I corresponding to each characteristic valuei, wherein i expression spies
The sequence number (in the present invention i value be 1 to 5 between) of value indicative, LiRepresent the lower limit of characteristic value, UiRepresent the upper of characteristic value
Limit value:
Ii={ Li, Ui}
For example, I1={ L1, U1What is represented is exactly T characteristic value P1 distribution;
(2-4) extracts all 5 using sliding window (its size is equal to 2 times of N) from 3-axis acceleration quadratic sum ASS
Characteristic value, and the distribution I that will be got in the characteristic value extracted and step (2-3)iContrasted, if extraction is complete
Portion's characteristic value all falls in distribution IiIt is interior, then judge to detect click event, be then transferred to step (2-5), if extraction
To 5 characteristic values in there is one not fall within distribution IiIt is interior, then judge not detecting click event, then will slide
Window pushes ahead a step-length, and (in the present invention, the value of the step-length is 1), then to repeat this step;
(2-5) is as a reference point with the position of current sliding window mouth, is counted forward with above-mentioned step-length, close enough by first
g2Position as time starting point, length N of the time starting point plus signal window is obtained into time terminating point;
Table 1 clicks on the experimental result of detection
The experimental result of detection is click on as shown in Table 1, and expression is three experimenters in two kinds of mobile phone
On click detection success rate.In the training stage, every experimenter is required the different zones click in mobile phone screen, altogether
300 times, P1~P5 five characteristic values are then extracted from each click event, count the distribution of each characteristic value,
The distribution of five characteristic values is exactly the statistical law of click event of the specific user in specific model altogether.Identifying
Stage, every experimenter are required to click in the different zones of mobile phone, 100 times altogether.Such as A 100 times click on test in,
Have on red rice 3s 89 times and be successfully detected, there are 11 click events to be not detected;Have on Meizu mx4 93 times and be detected
Arrive, and have 7 times and be not detected.Table 3-2's test result indicates that, the click detection method based on statistics can realize 90%
The detection success rate of left and right.
(3) user obtained according to step (2) clicks on the attitude angle that the beginning and ending time point that mobile phone occurs obtains in step (1)
Attitude angle characteristic value is obtained on θ curve;
Specifically, each characteristic vector has 5 pairs of totally 10 characteristic values:
F1:Difference of the roll angle from time starting point to flex point, if the angle of pitch is to be monotonically changed not in signal window
Flex point be present, then it is flex point to define terminating point;
F2:Roll angle is from flex point to the difference of time terminating point, if the angle of pitch is to be monotonically changed not in signal window
Flex point be present, then equal to zero;
F3:Standard deviation of the roll angle in signal window;
F4:Sum of the roll angle in signal window;
F5:Mean difference of the roll angle in signal window between sampled point;
F6:Difference of the angle of pitch from time starting point to flex point, if the angle of pitch is to be monotonically changed not in signal window
Flex point be present, then it is flex point to define terminating point;
F7:The angle of pitch is from flex point to the difference of time terminating point, if the angle of pitch is to be monotonically changed not in signal window
Flex point be present, then equal to zero;
F8:Standard deviation of the angle of pitch in signal window;
F9:Sum of the angle of pitch in signal window;
F10:Mean difference of the angle of pitch in signal window between sampled point;
(4) the attitude angle characteristic value obtained using assembled classifier to step (3) is classified, to obtain user point hitter
Prediction result corresponding to the region of machine;
Specifically, the assembled classifier that this step uses includes K- arest neighbors sorting algorithms (K-Nearest
Neighbor, abbreviation KNN), Naive Bayes Classifier (Naive Bayes Classifier, abbreviation NBC) and support to
Amount machine (Support Vector Machine, abbreviation SVM).
After the input feature vector of user is got, our grader is trained, that is, utilizes the classification in machine learning
Algorithm identifies the input data of user, and the basic step of recognizer is to collect data train classification models in the training stage,
It is predicted in cognitive phase using input of the disaggregated model trained to user.Because assembled classifier can be obtained than any
Single fundamental classifier will be good effect, to be taken into account using assembled classifier between the accuracy of fundamental classifier and grader
Diversity.Therefore some classical machine learning classification algorithms are first introduced below, then introduces assembled classifier of the present invention again
Combined strategy:
First, K- arest neighbors sorting algorithm
KNN algorithms by weigh characteristic value distance otherness to classifying between all objects, it is a kind of
The typically learning method based on analogy, there is more ripe theoretical foundation.Assuming that there are three known classification ω1、ω2、ω3,
When the unknown sample to be sorted of a classification enters sample space, each point in sample and training data to be sorted ask away from
From then selecting K closest point, see which kind of classification this K point belongs to, the most classification of occurrence number is just in K point
It is the classification belonging to sample to be sorted.
2nd, Naive Bayes Classifier
Bayes classifier is the sorting technique realized based on Bayes decision theory.In the known situation for knowing dependent probability
Under, judge the classification of sample to be sorted by making misclassification loss minimum.
Assuming that A1, A2...AnIt is n characteristic attribute of data set, there is m classification, C={ C in addition1, C2...CmAnd one
Sample X to be sorted, X attribute are { x1, x2...xnIn xiIt is attribute AiSome value, X belongs to class CiPosterior probability be P
(X|Ci), C (X) represents class label, and formula (3-7) is the mathematical notation of Bayesian Classification Model
C (X)=argmaxP (Ci)P(X|Ci) (3-7)
Naive Bayesian introduce it is assumed hereinafter that, i.e., under conditions of given classification C, all properties AiBetween be mutually solely
Vertical, because being difficult to try to achieve formula (3-7) result by calculating in the problem of actually encountering
, can be with independent study attribute A in Naive Bayes Classification AlgorithmiConditional probability P (A under classification Ci| C) and
Attribute AiProbability, attribute AiProbability is constant α, then grader formula (3-9) calculate sample to be sorted posteriority it is general
Rate
The advantages of Bayesian Classification Arithmetic is mathematical theory precise and reliable, classification effectiveness is stable, algorithm is simple, to missing number
According to insensitive.
3rd, SVMs
SVMs is the sorting technique based on statistical theory, is generally used for two classification problems, but can be with
Solve more classification problems by combining multiple two class support vector machines, integrated mode there are one-to-many, one-to-one and SVM decision trees
It is several[36].For being that original feature space is passed through core in the solution of the inseparable problem of lower dimensional space classification, SVM
Function Mapping is divided to high-dimensional feature space structural classification hyperplane.
Can be with following linear equation come structural classification hyperplane, wherein ω is the normal vector for representing in-plane, b tables
Show the displacement between hyperplane and origin
ωTX+b=0 (3-10)
The distance of sample space any point x to hyperplane is
Assuming that hyperplane can be classified sample like clockwork, for any point in two dimensional sample space
(xi,yi), there is below equation
So that the sample point nearest from hyperplane that formula (3-12) is set up is exactly supporting vector, two foreign peoples's supporting vectors
To the distance of hyperplane and it is γ, finds suitable ω and b so that γ is maximum[33]
The advantages of SVMs is:Can solve nonlinear problem, Generalization Capability can be improved, local pole can be avoided
Dot problem, can solve the problems, such as higher-dimension.
(5) all areas on mobile phone are clicked on for user, repeat the above steps (1) to (4), to obtain user point hitter
Prediction result corresponding to all areas of machine, and prediction result is handled using hidden Markov model, it is final to obtain
Recognition result.
Above-mentioned sorting algorithm is the recognizer for single button or individual digit, and it is to be built upon that this section, which illustrates,
Keying sequence on individual digit identification basis speculates algorithm.We observe in an experiment user input password when
Wait, in the case where one hand inputs, because the numerical key distance on keyboard is different, the sampling interval of acceleration click signal
Also it is different.
In the identification experiment of password, HMM is introduced into, it is assumed that the hunting zone of individual digit is first three
The maximum numeral of individual posterior probability, then 81 kinds altogether of 4 powers that the search space after the cutting of the password of 4 bit lengths is 3
Combination.20 4 passwords of stochastic inputs in experiment, and only consider ideal situation, the i.e. observation sequence (accelerometer of password
Sampling interval) with the distance between numerical key meet linear relationship, observation sequence is true.To 81 kinds possible group of each password
It is total to calculate their theoretical observation sequence, and compared with actual observation sequence, if theoretical observation sequence is seen not equal to actual
Sequencing row, illustrate that this combination is not real password, and it is weeded out from search space.
Result of the table 2 after Markov model is further cut
According to upper table 2, the average password combination quantity after Markov model is cut is 19, and 19 are dropped to from 81, under
4 times are dropped about.Illustrate further reduce searching for password from the observation sequence of accelerometer with HMM
Rope space, this substantially reduces the required time of attacker's decryption.
As it will be easily appreciated by one skilled in the art that the foregoing is merely illustrative of the preferred embodiments of the present invention, not to
The limitation present invention, all any modification, equivalent and improvement made within the spirit and principles of the invention etc., all should be included
Within protection scope of the present invention.