CN104112131A - Method and device for generating training samples used for face detection - Google Patents

Method and device for generating training samples used for face detection Download PDF

Info

Publication number
CN104112131A
CN104112131A CN201310137893.XA CN201310137893A CN104112131A CN 104112131 A CN104112131 A CN 104112131A CN 201310137893 A CN201310137893 A CN 201310137893A CN 104112131 A CN104112131 A CN 104112131A
Authority
CN
China
Prior art keywords
face
positive sample
represent
sample
brightness
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
Application number
CN201310137893.XA
Other languages
Chinese (zh)
Other versions
CN104112131B (en
Inventor
汪海洋
周祥明
王刚
潘石柱
张兴明
傅利泉
朱江明
吴军
吴坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201310137893.XA priority Critical patent/CN104112131B/en
Publication of CN104112131A publication Critical patent/CN104112131A/en
Application granted granted Critical
Publication of CN104112131B publication Critical patent/CN104112131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method and device for generating training samples used for face detection. The method includes the following steps that: an original face positive sample set and an original face negative sample set are obtained; image processing is performed on face positive samples in the original face positive sample set, and the processed face positive samples are added into the original face positive sample set, so that an intermediate face positive sample set can be obtained; random extraction and random weighting are performed on face positive samples in the intermediate face positive sample set, and the randomly extracted and weighted face positive samples are added into the intermediate face positive sample set, so that a final face positive sample set can be obtained; random extraction and bitwise AND logical operation are performed on face negative samples in the original face negative sample set, and the processed face negative samples are added into the original face negative sample set, and a final face negative sample set can be obtained; and the final face positive sample set and the final face negative sample set are adopted as training samples used for face detection. With the method and device provided by the technical scheme of the invention adopted, labor sources can be decreased, and the diversity of the training samples can be improved, and the accuracy of detection results can be ensured.

Description

A kind of generation method and device of the training sample detecting for face
Technical field
The present invention relates to field of computer technology, espespecially a kind of generation method and device of the training sample detecting for face.
Background technology
Face detects and is mainly used in actual applications the pre-service of recognition of face, and in image, accurate calibration goes out position and the size of face.Human face detection tech has obtained good application in gate control system, intelligent monitor system at present.In addition, in notebook computer, also bring into use successively the voucher of face recognition technology as computer log.In recent years, also integrated people's face detection algorithm in digital camera and mobile phone, offers user as new function and uses.In these application, it is all to bring into play vital effect that face detects.
Because facial image is subject to ambient light, expresses one's feelings, blocks, the various factors impact such as age and attitude, this just makes face detect becomes complicated, a challenging research topic.Through a large amount of scholar's years of researches, the Adaboost algorithm based on cascade structure is considered to detection speed the soonest and effect the best way.Adaboost algorithm is a kind of method based on sample learning: in the training stage, the common trait of the great amount of samples to input is learnt and concludes, generate training sample, comprise the positive sample of face and face negative sample, the positive sample of face is the image of face, and face negative sample is the image of face background of living in; At detection-phase, whether consistent with training sample of the feature by analysis image, determines whether image is facial image.Visible, training sample is very large on the impact of face testing result.
In general, training sample diversity is better, detects effect just better.At present, conventionally obtain training sample by the mode of artificial collection image, because training sample requires to have good diversity, so just need to gather a large amount of images, therefore can waste a large amount of human resources; And owing to can existing unavoidably a lot of features very approaching in the image gathering, this has just reduced the diversity of training sample, cannot ensure the accuracy of face testing result.
Summary of the invention
The embodiment of the present invention provides a kind of generation method and device of training sample detecting for face, in order to solving the human resources serious waste that the mode of existing artificial collection training sample causes, the diversity of training sample reduces and cannot ensure the problem of the accuracy of face testing result.
A generation method for the training sample detecting for face, comprising:
Obtain the positive sample of face of the first setting quantity as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample;
The positive sample of face in the positive sample set of described original face is carried out to image processing, and add in the positive sample set of described original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and added in the positive sample set of described middle face, obtain the positive sample set of final face; And
Face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and added in the set of described original face negative sample, obtain the set of final face negative sample;
Using the positive sample set of described final face and the set of described final face negative sample as the training sample detecting for face.
A generating apparatus for the training sample detecting for face, comprising:
Acquiring unit, for the positive sample of face that obtains the first setting quantity, as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample;
Processing unit, carries out image processing for the positive sample of face to the positive sample set of described original face, and adds in the positive sample set of described original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and added in the positive sample set of described middle face, obtain the positive sample set of final face; And the face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and add in the set of described original face negative sample, obtain the set of final face negative sample;
Generation unit, for using the positive sample set of described final face and the set of described final face negative sample as the training sample detecting for face.
Beneficial effect of the present invention is as follows:
Generation method and the device of the training sample detecting for face that the embodiment of the present invention provides, the positive sample of face by obtaining the first setting quantity is as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample; The positive sample of face in the positive sample set of described original face is carried out to image processing, and add in the positive sample set of described original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and added in the positive sample set of described middle face, obtain the positive sample set of final face; And the face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and add in the set of described original face negative sample, obtain the set of final face negative sample; Using the positive sample set of described final face and the set of described final face negative sample as the training sample detecting for face.This scheme is obtained the positive sample of face and the face negative sample of setting quantity, then the positive sample of these faces and face negative sample are carried out to certain processing, so just can obtain the positive sample of more face and face negative sample, just can obtain multifarious training sample without the mode by artificial collection image, human resources have been saved, improve again the diversity of training sample, and can ensure the accuracy of face testing result.
Brief description of the drawings
Fig. 1 is the process flow diagram of generation method of the training sample that detects for face in the embodiment of the present invention;
Fig. 2 is the method flow that obtains the positive sample set of final face in the embodiment of the present invention;
Fig. 3 is the structural representation of generating apparatus of the training sample that detects for face in the embodiment of the present invention.
Embodiment
The human resources serious waste causing for the mode of existing artificial collection training sample, the diversity of training sample reduce and cannot ensure the problem of the accuracy of face testing result, the generation method of the training sample detecting for face that the embodiment of the present invention provides, the flow process of the method as shown in Figure 1, performs step as follows:
S10: obtain the positive sample of face of the first setting quantity as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample.
Can obtain by the mode of artificial collection, also can directly obtain existing image.The quantity of the general positive sample of face is greater than 3000 width, comprise the various ages, the certain angle of expressing one's feelings, vacillate now to the left, now to the right (being less than 45 degree), face upward the certain angle of bowing (being less than 25 degree), not agnate up and down, the positive sample of these faces just can be used as the positive sample set of original face; Face negative sample is greater than 10000 width, comprise various indoor scenes (computer, desk, TV background, kitchen, bedroom, office, window etc.) and outdoor different scene (trees, meadow, building, road, sky, sea, flowers and trees, farmland, food market etc.), these face negative samples just can be used as the set of original face negative sample as far as possible.
S11: the positive sample of face in the positive sample set of original face is carried out to image processing, and add in the positive sample set of original face, the positive sample set of face in the middle of obtaining.
S12: the positive sample of face in the positive sample set of middle face is randomly drawed and random weighting, and added in the positive sample set of middle face, obtain the positive sample set of final face.
S13: the face negative sample in the set of original face negative sample is randomly drawed and step-by-step logical operation, and added in the set of original face negative sample, obtain the set of final face negative sample.
Can first carry out S11, then carry out S13; Also can first carry out S13, then carry out S11; Can certainly carry out S11 and S13 simultaneously.
S14: using positive final face sample set and final face negative sample set as the training sample detecting for face.
This scheme is obtained the positive sample of face and the face negative sample of setting quantity, then the positive sample of these faces and face negative sample are carried out to certain processing, so just can obtain the positive sample of more face and face negative sample, just can obtain multifarious training sample without the mode by artificial collection image, human resources have been saved, improve again the diversity of training sample, and can ensure the accuracy of face testing result.
More preferably, the positive sample of the face that obtains the first setting quantity in above-mentioned S10, as after the positive sample set of original face, also comprises: calculate in the positive sample set of original face the similarity of the positive sample of face between two according to the first selected characteristic; From the positive sample set of original face, delete in two positive samples of face that similarity is greater than setting threshold.
The face negative sample that obtains the second setting quantity in above-mentioned S10, as after the set of original face negative sample, also comprises: calculate in the set of original face negative sample the similarity of face negative sample between two according to the second selected characteristic; From the set of original face negative sample, delete in two face negative samples that similarity is greater than setting threshold.
In order to improve detection efficiency, can first get rid of the positive sample set of face and similar sample in the set of face negative sample, after respectively to the similarity of sample calculation between two in the positive sample set of face and the set of face negative sample, similarity can be greater than to a deletion in the sample of setting threshold.
Concrete, above-mentionedly calculate in the positive sample set of original face the similarity of the positive sample of face between two according to the first selected characteristic, and calculate in the set of original face negative sample the similarity of face negative sample between two according to the second selected characteristic, specifically comprise: calculate the positive sample of face or between two the similarity Score of face negative sample between two by following formula: Score = 1 N Σ N = 1 N e - ( f 1 i - f 2 i ) 2 2 .
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f 1i, f 2ifor the first selected characteristic i of the positive sample of face between two or the value of the second selected characteristic i of face negative sample between two.
Concrete, the positive sample of face in the positive sample set of original face in above-mentioned S11 carries out image processing, specifically comprises: the image processing that the positive sample of face in the positive sample set of original face is carried out comprises one of following or combination: random noise stack, illumination variation, block processing.
Concrete, above-mentioned the positive sample of face in the positive sample set of original face is carried out to random noise stack, carry out random noise stack by following formula: I noise ( i , j ) = I ( i , j ) + ( - 1 ) k mod 2 I ( i , j ) e - ( k mod 50 ) 2 2 . Wherein, I noise(i, j) represents the brightness of (i, j) point after random noise stack, I(i, j) represent the brightness of (i, j) point before random noise stack, k is random number.
Concrete, above-mentioned the positive sample of face in the positive sample set of original face is carried out to illumination variation processing, carry out vertical progressive conversion by following formula: I 1 ( i , j ) = I ( i , j ) + I ( i , j ) e - 9 × ( i + 1 H ) 2 . Wherein, I 1(i, j) represents the brightness of (i, j) point after vertical progressive conversion, I(i, j) represent the brightness of (i, j) point before vertical progressive conversion, k is random number, H represents the height of the positive sample of face.
Carry out vertical strip conversion by following formula: I 2 ( i , j ) = I ( i , j ) + ( - 1 ) ( i × 10 H ) mod 2 I ( i , j ) e - 9 ( i mod H 10 + 1 H ) 2 . Wherein, I 2(i, j) represents the brightness of (i, j) point after vertical strip conversion, I(i, j) represent the brightness of (i, j) point before vertical strip conversion.
Carry out the progressive conversion of level by following formula: I 3 ( i , j ) = I ( i , j ) + I ( i , j ) e - 9 × ( j + 1 W ) 2 . Wherein, I 3the brightness of (i, j) point after the progressive conversion of (i, j) expression level, I(i, j) brightness of (i, j) point before the progressive conversion of expression level, W represents the width of face negative sample.
Carry out horizontal strip conversion by following formula: I 4 ( i , j ) = I ( i , j ) + ( - 1 ) ( j × 10 W ) mod 2 I ( i , j ) e - 9 ( j mod W 10 + 1 W ) 2 . Wherein, I 4(i, j) represents the brightness of (i, j) point after horizontal strip conversion, I(i, j) represent the brightness of (i, j) point before horizontal strip conversion.
Concrete, the positive sample of face in the positive sample set of original face is blocked to processing, carry out left eye by following formula and block processing: wherein, I l(i, j) represent left eye block after (i, j) point brightness, I(i, j) represent left eye block before (i, j) point brightness, H represents the height of the positive sample of face, W represents the width of the positive sample of face, i lrepresent the horizontal ordinate of left eye, j lthe ordinate that represents left eye, k is random number.
Carry out right eye by following formula and block processing: wherein, I r(i, j) represent right eye block after (i, j) point brightness, I(i, j) represent right eye block before (i, j) point brightness, i rrepresent the horizontal ordinate of right eye, j lrepresent the ordinate of right eye.
Carry out eyes by following formula and block processing:
Wherein, I lR(i, j) represent eyes block after (i, j) point brightness, I(i, j) represent eyes block before (i, j) point brightness.
Carry out mouth by following formula and block processing: wherein, M r(i, j) represent mouth block after (i, j) point brightness, I(i, j) represent mouth block before (i, j) point brightness, i mrepresent the horizontal ordinate of mouth, j mrepresent the ordinate of mouth.
Concrete, as shown in Figure 2, the positive sample of face in the positive sample set of middle face in above-mentioned S12 is randomly drawed and random weighting, and adds in the positive sample set of middle face, obtains the positive sample set of final face, specifically comprises:
S120: obtain random number, the number remainder number by random number to the positive sample of face comprising in the positive sample set of middle face.
Can adopt prior art to generate random number, with k=random() represent, if the number of the positive sample of face comprising in the positive sample set of middle face town is Np, can get so kmodNp, be Ns.
S121: randomly draw the positive sample of face from the positive sample set of middle face, the number of the positive sample of face of extraction is remainder.
From the positive sample set of middle face, randomly draw Ns the positive sample of face.
S122: random weight generation value, wherein, the number of the random weighted value generating is remainder, and and is 1.
Random Ns weighted value, the W of generating 1, W 2w ns, wherein, W 1+ W 2+ ... + W ns=1.
S123: the random weighted value generating of use, to the positive sample weighting summation of the face of remainder, obtains the newly-increased positive sample of face, and adds in the positive sample set of middle face, obtains the positive sample set of final face.
Concrete, the random weighted value generating of use in above-mentioned S123, to the positive sample weighting summation of the face of remainder, obtains the newly-increased positive sample S of face by following formula new: wherein, S irepresent the luminance matrix of i the positive sample of face, w irepresent i weighted value, N srepresent remainder.
Concrete, the face negative sample in the set of original face negative sample in above-mentioned S13 is randomly drawed and step-by-step logical operation, and add in the set of original face negative sample, obtain the set of final face negative sample, specifically comprise: randomly draw two face negative samples in the set of original face negative sample; By two face negative samples randomly drawing carry out with or and XOR obtain three newly-increased face negative samples, and add in the set of original face negative sample, obtain the set of final face negative sample.
Wherein, two face samples randomly drawing are carried out to step-by-step logic and operation and can pass through formula S new1=S 1aMP.AMp.Amp S 2realize, two face samples randomly drawing are carried out to the computing of step-by-step logical OR and can pass through formula S new1=S 1| S 2realize, two face samples randomly drawing are carried out to step-by-step logic XOR and can pass through formula S new1=S 1^S 2realize.
Based on same inventive concept, the embodiment of the present invention provides a kind of generating apparatus of the training sample detecting for face, and the structure of this device as shown in Figure 3, comprising:
Acquiring unit 30, for the positive sample of face that obtains the first setting quantity, as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample.
Processing unit 31, carries out image processing for the positive sample of face to the positive sample set of original face, and adds in the positive sample set of original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of middle face is randomly drawed and random weighting, and added in the positive sample set of middle face, obtain the positive sample set of final face; And the face negative sample in the set of original face negative sample is randomly drawed and step-by-step logical operation,, and add in the set of original face negative sample, obtain the set of final face negative sample.
Generation unit 32, for using positive final face sample set and final face negative sample set as the training sample detecting for face.
Preferably, above-mentioned acquiring unit 30, also for after the positive sample of the face that obtains the first setting quantity is as the positive sample set of original face, calculates in the positive sample set of original face the similarity of the positive sample of face between two according to the first selected characteristic; From the positive sample set of original face, delete in two positive samples of face that similarity is greater than setting threshold; Obtain the face negative sample of the second setting quantity as after the set of original face negative sample, also comprise: calculate in the set of original face negative sample the similarity of face negative sample between two according to the second selected characteristic; From the set of original face negative sample, delete in two face negative samples that similarity is greater than setting threshold.
Concrete, above-mentioned acquiring unit 30, specifically for: calculate the positive sample of face or between two the similarity Score of face negative sample between two by following formula: wherein, N is the number of the first selected characteristic or the second selected characteristic, f 1i, f 2ifor the first selected characteristic i of the positive sample of face between two or the value of the second selected characteristic i of face negative sample between two.
Concrete, above-mentioned processing unit 31, specifically comprises: the image processing that the positive sample of face in the positive sample set of original face is carried out comprises one of following or combination: random noise stack, illumination variation, block processing.
Concrete, above-mentioned processing unit 31, specifically for: carry out random noise stack by following formula: I noise ( i , j ) = I ( i , j ) + ( - 1 ) k mod 2 I ( i , j ) e - ( k mod 50 ) 2 2 ; Wherein, I noise(i, j) represents the brightness of (i, j) point after random noise stack, I(i, j) represent the brightness of (i, j) point before random noise stack, k is random number.
Concrete, above-mentioned processing unit 31, specifically for:
Carry out vertical progressive conversion by following formula: I 1 ( i , j ) = I ( i , j ) + I ( i , j ) e - 9 × ( i + 1 H ) 2 ; Wherein, I 1(i, j) represents the brightness of (i, j) point after vertical progressive conversion, I(i, j) represent the brightness of (i, j) point before vertical progressive conversion, k is random number, H represents the height of the positive sample of face;
Carry out vertical strip conversion by following formula: I 2 ( i , j ) = I ( i , j ) + ( - 1 ) ( i × 10 H ) mod 2 I ( i , j ) e - 9 ( i mod H 10 + 1 H ) 2 ; Wherein, I 2(i, j) represents the brightness of (i, j) point after vertical strip conversion, I(i, j) represent the brightness of (i, j) point before vertical strip conversion;
Carry out the progressive conversion of level by following formula: I 3 ( i , j ) = I ( i , j ) + I ( i , j ) e - 9 × ( j + 1 W ) 2 ; Wherein, I 3the brightness of (i, j) point after the progressive conversion of (i, j) expression level, I(i, j) brightness of (i, j) point before the progressive conversion of expression level, W represents the width of face negative sample;
Carry out horizontal strip conversion by following formula: I 4 ( i , j ) = I ( i , j ) + ( - 1 ) ( j × 10 W ) mod 2 I ( i , j ) e - 9 ( j mod W 10 + 1 W ) 2 ; Wherein, I 4(i, j) represents the brightness of (i, j) point after horizontal strip conversion, I(i, j) represent the brightness of (i, j) point before horizontal strip conversion.
Concrete, above-mentioned processing unit 31, specifically for:
Carry out left eye by following formula and block processing: wherein, I l(i, j) represent left eye block after (i, j) point brightness, I(i, j) represent left eye block before (i, j) point brightness, H represents the height of the positive sample of face, W represents the width of the positive sample of face, i lrepresent the horizontal ordinate of left eye, j lthe ordinate that represents left eye, k is random number;
Carry out right eye by following formula and block processing: wherein, I r(i, j) represent right eye block after (i, j) point brightness, I(i, j) represent right eye block before (i, j) point brightness, i rrepresent the horizontal ordinate of right eye, j lrepresent the ordinate of right eye;
Carry out eyes by following formula and block processing: wherein, I lR(i, j) represent eyes block after (i, j) point brightness, I(i, j) represent eyes block before (i, j) point brightness;
Carry out mouth by following formula and block processing: wherein, M r(i, j) represent mouth block after (i, j) point brightness, I(i, j) represent mouth block before (i, j) point brightness, i mrepresent the horizontal ordinate of mouth, j mrepresent the ordinate of mouth.
Concrete, above-mentioned processing unit 31, specifically for: random number obtained, the number remainder number by random number to the positive sample of face comprising in the positive sample set of middle face; From the positive sample set of middle face, randomly draw the positive sample of face, the number of the positive sample of face of extraction is remainder; Random weight generation value, wherein, the number of the random weighted value generating is remainder, and and be 1; The random weighted value generating of use, to the positive sample weighting summation of the face of remainder, obtains the newly-increased positive sample of face, and adds in the positive sample set of middle face, obtains the positive sample set of final face.
Concrete, above-mentioned processing unit 31, specifically for: the newly-increased positive sample S of face obtained by following formula new: wherein, S irepresent the luminance matrix of i the positive sample of face, w irepresent i weighted value, N srepresent remainder.
Concrete, above-mentioned processing unit 31, specifically for: randomly draw two face negative samples in the set of original face negative sample; By two face negative samples randomly drawing carry out with or and XOR obtain three newly-increased face negative samples, and add in the set of original face negative sample, obtain the set of final face negative sample.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if these amendments of the present invention and within modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (20)

1. a generation method for the training sample detecting for face, is characterized in that, comprising:
Obtain the positive sample of face of the first setting quantity as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample;
The positive sample of face in the positive sample set of described original face is carried out to image processing, and add in the positive sample set of described original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and added in the positive sample set of described middle face, obtain the positive sample set of final face; And
Face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and added in the set of described original face negative sample, obtain the set of final face negative sample;
Using the positive sample set of described final face and the set of described final face negative sample as the training sample detecting for face.
2. the method for claim 1, is characterized in that, obtains the positive sample of face of the first setting quantity as after the positive sample set of original face, also comprises:
Calculate in described original face positive sample set the similarity of the positive sample of face between two according to the first selected characteristic;
From the positive sample set of described original face, delete in two positive samples of face that similarity is greater than setting threshold;
Obtain the face negative sample of the second setting quantity as after the set of original face negative sample, also comprise:
Calculate in described original face negative sample set the similarity of face negative sample between two according to the second selected characteristic;
From the set of described original face negative sample, delete in two face negative samples that similarity is greater than described setting threshold.
3. method as claimed in claim 2, it is characterized in that, calculate in described original face positive sample set the similarity of the positive sample of face between two according to the first selected characteristic, and calculate in described original face negative sample set the similarity of face negative sample between two according to the second selected characteristic, specifically comprise:
Calculate the positive sample of face or between two the similarity Score of face negative sample between two by following formula: Score = 1 N Σ i = 1 N e - ( f 1 i - f 2 i ) 2 2 ;
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f 1i, f 2ifor the first selected characteristic i of the positive sample of face between two or the value of the second selected characteristic i of face negative sample between two.
4. the method for claim 1, is characterized in that, the positive sample of face in the positive sample set of described original face is carried out to image processing, specifically comprises:
The image processing that the positive sample of face in the positive sample set of described original face is carried out comprises one of following or combination: random noise stack, illumination variation, block processing.
5. method as claimed in claim 4, is characterized in that, the positive sample of face in the positive sample set of described original face is carried out to random noise stack, specifically comprises:
Carry out random noise stack by following formula: I noise ( i , j ) = I ( i , j ) + ( - 1 ) k mod 2 I ( i , j ) e - ( k mod 50 ) 2 2 ;
Wherein, I noise(i, j) represents the brightness of (i, j) point after random noise stack, I(i, j) represent the brightness of (i, j) point before random noise stack, k is random number.
6. method as claimed in claim 4, is characterized in that, the positive sample of face in the positive sample set of described original face is carried out to illumination variation processing, specifically comprises:
Carry out vertical progressive conversion by following formula: wherein, I 1(i, j) represents the brightness of (i, j) point after vertical progressive conversion, I(i, j) represent the brightness of (i, j) point before vertical progressive conversion, k is random number, H represents the height of the positive sample of face;
Carry out vertical strip conversion by following formula: I 2 ( i , j ) = I ( i , j ) + ( - 1 ) ( i × 10 H ) mod 2 I ( i , j ) e - 9 ( i mod H 10 + 1 H ) 2 ; Wherein, I 2(i, j) represents the brightness of (i, j) point after vertical strip conversion, I(i, j) represent the brightness of (i, j) point before vertical strip conversion;
Carry out the progressive conversion of level by following formula: wherein, I 3the brightness of (i, j) point after the progressive conversion of (i, j) expression level, I(i, j) brightness of (i, j) point before the progressive conversion of expression level, W represents the width of face negative sample;
Carry out horizontal strip conversion by following formula: I 4 ( i , j ) = I ( i , j ) + ( - 1 ) ( j × 10 W ) mod 2 I ( i , j ) e - 9 ( j mod W 10 + 1 W ) 2 ; Wherein, I 4(i, j) represents the brightness of (i, j) point after horizontal strip conversion, I(i, j) represent the brightness of (i, j) point before horizontal strip conversion.
7. method as claimed in claim 4, is characterized in that, the positive sample of face in the positive sample set of described original face is blocked to processing, specifically comprises:
Carry out left eye by following formula and block processing: wherein, I l(i, j) represent left eye block after (i, j) point brightness, I(i, j) represent left eye block before (i, j) point brightness, H represents the height of the positive sample of face, W represents the width of the positive sample of face, i lrepresent the horizontal ordinate of left eye, j lthe ordinate that represents left eye, k is random number;
Carry out right eye by following formula and block processing: wherein, I r(i, j) represent right eye block after (i, j) point brightness, I(i, j) represent right eye block before (i, j) point brightness, i rrepresent the horizontal ordinate of right eye, j lrepresent the ordinate of right eye;
Carry out eyes by following formula and block processing: wherein, I lR(i, j) represent eyes block after (i, j) point brightness, I(i, j) represent eyes block before (i, j) point brightness;
Carry out mouth by following formula and block processing: wherein, M r(i, j) represent mouth block after (i, j) point brightness, I(i, j) represent mouth block before (i, j) point brightness, i mrepresent the horizontal ordinate of mouth, j mrepresent the ordinate of mouth.
8. the method for claim 1, it is characterized in that, the positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and add in the positive sample set of described middle face, obtain the positive sample set of final face, specifically comprise:
Obtain random number, the number remainder number by described random number to the positive sample of face comprising in the positive sample set of face in the middle of described;
In the middle of described, the positive sample set of face, randomly draw the positive sample of face, the number of the positive sample of face of extraction is described remainder;
Random weight generation value, wherein, the number of the random weighted value generating is described remainder, and and be 1;
The random weighted value generating of use, to the positive sample weighting summation of the face of described remainder, obtains the newly-increased positive sample of face, and adds in the positive sample set of described middle face, obtains the positive sample set of final face.
9. method as claimed in claim 8, is characterized in that, uses the random weighted value generating to the positive sample weighting summation of the face of described remainder, specifically comprises:
Obtain the newly-increased positive sample S of face by following formula new:
Wherein, S irepresent the luminance matrix of i the positive sample of face, w irepresent i weighted value, N srepresent remainder.
10. the method for claim 1, it is characterized in that, the face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and add in the set of described original face negative sample, obtain the set of final face negative sample, specifically comprise:
Randomly draw two face negative samples in the set of described original face negative sample;
By two face negative samples randomly drawing carry out with or and XOR obtain three newly-increased face negative samples, and add in the set of described original face negative sample, obtain the set of final face negative sample.
The generating apparatus of 11. 1 kinds of training samples that detect for face, is characterized in that, comprising:
Acquiring unit, for the positive sample of face that obtains the first setting quantity, as the positive sample set of original face, and the face negative sample that obtains the second setting quantity is as the set of original face negative sample;
Processing unit, carries out image processing for the positive sample of face to the positive sample set of described original face, and adds in the positive sample set of described original face, the positive sample set of face in the middle of obtaining; The positive sample of face in the positive sample set of face in the middle of described is randomly drawed and random weighting, and added in the positive sample set of described middle face, obtain the positive sample set of final face; And the face negative sample in the set of described original face negative sample is randomly drawed and step-by-step logical operation, and add in the set of described original face negative sample, obtain the set of final face negative sample;
Generation unit, for using the positive sample set of described final face and the set of described final face negative sample as the training sample detecting for face.
12. devices as claimed in claim 11, it is characterized in that, acquiring unit, also for after the positive sample of the face that obtains the first setting quantity is as the positive sample set of original face, calculates in described original face positive sample set the similarity of the positive sample of face between two according to the first selected characteristic;
From the positive sample set of described original face, delete in two positive samples of face that similarity is greater than setting threshold;
Obtain the face negative sample of the second setting quantity as after the set of original face negative sample, also comprise:
Calculate in described original face negative sample set the similarity of face negative sample between two according to the second selected characteristic;
From the set of described original face negative sample, delete in two face negative samples that similarity is greater than described setting threshold.
13. devices as claimed in claim 12, is characterized in that, described acquiring unit, specifically for:
Calculate the positive sample of face or between two the similarity Score of face negative sample between two by following formula: Score = 1 N Σ i = 1 N e - ( f 1 i - f 2 i ) 1 2 ;
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f 1i, f 2ifor the first selected characteristic i of the positive sample of face between two or the value of the second selected characteristic i of face negative sample between two.
14. devices as claimed in claim 11, is characterized in that, described processing unit, specifically comprises:
The image processing that the positive sample of face in the positive sample set of described original face is carried out comprises one of following or combination: random noise stack, illumination variation, block processing.
15. devices as claimed in claim 14, is characterized in that, described processing unit, specifically for:
Carry out random noise stack by following formula: I noise ( i , j ) = I ( i , j ) + ( - 1 ) k mod 2 I ( i , j ) e - ( k mod 50 ) 2 2 ;
Wherein, I noise(i, j) represents the brightness of (i, j) point after random noise stack, I(i, j) represent the brightness of (i, j) point before random noise stack, k is random number.
16. devices as claimed in claim 14, is characterized in that, described processing unit, specifically for:
Carry out vertical progressive conversion by following formula: wherein, I 1(i, j) represents the brightness of (i, j) point after vertical progressive conversion, I(i, j) represent the brightness of (i, j) point before vertical progressive conversion, k is random number, H represents the height of the positive sample of face;
Carry out vertical strip conversion by following formula: I 2 ( i , j ) = I ( i , j ) + ( - 1 ) ( i × 10 H ) mod 2 I ( i , j ) e - 9 ( i mod H 10 + 1 H ) 2 ; Wherein, I 2(i, j) represents the brightness of (i, j) point after vertical strip conversion, I(i, j) represent the brightness of (i, j) point before vertical strip conversion;
Carry out the progressive conversion of level by following formula: wherein, I 3the brightness of (i, j) point after the progressive conversion of (i, j) expression level, I(i, j) brightness of (i, j) point before the progressive conversion of expression level, W represents the width of face negative sample;
Carry out horizontal strip conversion by following formula: I 4 ( i , j ) = I ( i , j ) + ( - 1 ) ( j × 10 W ) mod 2 I ( i , j ) e - 9 ( j mod W 10 + 1 W ) 2 ; Wherein, I 4(i, j) represents the brightness of (i, j) point after horizontal strip conversion, I(i, j) represent the brightness of (i, j) point before horizontal strip conversion.
17. devices as claimed in claim 14, is characterized in that, described processing unit, specifically for:
Carry out left eye by following formula and block processing: wherein, I l(i, j) represent left eye block after (i, j) point brightness, I(i, j) represent left eye block before (i, j) point brightness, H represents the height of the positive sample of face, W represents the width of the positive sample of face, i lrepresent the horizontal ordinate of left eye, j lthe ordinate that represents left eye, k is random number;
Carry out right eye by following formula and block processing: wherein, I r(i, j) represent right eye block after (i, j) point brightness, I(i, j) represent right eye block before (i, j) point brightness, i rrepresent the horizontal ordinate of right eye, j lrepresent the ordinate of right eye;
Carry out eyes by following formula and block processing: wherein, I lR(i, j) represent eyes block after (i, j) point brightness, I(i, j) represent eyes block before (i, j) point brightness;
Carry out mouth by following formula and block processing: wherein, M r(i, j) represent mouth block after (i, j) point brightness, I(i, j) represent mouth block before (i, j) point brightness, i mrepresent the horizontal ordinate of mouth, j mrepresent the ordinate of mouth.
18. devices as claimed in claim 11, is characterized in that, described processing unit, specifically for:
Obtain random number, the number remainder number by described random number to the positive sample of face comprising in the positive sample set of face in the middle of described;
In the middle of described, the positive sample set of face, randomly draw the positive sample of face, the number of the positive sample of face of extraction is described remainder;
Random weight generation value, wherein, the number of the random weighted value generating is described remainder, and and be 1;
The random weighted value generating of use, to the positive sample weighting summation of the face of described remainder, obtains the newly-increased positive sample of face, and adds in the positive sample set of described middle face, obtains the positive sample set of final face.
19. devices as claimed in claim 18, is characterized in that, described processing unit, specifically for:
Obtain the newly-increased positive sample S of face by following formula new:
Wherein, S irepresent the luminance matrix of i the positive sample of face, w irepresent i weighted value, N srepresent remainder.
20. devices as claimed in claim 11, is characterized in that, described processing unit, specifically for:
Randomly draw two face negative samples in the set of described original face negative sample;
By two face negative samples randomly drawing carry out with or and XOR obtain three newly-increased face negative samples, and add in the set of described original face negative sample, obtain the set of final face negative sample.
CN201310137893.XA 2013-04-19 2013-04-19 Method and device for generating training samples used for face detection Active CN104112131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310137893.XA CN104112131B (en) 2013-04-19 2013-04-19 Method and device for generating training samples used for face detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310137893.XA CN104112131B (en) 2013-04-19 2013-04-19 Method and device for generating training samples used for face detection

Publications (2)

Publication Number Publication Date
CN104112131A true CN104112131A (en) 2014-10-22
CN104112131B CN104112131B (en) 2017-03-22

Family

ID=51708915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310137893.XA Active CN104112131B (en) 2013-04-19 2013-04-19 Method and device for generating training samples used for face detection

Country Status (1)

Country Link
CN (1) CN104112131B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344877A (en) * 2018-08-31 2019-02-15 深圳先进技术研究院 A kind of sample data processing method, sample data processing unit and electronic equipment
WO2019095469A1 (en) * 2017-11-14 2019-05-23 Zhejiang Dahua Technology Co., Ltd. Method and system for face detection
CN110826530A (en) * 2014-11-15 2020-02-21 北京旷视科技有限公司 Face detection using machine learning
CN112819173A (en) * 2019-11-18 2021-05-18 上海光启智城网络科技有限公司 Sample generation method and device and computer readable storage medium
CN114742171A (en) * 2022-04-24 2022-07-12 中山大学 Compression method, device and storage medium for intrinsic orthogonal decomposition sample
CN115050086A (en) * 2022-08-15 2022-09-13 北京百度网讯科技有限公司 Sample image generation method, model training method, image processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1317677C (en) * 2004-03-19 2007-05-23 中国科学院计算技术研究所 Genetic algorithm based human face sample generating method
CN101408943A (en) * 2007-10-09 2009-04-15 三星电子株式会社 Method for generating a training set for human face detection
CN102103695A (en) * 2009-12-21 2011-06-22 北京中星微电子有限公司 Method and device for generating image sample
WO2012131149A1 (en) * 2011-03-25 2012-10-04 Nokia Corporation Method apparatus and computer program product for detection of facial expressions

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1317677C (en) * 2004-03-19 2007-05-23 中国科学院计算技术研究所 Genetic algorithm based human face sample generating method
CN101408943A (en) * 2007-10-09 2009-04-15 三星电子株式会社 Method for generating a training set for human face detection
CN102103695A (en) * 2009-12-21 2011-06-22 北京中星微电子有限公司 Method and device for generating image sample
WO2012131149A1 (en) * 2011-03-25 2012-10-04 Nokia Corporation Method apparatus and computer program product for detection of facial expressions

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826530A (en) * 2014-11-15 2020-02-21 北京旷视科技有限公司 Face detection using machine learning
CN110826530B (en) * 2014-11-15 2023-06-30 北京旷视科技有限公司 Face detection using machine learning
WO2019095469A1 (en) * 2017-11-14 2019-05-23 Zhejiang Dahua Technology Co., Ltd. Method and system for face detection
US11804032B2 (en) 2017-11-14 2023-10-31 Zhejiang Dahua Technology Co., Ltd. Method and system for face detection
CN109344877A (en) * 2018-08-31 2019-02-15 深圳先进技术研究院 A kind of sample data processing method, sample data processing unit and electronic equipment
CN109344877B (en) * 2018-08-31 2020-12-11 深圳先进技术研究院 Sample data processing method, sample data processing device and electronic equipment
CN112819173A (en) * 2019-11-18 2021-05-18 上海光启智城网络科技有限公司 Sample generation method and device and computer readable storage medium
CN114742171A (en) * 2022-04-24 2022-07-12 中山大学 Compression method, device and storage medium for intrinsic orthogonal decomposition sample
CN115050086A (en) * 2022-08-15 2022-09-13 北京百度网讯科技有限公司 Sample image generation method, model training method, image processing method and device

Also Published As

Publication number Publication date
CN104112131B (en) 2017-03-22

Similar Documents

Publication Publication Date Title
CN104112131A (en) Method and device for generating training samples used for face detection
CN103810504B (en) Image processing method and device
WO2021164752A1 (en) Neural network channel parameter searching method, and related apparatus
CN107862270B (en) Face classifier training method, face detection method and device and electronic equipment
US20200057935A1 (en) Video action detection method based on convolutional neural network
US8750573B2 (en) Hand gesture detection
CN110647817A (en) Real-time face detection method based on MobileNet V3
Isa et al. Optimizing the hyperparameter tuning of YOLOv5 for underwater detection
CN106778796B (en) Human body action recognition method and system based on hybrid cooperative training
CN109086779B (en) Attention target identification method based on convolutional neural network
CN110309784A (en) Action recognition processing method, device, equipment and storage medium
CN105608446A (en) Video stream abnormal event detection method and apparatus
CN103198330B (en) Real-time human face attitude estimation method based on deep video stream
CN110652726B (en) Game auxiliary system based on image recognition and audio recognition
CN103853724A (en) Multimedia data sorting method and device
CN104156464A (en) Micro-video retrieval method and device based on micro-video feature database
CN110163567A (en) Classroom roll calling system based on multitask concatenated convolutional neural network
CN109064389A (en) A kind of free hand line draws the deep learning method of generation presence image
CN103105924A (en) Man-machine interaction method and device
CN112651459A (en) Defense method, device, equipment and storage medium for confrontation sample of deep learning image
CN113762009A (en) Crowd counting method based on multi-scale feature fusion and double-attention machine mechanism
Wang et al. Distortion recognition for image quality assessment with convolutional neural network
WO2022156214A1 (en) Liveness detection method and apparatus
CN106993240A (en) Many video summarization methods based on sparse coding
CN104376538A (en) Image sparse denoising method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant