Model parameter optimization method, related system and storage medium

By traversing the reference values ​​of the model parameters to determine the target values ​​and optimizing the model parameters, the model accuracy problem caused by the increase of prior data is solved, and higher model performance is achieved.

CN119089759APending Publication Date: 2024-12-06HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310657765.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When the prior data increases, the difference between the optimal value and non-optimal value of the model loss value increases in proportion, resulting in a concentrated parameter prior distribution, and the posterior data has little impact on the posterior distribution of parameters. Not high accuracy.

Method used

By obtaining multiple reference values ​​of the model, traversing these values ​​to obtain the target value, ensuring that the loss value of the target value on the prior data is not greater than the preset upper bound or the test accuracy value is not less than the preset lower bound, and then determining the optimization of the parameter value, update model parameters to avoid the impact of the a priori data quantity on the posterior distribution.

Benefits of technology

The accuracy of the model is improved, ensuring that the parameter optimization value takes into account the influence of prior and posterior data, and improving the performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089759A_ABST
    Figure CN119089759A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model parameter optimization method, a related system and a storage medium. The method comprises the steps of obtaining a plurality of reference values of parameters of a first model; traversing the plurality of reference values according to preset model evaluation information, the first model and a priori data pair of the first model to obtain at least one target value of the parameter; the loss value of the model corresponding to the target value on the priori data pair is not greater than the upper bound of the loss value of the model on the priori data pair in the preset model evaluation information; and / or the test precision value of the model corresponding to the target value on the priori data pair is not less than the lower bound of the test precision value of the model on the priori data pair; determining an optimization value of the parameter according to the at least one target value, a prior data pair of the first model and a posterior data pair of the first model; and updating the parameters of the first model according to the optimization value. Therefore, the precision of the model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence (AI) technology, and in particular to a model parameter optimization method and related systems and storage media. Background Art

[0002] Artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is also the study of the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.

[0003] Neural networks have been successfully applied in many fields, including computer vision, machine translation, speech recognition, and so on. After successfully training a machine learning model based on prior data, it is often necessary to adjust the parameters of the model based on posterior data. Due to the limited data domain used in training, it is difficult to train a model with sufficient generalization ability. When the model is used commercially, the amount of samples that can be collected is also extremely limited. The model needs to learn small samples with a very small number of samples to adapt to the data distribution of the target data domain and achieve high model accuracy to support commercial use.

[0004] At present, the sampling Bayesian model tuning method obtains the posterior distribution of the parameter based on the prior distribution of the model parameter, the loss value of the model on the prior data, and the loss value of the model on the posterior data, and then obtains the optimal value of the parameter. Since the prior distribution in this tuning algorithm is proportional to the number of prior data, the posterior distribution is proportional to the number of posterior data. As the prior data increases, the gap between the optimal value and the non-optimal value corresponding to the model loss value also increases proportionally. This causes the prior distribution of the parameter to be exponentially concentrated near the highest prior parameter. This makes the posterior data have little effect on the posterior distribution of the parameter, resulting in low model accuracy. Summary of the invention

[0005] The present application discloses a model parameter optimization method and related systems and storage media, which can avoid introducing complex hyperparameters for balancing the amount of prior data and the amount of posterior data when tuning parameters, while improving the accuracy of the model.

[0006] In a first aspect, an embodiment of the present application provides a model parameter optimization method, which may include:

[0007] Acquire multiple reference values ​​of parameters of the first model according to a priori data pairs of the first model and a posteriori data pairs of the first model;

[0008] According to the preset model evaluation information, the first model and the prior data pair, the multiple reference values ​​are traversed to obtain at least one target value of the parameter; the loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information;

[0009] Determining an optimized value of the parameter according to the at least one target value, the priori data pair, and the posteriori data pair;

[0010] The parameters of the first model are updated according to the optimized values.

[0011] In the embodiment of the present application, based on multiple reference values ​​of the parameters of the first model, according to the preset model evaluation information and the prior data pair, the multiple reference values ​​are traversed to obtain at least one target value of the parameter, and then the optimized value of the parameter is determined according to the target value, the prior data pair of the first model and the posterior data pair, and then the first model is updated based on the optimized value. This means is adopted, wherein the loss value of the model corresponding to the target value of the parameter on the prior data pair is not greater than the upper limit of the loss value of the model, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model, so that the optimized value of the obtained parameter can take into account the protection of the prior data pair; based on the target value, the prior data pair of the first model and the posterior data pair, the optimized value of the parameter is determined, and at the same time, the optimized value of the parameter can take into account the posterior data pair, and the performance is better. And the posterior distribution of the parameters of the model is not affected by the number of prior data pairs, and the performance is better.

[0012] The preset model evaluation information may include an upper limit of the loss value of the model and / or a lower limit of the test accuracy value of the model. Of course, it may also be other evaluation information.

[0013] The loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information. It can be understood that, taking the data domains to which the prior data pairs belong respectively as units, the data domain with the largest average loss value corresponding to the model corresponding to the target value satisfies that its average loss value is not greater than the upper limit of the loss value of the model in the preset model evaluation information. Alternatively, it can also be that the loss value of the model corresponding to the target value in each prior data pair in the prior data pair is not greater than the upper limit of the loss value of the model in the preset model evaluation information.

[0014] Correspondingly, the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information. It can be understood that, taking the data domains to which the prior data pairs belong respectively as units, the data domain with the smallest average test accuracy value corresponding to the model corresponding to the target value satisfies that its average test accuracy value is not less than the lower limit of the test accuracy value of the model in the preset model evaluation information. Alternatively, it can also be that the test accuracy value of the model corresponding to the target value in each prior data pair in the prior data pair is not less than the lower limit of the test accuracy value of the model in the preset model evaluation information.

[0015] In a possible implementation, the average loss value of the model corresponding to each reference value in each of the above training data domains can be solved (for example, for training data domain A, the loss value of each prior data pair in training data domain A is calculated, and then the average loss value of the prior data pairs in training data domain A is solved according to the number of prior data pairs in training data domain A), and then the training data domain with the largest average loss value is obtained. If the loss value of the training data domain with the largest average loss value is not less than the upper limit of the loss value of the model in the above preset model evaluation information, the reference value is recorded as the target value. If the loss value of the training data domain with the largest average loss value is greater than the upper limit of the loss value of the model in the above preset model evaluation information, the reference value is discarded.

[0016] In another possible implementation, the maximum loss value is determined by solving the loss value of the model corresponding to each reference value on each of the above-mentioned prior data pairs. If the maximum loss value is not less than the upper limit of the loss value of the model in the above-mentioned preset model evaluation information, the reference value is recorded as the target value.

[0017] Of course, other selection methods are also possible, and this solution does not limit this.

[0018] In a possible implementation manner, determining the optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair includes:

[0019] Obtaining a priori distribution of the parameters of the first model according to the priori data;

[0020] Obtaining a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value;

[0021] Obtaining a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair;

[0022] The optimized value of the parameter is determined according to the posterior distribution of the parameter.

[0023] In a possible implementation manner, the value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter.

[0024] In this way, the optimized values ​​of the obtained parameters can be optimal on the posterior data pair.

[0025] In another possible implementation manner, determining the optimized value of the parameter according to the posterior distribution of the parameter includes:

[0026] Sampling according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter;

[0027] A weighted average process is performed on multiple values ​​of the parameter to obtain an optimized value of the parameter.

[0028] Using this example, the uncertainty estimation of the model prediction results can be achieved.

[0029] In a possible implementation manner, the parameters are all parameters of the first model.

[0030] In another possible implementation, the parameters are partial parameters of the first model, wherein the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model.

[0031] The step of traversing the plurality of reference values ​​according to the preset model evaluation information, the first model and the priori data pair to obtain at least one target value of the parameter includes:

[0032] Obtaining a priori feature data pair according to the priori data pair and the feature extraction model;

[0033] According to the preset model evaluation information, the classification model and the prior feature data pair, traversing the plurality of reference values ​​to obtain at least one target value of the parameter;

[0034] The step of determining the optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair comprises:

[0035] Obtaining a posterior feature data pair according to the posterior data pair and the feature extraction model;

[0036] The optimized value of the parameter is determined according to the at least one target value, the priori feature data pair, the posterior feature data pair and the classification model.

[0037] Based on the optimized values ​​of the parameters determined above, the classification model is updated to obtain an optimized classification model, and the optimized first model can be obtained. The feature extraction model may not be updated in this process. Based on the above parameter optimization processing, the first model can be made compatible not only with the prior data pairs, but also with the posterior data pairs, and the posterior distribution of the parameters of the model is not affected by the number of prior data pairs, and the performance is better.

[0038] In a second aspect, an embodiment of the present application provides a model parameter optimization device, comprising:

[0039] An acquisition module, configured to acquire a plurality of reference values ​​of the parameters of the first model according to the priori data pairs of the first model and the posterior data pairs of the first model;

[0040] A calculation module, used to traverse the multiple reference values ​​according to the preset model evaluation information, the first model and the prior data pair to obtain at least one target value of the parameter; the loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information;

[0041] A determination module, configured to determine an optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair;

[0042] An updating module is used to update the parameters of the first model according to the optimized values.

[0043] In a possible implementation manner, the determining module is used to:

[0044] Obtaining a priori distribution of the parameters of the first model according to the priori data;

[0045] Obtaining a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value;

[0046] Obtaining a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair;

[0047] The optimized value of the parameter is determined according to the posterior distribution of the parameter.

[0048] In a possible implementation manner, the value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter.

[0049] In another possible implementation, the determining module is further configured to:

[0050] Sampling according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter;

[0051] A weighted average process is performed on multiple values ​​of the parameter to obtain an optimized value of the parameter.

[0052] In a possible implementation manner, the parameters are all parameters of the first model.

[0053] In another possible implementation, the parameters are partial parameters of the first model, wherein the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model.

[0054] The computing module is used for:

[0055] Obtaining a priori feature data pairs according to the priori data pairs of the first model and the feature extraction model;

[0056] According to the preset model evaluation information, the classification model and the prior feature data pair, traversing the plurality of reference values ​​to obtain at least one target value of the parameter;

[0057] The determining module is used to:

[0058] Obtaining a posterior feature data pair according to the posterior data pair of the first model and the feature extraction model;

[0059] The optimized value of the parameter is determined according to the at least one target value, the priori feature data pair, the posterior feature data pair and the classification model.

[0060] In a third aspect, the present application provides a model parameter optimization device, comprising a processor and a memory; wherein the memory is used to store program code, and the processor is used to call the program code to execute the described method.

[0061] In a fourth aspect, the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute a method as provided in any possible implementation of the first aspect.

[0062] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute a method provided in any possible implementation manner of the first aspect.

[0063] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute a method provided by any possible implementation method of the first aspect.

[0064] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method provided by any possible implementation method of the first aspect.

[0065] It can be understood that the device described in the second aspect, the device described in the third aspect, the computer storage medium described in the fourth aspect, the computer program product described in the fifth aspect or the chip described in the sixth aspect provided above are all used to execute any method provided in the first aspect.

[0066] Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The following is an introduction to the drawings used in the embodiments of the present application.

[0068] Figure 1 It is a schematic diagram of the architecture of the model parameter optimization system provided in the embodiment of the present application;

[0069] Figure 2a It is a schematic diagram of the architecture of a model training system provided in an embodiment of the present application;

[0070] Figure 2b It is a schematic diagram of a convolutional neural network structure provided in an embodiment of the present application;

[0071] Figure 3 It is a flow chart of a model parameter optimization method provided in an embodiment of the present application;

[0072] Figure 4 It is a flow chart of another model parameter optimization method provided in an embodiment of the present application;

[0073] Figure 5a It is a schematic diagram of a model training provided in an embodiment of the present application;

[0074] Figure 5b is a schematic diagram of a scenario of model parameter optimization provided by an embodiment of the present application;

[0075] Figure 6 It is a structural schematic diagram of a model parameter optimization device provided in an embodiment of the present application;

[0076] Figure 7It is a structural schematic diagram of another model parameter optimization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0078] Because when the prior art performs model parameter tuning, as the prior data increases, the gap between the optimal value and the non-optimal value corresponding to the model loss value also increases in direct proportion. This causes the prior distribution of the parameter to be exponentially concentrated near the highest prior parameter. This makes the influence of the posterior data on the posterior distribution of the parameter very small, resulting in low model accuracy. In view of this, the present application provides a model parameter optimization method and related systems and storage media, which can avoid introducing complex hyperparameters that balance the amount of prior data and the amount of posterior data when optimizing parameters, while improving the accuracy of the model.

[0079] The following will describe the system architecture of the embodiment of the present application in detail with reference to the accompanying drawings. Figure 1 , Figure 1 1 is a schematic diagram of a model parameter optimization system applicable to an embodiment of the present application, the system comprising a server 101 and a client 102.

[0080] The server 101 is a device with centralized computing capabilities. Exemplarily, the server 101 can be implemented by a server, a virtual machine, a cloud, or a robot.

[0081] When the server 101 includes a server, the type of the server includes but is not limited to a general-purpose computer, a dedicated server computer, a blade server, etc. This application does not strictly limit the number of servers included in the server 101, and the number can be one or more (such as a server cluster, etc.).

[0082] A virtual machine refers to a computing module that has complete hardware system functions and runs in a completely isolated environment through software simulation. Of course, in addition to virtual machines, the server 101 can also be implemented through other computing instances, such as containers.

[0083] The cloud is a software platform that uses application virtualization technology, which enables one or more software and applications to be developed and run in an independent virtualized environment. Optionally, when the server 101 is implemented through the cloud, the cloud can be deployed on a public cloud, a private cloud, or a hybrid cloud.

[0084] The client 102 or user end is a program corresponding to the server and providing local services to the client. The client 102 of the embodiment of the present application may be a handheld terminal, a wearable device, an entertainment device, etc.

[0085] In an embodiment of the present application, the client 102 can transmit data to the server 101, and the server determines the optimized value of the parameter and then sends the optimized value to the client 102 so that the client 102 can update the model parameter.

[0086] In another possible implementation, the model parameter optimization system may include only the client 102 , that is, the client 102 may complete the model parameter update independently.

[0087] In another possible implementation, the model parameter optimization system may include only the server 101, that is, the server 101 may complete the model parameter update alone.

[0088] Of course, other methods may also be used, and this solution does not limit this.

[0089] The first model of the embodiment of the present application is obtained by training based on prior data. Figure 2a 2 is a schematic diagram of the architecture of a model training system provided by an embodiment of the present application. The data acquisition device 260 is used to acquire image data and store it in the database 230 , and the training device 220 generates a target model / rule 201 based on the image data maintained in the database 230 .

[0090] The work of each layer in a deep neural network can be described by the mathematical expression y=a(Wgx+b): From a physical level, the work of each layer in a deep neural network can be understood as completing the transformation from input space to output space (i.e., the row space to column space of the matrix) through five operations on the input space (the set of input vectors). These five operations include: 1. Dimension increase / reduction; 2. Zoom in / out; 3. Rotation; 4. Translation; 5. "Bending". Among them, operations 1, 2, and 3 are completed by Wgx, operation 4 is completed by +b, and operation 5 is implemented by a(). The word "space" is used here because the classified object is not a single thing, but a class of things, and space refers to the collection of all individuals of this class of things. Among them, W is a weight vector, and each value in the vector represents the weight value of a neuron in the neural network of this layer. The vector W determines the spatial transformation from input space to output space described above, that is, the weight W of each layer controls how to transform the space. The purpose of training a deep neural network is to finally obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by many layers of vectors W). Therefore, the training process of a neural network is essentially about learning how to control spatial transformations, or more specifically, learning the weight matrix.

[0091] Because we want the output of the deep neural network to be as close as possible to the value we really want to predict, we can compare the current network's predicted value with the target value we really want, and then update the weight vector of each layer of the neural network based on the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the network's predicted value is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the neural network can predict the target value we really want. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.

[0092] The target model / rule obtained by the training device 220 can be applied to different systems or devices. Figure 2a In the embodiment, the execution device 210 is configured with an I / O interface 212 for data interaction with external devices, and a “user” can input data into the I / O interface 212 through a client device 240 .

[0093] The execution device 210 can call data, codes, etc. in the data storage system 250 , and can also store data, instructions, etc. in the data storage system 250 .

[0094] The calculation module 211 processes the input data using the target model / rule 201 .

[0095] The correlation function module 213 is used to extract features of the received data and perform normalization operations.

[0096] The correlation function module 214 is used to process the results output by the calculation module.

[0097] Finally, the I / O interface 212 returns the processing result to the client device 240 and provides it to the user.

[0098] More deeply, the training device 220 can generate corresponding target models / rules 201 based on different data for different goals to provide users with better results.

[0099] In the attached Figure 2aIn the case shown in , the user can manually specify the data to be input into the execution device 210, for example, by operating in the interface provided by the I / O interface 212. In another case, the client device 240 can automatically input data into the I / O interface 212 and obtain the result. If the client device 240 needs to obtain the user's authorization to automatically input data, the user can set the corresponding authority in the client device 240. The user can view the results output by the execution device 210 on the client device 240, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 240 can also serve as a data acquisition terminal to store the collected image data into the database 230.

[0100] It is worth noting that Figure 2a This is only a schematic diagram of a system architecture provided by an embodiment of the present invention. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. Figure 2a In the embodiment, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 can also be placed in the execution device 210.

[0101] The following is an introduction to the training of convolutional neural networks:

[0102] Convolutional neural network (CNN) is a deep neural network with a convolutional structure. It is a deep learning architecture. A deep learning architecture refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network in which each neuron responds to overlapping areas in the image input to it.

[0103] like Figure 2b As shown, the convolutional neural network (CNN) 100 may include an input layer 110 , a convolutional layer / pooling layer 120 , wherein the pooling layer is optional, and a neural network layer 130 .

[0104] Convolutional layer / pooling layer 120:

[0105] Convolutional Layer:

[0106] like Figure 2bThe convolution layer / pooling layer 120 shown may include layers 121-126 as shown in the examples. In one implementation, layer 121 is a convolution layer, layer 122 is a pooling layer, layer 123 is a convolution layer, layer 124 is a pooling layer, layer 125 is a convolution layer, and layer 126 is a pooling layer. In another implementation, layers 121 and 122 are convolution layers, layer 123 is a pooling layer, layers 124 and 125 are convolution layers, and layer 126 is a pooling layer. That is, the output of a convolution layer can be used as the input of a subsequent pooling layer, or as the input of another convolution layer to continue the convolution operation.

[0107] Taking the convolution layer 121 as an example, the convolution layer 121 may include a plurality of convolution operators, which are also called kernels. Their role in image processing is equivalent to a filter that extracts specific information from an input image matrix. The convolution operator may essentially be a weight matrix, which is usually predefined. In the process of performing a convolution operation on an image, the weight matrix is ​​usually processed one pixel by one pixel (or two pixels by two pixels... depending on the value of the step length stride) in the horizontal direction on the input image, thereby completing the work of extracting specific features from the image.

[0108] The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is ​​the same as the depth dimension of the input image. During the convolution operation, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, instead of using a single weight matrix, multiple weight matrices of the same dimension are applied. The output of each weight matrix is ​​stacked to form the depth dimension of the convolved image.

[0109] Different weight matrices can be used to extract different features in the image. For example, one weight matrix is ​​used to extract image edge information, another weight matrix is ​​used to extract specific colors of the image, and another weight matrix is ​​used to blur unnecessary noise in the image... The multiple weight matrices have the same dimensions, and the feature maps extracted by the multiple weight matrices with the same dimensions are also of the same dimension. The extracted feature maps with the same dimensions are then merged to form the output of the convolution operation.

[0110] The weight values ​​in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values ​​obtained through training can extract information from the input image, thereby helping the convolutional neural network 100 to make correct predictions.

[0111] When the convolutional neural network 100 has multiple convolutional layers, the initial convolutional layer (for example, 121) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 100 increases, the features extracted by the later convolutional layers (for example, 126) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.

[0112] Pooling layer:

[0113] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer, such as Figure 2b The layers 121-126 illustrated in 120 may be a convolution layer followed by a pooling layer, or multiple convolution layers followed by one or more pooling layers. In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and / or a maximum pooling operator to sample the input image to obtain an image of a smaller size. The average pooling operator may calculate the pixel values ​​in the image within a specific range to generate an average value. The maximum pooling operator may take the pixel with the largest value within a specific range as the result of the maximum pooling.

[0114] In addition, just as the size of the weight matrix used in the convolutional layer should be related to the image size, the operator in the pooling layer should also be related to the image size. The size of the image output after processing by the pooling layer can be smaller than the size of the image input to the pooling layer. Each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.

[0115] Neural network layer 130:

[0116] After being processed by the convolution layer / pooling layer 120, the convolution neural network 100 is not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 120 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 100 needs to use the neural network layer 130 to generate one or a group of outputs of the required number of classes.

[0117] Therefore, the neural network layer 130 may include multiple hidden layers (such as Figure 2b 131, 132 to 13n) and output layer 140 shown, the parameters contained in the multi-layer hidden layer can be pre-trained according to relevant training data of a specific task type, for example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc. ...

[0118] After the multiple hidden layers in the neural network layer 130, that is, the last layer of the entire convolutional neural network 100 is the output layer 140, which has a loss function similar to the classification cross entropy, specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network 100 (such as Figure 2b The propagation from 110 to 140 is forward propagation), and the reverse propagation (such as Figure 2b The propagation from 140 to 110 is called back propagation) and then the weight values ​​and biases of the aforementioned layers will begin to be updated to reduce the loss of the convolutional neural network 100 and the error between the result output by the convolutional neural network 100 through the output layer and the ideal result.

[0119] It should be noted that if Figure 2b The convolutional neural network 100 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models. For example, multiple convolutional layers / pooling layers can be used in parallel to input the extracted features into the full neural network layer 130 for processing.

[0120] The architecture of the embodiment of the present application is described above, and the method of the embodiment of the present application is described in detail below.

[0121] Reference Figure 3 As shown in FIG. 1 , it is a flow chart of a model parameter optimization method provided in an embodiment of the present application. Optionally, the method can be applied to the aforementioned model parameter optimization system. Figure 3 The model parameter optimization method shown may include steps 301-304. It should be understood that for the convenience of description, this application is described in the order of 301-304, and is not intended to limit the execution to the above order. The embodiment of the present application does not limit the order of execution, execution time, number of executions, etc. of the above one or more steps. The following description takes the execution subject of steps 301-304 of the model parameter optimization method as a server as an example, and this application is also applicable to other execution subjects such as clients. Steps 301-304 are as follows:

[0122] 301. Acquire multiple reference values ​​of parameters of the first model according to a priori data pairs of the first model and a posteriori data pair of the first model;

[0123] The first model may be a trained model, such as a convolutional neural network (CNN) model, etc., which is not limited in this solution.

[0124] The prior data pair of the first model can be understood as training the model based on the prior data pair to obtain the first model. The prior data pair can include training data and labels corresponding to the training data.

[0125] Optionally, the priori data pair may include data pairs of multiple different training data domains. The data domain may be understood as a data set formed by data sampled from one data distribution, and data sampled from different data distributions constitute different data domains.

[0126] The posterior data pair of the first model can be understood as a data pair used in the process of tuning the parameters of the trained first model. Alternatively, it can be a data pair used in a commercial process, which is not limited in this solution.

[0127] The parameters of the first model can be all parameters or partial parameters. When the above parameters are all parameters of the model, such as the first model has 3 parameters, namely w1, w2 and w3, the multiple reference values ​​can be, for example: (w1=2, w2=3, w3=0.5); (w1=0.2, w2=2, w3=0.4); (w1=0.2, w2=0.4, w3=1.3)... When the above parameters are partial parameters of the model, such as the parameter w2 in the first model, the multiple reference values ​​can be, for example: w2=3; w2=2; w2=0.4... This solution does not limit this.

[0128] In a possible implementation, multiple reference values ​​of the parameters of the first model can be obtained based on the Monte Carlo sampling method, the prior data pair of the first model and the posterior data pair of the first model. Among them, the Monte Carlo sampling method is a random simulation method. A method for obtaining one of the reference values ​​is introduced below. The Langevin Monte Carlo sampling method is a classic Markov chain Monte Carlo sampling method, which samples a reference value from the parameter space according to the prior distribution probability, calculates the gradient of the posterior data on the reference value, and searches for the reference value of the next parameter of the first model in the negative gradient direction. In order to ensure a certain degree of randomness, a certain amount of Gaussian noise is superimposed on the reference value obtained by the search. Among them, the iterative step length of the search selects the maximum step length that satisfies the preset constraint conditions (such as the preset model evaluation information described below). Subsequently, according to the previous step, it is iterated repeatedly until the reference value converges (the change amount of multiple consecutive searches is less than a preset value), that is, the reference value is obtained.

[0129] Of course, other methods can also be used to obtain reference values, and this solution does not limit this.

[0130] 302. According to the preset model evaluation information, the first model and the prior data pair, traverse the multiple reference values ​​to obtain at least one target value of the parameter; the loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model in the preset model evaluation information;

[0131] The preset model evaluation information may include an upper limit of the loss value of the model and / or a lower limit of the test accuracy value of the model. Of course, it may also be other evaluation information, which is not limited in this solution.

[0132] Based on the preset model evaluation information, appropriate model parameters can be selected to ensure the performance of the model.

[0133] At least one target value of the above-mentioned parameter may be selected from the above-mentioned multiple reference values ​​by traversing the above-mentioned multiple reference values, or may be obtained by processing the above-mentioned reference values, and this solution does not impose any limitation on this.

[0134] The loss value of the model corresponding to the above target value on the prior data pair is not greater than the upper limit of the loss value of the model in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value is not less than the lower limit of the test accuracy value of the model in the preset model evaluation information. It can be understood that the evaluation information of the model corresponding to the target value meets the requirements of the preset model evaluation information.

[0135] For example, it can be achieved by solving the average loss value of the model corresponding to each reference value in each of the above training data domains (for example, for training data domain A, the loss value of each prior data pair in training data domain A is calculated, and then the average loss value of the prior data pairs in training data domain A is solved according to the number of prior data pairs in training data domain A), and then obtaining the training data domain with the largest average loss value. If the loss value of the training data domain with the largest average loss value is not less than the upper limit of the loss value of the model in the above preset model evaluation information, the reference value is recorded as the target value. If the loss value of the training data domain with the largest average loss value is greater than the upper limit of the loss value of the model in the above preset model evaluation information, the reference value is discarded.

[0136] By repeating the above steps and searching through the above multiple reference values, at least one target value can be obtained.

[0137] For the method of determining the target value based on the test accuracy value, please refer to the above introduction, which will not be repeated here.

[0138] In a possible implementation, based on multiple reference values ​​of the above parameters, the target value of the parameter can be determined from the multiple reference values ​​based on the following expression:

[0139] θ:max L tr (fθ)≤ρ1+ε n1 ;

[0140] Wherein, θ is the above parameter of the first model. tr (fθ) is the loss value of the model's prior data corresponding to tr. ρ1 is the upper limit of the loss value of the preset model, ε n1 is the fluctuation value of the loss value of the model in the training data domain n1, where the training data domain n1 is the data domain with the largest loss value among multiple training data domains corresponding to the prior data pair.

[0141] For example, taking different training data domains as units, the loss value of the prior data to tr in each training data domain is calculated respectively, and then the average value of the loss value in each training data domain is calculated, and then the maximum loss value max L is determined based on these average values. tr (fθ), if the maximum loss value is not greater than ρ1+ε n1 , then the θ is determined as a target value.

[0142] In this example, the loss value of the model's prior data for tr in each training data domain is no greater than ρ1+ε n1 Take ρ as an example to illustrate. Of course, it can also be that the loss values ​​corresponding to the prior data of the model are not greater than ρ1, etc. It can also be other settings, and this solution does not limit this.

[0143] In another possible implementation, the target value of the parameter may be determined based on the following expression:

[0144] θ:min L tr (fθ)≥ρ2+ε n2 ;

[0145] Wherein, θ is the above parameter of the first model. tr (fθ) is the loss value of the model on the prior data pair tr. ρ2 is the lower bound of the model's test accuracy, ε n2 is the fluctuation value of the test accuracy value of the model in the training data domain n2, wherein the training data domain n2 is the data domain with the smallest test accuracy value among multiple training data domains corresponding to the prior data pair.

[0146] That is, the test accuracy value of the model's prior data for tr in each training data domain is not less than ρ2+ε n2 .

[0147] The above two implementations can also be used in combination, and this solution does not limit this.

[0148] The above examples only use the model loss value and the model test accuracy value as examples. It can also be other evaluation criteria, such as the average mean square error between the model test value and the label.

[0149] 303. Determine an optimized value of the parameter according to the at least one target value, the priori data pair, and the posteriori data pair;

[0150] The optimized value of the parameter is determined based on the target value of the parameter determined above, the prior data pair and the posterior data pair of the first model.

[0151] In a possible implementation, step 303 may include steps 3031-3034, which are as follows:

[0152] 3031. Obtain a priori distribution of the parameter according to the priori data;

[0153] The prior distribution of the parameters of the first model can be understood as a probability distribution of the parameters.

[0154] Optionally, the distribution of multiple parameters obtained during model training is processed based on prior data to obtain point distribution, thereby obtaining a prior distribution of the parameter.

[0155] Of course, other methods may also be used, for example, the prior distribution of the parameter may be manually specified, and this solution does not limit this.

[0156] 3032. Obtain a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value;

[0157] Based on the target value of the parameter of the first model, the loss value corresponding to each posterior data pair can be obtained by inputting the posterior data pair into the first model corresponding to the target value.

[0158] 3033. Obtain a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair;

[0159] In one possible implementation, the posterior distribution of the parameter can be expressed as:

[0160]

[0161] Among them, p(dθ|D tr ,D ad ) represents the posterior distribution of the parameter θ, π(dθ) represents the prior distribution of the parameter θ, (xi *, * ) is the i-th data pair in the posterior data pair ad, n * represents the number of posterior data pairs, l is the first model in the posterior data pair (xi * , * ) on the loss value.

[0162] In other words, the posterior distribution of the parameter is related to the prior distribution of the parameter and the model loss value corresponding to the posterior data pair. In this way, the defect of poor model performance caused by the large data volume gap caused by a large number of prior data pairs and a small sample of posterior data pairs can be avoided.

[0163] 3034. Determine an optimized value of the parameter according to the posterior distribution of the parameter.

[0164] In a possible implementation, the value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter. In this way, the obtained optimized value of the parameter can be optimal on the posterior data pair.

[0165] In another possible implementation, sampling is performed according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter; and then weighted averaging is performed on the multiple values ​​of the parameter to obtain the optimized value of the parameter. The sampling may be, for example, probability sampling. The weighted averaging may be, for example, weighted averaging with probability values ​​as weights. With this example, uncertainty estimation of the model prediction result can be achieved.

[0166] Other solutions are also possible, and this solution does not limit this.

[0167] It should be noted that the embodiment of the present application only uses the above expression as an example for explanation, and it can also be expressed in other ways. For example, step 302 and step 303 can use the following method to determine the optimal value of the parameter:

[0168]

[0169] Among them, C tr :={θ:max L tr (fθ)≤ρ1+ε n1}, and / or, C tr :={θ:min L tr (fθ)≥ρ2+ε n2}.

[0170] That is to say, when θ satisfies the above-mentioned restrictions, the posterior distribution p of the parameter is proportional to the prior distribution π(dθ) of the parameter and the corresponding model loss value of the posterior data pair. If θ does not meet the above-mentioned restrictions, the posterior distribution p of the parameter is, for example, 0.

[0171] 304. Update the parameters of the first model according to the optimized values.

[0172] The first model is updated based on the optimized values ​​of the parameters determined above to obtain an optimized first model. In this way, the model can be compatible not only with the prior data pairs, but also with the posterior data pairs, and the posterior distribution of the parameters of the model is not affected by the number of prior data pairs, and the performance is better.

[0173] The parameters of the first model can be continuously updated based on the posterior data obtained again until the model accuracy, performance, etc. meet the requirements.

[0174] Optionally, the acquired posterior data pair may also be provided to a model training device so that the model training device may use the posterior data pair as a priori data pair to facilitate accumulation of more data in subsequent training processes and enable gradual evolution of the algorithm.

[0175] In the embodiment of the present application, based on multiple reference values ​​of the parameters of the first model, according to the preset model evaluation information and the prior data pair, the multiple reference values ​​are traversed to obtain at least one target value of the parameter, and then the optimized value of the parameter is determined according to the target value, the prior data pair and the posterior data pair of the first model, and then the first model is updated based on the optimized value. This means is adopted, wherein the loss value of the model corresponding to the target value of the parameter on the prior data pair is not greater than the upper limit of the loss value of the model, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model, so that the optimized value of the obtained parameter can take into account the protection of the prior data pair; based on the target value, the prior data pair and the posterior data pair of the first model, the optimized value of the parameter is determined, and at the same time, the optimized value of the parameter can take into account the posterior data pair, and the performance is better.

[0176] Below Figure 4 The above-mentioned model parameter optimization method is introduced by taking the partial parameters of the updated model as an example. Among them, the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model. Figure 4 As shown in FIG. 1 , it is a flow chart of another model parameter optimization method provided in an embodiment of the present application. Optionally, the method can be applied to the aforementioned model parameter optimization system. Figure 4The model parameter optimization method shown may include steps 401-406. It should be understood that for the convenience of description, this application is described in the order of 401-406, and is not intended to limit execution to the above order. The embodiment of the present application does not limit the order of execution, execution time, number of executions, etc. of the above one or more steps. The following description takes the execution subject of steps 401-406 of the model parameter optimization method as a server as an example, and this application is also applicable to other execution subjects such as clients. Steps 401-406 are as follows:

[0177] 401. Acquire multiple reference values ​​of parameters of a classification model in a first model according to a priori data pairs of a first model and a posteriori data pair of the first model;

[0178] This example is explained by taking the updating of some parameters in the first model (parameters of the classification model) as an example. Of course, the updating of the parameters of the feature extraction model can also be done, and this solution does not limit this.

[0179] For an introduction to this part, please refer to the above Figure 3 The description of step 301 in the illustrated embodiment will not be repeated here.

[0180] 402. Obtain a priori feature data pair according to the priori data pair of the first model and the feature extraction model;

[0181] The first model is obtained by training based on prior data. Figure 5a As shown, training is performed based on multiple training data domains to obtain a first model f, which can be expressed as a complex sum of two functions (models): in, is the feature extraction part of the model, and ω is the classification part of the model.

[0182] For example, based on four training data domains A, B, C and D, the initial model is trained to obtain a first model. The first model includes a feature extraction part It is used to extract embedded features of data The first model also includes a classification part (such as a classifier), which corresponds to a parameter θ (in this case ω is θ). The four training data domains can be uniformly sampled, for example, 1000 data pairs are sampled from each training data domain to perform model training.

[0183] Optionally, the training data (such as x) in the prior data pair (such as (x, y)) of the first model is input into the feature extraction model for feature extraction processing to obtain the prior feature data (such as ), combined with the label of the prior data pair (such as y), we can get the prior feature data pair

[0184] 403. According to the preset model evaluation information, the classification model and the prior feature data pair, traverse the multiple reference values ​​to obtain at least one target value of the parameter; the loss value of the classification model corresponding to the target value is not greater than the upper limit of the loss value of the classification model on the prior feature data pair in the preset model evaluation information, and / or the test accuracy value of the classification model corresponding to the target value on the prior feature data pair is not less than the lower limit of the test accuracy value of the classification model in the preset model evaluation information;

[0185] In a possible implementation, based on multiple reference values ​​of the above parameters, the target value of the parameter can be determined based on the following expression:

[0186] θ: max L tr (fθ)≤ρ1+ε n1 ;

[0187] Among them, θ is the parameter of the classification model. tr (fθ) is the loss value of the classification model on the prior data pair tr. ρ1 is the upper bound of the loss value of the classification model, ε n1 is the fluctuation value of the loss value of the classification model in the training data domain n1, wherein the training data domain n1 is the data domain with the largest loss value among multiple training data domains corresponding to the prior feature data pairs.

[0188] That is, the loss value corresponding to each training data domain of the prior feature data of the classification model is no greater than ρ1+ε n1 .

[0189] In another possible implementation, the target value of the parameter may be determined based on the following expression:

[0190] θ: min L tr (fθ)≥ρ2+ε n2 ;

[0191] Among them, θ is the parameter of the classification model. tr (fθ) is the loss value of the classification model on the prior data pair tr. ρ2 is the lower bound of the test accuracy of the classification model, ε n2 is the fluctuation value of the test accuracy value of the classification model in the training data domain n2, wherein the training data domain n2 is the data domain with the smallest test accuracy value among multiple training data domains corresponding to the prior feature data pairs.

[0192] That is, the test accuracy value of the prior data pair tr of the classification model corresponding to each training data domain is not less than ρ2+ε n2 .

[0193] The above two implementations can also be used in combination, and this solution does not limit this.

[0194] For an introduction to this step, please refer to the previous Figure 3 The description of step 302 in the illustrated embodiment will not be repeated here.

[0195] In this example, only the prior feature data pairs may be stored. Compared with directly storing the prior data pairs, this solution can reduce the amount of data storage.

[0196] 404. Obtain a posterior feature data pair according to the posterior data pair of the first model and the feature extraction model;

[0197] Optionally, the training data in the posterior data pair of the first model is input into a feature extraction model for feature extraction processing to obtain posterior feature data, and the posterior feature data pair can be obtained by combining the label of the posterior data pair.

[0198] 405. Determine an optimized value of the parameter according to the target value, the priori feature data pair, the posterior feature data pair, and the classification model;

[0199] In a possible implementation, step 405 may include steps 4051-4054, which are as follows:

[0200] 4051. Obtaining a priori distribution of parameters of the classification model according to the priori feature data;

[0201] Optionally, the prior distribution of the parameter may be obtained based on multiple θ obtained during the training of the classification model in the first model.

[0202] Of course, other methods may also be used, and this solution does not limit this.

[0203] 4052. Obtain a loss value of the classification model on the posterior feature data pair according to the posterior feature data pair and the target value;

[0204] Based on the at least one target value, the classification data is obtained by inputting the posterior feature data in the posterior feature data pair into the classification model corresponding to the target value, and then the loss value corresponding to each posterior feature data pair can be obtained by combining the label in the posterior feature data pair.

[0205] 4053. Obtain a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the classification model on the posterior feature data pair;

[0206] In one possible implementation, the posterior distribution of the parameter can be expressed as:

[0207]

[0208] Among them, p(dθ|Dtr ,D ad ) represents the posterior distribution of the parameter θ, π(dθ) represents the prior distribution of the parameter θ, (xi * , * ) is the i-th data pair in the posterior feature data pair, n * Represents the number of posterior feature data pairs.

[0209] In other words, the posterior distribution of the parameter is related to the prior distribution of the parameter and the model loss value corresponding to the posterior feature data pair. In this way, the defect of poor model performance caused by the large data volume gap caused by a large number of prior data pairs and a small sample of posterior data pairs can be avoided.

[0210] 4054. Determine an optimized value of the parameter according to the posterior distribution of the parameter.

[0211] For an introduction to this step, please refer to the previous Figure 3 The description of step 3034 in the illustrated embodiment will not be repeated here.

[0212] 406. Update the parameters of the classification model according to the optimized values.

[0213] like Figure 5b As shown, the model parameters are tuned based on the target data domain U corresponding to the actual application scenario. The classification model is updated based on the optimized values ​​of the parameters determined above to obtain the optimized classification model, and the optimized first model can be obtained. The feature extraction model may not be updated in this process. Based on the above parameter optimization processing, the first model can be made compatible not only with the prior data pairs, but also with the posterior data pairs, and the posterior distribution of the parameters of the model is not affected by the number of prior data pairs, and the performance is better.

[0214] It should be noted that in the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between the various embodiments are consistent and can be referenced mutually, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0215] The above detailed description of the method of the embodiment of the present application, the following provides a device of the embodiment of the present application. It can be understood that in the various device embodiments of the present application, the division of multiple units or modules is only a logical division according to function, and is not used as a limitation on the specific structure of the device. In a specific implementation, some functional modules may be subdivided into more small functional modules, and some functional modules may also be combined into one functional module, but no matter whether these functional modules are subdivided or combined, the general process performed by the device is the same. For example, some devices contain a receiving unit and a sending unit. In some designs, the sending unit and the receiving unit can also be integrated into a communication unit, which can implement the functions implemented by the receiving unit and the sending unit. Usually, each unit corresponds to its own program code (or program instruction), and when the program code corresponding to each of these units is run on the processor, the unit is controlled by the processing unit to execute the corresponding process to implement the corresponding function.

[0216] The embodiments of the present application also provide a device for implementing any of the above methods. For example, a model parameter optimization device is provided, including modules (or means) for implementing each step performed by the server (or client) in any of the above methods.

[0217] For example, refer to Figure 6 FIG. 1 is a schematic diagram of the structure of a model parameter optimization device provided in an embodiment of the present application. The model parameter optimization device is used to implement the aforementioned model parameter optimization method, for example Figure 3 , Figure 4 The model parameter optimization method shown.

[0218] like Figure 6 As shown, the device may include an acquisition module 601, a calculation module 602, a determination module 603 and an update module 604, which are specifically as follows:

[0219] An acquisition module 601 is used to acquire multiple reference values ​​of parameters of the first model according to the priori data pairs of the first model and the posterior data pairs of the first model;

[0220] A calculation module 602 is used to traverse the multiple reference values ​​according to preset model evaluation information, the first model and the prior data pair of the first model to obtain at least one target value of the parameter; the loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information;

[0221] A determination module 603, configured to determine an optimized value of the parameter according to the at least one target value, the priori data pair of the first model, and the posterior data pair of the first model;

[0222] The updating module 604 is used to update the parameters of the first model according to the optimized values.

[0223] In a possible implementation, the determining module 603 is configured to:

[0224] Obtaining a priori distribution of the parameters of the first model according to the priori data;

[0225] Obtaining a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value;

[0226] Obtaining a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair;

[0227] The optimized value of the parameter is determined according to the posterior distribution of the parameter.

[0228] In a possible implementation manner, the value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter.

[0229] In a possible implementation, the determining module 603 is further configured to:

[0230] Sampling according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter;

[0231] A weighted average process is performed on multiple values ​​of the parameter to obtain an optimized value of the parameter.

[0232] In a possible implementation manner, the parameters are all parameters of the first model.

[0233] In a possible implementation, the parameters are partial parameters of the first model, wherein the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model.

[0234] The calculation module 602 is used to:

[0235] Obtaining a priori feature data pairs according to the priori data pairs of the first model and the feature extraction model;

[0236] According to the preset model evaluation information, the classification model and the prior feature data pair, traversing the plurality of reference values ​​to obtain at least one target value of the parameter;

[0237] The determining module 603 is used to:

[0238] Obtaining a posterior feature data pair according to the posterior data pair of the first model and the feature extraction model;

[0239] The optimized value of the parameter is determined according to the at least one target value, the priori feature data pair, the posterior feature data pair and the classification model.

[0240] For the introduction of each module above, please refer to the introduction of the aforementioned method embodiment, which will not be repeated here.

[0241] It should be understood that the division of each module in each of the above devices is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the modules in the model parameter optimization device can be implemented in the form of a processor calling software; for example, the model parameter optimization device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each module of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside the device or a memory outside the device. Alternatively, the modules in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits, and the hardware circuits can be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be realized by a programmable logic device (PLD), taking a field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All modules of the above devices can be realized in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.

[0242] Reference Figure 7 As shown in FIG. 1 , it is a schematic diagram of the hardware structure of another model parameter optimization device provided in an embodiment of the present application. Figure 7The model parameter optimization device 700 shown (the device 700 may be a computer device) includes a memory 701, a processor 702, a communication interface 703 and a bus 704. The memory 701, the processor 702 and the communication interface 703 are connected to each other through the bus 704.

[0243] The memory 701 may be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).

[0244] The memory 701 can store programs. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the model parameter optimization method of the embodiment of the present application.

[0245] The processor 702 is a circuit with signal processing capability. In one implementation, the processor 702 may be a circuit with instruction reading and running capability, such as a central processing unit CPU, a microprocessor, a graphics processing unit (GPU) (which may be understood as a microprocessor), or a digital signal processor (DSP); in another implementation, the processor 702 may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit may be fixed or reconfigurable, such as the processor 702 being a hardware circuit implemented by an ASIC or a programmable logic device PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration may be understood as the process of the processor loading instructions to implement the functions of some or all of the above modules. In addition, it may also be a hardware circuit designed for artificial intelligence, which may be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc. The processor 702 is used to execute relevant programs to implement the functions that need to be performed by the units in the model parameter optimization device of the embodiment of the present application, or to execute the model parameter optimization method of the method embodiment of the present application.

[0246] It can be seen that each module in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0247] In addition, the modules in the above device can be fully or partially integrated together, or can be implemented independently. In one implementation, these modules are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of the modules of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0248] The communication interface 703 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the device 700 and other devices or a communication network. For example, data can be obtained through the communication interface 703.

[0249] The bus 704 may include a path for transmitting information between various components of the device 700 (eg, the memory 701 , the processor 702 , and the communication interface 703 ).

[0250] It should be noted that although Figure 7 The device 700 shown only shows a memory, a processor, and a communication interface, but in the specific implementation process, those skilled in the art should understand that the device 700 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the device 700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the device 700 may also only include the devices necessary to implement the embodiments of the present application, and does not necessarily include Figure 7 All devices shown in .

[0251] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0252] The embodiment of the present application further provides a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0253] It should be understood that in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; wherein A and B can be singular or plural. Also, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, wherein a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be necessarily different. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0254] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0255] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0256] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.

[0257] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A model parameter optimization method, characterized in that: include: Acquire multiple reference values ​​of parameters of the first model according to a priori data pairs of the first model and a posteriori data pairs of the first model; According to preset model evaluation information, the first model and the prior data pair, traverse the plurality of reference values ​​to obtain at least one target value of the parameter; The loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information; Determining an optimized value of the parameter according to the at least one target value, the priori data pair, and the posteriori data pair; The parameters of the first model are updated according to the optimized values.

2. The method according to claim 1, characterized in that The step of determining the optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair comprises: Obtaining a priori distribution of the parameters of the first model according to the priori data; Obtaining a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value; Obtaining a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair; The optimized value of the parameter is determined according to the posterior distribution of the parameter.

3. The method according to claim 2, characterized in that The value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter.

4. The method according to claim 2, characterized in that: Determining the optimized value of the parameter according to the posterior distribution of the parameter includes: Sampling according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter; A weighted average process is performed on multiple values ​​of the parameter to obtain an optimized value of the parameter.

5. The method according to any one of claims 1 to 4, characterized in that: The parameters are all parameters of the first model.

6. The method according to any one of claims 1 to 4, characterized in that: The parameters are partial parameters of the first model, wherein the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model. The step of traversing the plurality of reference values ​​according to the preset model evaluation information, the first model and the priori data pair to obtain at least one target value of the parameter includes: Obtaining a priori feature data pair according to the priori data pair and the feature extraction model; According to the preset model evaluation information, the classification model and the prior feature data pair, traversing the plurality of reference values ​​to obtain at least one target value of the parameter; The step of determining the optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair comprises: Obtaining a posterior feature data pair according to the posterior data pair and the feature extraction model; The optimized value of the parameter is determined according to the at least one target value, the priori feature data pair, the posterior feature data pair and the classification model.

7. A model parameter optimization device, characterized in that: include: An acquisition module, configured to acquire a plurality of reference values ​​of the parameters of the first model according to the priori data pairs of the first model and the posterior data pairs of the first model; a calculation module, configured to traverse the plurality of reference values ​​according to preset model evaluation information, the first model and the priori data pair to obtain at least one target value of the parameter; The loss value of the model corresponding to the target value on the prior data pair is not greater than the upper limit of the loss value of the model on the prior data pair in the preset model evaluation information, and / or the test accuracy value of the model corresponding to the target value on the prior data pair is not less than the lower limit of the test accuracy value of the model on the prior data pair in the preset model evaluation information; A determination module, configured to determine an optimized value of the parameter according to the at least one target value, the priori data pair, and the a posteriori data pair; An updating module is used to update the parameters of the first model according to the optimized values.

8. The device according to claim 7, characterized in that The determining module is used to: Obtaining a priori distribution of the parameters of the first model according to the priori data; Obtaining a loss value of the first model on the posterior data pair according to the posterior data pair and the at least one target value; Obtaining a posterior distribution of the parameter according to the prior distribution of the parameter and the loss value of the first model on the posterior data pair; The optimized value of the parameter is determined according to the posterior distribution of the parameter.

9. The device according to claim 8, characterized in that The value of the parameter corresponding to the maximum probability in the posterior distribution of the parameter is determined as the optimized value of the parameter.

10. The device according to claim 8, characterized in that The determining module is further used for: Sampling according to the posterior distribution of the parameter to obtain multiple values ​​of the parameter; A weighted average process is performed on multiple values ​​of the parameter to obtain an optimized value of the parameter.

11. The device according to any one of claims 7 to 10, characterized in that The parameters are all parameters of the first model.

12. The method according to any one of claims 7 to 10, characterized in that: The parameters are partial parameters of the first model, wherein the first model includes a feature extraction model and a classification model in sequence, and the partial parameters are parameters corresponding to the classification model. The computing module is used for: Obtaining a priori feature data pairs according to the priori data pairs of the first model and the feature extraction model; According to the preset model evaluation information, the classification model and the prior feature data pair, traversing the plurality of reference values ​​to obtain at least one target value of the parameter; The determining module is used to: Obtaining a posterior feature data pair according to the posterior data pair of the first model and the feature extraction model; The optimized value of the parameter is determined according to the at least one target value, the priori feature data pair, the posterior feature data pair and the classification model.

13. A model parameter optimization device, characterized in that: It comprises a processor and a memory; wherein the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6.

15. A computer program product, characterized in that When the computer program product runs on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Model parameter optimization method based on geographic information system

    CN122364797A

  • Model parameter optimization method and related system, and storage medium

    EP4711971A1

  • Model parameter optimization method and related system, and storage medium

    WO2024250886A1