CN109376267A - Method and apparatus for generating model - Google Patents

Method and apparatus for generating model Download PDF

Info

Publication number
CN109376267A
CN109376267A CN201811273684.7A CN201811273684A CN109376267A CN 109376267 A CN109376267 A CN 109376267A CN 201811273684 A CN201811273684 A CN 201811273684A CN 109376267 A CN109376267 A CN 109376267A
Authority
CN
China
Prior art keywords
sample
model
initial model
training
subset
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
CN201811273684.7A
Other languages
Chinese (zh)
Other versions
CN109376267B (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 CN201811273684.7A priority Critical patent/CN109376267B/en
Publication of CN109376267A publication Critical patent/CN109376267A/en
Application granted granted Critical
Publication of CN109376267B publication Critical patent/CN109376267B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the present application discloses the method and apparatus for generating model.One specific embodiment of this method includes: acquisition sample set;Extract the part sample composition subset in the sample set, it executes following training step: the sample in the subset is input to initial model, the markup information that sample in information and the subset based on initial model output is had, determines the penalty values of each sample inputted;The penalty values that destination number is chosen according to the sequence of penalty values from small to large, are determined as target loss value for the average value of selected penalty values;Based on the target loss value, determine whether initial model trains completion;If so, the initial model after training is determined as object module.This embodiment improves the accuracys of model generated.

Description

Method and apparatus for generating model
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for generating model.
Background technique
In machine learning field, it usually needs carry out model training using sample set.However, for carrying out model training Sample set in, many samples have noise.As an example, training is for detecting video classification (for example, being divided into high quality Video class, low quality video class) model when, it is obtained to be normally based on click volume for used sample set.Click volume is high Video be commonly labeled as high-quality video, the low video of click volume is commonly labeled as low quality video.However, there is also Certain low quality videos are due to click volume larger the case where being marked as high-quality video.For example, the publisher of low quality video With more follower, cause video click volume larger.Concurrently there are certain high-quality videos due to click volume is smaller but by The case where labeled as low quality video.For example, since supplying system failure causes high-quality video not to be pushed.
Relevant mode is not considered sample noise usually, directly utilizes sample set, carried out in the way of supervised learning Model training.
Summary of the invention
The embodiment of the present application proposes the method and apparatus for generating model.
In a first aspect, the embodiment of the present application provides a kind of method for generating model, this method comprises: obtaining sample Collection, wherein the sample in sample set has markup information;The part sample extracted in sample set forms subset, executes following instruction Practice step: the sample in subset is input to initial model, the sample institute band in information and subset based on initial model output Some markup informations determine the penalty values of each sample inputted;Destination number is chosen according to the sequence of penalty values from small to large Penalty values, the average value of selected penalty values is determined as target loss value, wherein destination number be less than subset in sample This quantity;Based on target loss value, determine whether initial model trains completion;If so, the initial model after training is determined For object module.
In some embodiments, this method further include: in response to determining that initial model not complete by training, is based on target loss Value updates the parameter in initial model, determines in sample set with the presence or absence of the sample for being not carried out training step;It is deposited in response to determination It is being not carried out in the sample of training step and is extracting sample composition subset, the initial model after using undated parameter is as initially Model continues to execute training step.
In some embodiments, this method further include: there is no be not carried out training step in sample set in response to determining Sample, determines whether destination number is less than default value;In response to determine destination number be less than default value, by destination number with The sum of designated value is used as destination number, and the initial model after using undated parameter extracts in sample set again as initial model Part sample form subset, continue to execute training step.
In some embodiments, this method further include: in response to determining that destination number is not less than default value, use update For initial model after parameter as initial model, the part sample extracted in sample set again forms subset, continues to execute training Step.
In some embodiments, the initial value of destination number be the quantity of the sample in the subset formed for the first time two/ One.
In some embodiments, initial model obtains as follows: machine learning method is utilized, it will be in sample set Sample is as input, and using the markup information of the sample inputted as output, training obtains initial model.
In some embodiments, the sample in sample set is Sample video, and the markup information that sample is had is used to indicate The classification of Sample video, object module are for detecting the other video classification detection model of video class.
Second aspect, the embodiment of the present application provide it is a kind of for generating the device of model, the device include: obtain it is single Member is configured to obtain sample set, wherein the sample in sample set has markup information;Training unit is configured to extract sample The part sample of this concentration forms subset, executes following training step: the sample in subset is input to initial model, based on just The markup information that sample in the information and subset of the output of beginning model is had, determines the penalty values of each sample inputted;It presses The penalty values that destination number is chosen according to the sequence of penalty values from small to large, are determined as target for the average value of selected penalty values Penalty values, wherein destination number is less than the quantity of the sample in subset;Based on target loss value, determine whether initial model instructs Practice and completes;If so, the initial model after training is determined as object module.
In some embodiments, device further include: the first determination unit is configured in response to determine initial model not Training is completed, and target loss value is based on, and updates the parameter in initial model, and determining, which whether there is in sample set, is not carried out trained step Rapid sample;First execution unit is configured in response to determine presence, is not carried out in the sample of training step and extracts sample Subset is formed, the initial model after using undated parameter continues to execute training step as initial model.
In some embodiments, device further include: the second determination unit is configured in response to determine in sample set not In the presence of the sample for being not carried out training step, determine whether destination number is less than default value;Second execution unit is configured to ring Default value should be less than in determining destination number, regard the sum of destination number and designated value as destination number, use undated parameter For initial model afterwards as initial model, the part sample extracted in sample set again forms subset, continues to execute training step.
In some embodiments, device further include: third execution unit is configured in response to determine destination number not Less than default value, the initial model after using undated parameter extracts the part sample in sample set as initial model again Subset is formed, training step is continued to execute.
In some embodiments, the initial value of destination number be the quantity of the sample in the subset formed for the first time two/ One.
In some embodiments, initial model obtains as follows: machine learning method is utilized, it will be in sample set Sample is as input, and using the markup information of the sample inputted as output, training obtains initial model.
In some embodiments, the sample in sample set is Sample video, and the markup information that sample is had is used to indicate The classification of Sample video, object module are for detecting the other video classification detection model of video class.
The third aspect, the embodiment of the present application provide a kind of for detecting video class method for distinguishing, comprising: receive target view Frequently;The video classification that frame input in target video is generated using the method as described in the embodiment in above-mentioned first aspect Detection model obtains video classification testing result.
Fourth aspect, the embodiment of the present application provide a kind of for detecting the other device of video class, comprising: receiving unit, It is configured to receive target video;Input unit is configured to the frame input in target video using such as above-mentioned first aspect In embodiment described in method generate video classification detection model, obtain video classification testing result.
5th aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: one or more processors;Storage dress Set, be stored thereon with one or more programs, when one or more programs are executed by one or more processors so that one or Multiple processors realize the method such as any embodiment in above-mentioned first aspect and the third aspect.
6th aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should The method such as any embodiment in above-mentioned first aspect and the third aspect is realized when program is executed by processor.
Method and apparatus provided by the embodiments of the present application for generating model can be mentioned therefrom by obtaining sample set This composition subset is sampled to carry out the training of initial model.Wherein, the sample in sample set has markup information.In this way, will mention The sample in subset taken is input to initial model, can obtain the corresponding information of each sample of initial model output.Later, Markup information that information based on initial model output, the sample in extracted subset are had can be determined and be inputted The penalty values of each sample.Then, destination number can be chosen according to the sequence of penalty values from small to large (less than the sample in subset Quantity) penalty values, the average value of selected penalty values is determined as target loss value.Later, it can be damaged based on target Mistake value determines whether initial model trains completion.If initial model training is completed, so that it may which the initial model after training is true It is set to object module.Since the penalty values of usual noise sample are larger, thus, mesh is chosen according to the sequence of penalty values from small to large The penalty values for marking quantity (less than the quantity of the sample in subset) carry out the training of initial model, can screen out the shadow of noise sample It rings, improves the accuracy of model generated.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for generating model of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the method for generating model of the application;
Fig. 4 is the flow chart according to another embodiment of the method for generating model of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for generating model of the application;
Fig. 6 is the flow chart for being used to detect one embodiment of video class method for distinguishing according to the application;
Fig. 7 is the structural schematic diagram for being used to detect one embodiment of the other device of video class according to the application;
Fig. 8 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application 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 features in the embodiments and the embodiments of the present application can phase Mutually combination.The application 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 application for generating the method for model or the example of the device for generating model Property system 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..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications can be installed, such as video record class is answered on terminal device 101,102,103 With the application of, video playback class, the application of interactive voice class, searching class application, instant messaging tools, mailbox client, social platform Software 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 the various electronic equipments with display screen, including but not limited to smart phone, tablet computer, 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 (such as providing Distributed Services) may be implemented into it, also may be implemented into Single software or software module.It is not specifically limited herein.
When terminal device 101,102,103 is hardware, it is also equipped with image capture device thereon.Image Acquisition is set It is standby to can be the various equipment for being able to achieve acquisition image function, such as camera, sensor.User can use terminal device 101, the image capture device on 102,103, to acquire video.
Server 105 can be to provide the server of various services, such as carrying out data storage and data processing Data processing server.Sample set is can store in data processing server.It may include a large amount of sample in sample set.Its In, the sample in above-mentioned sample set can have markup information.In addition, data processing server can use the sample in sample set This, is trained initial model, and training result (such as the object module generated) can be stored.In this way, can benefit Corresponding data processing is carried out with the object module trained to realize function that the object module is supported.
It should be noted that server 105 can be hardware, it is also possible to software.When server is hardware, Ke Yishi The distributed server cluster of ready-made multiple server compositions, also may be implemented into individual server.When server is software, Multiple softwares or software module (such as providing Distributed Services) may be implemented into, single software or soft also may be implemented into Part module.It is not specifically limited herein.
It should be noted that the method provided by the embodiment of the present application for generating model is generally held by server 105 Row, correspondingly, the device for generating model is generally positioned in server 105.
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, the process of one embodiment of the method for generating model according to the application is shown 200.The method for being used to generate model, comprising the following steps:
Step 201, sample set is obtained.
It in the present embodiment, can be with for generating the executing subject (such as server 105 shown in FIG. 1) of the method for model Obtain sample set in several ways.For example, executing subject can by wired connection mode or radio connection, from It is obtained in another server (such as database server) of storage sample and is stored in existing sample set therein.Example again Such as, user can collect sample by terminal device (such as terminal device shown in FIG. 1 101,102,103).In this way, above-mentioned Executing subject can receive sample collected by terminal, and these samples are stored in local, to generate sample set.It needs to refer to Out, above-mentioned radio connection can include but is not limited to 3G/4G connection, WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection and other currently known or exploitation in the future radio connections.
It herein, may include a large amount of sample in sample set.Wherein, the sample in above-mentioned sample set can be with mark letter Breath.It should be noted that the sample in sample set can obtain according to actual needs.For example, if desired train one can be into The model of row image category detection, then the sample in sample set can be sample image, and markup information, which can be, is used to indicate figure The mark of the classification of picture.For another example if desired training the model for being able to carry out Face datection, then the sample in sample set can To be sample facial image, the position that markup information can be the face object region being used to indicate in sample image is believed Breath.
Step 202, the part sample extracted in sample set forms subset.
In the present embodiment, part sample is extracted in the sample set that executing subject can be obtained from step 201 to form Subset, and execute the training step of step 203 to step 206.Wherein, the extracting mode of sample is in this application and unlimited System.For example, it is also possible to which a certain number of samples that need to currently extract are extracted according to designated order from sample set.
In machine learning field, the subset for extracting sample composition every time is properly termed as minibatch (mini crowd It is secondary).The behavior that traversal completes all samples in sample set can be called an epoch (period).As an example, sample set In have 128000 samples, wherein 128 samples composition subset can be chosen every time, carry out the training of model.In sample set 128000 samples can successively form 1000 subsets.After each subset use, then it is assumed that have passed through an epoch.It needs It is noted that different epoch, can extract the sample composition subset of different number.For example, first epoch, it can be with every It is secondary to extract 128 data composition subsets.Second epoch can extract 256 data composition subsets every time.
Since the sample size in usual sample set is larger, in each round training, if in disposable sample set Whole samples, then time-consuming larger, treatment effeciency is lower.The part sample chosen in sample set herein forms subset, in training, Each subset carries out a subgradient decline, has finally traversed the sample in sample set, so that the data volume of iteration is smaller every time. Therefore, time-consuming can be reduced, improve treatment effeciency.
Step 203, the sample in subset is input to initial model, in information and subset based on initial model output The markup information that sample is had determines the penalty values of each sample inputted.
In the present embodiment, above-mentioned executing subject can first input the sample in subset composed in step 202 To initial model.Wherein, initial model can carry out the processing such as feature extraction, analysis, and then output information to sample.It needs Bright, above-mentioned initial model can be the model pre-established as needed, be also possible to existing to some as needed Model carries out obtained model after initial training.For example, if desired training one to be able to carry out image category detection or text The model of this classification detection, then can be used existing disaggregated model as initial model.As an example, existing disaggregated model The convolutional neural networks of various existing structures (such as DenseBox, VGGNet, ResNet, SegNet etc.) can be used.? Support vector machines (Support Vector Machine, SVM) etc. can be used.
After the sample in extracted subset is input to initial model, above-mentioned executing subject can extract introductory die The information that type is exported.Wherein, each sample inputted can correspond to the information of initial model output.For example, sub 128 samples are concentrated with, then one-to-one 128 information of 128 samples that initial model can be exported and be inputted.
Then, the mark that above-mentioned executing subject can be had based on the sample in the information and the subset that initial model exports Information is infused, determines the penalty values of each sample inputted.Herein, the target of training initial model is the information for being allowed to export and institute The difference for the markup information that the sample of input is had is as small as possible.Therefore, it will can be used to characterize the letter of initial model output The value of the difference of breath and markup information is as penalty values.In practice, various existing loss function (loss can be used Function), come characterize initial model output information and markup information difference.It, will for each sample inputted The information corresponding with the sample of initial model output and the markup information of the sample are input to loss function, and the sample can be obtained This penalty values.
In practice, loss function can be the predicted value (information exported) and true value for estimating initial model The inconsistent degree of (i.e. markup information).It is a non-negative real-valued function.Under normal circumstances, the value (penalty values) of loss function Smaller, the robustness of model is better.Loss function can be arranged according to actual needs.For example, it may be using Euclidean away from From, cross entropy loss function etc..
In some optional implementations of the present embodiment, above-mentioned initial model is also possible to as needed to building in advance Vertical model carries out obtained model after initial training.Specifically, above-mentioned initial model obtains as follows: Ke Yili With machine learning method, using the sample in above-mentioned sample set as input, using the markup information of the sample inputted as exporting, Training obtains initial model.Herein, existing model structure can be used to be trained to obtain initial model.As an example, if Training one model for image category detection is needed, then can use corresponding sample set, (sample is that can be image, sample This markup information can serve to indicate that the classification of image), in the way of supervised learning, convolutional neural networks are carried out preliminary Training.Convolutional neural networks after initial training are determined as initial model.Specifically, sample can be successively extracted from sample set This is to constitute subset, after being trained using the sample in each subset, can use gradient descent algorithm and carries out to model It is primary to update.The model that above-mentioned executing subject is trained when the sample in sample set can be traversed and be completed is determined as initially Model.
Step 204, the penalty values that destination number is chosen according to the sequence of penalty values from small to large, by selected penalty values Average value be determined as target loss value.
In the present embodiment, above-mentioned executing subject can choose the damage of destination number according to the sequence of penalty values from small to large The average value of selected penalty values is determined as target loss value by mistake value.Wherein, destination number is less than step 202 and is formed Subset in sample quantity.In practice, target loss value is the penalty values of the extracted subset.It can be for difference Training round, preset different destination numbers.Alternatively, it is also possible to set fixed value for destination number.
Since the penalty values of usual noise sample are larger, thus, number of targets is chosen according to the sequence of penalty values from small to large The penalty values for measuring (less than the quantity of the sample in subset) carry out the training of initial model, can screen out the influence of noise sample, Help to improve the accuracy of model generated.
In some optional implementations of the present embodiment, destination number can be set in advance for trained round It is fixed.Round is bigger, and destination number is bigger.For example, destination number can be set for first round training (i.e. first epoch) It is set to 64.Training (i.e. second epoch) is taken turns for second, destination number can be set to 66.(i.e. for third round training Third epoch), destination number can be set to 68.For another example for first round training, destination number can be set It is 64.For the second wheel training, destination number can be set to 68.For third round training, destination number can be set It is 70.
In some optional implementations of the present embodiment, destination number can also be based on preset initial value and training Round and calculate automatically.Round is bigger, and destination number is bigger.For example, can be using pre-set initial value as the first round Destination number used in training.Then, for later each round training, can determine last round of training round and some The sum of the product and initial value are determined as destination number used in wheel training by the product of specified numerical value.For example, the first round Training, destination number are initial value 64.Second wheel training, destination number are 66 (64+1 × 2).Third round training, destination number For 68 (64+2 × 2).And so on.
In some optional implementations of the present embodiment, the initial value of destination number can be the subset formed for the first time In sample quantity half.
Since in initial model training process, usually with the increase of training round, the performance of initial model (is predicted Accuracy) usually become better and better, the calculated penalty values of institute are more and more accurate.For showing preferable model, noise sample Penalty values it is usually larger.After being ranked up penalty values from small to large, the order of noise sample is more rearward.However, When iteration round is lower, the penalty values that initial model is exported may be not accurate enough.It is inadequate so as to cause the order of noise sample Rearward.Lesser number is set by destination number at this time, can effectively screen out the penalty values of noise sample.Help to improve model Training effect, make training after model have preferably performance.Therefore, destination number is set as increasing with training round And the numerical value increased, the accuracy of model generated can be improved.
Step 205, it is based on target loss value, determines whether initial model trains completion.
In the present embodiment, above-mentioned executing subject can be based on target loss value, and benefit determines initial model in various manners Whether completion is trained.As an example, above-mentioned executing subject can determine whether target loss value has restrained.When determining target loss When value convergence, then it can determine that initial model at this time has trained completion.As another example, above-mentioned executing subject can be first Target loss value is compared with preset value.In response to determining that target loss value is less than or equal to preset value, can count most In target loss value determined by close preset quantity (such as 100) secondary training step, less than or equal to the mesh of above-mentioned preset value The quantity of mark penalty values accounts for the ratio of the preset quantity.When the ratio is greater than preset ratio (such as 95%), can determine just Beginning model training is completed.It should be noted that preset value can be generally used for indicating inconsistent between predicted value and true value The ideal situation of degree.That is, when penalty values are less than or equal to preset value, it is believed that predicted value is nearly or approximately true Real value.Preset value can be arranged according to actual needs.
It should be noted that can then continue to execute step 206 in response to determining that initial model has trained completion.Response In determining that initial model not complete by training, the target loss value based on determined by step 204 updates the ginseng in initial model Number, extracts sample composition subset again from above-mentioned sample set, initial model after using undated parameter as initial model, after It is continuous to execute above-mentioned training step.Herein, it can use back-propagation algorithm and acquire ladder of the target loss value relative to model parameter Degree is then based on gradient updating model parameter using gradient descent algorithm.It should be pointed out that the penalty values that do not choose are not involved in Gradient decline.It should be noted that above-mentioned back-propagation algorithm, gradient descent algorithm and machine learning method are extensive at present The well-known technique of research and application, details are not described herein.
It is above-mentioned to hold in response to determining that initial model not complete by training in some optional implementations of the present embodiment Row main body can be based on above-mentioned target loss value, update the parameter in initial model.And it is possible to which determining in above-mentioned sample set is It is no to there is the sample for being not carried out above-mentioned training step.It is understood that when there is the sample for being not carried out training step in sample set This, it is meant that epicycle (current epoch) training does not complete, i.e., the sample in epicycle sample set does not traverse completion.At this point it is possible to from It is not carried out in the sample of above-mentioned training step and extracts sample composition subset, initial model after using undated parameter is as introductory die Type continues to execute above-mentioned training step.In general, in same wheel (same epoch) training process, the quantity of the sample extracted every time (quantity of the sample in subset formed every time) can be identical.Therefore, the quantity of sample extracted here can be with It is identical as the quantity of the sample extracted in step 202.
Optionally, in response in the above-mentioned sample set of determination there is no the sample of above-mentioned training step is not carried out, i.e., epicycle (when Preceding epoch) training be completed and epicycle sample set in sample traversed completion.Can then determine whether destination number is small In default value.As an example, default value can be set to be less than the sample if the quantity of the sample in subset is 128 The value of quantity, such as 110 or 120.It, can be by destination number and designated value in response to determining that destination number is less than default value The sum of (such as 2) are used as destination number, and the initial model after using undated parameter extracts above-mentioned sample as initial model again The part sample of concentration forms subset, continues to execute above-mentioned training step.It is understood that since a training in rotation being completed at this time Practice, therefore, it is to carry out next round training that the part sample composition subset extracted again in above-mentioned sample set herein, which is trained,.
Optionally, in response to determining that destination number is not less than above-mentioned default value, update is can be used in above-mentioned executing subject Initial model after parameter extracts the part sample composition subset in above-mentioned sample set again, continues to execute as initial model Above-mentioned training step.It is understood that since wheel training being completed at this time, extract above-mentioned sample set again herein In part sample composition subset be trained, be carry out next round training.
Step 206, in response to determining that initial model training is completed, the initial model after training is determined as object module.
In the present embodiment, in response to determine initial model training complete, above-mentioned executing subject can will after training at the beginning of Beginning model is determined as object module.
In some optional implementations of the present embodiment, the sample in above-mentioned sample set is Sample video, sample institute The markup information having is used to indicate the classification of Sample video, and above-mentioned object module is for detecting the other video classification of video class Detection model.
In some optional implementations of the present embodiment, object module can be stored in this by above-mentioned executing subject Ground can also send it to other electronic equipments (such as terminal device shown in FIG. 1 101,102,103).
With continued reference to the signal that Fig. 3, Fig. 3 are according to the application scenarios of the method for generating model of the present embodiment Figure.In the application scenarios of Fig. 3, in the application scenarios of Fig. 3, mould can be installed on terminal device 301 used by a user Type training class application.When user opens the application, and after uploading the store path of sample set or sample set, after providing the application The server 302 that platform is supported can run the method for generating model, comprising:
It is possible, firstly, to obtain sample set.Wherein, the sample in above-mentioned sample set has markup information.
Then, the part sample composition subset 303 in above-mentioned sample set is extracted, executes following training step: by subset 303 In sample be input to initial model 304, the mark that the information based on initial model output, the sample in subset 303 are had Information determines the penalty values of each sample inputted.Then, destination number can be chosen according to the sequence of penalty values from small to large Penalty values, the average value of selected penalty values is determined as target loss value 305, wherein destination number is less than selected Penalty values quantity.Then, it can be based on above-mentioned target loss value, determine whether initial model trains completion.If it is determined that instruction Practice and complete, the initial model after training can be determined as object module 306.
The method provided by the above embodiment of the application can therefrom extract sample composition subset by obtaining sample set To carry out the training of initial model.Wherein, the sample in sample set has markup information.In this way, by the sample in the subset of extraction Originally it is input to initial model, the corresponding information of each sample of initial model output can be obtained.Later, defeated based on initial model The markup information that sample in information out, extracted subset is had, can determine the penalty values of each sample inputted. Then, the loss of destination number (less than the quantity of the sample in subset) can be chosen according to the sequence of penalty values from small to large Value, is determined as target loss value for the average value of selected penalty values.Later, introductory die can be determined based on target loss value Whether type trains completion.If initial model training is completed, so that it may which the initial model after training is determined as object module.By It is larger in the penalty values of usual noise sample, thus, destination number, which is chosen, according to the sequence of penalty values from small to large (is less than subset In sample quantity) penalty values carry out initial model training, the influence of noise sample can be screened out, improve and generated Model accuracy.
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of the method for generating model.The use In the process 400 for the method for generating model, comprising the following steps:
Step 401, sample set is obtained.
It in the present embodiment, can be with for generating the executing subject (such as server 105 shown in FIG. 1) of the method for model Obtain sample set.It herein, may include a large amount of sample in sample set.Wherein, the sample in above-mentioned sample set can be with mark Infuse information.
In the present embodiment, the sample in above-mentioned sample set can be Sample video, and the markup information that sample is had can To be used to indicate the classification of Sample video,
Step 402, the part sample extracted in sample set forms subset.
In the present embodiment, part sample is extracted in the sample set that executing subject can be obtained from step 401 to form Subset, and execute the training step of step 403 to step 411.Wherein, the extracting mode of sample is in this application and unlimited System.For example, the sample that need to currently extract can be extracted according to designated order from sample set.
Step 403, the sample in subset is input to initial model, the information and extracted based on initial model output The markup information that sample in subset is had determines the penalty values of each sample inputted.
In the present embodiment, above-mentioned executing subject can first input the sample in subset composed in step 402 To initial model.Then, the information that initial model is exported can be extracted.Wherein, each sample inputted can correspond to The information of one initial model output.Then, it can be had based on the sample in the information and the subset that initial model exports Markup information, determine the penalty values of each sample inputted.It should be noted that the calculating operation of penalty values and step 203 In it is documented operation it is essentially identical, details are not described herein again.
In the present embodiment, above-mentioned initial model can be initial training is carried out to the model that pre-establishes as needed after Obtained model.Specifically, above-mentioned initial model obtains as follows: it can use machine learning method, it will be above-mentioned Sample in sample set is as input, and using the markup information of the sample inputted as output, training obtains initial model.This Place, can be used existing model structure and is trained to obtain initial model.
In the present embodiment, the model for being used to carry out video classification detection can be trained.Above-mentioned executing subject can be with In the way of supervised learning, initial training is carried out to convolutional neural networks.Convolutional neural networks after training are determined as just Beginning model.It should be noted that each subset traversal is completed, then it can use gradient descent algorithm and model carried out once more Newly.The model that above-mentioned executing subject is trained when the sample in sample set can be traversed and be completed is determined as initial model.
Step 404, the penalty values that destination number is chosen according to the sequence of penalty values from small to large, by selected penalty values Average value be determined as target loss value.
In the present embodiment, above-mentioned executing subject can choose the damage of destination number according to the sequence of penalty values from small to large The average value of selected penalty values is determined as target loss value by mistake value.Wherein, destination number can be less than step 402 institute The quantity of sample in the subset of composition.Since the penalty values of usual noise sample are larger, thus, from small to large according to penalty values Sequence choose destination number penalty values carry out initial model training, the influence of noise sample can be screened out, help to mention The accuracy of high model generated.
In the present embodiment, destination number can also be calculated automatically based on preset initial value and the round trained.Wheel Secondary bigger, destination number is bigger.For example, can be using pre-set initial value as the first round (i.e. first epoch) training Used destination number.Herein, the initial value of destination number can be the two of the quantity of the sample in the subset formed for the first time / mono-.It then, can be by destination number used in last round of training and some specified number for each round training later The sum of value (such as 2) is determined as destination number used in wheel training.For example, first round training, destination number is initial value 64.Second wheel training, destination number are 66 (64+2).Third round training, destination number are 68 (66+2).And so on, until When destination number reaches default value (such as 110).After destination number reaches default value, in each round training later In, no longer destination number can be updated.
Since in initial model training process, usually with the increase of training round, the performance of initial model (is predicted Accuracy) usually become better and better, the calculated penalty values of institute are more and more accurate.For showing preferable model, noise sample Penalty values it is usually larger.After being ranked up penalty values from small to large, the order of noise sample is more rearward.However, When iteration round is lower, the penalty values that initial model is exported may be not accurate enough.It is inadequate so as to cause the order of noise sample Rearward.Lesser number is set by destination number at this time, can effectively screen out the penalty values of noise sample.Help to improve model Training effect, make training after model have preferably performance.Therefore, destination number is set as increasing with training round And the numerical value increased, the accuracy of model generated can be improved.
Step 405, it is based on target loss value, determines whether initial model trains completion.
In the present embodiment, above-mentioned executing subject can be based on target loss value, and benefit determines initial model in various manners Whether completion is trained.As an example, above-mentioned executing subject can determine whether target loss value has restrained.When determining target loss When value convergence, then it can determine that initial model at this time has trained completion.
It should be noted that can then continue to execute step 411 in response to determining that initial model training is completed.In response to Determine that initial model not complete by training, can execute step 406.
Step 406, in response to determining that initial model not complete by training, is based on target loss value, updates in initial model Parameter determines in sample set with the presence or absence of the sample for being not carried out above-mentioned training step.
In the present embodiment, in response to determining that initial model not complete by training, above-mentioned executing subject can be based on above-mentioned mesh Penalty values are marked, the parameter in initial model is updated.Herein, it can use back-propagation algorithm and acquire target loss value relative to mould The gradient of shape parameter is then based on gradient updating model parameter using gradient descent algorithm.It should be pointed out that the damage that do not choose Mistake value is not involved in gradient decline.It should be noted that above-mentioned back-propagation algorithm, gradient descent algorithm and machine learning method It is the well-known technique studied and applied extensively at present, details are not described herein.At the same time, can determine in above-mentioned sample set whether In the presence of the sample for being not carried out above-mentioned training step.If it exists, step 407 can be executed, if it does not exist, step 408 can be executed.
Step 407, in response to determining the sample for existing in sample set and being not carried out training step, training step is not carried out Sample is extracted in sample and forms subset, and the initial model after using undated parameter continues to execute training step as initial model.
It is understood that when there is the sample for being not carried out training step in sample set, it is meant that epicycle (current epoch) Training does not complete, i.e., the sample in epicycle sample set does not traverse completion.At this point it is possible to which the sample of above-mentioned training step is not carried out Middle extraction sample forms subset, and the initial model after using undated parameter continues to execute above-mentioned training step as initial model.
Step 408, in response to, there is no the sample for being not carried out above-mentioned training step, determining target in the above-mentioned sample set of determination Whether quantity is less than default value.
In the present embodiment, the sample of above-mentioned training step is not carried out in response to being not present in the above-mentioned sample set of determination, on Stating executing subject can determine whether current destination number is less than default value.As an example, if the number of the sample in subset Amount is 128, then default value can be set to the value less than the sample size, such as 110 or 120.In response to determining target Quantity is less than default value, can execute step 409.In response to determining that destination number is not less than default value, step can be performed 410。
Step 409, in response to determining that destination number is less than default value, the sum of destination number and designated value are regard as target Quantity, for the initial model after using undated parameter as initial model, the part sample extracted in sample set again forms subset, Continue to execute training step.
In the present embodiment, in response to determining that destination number is less than default value, above-mentioned executing subject can be by number of targets The sum of amount and designated value (such as 2) are used as destination number, and the initial model after using undated parameter mentions again as initial model It takes the part sample in above-mentioned sample set to form subset, continues to execute above-mentioned training step.It is understood that due at this time A wheel training is completed, therefore, it is to carry out down that the part sample composition subset extracted again in above-mentioned sample set herein, which is trained, One wheel training.
Step 410, in response to determining that destination number is not less than above-mentioned default value, the initial model after undated parameter is used As initial model, the part sample composition subset in above-mentioned sample set is extracted again, continues to execute above-mentioned training step.
In the present embodiment, in response to determining that destination number is not less than above-mentioned default value, above-mentioned executing subject can make Initial model after using undated parameter extracts the part sample composition subset in above-mentioned sample set as initial model again, after It is continuous to execute above-mentioned training step.It is understood that since wheel training being completed at this time, it extracts again herein above-mentioned Part sample composition subset in sample set is trained, and is to carry out next round training.It should be noted that training at this time Destination number used in journey is without updating.
Step 411, in response to determining that initial model training is completed, the initial model after training is determined as object module.
In the present embodiment, in response to determine initial model training complete, above-mentioned executing subject can will after training at the beginning of Beginning model is determined as object module.Herein, above-mentioned object module is for detecting the other video classification detection model of video class.
Figure 4, it is seen that the method for generating model compared with the corresponding embodiment of Fig. 2, in the present embodiment Process 400 relate in the training process, gradually increase destination number, that is, gradually increase the quantity of selected penalty values Operation.Thus, it is possible to further increase the accuracy of model generated.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides one kind for generating mould One embodiment of the device of type, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer For in various electronic equipments.
As shown in figure 5, being used to generate the device 500 of model described in the present embodiment includes: acquiring unit 501, it is configured At acquisition sample set, wherein the sample in above-mentioned sample set has markup information;Training unit 502 is configured to extract above-mentioned Part sample in sample set forms subset, executes following training step: the sample in above-mentioned subset is input to initial model, The markup information that sample in information, above-mentioned subset based on initial model output is had, determines each sample inputted Penalty values;The penalty values that destination number is chosen according to the sequence of penalty values from small to large, by the average value of selected penalty values It is determined as target loss value, wherein destination number is less than the quantity of the sample in above-mentioned subset;Based on above-mentioned target loss value, Update the parameter in initial model;Determine whether initial model trains completion;If so, the initial model after training is determined as mesh Mark model.
In some optional embodiments of the present embodiment, which further includes the first determination unit and the first execution unit (not shown).Wherein, above-mentioned first determination unit may be configured in response to determining that initial model not complete by training, really With the presence or absence of the sample for being not carried out above-mentioned training step in fixed above-mentioned sample set.Above-mentioned first execution unit may be configured to ring Should exist in determining, be not carried out in the sample of above-mentioned training step and extract sample composition subset, using first after undated parameter Beginning model continues to execute above-mentioned training step as initial model.
In some optional embodiments of the present embodiment, which further includes the second determination unit and the second execution unit (not shown).Wherein, above-mentioned second determination unit is configured in response to determine in above-mentioned sample set that there is no be not carried out The sample of above-mentioned training step, determines whether destination number is less than default value;Second execution unit is configured in response to really The quantity that sets the goal is less than default value, the sum of destination number and preset quantity is regard as destination number, after undated parameter Initial model extracts the part sample composition subset in above-mentioned sample set again, continues to execute above-mentioned training as initial model Step.
In some optional embodiments of the present embodiment, which further includes third execution unit (not shown). Wherein, above-mentioned third execution unit is configured in response to determine that destination number not less than above-mentioned default value, is joined using updating Initial model after number extracts the part sample composition subset in above-mentioned sample set again, continues to execute as initial model State training step.
In some optional embodiments of the present embodiment, the initial value of destination number can be in the subset formed for the first time Sample quantity half.
In some optional embodiments of the present embodiment, initial model can obtain as follows: utilize machine Learning method, it is trained using the markup information of the sample inputted as exporting using the sample in above-mentioned sample set as input To initial model.
In some optional embodiments of the present embodiment, the sample in above-mentioned sample set can be Sample video, sample The markup information being had can serve to indicate that the classification of Sample video, and above-mentioned object module can be for for detecting video classification Video classification detection model.
The device provided by the above embodiment of the application obtains sample set by acquiring unit 501, can therefrom extract sample This composition subset is to carry out the training of initial model.Wherein, the sample in sample set has markup information.In this way, training unit Sample in the subset of extraction is input to initial model by 502, can obtain the corresponding letter of each sample of initial model output Breath.Later, the mark letter that the sample in training unit 502 is exported based on initial model information, extracted subset is had Breath, can determine the penalty values of each sample inputted.Then, number of targets can be chosen according to the sequence of penalty values from small to large The penalty values for measuring (less than the quantity of the sample in subset), are determined as target loss value for the average value of selected penalty values. Later, it can determine whether initial model trains completion based on target loss value.If initial model training is completed, so that it may will Initial model after training is determined as object module.Since the penalty values of usual noise sample are larger, thus, according to penalty values from The small penalty values for choosing destination number (less than the quantity of the sample in subset) to big sequence carry out the training of initial model, can To screen out the influence of noise sample, the accuracy of model generated is improved.
Fig. 6 is referred to, it illustrates provided by the present application for detecting the stream of one embodiment of video class method for distinguishing Journey 600.This is used to detect video class method for distinguishing and may comprise steps of:
Step 601, target video is received.
In the present embodiment, for detecting the other executing subject of video class (such as server shown in FIG. 1 105, Huo Zhecun Contain other servers of video classification detection model) it can use wired connection or radio connection, it receives terminal and sets Target video transmitted by standby (such as terminal device shown in FIG. 1 101,102,103).
Step 602, by the frame input video classification detection model in target video, video classification testing result is obtained.
In the present embodiment, the frame input video classification in above-mentioned target video can be detected mould by above-mentioned executing subject Type obtains video classification testing result.Video classification detection model can be using the generation as described in above-mentioned Fig. 2 embodiment The method of object module and generate.Specific generating process may refer to the associated description of Fig. 2 embodiment, and details are not described herein again. Video classification testing result can serve to indicate that the classification of target video
In some optional implementations of the present embodiment, above-mentioned executing subject is obtaining video classification testing result Afterwards, target video can be stored in video library corresponding with classification indicated by the video classification testing result.
The present embodiment can be used for detecting the classification of video for detecting video class method for distinguishing, can be improved video classification The accuracy of detection.
With continued reference to Fig. 7, as the realization to method shown in above-mentioned Fig. 6, this application provides one kind for detecting video One embodiment of the device of classification.The Installation practice is corresponding with embodiment of the method shown in fig. 6, which specifically can be with Applied in various electronic equipments.
As shown in fig. 7, being used to detect the other device 700 of video class described in the present embodiment includes: receiving unit 701, quilt It is configured to receive target video;Input unit 702 is configured to the frame input video classification in above-mentioned target video detecting mould Type obtains video classification testing result.
It is understood that all units recorded in the device 700 and each step phase in the method with reference to Fig. 6 description It is corresponding.As a result, above with respect to the operation of method description, the beneficial effect of feature and generation be equally applicable to device 700 and its In include unit, details are not described herein.
Below with reference to Fig. 8, it illustrates the computer systems 800 for the electronic equipment for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.Electronic equipment shown in Fig. 8 is only an example, function to the embodiment of the present application and should not use model Shroud carrys out any restrictions.
As shown in figure 8, computer system 800 includes central processing unit (CPU) 801, it can be read-only according to being stored in Program in memory (ROM) 802 or be loaded into the program in random access storage device (RAM) 803 from storage section 808 and Execute various movements appropriate and processing.In RAM 803, also it is stored with system 800 and operates required various programs and data. CPU 801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to always Line 804.
I/O interface 805 is connected to lower component: the importation 806 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 808 including hard disk etc.; And the communications portion 809 of the network interface card including LAN card, modem etc..Communications portion 809 via such as because The network of spy's net executes communication process.Driver 810 is also connected to I/O interface 805 as needed.Detachable media 811, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 810, in order to read from thereon Computer program be mounted into storage section 808 as needed.
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 communications portion 809, and/or from detachable media 811 are mounted.When the computer program is executed by central processing unit (CPU) 801, limited in execution the present processes Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above 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 may be programmed read-only deposit Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang Any appropriate combination stated.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, 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 the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include acquiring unit and training unit.Wherein, the title of these units does not constitute the limit to the unit itself under certain conditions It is fixed, for example, acquiring unit is also described as " obtaining the unit of sample set ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should Device: sample set is obtained;The part sample composition subset in the sample set is extracted, executes following training step: will be in the subset Sample be input to initial model, the markup information that the information based on initial model output, the sample in the subset are had, really The penalty values of the fixed each sample inputted;The penalty values of destination number are chosen according to the sequence of penalty values from small to large, it will be selected The average value of the penalty values taken is determined as target loss value;Based on the target loss value, the parameter in initial model is updated;It determines Whether initial model trains completion;If so, the initial model after training is determined as object module.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (18)

1. a kind of method for generating model, comprising:
Obtain sample set, wherein the sample in the sample set has markup information;
The part sample composition subset in the sample set is extracted, executes following training step: the sample in the subset is defeated Enter to initial model, the markup information that the sample in information and the subset based on initial model output is had determines institute The penalty values of each sample of input;The penalty values that destination number is chosen according to the sequence of penalty values from small to large, will be selected The average value of penalty values is determined as target loss value, wherein destination number is less than the quantity of the sample in the subset;Based on institute Target loss value is stated, determines whether initial model trains completion;If so, the initial model after training is determined as object module.
2. the method according to claim 1 for generating model, wherein the method also includes:
In response to determining that initial model not complete by training, is based on the target loss value, updates the parameter in initial model, determines With the presence or absence of the sample for being not carried out the training step in the sample set;
Exist in response to determining, is not carried out in the sample of the training step and extracts sample composition subset, use undated parameter Initial model afterwards continues to execute the training step as initial model.
3. the method according to claim 2 for generating model, wherein the method also includes:
In response to, there is no the sample for being not carried out the training step, determining whether destination number is less than in the determination sample set Default value;
In response to determining that destination number is less than default value, the sum of destination number and designated value are regard as destination number, using more Initial model after new parameter extracts the part sample composition subset in the sample set again, continues to hold as initial model The row training step.
4. the method according to claim 3 for generating model, wherein the method also includes:
In response to determining that destination number is not less than the default value, initial model after using undated parameter is as introductory die Type extracts the part sample composition subset in the sample set again, continues to execute the training step.
5. the method according to claim 3 for generating model, wherein the initial value of destination number forms for the first time The half of the quantity of sample in subset.
6. the method according to claim 1 for generating model, wherein initial model obtains as follows:
The markup information of the sample inputted is made using the sample in the sample set as input using machine learning method For output, training obtains initial model.
7. the method described in one of -6 for generating model according to claim 1, wherein the sample in the sample set is sample This video, the markup information that sample is had are used to indicate the classification of Sample video, and the object module is for detecting video The video classification detection model of classification.
8. a kind of for generating the device of model, comprising:
Acquiring unit is configured to obtain sample set, wherein the sample in the sample set has markup information;
Training unit is configured to extract the part sample composition subset in the sample set, executes following training step: by institute The sample stated in subset is input to initial model, what the sample in information and the subset based on initial model output was had Markup information determines the penalty values of each sample inputted;The damage of destination number is chosen according to the sequence of penalty values from small to large The average value of selected penalty values is determined as target loss value by mistake value, wherein destination number is less than the sample in the subset This quantity;Based on the target loss value, determine whether initial model trains completion;If so, by the initial model after training It is determined as object module.
9. according to claim 8 for generating the device of model, wherein described device further include:
First determination unit is configured in response to determine that initial model not complete by training, is based on the target loss value, updates Parameter in initial model determines in the sample set with the presence or absence of the sample for being not carried out the training step;
First execution unit is configured in response to determine presence, is not carried out in the sample of the training step and extracts sample Subset is formed, the initial model after using undated parameter continues to execute the training step as initial model.
10. according to claim 9 for generating the device of model, wherein described device further include:
Second determination unit is configured in response to determine in the sample set that there is no the samples for being not carried out the training step This, determines whether destination number is less than default value;
Second execution unit is configured in response to determine that destination number is less than default value, by destination number and designated value it With as destination number, the initial model after using undated parameter extracts the portion in the sample set as initial model again Divide sample to form subset, continues to execute the training step.
11. according to claim 10 for generating the device of model, wherein described device further include:
Third execution unit is configured in response to determine destination number not less than the default value, after undated parameter Initial model as initial model, extract again in the sample set part sample composition subset, continue to execute the instruction Practice step.
12. according to claim 10 for generating the device of model, wherein the initial value of destination number is first composition Subset in sample quantity half.
13. according to claim 8 for generating the device of model, wherein initial model obtains as follows:
The markup information of the sample inputted is made using the sample in the sample set as input using machine learning method For output, training obtains initial model.
14. for generating the device of model according to one of claim 8-13, wherein the sample in the sample set is Sample video, the markup information that sample is had are used to indicate the classification of Sample video, and the object module is to regard for detecting The video classification detection model of frequency classification.
15. one kind is for detecting video class method for distinguishing, comprising:
Receive target video;
Frame input in the target video is used into the video classification detection model generated the method for claim 7, Obtain video classification testing result.
16. one kind is for detecting the other device of video class, comprising:
Receiving unit is configured to receive target video;
Input unit is configured to the method for claim 7 generate the frame input use in the target video Video classification detection model obtains video classification testing result.
17. a kind of electronic equipment, 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 The now method as described in any in claim 1-7,15.
18. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor Method as described in any in claim 1-7,15.
CN201811273684.7A 2018-10-30 2018-10-30 Method and apparatus for generating a model Active CN109376267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811273684.7A CN109376267B (en) 2018-10-30 2018-10-30 Method and apparatus for generating a model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811273684.7A CN109376267B (en) 2018-10-30 2018-10-30 Method and apparatus for generating a model

Publications (2)

Publication Number Publication Date
CN109376267A true CN109376267A (en) 2019-02-22
CN109376267B CN109376267B (en) 2020-11-13

Family

ID=65390383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811273684.7A Active CN109376267B (en) 2018-10-30 2018-10-30 Method and apparatus for generating a model

Country Status (1)

Country Link
CN (1) CN109376267B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110251942A (en) * 2019-06-04 2019-09-20 腾讯科技(成都)有限公司 Control the method and device of virtual role in scene of game
CN110991312A (en) * 2019-11-28 2020-04-10 重庆中星微人工智能芯片技术有限公司 Method, apparatus, electronic device, and medium for generating detection information
WO2020087974A1 (en) * 2018-10-30 2020-05-07 北京字节跳动网络技术有限公司 Model generation method and device
CN111949860A (en) * 2019-05-15 2020-11-17 北京字节跳动网络技术有限公司 Method and apparatus for generating a relevance determination model
CN112397161A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, device and medium for generating an assay model
CN112397196A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method and device for generating image inspection recommendation model
CN112397195A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, electronic device, and medium for generating physical examination model
CN112397194A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, device and electronic equipment for generating patient condition attribution interpretation model
CN112397163A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, electronic device, and medium for generating case input model
CN112738793A (en) * 2020-12-29 2021-04-30 永辉云金科技有限公司 Equipment fingerprint generation method and device based on BP algorithm and storage medium
CN113344087A (en) * 2021-06-16 2021-09-03 安徽容知日新科技股份有限公司 Method for establishing sample set and computing equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080195577A1 (en) * 2007-02-09 2008-08-14 Wei Fan Automatically and adaptively determining execution plans for queries with parameter markers
CN107123089A (en) * 2017-04-24 2017-09-01 中国科学院遥感与数字地球研究所 Remote sensing images super-resolution reconstruction method and system based on depth convolutional network
CN107578034A (en) * 2017-09-29 2018-01-12 百度在线网络技术(北京)有限公司 information generating method and device
US20180060301A1 (en) * 2016-08-31 2018-03-01 Microsoft Technology Licensing, Llc End-to-end learning of dialogue agents for information access
CN107766940A (en) * 2017-11-20 2018-03-06 北京百度网讯科技有限公司 Method and apparatus for generation model
CN108197618A (en) * 2018-04-08 2018-06-22 百度在线网络技术(北京)有限公司 For generating the method and apparatus of Face datection model
CN108288271A (en) * 2018-02-06 2018-07-17 上海交通大学 Image detecting system and method based on three-dimensional residual error network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080195577A1 (en) * 2007-02-09 2008-08-14 Wei Fan Automatically and adaptively determining execution plans for queries with parameter markers
US20180060301A1 (en) * 2016-08-31 2018-03-01 Microsoft Technology Licensing, Llc End-to-end learning of dialogue agents for information access
CN107123089A (en) * 2017-04-24 2017-09-01 中国科学院遥感与数字地球研究所 Remote sensing images super-resolution reconstruction method and system based on depth convolutional network
CN107578034A (en) * 2017-09-29 2018-01-12 百度在线网络技术(北京)有限公司 information generating method and device
CN107766940A (en) * 2017-11-20 2018-03-06 北京百度网讯科技有限公司 Method and apparatus for generation model
CN108288271A (en) * 2018-02-06 2018-07-17 上海交通大学 Image detecting system and method based on three-dimensional residual error network
CN108197618A (en) * 2018-04-08 2018-06-22 百度在线网络技术(北京)有限公司 For generating the method and apparatus of Face datection model

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020087974A1 (en) * 2018-10-30 2020-05-07 北京字节跳动网络技术有限公司 Model generation method and device
CN111949860A (en) * 2019-05-15 2020-11-17 北京字节跳动网络技术有限公司 Method and apparatus for generating a relevance determination model
CN110251942A (en) * 2019-06-04 2019-09-20 腾讯科技(成都)有限公司 Control the method and device of virtual role in scene of game
CN110251942B (en) * 2019-06-04 2022-09-13 腾讯科技(成都)有限公司 Method and device for controlling virtual character in game scene
CN112397195A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, electronic device, and medium for generating physical examination model
CN112397196A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method and device for generating image inspection recommendation model
CN112397161A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, device and medium for generating an assay model
CN112397194A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, device and electronic equipment for generating patient condition attribution interpretation model
CN112397163A (en) * 2019-08-16 2021-02-23 北京大数医达科技有限公司 Method, apparatus, electronic device, and medium for generating case input model
CN112397163B (en) * 2019-08-16 2024-02-02 北京大数医达科技有限公司 Method, apparatus, electronic device and medium for generating case input model
CN112397194B (en) * 2019-08-16 2024-02-06 北京大数医达科技有限公司 Method, device and electronic equipment for generating patient disease attribution interpretation model
CN112397195B (en) * 2019-08-16 2024-02-09 北京大数医达科技有限公司 Method, apparatus, electronic device and medium for generating physical examination model
CN110991312A (en) * 2019-11-28 2020-04-10 重庆中星微人工智能芯片技术有限公司 Method, apparatus, electronic device, and medium for generating detection information
CN112738793A (en) * 2020-12-29 2021-04-30 永辉云金科技有限公司 Equipment fingerprint generation method and device based on BP algorithm and storage medium
CN113344087A (en) * 2021-06-16 2021-09-03 安徽容知日新科技股份有限公司 Method for establishing sample set and computing equipment

Also Published As

Publication number Publication date
CN109376267B (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN109376267A (en) Method and apparatus for generating model
CN109344908A (en) Method and apparatus for generating model
CN109492128A (en) Method and apparatus for generating model
CN109447156A (en) Method and apparatus for generating model
CN109214343A (en) Method and apparatus for generating face critical point detection model
CN109002842A (en) Image-recognizing method and device
CN108446387A (en) Method and apparatus for updating face registration library
CN109447246A (en) Method and apparatus for generating model
CN109145828A (en) Method and apparatus for generating video classification detection model
CN109902678A (en) Model training method, character recognition method, device, electronic equipment and computer-readable medium
CN109117358A (en) test method and test device for electronic equipment
CN109446990A (en) Method and apparatus for generating information
CN107578017A (en) Method and apparatus for generating image
CN110288049A (en) Method and apparatus for generating image recognition model
CN108960316A (en) Method and apparatus for generating model
CN108090916A (en) For tracking the method and apparatus of the targeted graphical in video
CN109976997A (en) Test method and device
CN110225366A (en) Video data processing and advertisement position determine method, apparatus, medium and electronic equipment
CN108345387A (en) Method and apparatus for output information
CN109410253B (en) For generating method, apparatus, electronic equipment and the computer-readable medium of information
CN109618236A (en) Video comments treating method and apparatus
CN109063653A (en) Image processing method and device
CN109977839A (en) Information processing method and device
CN109857908A (en) Method and apparatus for matching video
CN109376268A (en) Video classification methods, device, electronic equipment and computer readable storage medium

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

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.

CP01 Change in the name or title of a patent holder