WO2023019908A1 - Method and apparatus for generating training sample set, and electronic device, storage medium and program - Google Patents

Method and apparatus for generating training sample set, and electronic device, storage medium and program Download PDF

Info

Publication number
WO2023019908A1
WO2023019908A1 PCT/CN2022/078350 CN2022078350W WO2023019908A1 WO 2023019908 A1 WO2023019908 A1 WO 2023019908A1 CN 2022078350 W CN2022078350 W CN 2022078350W WO 2023019908 A1 WO2023019908 A1 WO 2023019908A1
Authority
WO
WIPO (PCT)
Prior art keywords
unlabeled
samples
neural network
sample
value
Prior art date
Application number
PCT/CN2022/078350
Other languages
French (fr)
Chinese (zh)
Inventor
钟华平
刘卓名
何聪辉
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023019908A1 publication Critical patent/WO2023019908A1/en

Links

Images

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • 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
    • 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
    • G06N3/084Backpropagation, e.g. using gradient descent
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Definitions

  • the present disclosure relates to the technical field of machine learning, and in particular to a method, device, electronic device and storage medium for generating a training sample set.
  • the training data set is a data set with rich annotation information. Collecting and annotating such a data set usually requires huge manpower and material resources.
  • the training data when collecting and labeling the training data set, the training data can be screened manually to construct a better data set, which leads to high manpower and material cost.
  • Embodiments of the present disclosure at least provide a method, device, electronic device, storage medium, and program for generating a training sample set, so as to automatically select training samples, saving time and effort.
  • An embodiment of the present disclosure provides a method for generating a training sample set, the method comprising:
  • the method of generating the training sample set above in the case of obtaining each unlabeled sample and the target neural network, it is possible to first determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network, and then from each unlabeled sample The target unlabeled samples whose estimated impact value meets the preset requirements are selected from the labeled samples. In this way, after the target unlabeled samples are labeled, the target labeled samples can be obtained to update the training sample set.
  • the disclosure realizes the automatic selection of unlabeled samples based on the estimated influence degree value, which is more time-saving and labor-saving than the manual selection scheme, and also reduces the subsequent labeling cost.
  • An embodiment of the present disclosure also provides a device for generating a training sample set, the device comprising:
  • An acquisition module configured to acquire each unlabeled sample and the target neural network trained based on the training sample set
  • the determination module is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on the respective unlabeled samples and the target neural network;
  • the selection module is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each of the unlabeled samples;
  • the generation module is configured to add the target labeled samples to the training sample set to obtain an updated training sample set when the target unlabeled sample is sample labeled to obtain the target labeled sample;
  • the updated training sample set is used to perform network training on the target neural network again.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus.
  • the memory stores machine-readable instructions executable by the processor.
  • the processor and the The memory communicates with each other through a bus, and when the machine-readable instructions are executed by the processor, the steps of the method for generating a training sample set described in any embodiment are executed.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating a training sample set described in any embodiment is executed. step.
  • An embodiment of the present disclosure further provides a computer program, where the computer program includes computer readable codes, and when the computer readable codes run in an electronic device, a processor of the electronic device executes the program described in any embodiment. Steps of the method for generating the training sample set described above.
  • FIG. 1 shows a schematic flowchart of a method for generating a training sample set provided by an embodiment of the present disclosure
  • FIG. 2 shows a schematic diagram of a system architecture that can be applied to a method for generating a training sample set according to an embodiment of the present disclosure
  • FIG. 3 shows a schematic structural diagram of an apparatus for generating a training sample set provided by an embodiment of the present disclosure
  • Fig. 4 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the related technology also provides an active learning training data screening method, which considers the uncertainty of the model for unlabeled samples, or the impact of unlabeled samples on the diversity of labeled datasets. Measure the importance of samples, which can automatically find high-value data in unlabeled samples. Compared with manual operation, the above method only takes a fraction of the time to build a better dataset, and uses very little data to train an efficient model, thereby reducing the cost of labeling.
  • Uncertainty-based active learning algorithms and diversity-based active learning algorithms are two mainstream algorithms in related technologies, but both have their own defects.
  • Uncertainty-based methods Because neural networks often exhibit overconfidence in unfamiliar samples, such methods choose samples inaccurately.
  • Methods based on sample diversity The current state of the model is not considered to select samples, and the computational complexity is usually proportional to the square of the size of the data set.
  • the embodiments of the present disclosure provide a method, device, electronic device, storage medium and program for generating a training sample set, so as to automatically realize the selection of training samples, saving time and effort.
  • the execution subject of the method for generating a training sample set provided by the embodiment of the present disclosure generally has a certain computing power
  • the electronic equipment includes, for example: terminal equipment or server or other processing equipment
  • the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant) Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the method for generating a training sample set may be implemented by a processor invoking computer-readable instructions stored in a memory.
  • FIG. 1 it is a schematic flowchart of a method for generating a training sample set provided by an embodiment of the present disclosure, the method is executed by an electronic device, and the method includes steps S101 to S104, wherein:
  • S102 Based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network;
  • S104 In the case of sample labeling the selected target unlabeled sample to obtain the target labeled sample, add the target labeled sample to the training sample set to obtain the updated training sample set; the updated training sample set is used to train the target neuron The network goes through network training again.
  • FIG. 2 shows a schematic diagram of a system architecture that can be used in a method for generating a training sample set in an embodiment of the present disclosure
  • the system architecture includes: an acquisition terminal 201, a network 202 And control terminal 203.
  • the acquisition terminal 201 and the control terminal 203 establish a communication connection through the network 202, the acquisition terminal 201 reports the obtained unlabeled samples and the target neural network to the control terminal 203 through the network 202, and the control terminal 203 acquires After arriving at each unlabeled sample and target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network; and select the target whose estimated influence degree value meets the preset requirements from each unlabeled sample Unlabeled samples; when the selected target unlabeled samples are labeled to obtain the target labeled samples, the target labeled samples are added to the training sample set to obtain an updated training sample set; the updated training sample set is used for The target neural network undergoes network training again. Finally, the control terminal 203 sends the updated training sample set to the acquisition terminal 201 .
  • the acquisition terminal 201 may be an image acquisition device, and the control terminal 203 may include a data processing device with data processing capability or a remote server.
  • the network 202 may be connected in a wired or wireless manner.
  • the control terminal 203 is a data processing device
  • the acquisition terminal 201 can communicate with the data processing device through a wired connection, such as performing data communication through a bus; Data exchange between the network and the remote server.
  • the application scenario of the method will be described in detail below.
  • the method for generating the training sample set in the embodiments of the present disclosure can be applied to the training preparation process of the neural network in any application scenario.
  • the training sample set can be a set of marked samples. How to automatically select the target unlabeled samples that can adapt to the target neural network training from a large number of unlabeled samples has become a key task to update the training sample set.
  • the manual screening method provided in related technologies results in high manpower and material costs, while the screening method related to active learning either screens unlabeled samples that are not accurate enough, or takes a long time to achieve screening.
  • the embodiment of the present disclosure provides an unlabeled sample screening scheme based on estimated influence degree value estimation, so that the target neural network trained by the obtained updated training sample set is more accurate, and Automated screening, saving time and effort.
  • the target neural network here is also different.
  • the target neural network here can be a classification network that determines the target classification; for another example, in the target detection application scenario, the target neural network here can determine the target position, size and other information detection network.
  • the target neural network here may also be other networks, which is not limited in this embodiment of the present disclosure.
  • the target neural network here can be trained based on a training sample set containing several labeled samples, for example, it can be a vehicle classification network trained based on multiple labeled vehicle pictures.
  • the estimated influence degree value of each unlabeled sample on the network training of the target neural network can be determined here.
  • the estimated influence degree value of each unlabeled sample can be determined, and the influence of each unlabeled sample on the estimated influence degree value of the network training of the target neural network can be converted into each first marked The estimated influence degree and value of the sample on the network training parameters, and the estimated influence value of each unlabeled sample on the network training parameters. This is considering that network training parameters are the most direct considerations for network training, and the degree of proximity between the estimated influence degree and value of each first labeled sample and the estimated influence degree value of each unlabeled sample can be determined to a certain extent. It reflects the role that unlabeled samples can play in the training of the target neural network.
  • the target whose estimated influence degree value meets the preset requirements can be selected from each unlabeled sample Unlabeled samples.
  • unlabeled samples with estimated influence degree values greater than the second preset threshold may be selected as target unlabeled samples; or the unlabeled samples may be sorted in order of estimated influence degree values from large to small, Then determine the target unlabeled samples according to the ranking results; for example, select the unlabeled samples whose ranking results are in the top 10 as the target unlabeled samples.
  • the second preset threshold is set according to the type of the selected target neural network. Since the selected target neural network type to be trained is different, the estimated influence value of each unlabeled sample is also different. Therefore, the second preset The setting of the threshold is also different.
  • the target unlabeled sample When the target unlabeled sample is selected, the target unlabeled sample can be firstly labeled, and then the labeled target labeled sample can be added to the training sample set to obtain an updated training sample set.
  • each round of update can be achieved through the following steps:
  • Step 1 Screen out the target unlabeled samples from each unlabeled sample to obtain each updated unlabeled sample; and determine the updated target neural network based on the training of the updated training sample set; the updated training sample set includes each the first labeled sample and the target labeled sample;
  • Step 2 Based on the updated unlabeled samples and the updated target neural network, determine the estimated influence degree value of the updated unlabeled samples on the network training of the updated target neural network;
  • Step 3 Select the target unlabeled samples whose estimated impact degree value meets the preset requirements from the updated unlabeled samples;
  • Step 4 In the case of labeling the selected target unlabeled samples to obtain the target labeled samples, add the target labeled samples to the updated training sample set, and obtain the updated target neural network for training. training sample set.
  • the target non-concerned samples that meet the preset requirements are unlabeled samples whose estimated influence degree value is greater than the second preset threshold value as the target unlabeled sample;
  • the small order sorts each unlabeled sample, and then determines the target unlabeled sample according to the sorting result.
  • the target unlabeled samples can be screened out from each unlabeled sample to obtain the updated unlabeled samples, and at this time, the target labeled samples corresponding to the target unlabeled samples can be added to the updated training sample set, And the updated target neural network can be obtained by training based on the updated training sample set.
  • the estimated influence degree value of each updated unlabeled sample can be determined based on each updated unlabeled sample and the updated target neural network, and then the target unlabeled sample is selected and the updated training sample set is updated again. , and so on, until the loop cut-off condition is reached, and the updated target neural network is obtained.
  • the above-mentioned cycle cut-off condition may be that the number of cycles reaches the preset number of times, or that the relevant evaluation indicators of the updated target neural network obtained after training reach the preset indicators, for example, the cycle cut-off condition that the prediction accuracy reaches 0.75 .
  • determining the estimated impact degree value may include the following steps:
  • Step 1 Based on each first labeled sample and the target neural network, determine the estimated influence degree of each first labeled sample on the network training parameters during the forward propagation process of the target neural network based on each first labeled sample and values; and, based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training parameters during the forward propagation of the target neural network based on each unlabeled sample;
  • Step 2 Based on the estimated influence degree and value of each first labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine the network effect of each unlabeled sample on the target neural network. The estimated impact value for training.
  • the determination of the estimated influence degree and value of each first labeled sample on the network training parameters can be realized based on the forward propagation of the labeled samples; secondly, each unlabeled sample can be realized based on the forward propagation of the unlabeled samples Determination of the estimated influence degree value of the sample on the network training parameters; finally, the estimated influence degree value of each unlabeled sample on the network training of the target neural network can be determined based on the above estimated influence degree sum value and the estimated influence degree value .
  • Forward propagation in the embodiments of the present disclosure may refer to a process of inputting samples into a trained target neural network to obtain a gradient and a Hessian matrix corresponding to a relevant loss function. During the forward propagation, the network parameter values of the target neural network are not adjusted.
  • the determination of the estimated influence degree of unlabeled samples on network training parameters can be realized based on the determination of pseudo-labeled information, which can be achieved by the following steps:
  • Step 1 For each unlabeled sample in each unlabeled sample, input each unlabeled sample into the target neural network, and determine the probability value for each candidate prediction result output by the target neural network;
  • Step 2 Based on the probability values for each candidate prediction result, determine the pseudo-label information of the unlabeled sample.
  • Step 3 Based on the pseudo-label information, determine the gradient value corresponding to the loss function of the target neural network in the case of forward propagation of unlabeled samples;
  • Step 4 The determined gradient value is used as the estimated influence degree value of the unlabeled samples on the network training parameters.
  • the probability values output by the target neural network for each candidate prediction result can be determined, and then the pseudo-label information of the unlabeled sample can be determined based on the probability values for each candidate prediction result .
  • the strategies for generating pseudo-label information for different target neural networks are also different.
  • the target neural network is a classification network and the candidate prediction result is a candidate category
  • the candidate category with the highest probability value can be determined as the pseudo-label information of the unlabeled sample
  • the prediction result is a candidate detection frame
  • the candidate detection frame whose probability value is greater than the first preset threshold is determined as the pseudo-label information of the unlabeled sample, that is, multiple candidate detection frames can be used as the pseudo-label information.
  • the first preset threshold can be set to 0.95, that is, the candidate detection frame with a probability value greater than 0.95 is determined as the pseudo-labeled information of the unlabeled sample.
  • the corresponding pseudo-label information generation strategy can also be determined for other target neural networks.
  • the loss of unlabeled samples can be determined through pseudo-label information, and the gradient value corresponding to the loss function of the target neural network can be determined by backpropagating the loss to the target neural network, which can be used as the estimated influence degree of unlabeled samples on network training parameters value.
  • the first marked sample is input into the target neural network, and the gradient value corresponding to the loss function of the target neural network and the Hessian matrix corresponding to the loss function of the target neural network are obtained.
  • the gradient value here is used to represent the degree of influence of each network parameter on the loss function in the case of forward propagation of the first labeled sample
  • the Hessian matrix here is used to represent the forward propagation of the first labeled sample.
  • the degree to which each network parameter affects the loss function is affected by other network parameters.
  • the above gradient value corresponds to the first derivative of the loss function
  • the Hessian matrix corresponds to the second derivative of the loss function.
  • the gradient value corresponding to the loss function of the target neural network obtained by each labeled sample and the Hessian matrix corresponding to the loss function of the target neural network can be superimposed to obtain the gradient sum value and Hessian The matrix and value, and then based on the product operation of the gradient sum value and the Hessian matrix sum value, determine the estimated influence degree and value.
  • the network performance test function of the training reference set can be combined to realize the determination of the estimated influence degree and value, and then determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network, which can be obtained by follows these steps to achieve:
  • Step 1 Obtain each second labeled sample included in the training reference set; the training reference set and the training sample set do not have the same labeled samples;
  • Step 2 Based on each of the first labeled samples, each of the second labeled samples, and the target neural network, determine that in the process of forward propagation of the target neural network based on each of the first labeled samples and each of the second labeled samples, each The estimated influence degree and value of the first labeled sample and each second labeled sample on the network training parameters; and, based on each unlabeled sample and the target neural network, determine the forward propagation of the target neural network based on each unlabeled sample In the process of , each unlabeled sample has an estimated influence value on the network training parameters;
  • Step 3 Based on the estimated influence degree and value of each first labeled sample and each second labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine each unlabeled sample The value of the estimated influence of the sample on the network training of the target neural network.
  • multiple first labeled samples may be selected from each first labeled sample, and each first labeled sample in the multiple first labeled samples
  • the marked samples are input into the target neural network, and the Hessian matrix and the value corresponding to the loss function of the target neural network are obtained;
  • each second marked sample in each second marked sample can be input into the target neural network, Obtain the gradient and value corresponding to the loss function of the target neural network; finally, based on the product operation of the gradient sum value and the Hessian matrix sum value, determine the estimated influence degree and value.
  • the first labeled sample for training the target neural network and the second labeled sample for performance testing of the target neural network are distinguished, so that a more accurate network can be determined while valid network testing Estimated magnitude and value of impact.
  • the present disclosure can be based on the gradient and value of the target neural network on the training reference set R inverse matrix with Hessian and values and the expected gradient value of the unlabeled sample z i to determine the impact of unlabeled samples on model performance, that is, to determine To measure the importance of sample zi , where the gradient and value can correspond to the degree of influence of each network parameter on the loss function in the case of forward propagation of each second labeled sample in each second labeled sample , the Hessian matrix and the value can correspond to the degree of influence of each network parameter on the loss function by the degree of influence of other network parameters in the case of forward propagation of each first labeled sample in each first labeled sample .
  • the Hessian matrix and the values can be defined as the sum of the Hessian matrices of all the first labeled samples, namely
  • the Hessian matrix and value will not be directly calculated, but the calculation and The product of , here the product can be recorded as s test , where s test can be determined by random estimation.
  • the gradient and value of the network on the reference set can be first Denote it as v, and then randomly select k samples ⁇ z 1 ,z 2 ,...,z k ⁇ from the first labeled sample, and initialize In the case of iterating through Second, the obtained s test results can be determined as the estimated impact degree and value.
  • the process of determining the degree and value of the estimated impact it can be realized through multiple rounds of iterative calculations.
  • the marked samples pointed to by the current round of iterative calculations are determined, based on the determined marked samples corresponding to Hessian matrix, gradient and value, and the estimated influence degree and value corresponding to the previous round of iterative operation, determine the estimated influence degree and value corresponding to the current round of iterative operation, and through multiple rounds of iterations, the final estimated influence can be obtained degree and value.
  • the expected gradient determined here Slightly different.
  • the unlabeled picture z i is forward propagated to the network, the category with the highest predicted score of the classifier is selected as the pseudo-labeling result p, and the pseudo-labeling result is used to determine the loss of the picture in turn will lose Backpropagation to the neural network to get the gradient by as the expected gradient for unlabeled samples
  • the unlabeled picture z i is propagated forward to the network, and all detection frames P' of the picture z i by the network are obtained.
  • a threshold such as 0.95
  • I(z i ,R) the more negative the value of I(z i ,R), the more positive impact the sample z i can have on network performance.
  • the N samples with the most negative values are selected for labeling and added to the first labeled sample to obtain an updated training sample set.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides a device for generating a training sample set corresponding to the method for generating a training sample set. Since the problem-solving principle of the device in the embodiment of the present disclosure is the same as that of the above-mentioned training sample set in the embodiment of the present disclosure The generated method is similar, so the implementation of the device can refer to the implementation of the method.
  • FIG. 3 it is a schematic structural diagram of a device for generating a training sample set provided by an embodiment of the present disclosure.
  • the device includes: an acquisition module 301, a determination module 302, a selection module 303, and a generation module 304; wherein,
  • the obtaining module 301 is configured to obtain each unlabeled sample and the target neural network trained based on the training sample set;
  • the determination module 302 is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on each unlabeled sample and the target neural network;
  • the selection module 303 is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample;
  • the generating module 304 is configured to add the target marked sample to the training sample set to obtain the updated training sample set when the target unlabeled sample is sample marked to obtain the target marked sample, and the updated training sample set is used In order to perform network training on the target neural network again.
  • the target labeled samples can be obtained to update the training sample set.
  • the present disclosure realizes the automatic selection of unlabeled samples based on the estimated influence degree value, which is more time-saving and labor-saving than the manual selection scheme, and also reduces the subsequent labeling cost.
  • the training sample set includes each first labeled sample; the determining module 302 is configured to determine the contribution of each unlabeled sample to the target neural network based on the following steps: Estimated impact value for network training:
  • each first marked sample and the target neural network Based on each first marked sample and the target neural network, determine the estimated influence degree and value of each first marked sample on the network training parameters during the forward propagation of the target neural network based on each first marked sample; as well as,
  • the determination module 302 is configured to determine the estimated impact degree and value according to the following steps:
  • the gradient sum value is used to represent The summation result of the gradient value corresponding to each first labeled sample, the gradient value is used to represent the degree of influence of each network parameter on the loss function in the case of forward propagation of the first labeled sample;
  • the Hessian matrix sum value is used In order to represent the summation result of the Hessian matrix corresponding to each first labeled sample, the Hessian matrix is used to indicate that in the case of forward propagation of the first labeled sample, the degree of influence of each network parameter on the loss function is affected by other The degree of influence of network parameters;
  • the estimated influence degree and value are determined.
  • the determination module 302 is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on each unlabeled sample and the target neural network according to the following steps:
  • each first labeled sample, each second labeled sample, and the target neural network Based on each first labeled sample, each second labeled sample, and the target neural network, it is determined that each first labeled sample and each second labeled sample are used for forward propagation of the target neural network.
  • the determination module 302 is configured to determine the estimated impact degree and value according to the following steps:
  • the estimated influence degree and value are determined.
  • the determination module 302 is configured to determine the estimated influence degree and value based on the product operation of the gradient sum value and the Hessian matrix sum value according to the following steps:
  • For the current round of iterative operations determine the marked samples pointed to by the current round of iterative operations, and determine the current The estimated influence degree and value corresponding to the round iterative operation.
  • the determination module 302 is configured to determine, based on each unlabeled sample and the target neural network, in the process of forward propagation of the target neural network based on each unlabeled sample, each unlabeled
  • the determined gradient value is used as the estimated influence degree value of the unlabeled sample on the network training parameters.
  • the determining module 302 is configured to determine the pseudo-labeling information of the unlabeled samples based on the probability values for each candidate prediction result according to the following steps:
  • the candidate prediction result is a candidate category
  • the candidate detection frame whose probability value is greater than the first preset threshold is determined as the pseudo-labeled information of the unlabeled sample.
  • the selection module 303 is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample according to the following steps:
  • the generating module 304 is further configured to:
  • the updated training sample set includes each first already Labeled samples and target labeled samples
  • FIG. 4 is a schematic structural diagram of the electronic device provided by the embodiment of the present disclosure, including: a processor 401 , a memory 402 , and a bus 403 .
  • the memory 402 stores machine-readable instructions executable by the processor 401 (for example, the execution instructions corresponding to the acquisition module 301, the determination module 302, the selection module 303, and the generation module 304 in the device in FIG. , the processor 401 communicates with the memory 402 through the bus 403, and when the machine-readable instructions are executed by the processor 401, the following processing is performed:
  • the target labeled samples are added to the training sample set to obtain the updated training sample set; the updated training sample set is used to retrain the target neural network Do network training.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored.
  • the computer program is run by a processor, the method for generating the training sample set described in the above-mentioned method embodiment is executed. step.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides a computer program.
  • the computer program includes computer readable codes.
  • the processor of the electronic device executes the training samples as described in any of the above embodiments. The steps of the method for set generation.
  • Embodiments of the present disclosure also provide a computer program product, the computer program product carries program code, and the instructions included in the program code can be configured to execute the steps of the method for generating the training sample set described in the method embodiment above, which can be See the method example above.
  • the above-mentioned computer program product may be realized by hardware, software or a combination thereof.
  • the computer program product may be embodied as a computer storage medium, and in other embodiments, the computer program product may be embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
  • the device involved in the embodiments of the present disclosure may be at least one of a system, a method, and a computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Examples of computer-readable storage media include: portable computer disks, hard disks, Random Access Memory (RAM), Read-Only Memory (ROM), erasable Electrical Programmable Read Only Memory (EPROM) or flash memory, Static Random-Access Memory (Static Random-Access Memory, SRAM), Portable Compact Disc Read-Only Memory (CD-ROM), Digital Video Discs (DVDs), memory sticks, floppy disks, mechanically encoded devices such as punched cards or raised structures in grooves with instructions stored thereon, and any suitable combination of the foregoing.
  • RAM Random Access Memory
  • ROM Read-Only Memory
  • EPROM erasable Electrical Programmable Read Only Memory
  • flash memory Static Random-Access Memory
  • SRAM Static Random-Access Memory
  • CD-ROM Portable Compact Disc Read-Only Memory
  • DVDs Digital Video Discs
  • memory sticks floppy disks, mechanically encoded devices such as punched cards or raised structures in grooves with instructions stored thereon, and any suitable combination of the foregoing.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over at least one of a network, such as the Internet, a local area network, a wide area network, and a wireless network.
  • the network may include at least one of copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, Industry Standard Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or in one or more source or object code written in any combination of programming languages, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the “C” language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (for example, using Internet Service Provider to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network
  • electronic circuits such as programmable logic circuits, FPGAs, or programmable logic arrays (Programmable Logic Arrays, PLAs), can be customized by using state information of computer-readable program instructions, which can execute computer-readable Read program instructions, thereby implementing various aspects of the present disclosure.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the computer software product is stored in a storage medium, including several
  • the instructions are used to make an electronic device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, random access memory RAM, magnetic disk or optical disk.
  • the present disclosure provides a method, device, electronic device, storage medium, and program for generating a training sample set, wherein the method includes: obtaining each unlabeled sample and the target neural network trained based on the training sample set; Label the samples and the target neural network, and determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network; select the target unlabeled sample whose estimated influence degree value meets the preset requirements from each unlabeled sample; When the selected target unlabeled sample is sample-labeled to obtain the target labeled sample, the target labeled sample is added to the training sample set to obtain the updated training sample set; the updated training sample set is used to re-train the target neural network. network training.

Abstract

Provided in the present disclosure are a method and apparatus for generating a training sample set, and an electronic device, a storage medium and a program. The method comprises: acquiring each unlabeled sample, and a target neural network obtained by performing training on the basis of a training sample set; on the basis of each unlabeled sample and the target neural network, determining an estimated effect degree value of each unlabeled sample regarding network training of the target neural network; selecting, from among unlabeled samples, a target unlabeled sample with the estimated effect degree value meeting a preset requirement; and when a target labeled sample is obtained by performing sample labeling on the selected target unlabeled sample, adding the target labeled sample to the training sample set, so as to obtain an updated training sample set, wherein the updated training sample set is used for performing network training again on the target neural network. By means of the present disclosure, automatic selection of an unlabeled sample is realized on the basis of an estimated effect degree value, which, compared with a manual selection scheme, saves time and labor, and also reduces subsequent labeling costs.

Description

一种训练样本集生成的方法、装置、电子设备、存储介质及程序A method, device, electronic device, storage medium and program for generating a training sample set
相关申请的交叉引用Cross References to Related Applications
本专利申请要求2021年08月19日提交的中国专利申请号为202110953373.0、申请人为:上海商汤科技开发有限公司,申请名称为“一种训练样本集生成的方法、装置、电子设备及存储介质”的优先权,该申请文件以引用的方式并入本公开中。This patent application requires that the Chinese patent application number submitted on August 19, 2021 is 202110953373.0, the applicant is: Shanghai Shangtang Technology Development Co., Ltd., and the application name is "a method, device, electronic equipment and storage medium for generating a training sample set ", which is incorporated into this disclosure by reference.
技术领域technical field
本公开涉及机器学习技术领域,尤其涉及一种训练样本集生成的方法、装置、电子设备及存储介质。The present disclosure relates to the technical field of machine learning, and in particular to a method, device, electronic device and storage medium for generating a training sample set.
背景技术Background technique
随着深度学习的不断发展,基于大规模训练数据集的支撑,各种机器学习模型在各行各业取得了越来越大的成功。训练数据集是带有丰富标注信息的数据集,收集并标注这样的数据集通常需要庞大的人力和物力成本。With the continuous development of deep learning, based on the support of large-scale training data sets, various machine learning models have achieved more and more success in all walks of life. The training data set is a data set with rich annotation information. Collecting and annotating such a data set usually requires huge manpower and material resources.
相关技术中,在进行训练数据集的收集和标注时,可以采用人工方式进行训练数据的筛选以构建更好的数据集,这导致人力物力成本过高。In related technologies, when collecting and labeling the training data set, the training data can be screened manually to construct a better data set, which leads to high manpower and material cost.
发明内容Contents of the invention
本公开实施例至少提供一种训练样本集生成的方法、装置、电子设备、存储介质及程序,以自动实现训练样本的选取,省时省力。Embodiments of the present disclosure at least provide a method, device, electronic device, storage medium, and program for generating a training sample set, so as to automatically select training samples, saving time and effort.
本公开实施例提供了一种训练样本集生成的方法,所述方法包括:An embodiment of the present disclosure provides a method for generating a training sample set, the method comprising:
获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;Obtain each unlabeled sample and the target neural network trained based on the training sample set;
基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值;Based on each of the unlabeled samples and the target neural network, determine the estimated influence degree value of each of the unlabeled samples on the network training of the target neural network;
从所述各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;Selecting target unlabeled samples whose estimated influence degree value meets the preset requirements from each of the unlabeled samples;
在对选取的所述目标未标注样本进行样本标注得到目标已标注样本的情况下,将所述目标已标注样本添加至所述训练样本集中,得到更新后训练样本集;所述更新后训练样本集用于对所述目标神经网络再次进行网络训练。In the case of performing sample labeling on the selected target unlabeled samples to obtain target labeled samples, adding the target labeled samples to the training sample set to obtain an updated training sample set; the updated training samples The set is used to perform network training on the target neural network again.
采用上述训练样本集生成的方法,在获取到各个未标注样本以及目标神经网络的情况下,可以先确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值,进而从各个未标注样本中选取预估影响程度值 符合预设要求的目标未标注样本,这样,在对目标未标注样本进行样本标注后即可以得到目标已标注样本以进行训练样本集的更新。本公开基于预估影响程度值实现了未标注样本的自动选取,相比人工选取的方案,更为省时省力,也降低了后续的标注成本。Using the method of generating the training sample set above, in the case of obtaining each unlabeled sample and the target neural network, it is possible to first determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network, and then from each unlabeled sample The target unlabeled samples whose estimated impact value meets the preset requirements are selected from the labeled samples. In this way, after the target unlabeled samples are labeled, the target labeled samples can be obtained to update the training sample set. The disclosure realizes the automatic selection of unlabeled samples based on the estimated influence degree value, which is more time-saving and labor-saving than the manual selection scheme, and also reduces the subsequent labeling cost.
本公开实施例还提供了一种训练样本集生成的装置,所述装置包括:An embodiment of the present disclosure also provides a device for generating a training sample set, the device comprising:
获取模块,配置为获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;An acquisition module configured to acquire each unlabeled sample and the target neural network trained based on the training sample set;
确定模块,配置为基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值;The determination module is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on the respective unlabeled samples and the target neural network;
选取模块,配置为从所述各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;The selection module is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each of the unlabeled samples;
生成模块,配置为在对选取的所述目标未标注样本进行样本标注得到目标已标注样本的情况下,将所述目标已标注样本添加至所述训练样本集中,得到更新后训练样本集;所述更新后训练样本集用于对所述目标神经网络再次进行网络训练。The generation module is configured to add the target labeled samples to the training sample set to obtain an updated training sample set when the target unlabeled sample is sample labeled to obtain the target labeled sample; The updated training sample set is used to perform network training on the target neural network again.
本公开实施例还提供了一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行任一实施例所述的训练样本集生成的方法的步骤。An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the The memory communicates with each other through a bus, and when the machine-readable instructions are executed by the processor, the steps of the method for generating a training sample set described in any embodiment are executed.
本公开实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行任一实施例所述的训练样本集生成的方法的步骤。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating a training sample set described in any embodiment is executed. step.
本公开实施例还提供一种计算机程序,所述计算机程序包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备的处理器执行任一实施例所述的训练样本集生成的方法的步骤。An embodiment of the present disclosure further provides a computer program, where the computer program includes computer readable codes, and when the computer readable codes run in an electronic device, a processor of the electronic device executes the program described in any embodiment. Steps of the method for generating the training sample set described above.
关于上述训练样本集生成的装置、电子设备、及计算机可读存储介质的效果描述参见上述训练样本集生成的方法的说明。For the effect description of the device, electronic equipment, and computer-readable storage medium for generating the training sample set, please refer to the description of the method for generating the training sample set.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these drawings other related drawings are obtained.
图1示出了本公开实施例所提供的一种训练样本集生成的方法的流程示意图;FIG. 1 shows a schematic flowchart of a method for generating a training sample set provided by an embodiment of the present disclosure;
图2示出了可以应用本公开实施例的训练样本集生成的方法的一种系统架构示意图;FIG. 2 shows a schematic diagram of a system architecture that can be applied to a method for generating a training sample set according to an embodiment of the present disclosure;
图3示出了本公开实施例所提供的一种训练样本集生成的装置的结构示意图;FIG. 3 shows a schematic structural diagram of an apparatus for generating a training sample set provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种电子设备的结构示意图。Fig. 4 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only It is a part of the embodiments of the present disclosure, but not all of them. The components of the disclosed embodiments generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article only describes an association relationship, which means that there can be three kinds of relationships, for example, A and/or B can mean: there is A alone, A and B exist at the same time, and B exists alone. situation. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
经研究发现,相关技术中可以采用人工方式进行训练数据的筛选以构建更好的数据集,这导致人力物力成本过高。After research, it is found that in related technologies, manual screening of training data can be used to construct a better data set, which leads to high cost of manpower and material resources.
为了解决上述问题,相关技术中还提供了一种主动学习的训练数据筛选方法,该方法通过考虑模型对未标注样本的不确定性,或者未标注样本对已标注数据集的多样性的影响来衡量样本的重要程度,这样可以自动找到未标注样本中的高价值数据。相较于人工操作,上述方法只需花费一小部分时间即可构建更好的数据集,并使用很少的数据来训练出高效的模型,从而降低标注成本。In order to solve the above problems, the related technology also provides an active learning training data screening method, which considers the uncertainty of the model for unlabeled samples, or the impact of unlabeled samples on the diversity of labeled datasets. Measure the importance of samples, which can automatically find high-value data in unlabeled samples. Compared with manual operation, the above method only takes a fraction of the time to build a better dataset, and uses very little data to train an efficient model, thereby reducing the cost of labeling.
基于不确定性的主动学习算法和基于多样性的主动学习算法是相关技术的两类主流算法,但都有各自的缺陷。基于不确定性的方法:因为神经网络通常会对不熟悉的样本展示出过度置信,使得这类方法选择样本不准确。基于样本多样性的方法:没有考虑模型当前状态来选择样本,且计算 复杂度通常正比于数据集的大小的平方。Uncertainty-based active learning algorithms and diversity-based active learning algorithms are two mainstream algorithms in related technologies, but both have their own defects. Uncertainty-based methods: Because neural networks often exhibit overconfidence in unfamiliar samples, such methods choose samples inaccurately. Methods based on sample diversity: The current state of the model is not considered to select samples, and the computational complexity is usually proportional to the square of the size of the data set.
基于上述研究,本公开实施例提供了一种训练样本集生成的方法、装置、电子设备、存储介质及程序,以自动实现训练样本的选取,省时省力。Based on the above research, the embodiments of the present disclosure provide a method, device, electronic device, storage medium and program for generating a training sample set, so as to automatically realize the selection of training samples, saving time and effort.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种训练样本集生成的方法进行详细介绍,本公开实施例所提供的训练样本集生成的方法的执行主体一般为具有一定计算能力的电子设备,该电子设备例如包括:终端设备或服务器或其它处理设备,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该训练样本集生成的方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate the understanding of this embodiment, a method for generating a training sample set disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the method for generating a training sample set provided by the embodiment of the present disclosure generally has a certain computing power Electronic equipment, the electronic equipment includes, for example: terminal equipment or server or other processing equipment, the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant) Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementation manners, the method for generating a training sample set may be implemented by a processor invoking computer-readable instructions stored in a memory.
参见图1所示,为本公开实施例提供的训练样本集生成的方法的流程示意图,所述方法由电子设备执行,所述方法包括步骤S101至S104,其中:Referring to FIG. 1 , it is a schematic flowchart of a method for generating a training sample set provided by an embodiment of the present disclosure, the method is executed by an electronic device, and the method includes steps S101 to S104, wherein:
S101:获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;S101: Obtain each unlabeled sample and a target neural network trained based on the training sample set;
S102:基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值;S102: Based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network;
S103:从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;S103: Select target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample;
S104:在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至训练样本集中,得到更新后训练样本集;更新后训练样本集用于对目标神经网络再次进行网络训练。S104: In the case of sample labeling the selected target unlabeled sample to obtain the target labeled sample, add the target labeled sample to the training sample set to obtain the updated training sample set; the updated training sample set is used to train the target neuron The network goes through network training again.
参见图2所示,图2示出了可以用于本公开实施例的训练样本集生成的方法的一种系统架构示意图;如图2所示,该系统架构中包括:获取终端201、网络202和控制终端203。为实现支撑一个示例性应用,获取终端201和控制终端203通过网络202建立通信连接,获取终端201通过网络202向控制终端203上报获取到的各个未标注样本和目标神经网络,控制终端203在获取到各个未标注样本、目标神经网络后,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值;并从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至训练样本集中,得到更新后训练样本集;更新后训练样本集用于对目标神经网络再次进行网络训练。最后,控制终端203将更新后训练样本集发送给获取终端201。Referring to FIG. 2, FIG. 2 shows a schematic diagram of a system architecture that can be used in a method for generating a training sample set in an embodiment of the present disclosure; as shown in FIG. 2, the system architecture includes: an acquisition terminal 201, a network 202 And control terminal 203. In order to support an exemplary application, the acquisition terminal 201 and the control terminal 203 establish a communication connection through the network 202, the acquisition terminal 201 reports the obtained unlabeled samples and the target neural network to the control terminal 203 through the network 202, and the control terminal 203 acquires After arriving at each unlabeled sample and target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network; and select the target whose estimated influence degree value meets the preset requirements from each unlabeled sample Unlabeled samples; when the selected target unlabeled samples are labeled to obtain the target labeled samples, the target labeled samples are added to the training sample set to obtain an updated training sample set; the updated training sample set is used for The target neural network undergoes network training again. Finally, the control terminal 203 sends the updated training sample set to the acquisition terminal 201 .
作为示例,获取终端201可以为图像采集设备,控制终端203可以包括具有数据处理能力的数据处理设备或远程服务器。网络202可以采用有线或无线连接方式。其中,当控制终端203为数据处理设备时,获取终端201可以通过有线连接的方式与数据处理设备通信连接,例如通过总线进行 数据通信;当控制终端203为远程服务器时,获取终端201可以通过无线网络与远程服务器进行数据交互。As an example, the acquisition terminal 201 may be an image acquisition device, and the control terminal 203 may include a data processing device with data processing capability or a remote server. The network 202 may be connected in a wired or wireless manner. Wherein, when the control terminal 203 is a data processing device, the acquisition terminal 201 can communicate with the data processing device through a wired connection, such as performing data communication through a bus; Data exchange between the network and the remote server.
为了便于理解本公开实施例提供的训练样本集生成的方法,接下来对该方法的应用场景进行详细描述。本公开实施例中的训练样本集生成的方法可以应用于任何应用场景下有关神经网络的训练准备过程中。为了更好的训练目标神经网络,在进行神经网络训练之前,需要准备更为丰富的训练样本集,这里的训练样本集可以是标注好的已标注样本的集合。如何从大量的未标注样本中自动选出可适配目标神经网络训练的目标未标注样本成为更新训练样本集的关键任务。In order to facilitate the understanding of the method for generating the training sample set provided by the embodiment of the present disclosure, the application scenario of the method will be described in detail below. The method for generating the training sample set in the embodiments of the present disclosure can be applied to the training preparation process of the neural network in any application scenario. In order to better train the target neural network, it is necessary to prepare a richer training sample set before training the neural network, where the training sample set can be a set of marked samples. How to automatically select the target unlabeled samples that can adapt to the target neural network training from a large number of unlabeled samples has become a key task to update the training sample set.
相关技术中提供的人工筛选方式导致人力物力成本较高,而有关主动学习的筛选方式要么所筛选的未标注样本不够准确,要么需要耗费较长的时间来实现筛选。正是为了解决这些问题,本公开实施例才提供了一种基于预估影响程度值估计的未标注样本筛选方案,以使得得到的更新后训练样本集所训练的目标神经网络更为准确,且自动实现筛选,省时省力。The manual screening method provided in related technologies results in high manpower and material costs, while the screening method related to active learning either screens unlabeled samples that are not accurate enough, or takes a long time to achieve screening. Just to solve these problems, the embodiment of the present disclosure provides an unlabeled sample screening scheme based on estimated influence degree value estimation, so that the target neural network trained by the obtained updated training sample set is more accurate, and Automated screening, saving time and effort.
其中,针对不同的应用场景,这里的目标神经网络也不同。例如,在目标分类应用场景下,这里的目标神经网络可以是确定目标分类的分类网络;再如,在目标检测应用场景下,这里的目标神经网络可以确定目标位置、大小等信息的检测网络。除此之外,这里的目标神经网络还可以是其它网络,本公开实施例对此不做限制。Among them, for different application scenarios, the target neural network here is also different. For example, in the target classification application scenario, the target neural network here can be a classification network that determines the target classification; for another example, in the target detection application scenario, the target neural network here can determine the target position, size and other information detection network. In addition, the target neural network here may also be other networks, which is not limited in this embodiment of the present disclosure.
在实际应用中,这里的目标神经网络可以是基于包含有若干已标注样本的训练样本集训练得到,例如,可以是基于多个已标注车辆图片训练得到的车辆分类网络。In practical applications, the target neural network here can be trained based on a training sample set containing several labeled samples, for example, it can be a vehicle classification network trained based on multiple labeled vehicle pictures.
这里,为了可以从各个未标注样本中筛选出更适配上述目标神经网络的目标未标注样本,这里可以确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值。Here, in order to select the target unlabeled samples that are more suitable for the above-mentioned target neural network from each unlabeled sample, the estimated influence degree value of each unlabeled sample on the network training of the target neural network can be determined here.
本公开实施例中可以确定出每个未标注样本的预估影响程度值,可以将各个未标注样本分别对目标神经网络的网络训练的预估影响程度值的影响,转化为各个第一已标注样本对网络训练参数的预估影响程度和值,以及每个未标注样本对网络训练参数的预估影响值。这是考虑到网络训练参数是实现网络训练的最直接考量因素,而各个第一已标注样本预估影响程度和值以及每个未标注样本预估影响程度值之间的接近程度一定程度上可以体现未标注样本能够对目标神经网络的训练可发挥的作用。In the embodiment of the present disclosure, the estimated influence degree value of each unlabeled sample can be determined, and the influence of each unlabeled sample on the estimated influence degree value of the network training of the target neural network can be converted into each first marked The estimated influence degree and value of the sample on the network training parameters, and the estimated influence value of each unlabeled sample on the network training parameters. This is considering that network training parameters are the most direct considerations for network training, and the degree of proximity between the estimated influence degree and value of each first labeled sample and the estimated influence degree value of each unlabeled sample can be determined to a certain extent. It reflects the role that unlabeled samples can play in the training of the target neural network.
在确定出每个未标注样本对目标神经网络的网络训练的预估影响程度值的情况下,本公开实施例中,可以从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本。这里,可以是选取预估影响程度值大于第二预设阈值的未标注样本作为目标未标注样本;也可以是先按照预估影响程度值由大到小的顺序对各个未标注样本进行排序,而后根据排序结果确定目标未标注样本;例如,选取排名结果处在前10位的未标注样本 作为目标未标注样本。这里,第二预设阈值是根据选择的目标神经网络的类型进行设置,由于选择的要训练的目标神经网络类型不同,每个未标注样本的预估影响程度值也不同,因此,第二预设阈值的设置也不同。In the case of determining the estimated influence degree value of each unlabeled sample on the network training of the target neural network, in the embodiment of the present disclosure, the target whose estimated influence degree value meets the preset requirements can be selected from each unlabeled sample Unlabeled samples. Here, unlabeled samples with estimated influence degree values greater than the second preset threshold may be selected as target unlabeled samples; or the unlabeled samples may be sorted in order of estimated influence degree values from large to small, Then determine the target unlabeled samples according to the ranking results; for example, select the unlabeled samples whose ranking results are in the top 10 as the target unlabeled samples. Here, the second preset threshold is set according to the type of the selected target neural network. Since the selected target neural network type to be trained is different, the estimated influence value of each unlabeled sample is also different. Therefore, the second preset The setting of the threshold is also different.
在选取出目标未标注样本的情况下,可以先对目标未标注样本进行样本标注,而后将标注得到的目标已标注样本添加到训练样本集中,得到更新后训练样本集。When the target unlabeled sample is selected, the target unlabeled sample can be firstly labeled, and then the labeled target labeled sample can be added to the training sample set to obtain an updated training sample set.
在实际应用中,可以进行多轮目标未标注样本的选取以及训练样本集的更新,以得到更为准确的更新后目标神经网络,每轮更新可以通过如下步骤来实现:In practical applications, multiple rounds of target unlabeled samples can be selected and the training sample set updated to obtain a more accurate updated target neural network. Each round of update can be achieved through the following steps:
步骤一、从各个未标注样本中筛除目标未标注样本,得到更新后的各个未标注样本;以及,确定基于更新后训练样本集训练得到的更新后目标神经网络;更新后训练样本集中包括各个第一已标注样本和目标已标注样本;Step 1. Screen out the target unlabeled samples from each unlabeled sample to obtain each updated unlabeled sample; and determine the updated target neural network based on the training of the updated training sample set; the updated training sample set includes each the first labeled sample and the target labeled sample;
步骤二、基于更新后的各个未标注样本、更新后目标神经网络,确定更新后的各个未标注样本对更新后目标神经网络的网络训练的预估影响程度值;Step 2. Based on the updated unlabeled samples and the updated target neural network, determine the estimated influence degree value of the updated unlabeled samples on the network training of the updated target neural network;
步骤三、从更新后的各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;Step 3. Select the target unlabeled samples whose estimated impact degree value meets the preset requirements from the updated unlabeled samples;
步骤四、在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至更新后训练样本集中,得到用于对更新后目标神经网络进行训练的更新后训练样本集。Step 4. In the case of labeling the selected target unlabeled samples to obtain the target labeled samples, add the target labeled samples to the updated training sample set, and obtain the updated target neural network for training. training sample set.
在一些实施例中,符合预设要求的目标未关注样本为预估影响程度值大于第二预设阈值的未标注样本作为目标未标注样本;也可以是先按照预估影响程度值由大到小的顺序对各个未标注样本进行排序,而后根据排序结果确定目标未标注样本。In some embodiments, the target non-concerned samples that meet the preset requirements are unlabeled samples whose estimated influence degree value is greater than the second preset threshold value as the target unlabeled sample; The small order sorts each unlabeled sample, and then determines the target unlabeled sample according to the sorting result.
这里,可以先从各个未标注样本中筛除目标未标注样本,以得到更新后的各个未标注样本,而这时可以将目标未标注样本对应的目标已标注样本添加到更新后训练样本集中,并可以基于更新后训练样本集训练得到更新后目标神经网络。这样,可以基于更新后的各个未标注样本、更新后目标神经网络确定更新后的各个未标注样本的预估影响程度值,继而进行目标未标注样本的选取以及再次的更新后训练样本集的更新,依此循环,直至达到循环截止条件,得到更新后目标神经网络。Here, the target unlabeled samples can be screened out from each unlabeled sample to obtain the updated unlabeled samples, and at this time, the target labeled samples corresponding to the target unlabeled samples can be added to the updated training sample set, And the updated target neural network can be obtained by training based on the updated training sample set. In this way, the estimated influence degree value of each updated unlabeled sample can be determined based on each updated unlabeled sample and the updated target neural network, and then the target unlabeled sample is selected and the updated training sample set is updated again. , and so on, until the loop cut-off condition is reached, and the updated target neural network is obtained.
其中,上述循环截止条件可以是循环次数达到预设次数,还可以是所训练得到的更新后目标神经网络的相关评价指标达到预设指标,例如,可以是预测准确度达到0.75这一循环截止条件。Wherein, the above-mentioned cycle cut-off condition may be that the number of cycles reaches the preset number of times, or that the relevant evaluation indicators of the updated target neural network obtained after training reach the preset indicators, for example, the cycle cut-off condition that the prediction accuracy reaches 0.75 .
考虑到预估影响程度值的确定对于未标注样本选取的关键作用,在一些实施例中可以对确定预估影响程度值的过程进行描述。这里,确定预估影响程度值可以包括如下步骤:Considering that the determination of the estimated influence degree value plays a key role in the selection of unlabeled samples, in some embodiments, the process of determining the estimated influence degree value can be described. Here, determining the estimated impact degree value may include the following steps:
步骤一、基于各个第一已标注样本以及目标神经网络,确定在基于各个第一已标注样本进行目标神经网络前向传播的过程中,各个第一已标注样本对网络训练参数的预估影响程度和值;以及,基于各个未标注样本以及目标神经网络,确定在基于各个未标注样本进行目标神经网络前向传播的过程中,每个未标注样本对网络训练参数的预估影响程度值;Step 1. Based on each first labeled sample and the target neural network, determine the estimated influence degree of each first labeled sample on the network training parameters during the forward propagation process of the target neural network based on each first labeled sample and values; and, based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training parameters during the forward propagation of the target neural network based on each unlabeled sample;
步骤二、基于各个第一已标注样本对网络训练参数的预估影响程度和值以及每个未标注样本对网络训练参数的预估影响程度值,确定每个未标注样本对目标神经网络的网络训练的预估影响程度值。Step 2. Based on the estimated influence degree and value of each first labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine the network effect of each unlabeled sample on the target neural network. The estimated impact value for training.
这里,首先,可以基于已标注样本的前向传播实现各个第一已标注样本对网络训练参数的预估影响程度和值的确定;其次,可以基于未标注样本的前向传播实现每个未标注样本对网络训练参数的预估影响程度值的确定;最后,可以基于上述预估影响程度和值和预估影响程度值确定每个未标注样本对目标神经网络的网络训练的预估影响程度值。Here, firstly, the determination of the estimated influence degree and value of each first labeled sample on the network training parameters can be realized based on the forward propagation of the labeled samples; secondly, each unlabeled sample can be realized based on the forward propagation of the unlabeled samples Determination of the estimated influence degree value of the sample on the network training parameters; finally, the estimated influence degree value of each unlabeled sample on the network training of the target neural network can be determined based on the above estimated influence degree sum value and the estimated influence degree value .
本公开实施例中的前向传播可以指的是将样本输入到训练好的目标神经网络中,得到相关损失函数对应的梯度和海森矩阵的过程。在前向传播的过程中,不会对目标神经网络的网络参数值进行调整。Forward propagation in the embodiments of the present disclosure may refer to a process of inputting samples into a trained target neural network to obtain a gradient and a Hessian matrix corresponding to a relevant loss function. During the forward propagation, the network parameter values of the target neural network are not adjusted.
针对未标注样本,可以基于伪标注信息的确定实现未标注样本对网络训练参数的预估影响程度值的确定,可以通过如下步骤来实现:For unlabeled samples, the determination of the estimated influence degree of unlabeled samples on network training parameters can be realized based on the determination of pseudo-labeled information, which can be achieved by the following steps:
步骤一、针对各个未标注样本中的每个未标注样本,将每个未标注样本输入到目标神经网络中,确定目标神经网络输出的针对各个候选预测结果的概率值;Step 1. For each unlabeled sample in each unlabeled sample, input each unlabeled sample into the target neural network, and determine the probability value for each candidate prediction result output by the target neural network;
步骤二、基于针对各个候选预测结果的概率值,确定未标注样本的伪标注信息。Step 2: Based on the probability values for each candidate prediction result, determine the pseudo-label information of the unlabeled sample.
步骤三、基于伪标注信息,确定在未标注样本前向传播的情况下,目标神经网络的损失函数对应的梯度值;Step 3. Based on the pseudo-label information, determine the gradient value corresponding to the loss function of the target neural network in the case of forward propagation of unlabeled samples;
步骤四、将确定的梯度值作为未标注样本对网络训练参数的预估影响程度值。Step 4: The determined gradient value is used as the estimated influence degree value of the unlabeled samples on the network training parameters.
这里,在将未标注样本输入到目标神经网络的情况下,可以确定目标神经网络输出的针对各个候选预测结果的概率值,然后基于针对各个候选预测结果的概率值确定未标注样本的伪标注信息。Here, when unlabeled samples are input into the target neural network, the probability values output by the target neural network for each candidate prediction result can be determined, and then the pseudo-label information of the unlabeled sample can be determined based on the probability values for each candidate prediction result .
考虑到不同应用场景所对应的目标神经网络不同,而针对不同的目标神经网络的伪标注信息的生成策略也不同。例如,在目标神经网络为分类网络、候选预测结果为候选类别的情况下,可以将概率值最大的候选类别确定为未标注样本的伪标注信息;再如,在目标神经网络包括检测网络、候选预测结果为候选检测框的情况下,将概率值大于第一预设阈值的候选检测框确定为未标注样本的伪标注信息,也即,可以将多个候选检测框作为伪标注信息。在一些实施例中个,可以将第一预设阈值设置为0.95,即将概率值大于0.95的候选检测框确定为未标注样本的伪标注信息。除此之 外,还可以针对其他目标神经网络确定对应的伪标注信息生成策略。Considering that the target neural networks corresponding to different application scenarios are different, the strategies for generating pseudo-label information for different target neural networks are also different. For example, when the target neural network is a classification network and the candidate prediction result is a candidate category, the candidate category with the highest probability value can be determined as the pseudo-label information of the unlabeled sample; When the prediction result is a candidate detection frame, the candidate detection frame whose probability value is greater than the first preset threshold is determined as the pseudo-label information of the unlabeled sample, that is, multiple candidate detection frames can be used as the pseudo-label information. In some embodiments, the first preset threshold can be set to 0.95, that is, the candidate detection frame with a probability value greater than 0.95 is determined as the pseudo-labeled information of the unlabeled sample. In addition, the corresponding pseudo-label information generation strategy can also be determined for other target neural networks.
通过伪标注信息可以确定未标注样本的损失,将损失反向传播到目标神经网络可以确定出目标神经网络的损失函数对应的梯度值,并可以作为未标注样本对网络训练参数的预估影响程度值。The loss of unlabeled samples can be determined through pseudo-label information, and the gradient value corresponding to the loss function of the target neural network can be determined by backpropagating the loss to the target neural network, which can be used as the estimated influence degree of unlabeled samples on network training parameters value.
针对第一已标注样本,将该第一已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的梯度值和目标神经网络的损失函数对应的海森矩阵。这里的梯度值用于表示在第一已标注样本前向传播的情况下、各个网络参数对损失函数的影响程度,这里的海森矩阵用于表示在第一已标注样本前向传播的情况下、每个网络参数对损失函数的影响程度受其他网络参数的影响程度。在具体的数学计算过程中,上述梯度值对应的是损失函数的一阶导数,海森矩阵对应的是损失函数的二阶导数。For the first marked sample, the first marked sample is input into the target neural network, and the gradient value corresponding to the loss function of the target neural network and the Hessian matrix corresponding to the loss function of the target neural network are obtained. The gradient value here is used to represent the degree of influence of each network parameter on the loss function in the case of forward propagation of the first labeled sample, and the Hessian matrix here is used to represent the forward propagation of the first labeled sample. , the degree to which each network parameter affects the loss function is affected by other network parameters. In the specific mathematical calculation process, the above gradient value corresponds to the first derivative of the loss function, and the Hessian matrix corresponds to the second derivative of the loss function.
这样,针对各个已标注样本,可以将每个已标注样本得到目标神经网络的损失函数对应的梯度值和目标神经网络的损失函数对应的海森矩阵进行叠加运算,以得到梯度和值和海森矩阵和值,进而基于梯度和值和海森矩阵和值的乘积运算,确定预估影响程度和值。In this way, for each labeled sample, the gradient value corresponding to the loss function of the target neural network obtained by each labeled sample and the Hessian matrix corresponding to the loss function of the target neural network can be superimposed to obtain the gradient sum value and Hessian The matrix and value, and then based on the product operation of the gradient sum value and the Hessian matrix sum value, determine the estimated influence degree and value.
在实际应用中,可以结合训练参考集的网络性能检验功能来实现预估影响程度和值的确定,进而确定出每个未标注样本对目标神经网络的网络训练的预估影响程度值,可以通过如下步骤来实现:In practical applications, the network performance test function of the training reference set can be combined to realize the determination of the estimated influence degree and value, and then determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network, which can be obtained by Follow these steps to achieve:
步骤一、获取训练参考集包括的各个第二已标注样本;训练参考集与训练样本集不存在相同的已标注样本;Step 1. Obtain each second labeled sample included in the training reference set; the training reference set and the training sample set do not have the same labeled samples;
步骤二、基于各个第一已标注样本、各个第二已标注样本以及目标神经网络,确定在基于各个第一已标注样本和各个第二已标注样本进行目标神经网络前向传播的过程中,各个第一已标注样本以及各个第二已标注样本对网络训练参数的预估影响程度和值;以及,基于各个未标注样本以及目标神经网络,确定在基于各个未标注样本进行目标神经网络前向传播的过程中,每个未标注样本对网络训练参数的预估影响程度值;Step 2. Based on each of the first labeled samples, each of the second labeled samples, and the target neural network, determine that in the process of forward propagation of the target neural network based on each of the first labeled samples and each of the second labeled samples, each The estimated influence degree and value of the first labeled sample and each second labeled sample on the network training parameters; and, based on each unlabeled sample and the target neural network, determine the forward propagation of the target neural network based on each unlabeled sample In the process of , each unlabeled sample has an estimated influence value on the network training parameters;
步骤三、基于各个第一已标注样本以及各个第二已标注样本对网络训练参数的预估影响程度和值以及每个未标注样本对网络训练参数的预估影响程度值,确定每个未标注样本对目标神经网络的网络训练的预估影响程度值。Step 3. Based on the estimated influence degree and value of each first labeled sample and each second labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine each unlabeled sample The value of the estimated influence of the sample on the network training of the target neural network.
有关确定每个未标注样本对网络训练参数的预估影响程度值的过程,可以参见上述描述内容。See the above description for the process of determining the estimated influence value of each unlabeled sample on the network training parameters.
在确定上述预估影响程度和值的过程中,首先,可以先从各个第一已标注样本中选取多个第一已标注样本,并将多个第一已标注样本中的每个第一已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的海森矩阵和值;其次,可以将各个第二已标注样本中的每个第二已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的梯度和值;最后,基于梯度和值和海森矩阵和值的乘积运算,确定预估影响程 度和值。In the process of determining the above-mentioned estimated influence degree and value, firstly, multiple first labeled samples may be selected from each first labeled sample, and each first labeled sample in the multiple first labeled samples The marked samples are input into the target neural network, and the Hessian matrix and the value corresponding to the loss function of the target neural network are obtained; secondly, each second marked sample in each second marked sample can be input into the target neural network, Obtain the gradient and value corresponding to the loss function of the target neural network; finally, based on the product operation of the gradient sum value and the Hessian matrix sum value, determine the estimated influence degree and value.
可知的是,这里对训练目标神经网络的第一已标注样本以及对目标神经网络进行性能检验的第二已标注样本进行了区分,进而可以实现在有效网络检验的同时,确定出更为准确的预估影响程度和值。It can be seen that here, the first labeled sample for training the target neural network and the second labeled sample for performance testing of the target neural network are distinguished, so that a more accurate network can be determined while valid network testing Estimated magnitude and value of impact.
为了便于理解上述每个未标注样本对目标神经网络的网络训练的预估影响程度值的确定过程,接下来可以结合公式进行阐述。In order to facilitate the understanding of the determination process of the estimated influence degree value of each unlabeled sample on the network training of the target neural network, it can be explained in conjunction with the formula.
本公开实施例中,可以基于目标神经网络在训练参考集R上的梯度和值
Figure PCTCN2022078350-appb-000001
与海森矩阵和值的逆矩阵
Figure PCTCN2022078350-appb-000002
及未标注样本z i的期望梯度值
Figure PCTCN2022078350-appb-000003
的乘积来确定未标注样本对模型性能的影响,也即确定
Figure PCTCN2022078350-appb-000004
来衡量样本z i的重要程度,其中,梯度和值可以对应的是在各个第二已标注样本中的每个第二已标注样本前向传播的情况下、各个网络参数对损失函数的影响程度,海森矩阵和值可以对应的是在各个第一已标注样本中的每个第一已标注样本前向传播的情况下、每个网络参数对损失函数的影响程度受其他网络参数的影响程度。这里的海森矩阵和值
Figure PCTCN2022078350-appb-000005
可以定义为所有第一已标注样本的海森矩阵的和值,即
Figure PCTCN2022078350-appb-000006
In the embodiment of the present disclosure, it can be based on the gradient and value of the target neural network on the training reference set R
Figure PCTCN2022078350-appb-000001
inverse matrix with Hessian and values
Figure PCTCN2022078350-appb-000002
and the expected gradient value of the unlabeled sample z i
Figure PCTCN2022078350-appb-000003
to determine the impact of unlabeled samples on model performance, that is, to determine
Figure PCTCN2022078350-appb-000004
To measure the importance of sample zi , where the gradient and value can correspond to the degree of influence of each network parameter on the loss function in the case of forward propagation of each second labeled sample in each second labeled sample , the Hessian matrix and the value can correspond to the degree of influence of each network parameter on the loss function by the degree of influence of other network parameters in the case of forward propagation of each first labeled sample in each first labeled sample . Here the Hessian matrix and the values
Figure PCTCN2022078350-appb-000005
can be defined as the sum of the Hessian matrices of all the first labeled samples, namely
Figure PCTCN2022078350-appb-000006
在实际应用中,考虑到海森矩阵和值的计算量较大,因而不会直接计算海森矩阵和值,而是计算
Figure PCTCN2022078350-appb-000007
Figure PCTCN2022078350-appb-000008
的乘积,这里可以将乘积记为s test,这里的s test可以通过随机估计来确定。
In practical applications, considering the large amount of calculation of the Hessian matrix and value, the Hessian matrix and value will not be directly calculated, but the calculation
Figure PCTCN2022078350-appb-000007
and
Figure PCTCN2022078350-appb-000008
The product of , here the product can be recorded as s test , where s test can be determined by random estimation.
这里,可以先将网络在参考集上的梯度和值
Figure PCTCN2022078350-appb-000009
记为v,而后随机从第一已标注样本中选出k个样本{z 1,z 2,…,z k},在初始化
Figure PCTCN2022078350-appb-000010
的情况下,通过迭代
Figure PCTCN2022078350-appb-000011
次,可以将求得的s test的结果确定为预估影响程度和值。
Here, the gradient and value of the network on the reference set can be first
Figure PCTCN2022078350-appb-000009
Denote it as v, and then randomly select k samples {z 1 ,z 2 ,…,z k } from the first labeled sample, and initialize
Figure PCTCN2022078350-appb-000010
In the case of iterating through
Figure PCTCN2022078350-appb-000011
Second, the obtained s test results can be determined as the estimated impact degree and value.
本公开实施例在确定预估影响程度和值的过程中可以是通过多轮迭代运算实现的,针对当前轮迭代运算,确定当前轮迭代运算指向的已标注样本,基于确定的已标注样本对应的海森矩阵、梯度和值、以及上一轮迭代运算对应的预估影响程度和值,确定当前轮迭代运算对应的预估影响程度和值,通过多轮迭代,可以求得最终的预估影响程度和值。In the embodiment of the present disclosure, in the process of determining the degree and value of the estimated impact, it can be realized through multiple rounds of iterative calculations. For the current round of iterative calculations, the marked samples pointed to by the current round of iterative calculations are determined, based on the determined marked samples corresponding to Hessian matrix, gradient and value, and the estimated influence degree and value corresponding to the previous round of iterative operation, determine the estimated influence degree and value corresponding to the current round of iterative operation, and through multiple rounds of iterations, the final estimated influence can be obtained degree and value.
这里,还可以确定未标注样本对网络训练参数的预估影响程度值,也即,需要确定未标注样本的期望梯度
Figure PCTCN2022078350-appb-000012
Here, it is also possible to determine the estimated influence degree value of the unlabeled samples on the network training parameters, that is, it is necessary to determine the expected gradient of the unlabeled samples
Figure PCTCN2022078350-appb-000012
针对不同的目标神经网络,这里所确定的期望梯度
Figure PCTCN2022078350-appb-000013
略有不同。
For different target neural networks, the expected gradient determined here
Figure PCTCN2022078350-appb-000013
Slightly different.
例如,针对分类网络,将未标注图片z i前向传播到网络中,选择分类器预测分数最高的类别作为伪标注结果p,使用伪标注结果确定图片的损失
Figure PCTCN2022078350-appb-000014
进而将损失
Figure PCTCN2022078350-appb-000015
反向传播到神经网络中得到梯度
Figure PCTCN2022078350-appb-000016
Figure PCTCN2022078350-appb-000017
作为未标记样本的期望梯度
Figure PCTCN2022078350-appb-000018
For example, for the classification network, the unlabeled picture z i is forward propagated to the network, the category with the highest predicted score of the classifier is selected as the pseudo-labeling result p, and the pseudo-labeling result is used to determine the loss of the picture
Figure PCTCN2022078350-appb-000014
in turn will lose
Figure PCTCN2022078350-appb-000015
Backpropagation to the neural network to get the gradient
Figure PCTCN2022078350-appb-000016
by
Figure PCTCN2022078350-appb-000017
as the expected gradient for unlabeled samples
Figure PCTCN2022078350-appb-000018
再如,针对检测网络,将未标注图片z i前向传播到网络中,得到网络对图片z i的所有检测框P'。这里,可以使用一个阈值,比如,0.95,将结果低于0.95的检测框即不置信的检测框滤去,并将剩余的检测框作为伪标注结果P,使用伪标注结果确定图片的损失
Figure PCTCN2022078350-appb-000019
将损失
Figure PCTCN2022078350-appb-000020
反向传播到神经网络中得到梯度
Figure PCTCN2022078350-appb-000021
Figure PCTCN2022078350-appb-000022
作为未标记样本的期望梯度
Figure PCTCN2022078350-appb-000023
For another example, for the detection network, the unlabeled picture z i is propagated forward to the network, and all detection frames P' of the picture z i by the network are obtained. Here, you can use a threshold, such as 0.95, to filter out the detection frames with results lower than 0.95, that is, the untrusted detection frames, and use the remaining detection frames as the pseudo-labeling result P, and use the pseudo-labeling result to determine the loss of the picture
Figure PCTCN2022078350-appb-000019
will lose
Figure PCTCN2022078350-appb-000020
Backpropagation to the neural network to get the gradient
Figure PCTCN2022078350-appb-000021
by
Figure PCTCN2022078350-appb-000022
as the expected gradient for unlabeled samples
Figure PCTCN2022078350-appb-000023
这里,在得到s test之后我们为每一个未标注样本z i确定
Figure PCTCN2022078350-appb-000024
通过确定
Figure PCTCN2022078350-appb-000025
来确定样本z i对模型性能的影响,这里,可以将
Figure PCTCN2022078350-appb-000026
记为I(z i,R)。I(z i,R)值越负,则样本z i可以为网络性能带来越正向的影响。选择值最负的N个样本进行标注并加入到第一已标注样本中,即可得到更新后训练样本集。
Here, after getting s test we determine for each unlabeled sample z i
Figure PCTCN2022078350-appb-000024
by determining
Figure PCTCN2022078350-appb-000025
To determine the impact of sample z i on model performance, here, you can use
Figure PCTCN2022078350-appb-000026
Denote as I(z i ,R). The more negative the value of I(z i ,R), the more positive impact the sample z i can have on network performance. The N samples with the most negative values are selected for labeling and added to the first labeled sample to obtain an updated training sample set.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与训练样本集生成的方法对应的训练样本集生成的装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述训练样本集生成的方法相似,因此装置的实施可以参见方法的实施。Based on the same inventive concept, the embodiment of the present disclosure also provides a device for generating a training sample set corresponding to the method for generating a training sample set. Since the problem-solving principle of the device in the embodiment of the present disclosure is the same as that of the above-mentioned training sample set in the embodiment of the present disclosure The generated method is similar, so the implementation of the device can refer to the implementation of the method.
参照图3所示,为本公开实施例提供的一种训练样本集生成的装置的结构示意图,装置包括:获取模块301、确定模块302、选取模块303和生成模块304;其中,Referring to FIG. 3 , it is a schematic structural diagram of a device for generating a training sample set provided by an embodiment of the present disclosure. The device includes: an acquisition module 301, a determination module 302, a selection module 303, and a generation module 304; wherein,
获取模块301,配置为获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;The obtaining module 301 is configured to obtain each unlabeled sample and the target neural network trained based on the training sample set;
确定模块302,配置为基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值;The determination module 302 is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on each unlabeled sample and the target neural network;
选取模块303,配置为从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;The selection module 303 is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample;
生成模块304,配置为在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至训练样本集中,得到更新后训练样本集;更新后训练样本集用于对目标神经网络再次进行网络训练。The generating module 304 is configured to add the target marked sample to the training sample set to obtain the updated training sample set when the target unlabeled sample is sample marked to obtain the target marked sample, and the updated training sample set is used In order to perform network training on the target neural network again.
采用上述训练样本集生成的装置,在获取到各个未标注样本以及目标神经网络的情况下,可以先确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值,进而从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本,这样,在对目标未标注样本进行样本标注后即可以得到目标已标注样本以进行训练样本集的更新。本公开基于预 估影响程度值实现了未标注样本的自动选取,相比人工选取的方案,更为省时省力,也降低了后续的标注成本。Using the above-mentioned device for generating training sample sets, when each unlabeled sample and the target neural network are obtained, it is possible to first determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network, and then from each unlabeled sample. The target unlabeled samples whose estimated impact value meets the preset requirements are selected from the labeled samples. In this way, after the target unlabeled samples are labeled, the target labeled samples can be obtained to update the training sample set. The present disclosure realizes the automatic selection of unlabeled samples based on the estimated influence degree value, which is more time-saving and labor-saving than the manual selection scheme, and also reduces the subsequent labeling cost.
在一种可能的实施方式中,训练样本集中包括各个第一已标注样本;确定模块302,配置为按照以下步骤基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值:In a possible implementation manner, the training sample set includes each first labeled sample; the determining module 302 is configured to determine the contribution of each unlabeled sample to the target neural network based on the following steps: Estimated impact value for network training:
基于各个第一已标注样本以及目标神经网络,确定在基于各个第一已标注样本进行目标神经网络前向传播的过程中,各个第一已标注样本对网络训练参数的预估影响程度和值;以及,Based on each first marked sample and the target neural network, determine the estimated influence degree and value of each first marked sample on the network training parameters during the forward propagation of the target neural network based on each first marked sample; as well as,
基于各个未标注样本以及目标神经网络,确定在基于各个未标注样本进行目标神经网络前向传播的过程中,每个未标注样本对网络训练参数的预估影响程度值;Based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training parameters during the forward propagation of the target neural network based on each unlabeled sample;
基于各个第一已标注样本对网络训练参数的预估影响程度和值以及每个未标注样本对网络训练参数的预估影响程度值,确定每个未标注样本对目标神经网络的网络训练的预估影响程度值。Based on the estimated influence degree and value of each first labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine the network training prediction of each unlabeled sample on the target neural network. Estimate the degree of impact.
在一种可能的实施方式中,确定模块302,配置为按照如下步骤确定预估影响程度和值:In a possible implementation manner, the determination module 302 is configured to determine the estimated impact degree and value according to the following steps:
将各个第一已标注样本中的每个第一已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的梯度和值和海森矩阵和值;其中,梯度和值用于表示每个第一已标注样本对应的梯度值的求和结果,梯度值用于表示在第一已标注样本前向传播的情况下、各个网络参数对损失函数的影响程度;海森矩阵和值用于表示每个第一已标注样本对应的海森矩阵的求和结果,海森矩阵用于表示在第一已标注样本前向传播的情况下、每个网络参数对损失函数的影响程度受其他网络参数的影响程度;Input each first marked sample in each first marked sample into the target neural network, and obtain the gradient sum value and the Hessian matrix sum value corresponding to the loss function of the target neural network; wherein, the gradient sum value is used to represent The summation result of the gradient value corresponding to each first labeled sample, the gradient value is used to represent the degree of influence of each network parameter on the loss function in the case of forward propagation of the first labeled sample; the Hessian matrix sum value is used In order to represent the summation result of the Hessian matrix corresponding to each first labeled sample, the Hessian matrix is used to indicate that in the case of forward propagation of the first labeled sample, the degree of influence of each network parameter on the loss function is affected by other The degree of influence of network parameters;
基于梯度和值和海森矩阵和值的乘积运算,确定预估影响程度和值。Based on the product operation of the gradient sum and the Hessian matrix sum, the estimated influence degree and value are determined.
在一种可能的实施方式中,确定模块302,配置为按照以下步骤基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值:In a possible implementation manner, the determination module 302 is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on each unlabeled sample and the target neural network according to the following steps:
获取训练参考集包括的各个第二已标注样本;训练参考集与训练样本集不存在相同的已标注样本;Obtain each second labeled sample included in the training reference set; the training reference set and the training sample set do not have the same labeled sample;
基于各个第一已标注样本、各个第二已标注样本以及目标神经网络,确定在基于各个第一已标注样本和各个第二已标注样本进行目标神经网络前向传播的过程中,各个第一已标注样本以及各个第二已标注样本对网络训练参数的预估影响程度和值;以及,Based on each first labeled sample, each second labeled sample, and the target neural network, it is determined that each first labeled sample and each second labeled sample are used for forward propagation of the target neural network. The degree and value of the estimated influence of the labeled sample and each second labeled sample on the network training parameters; and,
基于各个未标注样本以及目标神经网络,确定在基于各个未标注样本进行目标神经网络前向传播的过程中,每个未标注样本对网络训练参数的预估影响程度值;Based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training parameters during the forward propagation of the target neural network based on each unlabeled sample;
基于各个第一已标注样本以及各个第二已标注样本对网络训练参数的预估影响程度和值以及每个未标注样本对网络训练参数的预估影响程度值, 确定每个未标注样本对目标神经网络的网络训练的预估影响程度值。Based on the estimated influence degree and value of each first labeled sample and each second labeled sample on the network training parameters and the estimated influence degree value of each unlabeled sample on the network training parameters, determine the impact of each unlabeled sample on the target The estimated influence value of the network training of the neural network.
在一种可能的实施方式中,确定模块302,配置为按照如下步骤确定预估影响程度和值:In a possible implementation manner, the determination module 302 is configured to determine the estimated impact degree and value according to the following steps:
从各个第一已标注样本中选取多个第一已标注样本,并将多个第一已标注样本中的每个第一已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的海森矩阵和值;海森矩阵和值用于表示每个第一已标注样本对应的海森矩阵的求和结果,海森矩阵用于表示在第一已标注样本前向传播的情况下、每个网络参数对损失函数的影响程度受其他网络参数的影响程度;以及,Select multiple first labeled samples from each of the first labeled samples, and input each first labeled sample in the multiple first labeled samples into the target neural network to obtain a loss function corresponding to the target neural network The Hessian matrix and value; the Hessian matrix and the value are used to represent the summation result of the Hessian matrix corresponding to each first labeled sample, and the Hessian matrix is used to represent the forward propagation of the first labeled sample. , the degree to which each network parameter affects the loss function is affected by other network parameters; and,
将各个第二已标注样本中的每个第二已标注样本输入到目标神经网络中,得到目标神经网络的损失函数对应的梯度和值;梯度和值用于表示每个第二已标注样本对应的梯度值的求和结果,梯度值用于表示在第二已标注样本前向传播的情况下、各个网络参数对损失函数的影响程度;Input each second marked sample in each second marked sample into the target neural network to obtain the gradient and value corresponding to the loss function of the target neural network; the gradient and value are used to indicate that each second marked sample corresponds to The summation result of the gradient value of , the gradient value is used to represent the degree of influence of each network parameter on the loss function in the case of forward propagation of the second labeled sample;
基于梯度和值和海森矩阵和值的乘积运算,确定预估影响程度和值。Based on the product operation of the gradient sum and the Hessian matrix sum, the estimated influence degree and value are determined.
在一种可能的实施方式中,确定模块302,配置为按照以下步骤基于梯度和值和海森矩阵和值的乘积运算,确定预估影响程度和值:In a possible implementation manner, the determination module 302 is configured to determine the estimated influence degree and value based on the product operation of the gradient sum value and the Hessian matrix sum value according to the following steps:
针对当前轮迭代运算,确定当前轮迭代运算指向的已标注样本,基于确定的已标注样本对应的海森矩阵、梯度和值、以及上一轮迭代运算对应的预估影响程度和值,确定当前轮迭代运算对应的预估影响程度和值。For the current round of iterative operations, determine the marked samples pointed to by the current round of iterative operations, and determine the current The estimated influence degree and value corresponding to the round iterative operation.
在一种可能的实施方式中,确定模块302,配置为按照以下步骤基于各个未标注样本以及目标神经网络,确定在基于各个未标注样本进行目标神经网络前向传播的过程中,每个未标注样本对网络训练参数的预估影响程度值:In a possible implementation, the determination module 302 is configured to determine, based on each unlabeled sample and the target neural network, in the process of forward propagation of the target neural network based on each unlabeled sample, each unlabeled The value of the estimated influence degree of the sample on the network training parameters:
针对各个未标注样本中的每个未标注样本,将每个未标注样本输入到目标神经网络中,确定目标神经网络输出的针对各个候选预测结果的概率值;For each unlabeled sample in each unlabeled sample, input each unlabeled sample into the target neural network, and determine the probability value for each candidate prediction result output by the target neural network;
基于针对各个候选预测结果的概率值,确定未标注样本的伪标注信息;Based on the probability value for each candidate prediction result, determine the pseudo-label information of the unlabeled sample;
基于伪标注信息,确定在未标注样本前向传播的情况下,目标神经网络的损失函数对应的梯度值;Based on the pseudo-label information, determine the gradient value corresponding to the loss function of the target neural network in the case of forward propagation of unlabeled samples;
将确定的梯度值作为未标注样本对网络训练参数的预估影响程度值。The determined gradient value is used as the estimated influence degree value of the unlabeled sample on the network training parameters.
在一种可能的实施方式中,确定模块302,配置为按照以下步骤基于针对各个候选预测结果的概率值确定未标注样本的伪标注信息:In a possible implementation manner, the determining module 302 is configured to determine the pseudo-labeling information of the unlabeled samples based on the probability values for each candidate prediction result according to the following steps:
在目标神经网络为分类网络、候选预测结果为候选类别的情况下,将概率值最大的候选类别确定为未标注样本的伪标注信息;或者,When the target neural network is a classification network and the candidate prediction result is a candidate category, determine the candidate category with the largest probability value as the pseudo-label information of the unlabeled sample; or,
在目标神经网络包括检测网络、候选预测结果为候选检测框的情况下,将概率值大于第一预设阈值的候选检测框确定为未标注样本的伪标注信息。When the target neural network includes a detection network and the candidate prediction result is a candidate detection frame, the candidate detection frame whose probability value is greater than the first preset threshold is determined as the pseudo-labeled information of the unlabeled sample.
在一种可能的实施方式中,选取模块303,配置为按照以下步骤从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本:In a possible implementation manner, the selection module 303 is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample according to the following steps:
选取预估影响程度值大于第二预设阈值的未标注样本作为目标未标注样本;或者,Selecting an unlabeled sample with an estimated influence degree value greater than a second preset threshold as a target unlabeled sample; or,
按照预估影响程度值由大到小的顺序对各个未标注样本进行排序,根据排序结果确定目标未标注样本。Sort each unlabeled sample in descending order of the estimated impact value, and determine the target unlabeled sample according to the sorting result.
在一种可能的实施方式中,生成模块304,还配置为:In a possible implementation manner, the generating module 304 is further configured to:
得到更新后训练样本集之后,循环执行下述步骤,直至达到循环截止条件,得到更新后目标神经网络:After obtaining the updated training sample set, perform the following steps in a loop until the loop cut-off condition is reached, and the updated target neural network is obtained:
从各个未标注样本中筛除目标未标注样本,得到更新后的各个未标注样本;以及,确定基于更新后训练样本集训练得到的更新后目标神经网络;更新后训练样本集中包括各个第一已标注样本和目标已标注样本;Screen out the target unlabeled samples from each unlabeled sample to obtain each updated unlabeled sample; and determine the updated target neural network based on the updated training sample set training; the updated training sample set includes each first already Labeled samples and target labeled samples;
基于更新后的各个未标注样本、更新后目标神经网络,确定更新后的各个未标注样本对更新后目标神经网络的网络训练的预估影响程度值;Based on the updated unlabeled samples and the updated target neural network, determine the estimated influence degree value of the updated unlabeled samples on the network training of the updated target neural network;
从更新后的各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;From the updated unlabeled samples, select the target unlabeled samples whose estimated influence degree value meets the preset requirements;
在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至更新后训练样本集中,得到用于对更新后目标神经网络进行训练的更新后训练样本集。In the case of sample labeling the selected target unlabeled samples to obtain the target labeled samples, add the target labeled samples to the updated training sample set to obtain an updated training sample set for training the updated target neural network .
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the device and the interaction flow between the modules, reference may be made to the relevant description in the above method embodiment, and details will not be described here.
本公开实施例还提供了一种电子设备,如图4所示,为本公开实施例提供的电子设备的结构示意图,包括:处理器401、存储器402、和总线403。存储器402存储有处理器401可执行的机器可读指令(比如,图3中的装置中获取模块301、确定模块302、选取模块303和生成模块304对应的执行指令等),当电子设备运行时,处理器401与存储器402之间通过总线403通信,机器可读指令被处理器401执行时执行如下处理:The embodiment of the present disclosure also provides an electronic device, as shown in FIG. 4 , which is a schematic structural diagram of the electronic device provided by the embodiment of the present disclosure, including: a processor 401 , a memory 402 , and a bus 403 . The memory 402 stores machine-readable instructions executable by the processor 401 (for example, the execution instructions corresponding to the acquisition module 301, the determination module 302, the selection module 303, and the generation module 304 in the device in FIG. , the processor 401 communicates with the memory 402 through the bus 403, and when the machine-readable instructions are executed by the processor 401, the following processing is performed:
获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;Obtain each unlabeled sample and the target neural network trained based on the training sample set;
基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值;Based on each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network;
从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;Select the target unlabeled samples whose estimated influence degree value meets the preset requirements from each unlabeled sample;
在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至训练样本集中,得到更新后训练样本集;更新后训练样本集用于对目标神经网络再次进行网络训练。In the case of labeling the selected target unlabeled samples to obtain the target labeled samples, the target labeled samples are added to the training sample set to obtain the updated training sample set; the updated training sample set is used to retrain the target neural network Do network training.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的训练样本集生成的方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the method for generating the training sample set described in the above-mentioned method embodiment is executed. step. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例还提供一种计算机程序,计算机程序包括计算机可读代 码,在计算机可读代码在电子设备中运行的情况下,电子设备的处理器执行如上述任一实施例所述的训练样本集生成的方法的步骤。An embodiment of the present disclosure also provides a computer program. The computer program includes computer readable codes. When the computer readable codes run in the electronic device, the processor of the electronic device executes the training samples as described in any of the above embodiments. The steps of the method for set generation.
本公开实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可配置为执行上述方法实施例中所述的训练样本集生成的方法的步骤,可参见上述方法实施例。Embodiments of the present disclosure also provide a computer program product, the computer program product carries program code, and the instructions included in the program code can be configured to execute the steps of the method for generating the training sample set described in the method embodiment above, which can be See the method example above.
其中,上述计算机程序产品可以通过硬件、软件或其结合的方式实现。在一些实施例中,所述计算机程序产品可以体现为计算机存储介质,在另一些实施例中,计算机程序产品可以体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the above-mentioned computer program product may be realized by hardware, software or a combination thereof. In some embodiments, the computer program product may be embodied as a computer storage medium, and in other embodiments, the computer program product may be embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
本公开实施例中涉及的设备可以是系统、方法和计算机程序产品中的至少之一。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The device involved in the embodiments of the present disclosure may be at least one of a system, a method, and a computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦除可编程只读存储器(Electrical Programmable Read Only Memory,EPROM)或闪存、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. Examples of computer-readable storage media (a non-exhaustive list) include: portable computer disks, hard disks, Random Access Memory (RAM), Read-Only Memory (ROM), erasable Electrical Programmable Read Only Memory (EPROM) or flash memory, Static Random-Access Memory (Static Random-Access Memory, SRAM), Portable Compact Disc Read-Only Memory (CD-ROM), Digital Video Discs (DVDs), memory sticks, floppy disks, mechanically encoded devices such as punched cards or raised structures in grooves with instructions stored thereon, and any suitable combination of the foregoing. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和无线网中的至少之一下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和边缘服务器中的至少之一。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over at least one of a network, such as the Internet, a local area network, a wide area network, and a wireless network. . The network may include at least one of copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(Industry Standard Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言,诸如“C”语言或类似 的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、FPGA或可编程逻辑阵列(Programmable Logic Arrays,PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing the operations of the present disclosure may be assembly instructions, Industry Standard Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or in one or more source or object code written in any combination of programming languages, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the “C” language or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (for example, using Internet Service Provider to connect via the Internet). In some embodiments, electronic circuits, such as programmable logic circuits, FPGAs, or programmable logic arrays (Programmable Logic Arrays, PLAs), can be customized by using state information of computer-readable program instructions, which can execute computer-readable Read program instructions, thereby implementing various aspects of the present disclosure.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of description, for the specific working process of the system and device described above, reference can be made to the corresponding process in the foregoing method embodiments. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、随机存取存储器RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the essence of the technical solution of the present disclosure or the part that contributes to the related technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several The instructions are used to make an electronic device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, random access memory RAM, magnetic disk or optical disk.
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围 内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.
工业实用性Industrial Applicability
本公开提供了一种训练样本集生成的方法、装置、电子设备、存储介质及程序,其中,该方法包括:获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;基于各个未标注样本、目标神经网络,确定各个未标注样本分别对目标神经网络的网络训练的预估影响程度值;从各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;在对选取的目标未标注样本进行样本标注得到目标已标注样本的情况下,将目标已标注样本添加至训练样本集中,得到更新后训练样本集;更新后训练样本集用于对目标神经网络再次进行网络训练。The present disclosure provides a method, device, electronic device, storage medium, and program for generating a training sample set, wherein the method includes: obtaining each unlabeled sample and the target neural network trained based on the training sample set; Label the samples and the target neural network, and determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network; select the target unlabeled sample whose estimated influence degree value meets the preset requirements from each unlabeled sample; When the selected target unlabeled sample is sample-labeled to obtain the target labeled sample, the target labeled sample is added to the training sample set to obtain the updated training sample set; the updated training sample set is used to re-train the target neural network. network training.

Claims (14)

  1. 一种训练样本集生成的方法,所述方法由电子设备执行,所述方法包括:A method for generating a training sample set, the method being executed by an electronic device, the method comprising:
    获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;Obtain each unlabeled sample and the target neural network trained based on the training sample set;
    基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值;Based on each of the unlabeled samples and the target neural network, determine the estimated influence degree value of each of the unlabeled samples on the network training of the target neural network;
    从所述各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;Selecting target unlabeled samples whose estimated influence degree value meets the preset requirements from each of the unlabeled samples;
    在对选取的所述目标未标注样本进行样本标注得到目标已标注样本的情况下,将所述目标已标注样本添加至所述训练样本集中,得到更新后训练样本集;所述更新后训练样本集用于对所述目标神经网络再次进行网络训练。In the case of performing sample labeling on the selected target unlabeled samples to obtain target labeled samples, adding the target labeled samples to the training sample set to obtain an updated training sample set; the updated training samples The set is used to perform network training on the target neural network again.
  2. 根据权利要求1所述的方法,其中,所述训练样本集中包括各个第一已标注样本;所述基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值,包括:The method according to claim 1, wherein the training sample set includes each first labeled sample; and based on the each unlabeled sample and the target neural network, determining that each unlabeled sample has a corresponding The estimated influence degree value of the network training of the target neural network, including:
    基于所述各个第一已标注样本以及所述目标神经网络,确定在基于所述各个第一已标注样本进行目标神经网络前向传播的过程中,所述各个第一已标注样本对网络训练参数的预估影响程度和值;以及,Based on the respective first marked samples and the target neural network, determine the network training parameters of the respective first marked samples during the forward propagation of the target neural network based on the respective first marked samples The magnitude and value of the estimated impact of ; and,
    基于所述各个未标注样本以及所述目标神经网络,确定在基于所述各个未标注样本进行目标神经网络前向传播的过程中,每个所述未标注样本对网络训练参数的预估影响程度值;Based on each of the unlabeled samples and the target neural network, determine the estimated influence degree of each of the unlabeled samples on the network training parameters during the forward propagation of the target neural network based on the respective unlabeled samples. value;
    基于所述各个第一已标注样本对网络训练参数的预估影响程度和值以及每个所述未标注样本对网络训练参数的预估影响程度值,确定每个所述未标注样本对所述目标神经网络的网络训练的预估影响程度值。Based on the estimated influence degree and value of each of the first labeled samples on the network training parameters and the estimated influence degree value of each of the unlabeled samples on the network training parameters, determine the impact of each of the unlabeled samples on the The estimated influence value of network training for the target neural network.
  3. 根据权利要求2所述的方法,其中,按照如下步骤确定所述预估影响程度和值:The method according to claim 2, wherein the estimated influence degree and value are determined according to the following steps:
    将所述各个第一已标注样本中的每个所述第一已标注样本输入到所述目标神经网络中,得到所述目标神经网络的损失函数对应的梯度和值和海森矩阵和值;其中,所述梯度和值用于表示每个所述第一已标注样本对应的梯度值的求和结果,所述梯度值用于表示在所述第一已标注样本前向传播的情况下、各个网络参数对所述损失函数的影响程度;所述海森矩阵和值用于表示每个所述第一已标注样本对应的海森矩阵的求和结果,所述海森矩阵用于表示在所述第一已标注样本前向传播的情况下、每个网络参数对所述损失函数的影响程度受其他网络参数的影响程度;Input each of the first labeled samples in the first labeled samples into the target neural network to obtain a gradient sum and a Hessian matrix sum corresponding to a loss function of the target neural network; Wherein, the gradient sum value is used to represent the summation result of the gradient value corresponding to each of the first labeled samples, and the gradient value is used to represent that in the case of forward propagation of the first labeled sample, The degree of influence of each network parameter on the loss function; the Hessian matrix and the value are used to represent the summation result of the Hessian matrix corresponding to each of the first marked samples, and the Hessian matrix is used to represent the sum of the Hessian matrix in In the case of forward propagation of the first labeled sample, the degree of influence of each network parameter on the loss function is affected by the degree of influence of other network parameters;
    基于所述梯度和值和所述海森矩阵和值的乘积运算,确定所述预估影响程度和值。The estimated influence degree and value are determined based on a product operation of the gradient sum value and the Hessian matrix sum value.
  4. 根据权利要求2所述的方法,其中,所述基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值,包括:The method according to claim 2, wherein, based on the each unlabeled sample and the target neural network, determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network ,include:
    获取训练参考集包括的各个第二已标注样本;所述训练参考集与所述训练样本集不存在相同的已标注样本;Obtaining each second labeled sample included in the training reference set; the training reference set does not have the same labeled sample as the training sample set;
    基于所述各个第一已标注样本、所述各个第二已标注样本以及所述目标神经网络,确定在基于所述各个第一已标注样本和所述各个第二已标注样本进行目标神经网络前向传播的过程中,所述各个第一已标注样本以及所述各个第二已标注样本对网络训练参数的预估影响程度和值;以及,Based on the respective first marked samples, the respective second marked samples and the target neural network, determine the target neural network based on the respective first marked samples and the respective second marked samples before performing the target neural network In the process of forward propagation, the estimated influence degree and value of each of the first marked samples and each of the second marked samples on the network training parameters; and,
    基于所述各个未标注样本以及所述目标神经网络,确定在基于所述各个未标注样本进行目标神经网络前向传播的过程中,每个所述未标注样本对网络训练参数的预估影响程度值;Based on each of the unlabeled samples and the target neural network, determine the estimated influence degree of each of the unlabeled samples on the network training parameters during the forward propagation of the target neural network based on the respective unlabeled samples. value;
    基于所述各个第一已标注样本以及所述各个第二已标注样本对网络训练参数的预估影响程度和值以及每个所述未标注样本对网络训练参数的预估影响程度值,确定每个所述未标注样本对所述目标神经网络的网络训练的预估影响程度值。Determine each The estimated influence degree value of the unlabeled samples on the network training of the target neural network.
  5. 根据权利要求4所述的方法,其中,按照如下步骤确定所述预估影响程度和值:The method according to claim 4, wherein the estimated influence degree and value are determined according to the following steps:
    从所述各个第一已标注样本中选取多个第一已标注样本,并将所述多个第一已标注样本中的每个所述第一已标注样本输入到所述目标神经网络中,得到所述目标神经网络的损失函数对应的海森矩阵和值;所述海森矩阵和值用于表示每个所述第一已标注样本对应的海森矩阵的求和结果,所述海森矩阵用于表示在所述第一已标注样本前向传播的情况下、每个网络参数对所述损失函数的影响程度受其他网络参数的影响程度;以及,selecting a plurality of first labeled samples from the respective first labeled samples, and inputting each of the first labeled samples in the plurality of first labeled samples into the target neural network, Obtain the Hessian matrix and value corresponding to the loss function of the target neural network; the Hessian matrix and value are used to represent the summation result of the Hessian matrix corresponding to each of the first marked samples, and the Hessian The matrix is used to represent the degree of influence of each network parameter on the loss function by the degree of influence of other network parameters in the case of forward propagation of the first labeled sample; and,
    将所述各个第二已标注样本中的每个第二已标注样本输入到所述目标神经网络中,得到所述目标神经网络的损失函数对应的梯度和值;所述梯度和值用于表示每个所述第二已标注样本对应的梯度值的求和结果,所述梯度值用于表示在所述第二已标注样本前向传播的情况下、各个网络参数对所述损失函数的影响程度;Input each of the second marked samples in the respective second marked samples into the target neural network to obtain the gradient and value corresponding to the loss function of the target neural network; the gradient and value are used to represent A summation result of gradient values corresponding to each of the second labeled samples, where the gradient values are used to represent the influence of each network parameter on the loss function in the case of forward propagation of the second labeled samples degree;
    基于所述梯度和值和所述海森矩阵和值的乘积运算,确定所述预估影响程度和值。The estimated influence degree and value are determined based on a product operation of the gradient sum value and the Hessian matrix sum value.
  6. 根据权利要求3或5所述的方法,其中,所述基于所述梯度和值和所述海森矩阵和值的乘积运算,确定所述预估影响程度和值,包括:The method according to claim 3 or 5, wherein said determining the estimated influence degree and value based on the product operation of said gradient sum value and said Hessian matrix sum value comprises:
    针对当前轮迭代运算,确定当前轮迭代运算指向的已标注样本;For the current round of iterative operation, determine the marked samples pointed to by the current round of iterative operation;
    基于确定的所述已标注样本对应的海森矩阵、所述梯度和值、以及上一轮迭代运算对应的预估影响程度和值,确定所述当前轮迭代运算对应的预估影响程度和值。Based on the determined Hessian matrix corresponding to the marked sample, the gradient sum value, and the estimated influence degree and value corresponding to the previous round of iterative operation, determine the estimated influence degree and value corresponding to the current round of iterative operation .
  7. 根据权利要求2至6任一所述的方法,其中,所述基于所述各个未 标注样本以及所述目标神经网络,确定在基于所述各个未标注样本进行目标神经网络前向传播的过程中,每个所述未标注样本对网络训练参数的预估影响程度值,包括:The method according to any one of claims 2 to 6, wherein, based on the respective unlabeled samples and the target neural network, it is determined that in the process of forward propagation of the target neural network based on the respective unlabeled samples , each of the unlabeled samples has an estimated degree of influence on the network training parameters, including:
    针对各个未标注样本中的每个所述未标注样本,将每个所述未标注样本输入到所述目标神经网络中,确定目标神经网络输出的针对各个候选预测结果的概率值;For each of the unlabeled samples in each unlabeled sample, input each of the unlabeled samples into the target neural network, and determine the probability value for each candidate prediction result output by the target neural network;
    基于所述针对各个候选预测结果的概率值,确定所述未标注样本的伪标注信息;Based on the probability value for each candidate prediction result, determine the pseudo-label information of the unlabeled sample;
    基于所述伪标注信息,确定在所述未标注样本前向传播的情况下,所述目标神经网络的损失函数对应的梯度值;Based on the pseudo-label information, determine the gradient value corresponding to the loss function of the target neural network in the case of forward propagation of the unlabeled sample;
    将确定的所述梯度值作为所述未标注样本对网络训练参数的预估影响程度值。The determined gradient value is used as an estimated influence degree value of the unlabeled sample on the network training parameters.
  8. 根据权利要求7所述的方法,其中,所述基于所述针对各个候选预测结果的概率值,确定所述未标注样本的伪标注信息,包括:The method according to claim 7, wherein the determining the pseudo-labeling information of the unlabeled samples based on the probability values for each candidate prediction result comprises:
    在所述目标神经网络为分类网络、所述候选预测结果为候选类别的情况下,将概率值最大的候选类别确定为所述未标注样本的伪标注信息;或者,When the target neural network is a classification network and the candidate prediction result is a candidate category, determining the candidate category with the largest probability value as the pseudo-label information of the unlabeled sample; or,
    在所述目标神经网络包括检测网络、所述候选预测结果为候选检测框的情况下,将概率值大于第一预设阈值的候选检测框确定为所述未标注样本的伪标注信息。When the target neural network includes a detection network and the candidate prediction result is a candidate detection frame, determine a candidate detection frame with a probability value greater than a first preset threshold as the pseudo-label information of the unlabeled sample.
  9. 根据权利要求1至8任一所述的方法,其中,所述从所述各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本,包括:The method according to any one of claims 1 to 8, wherein the selection of target unlabeled samples whose estimated impact degree values meet the preset requirements from the various unlabeled samples includes:
    选取预估影响程度值大于第二预设阈值的未标注样本,作为所述目标未标注样本;或者,Selecting an unlabeled sample with an estimated influence degree value greater than a second preset threshold as the target unlabeled sample; or,
    按照预估影响程度值由大到小的顺序对所述各个未标注样本进行排序,根据排序结果确定所述目标未标注样本。The unlabeled samples are sorted in descending order of estimated influence degree values, and the target unlabeled samples are determined according to the sorting results.
  10. 根据权利要求1至9任一所述的方法,其中,所述得到更新后训练样本集之后,所述方法还包括:The method according to any one of claims 1 to 9, wherein, after obtaining the updated training sample set, the method further comprises:
    循环执行下述步骤,直至达到循环截止条件,得到更新后目标神经网络:Perform the following steps in a loop until the loop cut-off condition is reached, and the updated target neural network is obtained:
    从各个未标注样本中筛除所述目标未标注样本,得到更新后的各个未标注样本;以及,确定基于所述更新后训练样本集训练得到的更新后目标神经网络;其中,所述更新后训练样本集中包括各个第一已标注样本和所述目标已标注样本;Screen out the target unlabeled samples from each unlabeled sample to obtain each updated unlabeled sample; and determine an updated target neural network trained based on the updated training sample set; wherein, the updated The training sample set includes each first labeled sample and the target labeled sample;
    基于所述更新后的各个未标注样本、所述更新后目标神经网络,确定所述更新后的各个未标注样本对所述更新后目标神经网络的网络训练的预估影响程度值;Based on each of the updated unlabeled samples and the updated target neural network, determine an estimated influence degree value of each of the updated unlabeled samples on the network training of the updated target neural network;
    从所述更新后的各个未标注样本中选取预估影响程度值符合预设要求 的目标未标注样本;Select the target unlabeled samples whose estimated impact value meets the preset requirements from each of the updated unlabeled samples;
    在对选取的所述目标未标注样本进行样本标注得到目标已标注样本的情况下,将所述目标已标注样本添加至所述更新后训练样本集中,得到用于对所述更新后目标神经网络进行训练的更新后训练样本集。In the case of performing sample labeling on the selected target unlabeled samples to obtain target labeled samples, adding the target labeled samples to the updated training sample set to obtain a neural network for the updated target neural network The updated training sample set for training.
  11. 一种训练样本集生成的装置,所述装置包括:A device for generating a training sample set, the device comprising:
    获取模块,配置为获取各个未标注样本、以及基于训练样本集训练得到的目标神经网络;An acquisition module configured to acquire each unlabeled sample and the target neural network trained based on the training sample set;
    确定模块,配置为基于所述各个未标注样本、所述目标神经网络,确定所述各个未标注样本分别对所述目标神经网络的网络训练的预估影响程度值;The determination module is configured to determine the estimated influence degree value of each unlabeled sample on the network training of the target neural network based on the respective unlabeled samples and the target neural network;
    选取模块,配置为从所述各个未标注样本中选取预估影响程度值符合预设要求的目标未标注样本;The selection module is configured to select target unlabeled samples whose estimated influence degree value meets the preset requirements from each of the unlabeled samples;
    生成模块,配置为在对选取的所述目标未标注样本进行样本标注得到目标已标注样本的情况下,将所述目标已标注样本添加至所述训练样本集中,得到更新后训练样本集;所述更新后训练样本集用于对所述目标神经网络再次进行网络训练。The generation module is configured to add the target labeled samples to the training sample set to obtain an updated training sample set when the target unlabeled sample is sample labeled to obtain the target labeled sample; The updated training sample set is used to perform network training on the target neural network again.
  12. 一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至10任一所述的训练样本集生成的方法的步骤。An electronic device, comprising: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus , when the machine-readable instructions are executed by the processor, the steps of the method for generating the training sample set according to any one of claims 1 to 10 are executed.
  13. 一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至10任一所述的训练样本集生成的方法的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the method for generating a training sample set according to any one of claims 1 to 10 are executed.
  14. 一种计算机程序,所述计算机程序包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备的处理器执行用于实现如权利要求1至10任一所述的训练样本集生成的方法的步骤。A computer program, the computer program comprising computer readable code, in the case of the computer readable code running in an electronic device, the processor of the electronic device executes to implement any one of claims 1 to 10 The steps of the method for generating the training sample set.
PCT/CN2022/078350 2021-08-19 2022-02-28 Method and apparatus for generating training sample set, and electronic device, storage medium and program WO2023019908A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110953373.0A CN113642659B (en) 2021-08-19 2021-08-19 Training sample set generation method and device, electronic equipment and storage medium
CN202110953373.0 2021-08-19

Publications (1)

Publication Number Publication Date
WO2023019908A1 true WO2023019908A1 (en) 2023-02-23

Family

ID=78422847

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078350 WO2023019908A1 (en) 2021-08-19 2022-02-28 Method and apparatus for generating training sample set, and electronic device, storage medium and program

Country Status (2)

Country Link
CN (1) CN113642659B (en)
WO (1) WO2023019908A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701931A (en) * 2023-05-24 2023-09-05 中国长江三峡集团有限公司 Water quality parameter inversion method and device, storage medium and electronic equipment

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642659B (en) * 2021-08-19 2023-06-20 上海商汤科技开发有限公司 Training sample set generation method and device, electronic equipment and storage medium
CN114090601B (en) * 2021-11-23 2023-11-03 北京百度网讯科技有限公司 Data screening method, device, equipment and storage medium
CN114443849B (en) 2022-02-09 2023-10-27 北京百度网讯科技有限公司 Labeling sample selection method and device, electronic equipment and storage medium
CN115913413B (en) * 2023-02-22 2023-07-14 西安电子科技大学 Intelligent space millimeter wave propagation characteristic analysis method
CN116664028B (en) * 2023-08-01 2024-01-19 深圳市汉德网络科技有限公司 Cargo flow direction control method and device of transport vehicle and transport vehicle
CN116737607B (en) * 2023-08-16 2023-11-21 之江实验室 Sample data caching method, system, computer device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180004719A1 (en) * 2014-03-17 2018-01-04 Yahoo Holdings, Inc. Visual recognition using social links
CN110245721A (en) * 2019-06-25 2019-09-17 深圳市腾讯计算机系统有限公司 Training method, device and the electronic equipment of neural network model
CN111126574A (en) * 2019-12-30 2020-05-08 腾讯科技(深圳)有限公司 Method and device for training machine learning model based on endoscopic image and storage medium
CN111539443A (en) * 2020-01-22 2020-08-14 北京小米松果电子有限公司 Image recognition model training method and device and storage medium
CN113177119A (en) * 2021-05-07 2021-07-27 北京沃东天骏信息技术有限公司 Text classification model training and classifying method and system and data processing system
CN113642659A (en) * 2021-08-19 2021-11-12 上海商汤科技开发有限公司 Training sample set generation method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002461B (en) * 2018-06-04 2023-04-18 平安科技(深圳)有限公司 Handwriting model training method, text recognition method, device, equipment and medium
CN113128677A (en) * 2020-01-10 2021-07-16 北京百度网讯科技有限公司 Model generation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180004719A1 (en) * 2014-03-17 2018-01-04 Yahoo Holdings, Inc. Visual recognition using social links
CN110245721A (en) * 2019-06-25 2019-09-17 深圳市腾讯计算机系统有限公司 Training method, device and the electronic equipment of neural network model
CN111126574A (en) * 2019-12-30 2020-05-08 腾讯科技(深圳)有限公司 Method and device for training machine learning model based on endoscopic image and storage medium
CN111539443A (en) * 2020-01-22 2020-08-14 北京小米松果电子有限公司 Image recognition model training method and device and storage medium
CN113177119A (en) * 2021-05-07 2021-07-27 北京沃东天骏信息技术有限公司 Text classification model training and classifying method and system and data processing system
CN113642659A (en) * 2021-08-19 2021-11-12 上海商汤科技开发有限公司 Training sample set generation method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701931A (en) * 2023-05-24 2023-09-05 中国长江三峡集团有限公司 Water quality parameter inversion method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113642659B (en) 2023-06-20
CN113642659A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
WO2023019908A1 (en) Method and apparatus for generating training sample set, and electronic device, storage medium and program
US10958748B2 (en) Resource push method and apparatus
US10540573B1 (en) Story cycle time anomaly prediction and root cause identification in an agile development environment
US11880764B2 (en) Method, product, and system for detecting malicious network activity using a graph mixture density neural network
CN110533097A (en) A kind of image definition recognition methods, device, electronic equipment and storage medium
KR20190117713A (en) Neural Network Architecture Optimization
WO2019062413A1 (en) Method and apparatus for managing and controlling application program, storage medium, and electronic device
CN111708876B (en) Method and device for generating information
US20200177634A1 (en) Hybrid Network Infrastructure Management
JP2020533692A (en) Methods, systems, and computer programs for updating training data
JP2019519042A (en) Method and device for pushing information
CN110245757B (en) Image sample processing method and device, electronic equipment and storage medium
CN110929807A (en) Training method of image classification model, and image classification method and device
CN113906452A (en) Low resource entity resolution with transfer learning
US11488014B2 (en) Automated selection of unannotated data for annotation based on features generated during training
CN111814759B (en) Method and device for acquiring face quality label value, server and storage medium
US20210216904A1 (en) Knowledge Aided Feature Engineering
CN112070310A (en) Loss user prediction method and device based on artificial intelligence and electronic equipment
CN112329762A (en) Image processing method, model training method, device, computer device and medium
CN110598869A (en) Sequence model based classification method and device and electronic equipment
US11275994B2 (en) Unstructured key definitions for optimal performance
WO2023029397A1 (en) Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product
CN111768242A (en) Order-placing rate prediction method, device and readable storage medium
CN111126626A (en) Training method, device, server, platform and storage medium
CN113378067B (en) Message recommendation method, device and medium based on user mining

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE