CN104112131B - 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
CN104112131B
CN104112131B CN201310137893.XA CN201310137893A CN104112131B CN 104112131 B CN104112131 B CN 104112131B CN 201310137893 A CN201310137893 A CN 201310137893A CN 104112131 B CN104112131 B CN 104112131B
Authority
CN
China
Prior art keywords
face
positive sample
sample set
face positive
represent
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.)
Active
Application number
CN201310137893.XA
Other languages
Chinese (zh)
Other versions
CN104112131A (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 of the training sample for Face datection and device
Technical field
The present invention relates to field of computer technology, the generation method of espespecially a kind of training sample for Face datection and dress Put.
Background technology
Face datection is mainly used in the pretreatment of recognition of face in actual applications, i.e., accurate calibration goes out face in the picture Position and size.Human face detection tech has obtained good application in gate control system, intelligent monitor system at present.Separately Outward, in notebook computer, also begin to use face recognition technology to log in as computer successively voucher.In recent years, in number Also Face datection algorithm is integrated with camera and mobile phone, is supplied to user to use as new function.In such applications, face Detection is all to play vital effect.
Due to facial image easily by ambient light, express one's feelings, block, the various factors such as age and attitude is affected, this allows for Face datection becomes a complicated, challenging research topic.Through a large amount of scholar's years of researches, based on level link The Adaboost algorithm of structure is considered as detection speed most fast and effect the best way.Adaboost algorithm is a kind of based on sample The method of this study:In the training stage, the common trait of the great amount of samples to being input into is learnt and is concluded, and generates training sample This, including face positive sample and face negative sample, face positive sample is the image of face, and face negative sample is background residing for face Image;It is in detection-phase, whether consistent with training sample by the feature of analysis of the image, determine whether image is face Image.It can be seen that, impact of the training sample to Face datection result is very big.
In general, training sample multiformity is better, and Detection results are better.At present, generally by artificial collection image Mode obtain training sample, as training sample is required with preferable multiformity, then be accomplished by gathering substantial amounts of image, Therefore substantial amounts of human resourcess can be wasted;And due to there are many features unavoidably very close to this is just in the image of collection Reduce the multiformity of training sample, it is impossible to ensure the accuracy of face testing result.
The content of the invention
The embodiment of the present invention provides a kind of generation method of the training sample for Face datection and device, existing to solve Somebody's work collection training sample mode caused by human resourcess' serious waste, training sample multiformity reduce and cannot Ensure the problem of the accuracy of face testing result.
A kind of generation method of the training sample for Face datection, including:
Obtain first and the face positive sample of quantity is set as original face positive sample set, and obtain second set number The face negative sample of amount is used as original face negative sample set;
Image procossing is carried out to the face positive sample in the original face positive sample set, and is added to the primitive man In face positive sample set, middle face positive sample set is obtained;To the face positive sample in the middle face positive sample set Randomly selected and random weighting, and be added in the middle face positive sample set, obtained final face positive sample collection Close;And
Face negative sample in the original face negative sample set is randomly selected and step-by-step logical operationss, and is added It is added in the original face negative sample set, obtains final face negative sample set;
Using final face positive sample set and final face negative sample set as the instruction for Face datection Practice sample.
A kind of generating means of the training sample for Face datection, including:
Acquiring unit, sets the face positive sample of quantity as original face positive sample set for obtaining first, and Obtain second the face negative sample of quantity is set as original face negative sample set;
Processing unit, for carrying out image procossing to the face positive sample in the original face positive sample set, and adds It is added in the original face positive sample set, obtains middle face positive sample set;To the middle face positive sample set In face positive sample randomly selected and random weighting, and be added in the middle face positive sample set, obtain most Whole face positive sample set;And the face negative sample in the original face negative sample set is randomly selected and step-by-step Logical operationss, and be added in the original face negative sample set, obtain final face negative sample set;
Signal generating unit, for using final face positive sample set and final face negative sample set as being used for The training sample of Face datection.
The present invention has the beneficial effect that:
The generation method of the training sample for Face datection provided in an embodiment of the present invention and device, by obtaining first The face positive sample of setting quantity is used as original face positive sample set, and obtains the second face negative sample work for setting quantity For original face negative sample set;Image procossing is carried out to the face positive sample in the original face positive sample set, and is added It is added in the original face positive sample set, obtains middle face positive sample set;To the middle face positive sample set In face positive sample randomly selected and random weighting, and be added in the middle face positive sample set, obtain most Whole face positive sample set;And the face negative sample in the original face negative sample set is randomly selected and step-by-step Logical operationss, and be added in the original face negative sample set, obtain final face negative sample set;By the final people The set of face positive sample and final face negative sample set are used as the training sample for Face datection.The program obtains setting Then these face positive samples and face negative sample are carried out certain process by the face positive sample of quantity and face negative sample, More face positive samples and face negative sample are can be obtained by so, without the need for can just obtain by way of artificial collection image To multifarious training sample, that is, human resourcess are saved, improve the multiformity of training sample again, and can ensure that face The accuracy of testing result.
Description of the drawings
Fig. 1 be the embodiment of the present invention in for Face datection training sample generation method flow chart;
Fig. 2 is to obtain the method flow of final face positive sample set in the embodiment of the present invention;
Fig. 3 be the embodiment of the present invention in for Face datection training sample generating means structural representation.
Specific embodiment
For human resourcess' serious waste caused by the mode of existing artificial collection training sample, training sample it is various Property reduce and cannot ensure face testing result accuracy problem, it is provided in an embodiment of the present invention for Face datection The generation method of training sample, the flow process of the method is as shown in figure 1, execution step is as follows:
S10:Obtain first and the face positive sample of quantity is set as original face positive sample set, and obtain second set The face negative sample of fixed number amount is used as original face negative sample set.
Can be obtained by way of artificial collection, it is also possible to the existing image of direct access.Generic face positive sample Quantity is greater than 3000 width, including the various ages, express one's feelings, certain angle of vacillating now to the left, now to the right(Less than 45 degree), pitch certain angle up and down Degree(Less than 25 degree), it is not agnate, these face positive samples can serve as original face positive sample set;Face negative sample will More than 10000 width, as far as possible including various indoor scenes(Computer, desk, TV background, kitchen, bedroom, office, window etc.) With outdoor different scenes(Trees, meadow, building, road, sky, sea, HUAMU, farmland, food market etc.), these face negative samples Can serve as original face negative sample set.
S11:Image procossing is carried out to the face positive sample in original face positive sample set, and is just added to original face In sample set, middle face positive sample set is obtained.
S12:Face positive sample in middle face positive sample set is randomly selected and random weighting, and is added to In middle face positive sample set, final face positive sample set is obtained.
S13:Face negative sample in original face negative sample set is randomly selected and step-by-step logical operationss, and added It is added in original face negative sample set, obtains final face negative sample set.
S11 can be first carried out, then performs S13;S13 can also be first carried out, then performs S11;Can certainly perform simultaneously S11 and S13.
S14:Using the set of final face positive sample and the set of final face negative sample as the training sample for Face datection This.
The program obtains the face positive sample of setting quantity and face negative sample, then to these face positive samples and face Negative sample carries out certain process, so can be obtained by more face positive samples and face negative sample, need not be by artificial The mode of collection image can be obtained by multifarious training sample, that is, save human resourcess, improve training sample again Multiformity, and can ensure that the accuracy of Face datection result.
More preferably, the face positive sample of the setting quantity of acquisition first in above-mentioned S10 is used as original face positive sample set Afterwards, also include:The similarity of face positive sample two-by-two is calculated in original face positive sample set according to the first selected characteristic;From Similarity is deleted in original face positive sample set more than in two face positive samples of given threshold.
After the face negative sample of the setting quantity of acquisition second in above-mentioned S10 is as original face negative sample set, also Including:The similarity of face negative sample two-by-two is calculated in original face negative sample set according to the second selected characteristic;From primitive man Similarity is deleted in face negative sample set more than in two face negative samples of given threshold.
In order to improve detection efficiency, can get rid of first similar in the set of face positive sample and face negative sample set Sample, after similarity is calculated to the sample two-by-two in the set of face positive sample and face negative sample set respectively, can be by phase Like a deletion in sample of the degree more than given threshold.
Specifically, it is above-mentioned that the phase of face positive sample two-by-two is calculated in original face positive sample set according to the first selected characteristic Like spending, and the similarity of face negative sample two-by-two is calculated in original face negative sample set according to the second selected characteristic, specifically Including:Face positive sample two-by-two or similarity Score of face negative sample two-by-two are calculated by following equation:
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f1i、f2iFor the first of face positive sample two-by-two The value of the second selected characteristic i of selected characteristic i or two-by-two face negative sample.
Specifically, image procossing is carried out to the face positive sample in original face positive sample set in above-mentioned S11, specifically Including:One below or combination are included to the image procossing that the face positive sample in original face positive sample set is carried out:At random Noise superposition, illumination variation, block process.
Specifically, the above-mentioned face positive sample in original face positive sample set carries out random noise superposition, by under Row formula carries out random noise superposition:Wherein, Inoise(I, j) After representing random noise superposition(I, j)The brightness of point, I(I, j)Before representing random noise superposition(I, j)The brightness of point, k is random Number.
Specifically, the above-mentioned face positive sample in original face positive sample set carries out illumination variation process, by under Row formula carries out vertical progressive conversion:Wherein, I1(I, j)Represent vertical progressive After conversion(I, j)The brightness of point, I(I, j)Before representing vertical progressive conversion(I, j)The brightness of point, k is random number, and H represents face The height of positive sample.
Vertical strip conversion is carried out by following equation: Wherein, I2(I, j)After representing vertical strip conversion(I, j)The brightness of point, I(I, j)Before representing vertical strip conversion(I, j)Point Brightness.
The progressive conversion of level is carried out by following equation:Wherein, I3(I, j)After the progressive conversion of expression level(I, j)The brightness of point, I(I, j)Before the progressive conversion of expression level(I, j)The brightness of point, W are represented The width of face negative sample.
Horizontal strip conversion is carried out by following equation: Wherein, I4(I, j)After representing horizontal strip conversion(I, j)The brightness of point, I(I, j)Before representing horizontal strip conversion(I, j)Point Brightness.
Specifically, the face positive sample in original face positive sample set is carried out blocking process, is entered by following equation Row left eye blocks process:Wherein, IL(I, j)Represent left After eye-shade gear(I, j)The brightness of point, I(I, j)Before representing that left eye is blocked(I, j)The brightness of point, H represent the height of face positive sample Degree, W represent the width of face positive sample, iLRepresent the abscissa of left eye, jLThe vertical coordinate of left eye is represented, k is random number.
Right eye is carried out by following equation and blocks process: Wherein, IR(I, j)After representing that right eye is blocked(I, j)The brightness of point, I(I, j)Before representing that right eye is blocked(I, j)The brightness of point, iRTable Show the abscissa of right eye, jLRepresent the vertical coordinate of right eye.
Eyes are carried out by following equation and blocks process:
Wherein, ILR(I, j)After representing that eyes are blocked(I, j)The brightness of point, I(I, j)Before representing that eyes are blocked(I, j)Point Brightness.
Mouth is carried out by following equation and blocks process: Wherein, MR(I, j)After representing that mouth is blocked(I, j)The brightness of point, I(I, j)Before representing that mouth is blocked(I, j)The brightness of point, iMTable Show the abscissa of mouth, jMRepresent the vertical coordinate of mouth.
Specifically, as shown in Fig. 2 in above-mentioned S12 the face positive sample in middle face positive sample set is carried out with Machine is extracted and random weighting, and is added in middle face positive sample set, obtains final face positive sample set, concrete to wrap Include:
S120:Random number is obtained, by the number of face positive sample of the random number to including in middle face positive sample set Take the remainder.
Random number can be generated using prior art, use k=random()To represent, if middle face positive sample set The number of the face positive sample included in town is Np, then can take kmodNp, as Ns.
S121:Face positive sample, the number of the face positive sample of extraction is randomly selected from middle face positive sample set For remainder.
Ns face positive sample is randomly selected from middle face positive sample set.
S122:Random to generate weighted value, wherein, the number of the random weighted value for generating is remainder, and and is 1.
Ns weighted value, W is generated at random1、W2……WNs, wherein, W1+W2+……+WNs=1。
S123:Using face positive sample weighted sum of the random weighted value for generating to remainder, the positive sample of newly-increased face is obtained This, and be added in middle face positive sample set, obtain final face positive sample set.
Specifically, in above-mentioned S123 face positive sample weighted sum of the weighted value that use is generated at random to remainder, leads to Cross following equation and obtain newly-increased face positive sample Snew:Wherein, SiRepresent the bright of i-th face positive sample Degree matrix, wiRepresent i-th weighted value, NsRepresent remainder.
Specifically, the face negative sample in original face negative sample set is randomly selected in above-mentioned S13 and by Position logical operationss, and be added in original face negative sample set, final face negative sample set is obtained, is specifically included:At random Extract two face negative samples in original face negative sample set;By randomly select two face negative samples carry out with, or Three newly-increased face negative samples are obtained with XOR, and is added in original face negative sample set, obtained final face and bear Sample set.
Wherein, randomly select two face samples are carried out into step-by-step logic and operation and can passes through formula Snew1=S1& S2 Realize, randomly select two face samples are carried out into step-by-step logic or computing can pass through formula Snew1=S1|S2Realize, will be with Two face samples that machine is extracted carry out step-by-step logic XOR and can pass through formula Snew1=S1^S2Realize.
Based on same inventive concept, the embodiment of the present invention provides a kind of generation dress of training sample for Face datection Put, the structure of the device as shown in figure 3, including:
Acquiring unit 30, sets the face positive sample of quantity as original face positive sample set for obtaining first, with And the face negative sample of the second setting quantity is obtained as original face negative sample set.
Processing unit 31, for carrying out image procossing to the face positive sample in original face positive sample set, and adds To in original face positive sample set, middle face positive sample set is obtained;To the face in middle face positive sample set just Sample is randomly selected and random weighting, and is added in middle face positive sample set, obtains final face positive sample collection Close;And the face negative sample in original face negative sample set is randomly selected and step-by-step logical operationss, and be added to In original face negative sample set, final face negative sample set is obtained.
Signal generating unit 32, for using the set of final face positive sample and the set of final face negative sample as examining for face The training sample of survey.
Preferably, above-mentioned acquiring unit 30, is additionally operable to obtaining the face positive sample of the first setting quantity as primitive man After face positive sample set, the similar of face positive sample two-by-two is calculated in original face positive sample set according to the first selected characteristic Degree;Similarity is deleted from original face positive sample set more than in two face positive samples of given threshold;Obtain After the face negative sample of the second setting quantity is as original face negative sample set, also include:According to the second selected characteristic meter Calculate in original face negative sample set the similarity of face negative sample two-by-two;Similarity is deleted from original face negative sample set More than one in two face negative samples of given threshold.
Specifically, above-mentioned acquiring unit 30, specifically for:Face positive sample two-by-two or people two-by-two are calculated by following equation Similarity Score of face negative sample:Wherein, N is the first selected characteristic or the second selected characteristic Number, f1i、f2iThe first selected characteristic i for face positive sample two-by-two or two-by-two the second selected characteristic i of face negative sample Value.
Specifically, above-mentioned processing unit 31, specifically includes:Face positive sample in original face positive sample set is carried out Image procossing include one below or combination:Random noise superposition, illumination variation, block process.
Specifically, above-mentioned processing unit 31, specifically for:Random noise superposition is carried out by following equation:Wherein, Inoise(I, j)After representing random noise superposition(I, j) The brightness of point, I(I, j)Before representing random noise superposition(I, j)The brightness of point, k is random number.
Specifically, above-mentioned processing unit 31, specifically for:
Vertical progressive conversion is carried out by following equation:Wherein, I1(I, j)After representing vertical progressive conversion(I, j)The brightness of point, I(I, j)Before representing vertical progressive conversion(I, j)Point brightness, k be with Machine number, H represent the height of face positive sample;
Vertical strip conversion is carried out by following equation: Wherein, I2(I, j)After representing vertical strip conversion(I, j)The brightness of point, I(I, j)Before representing vertical strip conversion(I, j)Point Brightness;
The progressive conversion of level is carried out by following equation:Wherein, I3(I, j)After the progressive conversion of expression level(I, j)The brightness of point, I(I, j)Before the progressive conversion of expression level(I, j)The brightness of point, W are represented The width of face negative sample;
Horizontal strip conversion is carried out by following equation: Wherein, I4(I, j)After representing horizontal strip conversion(I, j)The brightness of point, I(I, j)Before representing horizontal strip conversion(I, j)Point Brightness.
Specifically, above-mentioned processing unit 31, specifically for:
Left eye is carried out by following equation and blocks process: Wherein, IL(I, j)After representing that left eye is blocked(I, j)The brightness of point, I(I, j)Before representing that left eye is blocked(I, j)The brightness of point, H tables The height of face positive sample of leting others have a look at, W represent the width of face positive sample, iLRepresent the abscissa of left eye, jLRepresent the vertical seat of left eye Mark, k is random number;
Right eye is carried out by following equation and blocks process: Wherein, IR(I, j)After representing that right eye is blocked(I, j)The brightness of point, I(I, j)Before representing that right eye is blocked(I, j)The brightness of point, iRTable Show the abscissa of right eye, jLRepresent the vertical coordinate of right eye;
Eyes are carried out by following equation and blocks process:Wherein, ILR (I, j)After representing that eyes are blocked(I, j)The brightness of point, I(I, j)Before representing that eyes are blocked(I, j)The brightness of point;
Mouth is carried out by following equation and blocks process: Wherein, MR(I, j)After representing that mouth is blocked(I, j)The brightness of point, I(I, j)Before representing that mouth is blocked(I, j)The brightness of point, iMTable Show the abscissa of mouth, jMRepresent the vertical coordinate of mouth.
Specifically, above-mentioned processing unit 31, specifically for:Random number is obtained, by random number to middle face positive sample collection The number of the face positive sample included in conjunction takes the remainder;Face positive sample is randomly selected from middle face positive sample set, is taken out The number of the face positive sample for taking is remainder;Random to generate weighted value, wherein, the number of the random weighted value for generating is remainder, And and be 1;Using face positive sample weighted sum of the random weighted value for generating to remainder, newly-increased face positive sample is obtained, and It is added in middle face positive sample set, obtains final face positive sample set.
Specifically, above-mentioned processing unit 31, specifically for:Newly-increased face positive sample S is obtained by following equationnewWherein, SiRepresent the luminance matrix of i-th face positive sample, wiRepresent i-th weighted value, NsRepresent remaining Number.
Specifically, above-mentioned processing unit 31, specifically for:Randomly select two faces in original face negative sample set Negative sample;By randomly select two face negative samples carry out with, or obtain three newly-increased face negative samples with XOR, and It is added in original face negative sample set, obtains final face negative sample set.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (20)

1. a kind of generation method of the training sample for Face datection, it is characterised in that include:
Obtain first and the face positive sample of quantity is set as original face positive sample set, and obtain second set quantity Face negative sample is used as original face negative sample set;
Image procossing is carried out to the face positive sample in the original face positive sample set, and is just added to the original face In sample set, middle face positive sample set is obtained;Face positive sample in the middle face positive sample set is carried out Randomly select, the face positive sample to extracting carries out random weighting;And based on the weighted value in random weighting result, to what is extracted Face positive sample carries out the computing based on weighted value, and is added in the middle face positive sample set, obtains final face Positive sample set;And
Face negative sample in the original face negative sample set is randomly selected, the face negative sample to extracting is carried out Step-by-step logical operationss, and be added in the original face negative sample set, obtain final face negative sample set;
Using final face positive sample set and final face negative sample set as the training sample for Face datection This.
2. the method for claim 1, it is characterised in that obtain first and set the face positive sample of quantity as primitive man After face positive sample set, also include:
The similarity of face positive sample two-by-two is calculated in the original face positive sample set according to the first selected characteristic;
Similarity is deleted from the original face positive sample set more than in two face positive samples of given threshold;
After the face negative sample of acquisition the second setting quantity is as original face negative sample set, also include:
The similarity of face negative sample two-by-two is calculated in the original face negative sample set according to the second selected characteristic;
Similarity is deleted from the original face negative sample set more than in two face negative samples of the given threshold One.
3. method as claimed in claim 2, it is characterised in that the original face positive sample is calculated according to the first selected characteristic The similarity of face positive sample two-by-two in set, and calculated in the original face negative sample set according to the second selected characteristic The similarity of face negative sample, specifically includes two-by-two:
Face positive sample two-by-two or similarity Score of face negative sample two-by-two are calculated by following equation:
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f1i、f2iFor face positive sample two-by-two first is chosen The value of the second selected characteristic i of feature i or two-by-two face negative sample.
4. the method for claim 1, it is characterised in that to the face positive sample in the original face positive sample set Image procossing is carried out, is specifically included:
One below or combination are included to the image procossing that the face positive sample in the original face positive sample set is carried out:With The superposition of machine noise, illumination variation, block process.
5. method as claimed in claim 4, it is characterised in that to the face positive sample in the original face positive sample set Random noise superposition is carried out, is specifically included:
Random noise superposition is carried out by following equation:
Wherein, InoiseThe brightness that (i, j) puts after (i, j) expression random noise superposition, before I (i, j) represents random noise superposition (i, J) brightness put, k are random number.
6. method as claimed in claim 4, it is characterised in that to the face positive sample in the original face positive sample set Illumination variation process is carried out, is specifically included:
Vertical progressive conversion is carried out by following equation:Wherein, I1(i, j) is represented The brightness that (i, j) puts after vertical progressive conversion, the brightness that (i, j) puts before the vertical progressive conversion of I (i, j) expressions, H represent face just The height of sample, i and j are position coordinateses;
Vertical strip conversion is carried out by following equation:Its In, I2(i, j) represent (i, j) brightness for putting after vertical strip conversion, I (i, j) represent vertical strip conversion before (i, j) put it is bright Degree, i and j are position coordinateses;
The progressive conversion of level is carried out by following equation:Wherein, I3(i, j) table The brightness that (i, j) puts after showing the progressive conversion of level, the brightness that (i, j) puts before the progressive conversion of I (i, j) expressions level, W represent face The width of positive sample, i and j are position coordinateses;
Horizontal strip conversion is carried out by following equation:Its In, I4(i, j) represent (i, j) brightness for putting after horizontal strip conversion, I (i, j) represent horizontal strip conversion before (i, j) put it is bright Degree, i and j are position coordinateses.
7. method as claimed in claim 4, it is characterised in that to the face positive sample in the original face positive sample set Carry out blocking process, specifically include:
Left eye is carried out by following equation and blocks process: Wherein, IL(i, j) represent left eye block after (i, j) brightness for putting, I (i, j) represent left eye block before (i, j) brightness for putting, H tables The height of face positive sample of leting others have a look at, W represent the width of face positive sample, iLRepresent the abscissa of left eye, jLRepresent the vertical seat of left eye Mark, k are random number, and i and j is position coordinateses;
Right eye is carried out by following equation and blocks process: Wherein, IR(i, j) represent right eye block after (i, j) brightness for putting, I (i, j) represent right eye block before (i, j) brightness for putting, iRTable Show the abscissa of right eye, jLThe vertical coordinate of right eye is represented, i and j is position coordinateses;
Eyes are carried out by following equation and blocks process:Wherein, ILR (i, j) represent eyes block after (i, j) brightness for putting, I (i, j) represent eyes block before (i, j) brightness for putting, i and j is position Coordinate;
Mouth is carried out by following equation and blocks process: Wherein, IM(i, j) represent mouth block after (i, j) brightness for putting, I (i, j) represent mouth block before (i, j) brightness for putting, iMTable Show the abscissa of mouth, jMThe vertical coordinate of mouth is represented, i and j is position coordinateses.
8. the method for claim 1, it is characterised in that to the face positive sample in the middle face positive sample set Randomly selected and random weighting, and be added in the middle face positive sample set, obtained final face positive sample collection Close, specifically include:
Random number is obtained, the number of face positive sample of the random number to including in the middle face positive sample set is taken Remainder;
Face positive sample is randomly selected from the middle face positive sample set, and the number of the face positive sample of extraction is described Remainder;
Random to generate weighted value, wherein, the number of the random weighted value for generating is the remainder, and and is 1;
Using face positive sample weighted sum of the random weighted value for generating to the remainder, newly-increased face positive sample is obtained, and It is added in the middle face positive sample set, obtains final face positive sample set.
9. method as claimed in claim 8, it is characterised in that using the random weighted value for generating to the face of the remainder just Sample weighting is sued for peace, and specifically includes:
Newly-increased face positive sample S is obtained by following equationnew
Wherein, SiRepresent the luminance matrix of i-th face positive sample, wiRepresent i-th weighted value, NsRepresent remainder.
10. the method for claim 1, it is characterised in that to the negative sample of face in the original face negative sample set Originally randomly selected and step-by-step logical operationss, and be added in the original face negative sample set, obtained final face and bear Sample set, specifically includes:
Randomly select two face negative samples in the original face negative sample set;
By randomly select two face negative samples carry out with, or obtain three newly-increased face negative samples with XOR, and add It is added in the original face negative sample set, obtains final face negative sample set.
11. a kind of generating means of the training sample for Face datection, it is characterised in that include:
Acquiring unit, sets the face positive sample of quantity as original face positive sample set for obtaining first, and obtains The face negative sample of the second setting quantity is used as original face negative sample set;
Processing unit, for carrying out image procossing to the face positive sample in the original face positive sample set, and is added to In the original face positive sample set, middle face positive sample set is obtained;To in the middle face positive sample set Face positive sample is randomly selected, and the face positive sample to extracting carries out random weighting;And based in random weighting result Weighted value, the face positive sample to extracting carry out the computing based on weighted value, and are added to the middle face positive sample set In, obtain final face positive sample set;And the face negative sample in the original face negative sample set is carried out at random Extract, the face negative sample to extracting carries out step-by-step logical operationss, and is added in the original face negative sample set, obtains Final face negative sample set;
Signal generating unit, for using final face positive sample set and final face negative sample set as face The training sample of detection.
12. devices as claimed in claim 11, it is characterised in that acquiring unit, are additionally operable to obtaining the first setting quantity After face positive sample is as original face positive sample set, the original face positive sample collection is calculated according to the first selected characteristic The similarity of face positive sample two-by-two in conjunction;
Similarity is deleted from the original face positive sample set more than in two face positive samples of given threshold;
After the face negative sample of acquisition the second setting quantity is as original face negative sample set, also include:
The similarity of face negative sample two-by-two is calculated in the original face negative sample set according to the second selected characteristic;
Similarity is deleted from the original face negative sample set more than in two face negative samples of the given threshold One.
13. devices as claimed in claim 12, it is characterised in that the acquiring unit, specifically for:
Face positive sample two-by-two or similarity Score of face negative sample two-by-two are calculated by following equation:
Wherein, N is the number of the first selected characteristic or the second selected characteristic, f1i、f2iFor face positive sample two-by-two first is chosen The value of the second selected characteristic i of feature i or two-by-two face negative sample.
14. devices as claimed in claim 11, it is characterised in that the processing unit, specifically include:
One below or combination are included to the image procossing that the face positive sample in the original face positive sample set is carried out:With The superposition of machine noise, illumination variation, block process.
15. devices as claimed in claim 14, it is characterised in that the processing unit, specifically for:
Random noise superposition is carried out by following equation:
Wherein, InoiseThe brightness that (i, j) puts after (i, j) expression random noise superposition, before I (i, j) represents random noise superposition (i, J) brightness put, k are random number.
16. devices as claimed in claim 14, it is characterised in that the processing unit, specifically for:
Vertical progressive conversion is carried out by following equation:Wherein, I1(i, j) is represented The brightness that (i, j) puts after vertical progressive conversion, the brightness that (i, j) puts before the vertical progressive conversion of I (i, j) expressions, H represent face just The height of sample, i and j are position coordinateses;
Vertical strip conversion is carried out by following equation:Its In, I2(i, j) represent (i, j) brightness for putting after vertical strip conversion, I (i, j) represent vertical strip conversion before (i, j) put it is bright Degree, i and j are position coordinateses;
The progressive conversion of level is carried out by following equation:Wherein, I3(i, j) table The brightness that (i, j) puts after showing the progressive conversion of level, the brightness that (i, j) puts before the progressive conversion of I (i, j) expressions level, W represent face The width of positive sample, i and j are position coordinateses;
Horizontal strip conversion is carried out by following equation:Its In, I4(i, j) represent (i, j) brightness for putting after horizontal strip conversion, I (i, j) represent horizontal strip conversion before (i, j) put it is bright Degree, i and j are position coordinateses.
17. devices as claimed in claim 14, it is characterised in that the processing unit, specifically for:
Left eye is carried out by following equation and blocks process: Wherein, IL(i, j) represent left eye block after (i, j) brightness for putting, I (i, j) represent left eye block before (i, j) brightness for putting, H tables The height of face positive sample of leting others have a look at, W represent the width of face positive sample, iLRepresent the abscissa of left eye, jLRepresent the vertical seat of left eye Mark, k are random number, and i and j is position coordinateses;
Right eye is carried out by following equation and blocks process: Wherein, IR(i, j) represent right eye block after (i, j) brightness for putting, I (i, j) represent right eye block before (i, j) brightness for putting, iRTable Show the abscissa of right eye, jLThe vertical coordinate of right eye is represented, i and j is position coordinateses;
Eyes are carried out by following equation and blocks process:Wherein, ILR (i, j) represent eyes block after (i, j) brightness for putting, I (i, j) represent eyes block before (i, j) brightness for putting, i and j is position Coordinate;
Mouth is carried out by following equation and blocks process: Wherein, IM(i, j) represent mouth block after (i, j) brightness for putting, I (i, j) represent mouth block before (i, j) brightness for putting, iMTable Show the abscissa of mouth, jMThe vertical coordinate of mouth is represented, i and j is position coordinateses.
18. devices as claimed in claim 11, it is characterised in that the processing unit, specifically for:
Random number is obtained, the number of face positive sample of the random number to including in the middle face positive sample set is taken Remainder;
Face positive sample is randomly selected from the middle face positive sample set, and the number of the face positive sample of extraction is described Remainder;
Random to generate weighted value, wherein, the number of the random weighted value for generating is the remainder, and and is 1;
Using face positive sample weighted sum of the random weighted value for generating to the remainder, newly-increased face positive sample is obtained, and It is added in the middle face positive sample set, obtains final face positive sample set.
19. devices as claimed in claim 18, it is characterised in that the processing unit, specifically for:
Newly-increased face positive sample S is obtained by following equationnew
Wherein, SiRepresent the luminance matrix of i-th face positive sample, wiRepresent i-th weighted value, NsRepresent remainder.
20. devices as claimed in claim 11, it is characterised in that the processing unit, specifically for:
Randomly select two face negative samples in the original face negative sample set;
By randomly select two face negative samples carry out with, or obtain three newly-increased face negative samples with XOR, and add It is added in the original face negative sample set, obtains final face negative sample set.
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 CN104112131A (en) 2014-10-22
CN104112131B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3158498A4 (en) * 2014-11-15 2017-08-16 Beijing Kuangshi Technology Co. Ltd. Face detection using machine learning
CN107729877B (en) 2017-11-14 2020-09-29 浙江大华技术股份有限公司 Face detection method and device based on cascade classifier
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
CN115050086B (en) * 2022-08-15 2022-11-04 北京百度网讯科技有限公司 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

Also Published As

Publication number Publication date
CN104112131A (en) 2014-10-22

Similar Documents

Publication Publication Date Title
CN104112131B (en) Method and device for generating training samples used for face detection
CN108875633B (en) Expression detection and expression driving method, device and system and storage medium
CN103810504B (en) Image processing method and device
CN107766842B (en) Gesture recognition method and application thereof
CN108805068A (en) A kind of motion assistant system, method, apparatus and medium based on student movement
CN106874826A (en) Face key point-tracking method and device
CN103198330B (en) Real-time human face attitude estimation method based on deep video stream
WO2007120558A3 (en) Image classification based on a mixture of elliptical color models
Jiang et al. Online robust action recognition based on a hierarchical model
CN104268514A (en) Gesture detection method based on multi-feature fusion
CN107301200A (en) A kind of article appraisal procedure and system analyzed based on Sentiment orientation
CN110163567A (en) Classroom roll calling system based on multitask concatenated convolutional neural network
WO2022178833A1 (en) Target detection network training method, target detection method, and apparatus
CN107491543A (en) A kind of client-based calligraphy auxiliary exercise method and system
CN107066979A (en) A kind of human motion recognition method based on depth information and various dimensions convolutional neural networks
CN109388725A (en) The method and device scanned for by video content
JP2010128633A (en) Information presentation device, method and program
Wang et al. Distortion recognition for image quality assessment with convolutional neural network
Liu et al. Trampoline motion decomposition method based on deep learning image recognition
Hsieh et al. A distance computer vision assisted yoga learning system
CN110298345A (en) A kind of area-of-interest automatic marking method of medical images data sets
Boychuk et al. An exploratory sentiment and facial expressions analysis of data from photo-sharing on social media: The case of football violence
CN106485226A (en) A kind of video pedestrian detection method based on neutral net
CN112801092B (en) Method for detecting character elements in natural scene image
CN103093467A (en) Shot boundary detection method based on double detection model

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