Method, device and equipment for training data processing model and data processing method
By using data augmentation and model parameter tuning, the problem of poor robustness of neural network models was solved, and the accuracy of data processing models was improved.
Patent Information
- Application Number
- CN202210491871.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-05-07
AI Technical Summary
The poor robustness of existing neural network models leads to low accuracy in data processing models.
By acquiring data augmentation parameters, the training data is augmented, and the model parameters of the network model are adjusted until the training termination condition is met. The adjusted network model is then used as the data processing model.
This improved the robustness and accuracy of the model, and enhanced the accuracy of the data processing results.
Smart Images

Figure CN114897158B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a data processing model training method, a data processing method, an apparatus and a device. BACKGROUND
[0002] With the continuous development of artificial intelligence technology, the types and functions of neural network models are also increasing. Common neural network models include classification models, identification models, recommendation models, etc. A trained neural network model can process input data, so the trained neural network model can also be referred to as a data processing model.
[0003] In related technologies, a neural network model is first built, and at the same time, training data and annotation results of the training data are obtained to train the neural network model multiple times using the training data and the annotation results of the training data to obtain a data processing model. The process of training the neural network model once is also the process of inputting the training data into the neural network model, outputting the prediction results of the training data by the neural network model, and adjusting the model parameters of the neural network model once based on the prediction results of the training data and the annotation results of the training data.
[0004] The above training method can result in poor robustness of the neural network model, thereby affecting the accuracy of the data processing model. SUMMARY
[0005] Embodiments of the present application provide a data processing model training method, a data processing method, an apparatus and a device, which can be used to solve the problems in related technologies. The technical solution includes the following contents.
[0006] In one aspect, the present application provides a data processing model training method, which comprises:
[0007] obtaining a first data augmentation parameter corresponding to a current training, a first network model and a first training data, wherein the first data augmentation parameter is used to represent information of data augmentation processing;
[0008] based on the first data augmentation parameter, performing data augmentation processing on the first training data to obtain the first training data after data augmentation processing;
[0009] based on the first training data after data augmentation processing, adjusting the model parameters of the first network model to obtain a second network model;
[0010] in response to satisfying a training end condition, taking the second network model as a data processing model.
[0011] In a possible implementation, the first data augmentation parameter comprises a selected probability of at least one candidate data augmentation processing.
[0012] The data augmentation processing on the first training data based on the first data augmentation parameter comprises:
[0013] The target data augmentation processing is determined from the at least one candidate data augmentation processing based on the selected probability of the at least one candidate data augmentation processing.
[0014] The first training data is subjected to the target data augmentation processing to obtain the data augmentation processed first training data.
[0015] In a possible implementation, the first data augmentation parameter further comprises an executed probability of each sub data augmentation processing in the target data augmentation processing.
[0016] The target data augmentation processing on the first training data comprises:
[0017] The target sub data augmentation processing is determined from the each sub data augmentation processing based on the executed probability of the each sub data augmentation processing.
[0018] The first training data is subjected to the target sub data augmentation processing to obtain the data augmentation processed first training data.
[0019] In a possible implementation, the adjustment of the model parameter of the first network model based on the data augmentation processed first training data to obtain a second network model comprises:
[0020] The data augmentation processed first training data is input into the first network model to obtain a prediction result of the data augmentation processed first training data.
[0021] An annotation result of the first training data is obtained.
[0022] The model parameter of the first network model is adjusted based on the prediction result of the data augmentation processed first training data and the annotation result of the first training data to obtain a second network model.
[0023] In a possible implementation, after the second network model is obtained, the method further comprises:
[0024] In response to the training end condition not being met, first verification data of the current training is obtained.
[0025] determine a loss value of the second network model corresponding to the first verification data based on the first verification data and the second network model;
[0026] determine a second data augmentation parameter for next training based on the loss value of the second network model corresponding to the first verification data, the second data augmentation parameter being used to represent information of data augmentation processing.
[0027] In a possible implementation, the determining of the loss value of the second network model corresponding to the first verification data based on the first verification data and the second network model includes:
[0028] perform data augmentation processing on the first verification data based on the first data augmentation parameter to obtain first verification data after data augmentation processing;
[0029] determine the loss value of the second network model corresponding to the first verification data based on the first verification data after data augmentation processing and the second network model.
[0030] In a possible implementation, the obtaining of the first network model includes:
[0031] obtain a candidate network model and first network structure parameters corresponding to the current training, the first network structure parameters being used to represent structure information of the first network model;
[0032] perform sampling processing on the candidate network model based on the first network structure parameters to obtain the first network model.
[0033] In a possible implementation, the candidate network model includes a plurality of candidate edges, the candidate edges being used to represent operation processing on a feature vector, and the first network structure parameters include importance parameters of each candidate edge.
[0034] The performing of the sampling processing on the candidate network model based on the first network structure parameters to obtain the first network model includes:
[0035] perform sampling processing on the plurality of candidate edges based on the importance parameters of each candidate edge to obtain a plurality of target edges;
[0036] determine the first network model based on the plurality of target edges.
[0037] In a possible implementation, each candidate edge corresponds to at least one candidate operation processing, and the first network structure parameters further include importance parameters of each candidate operation processing corresponding to each target edge.
[0038] The determining of the first network model based on the plurality of target edges includes:
[0039] For any target edge, based on the importance parameters of various candidate operation processes corresponding to the any target edge, the various candidate operation processes corresponding to the any target edge are sampled to obtain a target operation process corresponding to the any target edge;
[0040] Based on the target operation processes corresponding to the plurality of target edges, the first network model is determined.
[0041] In a possible implementation, the first network structure parameter is obtained, including:
[0042] The second verification data corresponding to the last training is obtained;
[0043] Based on the second verification data and the first network model, a loss value of the first network model corresponding to the second verification data is determined;
[0044] Based on the loss value of the first network model corresponding to the second verification data, the first network structure parameter is determined.
[0045] In a possible implementation, the first data enhancement parameter is obtained, including:
[0046] The second verification data corresponding to the last training is obtained;
[0047] Based on the second verification data and the first network model, a loss value of the first network model corresponding to the second verification data is determined;
[0048] Based on the loss value of the first network model corresponding to the second verification data, the first data enhancement parameter is determined.
[0049] In another aspect, the embodiments of the present application provide a data processing method, and the method comprises:
[0050] Obtaining target data;
[0051] Inputting the target data into a data processing model to obtain a data processing result of the target data, wherein the data processing model is obtained by training according to the data processing model training method.
[0052] In another aspect, the embodiments of the present application provide a data processing model training device, and the device comprises:
[0053] An obtaining module is configured to obtain a first data enhancement parameter, a first network model and first training data corresponding to a current training, wherein the first data enhancement parameter is used to represent information of data enhancement processing;
[0054] a data enhancement module, configured to perform data enhancement processing on the first training data based on the first data enhancement parameter to obtain first training data after data enhancement processing;
[0055] an adjustment module, configured to adjust model parameters of the first network model based on the first training data after data enhancement processing to obtain a second network model;
[0056] a determination module, configured to take the second network model as a data processing model in response to satisfaction of a training end condition.
[0057] In a possible implementation, the first data enhancement parameter comprises a selected probability of at least one candidate data enhancement processing;
[0058] The data enhancement module is configured to determine a target data enhancement processing from the at least one candidate data enhancement processing based on the selected probability of the at least one candidate data enhancement processing, and perform target data enhancement processing on the first training data to obtain the first training data after data enhancement processing.
[0059] In a possible implementation, the first data enhancement parameter further comprises an executed probability of each sub data enhancement processing in the target data enhancement processing;
[0060] The data enhancement module is configured to determine a target sub data enhancement processing from the each sub data enhancement processing based on the executed probability of the each sub data enhancement processing, and perform target sub data enhancement processing on the first training data to obtain the first training data after data enhancement processing.
[0061] In a possible implementation, the adjustment module is configured to input the first training data after data enhancement processing into the first network model to obtain a prediction result of the first training data after data enhancement processing, acquire a label result of the first training data, and adjust the model parameters of the first network model based on the prediction result of the first training data after data enhancement processing and the label result of the first training data to obtain the second network model.
[0062] In a possible implementation, the acquisition module is further configured to acquire first verification data of the current training in response to non-satisfaction of the training end condition.
[0063] The determining module is configured to determine a loss value of the second network model corresponding to the first verification data based on the first verification data and the second network model; and determine a second data enhancement parameter for next training based on the loss value of the second network model corresponding to the first verification data, where the second data enhancement parameter is used to represent information of data enhancement processing.
[0064] In a possible implementation, the determining module is configured to perform data enhancement processing on the first verification data based on the first data enhancement parameter to obtain first verification data after data enhancement processing; and determine a loss value of the second network model corresponding to the first verification data based on the first verification data after data enhancement processing and the second network model.
[0065] In a possible implementation, the obtaining module is configured to obtain a candidate network model and first network structure parameters corresponding to the current training, where the first network structure parameters are used to represent structure information of a first network model; and perform sampling processing on the candidate network model based on the first network structure parameters to obtain the first network model.
[0066] In a possible implementation, the candidate network model includes a plurality of candidate edges, where the candidate edges are used to represent operation processing on a feature vector, and the first network structure parameters include importance parameters of each candidate edge.
[0067] The obtaining module is configured to perform sampling processing on the plurality of candidate edges based on the importance parameters of each candidate edge to obtain a plurality of target edges; and determine a first network model based on the plurality of target edges.
[0068] In a possible implementation, each candidate edge corresponds to at least one candidate operation processing, and the first network structure parameters further include importance parameters of each candidate operation processing corresponding to each target edge.
[0069] The obtaining module is configured to, for each target edge, perform sampling processing on each candidate operation processing corresponding to the target edge based on the importance parameters of each candidate operation processing corresponding to the target edge to obtain a target operation processing corresponding to the target edge; and determine the first network model based on the target operation processing corresponding to the plurality of target edges.
[0070] In a possible implementation, the obtaining module is configured to obtain second verification data corresponding to the last training; determine a loss value of the first network model corresponding to the second verification data based on the second verification data and the first network model; and determine the first network structure parameters based on the loss value of the first network model corresponding to the second verification data.
[0071] In a possible implementation, the acquisition module is configured to acquire second verification data corresponding to the last training; determine a loss value of the first network model corresponding to the second verification data based on the second verification data and the first network model; and determine the first data enhancement parameter based on the loss value of the first network model corresponding to the second verification data.
[0072] In another aspect, an embodiment of the present application provides a data processing apparatus, the apparatus comprising:
[0073] An acquisition module is configured to acquire target data.
[0074] A obtaining module is configured to input the target data into a data processing model to obtain a data processing result of the target data, the data processing model being obtained by training according to the training method of the data processing model of any one of the above aspects.
[0075] In another aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory, the memory storing at least one program code, the at least one program code being loaded and executed by the processor to enable the electronic device to implement the training method of the data processing model of any one of the above aspects or the data processing method of any one of the above aspects.
[0076] In another aspect, a computer readable storage medium is also provided, the computer readable storage medium storing at least one program code, the at least one program code being loaded and executed by a processor to enable a computer to implement the training method of the data processing model of any one of the above aspects or the data processing method of any one of the above aspects.
[0077] In another aspect, a computer program or computer program product is also provided, the computer program or computer program product storing at least one computer instruction, the at least one computer instruction being loaded and executed by a processor to enable a computer to implement the training method of any one of the data processing models or the data processing method of any one of the above aspects.
[0078] The technical solutions provided in the embodiments of the present application bring at least the following beneficial effects:
[0079] The technical scheme provided in the embodiments of the present application first performs data enhancement processing on the first training data corresponding to the current training based on the first data enhancement parameter corresponding to the current training, and then adjusts the model parameter of the first network model corresponding to the current training based on the first training data after the data enhancement processing, so that the prediction ability of the model is improved, thereby improving the robustness and accuracy of the model, and further improving the accuracy of the data processing result when data processing is performed based on the data processing model. BRIEF DESCRIPTION OF DRAWINGS
[0080] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0081] Figure 1 is a schematic diagram of an implementation environment of a data processing model training method or a data processing method provided by the embodiments of the present application;
[0082] Figure 2 is a flowchart of a data processing model training method provided by the embodiments of the present application;
[0083] Figure 3 is a flowchart of a data processing method provided by the embodiments of the present application;
[0084] Figure 4 is a structural schematic diagram of a data processing model training device provided by the embodiments of the present application;
[0085] Figure 5 is a structural schematic diagram of a data processing device provided by the embodiments of the present application;
[0086] Figure 6 is a structural schematic diagram of a terminal device provided by the embodiments of the present application;
[0087] Figure 7 is a structural schematic diagram of a server provided by the embodiments of the present application. DETAILED DESCRIPTION
[0088] In order to make the purpose, technical scheme and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0089] Figure 1 is a schematic diagram of an implementation environment of a data processing model training method or a data processing method provided by the embodiments of the present application, as Figure 1The implementation environment shown includes an electronic device 11. The training method of the data processing model or the data processing method in the embodiments of the present application can be executed by the electronic device 11. Exemplarily, the electronic device 11 can include at least one of a terminal device or a server.
[0090] The terminal device can be at least one of a smartphone, a game console, a desktop computer, a tablet computer, and a laptop computer. The server can be a single server, or a server cluster composed of multiple servers, or any one of a cloud computing platform and a virtualization center, which is not limited in the embodiments of the present application. The server can be communicatively connected with the terminal device through a wired network or a wireless network. The server can have functions of data processing, data storage, and data transceiving, which are not limited in the embodiments of the present application.
[0091] Based on the above implementation environment, the embodiments of the present application provide a training method of a data processing model, which is executed by the electronic device 11 in the implementation environment. Figure 2 The training method of the data processing model provided by the embodiments of the present application is exemplified by a flowchart. The method can be executed by the electronic device 11 in the implementation environment. Figure 1 As shown in the figure, the method includes steps 201 to 204. Figure 2
[0092] In step 201, a first data augmentation parameter corresponding to a current training, a first network model, and first training data are obtained. The first data augmentation parameter is used to represent information of data augmentation processing.
[0093] The current training is any one of the first training to the last training. For the current training, the first data augmentation parameter corresponding to the current training, the first network model corresponding to the current training, and the first training data corresponding to the current training need to be obtained. The number of the first training data is multiple, and the data type and the obtaining manner of the first training data are not limited in the embodiments of the present application. Exemplarily, the data type of the first training data is multimedia data (i.e., the first training data is first training multimedia data), and any multimedia data can be obtained as the first training multimedia data. Here, the multimedia data includes at least one of text data, image data, audio data, and video data.
[0094] Exemplarily, obtaining the first data augmentation parameter includes: obtaining second verification data corresponding to the last training; determining a loss value of the first network model corresponding to the second verification data based on the second verification data and the first network model; and determining the first data augmentation parameter based on the loss value of the first network model corresponding to the second verification data.
[0095] The second verification data has a plurality of quantities, and the data type of the second verification data is the same as the data type of the first training data. For example, if the data type of the first training data is multimedia data, the data type of the second verification data is also multimedia data (i.e., the second verification data is second verification multimedia data). In addition, the second verification data is obtained in a similar manner to the first training data. The second verification data and the first training data can be the same data or different data, which is not limited herein.
[0096] In the embodiments of the present application, the second verification data can be input into the first network model, and the first network model outputs a prediction result of the second verification data. The prediction result of the second verification data is a data processing result of the second verification data obtained by prediction. In addition, a labeled result of the second verification data can also be obtained. The labeled result of the second verification data is a data processing result of the second verification data obtained by labeling. Then, based on the prediction result of the second verification data and the labeled result of the second verification data, a loss value of the first network model corresponding to the second verification data is determined.
[0097] It should be noted that the first network model is used to perform data processing on the input second verification data, and outputs a prediction result of the second verification data. The prediction result is a data processing result obtained by prediction. In the embodiments of the present application, the data processing is not limited, and for example, the data processing can be any one of classification processing, translation processing, recognition processing, detection processing, etc.
[0098] For example, the second verification data is second verification multimedia data, and the first network model can perform classification processing on the second verification multimedia data, and output a prediction result of the second verification multimedia data. The prediction result is a classification result of the second verification multimedia data obtained by prediction.
[0099] Optionally, a third data augmentation parameter corresponding to the last training is obtained. The second verification data is processed by data augmentation based on the third data augmentation parameter, and data augmentation processed second verification data is obtained. Based on the data augmentation processed second verification data and the first network model, a loss value of the first network model corresponding to the second verification data is determined. The third data augmentation parameter is obtained in a similar manner to the first data augmentation parameter, which can be seen from the description of the “obtaining the first data augmentation parameter” above, and will not be repeated here.
[0100] The second verification data processed by the data augmentation can be input into the first network model, and a prediction result of the second verification data processed by the data augmentation is output by the first network model. The prediction result of the second verification data processed by the data augmentation is a data processing result of the second verification data processed by the data augmentation obtained by prediction. Then, based on the prediction result of the second verification data processed by the data augmentation and the labeled result of the second verification data, a loss value of the first network model corresponding to the second verification data is determined.
[0101] Next, based on the loss value of the first network model corresponding to the second verification data, the first data augmentation parameter is determined. The random gradient descent algorithm can be used to determine the first data augmentation parameter based on the loss value of the first network model corresponding to the second verification data. The manner of determining the first data augmentation parameter is similar to the manner of determining the second data augmentation parameter for the next training, which can be seen from the description of the second data augmentation parameter below, and will not be repeated here.
[0102] It should be noted that, taking the second verification data as an example, the third data augmentation parameter corresponding to the last training can be obtained. The second verification multimedia data is processed by data augmentation based on the third data augmentation parameter, and the second verification multimedia data processed by data augmentation is obtained. The second verification multimedia data processed by data augmentation is input into the first network model, and a prediction result of the second verification multimedia data processed by data augmentation is output by the first network model. The prediction result is a data processing result obtained by prediction. At the same time, the labeled result of the second verification multimedia data is obtained, which is a data processing result obtained by labeling. Then, based on the prediction result of the second verification multimedia data processed by data augmentation and the labeled result of the second verification multimedia data, the loss value of the first network model corresponding to the second verification multimedia data is determined, and the first data augmentation parameter is determined based on the loss value. The data processing result is a processing result of any one of classification processing, translation processing, recognition processing, and detection processing.
[0103] In a possible implementation, the first network model is obtained by: obtaining a candidate network model and a first network structure parameter corresponding to the current training, the first network structure parameter being used to represent structure information of the first network model; and performing sampling processing on the candidate network model based on the first network structure parameter to obtain the first network model.
[0104] The embodiments of the present application do not limit the structure and acquisition method of the candidate network model. For example, a pre-built candidate network model can be directly acquired, and the candidate network model is stacked by at least one network layer, and any network layer can be referred to as a cell. Each network layer includes a plurality of (for example, 4) nodes, and any node represents a layer of feature vectors. There is a super-edge between any two nodes in a network layer, and the super-edge represents operation processing on the feature vectors. Any super-edge corresponds to at least one operation processing, for example, any super-edge corresponds to 7 operation processings, and the 7 operation processings are 3*3 separable convolution, 5*5 separable convolution, 3*3 separable atrous convolution, 5*5 separable atrous convolution, 3*3 maximum value pooling, 3*3 average value pooling, and skip connection operation. Among them, the super-edge in the embodiments of the present application is the candidate edge mentioned below, and the operation processing in the embodiments of the present application is the candidate operation processing mentioned below.
[0105] If the current training is the first training, the first network structure parameter corresponding to the current training is an initial network structure parameter, and the initial network structure parameter is a network structure parameter artificially set or randomly set. If the current training is any training other than the first training, the first network structure parameter corresponding to the current training is determined based on the second validation data, and the manner of determining the first network structure parameter based on the second validation data is described below.
[0106] In a possible implementation, the first network structure parameter is acquired by: acquiring second validation data corresponding to the last training; determining a loss value of the first network model corresponding to the second validation data based on the second validation data and the first network model; and determining the first network structure parameter based on the loss value of the first network model corresponding to the second validation data.
[0107] The manner of acquiring the second validation data and the manner of determining the loss value of the first network model corresponding to the second validation data have been described above, and will not be repeated here. The random gradient descent algorithm can be used to determine the first network structure parameter based on the loss value of the first network model corresponding to the second validation data. The manner of determining the first network structure parameter is similar to the manner of determining the second network structure parameter of the next training, which can be seen from the description of the second network structure parameter below, and will not be repeated here.
[0108] Since the first network structure parameter is used to represent the structure information of the first network model, the candidate network model can be sampled based on the first network structure parameter to obtain the first network model. Each candidate edge in the candidate network model corresponds to at least one candidate operation processing, and therefore, sampling the candidate network model is a sampling process of the candidate edges in the candidate network model and the candidate operation processing corresponding to the candidate edges.
[0109] Optionally, the candidate network model is denoted as a, the candidate edge in the candidate network model is denoted as B, and the candidate operation processing corresponding to the candidate edge in the candidate network model is denoted as A. The first network model can be represented as: B~p(β). Wherein a~p(α,β) represents the first network model obtained by sampling the candidate network model based on α and β, is an equivalent symbol, A~p(α) represents sampling the candidate operation processing corresponding to the candidate edge in the candidate network model based on α, and B~p(β) represents sampling the candidate edge in the candidate network model based on β. Wherein α represents the importance parameter of various candidate operation processing corresponding to the target edge, and β represents the importance parameter of each candidate edge. The α and β will be described in detail below, and will not be described here.
[0110] In a possible implementation, the candidate network model includes a plurality of candidate edges, the candidate edge represents operation processing on a feature vector, and the first network structure parameter includes the importance parameter of each candidate edge. Sampling the candidate network model based on the first network structure parameter to obtain the first network model includes: sampling the plurality of candidate edges based on the importance parameter of each candidate edge to obtain a plurality of target edges; and determining the first network model based on the plurality of target edges.
[0111] As mentioned above, there is a candidate edge between any two nodes in any network layer in the candidate network model, and the candidate edge represents operation processing on a feature vector. The first network structure parameter includes the importance parameter of each candidate edge, and the plurality of candidate edges can be sampled based on the importance parameter of each candidate edge to obtain a plurality of target edges.
[0112] Optionally, the Gumbel reparameterization method is used to sample the plurality of candidate edges based on the importance parameter of each candidate edge, and the sampling process will be described in detail below.
[0113] In the embodiment of the application, for a node j inside a cell, the candidate edge of the input node j is denoted as e i,j , wherein i∈{1,2,…,j-1}. The importance parameter of the candidate edge e i,j is denoted as β i,jis determined according to formula (1) shown as follows i,j whether the candidate edge e
[0114]
[0115] wherein, β i,j is an importance parameter of the candidate edge e i,j , β k,j is an importance parameter of the candidate edge e k,j , exp is a symbol of an exponential function (Exp), ∑ is a summation symbol, and τ is a hyperparameter. denotes an importance parameter of the normalized candidate edge e i,j , denotes an importance parameter of the normalized candidate edge e k,j , log is a logarithmic symbol. i,j denotes a random variable sampled according to a Gumbel distribution for the edge e i,j , g k,j denotes a random variable sampled according to a Gumbel distribution for the edge e k,j , denotes a sampling probability of the candidate edge e i,j , B i,j denotes whether the candidate edge e i,j is sampled, and argtop2 is used to take the top two variable values of a target function. The variable value is i.
[0116] According to formula (1), the value of B i,j is 0 or 1. The value of B i,j is 0, which indicates that the candidate edge e i,j is not sampled, and the value of B i,j is 1, which indicates that the candidate edge e i,j is sampled. The sampled candidate edge is the target edge. The number of target edges is multiple, and the first network model can be determined based on the multiple target edges.
[0117] In a possible implementation, any candidate edge corresponds to at least one candidate operation processing, and the first network structure parameter further includes an importance parameter of each candidate operation processing corresponding to any target edge; the first network model is determined based on the multiple target edges, including: for any target edge, based on the importance parameter of each candidate operation processing corresponding to the target edge, sampling processing is performed on each candidate operation processing corresponding to the target edge to obtain a target operation processing corresponding to the target edge; and the first network model is determined based on the target operation processing corresponding to the multiple target edges.
[0118] It has been mentioned above that each candidate edge in the candidate network model corresponds to at least one candidate operation processing, and the target edge is a sampled candidate edge. The first network structure parameter includes an importance parameter of each candidate operation processing corresponding to any target edge, and each candidate operation processing corresponding to any target edge can be sampled based on the importance parameter of each candidate operation processing corresponding to any target edge to obtain a target operation processing corresponding to any target edge.
[0119] Optionally, the sampling of each candidate operation processing corresponding to any target edge is performed based on the importance parameter of each candidate operation processing corresponding to any target edge in a Gumbel reparameterization manner, and the sampling is described in detail as follows.
[0120] In the embodiment of the present application, if the candidate edge e i,j is sampled, the candidate edge e i,j is the target edge. The importance parameter of the candidate operation processing o corresponding to the target edge e i,j is denoted as The target edge e i,j corresponding to the candidate operation processing o is determined according to formula (2) as shown below.
[0121]
[0122] wherein, denotes the importance parameter of the candidate operation processing o corresponding to the target edge e i,j , denotes the importance parameter of the candidate operation processing o' corresponding to the target edge e i,j , O denotes each candidate operation processing corresponding to the target edge e i,j , exp is the symbol of the exponential function, and Σ is the summation symbol. denotes the normalized importance parameter of the candidate operation processing o corresponding to the target edge e i,j , denotes the normalized importance parameter of the candidate operation processing o' corresponding to the target edge e i,j , and log is the logarithmic symbol. denotes a random variable obtained by randomly sampling the candidate operation processing o corresponding to the target edge e i,j according to the Gumbel distribution, denotes a random variable obtained by randomly sampling the candidate operation processing o' corresponding to the target edge e i,j according to the Gumbel distribution, denotes the sampling probability of the candidate operation processing o corresponding to the target edge e i,j , A i,j denotes the sampling probability of the candidate operation processing o' corresponding to the target edge e i,jThe one-hot encoding corresponding to the target operation processing is denoted as one hot. argmax is used to obtain the variable value when the target function is maximum, where the target function is The variable value is o, that is, The target edge e i,j The corresponding target operation processing.
[0123] In the embodiments of the present application, the formula (2) can be used to determine the target operation processing corresponding to each target edge. Then, based on the target operation processing corresponding to each target edge, the first network model can be determined.
[0124] In step 202, the first training data is subjected to data enhancement processing based on the first data enhancement parameter, and the first training data subjected to data enhancement processing is obtained.
[0125] In the embodiments of the present application, since the first data enhancement parameter is used to represent the information of data enhancement processing, the first training data can be subjected to data enhancement processing based on the first data enhancement parameter, and the first training data subjected to data enhancement processing is obtained.
[0126] For example, the first training data is first training multimedia data, and the first training multimedia data is subjected to data enhancement processing based on the first data enhancement parameter, and the first training multimedia data subjected to data enhancement processing is obtained.
[0127] In one possible implementation, the first data enhancement parameter includes a selected probability of at least one candidate data enhancement processing; and the first training data is subjected to data enhancement processing based on the first data enhancement parameter, and the first training data subjected to data enhancement processing is obtained, including: determining a target data enhancement processing from the at least one candidate data enhancement processing based on the selected probability of the at least one candidate data enhancement processing; and subjecting the first training data to the target data enhancement processing to obtain the first training data subjected to data enhancement processing.
[0128] In the embodiments of the present application, the selected probability greater than the first reference probability can be determined from the selected probability of the at least one candidate data enhancement processing included in the first data enhancement parameter. The candidate data enhancement processing corresponding to the selected probability greater than the first reference probability is taken as the target data enhancement processing. The first reference probability can be a set probability value, for example, the first reference probability is 0.75. The first reference probability can also be determined based on the selected probability of the at least one candidate data enhancement processing, for example, the selected probabilities of the at least one candidate data enhancement processing are sorted in descending order, and the Nth selected probability after sorting is taken as the first reference probability, where N is a positive integer.
[0129] For example, the first data augmentation parameter includes selected probabilities of three candidate data augmentation processes, which are 0.87, 0.03 and 0.1 respectively, and the first reference probability is 0.75. At this time, the candidate data augmentation process corresponding to 0.87 is the target data augmentation process.
[0130] After the target data augmentation process is determined, the first training data is subjected to the target data augmentation process to obtain the first training data subjected to data augmentation processing.
[0131] It should be noted that taking the first training data as the first training multimedia data as an example, a selected probability greater than the first reference probability can be determined from the selected probabilities of the at least one candidate data augmentation process included in the first data augmentation parameter. The candidate data augmentation process corresponding to the selected probability greater than the first reference probability is taken as the target data augmentation process. The first training multimedia data is subjected to the target data augmentation process to obtain the first training multimedia data subjected to data augmentation processing.
[0132] In a possible implementation, the first data augmentation parameter further includes a selected probability of each sub data augmentation process in the target data augmentation process; and the first training data is subjected to the target data augmentation process to obtain the first training data subjected to data augmentation processing, including: determining a target sub data augmentation process from the sub data augmentation processes based on the selected probabilities of the sub data augmentation processes; and the first training data is subjected to the target sub data augmentation process to obtain the first training data subjected to data augmentation processing.
[0133] Each candidate data augmentation process includes at least one sub data augmentation process, and the number of sub data augmentation processes is at least one, wherein each sub data augmentation process can be any one of a translation process, a rotation process, a histogram equalization process, etc. For example, each candidate data augmentation process includes two sub data augmentation processes, and there are 15 sub data augmentation processes in total, so there are 225 (15 2 ) candidate data augmentation processes in total.
[0134] In the implementation of the present application, the target data augmentation processing is determined from at least one candidate data augmentation processing, and therefore, the target data augmentation processing also includes at least one sub-data augmentation processing. The execution probability greater than the second reference probability can be determined from the execution probabilities of each sub-data augmentation processing in the target data augmentation processing included in the first data augmentation parameter. The sub-data augmentation processing in the target data augmentation processing corresponding to the execution probability greater than the second reference probability is taken as the target sub-data augmentation processing. The second reference probability can be a set probability value, for example, the second reference probability is 0.6. The second reference probability can also be determined based on the execution probabilities of each sub-data augmentation processing in the target data augmentation processing, for example, the execution probabilities of each sub-data augmentation processing in the target data augmentation processing are sorted in descending order, and the Mth execution probability after sorting is taken as the second reference probability, where M is a positive integer.
[0135] For example, the target data augmentation processing includes two sub-data augmentation processings, the first data augmentation parameter includes the execution probabilities of the two sub-data augmentation processings, the execution probabilities of the two sub-data augmentation processings are 0.67 and 0.33 respectively, and the second reference probability is 0.6. At this time, the sub-data augmentation processing corresponding to 0.67 is the target sub-data augmentation processing.
[0136] After the target sub-data augmentation processing is determined, the first training data is subjected to the target sub-data augmentation processing to obtain the first training data after data augmentation processing. Optionally, the first data augmentation parameter further includes the execution amplitude (i.e., the amplitude of executing the sub-data augmentation processing) of each sub-data augmentation processing in the target data augmentation processing. In the implementation of the present application, the first training data is subjected to the target sub-data augmentation processing based on the execution amplitude of each sub-data augmentation processing in the target data augmentation processing to obtain the first training data after data augmentation processing. For example, the first training multimedia data is subjected to the target sub-data augmentation processing based on the execution amplitude of each sub-data augmentation processing in the target data augmentation processing to obtain the first training multimedia data after data augmentation processing.
[0137] In step 203, the model parameters of the first network model are adjusted based on the first training data after data augmentation processing to obtain a second network model.
[0138] In the implementation of the present application, the loss value of the first network model corresponding to the first training data can be determined based on the first training data after data augmentation processing and the first network model. The first network model is adjusted based on the loss value of the first network model corresponding to the first training data to obtain a second network model.
[0139] In one possible implementation, the model parameters of the first network model are adjusted based on the data-augmented first training data to obtain the second network model, including: inputting the data-augmented first training data into the first network model to obtain the prediction result of the data-augmented first training data; obtaining the annotation result of the first training data; and adjusting the model parameters of the first network model based on the prediction result and the annotation result of the data-augmented first training data to obtain the second network model.
[0140] The first training data, after data augmentation, is input into the first network model. The first network model processes the data to obtain a prediction result for the augmented first training data. This prediction result is the result of data processing of the data-augmented first training data obtained through prediction. Additionally, the annotation result of the first training data can be obtained; this annotation result is the result of data processing of the first training data obtained through annotation. Next, based on the prediction result and the annotation result of the first training data, the loss value of the first network model corresponding to the first training data is determined. This annotation result is the result of data processing of the first training data obtained through annotation. Then, the first network model is adjusted based on the loss value of the first network model corresponding to the first training data to obtain a second network model. The first training data can be first training multimedia data, and the data processing result is the result of any one of the following data processing methods: classification, translation, recognition, or detection.
[0141] It should be noted that adjusting the first network model means adjusting the model parameters of the first network model. In this embodiment, the model parameters of the first network model can be adjusted based on the loss value of the first network model corresponding to the first training data, according to the formula (3) shown below, to obtain the model parameters of the second network model.
[0142]
[0143] Where st is the subject-to-symbol, w * (γ,a) represents the model parameters of the second network model, which can be simply expressed as w * γ is the first data augmentation parameter, and a represents the candidate network model. argmin is used to find the variable value that minimizes the objective function, E. Γ~p(γ) [L train (w,α|Γ(D train ))], where the variable value is w. Here, E represents the symbol for the mathematical expectation. Γ~p(γ) represents data augmentation processing performed on the first training data based on the first data augmentation parameter γ. Ltrain (w, a | Γ(D train ) represents the loss value of the first network model corresponding to the first training data, w is the model parameter of the first network model, D train characterizes the first training data, Γ(D train ) represents the first training data after data augmentation processing.
[0144] Step 204, in response to satisfying the training end condition, the second network model is taken as a data processing model.
[0145] When the training end condition is satisfied, the second network model is taken as a data processing model. The present embodiment does not limit the training end condition. For example, the training end condition is satisfied when the training number reaches 500.
[0146] It should be noted that different data processing corresponds to different data processing models. When the data processing is classification processing, the data processing model can be referred to as a classification model, which is used for classification processing of multimedia data. When the data processing is translation processing, the data processing model can be referred to as a translation model, which is used for translation processing of multimedia data. When the data processing is recognition processing, the data processing model can be referred to as a recognition model, which is used for recognition processing of multimedia data. When the data processing is detection processing, the data processing model can be referred to as a detection model, which is used for detection processing of multimedia data.
[0147] In a possible implementation, after obtaining the second network model, the method further includes: in response to not satisfying the training end condition, obtaining first validation data of the current training; determining a loss value of the second network model corresponding to the first validation data based on the first validation data and the second network model; and determining a second data augmentation parameter for the next training based on the loss value of the second network model corresponding to the first validation data, the second data augmentation parameter being used to represent information of data augmentation processing.
[0148] When the training end condition is not satisfied, the first validation data of the current training is obtained. The number of the first validation data is multiple, and the data type of the first validation data is the same as that of the first training data. For example, the data type of the first training data is multimedia data, and the data type of the first validation data is also multimedia data (i.e. the first validation data is first validation multimedia data). In addition, the acquisition method of the first validation data is similar to that of the first training data. The first validation data and the first training data can be the same data or different data, which is not limited here.
[0149] In this embodiment, the first verification data can be input into the second network model, and the second network model outputs the prediction result of the first verification data. The prediction result of the first verification data is the data processing result obtained by predicting the first verification data. Additionally, the annotation result of the first verification data can also be obtained; the annotation result of the first verification data is the data processing result obtained by annotating the first verification data. Then, based on the prediction result and the annotation result of the first verification data, the loss value of the second network model corresponding to the first verification data is determined. The data processing result can be the result of any of the following data processing methods: classification, translation, recognition, detection, etc.
[0150] In one possible implementation, determining the loss value of the second network model corresponding to the first validation data based on the first validation data and the second network model includes: performing data augmentation processing on the first validation data based on the first data augmentation parameters to obtain the data-augmented first validation data; and determining the loss value of the second network model corresponding to the first validation data based on the data-augmented first validation data and the second network model.
[0151] In this embodiment of the application, the method of performing data augmentation processing on the first verification data based on the first data augmentation parameter is similar to the method of performing data augmentation processing on the first training data based on the first data augmentation parameter, as can be seen in the relevant description of step 202, and will not be repeated here.
[0152] In this embodiment, the first validation data after data augmentation can be input into the second network model, and the second network model outputs the prediction result of the first validation data after data augmentation. The prediction result of the first validation data after data augmentation is the data processing result obtained by predicting the first validation data after data augmentation. Then, based on the prediction result of the first validation data after data augmentation and the annotation result of the first validation data, the loss value of the second network model corresponding to the first validation data is determined.
[0153] Next, based on the loss value of the second network model corresponding to the first validation data, the second data augmentation parameters for the next training iteration are determined. This can be achieved using the stochastic gradient descent algorithm, as shown in formula (4). Based on the loss value of the second network model corresponding to the first validation data, the gradient of the loss function with respect to the first data augmentation parameters is determined. Here, the loss function refers to the loss function of the second network model used to determine its loss value. Then, based on the gradient of the loss function with respect to the first data augmentation parameters, the first data augmentation parameters are adjusted to obtain the second data augmentation parameters for the next training iteration.
[0154]
[0155] in, Let γ be the gradient of the loss function with respect to the first data augmentation parameter, where γ is the first data augmentation parameter. α represents the gradient descent symbol. E represents the mathematical expectation symbol. a~p(α,β) represents the first network model obtained after sampling the candidate network model based on α and β (since the model parameters of the first network model are adjusted to obtain the second network model, the model structures of the first network model and the second network model are the same). a represents the candidate network model, α represents the importance parameters of various candidate operations corresponding to the target edge, and β represents the importance parameters of each candidate edge. This represents the loss value of the second network model corresponding to the first validation data, in relation to w. * gradient, w represents the loss value of the second network model corresponding to the first validation data. * These are the model parameters for the second network model. D represents the gradient of the model parameters of the second network model with respect to the first data augmentation parameters. val This represents the first verification data.
[0156] The model parameters of the second network model can be expressed as shown in formula (5) below.
[0157]
[0158] Among them, w * (γ) represents the model parameters of the second network model, which can be abbreviated as w. * γ is the first data augmentation parameter. argmin is used to find the variable value that minimizes the objective function, E. Γ~p(γ) [L train (w|Γ(D train ))], where the variable value is w. w represents the model parameters of the first network model, and E is the symbol for the mathematical expectation. Γ~p(γ) represents data augmentation processing performed on the first training data based on the first data augmentation parameter γ. L train (w|Γ(D train Γ(D) represents the loss value of the first network model corresponding to the first training data. train () represents the first training data after data augmentation. η is the learning rate symbol. This is the symbol for gradient descent. The symbol for definition, i.e., definition Let w′ be the model parameters of the second network model; that is, the model parameters of the second network model can be denoted as w. * It can also be written as w′.
[0159] The model parameters of the second network model satisfy the following formula (6). The explanation of each symbol in formula (6) can be found in formulas (4) and (5), and will not be repeated here.
[0160]
[0161] Based on the policy gradient, the model parameters w of the second network model * The gradient of the first data augmentation parameter γ satisfies the following formula (7), wherein the explanation of each symbol in formula (7) can be found in formulas (4) and (5), and will not be repeated here.
[0162]
[0163] In formula (7), log represents the logarithmic function, and p(Γ) represents the probability that the candidate data augmentation process Γ is sampled. Let represent the gradient of the function log p(Γ) with respect to the first data augmentation parameter γ. According to equations (4) to (7), we can obtain the following equation (8). The explanation of each symbol in equation (8) can be found in equations (4) and (5), and will not be repeated here.
[0164]
[0165] In formula (8), D val This is the first verification data. This represents the gradient of the loss function with respect to the first data augmentation parameters. Then, based on this gradient, the first data augmentation parameters are adjusted to obtain the second data augmentation parameters for the next training iteration.
[0166] In this embodiment, when the training termination condition is not met in the current training iteration, the loss value of the second network model corresponding to the first validation data is determined based on the first validation data of the current training iteration, and the second data augmentation parameters for the next training iteration are determined based on this loss value. Since the second data augmentation parameters are information used to characterize data augmentation processing, this embodiment can determine the data augmentation processing corresponding to the next training iteration. Because the data augmentation processing corresponding to the next training iteration is determined based on the loss value corresponding to the previous training iteration, the data augmentation processing methods are diverse and highly accurate, thereby improving the robustness and accuracy of the model.
[0167] In this embodiment, the second network structure parameters for the next training iteration can also be determined based on the loss value of the second network model corresponding to the first verification data. These second network structure parameters characterize the structural information of the model for the next training iteration. Therefore, this embodiment can determine the model corresponding to the next training iteration. Since the model for the next training iteration is determined based on the loss value of the previous training iteration, the model structure is continuously adjusted and optimized during training, thereby improving the model's accuracy.
[0168] The stochastic gradient descent algorithm can be used, and according to the formula (9) shown below, the gradient of the loss function with respect to the first network structure parameters is determined based on the loss value of the second network model corresponding to the first validation data. Then, based on the gradient of the loss function with respect to the first network structure parameters, the first network structure parameters are adjusted to obtain the second network structure parameters for the next training.
[0169]
[0170] In this embodiment, the first network structure parameters include α and β, where α is the importance parameter of various candidate operations corresponding to the target edge, and β represents the importance parameter of each candidate edge. In formula (9), The symbol for gradient descent is [symbol]. Let be the gradient of the loss function with respect to α, and E denote the sign of the mathematical expectation. A~p(α) represents the sampling of the candidate operation processing corresponding to the candidate edge in the candidate network model based on α, that is, the target operation processing corresponding to the target edge obtained based on α sampling, which can be simply denoted as A. L represents the gradient of the loss value of the second network model corresponding to the first validation data with respect to A. val (w * a) represents the loss value of the second network model corresponding to the first validation data, w * denoted as the model parameters of the second network model, and 'a' as the candidate network model. Let α represent the gradient of A with respect to α. Let B be the gradient of the loss function with respect to β. B~p(β) represents the sampling of candidate edges in the candidate network model based on β, that is, the target edge obtained by sampling based on β, which can be simply denoted as B. This represents the gradient of the loss value of the second network model corresponding to the first validation data with respect to B. This represents the gradient of B with respect to β.
[0171] In this embodiment of the application, after calculating the gradient of the loss function with respect to α... Afterwards, based on Adjust α to obtain the adjusted α. Then calculate the gradient of the loss function with respect to β. Afterwards, based on Adjust β to obtain the adjusted β. The adjusted α and adjusted β are the second network structure parameters for the next training iteration.
[0172] In this embodiment of the application, the first network structure parameters and the first data augmentation parameters should satisfy the following formula (10).
[0173]
[0174] Here, argmin is used to find the variable value that minimizes the objective function, L(α,β,γ), where the variables are α, β, and γ. The first network structure parameters include α and β, where α represents the importance parameter of each candidate operation corresponding to the objective edge, β represents the importance parameter of each candidate edge, and γ is the first data augmentation parameter. E is the symbol for the mathematical expectation. a~p(α,β) represents the first network model obtained after sampling the candidate network model based on α and β, where α represents the candidate network model. L val (w * (γ,a),a|D val ) represents the loss value of the second network model corresponding to the first validation data. w * (γ,a) represents the model parameters of the second network model, which can be simply referred to as w. * D val This represents the first verification data.
[0175] In each training iteration, the above method first performs data augmentation on the first training data corresponding to the current training iteration based on the first data augmentation parameters. Then, based on the data augmented first training data, it adjusts the model parameters of the first network model corresponding to the current training iteration, thereby improving the model's predictive ability, robustness, and accuracy. This, in turn, improves the accuracy of data processing results when data is processed based on the data processing model.
[0176] Taking the first training data as first training multimedia data and data processing as classification processing as an example, the classification model trained by related technologies has poor robustness, resulting in poor accuracy of classification results when multimedia data is classified based on the classification model. However, the embodiment of this application, following steps 201 to 204, first performs data augmentation processing on the first training multimedia data corresponding to the current training based on the first data augmentation parameters corresponding to the current training, and then adjusts the model parameters of the first network model corresponding to the current training based on the data augmented first training multimedia data to obtain the classification model. This training method of the classification model can improve the predictive ability of the classification model, thereby improving the robustness and accuracy of the classification model, and thus improving the accuracy of the classification results when multimedia data is classified based on the classification model.
[0177] Based on the same principle, any one of the models—translation, recognition, and detection—can be trained according to steps 201 to 204, improving the predictive ability of that model and thus enhancing its robustness and accuracy. When any model is a translation model, using it to translate multimedia data can improve the accuracy of the translation results; when any model is a recognition model, using it to recognize multimedia data can improve the accuracy of the recognition results; and when any model is a detection model, using it to detect multimedia data can improve the accuracy of the detection results.
[0178] Based on the above implementation environment, this application provides a data processing method to... Figure 3 The flowchart shown in this embodiment of the present application illustrates a data processing method. This method can be implemented by... Figure 1 The electronic device 11 in the middle performs the operation. For example... Figure 3 As shown, the method includes steps 301 to 302.
[0179] Step 301: Obtain the target data.
[0180] The number of target data is at least one, and this application embodiment does not limit the data type and acquisition method of the target data. For example, the data type of the target data is multimedia data (i.e., the target data is target multimedia data), and any multimedia data can be acquired as target multimedia data. Optionally, the multimedia data here includes at least one of image data, text data, audio data, and video data.
[0181] Step 302: Input the target data into the data processing model to obtain the data processing result of the target data.
[0182] The data processing model is trained according to the training method of the data processing model mentioned in the above embodiments.
[0183] In this embodiment, the target data is input into a data processing model, which then processes the target data to obtain a data processing result. This data processing result can be the result of any one of the following data processing methods: classification, translation, recognition, or detection.
[0184] For example, when the target data is target multimedia data, the data processing result of the target multimedia data can be the classification result after classifying the target multimedia data, or the detection result after detecting the target multimedia data.
[0185] In this embodiment, a data processing model is trained using the training method provided in the above embodiments (for ease of description, this data processing model is referred to as the data processing model of this embodiment). Additionally, four other data processing models are trained using four different methods; these four models are referred to as Data Processing Model 1, Data Processing Model 2, Data Processing Model 3, and Data Processing Model 4, respectively. The accuracy of the five data processing models is tested using two datasets (denoted as the CIFAR-10 dataset and the CIFAR-100 dataset, respectively), and the results are shown in Table 1 below.
[0186] Table 1
[0187] Data processing model CIFAR-10 dataset CIFAR-100 dataset Data processing model 1 97.2% 82.5% Data processing model 2 97.4% / Data processing model 3 97.1% 80.6% Data processing model 4 97.3% 79.4% Data processing model of the embodiment of the present application 97.9% 84.9%
[0188] As shown in Table 1, the data processing model of this application embodiment achieves higher accuracy on both the CIFAR-10 and CIFAR-100 datasets than data processing models 1-4. Therefore, it can be concluded that the data processing model of this application embodiment can improve the accuracy of the data processing results.
[0189] The data processing model described above first performs data augmentation on the first training data corresponding to the current training iteration based on the first data augmentation parameters during each training iteration. Then, based on the data augmented first training data, the model parameters of the first network model corresponding to the current training iteration are adjusted. This training method improves the predictive ability of the data processing model, thereby enhancing its robustness and accuracy. Consequently, when data is processed based on the data processing model, the accuracy of the data processing results is improved.
[0190] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the target data, first training data, first verification data, and second verification data involved in this application were all obtained with full authorization.
[0191] Figure 4 The diagram shown is a structural schematic of a training device for a data processing model provided in an embodiment of this application. Figure 4 As shown, the device includes:
[0192] The acquisition module 401 is used to acquire the first data augmentation parameters, the first network model, and the first training data corresponding to the current training. The first data augmentation parameters are used to characterize the information of data augmentation processing.
[0193] Data augmentation module 402 is used to perform data augmentation processing on the first training data based on the first data augmentation parameters to obtain the first training data after data augmentation processing;
[0194] The adjustment module 403 is used to adjust the model parameters of the first network model based on the first training data after data augmentation to obtain the second network model;
[0195] The determination module 404 is used to use the second network model as the data processing model in response to the satisfaction of the training termination condition.
[0196] In one possible implementation, the first data augmentation parameter includes the probability of at least one candidate data augmentation process being selected;
[0197] The data augmentation module 402 is used to determine a target data augmentation process from at least one candidate data augmentation process based on the selection probability of at least one candidate data augmentation process; and to perform the target data augmentation process on the first training data to obtain the first training data after data augmentation.
[0198] In one possible implementation, the first data augmentation parameter also includes the execution probability of each sub-data augmentation process in the target data augmentation process;
[0199] The data augmentation module 402 is used to determine the target sub-data augmentation process from the various sub-data augmentation processes based on the execution probability of each sub-data augmentation process; and to perform the target sub-data augmentation process on the first training data to obtain the first training data after data augmentation.
[0200] In one possible implementation, the adjustment module 403 is used to input the data-augmented first training data into the first network model to obtain the prediction result of the data-augmented first training data; obtain the annotation result of the first training data; and adjust the model parameters of the first network model based on the prediction result of the data-augmented first training data and the annotation result of the first training data to obtain the second network model.
[0201] In one possible implementation, the acquisition module 401 is further configured to acquire the first validation data of the current training session in response to the failure to meet the training termination condition;
[0202] The determination module 404 is used to determine the loss value of the second network model corresponding to the first validation data based on the first validation data and the second network model; and to determine the second data augmentation parameters for the next training based on the loss value of the second network model corresponding to the first validation data. The second data augmentation parameters are used to characterize the information of the data augmentation process.
[0203] In one possible implementation, the determining module 404 is used to perform data augmentation processing on the first verification data based on the first data augmentation parameters to obtain the data-augmented first verification data; and to determine the loss value of the second network model corresponding to the first verification data based on the data-augmented first verification data and the second network model.
[0204] In one possible implementation, the acquisition module 401 is used to acquire the candidate network model and the first network structure parameters corresponding to the current training, the first network structure parameters being used to characterize the structural information of the first network model; based on the first network structure parameters, the candidate network model is sampled to obtain the first network model.
[0205] In one possible implementation, the candidate network model includes multiple candidate edges, each representing a computational operation on the feature vector, and the first network structure parameters include importance parameters for each candidate edge.
[0206] The acquisition module 401 is used to sample multiple candidate edges based on the importance parameters of each candidate edge to obtain multiple target edges; and to determine the first network model based on the multiple target edges.
[0207] In one possible implementation, each candidate edge corresponds to at least one candidate operation, and the first network structure parameters also include importance parameters for various candidate operations corresponding to each target edge.
[0208] The acquisition module 401 is used to sample various candidate operation processing corresponding to any target edge based on the importance parameters of various candidate operation processing corresponding to any target edge, so as to obtain the target operation processing corresponding to any target edge; and to determine the first network model based on the target operation processing corresponding to multiple target edges.
[0209] In one possible implementation, the acquisition module 401 is used to acquire the second validation data corresponding to the previous training; based on the second validation data and the first network model, determine the loss value of the first network model corresponding to the second validation data; and based on the loss value of the first network model corresponding to the second validation data, determine the first network structure parameters.
[0210] In one possible implementation, the acquisition module 401 is used to acquire the second validation data corresponding to the previous training; determine the loss value of the first network model corresponding to the second validation data based on the second validation data and the first network model; and determine the first data augmentation parameters based on the loss value of the first network model corresponding to the second validation data.
[0211] During each training iteration, the aforementioned device first performs data augmentation on the first training data corresponding to the current training iteration based on the first data augmentation parameters. Then, based on the data augmented first training data, it adjusts the model parameters of the first network model corresponding to the current training iteration, thereby improving the model's predictive ability and thus enhancing its robustness and accuracy.
[0212] It should be understood that the above Figure 4 The provided device, when implementing its functions, is only illustrated by the above-described division of functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here. This improves the accuracy of data processing results when data processing is performed based on the data processing model.
[0213] Figure 5 The diagram shown is a structural schematic of a data processing device provided in an embodiment of this application. Figure 5 As shown, the device includes:
[0214] Module 501 is used to acquire target data;
[0215] The module 502 is used to input the target data into the data processing model and obtain the data processing result of the target data. The data processing model is trained according to the training method of the data processing model described above.
[0216] In each training iteration, the data processing model of the aforementioned device first performs data augmentation on the first training data corresponding to the current training iteration based on the first data augmentation parameters. Then, based on the data augmented first training data, it adjusts the model parameters of the first network model corresponding to the current training iteration. This training method improves the predictive ability of the data processing model, thereby enhancing its robustness and accuracy. Consequently, when data is processed based on the data processing model, the accuracy of the data processing results is improved.
[0217] It should be understood that the above Figure 5 The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0218] Figure 6 This illustration shows a structural block diagram of a terminal device 600 provided in an exemplary embodiment of this application. The terminal device 600 may be a portable mobile terminal, such as a smartphone, tablet computer, laptop computer, or desktop computer. The terminal device 600 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0219] Typically, terminal device 600 includes a processor 601 and a memory 602.
[0220] Processor 601 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 601 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 601 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 601 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0221] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 602 are used to store at least one instruction, which is executed by the processor 601 to implement the training method or data processing method of the data processing model provided in the method embodiments of this application.
[0222] In some embodiments, the terminal device 600 may also optionally include a peripheral device interface 603 and at least one peripheral device. The processor 601, memory 602, and peripheral device interface 603 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, and a power supply 608.
[0223] Peripheral interface 603 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 601 and memory 602. In some embodiments, processor 601, memory 602 and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 601, memory 602 and peripheral interface 603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0224] The radio frequency (RF) circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 604 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 604 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0225] Display screen 605 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 605 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 601 for processing. In this case, display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 605, disposed on the front panel of terminal device 600; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal device 600 or in a folded design; in still other embodiments, display screen 605 may be a flexible display screen, disposed on a curved or folded surface of terminal device 600. Furthermore, display screen 605 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 605 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0226] The camera assembly 606 is used to acquire images or videos. Optionally, the camera assembly 606 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.
[0227] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 601 for processing, or input to the radio frequency circuit 604 to achieve voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal device 600. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0228] Power supply 608 is used to supply power to the various components in terminal device 600. Power supply 608 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 608 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0229] In some embodiments, the terminal device 600 further includes one or more sensors 609. The one or more sensors 609 include, but are not limited to, an accelerometer 611, a gyroscope 612, a pressure sensor 613, an optical sensor 614, and a proximity sensor 615.
[0230] Accelerometer 611 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal device 600. For example, accelerometer 611 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 601 can control display screen 605 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 611. Accelerometer 611 can also be used for games or for acquiring user motion data.
[0231] The gyroscope sensor 612 can detect the orientation and rotation angle of the terminal device 600. The gyroscope sensor 612, in conjunction with the accelerometer sensor 611, can collect 3D motion data from the user on the terminal device 600. Based on the data collected by the gyroscope sensor 612, the processor 601 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0232] The pressure sensor 613 can be disposed on the side bezel of the terminal device 600 and / or on the lower layer of the display screen 605. When the pressure sensor 613 is disposed on the side bezel of the terminal device 600, it can detect the user's grip signal on the terminal device 600, and the processor 601 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed on the lower layer of the display screen 605, the processor 601 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 605. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0233] An optical sensor 614 is used to collect ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 based on the ambient light intensity collected by the optical sensor 614. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is decreased. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 based on the ambient light intensity collected by the optical sensor 614.
[0234] A proximity sensor 615, also known as a distance sensor, is typically mounted on the front panel of the terminal device 600. The proximity sensor 615 is used to detect the distance between the user and the front of the terminal device 600. In one embodiment, when the proximity sensor 615 detects that the distance between the user and the front of the terminal device 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from a screen-on state to a screen-off state; when the proximity sensor 615 detects that the distance between the user and the front of the terminal device 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from a screen-off state to a screen-on state.
[0235] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the terminal device 600, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0236] Figure 7This is a schematic diagram of the server structure provided in the embodiments of this application. The server 700 can vary considerably due to different configurations or performance. It may include one or more processors 701 and one or more memories 702. The one or more memories 702 store at least one line of program code, which is loaded and executed by the one or more processors 701 to implement the training method or data processing method of the data processing model provided in the various method embodiments described above. For example, the processor 701 is a CPU. Of course, the server 700 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 700 may also include other components for implementing device functions, which will not be elaborated here.
[0237] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code, which is loaded and executed by a processor to enable an electronic device to implement the training method or data processing method of any of the above-described data processing models.
[0238] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0239] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement the training method or data processing method of any of the above-described data processing models.
[0240] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0241] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0242] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for training a data processing model, characterized in that, The method comprises: obtaining first data augmentation parameters corresponding to the current training, a first network model, and first training data, wherein the first data augmentation parameters are used to represent information of data augmentation processing, the data type of the first training data is multimedia data, and the multimedia data comprises at least one of text data, image data, audio data, and video data; based on the first data augmentation parameters, performing data augmentation processing on the first training data to obtain first training data after data augmentation processing; based on the first training data after data augmentation processing, adjusting model parameters of the first network model to obtain a second network model; in response to satisfying a training end condition, taking the second network model as a data processing model, wherein the data processing model is an identification model, and the identification model is used for identification processing on the first training data; obtaining a first network model, comprising: obtaining a candidate network model and first network structure parameters corresponding to the current training, wherein the first network structure parameters are used to represent structure information of the first network model; based on the first network structure parameters, performing sampling processing on the candidate network model to obtain the first network model.
2. The method of claim 1, wherein, The first data augmentation parameters comprise a selected probability of at least one candidate data augmentation processing; based on the first data augmentation parameters, performing data augmentation processing on the first training data to obtain first training data after data augmentation processing, comprising: based on the selected probability of the at least one candidate data augmentation processing, determining a target data augmentation processing from the at least one candidate data augmentation processing; performing target data augmentation processing on the first training data to obtain the first training data after data augmentation processing.
3. The method of claim 2, wherein, The first data augmentation parameters further comprise an execution probability of each sub-data augmentation processing in the target data augmentation processing; based on the execution probability of each sub-data augmentation processing, determining a target sub-data augmentation processing from each sub-data augmentation processing; performing target sub-data augmentation processing on the first training data to obtain the first training data after data augmentation processing. based on the first training data after data augmentation processing, adjusting model parameters of the first network model to obtain a second network model, comprising:
4. The method of claim 1, wherein, inputting the first training data after data augmentation processing into the first network model to obtain a prediction result of the first training data after data augmentation processing; obtaining a label result of the first training data; based on the prediction result of the first training data after data augmentation processing and the label result of the first training data, adjusting model parameters of the first network model to obtain a second network model. after obtaining the second network model, further comprising:
5. The method of claim 1, wherein, in response to not satisfying the training end condition, obtaining first verification data of the current training; determine, based on the first verification data and the second network model, a loss value of the second network model corresponding to the first verification data; determine, based on the loss value of the second network model corresponding to the first verification data, a second data augmentation parameter for next training, the second data augmentation parameter being used to represent information of data augmentation processing.
6. The method of claim 5, wherein, The method comprises: perform data augmentation processing on the first verification data based on the first data augmentation parameter to obtain first verification data after data augmentation processing; determine, based on the first verification data after data augmentation processing and the second network model, a loss value of the second network model corresponding to the first verification data.
7. The method of claim 1, wherein, The candidate network model comprises a plurality of candidate edges, and the candidate edges represent operation processing on a feature vector, and the first network structure parameter comprises an importance parameter of each candidate edge. The method comprises: sample processing is performed on the plurality of candidate edges based on the importance parameter of each candidate edge to obtain a plurality of target edges; determine a first network model based on the plurality of target edges.
8. The method of claim 7, wherein, Any candidate edge corresponds to at least one candidate operation processing, and the first network structure parameter further comprises an importance parameter of each candidate operation processing corresponding to any target edge; The method comprises: for any target edge, sample processing is performed on each candidate operation processing corresponding to the target edge based on the importance parameter of each candidate operation processing corresponding to the target edge to obtain a target operation processing corresponding to the target edge; determine the first network model based on the target operation processing corresponding to the plurality of target edges.
9. The method of claim 1, wherein, The method comprises: obtain second verification data corresponding to previous training; determine, based on the second verification data and the first network model, a loss value of the first network model corresponding to the second verification data; determine the first network structure parameter based on the loss value of the first network model corresponding to the second verification data.
10. The method according to any one of claims 1 to 6, characterized in that, The method comprises: obtain second verification data corresponding to previous training; determine, based on the second verification data and the first network model, a loss value of the first network model corresponding to the second verification data; determine the first data augmentation parameter based on the loss value of the first network model corresponding to the second verification data.
11. A data processing method, characterized by, The method comprises: obtain target data; input the target data into a data processing model to obtain a data processing result of the target data, the data processing model being trained according to the method of any one of claims 1 to 10.
12. An apparatus for training a data processing model, the apparatus comprising: The apparatus comprises: The acquisition module is configured to acquire a first data augmentation parameter corresponding to the current training, a first network model, and first training data. The first data augmentation parameter is used to represent information of a data augmentation process. The first training data is of a multimedia data type, and includes at least one of text data, image data, audio data, and video data. The data augmentation module is configured to perform data augmentation processing on the first training data based on the first data augmentation parameter, to obtain first training data after data augmentation processing. The adjustment module is configured to adjust model parameters of the first network model based on the first training data after data augmentation processing, to obtain a second network model. The determination module is configured to, in response to a training end condition being met, determine the second network model as a data processing model. The data processing model is an identification model. The identification model is used to perform identification processing on the first training data. The method includes the following steps: The candidate network model and the first network structure parameter corresponding to the current training are acquired. The first network structure parameter is used to represent structure information of the first network model. The candidate network model is sampled based on the first network structure parameter, to obtain the first network model.
13. A data processing apparatus, characterized by: The device includes: The acquisition module is configured to acquire target data. The obtaining module is configured to input the target data into a data processing model, to obtain a data processing result of the target data. The data processing model is trained according to the method in any one of claims 1 to 10.
14. An electronic device, comprising: The electronic device includes a processor and a memory. The memory stores at least one program code. The at least one program code is loaded and executed by the processor, so that the electronic device implements the training method of the data processing model in any one of claims 1 to 10 or the data processing method in claim 11.
Citation Information
Patent Citations
Data enhancement method, device and equipment and storage medium
CN110796248A
Network model training method and device, equipment and storage medium
CN111857793A
Hierarchical network structure search method, device and readable storage medium
CN111860495A