A kind of method and system of automatic detection face
Technical field
The invention belongs to target detection technique field more particularly to a kind of method and system of automatic detection face.
Background technology
In recent years, more and more prosperous with science and technology, we have marched toward information-based, the intelligentized epoch.Though internet
It makes world's contact even closer, so that people's Working and life styles is had changed a lot, but information caused by internet is quick-fried
Fried the problem of bringing is also that can not be ignored.For example, how batch execution data information, how from a large amount of information
Rapid extraction arrives useful information etc..It is " wasting man power and money ", but can hand over now if only only relying on manpower to complete
To computer.Computer vision be exactly in these technologies a very important research direction, computer vision be related to depth
The subjects such as study, machine learning, pattern-recognition are spent, its ideal is to imitate the visual capacity for realizing the mankind, is completed various
Identification mission is detected, such as:Detect people, dog, the vehicle etc. in video image.At present target detection be applied to such as intelligent video and
Supervisory-controlled robot navigation etc..Thus, target detection all answers computer vision field, practical application with important research
With value.
The prior art is all the face directly detected using algorithm in video image for the pedestrian in detection monitor video,
This method is relatively suitble to the preferable environment of condition and face ratio is more visible and the detection accuracy of this method is relatively low, when multiple
Under miscellaneous background, such as under station, market environment, since background environment is excessively complicated, pedestrian is excessive, and facial image can be by tight
Ghost image is rung, and puzzlement etc. is brought for Face datection.
In order to solve the above-mentioned technical problem, people have carried out long-term exploration, such as Chinese patent discloses one kind and is based on
Face and human bioequivalence look for people's method and system [publication number:CN107292240A], including:Monitoring data is obtained, and to it
Carry out definition judgment;Recognition mode is selected according to definition judgment result, and by the pattern of selection in the monitoring data
In target object is detected after track;If the pattern of selection is human bioequivalence, the characteristic obtained is tracked after detection
Target sample is obtained according to middle interception, and carries out the comparison of face quality in the target sample, obtains human face photo;According to institute
It states human face photo and determines its corresponding identity information in face database, and according to the characteristic to the target object
Carry out behavior monitoring.
The selection of pattern is identified by definition judgment for said program, to achieve the purpose that improve recognition performance,
But detection means is disturbed factor and does not still eliminate still directly against face in video, it is also to be further improved.
Invention content
Regarding the issue above, the present invention provides a kind of method of the high automatic detection face of resolution;
The another object of this programme is to provide a kind of system of the automatic detection face based on the above method.
In order to achieve the above objectives, present invention employs following technical proposals:
A kind of method of automatic detection face, including:
S1:Video data is obtained, each individual corresponding individual data items in video data are extracted;
S2:Face datection is carried out to individually individual based on individual data items, and exports testing result.
In the method for above-mentioned automatic detection face, after step S1, further include:
Each individual data items are individually preserved in one file;
And in step s 2, individual corresponding to each file carries out Face datection, and exports testing result.
In the method for above-mentioned automatic detection face, in step s 2, further include:
Classification judgement carried out to corresponding individual based on the individual data items and/or Face datection result, and by same category
File put to identical file press from both sides under.
In the method for above-mentioned automatic detection face, in step s 2, the recognition result of output includes identification object class
Other and classification accuracy of judgement degree.
In the method for above-mentioned automatic detection face, in step sl, video data is extracted by human testing algorithm
In all individual data items;
In step s3, the face of the individual is detected by Face datection algorithm.
Further include Face datection training step before step S1 in the method for above-mentioned automatic detection face:
S01:Obtain the first data set, based on the first data set extract individual data items extracted with training individuals data it is offline
Model, and use the individual data items of extraction as the second data set;
S02:The off-line model of Face datection is trained using second data set.
A kind of system of automatic detection face, including detection module, the detection module include level-one detection module and two
Grade detection module, and level-one detection module and secondary detection module are in cascade connection, wherein
Level-one detection module, for obtaining video data, and the corresponding number of individuals of individual that each of extracts video data
According to;
Secondary detection module for carrying out Face datection to individually individual based on individual data items, and exports testing result.
In the system of above-mentioned automatic detection face, the level-one detection module includes individual data items preserving module,
For the individual data items individually to be preserved in one file.
In the system of above-mentioned automatic detection face, the secondary detection module further includes having classification judgment module, is used
In judging its generic to the individual according to individual data items and belong to the probability of the category.
Further include training module, and the training module includes level-one instruction in the system of above-mentioned automatic detection face
Practice module and two level training module, and level-one training module and two level training module are in cascade connection, wherein
Level-one training module carries out video data for training the off-line model of individual data items extraction;
Two level training module, the off-line model for carrying out Face datection to individually individual based on individual data items.
The present invention has the following advantages compared to the prior art:
1, Face datection is realized in detection twice, improves Detection accuracy;
2, first individual is separated from complex environment background, Face datection then is carried out to individually individual,
The Face datection stage eliminates environmental disturbances factor, improves Face datection accuracy;
3, it is applicable in the scene of more diversification, complication, there is higher accuracy than directly detecting face.
Description of the drawings
Fig. 1 is the method flow diagram of the embodiment of the present invention one;
Fig. 2 is the detection method logical flow chart of the embodiment of the present invention one;
Fig. 3 is the system block diagram of the embodiment of the present invention two;
Fig. 4 is the video detection process schematic of the embodiment of the present invention two.
Reference numeral:Server 10;Detection module 1;Level-one detection module 11;Individual data items preserving module 111;Two level is examined
Survey module 12;Classification judgment module 121;Training module 2;Level-one training module 21;Two level training module 22;IP Camera
20;Video information monitoring platform 30.
Specific implementation mode
Although operations are described as the processing of sequence by flow chart, many of which operation can by concurrently,
Concomitantly or simultaneously implement.The sequence of operations can be rearranged.Processing can be terminated when its operations are completed,
It is also possible to the additional step being not included in attached drawing.Processing can correspond to method, function, regulation, subroutine, son
Program etc..
Term "and/or" used herein above includes the arbitrary and institute of the associated item listed by one of them or more
There is combination.When a unit is referred to as " connecting " or when " coupled " to another unit, can be connected or coupled to described
Another unit, or may exist temporary location.
Term used herein above is not intended to limit exemplary embodiment just for the sake of description specific embodiment.Unless
Context clearly refers else, otherwise singulative used herein above "one", " one " also attempt to include plural number.Also answer
When understanding, term " include " and or " include " used herein above provide stated feature, integer, step, operation,
The presence of unit and/or component, and do not preclude the presence or addition of other one or more features, integer, step, operation, unit,
Component and/or a combination thereof.
The method and system that the present invention detects face automatically are mainly used in the monitoring scene for needing to carry out Face datection, energy
Prior art the problems such as Face datection accuracy is not high in the case where background environment is more complex is enough solved, is of the invention below
Preferred embodiment and in conjunction with attached drawing, technical scheme of the present invention will be further described, but the present invention is not restricted to these implements
Example.
Embodiment one
As shown in Figure 1, present embodiment discloses a kind of methods of automatic detection face, including:
S1:Video data is obtained, each individual corresponding individual data items in video data are extracted;
S2:Face datection is carried out to individually individual based on individual data items, and exports testing result.
Also, it here can be by being handled video data to obtain video frame picture, then in video frame picture
Extract individual data items.As shown in Fig. 2, the present embodiment detects face using the thought of Cascade algorithms, first to monitoring
Video frame picture employment physical examination method of determining and calculating carries out individual detection, the individual detected is cut out to obtain individual data items collection, is used
In the Face datection algorithm of next step, wherein human testing algorithm may be used is capable of detecting when appointing for human body in the prior art
One algorithm routine, such as the human testing algorithm based on gradient orientation histogram (HOG) feature, it is, of course, also possible to be other calculations
Method program, specific algorithm program are not limited herein;Similarly, what Face datection algorithm used is also to have in the prior art
For detecting some algorithm routines of face, such as the Face datection of dyadic wavelet transform, the people based on AdaBoost algorithms
Face detection, Face datection algorithm based on histogram coarse segmentation and singular value features Face datection etc., similarly, Face datection
Algorithm can also be that other algorithm routines, specific algorithm program are not limited herein.
Also, human testing algorithm and Face datection algorithm can be the same or different, with specific reference to algorithm to detection
Accuracy influence and other factors selection.
The present embodiment improves Face datection accuracy by two step detection modes, meanwhile, by the way that first pedestrian's individual is carried out
Then extraction carries out individual the mode of Face datection again, first detach human body from complex environment again to being detached from
Individual out carries out Face datection, the interference to detection of background environment is reduced, to improve Face datection accuracy.
Further, further comprising the steps of after step S1:
Each individual data items are individually preserved in one file, by way of individually preserving in one file
The data set that individual is unit is provided for the Face datection of second step, it is a in order to be detected based on individual data items in second step
Body face.
Certainly, at this time in step s 2, individual corresponding to each file carries out Face datection, and exports testing result.
Further, in step s 2, further include:
Classification judgement carried out to corresponding individual based on the individual data items and/or Face datection result, and by same category
File put to identical file press from both sides under.Preferably, can also corresponding individual be obtained in video according to video data in step sl
It is the location of middle, export a body position and classification simultaneously when exporting testing result.
Wherein classification foundation can there are many, for example, can according to Gender Classification, according to the age section classification, according to race
Classification, according to whether being human classification, according to supposition height classification etc..
Also, above-mentioned various sorting algorithms are also all made of existing algorithm in the prior art, such as about Sexual discriminating
Algorithm, currently, identity method for distinguishing can be used for by providing two kinds in the contrib of OpenCV:EigenFace and
FisherFace, EigenFace mainly use PCA (principal component analysis), by eliminating the correlation in data, by higher-dimension figure
As being reduced to lower dimensional space, the sample in training set is mapped to a bit in lower dimensional space, needs to judge test pictures gender
When, first test pictures are mapped in lower dimensional space, it is which then to calculate from the nearest sample point of test pictures, by nearest sample
The gender of this point is assigned to test pictures;FisherFace mainly utilizes the thought of LDA (linear projection analysis), by sample space
In men and women's sample projected on the straight line of origin, and ensure that projection inter- object distance of the sample on the line is minimum, class
Between distance it is maximum, to isolate the line of demarcation of identification men and women;
Algorithm is judged about age bracket, by merging LBP (local binarization pattern) and HOG (histogram of gradients) feature
Face age algorithm for estimating extracts the partial statistics characteristic with the face of change of age close relation, and CCA (canonical correlations point are used in combination
Analysis) method fusion, face database is trained and is tested finally by the method for SVR (Support vector regression), with carry out
Age bracket judges.
About race, can the face race recognizer based on Adaboost and SVM pass through the colour of skin letter for extracting face
Breath and Gabor characteristic, and feature learning is carried out by Adaboost cascade classifiers, feature is finally carried out according to SVM classifier
Classification ...
Assuming that classifying according to age bracket, Age estimation is carried out to individual while carrying out Face datection, judgment method is not
Limitation, if having 5 pedestrian's individuals A, B, C, D and E in video, A age bracket judging results are 8~10 years old, B and C judging results are
20~28 years old, C and D judging results were 29~35 years old, then the corresponding files of A are placed in a file, B and C are corresponding
File is placed under a file, and C and the corresponding files of D are placed under a file.By putting different classes of individual to not
Contribute to pedestrians' monitoring record etc. of Security Personnel's tune video monitoring regional with the mode under file.
Preferably, in step s 2, the recognition result of output further includes identification object type accuracy of judgement degree.Such as basis
It is 20~28 years old that some pedestrian's feature, which carries out it result that age bracket judges, but due to the technology restriction of detection judgement, institute
To need aside to mark the accuracy rate probability of judgement, so being about classification in output result:20~28 years old, probability
80%.
Further, further include Face datection training method before step S1:
S01:Obtain the first data set, based on the first data set extract individual data items extracted with training individuals data it is offline
Model, and use the individual data items of extraction as the second data set;
S02:The off-line model of Face datection is trained using second data set.
The first data set of training stage is handled to obtain video frame picture or history picture mainly for video data,
Hand labeled picture simultaneously selects preferable data to carry out deep learning model training, and it is exactly to carry to select preferable data set purpose
The accuracy of high detection.
Finally the model that training is completed is put in the database of server 10, when next time, detection needed, from database
Calling.And this method preferably executes in server 10, as a result exports and is preserved into database, when user asks
When data into request end returned data library corresponding testing result, can also be in other-end certainly when specifically used
Execute this method.
Embodiment two
As shown in figure 3, present embodiment discloses a kind of system based on the automatic detection face of method in embodiment one, it should
System is preferably placed in server comprising detection module 1, the detection module 1 include that level-one detection module 11 and two level are examined
Module 12 is surveyed, and level-one detection module 11 and secondary detection module 12 are in cascade connection, wherein
Level-one detection module 11, for obtaining video data, and the corresponding individual of individual that each of extracts video data
Data;
Secondary detection module 12 for carrying out Face datection to individually individual based on individual data items, and exports detection knot
Fruit.
Further, level-one detection module 11 includes individual data items preserving module 111, is used for the individual data items list
It solely preserves in one file.
Similarly, secondary detection module 12 further includes having classification judgment module 121, is used for according to individual data items to described
Body judges its generic and belongs to the probability of the category.
Further, this system further includes having the training module 2 based on deep learning model, and the training module 2 wraps
Level-one training module 21 and two level training module 22 are included, and level-one training module 21 and two level training module 22 are in cascade connection,
Wherein,
Level-one training module 21 carries out video data for training the off-line model of individual data items extraction;
Two level training module 22, the off-line model for carrying out Face datection to individually individual based on individual data items.
As shown in figure 4, specific testing process is as follows:
Monitoring information is acquired by IP Camera 20, monitoring information is fed through in backbone network by network;
Then this system obtains monitoring information for server 10 from backbone network here, and by its testing result store to
In the database of server 10;
When user selects video detection function in video information monitoring platform 30, video information monitoring platform is to server
10 initiate request, and corresponding testing result is returned to video letter after the request of the response video information of server 10 monitoring platform 30
Cease monitoring platform 30.
Specific embodiment described herein is only to be given an example to the present invention.The technical field of the invention
Technical staff can make various modifications or additions to the described embodiments or substitute by a similar method, but
Without departing from the spirit of the invention or going beyond the scope defined by the appended claims.
In addition, although server 10 is used more herein;Detection module 1;Level-one detection module 11;Individual data items are protected
Storing module 111;Secondary detection module 12;Classification judgment module 121;Training module 2;Level-one training module 21;Two level trains mould
Block 22;IP Camera 20;The terms such as video information monitoring platform 30, but it does not preclude the possibility of using other terms.Make
It is only for the convenience of describing and explaining the nature of the invention that be construed as any type additional with these terms
Limitation is all disagreed with spirit of that invention.