The content of the invention
It is an object of the invention to overcome the above-mentioned deficiency in the presence of prior art, there is provided the human body based on deep learningActivity recognition method, developed on the basis of human body behavior and then generate substantial amounts of machine Behavioral training sample so that machineDevice Behavioral training sample it is higher with the similarity of human body behavior, the coverage mode of training sample is more comprehensively.Pass through the people of magnanimityTraining sample of both body behavior and machine behavior carrys out the nerve that training package contains LSTM (Long Short-Term Memory)Network model;And the neural network model by training judges whether new input behavior is human body behavior.Methods described is specialSuitable for drag figure realize checking identifying code identification system operating main body judgement application scenarios.
In order to realize foregoing invention purpose, based on the Human bodys' response method of deep learning, using human body behavior andThe mouse drag movement locus training sample of production of machinery carrys out the neural network model of training package network containing LSTM, and uses trainingNeural network model afterwards judges whether the operating main body of current page is human body behavior.
Methods described includes implemented below step:
(1) structure includes the neural network model of LSTM networks;
(2) magnanimity human body behavior sample and the sample of machine behavior are obtained, the machine behavior sample is in human body behavior sampleGenerated on the basis of this, human body behavior sample is as positive sample, and machine behavior sample is as negative sample;
(3) neural network model built is trained using positive and negative samples;
(4) it is people or machine by the operating main body of the neural network model current page to judge trained.
Specifically, in the step (2), the single order difference (dx of mouse track information is usedi, dyi, dti) describe to operateBehavior, wherein dxi=xi-xi-1, dyi=yi-yi-1, dti=ti-ti-1;Wherein xiFor the abscissa in screen position of mouse, yiFor ordinate of the mouse in screen position, tiFor time information.
The mouse movement trace information that the positive sample of training recorded from people when browsing webpage.
Further, in the step (2), negative sample is generated by machine, and the mode of generation is as follows:
A, in the range of the maximum occurrences of setting, path length is randomly generated, it is random to generate (dxi, dyi, dti);
B, concentrated in positive sample and extract N bars track, the trajectory random being drawn into is divided into n subsegment, then will be divided intoSubsegment random groups be spliced into new track;
C, concentrated in positive sample and extract M bars track;Calculate the transverse shifting of each track always distance sum (dxi), longitudinal direction moveDynamic always distance sum (dyi) and mobile total time sum (dti);It is random to generate transverse shifting always distance sum (dxi) ', vertically moveAlways distance sum (dyi) ' and mobile total time sum (dti) ', the characterising parameter of new movement locus is generated using below equation:
Wherein dxi′、dyi′、dti' be respectively new track lateral coordinates, longitudinal coordinate, the single order difference of time;
D, K bars track is extracted in positive sample;To dxi, dyi, dtiThe disturbance of [- 0.5,0.5] again is randomly generated respectively, is obtainedObtain the characterising parameter of movement locus newly;
The sample that a, b, c, d mode are generated is mixed, as negative sample collection.
Further, in the step (3), in the training process of the neural network model, the onwards transmission mistake of signalJourney is as follows:
By (the dx of training samplei, dyi, dti) signal input embedding layers, by embedding layers by dxi, dyi, dtiM dimensional vectors corresponding to changing into respectively, and by dxi, dyi, dtiCorresponding m dimensional vectors are spliced into the vector of a 3m dimension;Will be toAmount is arranged in the LSTM neutral nets of 3m dimensions according to the sequential input hidden layer latitude of movement locus, is exported by LSTM neutral nets3m*L vector into full articulamentum, and by softmax layers export this track whether be human body behavior judged result;ItsMiddle L is the path length set.
Further, before neural network model training is carried out, including data are optimized with the process of processing:The placeReason includes:
In the step (2), preceding 100 (x are usedi, yi, ti) it is used as the characterising parameter of mouse movement track;Work as mouseIt is shorter to mark displacement, when movable information is inadequate 100, with (0,0,0) polishing to 100;That is L=100.
In the step (2), by dxi, dyiValue be converted into integer between [- 50,50], by dtiValue conversionFor (0,200] between integer, when actual value beyond set span when, replaced using boundary value.
Further, the sample size included in the positive sample collection is no less than 5000, concentrates and selects in positive sample80% sample selects 20% sample as test sample as training sample.
Further, the sample size included in the negative sample collection is no less than 5000, concentrates and selects in negative sample80% sample selects 20% sample as test sample as training sample.
Compared with prior art, beneficial effects of the present invention:The present invention provides the Human bodys' response based on deep learningMethod, the inventive method realize the judgement of current page operating main body, the inventive method using the neutral net comprising LSTMWhen building machine behavior sample based on human body behavior sample, 4 kinds of generating modes, including random generation are employed, will justSample trace is cut into some subsegments and is again spliced the subsegment after cutting at random at random, is entered on the basis of positive sampleThe proportional zoom of row trajectory parameters, disturbance etc.;Such negative sample producing method, it is based on positive sample, has with positive sampleHigher similitude, confusion is stronger, and the neutral net come is trained using such training sample has higher explanation energyPower.The inventive method realizes the identification of the current page operating main body based on LSTM networks first, and LSTM networks are a kind ofTime recurrent neural network, it is suitable for being spaced in processing and predicted time sequence and postponing relatively long critical event, this hairBright method is particularly suitable for the checking in dragging image hotpoint operating main body, the business scenario judged operating main body.
Embodiment
With reference to test example and embodiment, the present invention is described in further detail.But this should not be understoodFollowing embodiment is only limitted to for the scope of the above-mentioned theme of the present invention, it is all that this is belonged to based on the technology that present invention is realizedThe scope of invention.
It is an object of the invention to overcome the above-mentioned deficiency in the presence of prior art, there is provided the human body based on deep learningActivity recognition method, the mouse drag movement locus training sample using human body behavior and production of machinery carry out training package net containing LSTMThe neural network model of network, and judge whether the operating main body of current page is human body using the neural network model after trainingBehavior.
Methods described includes implemented below step as shown in Figure 1:
(1) structure includes the neural network model of LSTM networks;The neural network model includes:Embedding layers,LSTM, full articulamentum and softmax layers.Wherein embedding layers will input discrete signal therein and change into continuous realityNumber vector, the vector after the conversion of embedding layers is input in LSTM according to sequential, operation behavior will be described by LSTMSeveral time series vectors be spliced into a high dimension vector after be input in full articulamentum, and by after full articulamentum dimensionality reduction toAmount is input in softmax layers;The LSTM neutral nets that the inventive method uses are a kind of time recurrent neural networks, are suitable forIt is spaced in processing and predicted time sequence and postpones relatively long critical event.LSTM is different from RNN place, essentially consists inOne is added in algorithm and judges that whether useful information is " processor ", the structure of this processor effect is referred to as cell.OneThree fan doors have been placed among individual cell, has been called input gate respectively, forgets door and out gate.When an information enters LSTM netAmong network, it can be judged whether according to rule useful.Only meeting the information of algorithm certification can just leave, and the information not being inconsistent is thenPassed into silence by forgeing door, selectivity is more embodied when being handled in information, treatment effeciency is higher, solves RNN neutral nets notThe long sequence Dependence Problem that can be realized very well.
(2) magnanimity human body behavior sample and the sample of machine behavior are obtained, human body behavior sample is as positive sample, machine rowIt is sample as negative sample;Sample size included in the positive sample collection is no less than 5000, concentrates and selects in positive sample80% sample selects 20% sample as test sample as training sample.Sample included in the negative sample collectionQuantity is no less than 5000, concentrates the sample of selection 80% to select 20% sample to be used as training sample and survey in negative sampleSample sheet.
(3) neural network model built is trained using positive and negative samples;The training of neural network model is using forwardBackward algorithm.After in the rate of accuracy reached in test sample collection to the threshold value set, it is possible to think neural network modelTraining is completed.
(4) it is people or machine by the operating main body of the neural network model current page to judge trained.
Specifically, in the step (2), the single order difference (dx of mouse movement trace information is usedi, dyi, dti) describeOperation behavior, wherein dxi=xi-xi-1, dyi=yi-yi-1, dti=ti-ti-1;Wherein xiFor the horizontal seat in screen position of mouseMark, yiFor ordinate of the mouse in screen position, tiFor time information.The positive sample of training is remembered from people when browsing webpageThe mouse movement trace information recorded.Mouse movement track can very easily be collected by information by network front end function,Position and time information of the cursor of mouse in screen can be returned to during mouse is dragged by the function, can be with(x1, y1, t1)、(x2, y2, t2)、(x3, y3, t3)…(xn, yn, tn) form return, the present invention use mouse movement trace informationSingle order difference (dxi, dyi, dti) corresponding operation behavior is described, it can reflect mouse of the mouse in moving process rightIn each small period answered, in the translational speed of transverse direction, and lengthwise travel rate, and mobile lateral displacement and length travel feelingsCondition, embody fine feature when operator is operated.
When carrying out neural metwork training, it is necessary to the training sample of magnanimity, if human body Behavioral training sample is using manualIf exclusively carrying out collection, substantial amounts of manpower will be expended, and by setting picture to verify to gather people in web terminal in the existing stageBody behavior, volunteers drag these identifying codes and realize checking, such accelerated accumulation sample money when logging in or browsing webpageSource, improve operational efficiency.
Further, in the step (2), negative sample is generated by machine, and the mode of generation is as follows:
A, in the range of the maximum occurrences of setting, path length is randomly generated, it is random to generate (dxi, dyi, dti);
B, N bars tracks, such as 2000 are extracted in positive sample, the trajectory random being drawn into is divided into n (such as 3-10) subsegment, then the thousands of subsegment random groups formed after segmentation are spliced into new track;
C, M bars track is extracted in positive sample;Calculate the transverse shifting of track always distance sum (dxi), vertically move it is totalDistance sum (dyi) and mobile total time sum (dti);It is random to generate transverse shifting always distance sum (dxi) ', vertically move always away fromFrom sum (dyi) ' and mobile total time sum (dti) ', the characterising parameter of new movement locus is generated using below equation:
Wherein dxi′、dyi′、dti' be respectively new track lateral coordinates, longitudinal coordinate, the single order difference of time;
D, K bars track is extracted in positive sample;To dxi, dyi, dtiThe disturbance of [- 0.5,0.5] again is randomly generated respectively, is obtainedObtain the characterising parameter of movement locus newly;
The inventive method uses the negative sample that a, b, c, d mode generate, and fully positive sample feature is combined, compared to directThe sample generated at random, has a simulation degree higher to human body behavior, thus by such negative sample train come godThere is higher identification capability through network.
The sample that a, b, c, d mode are generated respectively selection 2500, forms negative sample collection.Produced relative to single modeRaw pays sample, and negative sample concentrates the sample generated comprising 4 kinds of modes so that negative sample collection has larger coverage.
Further, before neural network model training is carried out, including data are optimized with the process of processing:The placeReason includes:
In the step (2), preceding 100 (x are usedi, yi, ti) it is used as the characterising parameter of mouse movement track;Work as mouseIt is shorter to mark displacement, when movable information is inadequate 100, with (0,0,0) polishing to 100.The every track manually draggedLength may be different, the motion track information (x of mouse1, y1, t1)、(x2, y2, t2)、(x3, y3, t3)…(xn, yn, tn), middle n canIt can be more than or < 100, uniform length will be arranged to for the track trained and classified, meet the need that neural network parameter is setWill.The form of every track is [(dx1, dy1, dt1), (dx2, dy2, dt2) ..., (dx100, dy100, dt100)], if track is grownInadequate 100 are spent, then with 0 filling, i.e. [(dx1, dy1, dt1), (dx2, dy2, dt2) ..., (0,0,0)].
For the ease of analyzing dxi, dyiValue be converted into integer between [- 49,50], by dtiValue be converted to(0,200] between integer, when actual value beyond set span when, replaced using boundary value, by dxi, dyi, dtiValue to switch into integer be to calculate for convenience, such as (dxi, dyi, dti) actual value for (60.0, -75.3,300.3), the numerical value change after integer processing and span limit is (50, -50,200).
Further, in the step (3), in the training process of the neural network model, the onwards transmission mistake of signalJourney is as follows:By (the dx of training samplei, dyi, dti) signal input embedding layers, discrete (dx, dy, dt) is passed throughEmbedding changes into continuous real number vector.Implementation process is:By dx=dx+50, dy=dy+50, dx and dy scope are put downMove on to [1,100], embedding process is first dx, and dy, dt change into the one-hot vectors of 101 dimensions respectively, then multiply respectivelyWith the lookup_table matrixes of [101,10], by dx, dy, dt distinguish embedding into the vectors of 10 dimensions, then by these three toAmount splicing obtains input of 30 dimensional vectors as lstm.
The vector of 30 dimensions is arranged in the LSTM neutral nets of 30 dimensions according to sequential input hidden layer dimension, by LSTM nervesThe expression vector of this movement locus of the dimension of network output 3000 exports this rail into full articulamentum, and by softmax layersMark whether be human body behavior judged result.
The mark result of the preceding backward algorithm of the training process use classics of neutral net, judged result and training sample hasDuring deviation, signal successively adjusts weight coefficient according to loss function back-propagation.
The inventive method, which uses, intersects entropy loss as loss function.Loss function is carried out using stochastic gradient descent methodOptimization.Final mask classification accuracy on checking sample set reaches 95%.