Model training method, computer, storage medium and program product

By dynamically adjusting the filtering parameters a and b during model training using a quantum optimization algorithm, the problem of low filtering efficiency caused by fixed values ​​is solved, thereby improving the accuracy and efficiency of model training.

CN122045830APending Publication Date: 2026-05-15MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610517679.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-20
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing model training, the filtering parameters a and b are fixed values ​​and cannot be dynamically adjusted according to the iterative process of model training, resulting in poor sample filtering efficiency and affecting the model training effect.

Method used

A quantum optimization algorithm is used to calculate the standard form of the QUBO model for filtering parameters a and b, and the filtering parameters are dynamically adjusted in each iteration. The optimal value is used for sample filtering, and quantum computing technology is used for sample filtering.

Benefits of technology

It improves the accuracy and efficiency of model training, reduces model training time, realizes dynamic solution and iteration of filtering parameters, and improves the accuracy of sample filtering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122045830A_ABST
    Figure CN122045830A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, a computer, a storage medium and a program product. The method comprises the steps of obtaining a model training sample; constructing an optimization objective function of the filtering parameters a and b of the sample, and converting the optimization objective function into a standard form of a quadratic unconstrained binary optimization model of the filtering parameters a and b; calculating the standard form of the QUBO model by adopting a quantum optimization algorithm in each iterative operation of model training to obtain the optimal values of the filtering parameters a and b of each iterative operation; and performing sample filtering of training on the sample by using the optimal value to obtain a filtered sample, and performing iterative operation of model training by using the filtered sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a model training method, a computer, a storage medium, and a program product. Background Technology

[0002] Model training is the process of “teaching” an artificial intelligence model to perform iterative parameter calculations to optimize performance using a dataset of samples relevant to the model’s final use cases. If the training data is very similar to the actual problem that the model will be dealing with, then the well-trained model can make accurate predictions on the data to be predicted.

[0003] The dataset used in model training is massive. This massive dataset inevitably contains many duplicate, erroneous, and poorly correlated samples. Therefore, filtering the sample data is a necessary step in model training. Existing models use filtering parameters a and b to filter samples. However, in existing models, the filtering parameters a and b are fixed values ​​and cannot be dynamically adjusted according to the iterative process of model training. This results in poor efficiency of sample filtering and affects the effectiveness of model training. Summary of the Invention

[0004] This application provides a model training method, a computer, a storage medium, and a program product. The technical solution of this application increases the amount of computation by a small amount, so it can be deployed in the face recognition of the terminal. Furthermore, the input information after adding driving information can achieve the accuracy of face recognition information.

[0005] In a first aspect, embodiments of this application provide a model training method, the method comprising: Obtain samples for model training; Construct the optimization objective function for the filtering parameters a and b of the sample, and convert the optimization objective function into the standard form of the QUBO model of the filtering parameters a and b; In each iteration of model training, the standard form of the QUBO model is calculated using a quantum optimization algorithm to obtain the optimal values ​​of the filtering parameters a and b for each iteration. The optimal value is used to train the sample, and the filtered sample is obtained. The filtered sample is then used to perform iterative calculations for model training.

[0006] Secondly, embodiments of this application provide a computer, including: The memory, the processor, and executable program code stored in the memory and executable on the processor, the executable program code being configured to implement some or all of the steps as described in any of the methods in the first aspect.

[0007] Thirdly, embodiments of this application provide a computer-readable storage medium storing a model training program, which, when executed by a processor, implements some or all of the steps described in any of the methods in the first aspect.

[0008] Fourthly, embodiments of this application provide a computer program product, wherein the computer program product includes a computer program operable to cause a computer to perform some or all of the steps described in any method of the first aspect of this application. The computer program product may be a software installation package.

[0009] The technical solution in this application embodiment obtains training samples for the model; constructs an optimization objective function for the filtering parameters a and b of the samples, and converts the optimization objective function into the standard form of the QUBO model of the filtering parameters a and b; in each iteration of model training, a quantum optimization algorithm is used to calculate the standard form of the QUBO model to obtain the optimal values ​​of the filtering parameters a and b for each iteration; the optimal values ​​are used to filter the training samples to obtain filtered samples, and the filtered samples are used to perform iterative model training. This allows the model to approach the optimum faster and minimizes performance loss. Quantum computing technology is used to solve the QUBO model, making the solution for the optimal values ​​of a and b fast. Thus, during model training, the above filtering parameters can be dynamically solved and iterated according to the actual situation of model training, making the filtering of training samples more accurate and reasonable, reducing model training time, and improving model training accuracy. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.

[0011] Figure 1 This is a schematic diagram of the architecture of a training system provided in an embodiment of this application; Figure 2 This is a schematic flowchart of a model training method provided in an embodiment of this application; Figure 3 A flowchart illustrating a model iterative training method provided for a specific implementation of this application; Figure 4 A schematic flowchart of a model training method provided in Embodiment 1 of this application; Figure 5 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer provided in an embodiment of this application. Detailed Implementation

[0012] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort should fall within the scope of protection of the present application.

[0013] The terms "first," "second," and "third," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0014] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0015] The key terms and technical abbreviations involved in this application are explained below: Light GBM: Lightweight Gradient Boosting Machine, an efficient gradient boosting framework suitable for large-scale data and high-dimensional features, with fast training speed and low memory consumption.

[0016] GOSS: Gradient-based One-Side Sampling, a sampling technique used in gradient boosting algorithms, improves training efficiency by retaining samples with larger gradients and randomly sampling samples with smaller gradients.

[0017] QUBO: Quadratic Unconstrained Binary Optimization, a form of mathematical optimization problem commonly used in quantum computing and combinatorial optimization, aims to minimize or maximize a quadratic function with binary values ​​as variables.

[0018] Loss: The loss function is a function used to measure the difference between the model's predicted values ​​and the actual values. It is a core part of optimization algorithms in machine learning.

[0019] The model training method, computer, storage medium, and program product provided in this application embodiment can be applied to, for example... Figure 1 Please refer to the training system shown. Figure 1 , Figure 1 This is a schematic diagram of the architecture of a training system provided in an embodiment of this application. The training system 100 includes a client 101 and a server 102. The client 101 can communicate with the server 102 via a network. The client 101 refers to a device used by the user, such as a smartphone or computer. In this solution, the client 101 provides an interface for the user to interact with the training system 100. Through the client 101, the user can interact with the training system 100.

[0020] The model training method provided in this application can be deployed independently on server 102. Of course, the above model training method can also be executed by client 101 and server 102 in cooperation. This application does not limit the specific subject of execution of the above model training method.

[0021] Server 102 refers to a remote computer used for processing large amounts of computing tasks and storing data. In this scheme, samples for model training are obtained; an optimization objective function for the filtering parameters a and b of the samples is constructed, and the optimization objective function is converted into the standard form of the QUBO model for the filtering parameters a and b; in each iteration of model training, a quantum optimization algorithm is used to calculate the standard form of the QUBO model to obtain the optimal values ​​of the filtering parameters a and b for each iteration; the optimal values ​​are used to filter the samples for training, resulting in filtered samples; and the filtered samples are used to perform iterative model training operations.

[0022] Based on this, this application provides a model training method, which can be achieved by, for example, Figure 1 The server execution shown can be modified in actual application scenarios, depending on the specific application. Figure 2 This is a flowchart illustrating a model training method provided in an embodiment of this application. It is mainly applied to face recognition models, but can also be applied to the training of other models. The technical scenario of this embodiment is mainly a face recognition scenario.

[0023] The above model training methods are as follows Figure 2 As shown, it includes the following steps: Step S201: Obtain samples for model training; The above-mentioned acquisition of model training samples can be achieved using general public datasets. Of course, training samples can also be collected by web crawling or multimodal methods. Alternatively, training samples can be collected by purchasing commercial datasets or by manual annotation. The specific implementation of this application does not limit the above-mentioned methods of obtaining samples.

[0024] Step S202: Construct the optimization objective function of the filtering parameters a and b of the sample, and convert the optimization objective function into the standard form of the QUBO model of the filtering parameters a and b; Specifically, the objective function can be: ; in: It is the first The true labels of each sample are 1 and 0, where 1 represents true and 0 represents false. Is the model in parameters The predicted probability is as follows. γ is the total number of samples. a∈0.01×k, where 0≤k≤100; b∈0.01×k, where 0≤k≤100; 'a' corresponds to the binary variable b corresponds to a binary variable , where i represents the index of the binary variable a, and j represents the index of the binary variable b.

[0025] When calculating the optimal values ​​of a and b, the constraints of x and y also need to be considered. Specifically, it is necessary to construct constraint penalty terms for the binary variable x of the filtering parameter a, and constraint penalty terms for the binary variable y of the filtering parameter b. In detail: The constraint penalty term for x is: ; The constraint penalty term for y is: ; Where λ1 is the penalty coefficient for x; λ2 is the penalty coefficient for y.

[0026] To better optimize the values ​​of a and b, a constraint penalty term is added to the objective function to construct the total energy function of the QUBO model; Total energy function E=E loss + E penalty,x + E penalty,y ; in, ; The penalty items are: ; The penalty items are: ; The standard form of the QUBO model is: ; in, It is a vector of all binary variables; Q is a QUBO matrix, where, The diagonal elements of matrix Q are: ; ; The off-diagonal elements of matrix Q are: ; ;

[0027] For example, the penalty coefficients λ1 and λ2 are determined based on the difference between the training layers and the total number of layers; in: λ1 = 1 / (L) L target ) 2 ; λ2 = ΔL / (L-1); ΔL is the difference between floors, L is the total number of floors, L target This represents the desired number of layers in the face recognition model.

[0028] For example, the values ​​of a and b mentioned above can also be adjusted to their optimal values ​​based on the difference between the training layers and the total number of layers of the model, specifically including: a'=a×Kp1、 b'=b×Kp2; Where Kp1=1-α×(ΔL / L), Kp2=1+α×(ΔL / L) α is an empirical coefficient.

[0029] Step S203: For each iteration of model training, the standard form of the QUBO model is calculated using a quantum optimization algorithm to obtain the optimal values ​​of the filtering parameters a and b for each iteration. The above-mentioned calculation of the standard form of the QUBO model using a quantum optimization algorithm may specifically include: The standard form of the QUBO model is calculated using either the quantum fire algorithm or the quantum genetic algorithm to obtain the optimal values ​​of the filtering parameters a and b for each iteration.

[0030] Step S204: Use the optimal value to filter the samples for training, obtain the filtered samples, and use the filtered samples to perform iterative calculations for model training.

[0031] For example, the sample filtering process described above, which uses the optimal value to train the sample, may specifically include: The filtered samples are obtained by deleting samples that are greater than the filtering parameter a and deleting samples that are less than the filtering parameter b.

[0032] The technical solution in this application embodiment obtains training samples for the model; constructs an optimization objective function for the filtering parameters a and b of the samples, and converts the optimization objective function into the standard form of the QUBO model of the filtering parameters a and b; in each iteration of model training, a quantum optimization algorithm is used to calculate the standard form of the QUBO model to obtain the optimal values ​​of the filtering parameters a and b for each iteration; the optimal values ​​are used to filter the training samples to obtain filtered samples, and the filtered samples are used to perform iterative model training. This allows the model to approach the optimum faster and minimizes performance loss. Quantum computing technology is used to solve the QUBO model, making the solution for the optimal values ​​of a and b fast. Thus, during model training, the above filtering parameters can be dynamically solved and iterated according to the actual situation of model training, making the filtering of training samples more accurate and reasonable, reducing model training time, and improving model training accuracy.

[0033] See Figure 3 , Figure 3 A flowchart illustrating a model iterative training method provided in this application is provided. The model mentioned above can be a Light GBM model, such as... Figure 3 As shown, the above method may specifically include: Configure other parameters of the Light GBM model (except for the filtering parameters a and b), calculate the sample gradient, use quantum annealing to calculate the current optimal values ​​of a and b, filter the samples using a and b, perform this round of training using the filtered samples, after entering the next round of training, return to the step of calculating the sample gradient, and then obtain the model result.

[0034] The specific implementation of this application changes the configuration method of fixed values ​​of a and b in the prior art. It adopts the quantum annealing algorithm to optimize the values ​​of a and b in each round of training, thereby achieving sample filtering. In this way, during model training, the above filtering parameters can be dynamically solved according to the actual situation of model training and dynamically iterated, making the filtering of training samples more accurate and reasonable, reducing the model training time and improving the accuracy of model training.

[0035] Example 1 This application provides a model training method in its first embodiment. The technical scenario of this embodiment includes: taking face recognition model training as an example, specifically, the face recognition model includes, but is not limited to: lightweight models (e.g., ShuffleFace, MobileFaceNet, etc.), high-precision models (e.g., ResNet, IR-ResNet, ResNeSt, DenseNet), and optimization function models (e.g., ArcFace, CosFace, SphereFace). Of course, in other embodiments, the above model can also be a model for other technical scenarios, such as credit risk models (e.g., Logistic Regression, Light GBM), anti-fraud models (e.g., Isolation Forest, Transformer), quantitative investment models, etc. The technical solution provided in this embodiment is mainly applicable to models related to the financial field, such as identity recognition, risk management, quantitative investment, etc.

[0036] The technical scenario implemented in this embodiment is as follows: The number of training samples for model training in this embodiment is γ, where γ is a large value, such as 1 million or 3 million training samples. Figure 4 As shown, the above method includes the following steps: Step S401: When the face recognition model training begins, initialize other parameters according to the original logic, without specifying the specific values ​​of a and b; The original logic mentioned above can be the existing logic in the face recognition model. Depending on the model, the original logic may be different, so it will not be elaborated here.

[0037] The above a and b can be filtering parameters for training the face recognition model. For example, a can be understood as the minimum weight threshold and b can be understood as the maximum weight threshold. That is, samples with a weight greater than a are filtered out, and similarly, samples with a weight less than b are also filtered out.

[0038] This embodiment predefines, a∈0.01×k, where 0≤k≤100; b∈0.01×k, where 0≤k≤100; The values ​​of a and b are both between 0 and 1, and the specific values ​​of a and b are not necessarily the same.

[0039] Step S402: Calculate the gradient of all current training samples based on the original logic of face recognition.

[0040] The input gradient, for a face model f(x) (where x is the face image tensor, typically 3×H×W), where H represents the height of the face image tensor and W represents the width of the face image tensor, is the gradient. xf(x) represents the partial derivative of the model output with respect to the input pixels, that is, the degree of influence of each pixel value change on the output. The specific calculation method is as follows:

[0041] Where N = 3 × H × W, is the total number of pixels, and T represents the transpose operation.

[0042] Step S403: Construct a QUBO model for the face recognition model a and b values, and use the quantum optimization algorithm to calculate the optimal a and b values ​​of the QUBO model; Define binary variables for parameters a and b as follows: 'a' corresponds to the binary variable , in: Indicates selection , Indicates no choice. And it satisfies the one-hot constraint: (Choose only one) value); b corresponds to the binary variable , in: Indicates selection , This indicates that no choice is made and the one-hot constraint is satisfied.

[0043] Therefore, the objective function is defined as: ; in: It is the first The true label (0 or 1) of each sample, when y k When y = 1, it represents a positive example; when y = 1, it represents a positive example. k =0 indicates a negative example (counterexample).

[0044] Is the model in parameters The predicted probability is as follows. γ is the total number of samples. The cross-entropy loss term for a single sample is represented by... A joint decision.

[0045] The goal is to minimize That is, to search .

[0046] The core of the QUBO model is to transform the optimization objective into an energy function. The format is: ; in, It is a vector of all binary variables. It is a QUBO matrix (size is 1). ), where n represents the total number of binary variables corresponding to a, and m represents the total number of binary variables corresponding to b.

[0047] The key to the calculation scheme is to transform the objective function into the energy function E of the QUBO model, that is, to obtain the Q matrix, where the diagonal elements of the Q matrix represent the cost of a single variable, and the off-diagonal elements represent the interaction or constraint between two variables.

[0048] In the QUBO model, the loss term It needs to be represented by binary variables, because and It is a one-hot variable, when and At that time, the loss can be expressed as: ; Therefore, the energy function of the loss term is: ; According to the policy rules, binary variables need to satisfy... and Otherwise, an invalid solution of "selecting multiple parameters at the same time" will occur. The constraints need to be transformed into penalty terms and added to the energy function. That is, the constraint penalties for x and y need to be added to the energy function, and then the energy function is transformed into a standard function. Only in this way can the optimal values ​​of a and b be solved.

[0049] in, right Constraints and penalties: ; right Constraints and penalties: ; in The above penalty coefficient is an empirical value and can be adaptively adjusted according to different face models. The specific implementation of this application does not limit the specific value of the above penalty coefficient.

[0050] Expand the constraint penalty term of x (using the properties of binary variables) ,because ): ; n represents the total number of binary variables corresponding to parameter a.

[0051] therefore, The penalty items can be simplified as follows: ; Similarly, The penalty items are: ; Combining the loss term and the penalty term, the total energy function is:

[0052] because It is a constant (does not affect the optimization result) and can be ignored. The final energy function is: ; The standard form of the QUBO model is: ; Therefore, the total energy function needs to be decomposed into linear terms (single-variable coefficients) and quadratic terms (multiplicative coefficients), corresponding to the elements of the Q matrix.

[0053] Linear terms (diagonal elements): for : coefficient is (from) ); for : coefficient is (from) ); The corresponding diagonal elements of the Q matrix: ; ; Quadratic terms (off-diagonal elements): coefficient is (from) ); coefficient is (from) ); coefficient is (from) ).

[0054] The off-diagonal elements of the corresponding Q matrix: (for , and ); (for , and ); (for and ).

[0055] Therefore, the objective function is transformed into a standard QUBO model, which can then be solved using a quantum annealing algorithm solver to find the dynamic optimal values ​​of a and b.

[0056] For example, the values ​​of a and b in the above technical solution also need to consider the influence of layer difference and the number of layers on the values ​​of a and b. The layer difference represents the difference between the maximum and minimum training layers in the face recognition model, and the number of layers is the total number of layers in the face recognition model. For model training, iterative weights in some training layers are often disabled during training, while other layers participate in the iteration of training samples. For example, in the ResNet50 face recognition model, typically only 3 or 4 layers are trained, such as layers 3, 15, 20, and 50. These layers are commonly referred to as training layers, with a minimum training layer of 3 and a maximum training layer of 50. Specifically, the values ​​of a and b can be adjusted using the coefficient kp, where... Kp1 = 1 - α × (ΔL / L), Kp2 = 1 + α × (ΔL / L); where ΔL is the layer difference, L is the total number of layers, and α is an empirical coefficient, for example, it is usually taken as 0.05. After testing, the value of a needs to be smaller and the value of b needs to be larger. Therefore, Kp1 is the coefficient of the value of a and Kp2 is the coefficient of the value of b; a' = a × Kp1, b' = b × Kp2.

[0057] Step S404: Filter the training samples using the optimal values ​​of a and b to obtain filtered samples, and use the filtered samples to train the face recognition model.

[0058] The specific training methods for the aforementioned face recognition model can employ traditional training methods, such as metric learning, self-supervised / semi-supervised training, etc., which will not be elaborated upon here.

[0059] Step S405: After the current round of training of the face recognition model is completed, in the next round of training, the optimal values ​​of a and b are iterated to perform secondary filtering on the filtered samples to obtain secondary filtered samples. The secondary filtered samples are then used to train the face recognition model.

[0060] The model training method provided in this application iteratively calculates the values ​​of filtering parameters a and b, and constructs a QUBO model using the objective function and existing sample gradient values ​​to dynamically solve for the optimal values ​​of a and b. This allows the model to approach the optimum faster with minimal performance loss. Quantum computing technology is used to solve the QUBO model, resulting in a fast response time for finding the optimal values ​​of a and b. Thus, during model training, the aforementioned filtering parameters can be dynamically solved and iterated according to the actual situation of model training, making the filtering of training samples more accurate and reasonable, reducing model training time, and improving model training accuracy.

[0061] Example 2 This application provides a model training method in Embodiment 2. This embodiment takes face recognition model training as an example. The technical scenario of Embodiment 2 is the same as that of Embodiment 1, and will not be repeated here.

[0062] The method provided in this embodiment 2 differs from that in embodiment 1 only in step S403. That is, the specific implementation of step S403 can be replaced by the following steps. Therefore, other steps will not be described in detail.

[0063] Construct a QUBO model for the face recognition model with values ​​a and b, and use a quantum optimization algorithm to calculate the optimal values ​​a and b of the QUBO model; Define binary variables for parameters a and b as follows: 'a' corresponds to the binary variable , in: Indicates selection , Indicates no choice. And it satisfies the one-hot constraint: (Choose only one) value); b corresponds to the binary variable , in: Indicates selection , This indicates that no choice is made and the one-hot constraint is satisfied.

[0064] Therefore, the objective function is defined as: ; in: It is the first The true label (0 or 1) of each sample, when y k When y = 1, it represents a positive example; when y = 1, it represents a positive example. k =0 indicates a negative example (counterexample).

[0065] Is the model in parameters The predicted probability is as follows. γ is the total number of samples. The cross-entropy loss term for a single sample is represented by... A joint decision.

[0066] The goal is to minimize That is, to search .

[0067] The core of the QUBO model is to transform the optimization objective into an energy function. The format is: ; in, It is a vector of all binary variables. It is a QUBO matrix (size is 1). ), The key to the calculation scheme is to transform the objective function into the energy function E of the QUBO model, that is, to obtain the Q matrix, where the diagonal elements of the Q matrix represent the cost of a single variable; and the off-diagonal elements represent the interaction or constraint between two variables.

[0068] In the QUBO model, the loss term It needs to be represented by binary variables, because and It is a one-hot variable, when and At that time, the loss can be expressed as: ; Therefore, the energy function of the loss term is: ; According to the policy rules, binary variables need to satisfy... and Otherwise, an invalid solution of "selecting multiple parameters at the same time" will occur. The constraints need to be transformed into penalty terms and added to the energy function. That is, the constraint penalties for x and y need to be added to the energy function, and then the energy function is transformed into a standard function. Only in this way can the optimal values ​​of a and b be solved.

[0069] Among them, the constraint penalty for x is limited by the number of layers, and the constraint penalty for y is limited by the layer difference; right Constraints and penalties: ; right Constraints and penalties: ; Where, λ1 = 1 / (L-L) target ) 2 ; Where L is the total number of layers in the face recognition model, L target Let L be the expected number of layers in a face recognition model. Taking a face recognition model as an example, L... target It can be 45, 48, etc.

[0070] λ2 = ΔL / (L-1); Expand the constraint penalty term of x (using the properties of binary variables) ,because ): ; n represents the total number of binary variables corresponding to parameter a.

[0071] therefore, The penalty items can be simplified as follows: ; Similarly, The penalty items are: ; Combining the loss term and the penalty term, the total energy function is:

[0072] because It is a constant (does not affect the optimization result) and can be ignored. The final energy function is:

[0073] The standard form of the QUBO model is: ; Therefore, the total energy function needs to be decomposed into linear terms (single-variable coefficients) and quadratic terms (multiplicative coefficients), corresponding to the elements of the Q matrix.

[0074] Linear terms (diagonal elements): for The coefficient is -1 / (L) L target ) 2 (from) ); for : coefficient is (from) ); The corresponding diagonal elements of the Q matrix: 2 ; ; Quadratic terms (off-diagonal elements): coefficient is (from) ); coefficient is (from) ); coefficient is (from) ).

[0075] The off-diagonal elements of the Q matrix: 2 (for , and ); (for , and ); (for and ).

[0076] The model training method provided in this application iteratively calculates the values ​​of filtering parameters a and b, and dynamically solves for the optimal values ​​of a and b by constructing a QUBO model using the objective function, penalty term, and existing sample gradient values. This allows the model to approach the optimum faster with minimal performance loss. In solving the QUBO model, the impact of the number of model layers and layer difference on the penalty term is considered. Quantum computing technology is used to solve the QUBO model, making the solution for the optimal values ​​of a and b fast. Thus, during model training, the aforementioned filtering parameters can be dynamically solved and iterated based on the actual number of training layers and the training layer difference, making the filtering of training samples more accurate and reasonable, reducing model training time, and improving model training accuracy.

[0077] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a model training device 500 provided in an embodiment of this application, as shown below. Figure 5 As shown, the model training device 500 includes: Acquisition unit 501 is used to acquire samples for model training; An optimization unit 502 is constructed to construct the optimization objective function of the filtering parameters a and b of the sample, and to convert the optimization objective function into the standard form of the QUBO model of the filtering parameters a and b. The iteration unit 503 is used for each iteration of model training. It uses a quantum optimization algorithm to calculate the standard form of the QUBO model to obtain the optimal values ​​of the filtering parameters a and b for each iteration. The training unit 504 uses the optimal value to filter the samples used for training, obtains filtered samples, and performs iterative calculations for model training using the filtered samples.

[0078] Optionally, the aforementioned construction optimization unit 502 is specifically used to construct the optimization objective function for the filtering parameters a and b of the sample, including: The objective function is: ; in: It is the first The true label of each sample; Is the model in parameters The predicted probability is as follows. γ is the total number of samples. a∈0.01×k, where 0≤k≤100; b∈0.01×k, where 0≤k≤100; 'a' corresponds to the binary variable b corresponds to a binary variable .

[0079] Optionally, the aforementioned construction optimization unit 502 is also used to construct the constraint penalty term for the binary variable x of the filter parameter a, and to construct the constraint penalty term for the binary variable y of the filter parameter b. The constraint penalty term for x is: ; The constraint penalty term for y is: ; Where λ1 is the penalty coefficient for x; λ2 is the penalty coefficient for y.

[0080] Optionally, the above-mentioned construction optimization unit 502 is specifically used to add the constraint penalty terms of x and y into the optimization objective function to obtain the total energy function, and to convert the total energy function into the standard form of the QUBO model.

[0081] Optionally, the aforementioned optimization unit 502, specifically used to convert the total energy function into the standard form of the QUBO model, includes: Total energy function E=E loss + E penalty,x + E penalty,y ; in, ; The penalty items are: ; The penalty items are: ; The standard form of the QUBO model is: .

[0082] in, It is a vector of all binary variables; Q is a QUBO matrix, where, The diagonal elements of matrix Q are: ; ; The off-diagonal elements of the Q matrix are: ; ;

[0083] Optionally, the above-mentioned device may further include: an adjustment unit 505, used to adjust the optimal values ​​of the filtering parameters a and b based on the training layer difference and the total number of layers of the model, specifically including: a'=a×Kp1、 b'=b×Kp2; Where Kp1=1-α×(ΔL / L), Kp2=1+α×(ΔL / L) ΔL is the difference between floors, L is the total number of floors, and α is an empirical coefficient.

[0084] The adjustment unit 505 is also used to determine the penalty coefficients λ1 and λ2 based on the training layer difference and the total number of layers; in: λ1 = 1 / (LL) target ) 2 ; λ2 = ΔL / (L-1); ΔL is the difference between floors, L is the total number of floors, L target This represents the desired number of layers in the face recognition model.

[0085] Based on the description of the above method embodiments and related device embodiments, please refer to... Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer provided in an embodiment of this application. Figure 6The computer 600 shown includes a processor 601, a memory 602, a communication interface 603, and a bus 604. The processor 601, memory 602, and communication interface 603 are interconnected via the bus 604.

[0086] Optionally, the memory 602 can be ROM, a static storage device, a dynamic storage device, or RAM.

[0087] Memory 602 can store executable program code. When the executable program code stored in memory 602 is executed by processor 601, processor 601 and communication interface 603 are used for execution. Figure 2 , Figure 4 The various steps of the model training method in the illustrated embodiment.

[0088] The processor 601 employs a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), GPU, or one or more integrated circuits to execute relevant programs to perform the model training method of the method embodiment of this application.

[0089] The processor 601 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the model training method of this application can be completed through the integrated logic circuits in the hardware of the processor 601 or through software instructions. Optionally, the processor 601 can be a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor is a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. Optional software modules are located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 602. The processor 601 reads the information in memory 602 and, in conjunction with its hardware, completes the functions required by the modules included in the model training device 500 of this application embodiment, or executes the model training method of the method embodiment of this application.

[0090] Communication interface 603 uses transceiver-related devices such as, but not limited to, transceivers.

[0091] Bus 604 may include a pathway for transmitting information between various components of computer 600 (e.g., memory 602, processor 601, communication interface 603).

[0092] It should be noted that, although Figure 6 The computer 600 shown only illustrates the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the computer 600 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the computer 600 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the computer 600 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 6 All the devices shown.

[0093] This application provides a computer-readable storage medium storing a computer program for electronic data interchange. The computer program includes execution instructions for performing some or all of the steps of any of the model training methods described in the above-described model training method embodiments. The computer includes an electronic client device.

[0094] This application provides a computer program product, which includes a computer program operable to cause a computer to perform some or all of the steps of any of the model training methods described in the above method embodiments. The computer program product may be a software installation package.

[0095] It should be noted that, for the sake of simplicity, each of the aforementioned model training method embodiments is described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.

[0096] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of a model training method, computer, storage medium, and program product of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas of this application. At the same time, for those skilled in the art, based on the ideas of a model training method, computer, storage medium, and program product of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

[0097] This application is described with reference to flowchart illustrations and / or block diagrams of methods, hardware products, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable model training device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable model training device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable model training device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. Memory may include: flash drives, read-only memory (ROM), random access memory (RAM), hard disks or optical disks, etc.

[0099] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce a good effect.

[0100] Those skilled in the art will understand that all or part of the steps in the various method embodiments of any of the above-described model training methods can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk, or an optical disk, etc.

[0101] It is understood that any product that is controlled or configured to execute the processing method of the flowchart described in an embodiment of a model training method of this application, such as the apparatus and computer program product of the above flowchart, falls within the scope of the related products described in this application.

[0102] Obviously, those skilled in the art can make various modifications and variations to the model training method, computer, storage medium, and program product provided in this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A model training method, characterized in that, The method includes: Obtain samples for model training; Construct the optimization objective function for the filtering parameters a and b of the sample, and transform the optimization objective function into the standard form of the quadratic unconstrained binary optimization QUBO model for the filtering parameters a and b; The optimization objective function for constructing the filtering parameters a and b of the sample specifically includes: The objective function is: ; in: It is the first The true label of each sample; Is the model in parameters The predicted probability is as follows. γ is the total number of samples. a∈0.01×k, where 0≤k≤100; b∈0.01×k, where 0≤k≤100; 'a' corresponds to the binary variable b corresponds to a binary variable ; In each iteration of model training, the standard form of the QUBO model is calculated using a quantum optimization algorithm to obtain the optimal values ​​of the filtering parameters a and b for each iteration. The optimal value is used to train the sample, and the filtered sample is obtained. The filtered sample is then used to perform iterative calculations for model training.

2. The model training method according to claim 1, characterized in that, After constructing the optimization objective function for the filtering parameters a and b of the sample, the method further includes: Construct the constraint penalty term for the binary variable x of filter parameter a, and construct the constraint penalty term for the binary variable y of filter parameter b; The constraint penalty term for x is: ; The constraint penalty term for y is: ; Where λ1 is the penalty coefficient for x; λ2 is the penalty coefficient for y.

3. The model training method according to claim 2, characterized in that, The standard form of converting the optimization objective function into a quadratic unconstrained binary optimization QUBO model with filtering parameters a and b specifically includes: The constraint penalty terms for x and y are added to the optimization objective function to obtain the total energy function, which is then converted into the standard form of the QUBO model.

4. The model training method according to claim 3, characterized in that, The specific steps of converting the total energy function into the standard form of the QUBO model include: Total energy function E=E loss + E penalty,x + E penalty , y ; in, ; The penalty items are: ; The penalty items are: ; The standard form of the QUBO model is: ; in, It is a vector of all binary variables; Q is a QUBO matrix with a size of ,in, The diagonal elements of matrix Q are: ; ; The off-diagonal elements of matrix Q are: ; ; ; T stands for transpose.

5. The model training method according to claim 4, characterized in that, After obtaining the optimal values ​​of the filtering parameters a and b for each iteration, the method further includes: The optimal values ​​of the filtering parameters a and b are adjusted based on the training layer difference and the total number of layers of the model, specifically including: a'=a×Kp1、 b'=b×Kp2; Where Kp1=1-α×(ΔL / L), Kp2=1+α×(ΔL / L) ΔL is the difference between floors, L is the total number of floors, and α is an empirical coefficient.

6. The model training method according to claim 4, characterized in that, The method further includes: The penalty coefficients λ1 and λ2 are determined based on the training layer difference and the total number of layers of the model. in: λ1= 1 / (LL target ) 2 ; λ2 = ΔL / (L-1); ΔL is the difference between floors, L is the total number of floors, L target This represents the desired number of layers in the face recognition model.

7. The model training method according to claim 1, characterized in that, The method further includes: sample filtering using the optimal value to train the sample, specifically including: The filtered samples are obtained by deleting samples that are greater than the filtering parameter a and deleting samples that are less than the filtering parameter b.

8. A computer, characterized in that, include: The memory, the processor, and executable program code stored in the memory and executable on the processor, wherein the processor executes the executable program code to perform the steps of the model training method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores executable program code, the executable program code including execution instructions for performing the steps of the model training method as described in any one of claims 1-7.

10. A computer program product, characterized in that, The computer program product includes a computer program that causes a computer to perform the steps of the model training method as described in any one of claims 1-7.