WO2021248791A1 - 数据增强策略的更新方法、装置、设备及存储介质 - Google Patents

数据增强策略的更新方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021248791A1
WO2021248791A1 PCT/CN2020/125967 CN2020125967W WO2021248791A1 WO 2021248791 A1 WO2021248791 A1 WO 2021248791A1 CN 2020125967 W CN2020125967 W CN 2020125967W WO 2021248791 A1 WO2021248791 A1 WO 2021248791A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
strategy
training
data enhancement
stage
Prior art date
Application number
PCT/CN2020/125967
Other languages
English (en)
French (fr)
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 北京市商汤科技开发有限公司
Priority to JP2021569392A priority Critical patent/JP2022541370A/ja
Priority to KR1020217038153A priority patent/KR20220004692A/ko
Publication of WO2021248791A1 publication Critical patent/WO2021248791A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • the embodiments of the present disclosure relate to the field of machine learning, and relate to an update method, device, device, and storage medium of a data enhancement strategy.
  • the application effect of deep learning technology relies on a large amount of training data, and the data processing model trained on a limited amount of training data usually has an overfitting phenomenon.
  • automatic data enhancement technology is gradually used to increase the amount and diversity of training data.
  • Automatic data enhancement technology refers to the automatic data enhancement process through automatic machine learning technology. Therefore, it is very important to find a suitable data enhancement strategy.
  • the data enhancement strategy can be optimized through the reinforcement learning algorithm based on the training effect of the data processing model.
  • the embodiments of the present disclosure provide a method, device, device, and storage medium for updating a data enhancement strategy.
  • the embodiments of the present disclosure provide a method for updating a data enhancement strategy, including:
  • the data enhancement strategy and the preset training data perform the second-stage training on the preset data processing model that has undergone the first-stage training
  • the data enhancement strategy is updated to obtain the updated data enhancement strategy.
  • the method further includes:
  • the data enhancement strategy is updated for the M+1th time.
  • the number of the initial data enhancement strategies is multiple, and the updating of each of the data enhancement strategies is performed in parallel; the method further includes:
  • each of the data enhancement strategies except for the optimal strategy is replaced with the optimal data enhancement strategy.
  • the data enhancement strategy includes a plurality of preset data enhancement operations; according to the data enhancement strategy and the preset training data, the data that has undergone the first stage of training is preset Process the model for the second stage of training, including:
  • the second-stage training is performed on the data processing model after the first-stage training through the training data after data enhancement.
  • the updating the data enhancement strategy according to the data processing model trained in the second stage includes:
  • the updated data enhancement strategy is selected from each of the preset strategies.
  • the updating the preset strategy model according to the data processing model trained in the second stage includes:
  • the data processing model trained in the second stage is tested, and the test result is obtained;
  • the strategy model is updated according to the historical inspection result and the inspection result.
  • the updating the strategy model according to the historical inspection result and the inspection result includes:
  • the strategy parameter in the strategy model is updated.
  • the method before the obtaining the initial data enhancement strategy, the method further includes:
  • the data enhancement strategy in the first-stage training is uniformly and randomly selected;
  • embodiments of the present disclosure provide a data processing method, including:
  • the data to be processed is processed through a pre-trained data processing model.
  • the data processing model sequentially undergoes the first stage of training and the second stage of training.
  • a preset data enhancement strategy is adopted
  • the data processing model is trained with preset training data, and the data enhancement strategy is generated using the method described in the first aspect or each possible implementation manner of the first aspect.
  • the method further includes:
  • the second stage training is performed on the data processing model trained in the first stage.
  • the performing the first stage training on the data processing model according to the training data includes:
  • the data enhancement strategy in the first-stage training is uniformly and randomly selected;
  • the to-be-processed data and the training data are image data or text data.
  • an update device for a data enhancement strategy including:
  • the acquisition part is configured to acquire the initial data enhancement strategy
  • the training part is configured to perform second-stage training on the preset data processing model that has undergone the first-stage training according to the data enhancement strategy and preset training data;
  • the update part is configured to update the data enhancement strategy according to the data processing model trained in the second stage to obtain the updated data enhancement strategy.
  • an embodiment of the present disclosure provides a data processing device, including:
  • the obtaining part is configured to obtain the data to be processed
  • the processing part is configured to process the to-be-processed data through a pre-trained data processing model.
  • the data processing model sequentially undergoes the first stage of training and the second stage of training, and passes through the second training stage.
  • the preset data enhancement strategy and preset training data train the data processing model, and the data enhancement strategy is generated using the method described in the first aspect or each possible implementation manner of the first aspect.
  • an electronic device including:
  • the memory is used to store program instructions
  • the processor is configured to call program instructions in the memory to execute the method described in the first aspect, each possible implementation manner of the first aspect, the second aspect, or each possible implementation manner of the second aspect.
  • the embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored.
  • the computer program When the computer program is executed, it implements the first aspect and the possible implementation manners of the first aspect, The method described in the second aspect, or each possible implementation manner of the second aspect.
  • the embodiments of the present disclosure provide a computer program, including computer-readable code.
  • the processor in the electronic device executes the Aspect, each possible implementation manner of the first aspect, the second aspect, or the method described in each possible implementation manner of the second aspect.
  • the training phase of the data processing model is divided into the first stage and the second stage before and after the two phases.
  • the data enhancement strategy and the training data are used to update the data enhancement strategy.
  • the data processing model trained in the first stage is trained in the second stage, and then the data enhancement strategy is updated based on the data processing model trained in the second stage, so that the data processing model does not need to be trained from scratch during the update process of the data enhancement strategy. While ensuring the quality of the data enhancement strategy, the efficiency of generating the data enhancement strategy is improved.
  • the generated data enhancement strategy can be applied to the same type of training data and is transferable.
  • Figure 1 is an example diagram of the relationship between data enhancement and the training effect of an image classification model
  • FIG. 2 is a schematic diagram of a network architecture provided by an embodiment of the disclosure.
  • FIG. 3 is a schematic flowchart of a method for updating a data enhancement strategy provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure.
  • FIG. 7 is an example diagram of parallel updating of multiple data enhancement strategies provided by another embodiment of the present disclosure.
  • FIG. 8 is a schematic flowchart of a data processing method provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an update device for a data enhancement strategy provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a data processing device provided by an embodiment of the disclosure.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the disclosure.
  • Fig. 12 is a block diagram of a device for updating a data enhancement strategy provided according to this embodiment.
  • the first-stage training and the second-stage training refer to the total number of training of the data processing model, and the training of the data processing model is divided into the first-stage training and the second-stage training in the order of front and back.
  • the total number of training times of the data processing model is preset to 300 times
  • the first 100 times of training may be referred to as the first stage of training
  • the last 200 times of training may be referred to as the second stage of training.
  • the number of training times in the first phase of training and the number of training times in the second phase of training are not limited.
  • Data enhancement operation refers to the operation of fine-tuning the training data to increase the data volume and diversity of the training data. For example, taking image data as an example, the size and color of the image data are adjusted.
  • Data enhancement strategy refers to a data enhancement program for training data.
  • the data enhancement strategy includes data enhancement operations.
  • the data enhancement operation in the data enhancement strategy is horizontal cropping of the image, and the cropping amplitude corresponding to the horizontal cropping of the image is 0.1 width, that is, the width of each horizontal cropping of the image is 10% of the original width of the image.
  • Deep learning technology is widely used in many fields and has achieved remarkable results.
  • deep learning technology can handle tasks such as image classification, target detection, image segmentation, and human pose estimation.
  • the data processing model using deep learning technology usually needs to be trained on a large amount of training data, otherwise the trained model will appear over-fitting. Therefore, data enhancement has become a common way to increase the amount and diversity of training data, and designing an appropriate data enhancement strategy has become a key factor in improving the training effect of data processing models.
  • data enhancement strategies can be manually designed by professionals, but this method not only has high time and personnel costs, but also has low reusability of data enhancement strategies, and is usually only suitable for training specific data processing models.
  • the method of automatically generating data enhancement strategies can not only improve the efficiency of data enhancement strategy generation, but also generate better data enhancement strategies.
  • the data enhancement strategy can be optimized through a reinforcement learning algorithm based on the training effect of the data processing model.
  • the inventor conjectures that the improvement of the training effect of the data processing model by data enhancement mainly occurs in the later training stage of the data processing model.
  • the inventor has conducted an in-depth study of the model training process based on the data enhancement strategy to verify the above conjecture.
  • FIG. 1 shows the relationship between data enhancement and the training effect of the image classification model.
  • the abscissa is the number of data enhancement rounds in the 300 training of the image classification model, and the ordinate is the classification of the image classification model after 300 training.
  • the dotted line is the relationship between the number of data enhancement rounds in the later stage of training and the classification accuracy of the image classification model, and the solid line is the relationship between the number of data enhancement rounds in the early stage of training and the classification accuracy of the image classification model.
  • the number of data enhancement rounds in the post-training period is continuously calculated from the last training of the image classification model.
  • the number of data enhancement rounds in the post-training period is 50, which means that data enhancement is performed in the last 50 trainings of the image classification model.
  • the number of data enhancement rounds in the pre-training period is continuously calculated from the first training of the image classification model.
  • the number of data enhancement rounds in the pre-training period is 50, which means that data enhancement is performed in the first 50 trainings of the image classification model.
  • the method for updating the data enhancement strategy obtained by the embodiments of the present disclosure obtains the initial data enhancement strategy, and performs the first-stage training data processing model according to the data enhancement strategy and training data.
  • the data enhancement strategy is updated according to the data processing model trained in the second stage, so that in the process of updating the data strategy model, only the second stage of training is required for the data processing model, which not only ensures the data enhancement strategy Quality has improved the efficiency of data enhancement strategy generation.
  • the method for updating the data enhancement strategy provided by the embodiment of the present disclosure may be applicable to the network architecture shown in FIG. 2.
  • the network architecture includes at least a terminal device 201 or a server 202.
  • the terminal device 201 can store the data processing model trained in the first stage, and perform the second stage training of the data processing model and the data enhancement strategy.
  • the data processing model trained in the first stage can also be stored on the server 202, and the second-stage training of the data processing model and the update of the data enhancement strategy can be performed;
  • the terminal device 201 can also be stored in the first-stage training Data processing model, the second stage training of the data processing model and the update of the data enhancement strategy are performed on the server 202, or the data processing model trained in the first stage is stored on the server 202, and the data processing model is performed on the terminal device 201 The second phase of training and data enhancement strategy update.
  • the foregoing terminal device may be a computer, a tablet computer, a smart phone, etc.
  • the foregoing server may be a single server or a server group composed of multiple servers.
  • FIG. 3 is a schematic flowchart of a method for updating a data enhancement strategy provided by an embodiment of the present disclosure. As shown in Figure 3, the method includes:
  • an initial data enhancement strategy can be obtained from each preset data enhancement strategy.
  • each preset data enhancement strategy is called each preset strategy, and the currently adopted data enhancement strategy is called data Enhanced strategy.
  • the user may also set the initial data enhancement strategy in advance, and directly obtain the set data enhancement strategy.
  • the initial data enhancement operation can also be obtained from each preset data enhancement operation, and then the initial data enhancement strategy can be obtained.
  • S302 Perform a second-stage training on the preset data processing model that has undergone the first-stage training according to the data enhancement strategy and the preset training data.
  • the data processing model may be trained in the first stage in advance to obtain the data processing model after the first stage of training.
  • Training data can be collected in advance, and the training data can be stored in the form of a database.
  • the training data can be enhanced through the data enhancement strategy.
  • the training data after the data enhancement is used to perform the first step on the data processing model trained in the first stage.
  • the second-stage training obtains the data processing model after the second-stage training, so that the training data is enhanced in the post-training of the data processing model, making full use of the feature that data enhancement has a greater impact on the post-training of the data processing model.
  • the training effect of the data processing model trained in the second stage can be tested, and the test result can be obtained.
  • the inspection result of the data processing model is the accuracy of image classification of the data processing model.
  • the test result of the data processing model is obtained, and the training of the data processing model obtained by training based on the training data after the data enhancement can be understood in the case of data enhancement of the training data through the data enhancement strategy
  • the test results of the data processing model reflect the quality of the data enhancement strategy.
  • the higher the accuracy of the image classification of the data processing model the better the quality of the data enhancement strategy. Therefore, the data enhancement strategy can be updated based on the test results of the data processing model.
  • the preset strategy in the strategy update space can be obtained as the updated data enhancement strategy.
  • the data processing model trained in the first stage is trained in the second stage, and the data enhancement strategy is updated according to the data processing model trained in the second stage.
  • FIG. 4 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure. As shown in Figure 4, the method includes:
  • the initial data enhancement strategy can be obtained from each preset strategy.
  • the user can also set the initial data enhancement strategy in advance, and directly obtain the set data enhancement strategy.
  • the initial data enhancement operation can also be obtained from each preset data enhancement operation, and then the initial data enhancement strategy can be obtained.
  • the data enhancement strategy includes multiple preset data enhancement operations to improve the quality of the data enhancement strategy.
  • the training data can be enhanced in turn according to the data enhancement operations in the data enhancement strategy.
  • the data processing model trained in the first stage is trained in the second stage.
  • each data enhancement operation and each operation amplitude corresponding to each data enhancement operation as shown in Table 1 can be preset.
  • the same data enhancement operations with different operation ranges can be used.
  • Treated as different data enhancement operations so there are 36 data enhancement operations in Table 1.
  • the data enhancement operations in Table 1 can be combined to obtain 36 ⁇ 36 data enhancement strategies. Therefore, according to Table 1, 36 ⁇ 36 preset strategies can be set.
  • S402 Perform a second-stage training on the preset data processing model that has undergone the first-stage training according to the data enhancement strategy and the preset training data.
  • the training data can be enhanced through the data enhancement strategy.
  • the training data after the data enhancement is used to perform the first step on the data processing model trained in the first stage.
  • the second-stage training obtains the data processing model after the second-stage training, so that the training data is enhanced in the post-training of the data processing model, making full use of the feature that data enhancement has a greater impact on the post-training of the data processing model.
  • the training effect of the data processing model trained in the second stage can be tested, and the test result can be obtained.
  • the test result of the data processing model is obtained, and the training of the data processing model obtained by training based on the training data after the data enhancement can be understood in the case of data enhancement of the training data through the data enhancement strategy.
  • the test results of the data processing model reflect the quality of the currently adopted data enhancement strategy. Therefore, the data enhancement strategy can be updated based on the test results of the data processing model.
  • the preset strategy in the strategy update space can be obtained as the updated data enhancement strategy.
  • the initial data enhancement strategy is updated to the updated data enhancement strategy, that is, the currently adopted data enhancement strategy is updated to the updated data enhancement strategy, and step S402 is executed to correct
  • the data enhancement strategy has been updated many times.
  • the update of the data enhancement strategy is stopped, and the test results of the data processing model trained in the second stage are selected during all the update processes In the highest case, the adopted data enhancement strategy is used as the final data enhancement strategy, thereby effectively improving the quality of the data enhancement strategy.
  • the data enhancement strategy of the Mth update is obtained, and M is greater than or equal to 1.
  • the data processing model trained in the first stage is carried out. Two-stage training; according to the data enhancement model trained in the second stage, the data enhancement strategy is updated for the M+1th time.
  • the number of updates reaches the threshold of the number of times, it is determined that the updated data enhancement strategy meets the preset condition; when the number of updates does not meet the threshold of the number of times, it is determined that the updated data enhancement strategy does not meet the preset condition, so as to pass the number of updates Control whether the update of the data enhancement strategy continues, and avoid always updating the data enhancement strategy.
  • determining whether to stop the continuous update of the data enhancement strategy by determining whether the update times of the data enhancement strategy reaches the preset threshold value, it can also be determined by determining whether the data enhancement strategy has undergone the second phase of training. Whether the test result of the data processing model meets the preset conditions is used to determine whether to stop the continuous update of the data enhancement strategy.
  • the test result of the data processing model can be compared with the preset test threshold. In the case that the test result of the data processing model is greater than the test threshold, it is determined that the data processing model that has passed the second training stage meets the preset conditions.
  • the data enhancement strategy is set as the final data enhancement strategy; when the test result of the data processing model is less than or equal to the test threshold, it is determined that the data processing model after the second training phase does not meet the preset conditions, and the data enhancement strategy is continued Update.
  • the number of data enhancement strategies in each update process is multiple, and the updates of each data enhancement strategy are performed in parallel, thereby effectively improving the generation efficiency of the data enhancement strategy.
  • each data enhancement strategy except the optimal strategy is replaced with the optimal data enhancement strategy, thereby improving the convergence of the update process and the generation efficiency of the data enhancement strategy.
  • the selection is made based on the test result obtained by testing the training effect of the data processing model trained in the second stage.
  • the training data is image data or text data.
  • the data processing model is an image processing model; when the training data is text data, the data processing model is Natural language processing model. Therefore, the method for updating the data enhancement strategy improved by the embodiment of the present disclosure is applicable to the generation of the data enhancement strategy in the image processing field and the generation of the data enhancement strategy in the natural language field.
  • the data processing model trained in the first stage is trained in the second stage, and the data enhancement strategy is performed multiple times according to the data processing model trained in the second stage.
  • Update make full use of the characteristics of data enhancement strategies that have greater influence on the later training of data processing models, and improve the efficiency of data enhancement strategies while ensuring the quality of data enhancement strategies.
  • FIG. 5 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure. As shown in Figure 5, the method includes:
  • the initial data enhancement strategy can be obtained from each preset strategy.
  • the initial data enhancement strategy can also be pre-set by the user directly.
  • the initial data enhancement operation can also be obtained from each preset data enhancement operation, and then the initial data enhancement strategy can be obtained.
  • one or more preset strategies are selected uniformly and randomly from each preset strategy as the initial data enhancement Strategy to improve the fairness of the initial data enhancement strategy selection.
  • one or more preset strategies are uniformly randomly selected from each preset strategy, which means that the probability of each preset strategy being selected is equal.
  • each data enhancement strategy is updated synchronously to improve the efficiency of data enhancement strategy generation.
  • S502 Perform a second-stage training on the preset data processing model that has undergone the first-stage training according to the data enhancement strategy and the preset training data.
  • the training data is enhanced through the data enhancement operation in the data enhancement strategy.
  • the data enhancement strategy includes multiple data enhancement operations
  • the data enhancement strategy is used to enhance the training data. Operation, perform data enhancement on the training data one by one, and obtain the training data after the data enhancement.
  • the data processing model trained in the first stage is trained in the second stage to obtain the data processing model trained in the second stage.
  • the strategy model is a parameterized model, and its parameters are preset strategy parameters.
  • the output of the strategy model can be adjusted.
  • the output of the strategy model is the selection probability of each preset strategy, that is, when the data enhancement strategy is updated, the probability of each preset strategy being selected as the updated data enhancement strategy. Therefore, the strategy model can be understood as a polynomial distribution.
  • preset verification data can be obtained, and the verification data includes input data and tag data corresponding to the input data.
  • the verification data includes the input image and the classification label corresponding to the input image, where the classification label is the input data Category.
  • the input data in the verification data is input to the data processing model trained in the second stage to obtain the output result of the data processing model, and the output result of the data processing model is processed with the label data corresponding to the input data.
  • the test results of the data processing model can be obtained.
  • testing the data processing model refers to testing the training effect of the data processing model. For example, taking image data as an example, when the verification data is image data and the task of the data processing model is an image classification task, the input image is input to the data processing model, and the output of the data processing model is assigned to the classification label corresponding to the input image By comparison, the classification accuracy of the data processing model can be obtained.
  • the strategy parameters of the strategy model can be updated according to the inspection result to obtain the updated strategy model.
  • S504 Determine the selection probability of each preset strategy through the updated strategy model.
  • S505 According to the selection probability of each preset strategy, select an updated data enhancement strategy from each preset strategy.
  • the selection probability of each preset strategy can be re-determined. According to the selection probability of each preset strategy, one of the preset strategies is selected as the updated strategy. Data enhancement strategy.
  • the strategy parameter includes the weight corresponding to each preset strategy, and the strategy parameter is updated, that is, the weight corresponding to each preset strategy is updated.
  • the same weight can be set for each preset strategy to achieve uniform and random selection of the initial data enhancement strategy from each preset strategy.
  • the weight of each preset strategy changes differently, and the selection probability of each preset strategy gradually differs.
  • the strategy parameters are adjusted, and then the selection probability of each preset strategy is re-determined according to the strategy model, and the better quality data is continuously selected from each preset strategy for enhancement
  • the strategy not only improves the generation efficiency of the data enhancement strategy, but also guarantees the quality of the data enhancement strategy.
  • the strategy model can be expressed as formula (1):
  • e is the base of the natural logarithm
  • ⁇ k is the k-th weight in the strategy parameter ⁇ , that is, the weight corresponding to the k-th preset strategy
  • K represents the total number of preset strategies
  • O (k) represents the k-th weight A preset strategy
  • p ⁇ (O (k) ) represents the selection probability of the k-th preset strategy. Therefore, through the strategy model and the strategy parameters including the corresponding weights of each preset strategy, the selection probability of each preset strategy can be determined. By adjusting the strategy parameters, the selection probability of each preset strategy can be effectively adjusted, which improves the data enhancement strategy. The efficiency of the generation of data, and to ensure the quality of the data enhancement strategy.
  • the policy parameters in the process of updating the policy parameters according to the test results of the data processing model trained in the second stage, can be updated through the preset heuristic search algorithm to improve the strategy. The effect of parameter updates.
  • the policy parameter update can be expressed as formula (3):
  • T n represents the nth search trajectory in the reinforcement learning algorithm
  • p(T n ) is the probability that the search trajectory T n is searched in the reinforcement learning algorithm
  • N represents the search trajectory in the reinforcement learning algorithm quantity
  • the gradient value of the policy parameters can be Multiply it by the preset learning rate in the reinforcement learning algorithm to get the product, and then add the product to the strategy parameter to get the updated strategy parameter.
  • the model parameters of the data-processing model obtained through the second-stage training It can be expressed as formula (4):
  • x represents the input data in the training data
  • y represents the label data corresponding to x in the training data
  • O(x) represents the data enhancement of x
  • L( ⁇ ) represents the preset loss function
  • the data enhancement strategy in the first stage training is uniformly and randomly selected, according to the data in the first stage
  • the enhancement strategy performs data enhancement on the training data.
  • the data processing model is trained in the first stage, so that the training data is also enhanced in the first stage of training to improve the data processing after the first stage of training The training effect of the model.
  • model parameters of the data processing model obtained through the first stage of training can be expressed as formula (5):
  • ⁇ share represents the model parameters of the data processing model obtained through the first stage of training, It means that the data enhancement strategy is selected from each preset strategy according to the uniform probability distribution.
  • the data enhancement strategy has a greater impact on the later training of the data processing model.
  • the data processing model trained in the first stage is trained in the second stage.
  • the data processing model trained in the second stage update the strategy model, determine the selection probability of each preset strategy through the updated strategy model, and optimize the quality of the updated data to enhance the strategy by adjusting the probability of each preset strategy.
  • the quality of the data enhancement strategy is improved, and the generation efficiency of the data enhancement strategy is improved.
  • FIG. 6 is a schematic flowchart of a method for updating a data enhancement strategy provided by another embodiment of the present disclosure. As shown in Figure 6, the method includes:
  • the training effect of the data processing model trained in the second stage is tested by verifying the data, and the test is obtained.
  • the test results of the second-stage data processing model in the first N-1 updates of the data enhancement strategy are obtained.
  • the test results of the second-stage data processing model in the first N-1 updates of the data enhancement strategy are called historical test results.
  • the test results and historical test results can be combined to update the strategy model to Ensure the stability of the strategy model update during each update process, thereby improving the update effect of the data enhancement strategy.
  • N is the total number of current updates of the data enhancement strategy
  • the Nth update refers to the current update process.
  • the mean value of the historical test results can be determined, the difference between the test result and the mean value can be determined, and the difference is calculated based on the difference.
  • the strategy parameters in the strategy model are updated to ensure the stability of the strategy model update during each update process, thereby improving the data enhancement strategy update effect.
  • the update process of the strategy parameters can adopt a heuristic search algorithm, which will not be repeated.
  • S604 Determine the selection probability of each preset strategy through the updated strategy model.
  • S605 According to the selection probability of each preset strategy, select an updated data enhancement strategy from each preset strategy.
  • steps S601 to S605 can refer to the detailed description of steps S501 to S505, which will not be repeated here.
  • S606 Determine whether the updated data enhancement strategy meets a preset condition.
  • S608 if the updated data enhancement strategy meets the preset condition, S608 is executed; if the updated data enhancement strategy does not meet the preset condition, S607 is executed.
  • the updated initial data enhancement strategy is the updated data enhancement strategy
  • step S602 is skipped to perform multiple updates to the data enhancement strategy to improve the quality of the data enhancement strategy.
  • the updated data enhancement strategy is set as the final data enhancement strategy.
  • determining whether to stop the continuous update of the data enhancement strategy by determining whether the update times of the data enhancement strategy reaches the preset threshold value, it can also be determined by determining whether the data enhancement strategy has undergone the second phase of training. Whether the test result of the data processing model meets the preset conditions is used to determine whether to stop the continuous update of the data enhancement strategy.
  • the test result of the data processing model can be compared with a preset test threshold.
  • the test result of the data processing model is greater than the test threshold, it means the data processing model that has passed the second training stage
  • the data enhancement strategy is set as the final data enhancement strategy; if the test result of the data processing model is less than or equal to the test threshold, the data enhancement strategy is continued to be updated.
  • the optimal data enhancement strategy is selected, and the updated data In the enhancement strategy, each data enhancement strategy except the optimal strategy is replaced with the optimal data enhancement strategy, thereby improving the convergence of the update process and the generation efficiency of the data enhancement strategy.
  • the selection can be made based on the test result obtained by testing the training effect of the data processing model trained in the second stage.
  • Figure 7 provides a parallel update process for multiple data enhancement strategies.
  • each cube represents a data enhancement strategy
  • each cube represents a data processing model
  • accuracy (ACC) represents the test result of the data processing model obtained through the second stage of training
  • each row represents one Data enhancement strategy update process
  • each column represents an update of each data enhancement strategy.
  • an initial data enhancement strategy can be selected uniformly and randomly from each preset strategy, and multiple copies of the initial data enhancement strategy can be obtained to obtain multiple identical initial data enhancement strategies.
  • the strategy is updated in parallel. Every preset update times, the optimal data enhancement strategy is selected from each updated data enhancement strategy, and the optimal data enhancement strategy is copied, as shown by the dashed arrow.
  • Strategy replication is: in each updated data enhancement strategy, the remaining data enhancement strategy except for the optimal data enhancement strategy is replaced with the optimal data enhancement strategy. Therefore, the convergence of multiple updates of the data enhancement strategy can be effectively improved, and a better quality data enhancement strategy can be obtained.
  • the model parameter ⁇ share of the data processing model trained in the first stage is loaded into the data processing model to obtain the data processing model trained in the first stage.
  • the second-stage training is performed on the data processing model trained in the first stage, and then the verification data is tested to obtain ACC, that is, the test result of the data processing model trained in the second stage.
  • ACC that is, the test result of the data processing model trained in the second stage.
  • the data enhancement strategy is updated, and the updated data enhancement strategy is obtained.
  • multiple data enhancement strategies can be updated in parallel, and each update process of the data enhancement strategy only requires the second-stage training of the data processing model, and each preset number of updates will be
  • Each updated data enhancement strategy is replaced with the current optimal data enhancement strategy, and the calculation amount of strategy parameter update is small, which effectively improves the efficiency of data enhancement strategy update, improves the efficiency of data enhancement strategy generation, and ensures The quality of the data enhancement strategy.
  • the ratio of the training times of the first stage training to the total training times or the ratio of the training times of the second stage training to the total training times may be adjusted to improve the generation efficiency of the data enhancement strategy.
  • FIG. 8 is a schematic flowchart of a data processing method provided by an embodiment of the disclosure. As shown in Figure 8, the method includes:
  • the data to be processed input by the user can be acquired, and the data to be processed can also be collected in advance.
  • the data to be processed is processed through the pre-trained data processing model.
  • the data processing model goes through the first stage of training and the second stage of training in turn.
  • the preset data enhancement strategy and preset training are used
  • the data trains the data processing model.
  • the data processing model is pre-trained.
  • the data processing model is trained in the first stage, and then the data processing model is trained in the second stage according to the data enhancement strategy and training data, so as to make full use of
  • the data to be processed is input into a data processing model, and the data to be processed is processed by the data processing model to obtain corresponding processing results.
  • the data enhancement strategy used in the second-stage training of the data processing model can be obtained through the data enhancement strategy update method improved in any of the above embodiments, so as to improve the quality and generation of the data enhancement strategy. Efficiency, thereby improving the data processing effect of the data processing model and the efficiency of model training.
  • the data processing model in the process of training the data processing model, may be trained in the first stage through the training data to obtain the data processing model trained in the first stage. Then use the data enhancement strategy to enhance the training data. Based on the training data after the data enhancement, the data processing model trained in the first stage is trained in the second stage to obtain the trained data processing model, so as to make full use of the data enhancement.
  • the post-training of the data processing model has a more influential feature, which improves the data processing effect of the data processing model and the efficiency of model training.
  • the data enhancement strategy can be selected uniformly and randomly among the preset strategies as the data enhancement strategy for the first stage of training.
  • the data enhancement strategy is used to enhance the training data, and the data processing model is trained in the first stage through the data-enhanced training data, so that the data enhancement strategy is selected uniformly and randomly, and the time spent on model training is increased as much as possible.
  • the training effect of the first-stage training of the data processing model thereby improving the overall training effect of the data processing model.
  • the data to be processed and the training data can be image data or text data.
  • the data processing model is an image processing model
  • the data to be processed and the training data are image data
  • the data processing model is In the case of the natural language processing model, the data to be processed and the training data are text data, thereby improving the image processing effect or the natural language processing effect.
  • the data to be processed is processed through the pre-trained data processing model.
  • the training process of the data processing model is divided into the first stage training and the second stage training.
  • the preset The data enhancement strategy of the data processing model improves the data processing effect and model training efficiency of the data processing model, thereby improving the data processing effect.
  • Automatic machine learning is a hot area in the current machine learning field, and its related technologies can play a role in improving model performance and reducing manpower required for tuning in many fields.
  • Image data enhancement technology has also been widely used in the field of image processing. Automating the image data enhancement process through automatic machine learning technology can improve the pertinence of data enhancement and reduce unnecessary manual adjustments.
  • it is more complicated to find a suitable enhancement strategy on the data set of a specific task. This is because the magnitude of the data set is generally large, and the overhead of direct search is unacceptable. And if it is only to find a common strategy and apply it to all tasks, the improvement function of the model will be lower.
  • some of the existing automatic data-enhanced search technologies are still expensive, and some of the enhancement effects are not ideal. Among them, part or all of the process of automating machine learning.
  • the most common task is to automatically adjust the parameters of machine learning, such as automatically finding a suitable model structure, a suitable data enhancement strategy, a suitable loss function, and a suitable optimizer.
  • the update method of the data enhancement strategy provided by the embodiments of the present disclosure can achieve a good balance between time consumption and evaluation accuracy, that is, search can be carried out directly on a data set of a conventional scale, and a stable improvement can be obtained; and, applicable It is used in multiple image classification data sets, and has a certain transferability; it can also be easily embedded in various image classification tasks.
  • the method for updating the data enhancement strategy includes searching for an image data enhancement strategy.
  • the search process can be divided into the following three steps. First of all, the model is trained under a uniform random strategy. After that, the One-Shot (search strategy) search phase will be carried out, that is, the end state of the pre-training is repeatedly loaded and the post-training is performed, and the search is performed at the same time. The search goal is to optimize the performance of post-training. Finally, apply the searched strategy to the original task to re-train as a whole to get the final model performance.
  • One-Shot is a search strategy.
  • the original intention is to take a "path" in the entire search space each time, and it can also be broadly understood as a single sampling update that is repeated multiple times.
  • the time efficiency of the search can be greatly improved.
  • the stability of the evaluation index was not observed to be damaged in the experiment. Using this method can improve the performance of each image classification model under a given data set, and help the model achieve better performance in multiple task scenarios.
  • Step A use uniform and random data enhancement for pre-training.
  • this step A includes: obtaining an untrained initial model; training under uniform random data enhancement; and obtaining a model that has been previously trained.
  • the input of step A is a designated image classification data set, a completely untrained model; the output is a model that has been trained in the previous period.
  • this step A includes:
  • the data enhancement operations we choose can be various automatic data enhancement operations to ensure fairness.
  • the operation list is shown in Table 1, where the second column represents the different amplitude values of each operation. Considering the difference in amplitude values, there are a total of 36 possible data enhancement operations. During training, two operations will be used uniformly and randomly for each picture. The picture after the data enhancement operation is used as the actual input of the model.
  • Step B Perform One-Shot search, that is, repeat post-training and continuously update the data enhancement strategy.
  • each cube represents a data enhancement strategy
  • each cube represents a data processing model.
  • Accuracy (ACC) Represents the test results of the data processing model obtained through the second stage of training.
  • Each row represents the update process of a data enhancement strategy
  • each column represents an update of each data enhancement strategy.
  • the single update process may include: loading the model obtained after pre-training. That is, each post-training will reset the model parameters to the parameters obtained after the pre-training.
  • the historical index sliding average can be subtracted from each evaluation. Use this time model to evaluate the index update strategy. Reinforcement learning is used here to update, and the goal of the update is to improve the evaluation index of the model.
  • the final strategy After several repeated training and updates, the final strategy will be obtained.
  • the final strategy can be exported as a short script for convenient addition to the desired training process.
  • Step C Retrain using the final strategy to obtain the final model and final performance.
  • each picture will undergo data enhancement under the control of the final strategy (under the corresponding probability value).
  • the final model and performance are obtained.
  • the method for updating the data enhancement strategy utilizes the One-Shot idea, which achieves a good balance between search efficiency and evaluation accuracy, and achieves a better experimental effect under the same conditions.
  • the results of the algorithm search can be easily derived and can be used flexibly for other tasks.
  • the method for updating the data enhancement strategy can directly perform data enhancement in the training process of image classification tasks or other image processing tasks, in order to achieve better performance and stronger generalization; Search for data enhancement strategies under specified data sets and specified models to obtain highly customized data enhancement strategies; it can be combined with a customized search space to perform data enhancement strategy searches for a wider range of tasks. Such as natural language processing and other fields.
  • FIG. 9 is a schematic structural diagram of an update apparatus for a data enhancement strategy provided by an embodiment of the present disclosure. As shown in Figure 9, the device includes:
  • the obtaining part 901 is configured to obtain an initial data enhancement strategy
  • the training part 902 is configured to perform second-stage training on the preset data processing model that has undergone the first-stage training according to the data enhancement strategy and preset training data;
  • the update part 903 is configured to update the data enhancement strategy according to the data processing model trained in the second stage to obtain the updated data enhancement strategy.
  • the update part 903 is also configured as:
  • the updated initial data enhancement strategy is the updated data enhancement strategy to update the data enhancement strategy multiple times.
  • the number of data enhancement strategies is multiple, and the update of each data enhancement strategy is performed in parallel; the update part 903 is also configured as:
  • the optimal data enhancement strategy is selected;
  • each data enhancement strategy except the optimal strategy is replaced with the optimal data enhancement strategy.
  • the data enhancement strategy includes a plurality of preset data enhancement operations; the training part 902 is also configured to:
  • the data processing model trained in the first stage is trained in the second stage.
  • the training data is image data or text data.
  • the update part 903 is also configured as:
  • the updated data enhancement strategy is selected from each preset strategy.
  • the updating part 903 is further configured to:
  • the data processing model trained in the second stage is tested, and the test result is obtained;
  • the strategy model is updated.
  • the update part 903 is also configured as:
  • the strategy parameters in the strategy model are updated.
  • the training part 902 is further configured to:
  • the data enhancement strategy in the first stage of training is uniformly and randomly selected;
  • the data processing model is trained in the first stage.
  • the device for updating the data enhancement strategy provided in FIG. 9 can execute the above-mentioned corresponding method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 10 is a schematic structural diagram of a data processing device provided by an embodiment of the present disclosure. As shown in Figure 10, the device includes:
  • the obtaining part 1001 is configured to obtain data to be processed
  • the processing part 1002 is configured to process the data to be processed through a pre-trained data processing model.
  • the data processing model sequentially undergoes the first stage of training and the second stage of training, and in the second training stage, the preset data enhancement strategy is adopted Train the data processing model with preset training data.
  • the data enhancement strategy is generated using the method for updating the data enhancement strategy shown in any of the foregoing embodiments.
  • the device further includes a training part, and the training part is further configured to:
  • the data processing model trained in the first stage is trained in the second stage.
  • the training part is also configured as:
  • the data enhancement strategy in the first stage of training is uniformly and randomly selected
  • the data processing model is trained in the first stage.
  • the data to be processed and the training data are image data or text data.
  • the data processing device provided in FIG. 10 can execute the foregoing corresponding method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the disclosure.
  • the terminal device may include: a processor 1101 and a memory 1102.
  • the memory 1102 is used to store computer execution instructions, and the processor 1101 implements a method as in any of the foregoing embodiments when the processor 1101 executes a computer program.
  • the above-mentioned processor 1101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), a dedicated Integrated circuit (application-specific integrated circuit, ASIC), field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the aforementioned memory 1102 may include random access memory (RAM), or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the embodiments of the present disclosure also provide a computer-readable storage medium, in which instructions are stored, which when run on a computer, cause the computer to execute the method in any of the above-mentioned embodiments.
  • the embodiments of the present disclosure further provide a program product, the program product includes a computer program, the computer program is stored in a storage medium, at least one processor can read the computer program from the storage medium, the at least When a processor executes the computer program, the method of any of the foregoing embodiments can be implemented.
  • FIG. 12 is a block diagram of a device 1200 for updating a data enhancement strategy provided according to this embodiment.
  • the apparatus 1200 may be provided as a server or a computer. 12
  • the apparatus 1200 includes a processing component 1201, which further includes one or more processors, and a memory resource represented by a memory 1202, for storing instructions executable by the processing component 1201, such as application programs.
  • the application program stored in the memory 1202 may include one or more parts each corresponding to a set of instructions.
  • the processing component 1201 is configured to execute instructions to execute the method of any one of the embodiments in FIG. 3 to FIG. 6 described above.
  • the device 1200 may also include a power component 1203 configured to perform power management of the device 1200, a wired or wireless network interface 1204 configured to connect the device 1200 to a network, and an input output (I/O) interface 1205.
  • the device 1200 can operate based on an operating system stored in the memory 1202, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • "at least one” refers to one or more, and “multiple” refers to two or more.
  • “And/or” describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A , B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an “or” relationship; in the formula, the character "/" indicates that the associated objects before and after are in a "division” relationship.
  • At least one item (a) refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a).
  • at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple Piece.
  • the size of the sequence numbers of the foregoing processes does not mean the order of execution.
  • the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present disclosure.
  • the implementation process constitutes any limitation.
  • the data processing model trained in the first stage is trained in the second stage, and the data enhancement strategy is updated according to the data processing model trained in the second stage.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)
  • Machine Translation (AREA)
  • Devices For Checking Fares Or Tickets At Control Points (AREA)

Abstract

本公开的实施例提供一种数据增强策略的更新方法、装置、设备以及存储介质。该方法包括:获取初始的数据增强策略,根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新,以得到更新的数据增强策略。

Description

数据增强策略的更新方法、装置、设备及存储介质
相关申请的交叉引用
本公开基于申请号为202010519507.3、申请日为2020年6月9日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
技术领域
本公开的实施例涉及机器学习领域,涉及一种数据增强策略的更新方法、装置、设备及存储介质。
背景技术
深度学习技术的应用效果依赖于大量的训练数据,在数量有限的训练数据上训练得到的数据处理模型,通常会出现过度拟合现象。为了提高数据处理模型的训练效果、并降低模型训练所需的人力,自动数据增强技术逐渐被用来提高训练数据的数据量和多样性。
自动数据增强技术是指通过自动机器学习技术自动化数据增强过程,因此,找到一个合适的数据增强策略非常关键。通常地,可基于数据处理模型的训练效果,通过强化学习算法对数据增强策略进行优化。
由于训练数据的量级通常比较大、且数据处理模型训练的也比较耗时,数据增强策略的生成效率还有待提高。
发明内容
本公开的实施例提供一种数据增强策略的更新方法、装置、设备及存储介质。
第一方面,本公开的实施例提供一种数据增强策略的更新方法,包括:
获取初始的数据增强策略;
根据所述数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练;
根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,以得到更新后的所述数据增强策略。
在一种可能的实现方式中,所述方法还包括:
获取第M次更新的所述数据增强策略,所述M大于或等于1;
根据第M次更新的所述数据增强策略和所述训练数据,对所述经过第一阶段训练的数据处理模型进行第二阶段训练;
根据经过第二阶段训练的数据增强模型,对所述数据增强策略进行第M+1次更新。
在一种可能的实现方式中,所述初始的数据增强策略的数量为多个,各所述数据增强策略的更新并行进行;所述方法还包括:
每预设的更新次数,根据所述经过第二阶段训练的数据处理模型,在更新后的各所述数据增强策略中,选取最优策略;
在更新后的所述数据增强策略中,将除所述最优策略之外的各所述数据增强策略分别替换为所述最优的数据增强策略。
在一种可能的实现方式中,所述数据增强策略包括多个预设的数据增强操作;所述根据所述数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练,包括:
按照各所述数据增强操作,依次对所述训练数据进行数据增强;
通过数据增强后的所述训练数据,对所述经过第一阶段训练的数据处理模型进行第二阶段训练。
在一种可能的实现方式中,所述根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,包括:
根据所述经过第二阶段训练的数据处理模型,更新预设的策略模型;
通过更新后的所述策略模型,确定各个预设策略的选中概率;
按照各所述预设策略的选中概率,在各所述预设策略中选取更新后的所述数据增强策略。
在一种可能的实现方式中,在所述数据增强策略的更新次数为多次的情况下,所述根据经过第二阶段训练的数据处理模型,更新预设的策略模型,包括:
根据预设的验证数据,对所述经过第二阶段训练的数据处理模型进行检验,得到检验结果;
获取所述数据增强策略的前N-1次更新中所述经过第二阶段的数据处理模型的历史检验结果,所述N为所述数据增强策略当前更新的总次数;
根据所述历史检验结果和所述检验结果,对所述策略模型进行更新。
在一种可能的实现方式中,所述根据所述历史检验结果和所述检验结果,对所述策略模型进行更新,包括:
确定所述历史检验结果的均值;
确定所述检验结果和所述均值的差值;
根据所述差值,对所述策略模型中的策略参数进行更新。
在一种可能的实现方式中,所述获取初始的数据增强策略之前,所述方法还包括:
在各个预设策略中,均匀随机选取所述第一阶段训练中的数据增强策略;
根据所述第一阶段训练中的数据增强策略和所述训练数据,对所述数据处理模型进行所述第一阶段训练。
第二方面,本公开的实施例提供一种数据处理方法,包括:
获取待处理数据;
通过预先训练好的数据处理模型,对所述待处理数据进行处理,所述数据处理模型依次经过第一阶段训练和第二阶段训练,在所述第二训练阶段中通过预设的数据增强策略和预设的训练数据对所述数据处理模型进行训练,所述数据增强策略采用如第一方面或第一方面各可能的实现方式所述的方法进行生成。
在一种可能的实现方式中,所述方法还包括:
根据所述训练数据,对所述数据处理模型进行所述第一阶段训练;
通过所述数据增强策略对所述训练数据进行数据增强;
根据数据增强后的所述训练数据,对经过所述第一阶段训练的数据处理模型进行所述第二阶段训练。
在一种可能的实现方式中,所述根据所述训练数据,对所述数据处理模型进行所述第一阶段训练,包括:
在各预设策略中,均匀随机选取所述第一阶段训练中的数据增强策略;
根据所述第一阶段训练中的数据增强策略和所述训练数据,对所述数据处理模型进行所述第一阶段训练。
在一种可能的实现方式中,所述待处理数据和所述训练数据为图像数据或者文本数据。
第三方面,本公开的实施例提供一种数据增强策略的更新装置,包括:
获取部分,被配置为获取初始的数据增强策略;
训练部分,被配置为根据所述数据增强策略和预设的训练数据,对预设的经过第一阶 段训练的数据处理模型进行第二阶段训练;
更新部分,被配置为根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,以得到更新后的所述数据增强策略。
第四方面,本公开的实施例提供一种数据处理装置,包括:
获取部分,被配置为获取待处理数据;
处理部分,被配置为通过预先训练好的数据处理模型,对所述待处理数据进行处理,所述数据处理模型依次经过第一阶段训练和第二阶段训练,在所述第二训练阶段中通过预设的数据增强策略和预设的训练数据对所述数据处理模型进行训练,所述数据增强策略采用如第一方面或第一方面各可能的实现方式所述的方法进行生成。
第五方面,本公开的实施例提供了一种电子设备,包括:
存储器和处理器;
所述存储器用于存储程序指令;
所述处理器用于调用所述存储器中的程序指令执行如第一方面、第一方面的各可能的实现方式、第二方面、或者第二方面的各可能的实现方式所述的方法。
第六方面,本公开的实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被执行时,实现如第一方面、第一方面的各可能的实现方式、第二方面、或者第二方面的各可能的实现方式所述的方法。
第七方面,本公开实施例提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现如第一方面、第一方面的各可能的实现方式、第二方面、或者第二方面的各可能的实现方式所述的方法。
本公开的实施例提供的数据增强策略的更新方法,数据处理模型的训练阶段分为第一阶段和第二阶段这前后两阶段,在更新数据增强策略时,基于数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,再基于经过第二阶段训练的数据处理模型更新数据增强策略,从而通过在数据增强策略的更新过程中无需对数据处理模型从头开始训练,在确保数据增强策略质量的同时,提高数据增强策略的生成效率。此外,生成的数据增强策略可适用于训练数据的同类数据,具备可迁移性。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1为数据增强与图像分类模型的训练效果之间的关系示例图;
图2为本公开一实施例提供的网络架构示意图;
图3为本公开一实施例提供的数据增强策略的更新方法的流程示意图;
图4为本公开另一实施例提供的数据增强策略的更新方法的流程示意图;
图5为本公开另一实施例提供的数据增强策略的更新方法的流程示意图;
图6为本公开另一实施例提供的数据增强策略的更新方法的流程示意图;
图7为本公开另一实施例提供的多个数据增强策略并行更新的示例图;
图8为本公开一实施例提供的数据处理方法的流程示意图;
图9为本公开一实施例提供的数据增强策略的更新装置的结构示意图;
图10为本公开一实施例提供的数据处理装置的结构示意图;
图11为本公开一实施例提供的电子设备的结构示意图;
图12为根据本实施例提供的数据增强策略的更新装置的框图。
通过上述附图,已示出本公开明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本公开构思的范围,而是通过参考特定实施例为本领域技术人员说明本公开的概念。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
首先对本公开的实施例所涉及的名词进行解释:
第一阶段训练、第二阶段训练:是指按照数据处理模型的训练总次数,将数据处理模型的训练按照前后顺序划分为第一阶段训练和第二阶段训练。例如,预先设定数据处理模型的训练总次数为300次,则可以将前100次训练称为第一阶段训练,将后200次训练称为第二阶段训练。其中,对第一阶段训练中的训练次数和第二阶段训练中的训练次数不进行限制。
数据增强操作:是指对训练数据进行微调的操作,以增加训练数据的数据量和多样性。例如,以图像数据为例,对图像数据进行尺寸、色彩调整。
数据增强策略:是指对训练数据进行数据增强的方案。其中,数据增强策略包括数据增强操作。例如,数据增强策略中的数据增强操作为图像水平剪切、且图像水平剪切对应的剪切幅度为0.1宽度,即每次图像水平剪切的宽度为图像原始宽度的10%。
深度学习技术被广泛应用于多个领域并取得显著的成果。以图像视觉领域为例,深度学习技术能够胜任的任务有图像分类、目标检测、图像分割、人体姿态估计等。为出色完成这些任务,采用深度学习技术的数据处理模型通常需要在大量的训练数据上进行训练,否则训练得到的模型将出现过度拟合现象。因此,数据增强成为增加训练数据的数据量和多样性的常用方式,而设计合适的数据增强策略成为提高数据处理模型训练效果的关键因素。
一般地,可通过专业人士手动设计数据增强策略,但这种方式不仅时间成本和人员成本较高,且数据增强策略的复用性不高,通常只适用于训练特定的数据处理模型。自动生成数据增强策略的方式,相较于专业人士手动设计数据增强策略,不仅能够提高数据增强策略的生成效率,且能够生成更优的数据增强策略。
一般地,在自动生成数据增强策略的方式中,可依据数据处理模型的训练效果,通过强化学习算法对数据增强策略进行优化。发明人发现,在该方式中,需要不断地重复数据处理模型的整个训练过程,再加上训练数据的规模不小,整体的计算量较大、耗时较长,导致数据增强策略的生成效率不高。
在深度学习技术中,数据处理模型的过拟合通常发生在后期训练阶段。因此,发明人猜想:数据增强对数据处理模型的训练效果的提升,主要发生在数据处理模型的后期训练阶段。为了提高数据增强策略的生成效率、并确保基于该数据增强策略进行训练的数据处理模型的训练效果,发明人深入研究了基于数据增强策略的模型训练过程,对上述猜想进行验证。
以数据处理模型为图像分类模型、且图像分类模型的训练总次数为300次为例,发明人得到图1所示的结果。图1示出了数据增强与图像分类模型的训练效果之间的关系,横坐标为在图像分类模型的300次训练中的数据增强轮数,纵坐标为300次训练后的图像分 类模型的分类准确度。虚线为训练后期的数据增强轮数与图像分类模型的分类准确度的关系,实线为训练前期的数据增强轮数与图像分类模型的分类准确度的关系。
其中,训练后期的数据增强轮数是从图像分类模型的最后一次训练往前连续计算,例如训练后期的数据增强轮数为50,则表示在图像分类模型的后50次训练进行数据增强。训练前期的数据增强轮数是从图像分类模型的第一次训练往后连续计算,例如训练前期的数据增强轮数为50,则表示在图像分类模型的前50次训练进行数据增强。
基于图1可以得到:一、在数据增强轮数一致的情况下虚线总是在实线上方,所以在数据增强轮数一致的情况下,在训练后期进行数据增强所得到的图像分类模型的分类准确度,比在训练前期进行数据增强所得到的图像分类模型的分类准确度高;二、在图像分类模型的分类准确度一致的情况下虚线总是在实线左侧,所以在图像分类模型的分类准确度一致的情况下,在训练后期进行数据增强所需的数据增强轮数,比在训练前期进行数据增强所需的数据增强轮数少。注意,由于实线和虚线上的第一个点都表示进行数据增强的轮数为0、实线和虚线上的最后一个点都表示进行数据增强的轮数为300,因此在上述比较的过程中不考虑这四个点。
基于发明人的上述发现,本公开的实施例提供的数据增强策略的更新方法,获取初始的数据增强策略,根据数据增强策略和训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,更新数据增强策略,从而在更新数据策略模型的过程中,仅需对数据处理模型进行第二阶段训练,既保证了数据增强策略的质量,又提高了数据增强策略的生成效率。
本公开的实施例提供的数据增强策略的更新方法,可以适用于图2所示的网络架构。如图2所示,该网络架构至少包括终端设备201或者服务器202,可在终端设备201上存储经过第一阶段训练的数据处理模型、并进行数据处理模型的第二阶段训练和数据增强策略的更新;也可在服务器202上存储经过第一阶段训练的数据处理模型、并进行数据处理模型的第二阶段训练和数据增强策略的更新;还可在终端设备201上存储经过第一阶段训练的数据处理模型,在服务器202上进行数据处理模型的第二阶段训练和数据增强策略的更新,或者,在服务器202上存储经过第一阶段训练的数据处理模型,在终端设备201上进行数据处理模型的第二阶段训练和数据增强策略的更新。
上述终端设备可以是计算机、平板电脑、智能手机等设备,上述服务器可为单个的服务器或者多个服务器组成的服务器群。
下面对本公开的实施例的技术方案以及本公开的技术方案如何解决上述技术问题进行详细说明。下面这几个实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本公开的实施例的实施例进行描述。
图3为本公开一实施例提供的数据增强策略的更新方法的流程示意图。如图3所示,该方法包括:
S301、获取初始的数据增强策略。
在一种可能的实现方式中,在S301中可从各个预设的数据增强策略中,获取初始的数据增强策略。其中,为了将各个预设的数据增强策略与当前采用的数据增强策略进行区分,在描述上,将各个预设的数据增强策略称为各个预设策略,将当前采用的数据增强策略称为数据增强策略。
在一种可能的实现方式中,除了从各个预设策略中获取初始的数据增强策略外,还可由用户预先设置好初始的数据增强策略,直接获取该设置好的数据增强策略。或者,还可从各个预设的数据增强操作中获取初始的数据增强操作,进而得到初始的数据增强策略。
S302、根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练。
其中,可预先对数据处理模型进行第一阶段训练,得到经过第一阶段训练的数据处理模型。可预先采集训练数据,训练数据可以数据库的形式存储。
在一种可能的实现方式中,在获得初始的数据增强策略后,可通过数据增强策略对训练数据进行数据增强,通过数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,得到经过第二阶段训练的数据处理模型,从而在数据处理模型的后期训练中对训练数据进行数据增强,充分利用数据增强对数据处理模型的后期训练影响更大的特点。
其中,对数据处理模型所采用的训练算法不做限制。
S303、根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新。
在一种可能的实现方式中,数据处理模型经过第一阶段训练和第二阶段训练后,即完成其训练过程,得到训练好的处理模型。因此,可对经过第二阶段训练的数据处理模型的训练效果进行检验,得到检验结果。例如,在数据处理模型的任务为图像分类任务的情况下,数据处理模型的检验结果即数据处理模型的图像分类准确度。
在一种可能的实现方式中,得到数据处理模型的检验结果,即可了解在通过数据增强策略对训练数据进行数据增强的情况下,基于数据增强后的训练数据训练得到的数据处理模型的训练效果,可见,数据处理模型的检验结果体现数据增强策略的质量。例如,数据处理模型的图像分类准确度越高,则代表数据增强策略的质量越好。因此,可根据数据处理模型的检验结果,对数据增强策略进行更新。在对数据增强策略进行更新的过程中,可获取策略更新空间中的预设策略作为更新后的数据增强策略。
本公开实施例中,通过初始的数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新,充分利用数据增强策略对数据处理模型的后期训练影响更大的特点,在确保数据增强策略质量的同时,提高数据增强策略的生成效率。
图4为本公开另一实施例提供的数据增强策略的更新方法的流程示意图。如图4所示,该方法包括:
S401、获取初始的数据增强策略。
在一种可能的实现方式中,可从各个预设策略中,获取初始的数据增强策略。除了从各个预设策略中获取初始的数据增强策略外,还可由用户预先设置好初始的数据增强策略,直接获取该设置好的数据增强策略。或者,还可从各个预设的数据增强操作中获取初始的数据增强操作,进而得到初始的数据增强策略。
在一种可能的实现方式中,数据增强策略包括多个预设的数据增强操作,以提高数据增强策略的质量。后续在对经过第一阶段的数据处理模型进行第二阶段训练的情况下,可按照数据增强策略中的各个数据增强操作,依次对训练数据进行数据增强,通过数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练。
以训练数据为图像数据为例,可预先设置如表1所示的各个数据增强操作和各个数据增强操作对应的各个操作幅度。图1中的数据增强操作的类型共有14种,其中11种数据增强操作分别设有3种操作幅度,另外3种数据增强操作不需要设置操作幅度,可将不同操作幅度的同种数据增强操作当作不同的数据增强操作,因此表1中共有36个数据增强操作。在数据增强策略包括两个数据增强操作的情况下,表1中的数据增强操作可组合得到36×36个数据增强策略。因此,根据表1,可设置36×36个预设策略。
表1图像数据增强操作及各增强操作幅度
数据增强操作 操作幅度 幅度单位
水平裁剪 {0.1,0.2,0.3} 宽度比例
垂直裁剪 {0.1,0.2,0.3} 高度比例
水平平移 {0.15,0.3,0.45} 宽度比例
垂直平移 {0.15,0.2,0.45} 高度比例
图像旋转 {10,20,30} 角度值
色彩调整 {0.3,0.6,0.9} 色彩平衡度
色调分离 {4.4,5.6,6.8} 像素位数值
日光化 {26,102,179} 像素阈值
对比度调整 {1.3,1.6,1.9} 对比度比例
锐度调整 {1.3,1.6,1.9} 锐化比例
亮度调整 {1.3,1.6,1.9} 亮度比例
自动对比度
均衡化
颜色反转
S402、根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练。
在一种可能的实现方式中,在获得初始的数据增强策略后,可通过数据增强策略对训练数据进行数据增强,通过数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,得到经过第二阶段训练的数据处理模型,从而在数据处理模型的后期训练中对训练数据进行数据增强,充分利用数据增强对数据处理模型的后期训练影响更大的特点。
S403、根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新。
在一种可能的实现方式中,数据处理模型经过第一阶段训练和第二阶段训练后,即完成其训练过程,得到训练好的处理模型。因此,可对经过第二阶段训练的数据处理模型的训练效果进行检验,得到检验结果。
在一种可能的实现方式中,得到数据处理模型的检验结果,即可了解在通过数据增强策略对训练数据进行数据增强的情况下,基于数据增强后的训练数据训练得到的数据处理模型的训练效果,可见,数据处理模型的检验结果体现当前采用的数据增强策略的质量。因此,可根据数据处理模型的检验结果,对数据增强策略进行更新。在对数据增强策略进行更新的过程中,可获取策略更新空间中的预设策略作为更新后的数据增强策略。
S404、确定更新后的数据增强策略是否满足预设条件。
在一种可能的实现方式中,在更新后的数据增强策略满足预设条件的情况下,执行S406;在更新后的数据增强策略未满足预设条件的情况下,执行S405。
S405、更新初始的数据增强策略为更新后的数据增强策略。
在一种可能的实现方式中,将初始的数据增强策略更新为更新后的数据增强策略,也即将当前采用的数据增强策略更新为更新后的数据增强策略,并跳转执行步骤S402,以对数据增强策略进行多次更新。
S406、得到最终的数据增强策略。
在一种可能的实现方式中,在更新后的数据增强策略满足预设条件的情况下,停止对数据增强策略的更新,在所有更新过程中选取经过第二阶段训练的数据处理模型的检验结果最高的情况下,采用的数据增强策略作为最终的数据增强策略,从而有效地提高数据增强策略的质量。
在一种可能的实现方式中,获取第M次更新的数据增强策略,M大于或等于1;根据第M次更新的数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练;根据经过第二阶段训练的数据增强模型,对数据增强策略进行第M+1次更新。
在一种可能的实现方式中,可通过确定数据增强策略的更新次数是否到达预设的次数阈值,来确定更新后的数据增强策略是否满足预设条件。在更新次数达到次数阈值的情况下,确定更新后的数据增强策略满足预设条件;在更新次数未达到次数阈值的情况下,确定更新后的数据增强策略不满足预设条件,从而通过更新次数控制数据增强策略的更新是否继续,避免对数据增强策略一直更新。
在一种可能的实现方式中,除了通过确定数据增强策略的更新次数是否到达预设的次数阈值,来确定是否停止对数据增强策略的持续更新之外,还可通过确定经过第二阶段训练的数据处理模型的检验结果是否满足预设条件,来确定是否停止对数据增强策略的持续更新。
其中,可将数据处理模型的检验结果与预设的检验阈值进行比较,在数据处理模型的检验结果大于检验阈值的情况下,则确定经过第二训练阶段的数据处理模型满足预设条件,将数据增强策略设置为最终的数据增强策略;在数据处理模型的检验结果小于或等于该检验阈值的情况下,则确定经过第二训练阶段的数据处理模型不满足预设条件,继续进行数据增强策略的更新。
在一种可能的实现方式中,每次更新过程中的数据增强策略的数量为多个,各个数据增强策略的更新并行进行,从而有效提高数据增强策略的生成效率。
在一种可能的实现方式中,每隔预设的更新次数,根据经过第二阶段训练的数据处理模型,在更新后的各数据增强策略中,选取最优的数据增强策略,在更新后的数据增强策略中,将除最优策略之外的各数据增强策略分别替换为最优的数据增强策略,从而提高更新过程的收敛性和数据增强策略的生成效率。其中,在选择最优的数据增强策略过程中,根据对经过第二阶段训练的数据处理模型的训练效果进行检测所得的检验结果进行选择。
在一种可能的实现方式中,训练数据为图像数据或文本数据,在训练数据为图像数据的情况下,数据处理模型为图像处理模型;在训练数据为文本数据的情况下,数据处理模型为自然语言处理模型。因此,本公开实施例提高的数据增强策略的更新方法可适用于图像处理领域的数据增强策略的生成和自然语言领域的数据增强策略的生成。
本公开实施例中,通过初始的数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,对数据增强策略进行多次更新,充分利用数据增强策略对数据处理模型的后期训练影响更大的特点,在确保数据增强策略质量的同时,提高数据增强策略的生成效率。
图5为本公开另一实施例提供的数据增强策略的更新方法的流程示意图。如图5所示,该方法包括:
S501、获取初始的数据增强策略。
在一种可能的实现方式中,可从各个预设策略中,获取初始的数据增强策略。除了从各个预设策略中获取初始的数据增强策略外,还可由直接获取用户预先设置好初始的数据 增强策略。或者,还可从各个预设的数据增强操作中获取初始的数据增强操作,进而得到初始的数据增强策略。
在一种可能的实现方式中,在从各个预设策略中,获取初始的数据增强策略的情况下,均匀随机地从各个预设策略中选取一个或多个预设策略,作为初始的数据增强策略,从而提高初始的数据增强策略选取的公平性。其中,均匀随机地从各个预设策略中一个或多个预设策略,表示各个预设策略被选取的概率相等。
在一种可能的实现方式中,在均匀随机地从各个预设策略中选取了多个预设策略作为初始的数据增强策略的情况下,表明初始的数据增强策略为多个,则后续更新过程中,对各个数据增强策略进行同步更新,从而提高数据增强策略的生成效率。
S502、根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练。
在一种可能的实现方式中,通过数据增强策略中的数据增强操作,对训练数据进行数据增强,在数据增强策略中包括多个数据增强操作的情况下,通过数据增强策略中的各个数据增强操作,依次对训练数据进行数据增强,得到数据增强后的训练数据。通过数据增强后的训练数据,对经过第一阶段训练的数据处理模型,进行第二阶段训练,得到经过第二阶段训练的数据处理模型。
S503、根据经过第二阶段训练的数据处理模型,更新预设的策略模型。
其中,策略模型为一个参数化模型,其参数为预设的策略参数,通过调整策略操作,可调整策略模型的输出。策略模型的输出为各个预设策略的选择概率,即在数据增强策略更新的情况下,各个预设策略被选中作为更新后的数据增强策略的概率。因此,策略模型可以理解为一个多项式分布。
在一种可能的实现方式中,可获取预设的验证数据,验证数据包括输入数据和与输入数据对应的标签数据。例如,以图像数据为例,在验证数据为图像数据、且数据处理模型的任务为图像分类任务的情况下,验证数据包括输入图像和与输入图像对应的分类标签,其中,分类标签为输入数据的类别。
在一种可能的实现方式中,将验证数据中的输入数据输入经过第二阶段训练的数据处理模型,得到数据处理模型的输出结果,将数据处理模型的输出结果与输入数据对应的标签数据进行比较,即可得到对数据处理模型进行检验的检验结果。这里,对数据处理模型进行检验,是指对数据处理模型的训练效果进行检验。例如,以图像数据为例,在验证数据为图像数据、且数据处理模型的任务为图像分类任务的情况下,将输入图像输入数据处理模型,将数据处理模型的输出与输入图像对应的分类标签进行比较,即可得到数据处理模型的分类准确度。
在一种可能的实现方式中,得到数据处理模型的检验结果后,可根据该检验结果,对策略模型的策略参数进行更新,得到更新后的策略模型。
S504、通过更新后的策略模型,确定各个预设策略的选中概率。
S505、按照各预设策略的选中概率,在各预设策略中选取更新后的数据增强策略。
在一种可能的实现方式中,按照更新后的策略模型,可重新确定各个预设策略的选中概率,按照各个预设策略的选中概率,在各个预设策略中选取一个预设策略作为更新后的数据增强策略。
在一种可能的实现方式中,策略参数中包括各个预设策略对应的权重,对策略参数进行更新,即对各个预设策略对应的权重进行更新。在获取初始的数据增强策略的过程中,可通过为各个预设策略设置相同的权重,实现均匀随机地从各个预设策略中选取初始的数 据增强策略。在更新策略参数的过程中,各个预设策略的权重发生不同的变化,各个预设策略的选中概率逐渐出现差别。因此,依据经过第二阶段训练的数据模型的训练效果,对策略参数进行调整,再依据策略模型重新确定各个预设策略的选中概率,不断地从各个预设策略中选取质量更好的数据增强策略,既提高了数据增强策略的生成效率,又保证了数据增强策略的质量。
在一种可能的实现方式中,策略模型可表示为公式(1):
Figure PCTCN2020125967-appb-000001
其中,e为自然对数的底数,θ k为策略参数θ中的第k个权重,也即第k个预设策略对应的权重,K表示预设策略的总数,O (k)表示第k个预设策略,p θ(O (k))表示第k个预设策略的选中概率。因此,通过策略模型和包括各个预设策略所对应权重的策略参数,可确定各个预设策略的选中概率,通过调整策略参数,可有效调整各个预设策略的选中概率,既提高了数据增强策略的生成效率,又保证了数据增强策略的质量。
在一种可能的实现方式中,策略参数的更新可表示为公式(2):
Figure PCTCN2020125967-appb-000002
其中,
Figure PCTCN2020125967-appb-000003
表示经过第二阶段训练的数据处理模型的检验结果,
Figure PCTCN2020125967-appb-000004
表示经过第二阶段训练的数据处理模型的模型参数,D val表示验证数据。
在一种可能的实现方式中,在根据经过第二阶段训练的数据处理模型的检验结果对策略参数进行更新的过程中,可通过预设的启发式搜索算法实现策略参数的更新,以提高策略参数更新的效果。
在一种可能的实现方式中,在用于策略参数更新的启发式搜索算法为强化学习算法的情况下,策略参数的更新可表示为公式(3):
Figure PCTCN2020125967-appb-000005
其中,
Figure PCTCN2020125967-appb-000006
表示策略参数的梯度值,T n表示强化学习算法中的第n条搜索轨迹,p(T n)为在强化学习算法中搜索轨迹T n被搜索到的概率,N表示强化学习算法中搜索轨迹的数量,
Figure PCTCN2020125967-appb-000007
表示经过第二阶段训练的数据处理模型的检验结果的期望值。
其中,在通过强化学习算法更新策略参数的过程中,可将策略参数的梯度值
Figure PCTCN2020125967-appb-000008
乘以强化学习算法中预设的学习率,得到乘积,再将乘积与策略参数相加,得到更新后的策略参数。例如,采用Adam(adaptive moment estimation,适应性矩估计)算法作为强化学习算法的情况下,Adam的学习率可设置为η θ=0.1、β 1=0.5和β 2=0.999。
在一种可能的实现方式中,在根据数据增强测量和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练的过程中,经过第二阶段训练得到的数据处理模型的模型参数可表示为公式(4):
Figure PCTCN2020125967-appb-000009
其中,x表示训练数据中的输入数据,y表示训练数据中与x对应的标签数据,O(x)表示对x进行数据增强,L(·)表示预设的损失函数,
Figure PCTCN2020125967-appb-000010
表示服从策略模型得到的概率分布从各个预设策略中选取数据增强策略,D tr表示训练数据,Z为训练数据中输入数据x的数量。
在一种可能的实现方式中,在预先对数据处理模型进行第一阶段训练的过程中,从各个预设策略中,均匀随机选取第一阶段训练中的数据增强策略,根据第一阶段的数据增强策略对训练数据进行数据增强,根据数据增强的训练数据,对数据处理模型进行第一阶段训练,从而在第一阶段训练中也对训练数据进行数据增强,提高经过第一阶段训练的数据处理模型的训练效果。
在一种可能的实现方式中,经过第一阶段训练得到的数据处理模型的模型参数可表示为公式(5):
Figure PCTCN2020125967-appb-000011
其中,ω share表示经过第一阶段训练得到的数据处理模型的模型参数,
Figure PCTCN2020125967-appb-000012
表示服从均匀的概率分布从各个预设策略中选取数据增强策略。
本公开实施例中,充分利用数据增强策略对数据处理模型的后期训练影响更大的特点,根据数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,更新策略模型,通过更新后的策略模型,确定各预设策略的选中概率,通过调整各预设策略的概率,优化更新后的数据增强策略的质量,从而既提高了数据增强策略质量,又提高了数据增强策略的生成效率。
图6为本公开另一实施例提供的数据增强策略的更新方法的流程示意图。如图6所示,该方法包括:
S601、获取初始的数据增强策略。
S602、根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练。
S603、根据经过第二阶段训练的数据处理模型,更新预设的策略模型。
在一种可能的实现方式中,在根据经过第二阶段训练的数据处理模型,更新策略模型的过程中,通过验证数据,对经过第二阶段训练的数据处理模型的训练效果进行检验,得到检验结果,获取数据增强策略的前N-1次更新中经过第二阶段的数据处理模型的检验结果。为了描述清晰,将数据增强策略的前N-1次更新中经过第二阶段的数据处理模型的检验结果称为历史检验结果,可综合该检验结果和历史检验结果,对策略模型进行更新,以确保每次更新的过程中该策略模型更新的稳定性,进而提高数据增强策略更新效果。其中,N为数据增强策略当前更新的总次数,第N次更新即指当前更新过程。
在一种可能的实现方式中,在综合该检验结果和历史检验结果,对策略模型进行更新的过程中,可确定历史检验结果的均值,确定检验结果与该均值的差值,根据差值对策略模型中的策略参数进行更新,以确保每次更新的过程中该策略模型更新的稳定性,进而提高数据增强策略更新效果。策略参数的更新过程可采用启发式搜索算法,不再赘述。
S604、通过更新后的策略模型,确定各个预设策略的选中概率。
S605、按照各预设策略的选中概率,在各预设策略中选取更新后的数据增强策略。
在一种可能的实现方式中,步骤S601~S605可参照步骤S501~S505的详细描述,在此不再赘述。
S606、确定更新后的数据增强策略是否满足预设条件。
在一种可能的实现方式中,在更新后的数据增强策略满足预设条件的情况下,则执行S608;在更新后的数据增强策略不满足预设条件的情况下,执行S607。
S607、更新初始的数据增强策略为更新后的数据增强策略。
在一种可能的实现方式中,更新初始的数据增强策略为更新后的数据增强策略,并跳转至执行步骤S602,以对数据增强策略进行多次更新,提高数据增强策略的质量。
S608、得到最终的数据增强策略。
在一种可能的实现方式中,将更新后的数据增强策略设为最终的数据增强策略。
在一种可能的实现方式中,可通过确定数据增强策略的更新次数是否到达预设的次数阈值,来确定更新后的数据增强策略是否满足预设条件,在更新次数达到次数阈值的情况下,确定更新后的数据增强策略满足预设条件;在更新次数未达到次数阈值的情况下,确 定更新后的数据增强策略不满足预设条件。从而通过更新次数控制数据增强策略的更新是否继续,避免对数据增强策略一直更新。
在一种可能的实现方式中,除了通过确定数据增强策略的更新次数是否到达预设的次数阈值,来确定是否停止对数据增强策略的持续更新之外,还可通过确定经过第二阶段训练的数据处理模型的检验结果是否满足预设条件,来确定是否停止对数据增强策略的持续更新。
在一种可能的实现方式中,可将数据处理模型的检验结果与预设的检验阈值进行比较,在数据处理模型的检验结果大于检验阈值的情况下,表示经过第二训练阶段的数据处理模型满足预设条件,将数据增强策略设置为最终的数据增强策略;在数据处理模型的检验结果小于或等于该检验阈值的情况下,继续进行数据增强策略的更新。
在一种可能的实现方式中,每预设的更新次数,根据经过第二阶段训练的数据处理模型,在更新后的各数据增强策略中,选取最优的数据增强策略,在更新后的数据增强策略中,将除最优策略之外的各数据增强策略分别替换为最优的数据增强策略,从而提高更新过程的收敛性和数据增强策略的生成效率。其中,在选择最优的数据增强策略过程中,可以根据对经过第二阶段训练的数据处理模型的训练效果进行检测所得的检验结果进行选择。
例如,图7提供了多个数据增强策略并行更新的过程。如图7所示,每个长方体表示一个数据增强策略,每个正方体表示一个数据处理模型,准确率(Accuracy,ACC)表示经过第二阶段训练得到的数据处理模型的检验结果,每行表示一个数据增强策略的更新过程,每一列表示各个数据增强策略的一次更新。
如图7所示,可均匀随机地从各个预设策略中选取一个初始的数据增强策略,将该初始的数据增强策略复制多份,得到多个相同的初始的数据增强策略,多个数据增强策略并行进行更新,每隔预设更新次数,从各个更新后的数据增强策略中选取最优的数据增强策略,将最优的数据增强策略进行复制,如虚线箭头所示的策略复制,这里的策略复制也即:在各个更新后的数据增强策略中,将除最优的数据增强策略以外的剩余的数据增强策略替换为该最优的数据增强策略。因此,能够有效地提高数据增强策略多次更新的收敛性,得到质量较佳的数据增强策略。
如图7所示,在单次更新过程中,将经过第一阶段训练的数据处理模型的模型参数ω share加载至数据处理模型,得到经过第一阶段训练的数据处理模型,通过数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,再经过验证数据的检验,得到ACC,也即经过第二阶段训练的数据处理模型的检验结果,在基于该检验结果,对数据增强策略进行更新,得到更新后的数据增强策略。
参考图7可以看出,本公开实施例中,可对多个数据增强策略进行并行更新,数据增强策略的每次更新过程仅需对数据处理模型进行第二阶段训练,每预设更新次数将各个更新后的数据增强策略替换为当前最优的数据增强策略,且策略参数更新的计算量小,从而有效地提高了数据增强策略更新的效率、提高了数据增强策略的生成效率、且保证了数据增强策略的质量。
在一个实施例中,可通过调整第一阶段训练的训练次数占总训练次数的比例、或者第二阶段训练的训练次数占总训练次数的比例,来提高数据增强策略的生成效率。
图8为本公开一实施例提供的数据处理方法的流程示意图。如图8所示,该方法包括:
S801、获取待处理数据。
其中,可获取用户输入的待处理数据,也可预先采集的待处理数据。
S802、通过预先训练好的数据处理模型,对待处理数据进行处理,数据处理模型依次经过第一阶段训练和第二阶段训练,在第二训练阶段中通过预设的数据增强策略和预设的训练数据对数据处理模型进行训练。
其中,预先训练好数据处理模型,在数据处理模型的训练过程中,先对数据处理模型进行第一阶段训练,再根据数据增强策略和训练数据对数据处理模型进行第二阶段训练,从而充分利用数据增强对数据处理模型的后期训练影响更大的特点,提高数据处理模型的数据处理效果和模型训练效率。
在一种可能的实现方式中,将待处理数据输入数据处理模型,由数据处理模型对待处理数据进行处理,得到相应的处理结果。
在一种可能的实现方式中,数据处理模型的第二阶段训练所采用的数据增强策略,可通过上述任一实施例提高的数据增强策略的更新方法得到,以提高数据增强策略的质量和生成效率,进而提高数据处理模型的数据处理效果和模型训练效率。
在一种可能的实现方式中,在训练数据处理模型的过程中,可先通过训练数据,对数据处理模型进行第一阶段训练,得到经过第一阶段训练的数据处理模型。再通过数据增强策略对训练数据进行数据增强,基于数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,得到训练好的数据处理模型,从而充分利用数据增强对数据处理模型的后期训练影响更大的特点,提高数据处理模型的数据处理效果和模型训练效率。
在一种可能的实现方式中,在对数据处理模型进行第一阶段训练的过程中,可在各预设策略中,均匀随机选取数据增强策略,作为第一阶段训练的数据增强策略,通过选取的数据增强策略对训练数据进行数据增强,通过数据增强的训练数据对数据处理模型进行第一阶段训练,从而通过均匀随机选取数据增强策略,在尽量不增加模型训练所耗时长的情况下,提高数据处理模型第一阶段训练的训练效果,进而提高数据处理模型的整体训练效果。
在一种可能的实现方式中,待处理数据和训练数据可为图像数据或者文本数据,在数据处理模型为图像处理模型的情况下,待处理数据和训练数据为图像数据;在数据处理模型为自然语言处理模型的情况下,待处理数据和训练数据为文本数据,从而提高图像处理效果或自然语言处理效果。
本公开实施例中,通过预先训练好的数据处理模型对待处理数据进行处理,该数据处理模型的训练过程分为第一阶段训练和第二阶段训练,在第二阶段训练过程中采用了预设的数据增强策略,从而提高数据处理模型的数据处理效果和模型训练效率,进而提高了数据处理效果。
下面,将说明本公开实施例在一个实际的应用场景中的示例性应用。
自动机器学习是当前机器学习领域的一个热点领域,其相关技术在许多领域中可以起到提升模型表现和减少调优所需人力的作用。图像数据增强技术在图像处理领域也已经受到了广泛的运用。通过自动机器学习技术自动化图像数据增强过程,可以提高数据增强的针对性,也减少了不必要的人工调整。然而在特定任务的数据集上找到合适的增强策略是较复杂的,这是因为数据集的量级一般都较大,直接寻找的开销不可接受。而如果仅是寻找一个通用的策略并应用在所有任务中,其对模型的提升功能则会较低。而现有的一些自动数据增强搜索技术,有一些开销仍然巨大,有一些的提升效果也不太理想。其中,自动化机器学习的部分或全部过程。最常见的任务为自动进行机器学习的参数调整,例如自动寻找合适的模型结构、合适的数据增强策略、合适的损失函数、合适的优化器。
本公开实施例提供的数据增强策略的更新方法,可以在时间消耗和评价准确性之间取 得了良好的平衡,即可以直接在常规规模数据集上开展搜索,并得到稳定的提升;并且,适用于多个图像分类数据集,并具备一定的可迁移能力;还可以较容易地嵌入到各个图像分类任务中。
在一种可能的实现方式中,该数据增强策略的更新方法包括图像数据增强策略的搜索。搜索过程可分为以下三个步骤进行。首先,将模型在均匀随机策略下进行前期的训练。之后将进行One-Shot(搜索策略)搜索阶段,即反复加载前期训练的结束状态并执行后期训练,同时进行搜索。搜索目标是最优化后期训练的表现。最后,将搜索得到的策略运用在原始任务上重新整体训练,得到最终的模型表现。其中,One-Shot为一种搜索策略,原意为每次在整个搜索空间中采取一条“路径”,亦可广泛理解为多次重复的单采样更新。通过对此方法的前后期训练比例的合理调整,可以大幅提升搜索的时间效率。并且由于发明人观察到后期训练对于数据增强的影响更敏感,因此评价指标的稳定性在实验中也未观察到被破坏。利用此方法,可以提高各个图像分类模型在给定数据集下的性能,帮助模型在多个任务场景下取得更好的表现。
本公开实施例提供的数据增强策略的更新方法主要包括以下步骤:
步骤A,使用均匀随机的数据增强,进行前期训练。
在一种可能的实现方式中,该步骤A包括:获取未训练的初始模型;在均匀随机数据增强下训练;得到前期训练完毕的模型。其中,步骤A的输入为指定的图像分类数据集、完全未训练的模型;输出为前期训练完毕的模型。
在一种可能的实现方式中,该步骤A包括:
使用未经训练的初始模型作为起点。在实验中,可以选择多种模型分别独立地进行实验;
在前期训练的过程中,图像会以等概率进行各种数据增强。通过实际的实验观察,发现进行均匀的数据增强相比不进行数据增强,取得的效果更好。我们选择的数据增强操作可以是各种自动数据增强操作,以确保公平性。操作列表如表1所示,其中第二列表示的是各个操作的不同幅度值。考虑幅度值差异,共有36种可能的数据增强操作。在训练时对每张图片会均匀地随机两个操作进行使用。经过数据增强操作后的图片才作为模型实际上得到的输入。
保存前期训练完毕的模型,以供后期训练使用。
步骤B,进行One-Shot搜索,即反复进行后期训练,并不断更新数据增强策略。
在一种可能的实现方式中,该反复训练的详情可参考图7,如图7所示,每个长方体表示一个数据增强策略,每个正方体表示一个数据处理模型,准确率(Accuracy,ACC)表示经过第二阶段训练得到的数据处理模型的检验结果,每行表示一个数据增强策略的更新过程,每一列表示各个数据增强策略的一次更新。
其中,在单次更新过程中可以包括:加载前期训练完毕得到的模型。即每次后期训练都会重置模型参数为前期训练完毕得到的参数。使用当前策略控制数据增强,进行后期训练。当前策略是一个参数化的模型,其参数能够导出各个数据增强操作的概率。由于对每张图片会进行两次数据增强操作,因此结合考虑先后关系,共有36*36=1296种增强方法。需要注意的是,策略在每次后期训练后不会重置,而是会一直保持更新,直到整个搜索期结束。得到后期训练完毕的模型。此时,将对模型进行评价。通过选用了图像分类作为实际任务,因此评价指标即为分类的准确率。为了提高评价指标的稳定性和相对性,可以对每次评价减去了历史的指数滑动平均值。利用此时模型评价指标更新策略。此处使用了强化学习进行更新,其更新的目标是提升模型的评价指标。
经过若干次反复的训练和更新,将会得到最终的策略。最终策略可以导出为一个简短的脚本,以供便利地加入到期望的训练过程中。
步骤C,使用最终策略重新训练,得到最终模型和最终表现。该步骤中每一张图片都会在最终策略的控制下(对应的概率值下)进行数据增强。该步骤完成后即得到了最终的模型和表现。
本公开实施例提供的数据增强策略的更新方法利用One-Shot思路,在搜索效率和评价准确度之间达到了良好的平衡,且达到了同样条件下更好的实验效果。同时,算法搜索的结果能够被简易地导出,可以被其他任务灵活地使用。
本公开实施例提供的数据增强策略的更新方法,可以直接在图像分类任务或其他图像处理任务的训练过程中进行数据增强,以期望取得更好的表现和更强的泛化性;可以实现在指定数据集和指定模型下数据增强策略的搜索,以得到高度定制的数据增强策略;可以结合自定义的搜索空间,进行更广泛任务的数据增强策略搜索。例如自然语言处理等领域。
图9为本公开的一实施例提供的数据增强策略的更新装置的结构示意图。如图9所示,该装置包括:
获取部分901,被配置为获取初始的数据增强策略;
训练部分902,被配置为根据数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练;
更新部分903,被配置为根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新,以得到更新后的数据增强策略。
在一种可能的实现方式中,更新部分903还被配置为:
更新初始的数据增强策略为更新后的数据增强策略,以对数据增强策略进行多次更新。
在一种可能的实现方式中,数据增强策略的数量为多个,各数据增强策略的更新并行进行;更新部分903还被配置为:
每隔预设的更新次数,根据经过第二阶段训练的数据处理模型,在更新后的各数据增强策略中,选取最优的数据增强策略;
在更新后的数据增强策略中,将除最优策略之外的各数据增强策略分别替换为最优的数据增强策略。
在一种可能的实现方式中,数据增强策略包括多个预设的数据增强操作;训练部分902还被配置为:
按照各数据增强操作,依次对训练数据进行数据增强;
通过数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练。
在一种可能的实现方式中,训练数据为图像数据或文本数据。
在一种可能的实现方式中,更新部分903还被配置为:
根据经过第二阶段训练的数据处理模型,更新预设的策略模型;
通过更新后的策略模型,确定各个预设策略的选中概率;
按照各预设策略的选中概率,在各预设策略中选取更新后的数据增强策略。
在一种可能的实现方式中,在数据增强策略的更新次数为多次的情况下,更新部分903还被配置为:
根据预设的验证数据,对经过第二阶段训练的数据处理模型进行检验,得到检验结果;
获取数据增强策略的前N-1次更新中经过第二阶段的数据处理模型的历史检验结果,N为数据增强策略当前更新的总次数;
根据历史检验结果和检验结果,对策略模型进行更新。
在一种可能的实现方式中,更新部分903还被配置为:
确定历史检验结果的均值;
确定检验结果和均值的差值;
根据差值,对策略模型中的策略参数进行更新。
在一种可能的实现方式中,训练部分902还被配置为:
在各个预设策略中,均匀随机选取第一阶段训练中的数据增强策略;
根据第一阶段训练中的数据增强策略和训练数据,对数据处理模型进行第一阶段训练。
图9提供的数据增强策略的更新装置,可以执行上述相应方法实施例,其实现原理和技术效果类似,在此不再赘述。
图10为本公开的一实施例提供的数据处理装置的结构示意图。如图10所示,该装置包括:
获取部分1001,被配置为获取待处理数据;
处理部分1002,被配置为通过预先训练好的数据处理模型,对待处理数据进行处理,数据处理模型依次经过第一阶段训练和第二阶段训练,在第二训练阶段中通过预设的数据增强策略和预设的训练数据对数据处理模型进行训练。
在一种可能的实现方式中,数据增强策略采用上述任一实施例所示的数据增强策略的更新方法进行生成。
在一种可能的实现方式中,该装置还包括训练部分,训练部分还被配置为:
根据训练数据,对数据处理模型进行第一阶段训练;
通过数据增强策略对训练数据进行数据增强;
根据数据增强后的训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练。
在一种可能的实现方式中,训练部分还被配置为:
在各预设策略中,均匀随机选取第一阶段训练中的数据增强策略;
根据第一阶段训练中的数据增强策略和训练数据,对数据处理模型进行第一阶段训练。
在一种可能的实现方式中,待处理数据和训练数据为图像数据或者文本数据。
图10提供的数据处理装置,可以执行上述相应方法实施例,其实现原理和技术效果类似,在此不再赘述。
图11为本公开实施例提供的一种电子设备的结构示意图。如图11所示,该终端设备可以包括:处理器1101和存储器1102。存储器1102用于存储计算机执行指令,处理器1101执行计算机程序时实现如上述任一实施例的方法。
上述的处理器1101可以是通用处理器,包括中央处理器(central processing unit,CPU)、网络处理器(network processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。上述存储器1102可能包含随机存取存储器(random access memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如上述任一实施例的方法。
本公开实施例还提供一种程序产品,所述程序产品包括计算机程序,所述计算机程序存储在存储介质中,至少一个处理器可以从所述存储介质中读取所述计算机程序,所述至少一个处理器执行所述计算机程序时可实现上述任一实施例的方法。
图12是根据本实施例提供的数据增强策略的更新装置1200的框图。例如,装置1200可以被提供为一服务器或者一计算机。参照图12,装置1200包括处理组件1201,其进一步包括一个或多个处理器,以及由存储器1202所代表的存储器资源,用于存储可由处理组件1201的执行的指令,例如应用程序。存储器1202中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的部分。此外,处理组件1201被配置为执行指令,以执行上述图3至图6任一实施例的方法。
装置1200还可以包括一个电源组件1203被配置为执行装置1200的电源管理,一个有线或无线网络接口1204被配置为将装置1200连接到网络,和一个输入输出(I/O)接口1205。装置1200可以操作基于存储在存储器1202的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在本公开实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中,A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系;在公式中,字符“/”,表示前后关联对象是一种“相除”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中,a,b,c可以是单个,也可以是多个。
可以理解的是,在本公开实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本公开实施例的范围。
可以理解的是,在本公开的实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开的实施例旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求书指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求书来限制。
工业实用性
本公开实施例通过初始的数据增强策略和训练数据,对经过第一阶段训练的数据处理模型进行第二阶段训练,根据经过第二阶段训练的数据处理模型,对数据增强策略进行更新。这样,可以充分利用数据增强策略对数据处理模型的后期训练影响更大的特点,在确保数据增强策略质量的同时,提高数据增强策略的生成效率。

Claims (17)

  1. 一种数据增强策略的更新方法,所述方法包括:
    获取初始的数据增强策略;
    根据所述数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练;
    根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,以得到更新后的数据增强策略。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    获取第M次更新的所述数据增强策略,所述M大于或等于1;
    根据第M次更新的所述数据增强策略和所述训练数据,对所述经过第一阶段训练的数据处理模型进行第二阶段训练;
    根据经过第二阶段训练的数据增强模型,对所述数据增强策略进行第M+1次更新。
  3. 根据权利要求2所述的方法,其中,所述初始的数据增强策略的数量为多个,各所述数据增强策略的更新并行进行;所述方法还包括:
    每预设的更新次数,根据所述经过第二阶段训练的数据处理模型,在更新后的各所述数据增强策略中,选取最优的数据增强策略;
    在更新后的所述数据增强策略中,将除所述最优策略之外的各所述数据增强策略分别替换为所述最优的数据增强策略。
  4. 根据权利要求1-3任一项所述的方法,其中,所述数据增强策略包括多个预设的数据增强操作;所述根据所述数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练,包括:
    按照各所述数据增强操作,依次对所述训练数据进行数据增强;
    通过数据增强后的所述训练数据,对所述经过第一阶段训练的数据处理模型进行第二阶段训练。
  5. 根据权利要求1-3任一项所述的方法,其中,所述根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,包括:
    根据所述经过第二阶段训练的数据处理模型,更新预设的策略模型;
    通过更新后的所述策略模型,确定各个预设策略的选中概率;
    按照各所述预设策略的选中概率,在各所述预设策略中选取更新后的所述数据增强策略。
  6. 根据权利要求5所述的方法,其中,在所述数据增强策略的更新次数为多次的情况下,所述根据经过第二阶段训练的数据处理模型,更新预设的策略模型,包括:
    根据预设的验证数据,对所述经过第二阶段训练的数据处理模型进行检验,得到检验结果;
    获取所述数据增强策略的前N-1次更新中所述经过第二阶段的数据处理模型的历史检验结果,所述N为所述数据增强策略当前更新的总次数;
    根据所述历史检验结果和所述检验结果,对所述策略模型进行更新。
  7. 根据权利要求6所述的方法,其中,所述根据所述历史检验结果和所述检验结果,对所述策略模型进行更新,包括:
    确定所述历史检验结果的均值;
    确定所述检验结果和所述均值的差值;
    根据所述差值,对所述策略模型中的策略参数进行更新。
  8. 根据权利要求1-3任一项所述的方法,其中,所述获取初始的数据增强策略之前,所述方法还包括:
    在各个预设策略中,均匀随机选取所述第一阶段训练中的数据增强策略;
    根据所述第一阶段训练中的数据增强策略和所述训练数据,对所述数据处理模型进行所述第一阶段训练。
  9. 一种数据处理方法,所述方法包括:
    获取待处理数据;
    通过预先训练好的数据处理模型,对所述待处理数据进行处理,所述数据处理模型依次经过第一阶段训练和第二阶段训练,在所述第二训练阶段中通过预设的数据增强策略和预设的训练数据对所述数据处理模型进行训练,所述数据增强策略采用如权利要求1-8任一项所述的数据增强策略的更新方法进行生成。
  10. 根据权利要求9所述的方法,其中,所述方法还包括:
    根据所述训练数据,对所述数据处理模型进行所述第一阶段训练;
    通过所述数据增强策略对所述训练数据进行数据增强;
    根据数据增强后的所述训练数据,对经过所述第一阶段训练的数据处理模型进行所述第二阶段训练。
  11. 根据权利要求10所述的方法,其中,所述根据所述训练数据,对所述数据处理模型进行所述第一阶段训练,包括:
    在各预设策略中,均匀随机选取所述第一阶段训练中的数据增强策略;
    根据所述第一阶段训练中的数据增强策略和所述训练数据,对所述数据处理模型进行所述第一阶段训练。
  12. 根据权利要求9-11任一项所述的方法,其中,所述待处理数据和所述训练数据为图像数据或者文本数据。
  13. 一种数据增强策略的更新装置,所述装置包括:
    获取部分,被配置为获取初始的数据增强策略;
    训练部分,被配置为根据所述数据增强策略和预设的训练数据,对预设的经过第一阶段训练的数据处理模型进行第二阶段训练;
    更新部分,被配置为根据经过第二阶段训练的数据处理模型,对所述数据增强策略进行更新,以得到更新后的所述数据增强策略。
  14. 一种数据处理装置,所述装置包括:
    获取部分,被配置为获取待处理数据;
    处理部分,被配置为通过预先训练好的数据处理模型,对所述待处理数据进行处理,所述数据处理模型依次经过第一阶段训练和第二阶段训练,在所述第二训练阶段中通过预设的数据增强策略和预设的训练数据对所述数据处理模型进行训练,所述数据增强策略采用如权利要求1-8任一项所述的数据增强策略的更新方法进行生成。
  15. 一种电子设备,其中,所述电子设备包括:存储器和处理器;
    所述存储器用于存储程序指令;
    所述处理器用于调用所述存储器中的程序指令执行如权利要求1-8中任一项或者权利要求9-12中任一项所述的方法。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序;所述计算机程序被执行时,实现如权利要求1-8中任一项或者权利要求9-12中任一项所述的方法。
  17. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1-8中任一项或者权利要求9-12中任一项所述的方法。
PCT/CN2020/125967 2020-06-09 2020-11-02 数据增强策略的更新方法、装置、设备及存储介质 WO2021248791A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021569392A JP2022541370A (ja) 2020-06-09 2020-11-02 データ強化ポリシーの更新方法、装置、デバイス及び記憶媒体
KR1020217038153A KR20220004692A (ko) 2020-06-09 2020-11-02 데이터 증강 정책의 업데이트 방법, 장치, 기기 및 저장 매체

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010519507.3 2020-06-09
CN202010519507.3A CN111695624B (zh) 2020-06-09 2020-06-09 数据增强策略的更新方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021248791A1 true WO2021248791A1 (zh) 2021-12-16

Family

ID=72479980

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125967 WO2021248791A1 (zh) 2020-06-09 2020-11-02 数据增强策略的更新方法、装置、设备及存储介质

Country Status (5)

Country Link
JP (1) JP2022541370A (zh)
KR (1) KR20220004692A (zh)
CN (1) CN111695624B (zh)
TW (1) TWI781576B (zh)
WO (1) WO2021248791A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114665986A (zh) * 2022-03-15 2022-06-24 深圳市百泰实业股份有限公司 一种蓝牙钥匙的测试系统及方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695624B (zh) * 2020-06-09 2024-04-16 北京市商汤科技开发有限公司 数据增强策略的更新方法、装置、设备及存储介质
CN114462628A (zh) * 2020-11-09 2022-05-10 华为技术有限公司 数据增强方法、装置、计算设备以及计算机可读存储介质
CN113537406B (zh) * 2021-08-30 2023-04-07 重庆紫光华山智安科技有限公司 一种图像自动数据增强方法、系统、介质及终端

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110110861A (zh) * 2019-05-09 2019-08-09 北京市商汤科技开发有限公司 确定模型超参数及模型训练的方法和装置、存储介质
CN110807109A (zh) * 2019-11-08 2020-02-18 北京金山云网络技术有限公司 数据增强策略的生成方法、数据增强方法和装置
US20200114926A1 (en) * 2018-10-16 2020-04-16 Toyota Motor Engineering & Manufacturing North America, Inc. Vehicle velocity predictor using neural networks based on v2x data augmentation to enable predictive optimal control of connected and automated vehicles
CN111695624A (zh) * 2020-06-09 2020-09-22 北京市商汤科技开发有限公司 数据增强策略的更新方法、装置、设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9449283B1 (en) * 2012-08-20 2016-09-20 Context Relevant, Inc. Selecting a training strategy for training a machine learning model
CN111758105A (zh) * 2018-05-18 2020-10-09 谷歌有限责任公司 学习数据增强策略
CN109961098B (zh) * 2019-03-22 2022-03-01 中国科学技术大学 一种机器学习的训练数据选择方法
CN111127364B (zh) * 2019-12-26 2022-08-02 吉林大学 图像数据增强策略选择方法及人脸识别图像数据增强方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200114926A1 (en) * 2018-10-16 2020-04-16 Toyota Motor Engineering & Manufacturing North America, Inc. Vehicle velocity predictor using neural networks based on v2x data augmentation to enable predictive optimal control of connected and automated vehicles
CN110110861A (zh) * 2019-05-09 2019-08-09 北京市商汤科技开发有限公司 确定模型超参数及模型训练的方法和装置、存储介质
CN110807109A (zh) * 2019-11-08 2020-02-18 北京金山云网络技术有限公司 数据增强策略的生成方法、数据增强方法和装置
CN111695624A (zh) * 2020-06-09 2020-09-22 北京市商汤科技开发有限公司 数据增强策略的更新方法、装置、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114665986A (zh) * 2022-03-15 2022-06-24 深圳市百泰实业股份有限公司 一种蓝牙钥匙的测试系统及方法
CN114665986B (zh) * 2022-03-15 2023-05-16 深圳市百泰实业股份有限公司 一种蓝牙钥匙的测试系统及方法

Also Published As

Publication number Publication date
JP2022541370A (ja) 2022-09-26
TWI781576B (zh) 2022-10-21
CN111695624A (zh) 2020-09-22
KR20220004692A (ko) 2022-01-11
TW202147180A (zh) 2021-12-16
CN111695624B (zh) 2024-04-16

Similar Documents

Publication Publication Date Title
WO2021248791A1 (zh) 数据增强策略的更新方法、装置、设备及存储介质
US20230043174A1 (en) Method for pushing anchor information, computer device, and storage medium
WO2018227800A1 (zh) 一种神经网络训练方法及装置
KR20160037022A (ko) 부스트 풀링 뉴럴 네트워크 기반의 데이터 분류 장치 및 그 데이터 분류 장치를 위한 뉴럴 네트워크 학습 방법
US9361666B2 (en) Learning user preferences for photo adjustments
CN110597878B (zh) 一种多模态数据的跨模态检索方法、装置、设备及介质
CN112257815A (zh) 模型生成方法、目标检测方法、装置、电子设备及介质
WO2020238039A1 (zh) 神经网络搜索方法及装置
US20220405579A1 (en) Single-stage model training for neural architecture search
JP2023523029A (ja) 画像認識モデル生成方法、装置、コンピュータ機器及び記憶媒体
EP4094197A1 (en) Neural architecture search with weight sharing
JP2022063250A (ja) SuperLoss:堅牢なカリキュラム学習のための一般的な損失
US20200334557A1 (en) Chained influence scores for improving synthetic data generation
US20160070705A1 (en) Interactive feedback for changes in search relevancy parameters
WO2023207139A1 (zh) 利用交流型樽海鞘算法求解拉伸/压缩弹簧参数的方法
CN112232397A (zh) 图像分类模型的知识蒸馏方法、装置和计算机设备
CN113537630A (zh) 业务预测模型的训练方法及装置
CN110991621A (zh) 一种基于通道数搜索卷积神经网络的方法
CN109033428B (zh) 一种智能客服方法及系统
WO2021253938A1 (zh) 一种神经网络的训练方法、视频识别方法及装置
CN112668718B (zh) 神经网络训练方法、装置、电子设备以及存储介质
US11507782B2 (en) Method, device, and program product for determining model compression rate
US20230087774A1 (en) Parameter optimization method, electronic device, and storage medium
CN116910210A (zh) 基于文档的智能问答模型训练方法、装置及其应用
CN115170902B (zh) 图像处理模型的训练方法

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021569392

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20217038153

Country of ref document: KR

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20940452

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20940452

Country of ref document: EP

Kind code of ref document: A1