CN110070076A - Method and apparatus for choosing trained sample - Google Patents

Method and apparatus for choosing trained sample Download PDF

Info

Publication number
CN110070076A
CN110070076A CN201910379575.1A CN201910379575A CN110070076A CN 110070076 A CN110070076 A CN 110070076A CN 201910379575 A CN201910379575 A CN 201910379575A CN 110070076 A CN110070076 A CN 110070076A
Authority
CN
China
Prior art keywords
sample
face datection
result information
trained
datection model
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
CN201910379575.1A
Other languages
Chinese (zh)
Other versions
CN110070076B (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910379575.1A priority Critical patent/CN110070076B/en
Publication of CN110070076A publication Critical patent/CN110070076A/en
Application granted granted Critical
Publication of CN110070076B publication Critical patent/CN110070076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

Embodiment of the disclosure discloses the method and apparatus for choosing trained sample.One specific embodiment of this method includes: to obtain Face datection model trained in advance;First sample set is obtained, the sample that first sample is concentrated includes input picture and the corresponding actually detected result information of input picture;For the sample that first sample is concentrated, the input picture in the sample is input to Face datection model, obtains the corresponding output test result information of input picture in the sample;Determine whether the deviation between the actually detected result information in the sample and output test result information is less than preset threshold;In response to determining that the actually detected result information in the sample and the deviation between output test result information are not less than preset threshold, chooses the sample and be used as trained sample.And then can use the training sample selected, Face datection model is further adjusted, so that Face datection model adjusted has better detection effect, reduces false detection rate.

Description

Method and apparatus for choosing trained sample
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to for choosing the method and dress of trained sample It sets.
Background technique
In the practical application of Face datection, the actually detected result of Face datection model it sometimes appear that mistake feelings Condition.For example, being by non-face image-region (such as showing the image-region of the face of animal, non-face image region) error detection Show the image-region of face.
Based on this, how further to improve the testing result of Face datection model, to reduce the erroneous detection of Face datection model Rate is the one aspect that related technical personnel endeavour research.
Summary of the invention
Embodiment of the disclosure proposes the method and apparatus for choosing trained sample.
In a first aspect, embodiment of the disclosure provides a kind of method for choosing trained sample, this method comprises: Obtain Face datection model trained in advance;Obtain first sample set, wherein the sample that first sample is concentrated includes input picture Actually detected result information corresponding with input picture;For the sample that first sample is concentrated, by the input picture in the sample It is input to Face datection model, obtains the corresponding output test result information of input picture in the sample;It determines in the sample Actually detected result information and output test result information between deviation whether be less than preset threshold;In response to determining the sample The deviation between actually detected result information and output test result information in this is not less than preset threshold, chooses sample work For trained sample.
In some embodiments, the above method further include: based on the training sample chosen from first sample concentration to people Face detection model is trained, to update Face datection model.
In some embodiments, Face datection model is obtained based on the training of the second sample set;And it is based on from first sample The training chosen is concentrated to be trained with sample to Face datection model, to update Face datection model, comprising: will be from the first sample The training that this concentration is chosen is added to the second sample set with sample, obtains the second new sample set;Based on obtained new second Sample set is trained Face datection model, to update Face datection model.
In some embodiments, Face datection model is obtained based on the training of preset loss function, and in the second sample set First category sample relative to loss function value weight no more than the second category in the second sample set sample phase For the weight of the value of loss function, wherein the number of the sample of the first category in the second sample set is greater than the second sample set In second category sample number.
In some embodiments, loss function includes Focal Loss.
Second aspect, embodiment of the disclosure provide a kind of for choosing the device of trained sample, which includes: Acquiring unit is configured to obtain Face datection model trained in advance;Above-mentioned acquiring unit is further configured to acquisition One sample set, wherein the sample that first sample is concentrated includes input picture and the corresponding actually detected result information of input picture; Selection unit is configured to the sample concentrated for first sample, the input picture in the sample is input to Face datection mould Type obtains the corresponding output test result information of input picture in the sample;Determine the actually detected result letter in the sample Whether the deviation between breath and output test result information is less than preset threshold;In response to determining the actually detected knot in the sample Deviation between fruit information and output test result information is not less than preset threshold, chooses the sample and is used as trained sample.
In some embodiments, above-mentioned apparatus further include: updating unit is configured to be based on to concentrate from first sample to choose Training Face datection model is trained with sample, to update Face datection model.
In some embodiments, Face datection model is obtained based on the training of the second sample set;And above-mentioned updating unit into One step is configured to: the training chosen will be concentrated to be added to the second sample set with sample from first sample, is obtained the second new sample This collection;Face datection model is trained based on obtained the second new sample set, to update Face datection model.
In some embodiments, Face datection model is obtained based on the training of preset loss function, and in the second sample set First category sample relative to loss function value weight no more than the second category in the second sample set sample phase For the weight of the value of loss function, wherein the number of the sample of the first category in the second sample set is greater than the second sample set In second category sample number.
In some embodiments, loss function includes Focal Loss.
The third aspect, embodiment of the disclosure provide a kind of server, which includes: one or more processing Device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, make Obtain method of the one or more processors realization as described in implementation any in first aspect.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program, The method as described in implementation any in first aspect is realized when the computer program is executed by processor.
The method and apparatus for choosing trained sample that embodiment of the disclosure provides, according to Face datection model pair The testing result of some samples, the sample for choosing Face datection model erroneous detection are used as trained sample.Due to the training selected With sample it is the image of current Face datection model difficulty detection, therefore can use the training sample selected, further Face datection model is adjusted, so that Face datection model adjusted is larger for testing result and true testing result deviation Image have good detection effect.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for choosing trained sample of the disclosure;
Fig. 3 is the flow chart according to another embodiment of the method for choosing trained sample of the disclosure;
Fig. 4 is according to an embodiment of the present disclosure for choosing the signal of an application scenarios of the method for trained sample Figure;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for choosing trained sample of the disclosure;
Fig. 6 is adapted for the structural schematic diagram for realizing the electronic equipment of embodiment of the disclosure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the disclosure for choosing the method for trained sample or for choosing trained sample Device embodiment exemplary architecture 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
Terminal device 101,102,103 is interacted by network 104 with server 105, to receive or send message etc..Terminal Various client applications can be installed in equipment 101,102,103.For example, the application of browser class, searching class application, Instant Messenger Letter tool, image processing class application etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard When part, it can be various electronic equipments, including but not limited to smart phone, tablet computer, E-book reader, on knee portable Computer and desktop computer etc..When terminal device 101,102,103 is software, above-mentioned cited electricity may be mounted at In sub- equipment.Multiple softwares or software module may be implemented into (such as providing multiple softwares of Distributed Services or soft in it Part module), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be to provide the server of various services, for example, be installed on terminal device 101,102,103 For Face datection application provide support back-end server.Server 105 can adopt terminal device 101,102,103 Multiple samples of collection are respectively processed, to obtain the corresponding testing result of each sample.Later, server 105 can be with According to the corresponding testing result of each sample and the corresponding true testing result of each sample, selected from each sample The sample for taking corresponding testing result and true testing result to differ greatly is used as trained sample.Further, server 105 Can the training based on selection Face datection model is trained with sample to update Face datection model.
Server 105 is local also to have can store multiple samples.At this point, server 105 can directly extract local deposited Multiple samples of storage are respectively processed.At this point it is possible to which terminal device 101,102,103 is not present
It should be noted that for choosing the method for trained sample generally by servicing provided by embodiment of the disclosure Device 105 executes, and correspondingly, the device for choosing training sample is generally positioned in server 105.
It should be noted that server 105 can be hardware, it is also possible to software.It, can when server 105 is hardware To be implemented as the distributed server cluster that multiple servers form, individual server also may be implemented into.When server 105 is When software, multiple softwares or software module may be implemented into (such as providing multiple softwares of Distributed Services or software mould Block), single software or software module also may be implemented into.It is not specifically limited herein.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates one embodiment according to the method for choosing trained sample of the disclosure Process 200.This be used for choose trained sample method the following steps are included:
Step 201, Face datection model trained in advance is obtained.
In the present embodiment, for choosing the executing subject (server 105 as shown in Figure 1) of the method for trained sample Face datection model trained in advance can be obtained from local or other storage equipment.
Wherein, Face datection model can be used for detecting face.The specific detection effect of Face datection model can basis Application scenarios it is different and different.For example, Face datection model can be specifically used for whether detection input picture shows Face.Face datection model can also be specifically used for the position for the face that detection input picture is shown.
The method that Face datection model can be in advance based on machine learning by technical staff utilizes the training of a large amount of training samples It obtains.What Face datection model was also possible to obtain from the platform of some open sources has trained the Face datection model completed.
Step 202, first sample set is obtained.
In the present embodiment, above-mentioned executing subject can be from local, other storage equipment (terminal device as shown in Figure 1 101,102,103) or in the database of connection first sample set is obtained.Wherein, the sample that first sample is concentrated may include defeated Enter image and the corresponding actually detected result information of input picture.
Wherein, actually detected result information can serve to indicate that input picture is corresponding, true testing result.For example, Actually detected result information can serve to indicate that the position of face that input picture is shown in the input image.
Actually detected result information can be labeled to obtain to input picture in advance by technical staff.Actual result information Also it can use the higher Face datection model of some Detection accuracies to obtain.
For example, Face datection model can be respectively applied to PC (Personal Computer, individual calculus under some cases Machine) end and mobile terminal.And due to the one of the attribute of mobile terminal itself (such as memory capacity, computing capability, power consumption ability) A little limitations, the detectability that will lead to the applicable Face datection model of mobile terminal institute are examined compared to the applicable face of the end PC institute The detectability for surveying model is poor.At this point, it is corresponding to obtain input picture using the Face datection model applied to the end PC Testing result information, and using obtained testing result information as the corresponding actually detected result information of input picture.
Step 203, the sample concentrated for first sample executes following steps 2031-2033:
Step 2031, the input picture in the sample is input to Face datection model, obtains the input figure in the sample As corresponding output test result information.
In this step, output test result information can serve to indicate that Face datection model was obtained for input picture Testing result.It should be appreciated that under different application scenarios, testing result indicated by output test result information can be with It is different.For example, output test result information, which can serve to indicate that, shows face under application scenes in input picture Probability.In another example the face that output test result information can serve to indicate that input picture is shown exists under application scenes Position in image.
It should be appreciated that under different application scenarios, actually detected result information and output test result information tool There is corresponding relationship.For example, output test result information can serve to indicate that the probability that face is shown in input picture, then, Corresponding actually detected result information then can serve to indicate that the true probability that face is shown in input picture.
Step 2032, determining the deviation between the actually detected result information in the sample and output test result information is It is no to be less than preset threshold.
In this step, it is desirable that output test result information should be consistent with actually detected result information.Therefore, people The detection effect of face detection model is better, and the deviation between output test result information and actually detected result information should be got over It is small.
Preset threshold can be configured by technical staff previously according to actual application demand.Actually detected result information Deviation between output test result information, which is less than preset threshold, can then indicate Face datection model to defeated in the sample The testing result for entering image is preferable.It can indicate that the input picture in the sample is the figure that Face datection model is easy detection Picture.
On the contrary, the deviation between actually detected result information and output test result information then may be used not less than preset threshold To indicate that Face datection model is poor to the testing result of input picture.It can indicate that the input picture in the sample is face The image of the more difficult detection of detection model.
It should be appreciated that the deviation between actually detected result information and output test result information can be according to not With the specific representation of result information actually detected under application scenarios and output test result information, select different modes true It is fixed.
For example, when whether Face datection model shows face for detecting input picture, actually detected result Information and output test result information can be specific numerical value, for indicating that input picture shows the probability value of face.This When, it can use the absolute value of the difference of actually detected result information and the corresponding two values of output test result information to indicate Deviation between actually detected result information and output test result information.
For example, when Face datection model is used to detect the position for the face that input picture is shown, actually detected knot Fruit information and output test result information can be the triple for indicating detection block.Wherein, detection block can refer to input figure The image-region where face as shown in.One of element of triple can be used to indicate that a specified top of detection block The coordinate of point, one of element of triple can be used to indicate that the length of detection block, and another element of triple can be with For indicating the width of detection block.At this point, being directed to actually detected result information and output test result information corresponding three Tuple.It can first determine the coordinate of the geometric center point for the detection block that two triples indicate respectively, calculate two ternarys later The area for the detection block that group indicates respectively can use the absolute value of the difference of calculated two areas later, and calculated The sum of the distance of two coordinates indicates the deviation between actually detected result information and output test result information.
Step 2033, in response to determining the actually detected result information in the sample and between output test result information Deviation chooses the sample and is used as trained sample not less than preset threshold is met.
In this step, if between actually detected result information and corresponding output test result information in the sample Deviation is not less than and meets preset threshold, it can indicates that the input picture in the sample is the figure of the more difficult detection of Face datection model Picture.Therefore, the sample can be chosen and be used as trained sample, to improve Face datection model to the sample based on training sample In input picture detectability.
It is alternatively possible to based on concentrating the training chosen to be trained with sample to Face datection model from first sample, To update Face datection model.Since current Face datection model is poor to the testing result of the training sample selected, Therefore, directly Face datection model further can be trained with sample using the training chosen, so that Face datection Model learning detects the ability of these training samples, to obtain updated Face datection model.
Under some cases, since the number of the training sample selected may be less, so that utilizing these selections When training out is again trained Face datection model with sample, training effect is poor to get the updated face arrived Improving for testing result and the detection effect of the true biggish image of testing result deviation for detection model is smaller.In addition, by In being only trained with sample to Face datection model with the training chosen, it is possible that updated Face datection model pair The detection effect of the training sample of selection is preferable, and weakens to the detectability for the image for being easy detection before.
Based on this, it may be considered that on the basis of the training sample of selection, be further added by some training samples.Such side Face can guarantee that the number of training sample will not be very little, on the other hand can guarantee in training sample will not only detection in distress figure Picture.
For example, some training samples can be obtained from some open sources ground data platform, then with the training sample of selection Training sample set is formed, and the training sample concentrated using the training sample is trained Face datection model.
It is alternatively possible to which the training to selection carries out signature analysis with sample, then chooses training that is some and choosing and use The higher image of the similarity of sample is also used as training sample.It is then possible to which it is unselected to choose some and first sample concentration The higher image of similarity of sample be also used as training sample.Later, the training sample that can be integrated is to Face datection Model is further trained.
Wherein, image characteristic analysis is a kind of field of image processing commonly image analysis means.It is therefore possible to use existing The various image characteristics extractions having and analysis method (such as Principal Component Analysis, core principle component analysis method) are to trained sample Carry out signature analysis.
Optionally, Face datection model can be is assembled for training based on the second sample for being different from first sample set described above It gets.Herein, the difference of the second sample set and first sample set is it is to be understood that training sample in the second sample set The training sample concentrated with first sample is entirely different.Alternatively, it is also understood that being the training sample in the second sample set and The training sample that one sample is concentrated is not quite similar, that is, some proper subclass of the second sample set can be first sample set simultaneously A proper subclass.At this point it is possible to which the training of selection is directly added to the second sample set with sample, the second new sample is obtained Collection.And then Face datection model can be trained based on obtained the second new sample set, to update Face datection model, So that updated Face datection model is on the basis of improving to the detectability of the training sample of selection, still Keep the detectability to former training sample.
In some cases, due to the acquisition difficulty of different types of sample, it will lead to the simple sample in the second sample set This is more, and difficult sample may be less.Wherein, simple sample can refer to that Face datection model is easy the sample of detection.Difficult sample It can refer to that Face datection model is not easy the sample of detection.And it utilizes selected by the method provided by the above embodiment of the disclosure The training sample that sample is that Face datection model is not easy detection.Therefore, based on the provided by the above embodiment of the disclosure Method can effectively increase the number of difficult sample.
In addition, since the training that selects with sample is image that current Face datection model is not easy detection, It can use the training sample selected, Face datection model further adjusted, so that Face datection model adjusted There is good detection effect for the image of difficult detection before.
With further reference to Fig. 3, it illustrates the processes of another embodiment of the method for choosing trained sample 300.This is used to choose the process 300 of the method for trained sample, comprising the following steps:
Step 301, obtain Face datection model trained in advance, wherein Face datection model be based on the second sample set and Preset loss function training obtains, and weight of the sample of the first category in the second sample set relative to the value of loss function No more than the second category in the second sample set sample relative to loss function value weight.
In this step, loss function can be preset by technical staff.First category and second category can bases Actual application demand is divided.Wherein, the number of the sample of the first category in the second sample set can be greater than the second sample The number of the sample of the second category of this concentration.As an example, the image of first category can refer to that Face datection model is easy inspection The image of survey, the image of second category can refer to the image of Face datection model difficulty detection.
Wherein, the image for being easy detection can refer to Face datection model to the testing result and true testing result of the image Between deviation it is smaller (such as less than preset threshold).Accordingly, the image of difficult detection can refer to Face datection model to the image Testing result and true testing result between deviation it is larger (such as larger than preset threshold).
Due to it is possible that the number of sample different classes of in the second sample set differs larger situation, to just hold It is preferable compared with a kind of detection effect of the image of classification of multisample to correspondence to easily lead to the Face datection model trained, and to right Answer the detection effect of the image of another classification of less sample poor.
Therefore, while the first kind can be reduced by increasing the sample of second category for the weight of the value of loss function Other sample is to the weight of loss function, the instruction of the samples of the two categories in the second sample set of Lai Pingheng to Face datection model Experienced influence.
It is alternatively possible to based on Bootstrapping algorithm, OHEM (Online Hard Example Mining) etc. come The samples of the two categories in the second sample set is balanced to the weight of the value of loss function.
Optionally, loss function includes Focal Loss.Focal Loss be on the basis of cross entropy loss function into The adjustment of one step, it is unbalance with the sample proportion for solving the problems, such as different classes of in training process.Specifically, Focal Loss is being marked The index of modulation is increased on the basis of quasi- cross entropy loss function.Inhibit the sample of first category corresponding by the index of modulation Weight, so that number of the corresponding weight of the sample of first category with the number of the sample of first category and the sample of second category The increase of purpose ratio and decay.
Therefore, the sample of first category and the sample of second category can preferably be measured to total using Focal Loss The influence of the value of loss function, so that the corresponding weight of the sample for reducing first category, enables model more special in training It infuses in the processing of the sample of second category.
By influence of the sample to loss function of the two categories in the second sample set of balance, can to train The sample of the Face datection model second category less to number of samples also can be handled preferably, to reduce Face datection model False detection rate.
Step 302, first sample set is obtained.
Step 303, the sample concentrated for first sample executes following steps 3031-3033:
Step 3031, the input picture in the sample is input to Face datection model, obtains the input figure in the sample As corresponding output test result information.
Step 3032, determining the deviation between the actually detected result information in the sample and output test result information is It is no to be less than preset threshold.
Step 3033, in response to determining the actually detected result information in the sample and between output test result information Deviation chooses the sample and is used as trained sample not less than preset threshold is met.
Step 304, the training chosen will be concentrated to be added to the second sample set with sample from first sample, obtains new second Sample set.
Step 305, Face datection model is trained based on obtained the second new sample set, to update Face datection Model.
It should be noted that in addition in above-mentioned steps 301 about the related content of loss function other than other parts in The specific implementation procedure held can refer to the related description in Fig. 2 corresponding embodiment, and details are not described herein.
It is the one of the application scenarios of the method according to the present embodiment for choosing trained sample with continued reference to Fig. 4, Fig. 4 A schematic diagram 400.In the application scenarios of Fig. 4, the people obtained based on the second sample set 401 and Focal Loss training is first obtained Face detection model 402, and obtain first sample set 403.Wherein, the sample in first sample set 403 include input picture and The corresponding actually detected result information of input picture.Each sample in first sample set 403 is separately input into Face datection Model 402 obtains the corresponding output test result information of each sample.
It is illustrated using a sample 4031 in first sample set 403 as example: by the input figure in sample 4031 As 40311 are input to Face datection model 402, the corresponding output test result information 404 of input picture 40311 is obtained.Later, Determining the deviation between output test result information 404 and the corresponding actually detected result information 40312 of input picture 40311 When not less than preset threshold 405, chooses sample 4031 and be used as trained sample, and sample 4031 is added to the second sample set In 401.
Similarly, other samples in first sample set 403 are handled, therefrom selects all corresponding output inspections The deviation surveyed between result information and actually detected result information is not less than the sample of preset threshold, and is added to the second sample set In 401, the second new sample set 406 is obtained.It later, can be based on obtained new the second sample set 406 training Face datection Model 402, to obtain updated Face datection model 407.
It is trained that the utilization of process 300 of the method for choosing trained sample in the present embodiment is based on Focal Loss The Face datection model arrived concentrates the sample for selecting Face datection model difficulty and detecting from first sample, thus on the one hand can be with Influence of the sample of the two categories for training the second training sample of face detection model to concentrate to loss function is balanced, from And guarantee accuracy of the face detection model to the testing result of the sample of two categories.On the other hand it can use trained Face datection model increases the number of the sample of difficult detection.And then the sample of obtained difficult detection can be added to the second training Sample set is further to train Face datection model, to enhance Face datection model to the detectability of the sample of hardly possible detection.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides for choosing trained use One embodiment of the device of sample, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be with Applied in various electronic equipments.
As shown in figure 5, the device 500 provided in this embodiment for choosing trained sample includes 501 He of acquiring unit Selection unit 502.Wherein, acquiring unit 501 is configured to obtain Face datection model trained in advance, and obtains the first sample This collection, wherein the sample that first sample is concentrated includes input picture and the corresponding actually detected result information of input picture.It chooses Unit 502 is configured to the sample concentrated for first sample, and the input picture in the sample is input to Face datection model, Obtain the corresponding output test result information of input picture in the sample;Determine actually detected result information in the sample and Whether the deviation between output test result information is less than preset threshold;In response to determining the actually detected result letter in the sample Deviation between breath and output test result information is not less than preset threshold, chooses the sample and is used as trained sample.
In the present embodiment, in the device 500 for choosing trained sample: acquiring unit 501 and selection unit 502 Specific processing and its brought technical effect can be respectively with reference to step 201, step 202 and the steps in Fig. 2 corresponding embodiment 203 related description, details are not described herein.
In some optional implementations of the present embodiment, the above-mentioned device 500 for choosing training sample is also wrapped Include: updating unit (not shown) is configured to based on the training sample chosen from first sample concentration to Face datection mould Type is trained, to update Face datection model.
In some optional implementations of the present embodiment, Face datection model is based on the training of the second sample set and obtains; And above-mentioned updating unit is further configured to: the training chosen will be concentrated to be added to the second sample with sample from first sample Collection, obtains the second new sample set;Face datection model is trained based on obtained the second new sample set, with more new person Face detection model.
In some optional implementations of the present embodiment, it is trained that Face datection model is based on preset loss function It arrives, and the sample of the first category in the second sample set is not more than in the second sample set relative to the weight of the value of loss function Weight of the sample of second category relative to the value of loss function, wherein the number of the sample of the first category in the second sample set Mesh is greater than the number of the sample of the second category in the second sample set.
In some optional implementations of the present embodiment, loss function includes Focal Loss.
The device provided by the above embodiment of the disclosure obtains Face datection model trained in advance by acquiring unit, And obtain first sample set, wherein the sample that first sample is concentrated includes input picture and the corresponding practical inspection of input picture Survey result information;Input picture in the sample is input to Face datection by the sample that selection unit concentrates first sample Model obtains the corresponding output test result information of input picture in the sample;Determine the actually detected result in the sample Whether the deviation between information and output test result information is less than preset threshold;It is actually detected in the sample in response to determining Deviation between result information and output test result information is not less than preset threshold, chooses the sample and is used as trained sample. Since the training that selects is the image of current Face datection model difficulty detection with sample, the instruction selected can use Experienced sample further adjusts Face datection model, so that the figure of Face datection model adjusted difficult detection for before As having good detectability.
Below with reference to Fig. 6, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1 Server) 600 structural schematic diagram.Server shown in Fig. 6 is only an example, should not be to the function of embodiment of the disclosure Any restrictions can be brought with use scope.
As shown in fig. 6, electronic equipment 600 may include processing unit (such as central processing unit, graphics processor etc.) 601, random access can be loaded into according to the program being stored in read-only memory (ROM) 602 or from storage device 608 Program in memory (RAM) 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with electronic equipment Various programs and data needed for 600 operations.Processing unit 601, ROM 602 and RAM 603 pass through the phase each other of bus 604 Even.Input/output (I/O) interface 605 is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 606 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 607 of dynamic device etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.Communication device 609, which can permit electronic equipment 600, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 6 shows tool There is the electronic equipment 600 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.Each box shown in Fig. 6 can represent a device, can also root According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608 It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the implementation of the disclosure is executed The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that computer-readable medium described in embodiment of the disclosure can be computer-readable signal Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between Matter can also be any computer-readable medium other than computer readable storage medium, which can be with It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned server;It is also possible to individualism, and without It is incorporated in the server.Above-mentioned computer-readable medium carries one or more program, when said one or multiple journeys When sequence is executed by the server, so that the server: obtaining Face datection model trained in advance;First sample set is obtained, In, the sample that first sample is concentrated includes input picture and the corresponding actually detected result information of input picture;For the first sample Input picture in the sample is input to Face datection model, obtains the input picture pair in the sample by the sample of this concentration The output test result information answered;It determines inclined between the actually detected result information in the sample and output test result information Whether difference is less than preset threshold;In response to determining the actually detected result information in the sample and between output test result information Deviation be not less than preset threshold, choose the sample be used as trained sample.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof The computer program code of work, described program design language include object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet Include local area network (LAN) or wide area network (WAN) --- it is connected to subscriber computer, or, it may be connected to outer computer (such as It is connected using ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor Including acquiring unit and selection unit.Wherein, the title of these units is not constituted to the unit itself under certain conditions It limits, for example, acquiring unit is also described as " obtaining the unit of Face datection model trained in advance ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member it should be appreciated that embodiment of the disclosure involved in invention scope, however it is not limited to the specific combination of above-mentioned technical characteristic and At technical solution, while should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its be equal Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.

Claims (12)

1. a kind of method for choosing trained sample, comprising:
Obtain Face datection model trained in advance;
Obtain first sample set, wherein the sample that the first sample is concentrated includes input picture and the corresponding reality of input picture Border testing result information;
For the sample that the first sample is concentrated, the input picture in the sample is input to the Face datection model, is obtained To the corresponding output test result information of input picture in the sample;Determine the actually detected result information in the sample and institute State whether the deviation between output test result information is less than preset threshold;In response to determining the actually detected result in the sample Deviation between information and the output test result information is not less than preset threshold, chooses the sample and is used as trained sample.
2. according to the method described in claim 1, wherein, the method also includes:
Based on concentrating the training chosen to be trained with sample to the Face datection model from the first sample, to update State Face datection model.
3. according to the method described in claim 2, wherein, the Face datection model is based on the training of the second sample set and obtains;With And
It is described that the Face datection model is trained with sample based on the training chosen from first sample concentration, with more The new Face datection model, comprising:
The training chosen will be concentrated to be added to second sample set with sample from the first sample, obtains the second new sample Collection;
The Face datection model is trained based on obtained the second new sample set, to update the Face datection mould Type.
4. according to the method described in claim 3, wherein, it is trained that the Face datection model is based on preset loss function It arrives, and the weight of value of the sample of the first category in second sample set relative to the loss function is no more than described the Weight of the sample of second category in two sample sets relative to the value of the loss function, wherein in second sample set First category sample number be greater than second sample set in second category sample number.
5. according to the method described in claim 4, wherein, the loss function includes Focal Loss.
6. a kind of for choosing the device of trained sample, comprising:
Acquiring unit is configured to obtain Face datection model trained in advance;
The acquiring unit is further configured to obtain first sample set, wherein the sample that the first sample is concentrated includes Input picture and the corresponding actually detected result information of input picture;
Selection unit is configured to the sample concentrated for the first sample, the input picture in the sample is input to institute Face datection model is stated, the corresponding output test result information of input picture in the sample is obtained;Determine the reality in the sample Whether the deviation between border testing result information and the output test result information is less than preset threshold;In response to determining the sample The deviation between actually detected result information and the output test result information in this is not less than preset threshold, chooses the sample The trained sample of this conduct.
7. device according to claim 6, wherein described device further include:
Updating unit is configured to based on the training sample chosen from first sample concentration to the Face datection model It is trained, to update the Face datection model.
8. device according to claim 7, wherein the Face datection model is based on the training of the second sample set and obtains;With And
The updating unit is further configured to:
The training chosen will be concentrated to be added to second sample set with sample from the first sample, obtains the second new sample Collection;
The Face datection model is trained based on obtained the second new sample set, to update the Face datection mould Type.
9. device according to claim 8, wherein it is trained that the Face datection model is based on preset loss function It arrives, and the weight of value of the sample of the first category in second sample set relative to the loss function is no more than described the Weight of the sample of second category in two sample sets relative to the value of the loss function, wherein in second sample set First category sample number be greater than second sample set in second category sample number.
10. device according to claim 9, wherein the loss function includes Focal Loss.
11. a kind of server, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor Such as method as claimed in any one of claims 1 to 5.
CN201910379575.1A 2019-05-08 2019-05-08 Method and device for selecting training samples Active CN110070076B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910379575.1A CN110070076B (en) 2019-05-08 2019-05-08 Method and device for selecting training samples

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910379575.1A CN110070076B (en) 2019-05-08 2019-05-08 Method and device for selecting training samples

Publications (2)

Publication Number Publication Date
CN110070076A true CN110070076A (en) 2019-07-30
CN110070076B CN110070076B (en) 2021-05-18

Family

ID=67370363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910379575.1A Active CN110070076B (en) 2019-05-08 2019-05-08 Method and device for selecting training samples

Country Status (1)

Country Link
CN (1) CN110070076B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807523A (en) * 2019-10-23 2020-02-18 中科智云科技有限公司 Method and equipment for generating detection model of similar target
CN111428783A (en) * 2020-03-23 2020-07-17 支付宝(杭州)信息技术有限公司 Method and device for performing sample domain conversion on training samples of recommendation model
CN112561389A (en) * 2020-12-23 2021-03-26 北京元心科技有限公司 Method and device for determining equipment detection result and electronic equipment
CN113420174A (en) * 2021-05-25 2021-09-21 北京百度网讯科技有限公司 Difficult sample mining method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831153A (en) * 2012-06-28 2012-12-19 北京奇虎科技有限公司 Method and device for selecting sample
CN107358209A (en) * 2017-07-17 2017-11-17 成都通甲优博科技有限责任公司 Training method, device and method for detecting human face, the device of Face datection model
CN107690659A (en) * 2016-12-27 2018-02-13 深圳前海达闼云端智能科技有限公司 A kind of image identification system and image-recognizing method
CN107958235A (en) * 2017-12-28 2018-04-24 泰康保险集团股份有限公司 A kind of facial image detection method, device, medium and electronic equipment
EP3336800A1 (en) * 2016-12-19 2018-06-20 Siemens Healthcare GmbH Determination of a training function for generating annotated training images
CN108229268A (en) * 2016-12-31 2018-06-29 商汤集团有限公司 Expression Recognition and convolutional neural networks model training method, device and electronic equipment
CN108305248A (en) * 2018-01-17 2018-07-20 慧影医疗科技(北京)有限公司 It is a kind of fracture identification model construction method and application
CN108596184A (en) * 2018-04-25 2018-09-28 清华大学深圳研究生院 Training method, readable storage medium storing program for executing and the electronic equipment of image, semantic parted pattern
CN108803555A (en) * 2018-03-20 2018-11-13 北京航空航天大学 A kind of inferior health online recognition and diagnostic method based on performance monitoring data

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831153A (en) * 2012-06-28 2012-12-19 北京奇虎科技有限公司 Method and device for selecting sample
EP3336800A1 (en) * 2016-12-19 2018-06-20 Siemens Healthcare GmbH Determination of a training function for generating annotated training images
CN107690659A (en) * 2016-12-27 2018-02-13 深圳前海达闼云端智能科技有限公司 A kind of image identification system and image-recognizing method
CN108229268A (en) * 2016-12-31 2018-06-29 商汤集团有限公司 Expression Recognition and convolutional neural networks model training method, device and electronic equipment
CN107358209A (en) * 2017-07-17 2017-11-17 成都通甲优博科技有限责任公司 Training method, device and method for detecting human face, the device of Face datection model
CN107958235A (en) * 2017-12-28 2018-04-24 泰康保险集团股份有限公司 A kind of facial image detection method, device, medium and electronic equipment
CN108305248A (en) * 2018-01-17 2018-07-20 慧影医疗科技(北京)有限公司 It is a kind of fracture identification model construction method and application
CN108803555A (en) * 2018-03-20 2018-11-13 北京航空航天大学 A kind of inferior health online recognition and diagnostic method based on performance monitoring data
CN108596184A (en) * 2018-04-25 2018-09-28 清华大学深圳研究生院 Training method, readable storage medium storing program for executing and the electronic equipment of image, semantic parted pattern

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ABHINAV SHRIVASTAVA等: "Training Region-Based Object Detectors with Online Hard Example Mining", 《2016 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION》 *
TSUNG-YI LIN等: "Focal Loss for Dense Object Detection", 《2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION》 *
魏京欢: "面向移动终端的人脸活体检测技术研究", 《中国优秀硕士学位论文全文数据库》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807523A (en) * 2019-10-23 2020-02-18 中科智云科技有限公司 Method and equipment for generating detection model of similar target
CN110807523B (en) * 2019-10-23 2022-08-05 中科智云科技有限公司 Method and equipment for generating detection model of similar target
CN111428783A (en) * 2020-03-23 2020-07-17 支付宝(杭州)信息技术有限公司 Method and device for performing sample domain conversion on training samples of recommendation model
CN111428783B (en) * 2020-03-23 2022-06-21 支付宝(杭州)信息技术有限公司 Method and device for performing sample domain conversion on training samples of recommendation model
CN112561389A (en) * 2020-12-23 2021-03-26 北京元心科技有限公司 Method and device for determining equipment detection result and electronic equipment
CN112561389B (en) * 2020-12-23 2023-11-10 北京元心科技有限公司 Method and device for determining detection result of equipment and electronic equipment
CN113420174A (en) * 2021-05-25 2021-09-21 北京百度网讯科技有限公司 Difficult sample mining method, device, equipment and storage medium
CN113420174B (en) * 2021-05-25 2024-01-09 北京百度网讯科技有限公司 Difficult sample mining method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110070076B (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN109508681A (en) The method and apparatus for generating human body critical point detection model
CN110070076A (en) Method and apparatus for choosing trained sample
CN108898185A (en) Method and apparatus for generating image recognition model
CN109858445A (en) Method and apparatus for generating model
CN109002842A (en) Image-recognizing method and device
CN108985208A (en) The method and apparatus for generating image detection model
CN109389640A (en) Image processing method and device
CN108038880A (en) Method and apparatus for handling image
CN109308490A (en) Method and apparatus for generating information
CN108121800A (en) Information generating method and device based on artificial intelligence
CN109993150A (en) The method and apparatus at age for identification
CN109389072A (en) Data processing method and device
CN109815365A (en) Method and apparatus for handling video
CN109086780A (en) Method and apparatus for detecting electrode piece burr
CN109063653A (en) Image processing method and device
CN109409364A (en) Image labeling method and device
CN108427941A (en) Method, method for detecting human face and device for generating Face datection model
CN109242801A (en) Image processing method and device
CN108509916A (en) Method and apparatus for generating image
CN108509921A (en) Method and apparatus for generating information
CN110298850A (en) The dividing method and device of eye fundus image
CN110009059A (en) Method and apparatus for generating model
CN110110666A (en) Object detection method and device
CN108446659A (en) Method and apparatus for detecting facial image
CN110427915A (en) Method and apparatus for output information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.