Model determination method and apparatus and computer readable storage medium

By introducing discriminant sub-models and predictive sub-models into multi-scene models, combined with internal and external loop training methods, the problems of poor results and instability in training in specific application scenarios are solved, and higher accuracy and training stability are achieved.

WO2025066291A1PCT designated stage expired Publication Date: 2025-04-03CHINA UNIONPAY

Patent Information

Application Number
PCT/CN2024/099028
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-28
Filing Date
2024-06-13
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

The existing multi-scene models have poor results when applied to specific application scenarios, and their training is unstable. The fixed external loop learning rate leads to a decline in generalization performance and an increase in training time.

Method used

By obtaining multiple training samples corresponding to M training tasks, using the discriminant sub-model and predictive sub-model in the initial multi-scene model, the data set characteristics and prediction results of the training sample are determined, the sub-model loss function is generated, and the multi-scene model is obtained through internal and external loop training.

Benefits of technology

The accuracy of multi-scene models in multiple application scenarios is improved, training stability is enhanced, and generalization performance and training efficiency are improved by dynamically adjusting the external loop learning rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024099028_03042025_PF_FP_ABST
    Figure CN2024099028_03042025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a model determination method and apparatus and a computer readable storage medium. The method comprises: acquiring a plurality of training samples corresponding to each of M training tasks, M≥2; by means of a discrimination sub-model comprised in an initial multi-scenario model, determining data set features respectively corresponding to the plurality of training samples corresponding to the ith training task, M≥i≥1; according to the plurality of training samples corresponding to the ith training task and the data set features respectively corresponding to the plurality of training samples, by means of a prediction sub-model comprised in the initial multi-scenario model, determining prediction results respectively corresponding to the plurality of training samples corresponding to the ith training task; generating a sub-model loss function corresponding to the ith training task; and, by means of sub-model loss functions respectively corresponding to the M training tasks, performing inner and outer loops of training on the initial multi-scenario model to obtain a multi-scenario model. The described method can improve the accuracy of a multi-scenario model applied to multiple application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Model determination method, device and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on September 28, 2023, with application number CN202311280497.2 and application name “A model determination method, device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of data processing, and specifically to a model determination method, device, and computer-readable storage medium. Background Art

[0004] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0005] Humans have the ability to quickly adapt to new scenarios based on prior knowledge. For example, infants can recognize cats or dogs after only a few encounters, and can learn to run with limited walking practice. In contrast, models typically require a large number of samples to learn to apply to specific application scenarios and lack the corresponding generalization ability.

[0006] In this regard, Model-Agnostic Meta-Learning (MAML) has been proposed in related technologies to make up for the shortcomings of model training requiring a large number of samples and poor generalization ability. Specifically, MAML does not use a large number of samples to improve the model's ability in a specific application scenario, but uses a small number of samples from different data sets to improve the model's ability in a series of application scenarios. For example, compared with a speech recognition model that can only be applied to speech recognition or an image recognition model that can only be applied to image recognition, MAML can be used to obtain a multi-scenario recognition model that can be applied to a series of application scenarios such as speech recognition and image recognition by training with a small number of samples from different data sets.

[0007] Although MAML can be used in related technologies to obtain a multi-scenario model that can be applied to a series of application scenarios, due to the need to ensure the universal initialization of the multi-scenario model when applied to multiple application scenarios, the effect of the multi-scenario model when applied to specific application scenarios will be poor. For example, the accuracy of the multi-scenario recognition model obtained through MAML may not be high when applied to the specific application scenario of speech recognition. That is, the multi-scenario model obtained through MAML will have certain limitations when applied to multiple application scenarios.

[0008] Therefore, how to improve the accuracy of multi-scenario models that can be applied to multiple application scenarios is an urgent problem to be solved.

[0009] Application Contents

[0010] In response to the above-mentioned problems existing in the prior art, a model determination method, device and computer-readable storage medium are proposed. By using this method, device and computer-readable storage medium, the above-mentioned problems can be solved.

[0011] This application provides the following solutions.

[0012] In a first aspect, a model determination method is provided, comprising:

[0013] Obtain multiple training samples corresponding to M training tasks, where M is an integer and M≥2; for an i-th training task among the M training tasks, the multiple training samples corresponding to the i-th training task correspond to multiple training data sets, and the multiple training data sets correspond one-to-one to multiple application scenarios, where i is an integer and M≥i≥1;

[0014] Inputting multiple training samples corresponding to the i-th training task into an initial multi-scenario model, and determining dataset features corresponding to the multiple training samples corresponding to the i-th training task through a discriminant sub-model in the initial multi-scenario model; the dataset features are used to represent the correlation between the corresponding training samples and the multiple training datasets;

[0015] Determining prediction results corresponding to the multiple training samples corresponding to the i-th training task, respectively, by using a prediction sub-model in the initial multi-scenario model, according to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple training samples;

[0016] Generate a sub-model loss function corresponding to the i-th training task based on the difference between the prediction results and the corresponding sample labels of the multiple training samples corresponding to the i-th training task;

[0017] The initial multi-scene model is trained through the inner and outer loops of the sub-model loss functions and outer loop learning rates corresponding to the M training tasks to obtain a multi-scene model.

[0018] Optionally, when the prediction sub-model includes K convolutional layers, where K is an integer and K≥2, determining the prediction results corresponding to the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples respectively, by the prediction sub-model in the initial multi-scenario model, includes:

[0019] For the first convolutional layer of the K convolutional layers, input the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples respectively into the first convolutional layer, and determine the first layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task respectively through the first convolutional layer;

[0020] For the kth convolutional layer among the K convolutional layers, inputting the k-1th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple samples into the kth convolutional layer, and determining the kth layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task through the kth convolutional layer; wherein k is an integer, K ≥ k ≥ 2;

[0021] The K-th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are used as the prediction results corresponding to the multiple training samples corresponding to the i-th training task.

[0022] Optionally, the discriminant sub-model and the predictive sub-model have the same model architecture.

[0023] Optionally, determining the prediction results corresponding to the multiple training samples corresponding to the i-th training task respectively through the prediction sub-model in the initial multi-scenario model based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples respectively includes:

[0024] Inputting the dataset features corresponding to the plurality of training samples into the bidirectional long short-term memory network in the initial multi-scenario model, and determining the memory dataset features corresponding to the plurality of training samples through the bidirectional long short-term memory network; the memory dataset features include a greater amount of information than the corresponding dataset features;

[0025] According to the multiple training samples corresponding to the i-th training task and the memory data set features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined through the prediction sub-model in the initial multi-scene model.

[0026] Optionally, the inner loop and the outer loop of training the initial multi-scenario model using the sub-model loss functions and outer loop learning rates corresponding to the M training tasks respectively to obtain the multi-scenario model include:

[0027] Performing an inner loop of training the initial multi-scenario model using the sub-model loss function corresponding to the i-th training task to obtain a model update parameter corresponding to the i-th training task;

[0028] According to the model update parameters and outer loop learning rates corresponding to the M training tasks, an outer loop of training is performed on the initial multi-scene model to obtain a multi-scene model.

[0029] Optionally, the inner loop of training the initial multi-scenario model using the sub-model loss function corresponding to the i-th training task to obtain the model update parameters corresponding to the i-th training task includes:

[0030] An inner loop of training the initial multi-scenario model is performed using the sub-model loss function corresponding to the i-th training task to obtain a plurality of model update sub-parameters corresponding to the i-th training task; the plurality of model update sub-parameters corresponding to the i-th training task correspond one-to-one to the plurality of training samples corresponding to the i-th training task;

[0031] The outer loop of training the initial multi-scenario model according to the model update parameters and outer loop learning rates corresponding to the M training tasks to obtain the multi-scenario model includes:

[0032] According to the multiple model update sub-parameters and outer loop learning rates corresponding to the M training tasks, the outer loop of training the initial multi-scene model is performed to obtain a multi-scene model.

[0033] Optionally, when performing an inner loop of training the initial multi-scenario model using the sub-model loss function corresponding to the i-th training task, the method further includes:

[0034] Corresponding sample weights are respectively configured for the multiple training samples corresponding to the i-th training task.

[0035] Optionally, configuring corresponding sample weights for the multiple training samples corresponding to the i-th training task respectively includes:

[0036] At the beginning of the inner loop of the training of the initial multi-scenario model, corresponding initial sample weights are respectively configured for the multiple training samples corresponding to the i-th training task; the values ​​of the multiple initial sample weights corresponding to the i-th training task are the same;

[0037] During the inner loop process of training the initial multi-scene model, the weights of multiple initial samples corresponding to the i-th training task are adjusted; wherein, for the starting training sample among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the starting training sample corresponding to the i-th training task is reduced, and for the subsequent training samples among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the subsequent training samples corresponding to the i-th training task is increased.

[0038] Optionally, the method further includes:

[0039] During the outer loop process of training the initial multi-scene model, the outer loop learning rate is annealed; wherein the outer loop learning rate decreases as the outer loop process of training the initial multi-scene model progresses.

[0040] In a second aspect, a model determination device is provided, comprising:

[0041] an acquisition unit, configured to acquire a plurality of training samples corresponding to M training tasks, where M is an integer and M≥2; for an i-th training task among the M training tasks, the plurality of training samples corresponding to the i-th training task respectively have corresponding sample labels, the plurality of training samples corresponding to the i-th training task correspond to a plurality of training data sets, the plurality of training data sets correspond one-to-one to a plurality of application scenarios, and the plurality of application scenarios have the same scenario type, where i is an integer and M≥i≥1;

[0042] A first determining unit is configured to input the plurality of training samples corresponding to the i-th training task into an initial multi-scenario model, and determine, through a discriminant sub-model in the initial multi-scenario model, dataset features corresponding to the plurality of training samples corresponding to the i-th training task, respectively; the dataset features are used to represent the correlation between the corresponding training samples and the plurality of training datasets;

[0043] A second determining unit is configured to determine, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, respectively, using a prediction sub-model in the initial multi-scenario model to determine prediction results corresponding to the multiple training samples corresponding to the i-th training task;

[0044] A generating unit, configured to generate a sub-model loss function corresponding to the i-th training task based on differences between prediction results and corresponding sample labels corresponding to the plurality of training samples corresponding to the i-th training task;

[0045] A first training unit is configured to perform an inner loop of training the initial multi-scenario model using a sub-model loss function corresponding to the i-th training task to obtain a model update parameter corresponding to the i-th training task;

[0046] The second training unit is used to perform an outer loop training on the initial multi-scenario model according to the model update parameters and outer loop learning rates corresponding to the M training tasks, so as to obtain a multi-scenario model, which is applied to the multiple application scenarios.

[0047] In a third aspect, a model determination device is provided, comprising:

[0048] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute: the method as described in the above aspects.

[0049] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor executes the method described in the above aspects.

[0050] One of the advantages of the above embodiment is that in order to obtain a multi-scenario model that can be applied to multiple application scenarios with the same scenario type, multiple training samples corresponding to M training tasks are obtained, where M is an integer, M≥2, and the i-th training task in the M training tasks is used as an example for illustration, where i is an integer, M≥i≥1, and the multiple training samples corresponding to the i-th training task do not come from one training data set, but from multiple training data sets corresponding one-to-one to multiple application scenarios; the multiple training samples corresponding to the i-th training task are input into the initial multi-scenario model for training optimization. The initial multi-scenario model includes a discriminant sub-model and a prediction sub-model. The discriminant sub-model can be used to first determine the data set features corresponding to the multiple training samples corresponding to the i-th training task. The data set features are used to represent the correlation between the corresponding training samples and the multiple training data sets, that is, the data set features can represent the correlation with the corresponding The most relevant training dataset for the training sample is used to determine the application scenario corresponding to the corresponding training sample. Then, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction sub-model is used to determine the prediction results corresponding to the multiple training samples corresponding to the i-th training task. Since the prediction sub-model not only refers to the training samples but also refers to the dataset features that can represent the application scenario corresponding to the training samples in the process of determining the prediction results, the accuracy of the prediction results can be increased to a certain extent. Based on the difference between the prediction results corresponding to the multiple training samples corresponding to the i-th training task and the corresponding sample labels, a sub-model loss function corresponding to the i-th training task can be generated. The initial multi-scenario model is trained through the inner and outer loops using the sub-model loss functions corresponding to the M training tasks and the outer loop learning rate to obtain a multi-scenario model. During the training of the initial multi-scenario model, the initial multi-scenario model, including the discriminant sub-model and the prediction sub-model, can learn how to discriminate the application scenario corresponding to the training sample, so that the obtained multi-scenario model can be better applied to specific application scenarios among multiple application scenarios, thereby improving the accuracy of the multi-scenario model applied to multiple application scenarios.

[0051] Other advantages of the present application will be explained in more detail with reference to the following description and accompanying drawings.

[0052] It should be understood that the above description is only an overview of the technical solution of this application, so that the technical means of this application can be more clearly understood and implemented in accordance with the contents of the description. In order to make the above and other purposes, features and advantages of this application more obvious and easy to understand, the following examples are used to illustrate the specific implementation methods of this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The advantages and benefits described herein, as well as other advantages and benefits, will be apparent to those skilled in the art upon reading the detailed description of the exemplary embodiments below. The accompanying drawings are provided for illustration purposes only and are not to be considered limiting of the present application. The same reference numerals are used throughout the accompanying drawings to denote the same components. In the accompanying drawings:

[0054] FIG1 is a comparison diagram of MAML and pre-training provided in an embodiment of the present application;

[0055] FIG2 is a diagram showing the accuracy of a MAML training provided in an embodiment of the present application;

[0056] FIG3 is a schematic diagram of the structure of a hardware operating environment provided in an embodiment of the present application;

[0057] FIG4 is a flow chart of a model determination method provided in an embodiment of the present application;

[0058] FIG5 is a model structure diagram of an initial multi-scenario model provided in an embodiment of the present application;

[0059] FIG6 is a schematic diagram of multiple data sets provided in an embodiment of the present application;

[0060] FIG7 is a comparison diagram of the accuracy variance of MMAML and MMAML+ provided in an embodiment of the present application;

[0061] FIG8 is a diagram illustrating an application scenario of a model determination method provided in an embodiment of the present application;

[0062] FIG9 is a schematic diagram of a model determination device provided in an embodiment of the present application;

[0063] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION

[0064] The following describes exemplary embodiments of the present application in more detail with reference to the accompanying drawings. Although the accompanying drawings illustrate exemplary embodiments of the present application, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0065] In the description of the embodiments of the present application, it should be understood that terms such as "including" or "having" are intended to indicate the presence of disclosed features, numbers, steps, actions, components, parts, or a combination thereof in the present specification, and do not exclude the possibility of the presence of one or more other features, numbers, steps, actions, components, parts, or a combination thereof.

[0066] Unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. “And / or” in this article is only a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0067] The terms "first," "second," etc., are used solely to distinguish identical or similar technical features for ease of description and should not be construed as indicating or implying the relative importance or quantity of these technical features. Thus, a feature defined by "first," "second," etc., may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, unless otherwise specified, the term "plurality" means two or more than two.

[0068] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0069] The basic training method in related technologies usually uses a loss function to supervise the learning of the model. The corresponding formula is as follows:

[0070] Among them, θ* represents the parameters after training, θ represents the parameters during training, (X, y) represents the training data, X represents the input feature vector, y represents the corresponding label, and L (X,y) represents the loss function, f θ (X, y) represents the corresponding model parameters.

[0071] The model can be trained using the above formula. Specifically, the training data is usually input into the initial model in the form of batches of data points (x, y). Each data point contains an input feature vector x and a corresponding label y. The initial model learns from these training data. The training process optimizes the model parameters based on the input-output relationship observed in the training data, thereby minimizing the loss function L in the formula. (X,y) , this method can be applied to linear regression, support vector machine (SVM) and decision tree, etc.

[0072] Although models in related technologies can be applied to specific application scenarios, compared to humans who can quickly learn new skills based on prior knowledge, models typically require a large number of sample training samples before they can adapt to specific application scenarios and lack the corresponding generalization capabilities. Specific flaws include:

[0073] 1. Data greed: Models typically require large amounts of labeled data for training. This means manually labeling datasets, which can be time-consuming, expensive, and impractical. Furthermore, when applied to new scenarios, new data often needs to be collected and labeled, limiting the model's scope of application and scalability.

[0074] 2. Lack of generalization ability: Models usually perform poorly when applied to new application scenarios. This is because models often learn specific capabilities by adjusting parameters on a large amount of training data. This leads to the model's lack of ability to share knowledge and transfer learning between different application scenarios. In other words, the model is difficult to apply to new application scenarios.

[0075] 3. Slow training and high time cost: For different application scenarios, a large amount of training data is usually required for independent training, and the training time is usually long.

[0076] 4. Lack of flexibility and adaptability: Models are usually static and cannot be dynamically adjusted according to changes in application scenarios. That is, the models lack autonomous learning and adaptive capabilities and require manual parameter adjustment and optimization.

[0077] To address this issue, pre-training has been proposed in related technologies to address data greed, lack of generalization capabilities, slow training, high time costs, and lack of flexibility and adaptability. Pre-training involves initial training on multiple large-scale datasets, followed by fine-tuning on the target application scenario. This involves learning common features across different application scenarios from multiple large-scale datasets to adjust model parameters, and then transferring this knowledge to the target application scenario. Specifically, pre-training can include the following steps:

[0078] 1. Initial training: Initial training can be performed using the following formula:

[0079] Among them, θ represents the parameters in the training process, P represents P large-scale data sets, p represents the p-th large-scale data set in P large-scale data sets, l p (θ) represents the training through the p-th large-scale dataset.

[0080] The above formula can be used to train using P large-scale datasets. For example, training can be performed through self-supervised learning, unsupervised learning, or supervised learning. After the initial training phase, a model parameter that performs well on multiple large-scale datasets will be obtained.

[0081] 2. Fine-tuning: After initial training is complete, the model parameters obtained from initial training are applied to the target application scenario and fine-tuned on the corresponding dataset. The purpose of fine-tuning is to further optimize the model parameters to adapt to the target application scenario based on its specific requirements. The dataset for fine-tuning is typically a smaller dataset related to the target application scenario.

[0082] Inspired by pre-training, meta-learning has been proposed in related technologies to compensate for the shortcomings of model training, which requires a large number of samples and has poor generalization capabilities. Rather than using a large number of samples to improve a model's capabilities in a specific application scenario, meta-learning uses a small number of samples from different datasets to improve the model's capabilities across a range of application scenarios. Meta-learning is also known as learning how to learn. Meta-learning has been widely studied in fields such as few-shot regression, few-shot classification, and fast reinforcement learning. In related technologies, researchers have proposed three main meta-learning paradigms: metric learning, model-based learning, and optimizer learning. Metric learning aims to learn a kernel function that generates prediction probabilities, while model-based learning aims to adjust the model's internal state based on changes in the application scenario. MAML is an optimizer learning paradigm. Inspired by fine-tuning and transfer learning on the IMAGENET dataset, MAML aims to find a global initialization that can quickly and efficiently adapt to new application scenarios. The corresponding formula in MAML is as follows:

[0083] in, represents the parameters after the i-th training, θ i represents the parameters in the i-th training process, T train Represents a series of training tasks, V∈T trainrepresents a dataset from a set of training tasks, Represents the loss function corresponding to the data set, (X, y)∈V represents the training data from the data set, X represents the input feature vector, y represents the corresponding label, Represents the model parameters corresponding to the i-th training.

[0084] MAML differs from the aforementioned basic training methods in both input and output. The input of the basic training method is a series of training data, while the input of MAML is a series of training tasks. The output of the basic training method is to solve application scenarios similar to the training data through specific functions, while the output of MAML is a function with generalization ability to quickly adapt to multiple application scenarios. Among them, the biggest difference between the basic training method and MAML is that the objective function during MAML training is different. If the basic training method is to obtain experts who are good at a certain field, then MAML is to obtain experts who can be applied in multiple fields and have the ability to learn quickly.

[0085] Furthermore, the main difference between MAML and pre-training lies in the loss function. Pre-training results in a model that performs well across multiple application scenarios, while MAML results in a model that performs well across multiple application scenarios, including in new ones. In other words, compared to pre-training, MAML focuses more on whether the resulting model can quickly adapt to new application scenarios. In other words, the model generated by MAML has the ability to learn how to learn.

[0086] As shown in Figure 1, pre-training updates the model parameters once after completing training for multiple training tasks, so that the direction of its gradient change is the same as the first update direction of the training task. However, MAML updates the model parameters after the second gradient descent step, that is, for each training task, the parameters are updated after two steps of gradient descent.

[0087] Specifically, the MAML training process includes the following steps:

[0088] 1. For each training task, use the initial model parameters to perform the first step of gradient descent and calculate the gradient of the loss function with respect to the model parameters.

[0089] 2. Perform the second step of gradient descent based on the gradients calculated for all training tasks to obtain the final model parameters.

[0090] In comparison, pre-training directly updates the model parameters after only one step of gradient descent in each training task.

[0091] MAML chooses to perform two steps of gradient descent before updating model parameters in order to fully utilize the gradient information of the training task to better adapt to new application scenarios. By performing more gradient descent steps, MAML can better capture the gradient direction specific to the training task, thereby achieving faster and more efficient adaptive learning.

[0092] In addition, in order to address the shortcomings of basic training methods, related technologies also provide methods such as transfer learning, reinforcement learning, and continuous learning.

[0093] Although MAML can be used to obtain multi-scenario models that can be applied to a range of application scenarios and has shown excellent results in the fields of few-shot supervised learning and reinforcement learning, it still has the following drawbacks:

[0094] 1. There are limitations when applied to multiple application scenarios: Since the MAML process needs to ensure the universal initialization of the multi-scenario model when applied to multiple application scenarios, the effect of the multi-scenario model when applied to specific application scenarios will be poor. That is, the multi-scenario model obtained through MAML will have certain limitations when applied to multiple application scenarios. For example, the accuracy of the multi-scenario recognition model obtained through MAML may not be high when applied to the specific application scenario of speech recognition.

[0095] 2. Training instability: As shown in Figure 2, MAML requires multiple backpropagation derivative calculations due to its special inner and outer loop design, which may lead to gradient explosion and gradient vanishing problems. In other words, MAML may be very unstable during training.

[0096] 3. Fixed outer loop learning rate: In MAML, related techniques often use a fixed outer loop learning rate for training optimization, such as using the Adam optimizer with a fixed outer loop learning rate. Using a fixed outer loop learning rate can reduce MAML's generalization performance and require more training time to adjust the outer loop learning rate.

[0097] In view of this, embodiments of the present application provide a model determination method, device, and computer-readable storage medium.

[0098] As shown in FIG3 , FIG3 is a structural diagram of a hardware operating environment provided in an embodiment of the present application.

[0099] It should be noted that Figure 3 is a schematic diagram of the structure of the hardware operating environment of the model determination device. The model determination device in the embodiment of the present application can be a terminal device such as a PC, a portable computer, etc.

[0100] As shown in Figure 3, the model determination device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0101] Those skilled in the art will appreciate that the model determination device structure shown in FIG3 does not constitute a limitation on the model determination device, and may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.

[0102] As shown in Figure 3, memory 1005, a computer storage medium, may include an operating system, a network communication module, a user interface module, and a model determination program. The operating system is a program that manages and controls the hardware and software resources of the model determination device and supports the operation of the model determination program and other software or programs.

[0103] In the model determination device shown in FIG3 , the user interface 1003 is primarily used to receive requests, data, etc. sent by the first terminal, the second terminal, and the supervisory terminal; the network interface 1004 is primarily used to connect to the backend server for data communication; and the processor 1001 can be used to call the model determination program stored in the memory 1005 and perform the following operations:

[0104] Obtain multiple training samples corresponding to M training tasks, where M is an integer and M≥2; for the i-th training task among the M training tasks, the multiple training samples corresponding to the i-th training task correspond to multiple training data sets, and the multiple training data sets correspond one-to-one to multiple application scenarios, where i is an integer and M≥i≥1;

[0105] Input multiple training samples corresponding to the i-th training task into the initial multi-scenario model, and determine the dataset features corresponding to the multiple training samples corresponding to the i-th training task through the discriminant sub-model in the initial multi-scenario model; the dataset features are used to represent the correlation between the corresponding training samples and multiple training datasets;

[0106] According to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined by the prediction sub-model in the initial multi-scenario model;

[0107] Generate a sub-model loss function corresponding to the i-th training task based on the difference between the prediction results and the corresponding sample labels of the multiple training samples corresponding to the i-th training task;

[0108] The inner and outer loops of the initial multi-scene model are trained through the sub-model loss functions and outer loop learning rates corresponding to the M training tasks to obtain the multi-scene model.

[0109] Therefore, during the training process of the initial multi-scenario model, the initial multi-scenario model including the discriminant sub-model and the prediction sub-model can learn the knowledge of how to discriminate the application scenarios corresponding to the training samples, so that the obtained multi-scenario model can be better applied to specific application scenarios in multiple application scenarios, thereby improving the accuracy of the multi-scenario model applied to multiple application scenarios.

[0110] Figure 4 is a flow chart illustrating a model determination method according to an embodiment of the present application. In this flow, from a device perspective, the execution entity can be one or more electronic devices, more specifically, the processing modules of these electronic devices; from a program perspective, the execution entity can be the programs installed on these electronic devices. In this embodiment, the execution entity of the model determination method can be the model determination device in the embodiment shown in Figure 3.

[0111] S401. Obtain multiple training samples corresponding to M training tasks, where M is an integer and M≥2.

[0112] In this embodiment, unlike the usual model training method in which only one training task needs to be set, M training tasks need to be set, where M is an integer and M≥2. This is because the training method of this embodiment is based on MAML, which mainly involves two layers of loops, one is an inner loop and the other is an outer loop. The inner loop adapts the update of model parameters according to each specific training task in the M training tasks, that is, it adapts to the specific training tasks; the outer loop performs initialization update of model parameters based on the M training tasks.

[0113] In order to train and optimize the model through M training tasks, multiple training samples corresponding to the M training tasks can be obtained. The training samples refer to the samples used to train and optimize the model. For the convenience of explanation, the following takes any one of the M training tasks, that is, the i-th training task, as an example, where i is an integer and M≥i≥1.

[0114] In order to enable supervised training of the model in subsequent steps, the multiple training samples corresponding to the i-th training task have corresponding sample labels. The sample labels can identify the true values ​​corresponding to the training samples. For example, when the training samples correspond to the application scenario of cat and dog recognition, the sample labels can be used to identify whether the corresponding training samples are cats or dogs.

[0115] In related technologies, when using the MAML method for training optimization, when constructing multiple training samples corresponding to each training task, multiple training data of different categories are selected from a training dataset, that is, each training task targets a training dataset.

[0116] In this embodiment, when constructing the multiple training samples corresponding to the i-th training task, multiple different categories of training data can be selected from multiple training datasets. For example, a 5-way 1-shot model can be selected, where 5-way means determining five categories of training data from five training datasets, and 1-shot means determining one training sample from each category of training data. That is, for a single training task, the number of samples involved is five, and these five samples come from five training datasets. In other words, the multiple training samples corresponding to the i-th training task correspond to multiple training datasets, rather than just one training dataset.

[0117] A training dataset is a collection of multiple training data sets that match application scenarios. That is, each training dataset contains training data that matches its corresponding application scenario. For example, if the application scenario is cat and dog recognition, the corresponding training dataset may include multiple cat images and multiple dog images. To enable training and optimization of the model across multiple application scenarios, the multiple training datasets involved in this embodiment correspond one-to-one to multiple application scenarios.

[0118] Since multiple training data sets correspond one-to-one to multiple application scenarios, compared with MAML where each training task corresponds to one application scenario, each training task of the training method in this embodiment can correspond to multiple application scenarios.

[0119] It should be noted that in order to enable the model to be applied to multiple application scenarios after training, multiple application scenarios have the same scene type. The scene type refers to the type of application scenario, which can include recognition, regression, etc. For example, when the scene type is recognition, multiple application scenarios can include cat and dog recognition, face recognition, etc.

[0120] In addition, in this embodiment, in order to verify the performance of the obtained model in subsequent steps, corresponding query samples can be obtained. Query samples refer to samples used to verify the performance of the model. In order to accurately verify the generalization ability of the model, the query samples and training samples are not the same.

[0121] S402. Input multiple training samples corresponding to the i-th training task into the initial multi-scene model, and determine the data set features corresponding to the multiple training samples corresponding to the i-th training task through the discriminant sub-model in the initial multi-scene model.

[0122] A multi-scenario model refers to a model that can be applied to multiple application scenarios. Compared with ordinary models that can only be applied to a single application scenario, a multi-scenario model can be applied to multiple different application scenarios.

[0123] The initial multi-scenario model refers to an initial model that can be used to train training samples to obtain a multi-scenario model, that is, a multi-scenario model for which model training has not been completed.

[0124] Because in the related art, in order to ensure the universal initialization of the multi-scenario model when applied to multiple application scenarios, the obtained multi-scenario model will have a poor effect when applied to a specific application scenario.

[0125] Therefore, in this embodiment, in order to improve the accuracy of the multi-scenario model, the initial multi-scenario model may include a discriminant sub-model in addition to the prediction sub-model, wherein the discriminant sub-model is used to determine the application scenario corresponding to the training sample, and the prediction sub-model is used to determine the prediction result corresponding to the training sample.

[0126] Specifically, after inputting multiple training samples corresponding to the i-th training task into the initial multi-scenario model, the discriminant sub-model in the initial multi-scenario model can first determine the dataset features corresponding to the multiple training samples corresponding to the i-th training task. The dataset features are used to represent the correlation between the corresponding training samples and multiple training datasets, that is, the dataset features can represent the training dataset that is most relevant to the corresponding training sample, so that it can be determined that the corresponding training sample comes from the most relevant training dataset, and then the application scenario corresponding to the most relevant training dataset can be determined as the application scenario corresponding to the training sample. For example, when training sample A comes from the training dataset corresponding to the application scenario of cat and dog recognition, the discriminant sub-model in the initial multi-scenario model can first determine the dataset feature A corresponding to training sample A. The dataset feature A can indicate that the corresponding training sample A comes from the training dataset corresponding to the application scenario of cat and dog recognition. That is to say, in the process of training the initial multi-scenario model, for training samples from multiple training datasets, the initial multi-scenario model will discriminate the relationship between the training sample and these multiple training data through the discriminant sub-model, and the obtained dataset features are strongly correlated with the corresponding application scenarios.

[0127] S403. According to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined by the prediction sub-model in the initial multi-scenario model.

[0128] The prediction result refers to the corresponding result obtained through prediction after the training sample is input into the model. For example, when training sample A comes from the training data set corresponding to the application scenario of cat and dog identification, the corresponding prediction result of training sample A can be that there is a 0.8 probability that it is a cat.

[0129] After determining the dataset features corresponding to the multiple training samples corresponding to the i-th training task in S402, the prediction results corresponding to the multiple training samples corresponding to the i-th training task can be determined by the prediction sub-model based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples. For example, when training sample A comes from the training dataset corresponding to the application scenario of cat and dog identification, compared with directly obtaining the prediction result of training sample A, the initial multi-scenario model can obtain the corresponding prediction result based on training sample A and the dataset features corresponding to training sample A through the prediction sub-model. Since the prediction sub-model not only refers to the training samples in the process of determining the prediction result, but also refers to the dataset features that can represent the application scenario corresponding to the training samples, it can increase the accuracy of the prediction result to a certain extent. In other words, the dataset features obtained by the discriminant sub-model can modify the prediction sub-model, so that the prediction sub-model can adapt to different application scenarios.

[0130] In one possible implementation, when the prediction sub-model includes K convolutional layers, where K is an integer and K≥2, S403 determines, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task, respectively, by the prediction sub-model in the initial multi-scenario model, including:

[0131] For the first convolution layer among the K convolution layers, multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples are input into the first convolution layer, and the first layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are determined through the first convolution layer;

[0132] For the kth convolutional layer among the K convolutional layers, the k-1th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple samples are input into the kth convolutional layer, and the kth layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are determined through the kth convolutional layer; where k is an integer, K ≥ k ≥ 2;

[0133] The K-th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are used as the prediction results corresponding to the multiple training samples corresponding to the i-th training task.

[0134] In the actual use of this embodiment, the prediction sub-model may include K convolutional layers, where K is an integer and K≥2. At this time, in order to obtain accurate prediction results, the data set features can be used as partial input of each of the K convolutional layers, that is, the data set features are not only used as simple input items of the prediction sub-model, but are also used to adjust each convolutional layer in the prediction sub-model.

[0135] Exemplarily, as shown in Figure 5, when the prediction sub-model includes four convolutional layers, wherein the channel size of each convolutional layer is 32, 64, 128 and 256 respectively, the convolution kernel size of each convolutional layer is 3, the stride is 3, and valid padding is used, and each convolutional layer is followed by batch normalization and rectified linear unit (ReLU) activation layer. After the dataset features are obtained through the discriminant sub-model, the dataset features can be in the form of feature vectors, and the dataset features can be converted into four different dimensions through four linear fully connected layers, that is, converted into the form of embedded vectors, and then the sigmoid function is taken for the dataset features of each dimension and multiplied by each convolutional layer in the prediction sub-model to complete the adjustment of each convolutional layer in the prediction sub-model.

[0136] By using the dataset features as the input of each convolutional layer included in the prediction sub-model, each convolutional layer included in the prediction sub-model can be adjusted, thereby better improving the accuracy of the multi-scene model.

[0137] In one possible implementation, the discriminant sub-model and the predictive sub-model have the same model architecture.

[0138] In the actual application process of this embodiment, in order to reduce the amount of calculation, the discriminant sub-model and the prediction sub-model can be directly made to have the same model architecture. As shown in Figure 5, the discriminant sub-model can also adopt a multi-layer convolutional neural network architecture, that is, the discriminant sub-model can also include four convolutional layers, wherein the channel size of each convolutional layer can also be 32, 64, 128 and 256 respectively, the convolution kernel size of each convolutional layer can also be 3, the stride can also be 3, and effective padding is also used. Each convolutional layer is also followed by batch normalization and rectified linear unit activation layers. After the four convolutional layers of the discriminant sub-model, a 256-dimensional data set feature can be obtained by average pooling.

[0139] In one possible implementation, in S403, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined by the prediction sub-model in the initial multi-scenario model, including:

[0140] Inputting the dataset features corresponding to the multiple training samples into the bidirectional long short-term memory network in the initial multi-scenario model, and determining the memory dataset features corresponding to the multiple training samples through the bidirectional long short-term memory network; the amount of information included in the memory dataset features is greater than the amount of information included in the corresponding dataset features;

[0141] According to the multiple training samples corresponding to the i-th training task and the memory data set features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined through the prediction sub-model in the initial multi-scenario model.

[0142] Based on the dataset features corresponding to the multiple training samples corresponding to the i-th training task obtained through the initial discriminant sub-model, as shown in Figure 5, the dataset features corresponding to the multiple training samples corresponding to the i-th training task can be input into the bidirectional long short-term memory network in the initial multi-scenario model. The bidirectional long short-term memory (LSTM) network is an artificial recurrent neural network (RNN). The LSTM network can take a feature vector as input, wherein the hidden layer size can be 128. Through the bidirectional long short-term memory network, the memory dataset features corresponding to the multiple training samples corresponding to the i-th training task can be determined, wherein the amount of information included in the memory dataset features is greater than the amount of information included in the corresponding dataset features. That is to say, the memory of the dataset features is enhanced through the LSTM network, and the corresponding memory dataset features are obtained.

[0143] On the basis of obtaining the memory data set features corresponding to the multiple training samples corresponding to the i-th training task, the prediction results corresponding to the multiple training samples corresponding to the i-th training task can be determined through the prediction sub-model in the initial multi-scenario model according to the multiple training samples corresponding to the i-th training task and the memory data set features corresponding to the multiple training samples.

[0144] By adding the LSTM network as a memory layer, the multi-scenario model's ability to handle complex application scenarios is further enhanced, allowing it to better leverage previously learned knowledge when handling new application scenarios. Corresponding experimental results also demonstrate that in complex application scenarios, such as when processing five application scenarios simultaneously, the addition of LSTM can further improve the accuracy of the multi-scenario model in specific application scenarios, further enhancing the performance of the initial multi-scenario model.

[0145] S404: Generate a sub-model loss function corresponding to the i-th training task based on the differences between the prediction results and the corresponding sample labels of the multiple training samples corresponding to the i-th training task.

[0146] Since the prediction result refers to the corresponding result obtained through prediction after the training sample is input into the model, and the sample label refers to the label that can identify the true value corresponding to the training sample, for the i-th training task, based on the difference between the prediction results and the corresponding sample labels corresponding to the multiple training samples corresponding to the i-th training task, the sub-model loss function corresponding to the i-th training task can be generated. The sub-model loss function corresponding to the i-th training task can represent the model training optimization direction corresponding to the i-th training task.

[0147] S405. The inner and outer loops of the initial multi-scenario model are trained using the sub-model loss functions and outer loop learning rates corresponding to the M training tasks to obtain a multi-scenario model.

[0148] After obtaining the sub-model loss functions corresponding to the M training tasks through S404, since the sub-model loss functions corresponding to the M training tasks can represent the model training optimization directions corresponding to the M training tasks respectively, the initial multi-scenario model can be trained according to the sub-model loss functions corresponding to the M training tasks and the outer loop learning rate, that is, the inner loop and outer loop of the initial multi-scenario model are trained to obtain a multi-scenario model, which can be applied to multiple application scenarios.

[0149] In one possible implementation, in S405, the initial multi-scenario model is trained through the inner and outer loops using the sub-model loss functions and outer loop learning rates corresponding to the M training tasks, thereby obtaining the multi-scenario model, including:

[0150] Through the sub-model loss function corresponding to the i-th training task, the inner loop of training the initial multi-scene model is performed to obtain the model update parameters corresponding to the i-th training task;

[0151] According to the model update parameters and outer loop learning rates corresponding to the M training tasks, the outer loop of the initial multi-scene model is trained to obtain the multi-scene model.

[0152] Since the sub-model loss function corresponding to the i-th training task can represent the model training optimization direction corresponding to the i-th training task, the initial multi-scene model can be trained according to the sub-model loss function corresponding to the i-th training task, that is, the inner loop of training the initial multi-scene model is performed to complete the update of the initial multi-scene model by multiple training samples corresponding to the i-th training task, thereby obtaining the model update parameters corresponding to the i-th training task.

[0153] The model update parameters corresponding to the M training tasks can be obtained based on the sub-model loss functions corresponding to the M training tasks. After obtaining the model parameters corresponding to the M training tasks, in order to obtain an initial scenario model that can be applied to multiple application scenarios, the initial multi-scenario model can be trained in an outer loop based on the model update parameters corresponding to the M training tasks and the outer loop learning rate to obtain a multi-scenario model. For example, the outer loop of training can be completed by the following formula:

[0154] Among them, θ represents the parameter, β represents the outer loop learning rate, represents gradient descent, p(T) represents M training tasks, T i represents the i-th training task, represents the sub-model loss function corresponding to the i-th training task, Represents the model update parameters corresponding to the i-th training task.

[0155] Through the above formula, the model update parameters corresponding to the i-th training task can be obtained through one-step gradient descent. After obtaining the model update parameters corresponding to the M training tasks, the model update parameters corresponding to the M training tasks can be subjected to two-step gradient descent. The model parameters can be converged through the outer loop learning rate to obtain the corresponding multi-scenario model.

[0156] Since the initial multi-scenario model, including the discriminant sub-model and the prediction sub-model, can learn how to discriminate the application scenarios corresponding to the training samples during the training process, the obtained multi-scenario model can be better applied to specific application scenarios in multiple application scenarios, thereby improving the accuracy of the multi-scenario model applied to multiple application scenarios.

[0157] In one possible implementation, the initial multi-scenario model is trained in an inner loop using the sub-model loss function corresponding to the i-th training task to obtain the model update parameters corresponding to the i-th training task, including:

[0158] The initial multi-scenario model is trained in an inner loop using the sub-model loss function corresponding to the i-th training task to obtain multiple model update sub-parameters corresponding to the i-th training task; the multiple model update sub-parameters corresponding to the i-th training task correspond one-to-one to the multiple training samples corresponding to the i-th training task;

[0159] According to the model update parameters and outer loop learning rates corresponding to the M training tasks, the outer loop of the training of the initial multi-scenario model is performed to obtain a multi-scenario model, including:

[0160] According to the multiple models corresponding to the M training tasks, the sub-parameters and the outer loop learning rate are updated, and the outer loop of the initial multi-scene model is trained to obtain the multi-scene model.

[0161] Due to its special inner and outer loop design, MAML requires multiple back-propagation derivative calculations, which may lead to gradient explosion and gradient vanishing problems. That is, MAML may be very unstable during training.

[0162] In this regard, in the inner loop process of training the initial multi-scenario model using the sub-model loss function corresponding to the i-th training task, compared to only obtaining the model update parameters corresponding to the i-th training task, where the model update parameters corresponding to the i-th training task correspond to the last training sample among the multiple training samples corresponding to the i-th training task, in this embodiment, multiple model update sub-parameters corresponding to the i-th training task can be obtained, where the multiple model update sub-parameters corresponding to the i-th training task correspond one-to-one to the multiple training samples corresponding to the i-th training task. That is, in this embodiment, the model update sub-parameters updated for each step corresponding to the i-th training task can be obtained to calculate the sub-loss of each step, rather than only obtaining the loss of the last step corresponding to the i-th training task.

[0163] After obtaining multiple model update sub-parameters corresponding to the M training tasks, the outer loop of training the initial multi-scene model can be performed according to the multiple model update sub-parameters and outer loop learning rate corresponding to the M training tasks, so that in the process of the outer loop of model training, the training process of the initial multi-scene model can be smoothed through multi-step loss to avoid training instability.

[0164] In one possible implementation, during the inner loop of training the initial multi-scenario model using the sub-model loss function corresponding to the i-th training task, the method further includes:

[0165] Configure corresponding sample weights for multiple training samples corresponding to the i-th training task.

[0166] When the inner loop of the initial multi-scene model is trained through the sub-model loss function corresponding to the i-th training task, in order to control the impact of each training sample on the training optimization of the initial multi-scene model, taking the i-th training task as an example, the corresponding sample weights can be configured for the multiple training samples corresponding to the i-th training task, as shown in the following formula:

[0167] Among them, θ represents the parameter, β represents the outer loop learning rate, represents gradient descent, p(T)

[0168] represents M training tasks, T i represents the i-th training task, N represents the N training samples corresponding to the i-th training task, j represents the j-th training sample in the N training samples corresponding to the i-th training task, v j represents the sample weight corresponding to the jth training sample among the N training samples corresponding to the i-th training task, represents the sub-model loss function corresponding to the i-th training task, Represents the model update sub-parameter corresponding to the j-th training sample corresponding to the i-th training task.

[0169] It should be noted that the higher the sample weight, the more important the corresponding training sample is in the training process, and the lower the sample weight, the less important the corresponding training sample is in the training process. For example, in order to reduce the amount of calculation, the same sample weight can be configured for multiple training samples corresponding to the i-th training task.

[0170] In a possible implementation, corresponding sample weights are configured for each of the multiple training samples corresponding to the i-th training task, including:

[0171] At the beginning of the inner loop of the training of the initial multi-scenario model, corresponding initial sample weights are configured for the multiple training samples corresponding to the i-th training task; the values ​​of the multiple initial sample weights corresponding to the i-th training task are the same;

[0172] During the inner loop of training the initial multi-scenario model, the weights of multiple initial samples corresponding to the i-th training task are adjusted; wherein, for the starting training sample among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the starting training sample corresponding to the i-th training task is reduced, and for the subsequent training samples among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the subsequent training samples corresponding to the i-th training task is increased.

[0173] In this embodiment, for the i-th training task, the weights of multiple samples corresponding to the i-th training task can be changed along with the training process. Specifically, at the beginning of the inner loop of the training of the initial multi-scene model, corresponding initial sample weights can be configured for the multiple training samples corresponding to the i-th training task. At this time, it can be assumed that the multiple training samples corresponding to the i-th training task have equal contributions to the final update, that is, the values ​​of the multiple initial sample weights corresponding to the i-th training task are the same. During the inner loop of the training of the initial multi-scene model, as the number of iterations increases, the subsequent steps of the inner loop become more important, while the starting steps are less important. Therefore, the weights of multiple initial samples corresponding to the i-th training task can be adjusted. Among them, for the starting training sample among the multiple training samples corresponding to the i-th training task, the starting training sample refers to the training sample corresponding to the starting step of the inner loop. The initial sample weight corresponding to the starting training sample corresponding to the i-th training task can be reduced, that is, the influence of the starting step of the inner loop is reduced. For the subsequent training samples among the multiple training samples corresponding to the i-th training task, the subsequent training samples refer to the training samples corresponding to the subsequent steps of the inner loop. The initial sample weight corresponding to the subsequent training samples corresponding to the i-th training task is increased, that is, the influence of the subsequent steps of the inner loop is increased.

[0174] Since the loss function is calculated more accurately later in the training optimization process, the sample weights can be adjusted during the training process to allow the inner loop to converge to a relatively lower loss, thereby obtaining a set of model update parameters that perform well on the corresponding training task.

[0175] In one possible implementation, during the outer loop process of training the initial multi-scene model, the outer loop learning rate is annealed; wherein the outer loop learning rate decreases as the outer loop process of training the initial multi-scene model progresses.

[0176] In MAML, related techniques often use a fixed outer-loop learning rate for training optimization, such as using the Adam optimizer with a fixed outer-loop learning rate. Using a fixed outer-loop learning rate can reduce MAML's generalization performance and require more training time to adjust the outer-loop learning rate.

[0177] In this regard, in this embodiment, a fixed outer loop learning rate is not adopted. Instead, the outer loop learning rate is annealed during the outer loop process of training the initial multi-scene model. For example, the outer loop learning rate can be annealed through a learning rate scheduler such as a cosine annealing scheduler, so that the outer loop learning rate becomes smaller as the outer loop process of training the initial multi-model is completed, thereby improving the generalization performance of the obtained multi-scene model and reducing the training time.

[0178] It can be seen that in order to obtain a multi-scenario model that can be applied to multiple application scenarios with the same scenario type, multiple training samples corresponding to M training tasks are obtained, where M is an integer, M≥2, and the i-th training task in the M training tasks is taken as an example for explanation, where i is an integer, M≥i≥1, and the multiple training samples corresponding to the i-th training task do not come from one training data set, but from multiple training data sets corresponding to multiple application scenarios one by one; the multiple training samples corresponding to the i-th training task are input into the initial multi-scenario model for training optimization. The initial multi-scenario model includes a discriminant sub-model and a prediction sub-model. The discriminant sub-model can be used to first determine the data set features corresponding to the multiple training samples corresponding to the i-th training task. The data set features are used to represent the correlation between the corresponding training samples and the multiple training data sets, that is, the data set features can represent the correlation with the corresponding training samples. The most relevant training dataset is used to determine the application scenario corresponding to the corresponding training sample. Then, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction sub-model is used to determine the prediction results corresponding to the multiple training samples corresponding to the i-th training task. Since the prediction sub-model not only refers to the training samples but also refers to the dataset features that can represent the application scenario corresponding to the training samples in the process of determining the prediction results, the accuracy of the prediction results can be increased to a certain extent. Based on the difference between the prediction results corresponding to the multiple training samples corresponding to the i-th training task and the corresponding sample labels, the sub-model loss function corresponding to the i-th training task can be generated. The initial multi-scenario model is trained through the inner and outer loops using the sub-model loss functions corresponding to the M training tasks and the outer loop learning rate to obtain a multi-scenario model. During the training process of the initial multi-scenario model, the initial multi-scenario model, including the discriminant sub-model and the prediction sub-model, can learn how to discriminate the application scenario corresponding to the training samples, thereby enabling the obtained multi-scenario model to be better applied to specific application scenarios among multiple application scenarios, thereby improving the accuracy of the multi-scenario model applied to multiple application scenarios.

[0179] The multi-scene model obtained in this application will be verified by an experimental dataset. The dataset used in the experimental dataset may include multiple datasets, as shown in Figure 6. (a) in Figure 6 represents the OMNIGLOT dataset, which mainly includes images corresponding to handwritten characters, (b) in Figure 6 represents the MINI-IMAGENET dataset, which mainly includes images corresponding to common objects, (c) in Figure 6 represents the FC100 dataset, which mainly includes images corresponding to common objects, (d) in Figure 6 represents the CUB dataset, which mainly includes images corresponding to birds, and (e) in Figure 6 represents the AIRCRAFT dataset, which mainly includes images corresponding to airplanes. Based on multiple datasets, experimental verification can be performed on the fusion of multiple datasets, such as mixing two datasets and mixing three datasets. The fusion method of the dataset can be shown in Table 1:

[0180] Table 1 Dataset fusion method table

[0181] Since the training method of this application is an improvement based on MAML, by adding a discriminant sub-model to the initial multi-scenario model, the multi-scenario model has the ability to train across training data sets in one training task, which expands the accuracy of MAML in multiple application scenarios and improves the ability of MAML in multi-model applications. To this end, the meta-learning training method in this application can be represented by the multi-mode model-agnostic meta-learning algorithm (MMAML). By comparing the accuracy of MAML and MMAML on multiple data sets, the accuracy of MMAML in multiple application scenarios can be verified. The corresponding verification data are shown in Tables 2 and 3:

[0182] Table 2 Evaluation process accuracy of MAML and MMAML under multiple datasets

[0183] Table 3 Statistics and assumed values ​​of MAML and MMAML under multiple data sets

[0184] As shown in Table 2, MMAML's evaluation process accuracy is higher than MAML's for multiple datasets, and the difference in evaluation process accuracy between MMAML and MAML increases with the number of datasets. As shown in Table 3, assuming that MAML has no accuracy improvement and the opposite hypothesis that the training method of this application does improve accuracy, the statistical values ​​obtained clearly reject the null hypothesis, thus proving that MAML and MMAML have significant differences, indicating that the training method of this application can significantly improve MAML's accuracy.

[0185] The MAML in the related art has the defect of unstable training. In the scheme of this application, an improvement is made to this problem, that is, by obtaining the multi-step loss of the inner loop to improve the stability of the model during training. The relevant training method can be represented by MMAML+. Through experiments, it is found that MMAML+ is significantly better than MMAML in training stability, especially in the training scenario of multiple data sets. As shown in Figure 7, Figure 7 (a) refers to the data corresponding to the mixture of two data sets, Figure 7 (b) refers to the data corresponding to the mixture of three data sets, Figure 7 (c) refers to the data corresponding to the mixture of four data sets, and Figure 7 (d) refers to the data corresponding to the mixture of five data sets. By comparing the accuracy variance during the training process, it can be Analysis shows that the change in accuracy variance corresponding to MMAML+ is smaller than that of MMAML, that is, MMAML+ training is more stable. In addition, the experimental results are analyzed, and the relevant data are shown in Table 4. By quantitatively comparing the accuracy variance, it can be found that the accuracy variance of MMAML+ is smaller. The obtained experimental data are interpreted using Wilcoxon comparison. The null hypothesis is set to be that MMAML+ has no improvement in stability. The opposite hypothesis is that the MMAML+ method does improve training stability. According to the obtained assumed value, the null hypothesis can be rejected with certainty, thus proving that there is a significant difference between MMAML+ and MMAML, that is, MMAML+ can significantly improve training stability.

[0186] Table 4. Data related to MMAML+ training stability

[0187] The training method of the present application is an improvement on MAML and has the advantages of MAML, that is, the training method of the present application has the ability to learn with a small number of samples, good generalization ability and the ability to learn quickly. In the actual application of the model, many application scenarios cannot find a training set of sufficient size during training. The present application uses a meta-learning training method to enable the model to learn quickly from a small number of samples. After learning a task, the basic training method can often only perform well in a specific application scenario and is difficult to generalize to other application scenarios. The present application performs meta-training on multiple related application scenarios, so that the model can be better generalized to new application scenarios, thereby improving the generalization ability of the model.

[0188] As an improvement on MAML, the training method of this application also has another advantage of MAML, namely model independence, or in other words, no perception of the model, that is, the training method of this application is theoretically applicable to various types of models, such as neural networks, support vector machines, etc. In addition, since MAML has also demonstrated excellent performance in many fields, including few-sample regression, few-sample classification, and rapid reinforcement learning, etc. In the field of few-sample regression, the training method of this application can be applied to the scenario of marketing activity configuration optimization, for example, according to the multi-dimensional rule elements of the activity configuration, including: basic rules, transaction methods, merchant rules, user rules, display rules, etc., to predict the expected effect of this marketing activity, such as: budget execution rate, ticket collection / verification rate, marketing leverage ratio (one-yuan discount drives transaction volume), etc. This helps operators and event organizers to appropriately adjust factors such as the form of the activity and the audience. In the field of few-sample classification, the training method of this application can be applied to traditional image classification and typical natural language processing (NLP) tasks. The training method provided in this application can also be implemented in the merchant chain model optimization project. Through the training of multiple subtasks (named entity recognition, name similarity calculation), a better initialization parameter can be obtained.

[0189] The model determination method of the present application is described below based on an embodiment of an application scenario.

[0190] Marketing campaigns rely heavily on configuration. Faced with a complex set of configuration elements, reviewing and adjusting marketing campaigns, as well as designing new ones, can often be challenging. If the effectiveness of campaigns could be directly predicted based on these configuration elements, configuration efficiency and marketing effectiveness could be greatly improved. However, there are currently many different campaigns, but limited training sample data. The model determination method proposed in this application is well-suited for this scenario.

[0191] The specific implementation process and the parameter updates and data flows involved are shown in Figure 8 and Table 5. As shown in Figure 8, the model determination method of the present application can be applied to the optimization of marketing activities, wherein the key steps are the creation of the data set and the training of the model.

[0192] Dataset Creation: Following the few-shot learning paradigm, the collected raw data can be divided into a series of training tasks based on activity type. For example, one training task contains information on five activities: Activity 1, Activity 2, Activity 3, Activity 4, and Activity 5. These five activities fall into the categories of coupons, instant discounts, precision marketing, Cloud QuickPass red envelopes, and cashback points. The configuration elements of these five activities vary significantly, but they can be evaluated using a standardized evaluation system, such as the utilization rate of activity funds, marketing leverage, monthly active users, and monthly active transactions. Each task is a combination of different activity categories. After the data is divided by task, it undergoes data format conversion, known as preprocessing, before being input into the initial multi-scenario model training. Since the activity configuration elements include both text and numbers such as time, they can be treated as text information and truncated and supplemented. The text is then converted to a one-dimensional vector, and then the one-dimensional vector is converted to a three-dimensional vector to serve as the input to the initial multi-scenario model.

[0193] The model training phase is divided into two parts: an inner and outer loop. The inner loop updates model parameters for a specific training task only. Training in the inner loop only requires five training data points at a time, demonstrating the advantages of few-shot learning. The outer loop, on the other hand, integrates all training tasks to derive cross-task model parameters. Since the original intention of training is to enable the model to quickly adapt to new application scenarios, the model parameters obtained through this method can converge quickly and be applied to predictions in completely new application scenarios.

[0194] Table 5 Internal and external loop data flow table

[0195] The model determination method of the present application allows for great flexibility in model selection. By focusing on optimizing the training process (inner and outer loops) itself, rather than the model, model non-awareness can be achieved. Since the amount of training data required is not large, it also provides convenience for lightweight applications such as marketing activity configuration optimization scenarios. Traditional small sample learning is extremely unstable throughout the training process because the amount of data used in the inner loop is very small. By adding multi-step loss optimization, the training of the inner loop is well smoothed, thereby improving the overall training stability and making the model converge more quickly. In addition, the types of activities in actual application scenarios are varied, and their configuration parameters vary greatly. The discriminant sub-model added in this proposal can well identify different categories of activities, so that the model has higher accuracy when facing specific activities. At the same time, it also has good generalization capabilities, which is convenient for adapting to new forms of activities in the future.

[0196] In the description of this specification, the description with reference to the terms "some possible embodiments", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application, and the above terms do not necessarily represent the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0197] About the method flow chart of the present application embodiment, some operations are described as the different steps performed in a certain order.Such flow chart belongs to illustrative and non-restrictive.Some steps described in this article can be grouped together and performed in a single operation, or some steps can be divided into multiple sub-steps and can be performed in an order different from that shown in this article.The various steps shown in the flow chart can be realized in any way by any circuit structure and / or tangible mechanism (for example, by the software, hardware (for example, the logical function realized by processor or chip) etc. running on computer equipment and / or its any combination).

[0198] Those skilled in the art will understand that, in the method described in the above specific embodiments, the writing order of each step does not mean a strict execution order, and the specific execution order of each step should be determined by its function and possible internal logic.

[0199] The following describes a model determination device provided by the present application based on an embodiment of the device. As shown in FIG9 , the model determination device 900 includes an acquisition unit 901 , a first determination unit 902 , a second determination unit 903 , a generation unit 904 , and a training unit 905 :

[0200] An acquisition unit 901 is configured to acquire a plurality of training samples corresponding to M training tasks, where M is an integer and M≥2; for an i-th training task among the M training tasks, the plurality of training samples corresponding to the i-th training task correspond to a plurality of training data sets, and the plurality of training data sets correspond one-to-one to a plurality of application scenarios, where i is an integer and M≥i≥1;

[0201] A first determining unit 902 is configured to input multiple training samples corresponding to the i-th training task into the initial multi-scenario model, and determine, using the discriminant sub-model in the initial multi-scenario model, dataset features corresponding to the multiple training samples corresponding to the i-th training task; the dataset features are used to represent the correlation between the corresponding training samples and the multiple training datasets;

[0202] The second determining unit 903 is configured to determine, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task respectively using the prediction sub-model in the initial multi-scenario model;

[0203] A generating unit 904 is configured to generate a sub-model loss function corresponding to the i-th training task based on differences between prediction results and sample labels corresponding to the plurality of training samples corresponding to the i-th training task;

[0204] The training unit 905 is used to train the initial multi-scene model through the inner loop and outer loop using the sub-model loss functions and outer loop learning rates corresponding to the M training tasks, thereby obtaining the multi-scene model.

[0205] In a possible implementation, the second determining unit 903 is configured to:

[0206] When the prediction sub-model includes K convolutional layers, where K is an integer and K≥2, for the first convolutional layer of the K convolutional layers, multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples are input into the first convolutional layer, and the first layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are determined through the first convolutional layer;

[0207] For the kth convolutional layer among the K convolutional layers, the k-1th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple samples are input into the kth convolutional layer, and the kth layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are determined through the kth convolutional layer; where k is an integer, K ≥ k ≥ 2;

[0208] The K-th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are used as the prediction results corresponding to the multiple training samples corresponding to the i-th training task.

[0209] In one possible implementation, the discriminant sub-model and the predictive sub-model have the same model architecture.

[0210] In a possible implementation, the second determining unit 903 is configured to:

[0211] Inputting the dataset features corresponding to the multiple training samples into the bidirectional long short-term memory network in the initial multi-scenario model, and determining the memory dataset features corresponding to the multiple training samples through the bidirectional long short-term memory network; the amount of information included in the memory dataset features is greater than the amount of information included in the corresponding dataset features;

[0212] According to the multiple training samples corresponding to the i-th training task and the memory data set features corresponding to the multiple training samples, the prediction results corresponding to the multiple training samples corresponding to the i-th training task are determined through the prediction sub-model in the initial multi-scenario model.

[0213] In a possible implementation, the training unit 905 is configured to:

[0214] Through the sub-model loss function corresponding to the i-th training task, the inner loop of training the initial multi-scene model is performed to obtain the model update parameters corresponding to the i-th training task;

[0215] According to the model update parameters and outer loop learning rates corresponding to the M training tasks, the outer loop of the initial multi-scene model is trained to obtain the multi-scene model.

[0216] In a possible implementation, the training unit 905 is configured to:

[0217] The initial multi-scenario model is trained in an inner loop using the sub-model loss function corresponding to the i-th training task to obtain multiple model update sub-parameters corresponding to the i-th training task; the multiple model update sub-parameters corresponding to the i-th training task correspond one-to-one to the multiple training samples corresponding to the i-th training task;

[0218] According to the multiple models corresponding to the M training tasks, the sub-parameters and the outer loop learning rate are updated, and the outer loop of the initial multi-scene model is trained to obtain the multi-scene model.

[0219] In a possible implementation, the model determination device 900 further includes a configuration unit configured to:

[0220] Configure corresponding sample weights for multiple training samples corresponding to the i-th training task.

[0221] In a possible implementation, the configuration unit is configured to:

[0222] At the beginning of the inner loop of the training of the initial multi-scenario model, corresponding initial sample weights are configured for the multiple training samples corresponding to the i-th training task; the values ​​of the multiple initial sample weights corresponding to the i-th training task are the same;

[0223] During the inner loop of training the initial multi-scenario model, the weights of multiple initial samples corresponding to the i-th training task are adjusted; wherein, for the starting training sample among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the starting training sample corresponding to the i-th training task is reduced, and for the subsequent training samples among the multiple training samples corresponding to the i-th training task, the initial sample weight corresponding to the subsequent training samples corresponding to the i-th training task is increased.

[0224] In a possible implementation, the model determination device 900 further includes an annealing unit configured to:

[0225] During the outer loop process of training the initial multi-scene model, the outer loop learning rate is annealed; wherein the outer loop learning rate decreases as the outer loop process of training the initial multi-scene model progresses.

[0226] It should be noted that the device in the embodiment of the present application can implement the various processes of the embodiment of the aforementioned method and achieve the same effects and functions, which will not be repeated here.

[0227] One of the advantages of the above embodiment is that in order to obtain a multi-scenario model that can be applied to multiple application scenarios with the same scenario type, multiple training samples corresponding to M training tasks are obtained, where M is an integer, M≥2, and the i-th training task in the M training tasks is used as an example for illustration, where i is an integer, M≥i≥1, and the multiple training samples corresponding to the i-th training task do not come from one training data set, but from multiple training data sets corresponding one-to-one to multiple application scenarios; the multiple training samples corresponding to the i-th training task are input into the initial multi-scenario model for training optimization. The initial multi-scenario model includes a discriminant sub-model and a prediction sub-model. The discriminant sub-model can be used to first determine the data set features corresponding to the multiple training samples corresponding to the i-th training task. The data set features are used to represent the correlation between the corresponding training samples and the multiple training data sets, that is, the data set features can represent the correlation with the corresponding The most relevant training dataset for the training sample is used to determine the application scenario corresponding to the corresponding training sample. Then, based on the multiple training samples corresponding to the i-th training task and the dataset features corresponding to the multiple training samples, the prediction sub-model is used to determine the prediction results corresponding to the multiple training samples corresponding to the i-th training task. Since the prediction sub-model not only refers to the training samples but also refers to the dataset features that can represent the application scenario corresponding to the training samples in the process of determining the prediction results, the accuracy of the prediction results can be increased to a certain extent. Based on the difference between the prediction results corresponding to the multiple training samples corresponding to the i-th training task and the corresponding sample labels, the sub-model loss function corresponding to the i-th training task can be generated. The inner and outer loops of the initial multi-scenario model are trained using the sub-model loss functions corresponding to the M training tasks and the outer loop learning rate to obtain the multi-scenario model. During the training of the initial multi-scenario model, the initial multi-scenario model, including the discriminant sub-model and the predictive sub-model, can learn how to discriminate the application scenario corresponding to the training sample, so that the obtained multi-scenario model can be better applied to specific application scenarios among multiple application scenarios, thereby improving the accuracy of the multi-scenario model applied to multiple application scenarios.

[0228] According to some embodiments of the present application, a model determination device according to an embodiment of the present application is provided, which is used to execute the model determination method shown in Figure 4, and the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the above embodiment.

[0229] According to some embodiments of the present application, a non-volatile computer storage medium of a model determination method is provided, on which computer executable instructions are stored. The computer executable instructions are configured to execute the method described in the above embodiments when executed by a processor.

[0230] Computer-readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory, read-only memory, electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in this specific order, or that all shown operations must be performed to achieve the desired result. In addition, certain steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple substeps.

[0231] Although the spirit and principles of the present application have been described above with reference to several specific embodiments, it should be understood that the present application is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined. The present application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A model determination method, wherein: include: Get multiple training samples corresponding to M training tasks, where M is an integer and M≥2; For the i-th training task among the M training tasks, the multiple training samples corresponding to the i-th training task correspond to multiple training data sets, and the multiple training data sets correspond to multiple application scenarios one by one, wherein i is an integer, and M≥i≥1; Inputting a plurality of training samples corresponding to the i-th training task into an initial multi-scenario model, and determining data set features corresponding to the plurality of training samples corresponding to the i-th training task respectively through a discriminant sub-model in the initial multi-scenario model; the data set features are used to represent the correlation between the corresponding training samples and the plurality of training data sets; According to the multiple training samples corresponding to the i-th training task and the data set features respectively corresponding to the multiple training samples, determining the prediction results respectively corresponding to the multiple training samples corresponding to the i-th training task through the prediction sub-model in the initial multi-scenario model; Generate a sub-model loss function corresponding to the i-th training task based on differences between prediction results and corresponding sample labels respectively corresponding to the plurality of training samples corresponding to the i-th training task; The inner and outer loops of the initial multi-scene model are trained using the sub-model loss functions and outer loop learning rates corresponding to the M training tasks to obtain a multi-scene model.

2. The method according to claim 1, wherein: When the prediction sub-model includes K convolutional layers, where K is an integer and K≥2, the method of determining the prediction results corresponding to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple training samples respectively according to the multiple training samples corresponding to the i-th training task through the prediction sub-model in the initial multi-scenario model includes: For the first convolution layer among the K convolution layers, multiple training samples corresponding to the i-th training task and data set features respectively corresponding to the multiple training samples are input into the first convolution layer, and the first layer prediction sub-results respectively corresponding to the multiple training samples corresponding to the i-th training task are determined through the first convolution layer; For the kth convolutional layer among the K convolutional layers, the k-1th layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple samples are input into the kth convolutional layer, and the kth layer prediction sub-results corresponding to the multiple training samples corresponding to the i-th training task are determined through the kth convolutional layer; wherein k is an integer, K≥k≥2; The K-th layer prediction sub-results respectively corresponding to the multiple training samples corresponding to the i-th training task are used as the prediction results respectively corresponding to the multiple training samples corresponding to the i-th training task.

3. The method according to claim 1, wherein: The discriminant sub-model and the predictive sub-model have the same model architecture.

4. The method according to claim 1, wherein: The method of determining prediction results respectively corresponding to the multiple training samples corresponding to the i-th training task and the data set features respectively corresponding to the multiple training samples by using the prediction sub-model in the initial multi-scenario model comprises: Inputting the data set features corresponding to the multiple training samples into the bidirectional long short-term memory network in the initial multi-scenario model, and determining the memory data set features corresponding to the multiple training samples through the bidirectional long short-term memory network; the amount of information included in the memory data set features is greater than the amount of information included in the corresponding data set features; According to the multiple training samples corresponding to the i-th training task and the memory data set features respectively corresponding to the multiple training samples, the prediction results respectively corresponding to the multiple training samples corresponding to the i-th training task are determined through the prediction sub-model in the initial multi-scene model.

5. The method according to claim 1, wherein: The inner loop and the outer loop of training the initial multi-scenario model by using the sub-model loss functions and the outer loop learning rates corresponding to the M training tasks respectively to obtain the multi-scenario model include: Performing an inner loop of training the initial multi-scenario model through the sub-model loss function corresponding to the i-th training task to obtain a model update parameter corresponding to the i-th training task; According to the model update parameters and outer loop learning rates corresponding to the M training tasks, an outer loop of training is performed on the initial multi-scenario model to obtain a multi-scenario model.

6. The method according to claim 5, wherein: The inner loop of training the initial multi-scenario model through the sub-model loss function corresponding to the i-th training task to obtain the model update parameter corresponding to the i-th training task includes: The initial multi-scenario model is trained in an inner loop through the sub-model loss function corresponding to the i-th training task to obtain a plurality of model update sub-parameters corresponding to the i-th training task; the plurality of model update sub-parameters corresponding to the i-th training task correspond one-to-one to the plurality of training samples corresponding to the i-th training task; The outer loop of training the initial multi-scenario model according to the model update parameters and the outer loop learning rates respectively corresponding to the M training tasks to obtain the multi-scenario model includes: According to the multiple model update sub-parameters and outer loop learning rates corresponding to the M training tasks, an outer loop of training the initial multi-scene model is performed to obtain a multi-scene model.

7. The method according to claim 6, wherein: When the inner loop of training the initial multi-scenario model by the sub-model loss function corresponding to the i-th training task, the method further includes: Corresponding sample weights are respectively configured for multiple training samples corresponding to the i-th training task.

8. The method according to claim 7, wherein: The configuring corresponding sample weights for the plurality of training samples corresponding to the i-th training task respectively includes: At the beginning stage of the inner loop of the training of the initial multi-scenario model, respectively configuring corresponding initial sample weights for the multiple training samples corresponding to the i-th training task; the values ​​of the multiple initial sample weights corresponding to the i-th training task are the same; During the inner loop process of training the initial multi-scene model, the weights of multiple initial samples corresponding to the ith training task are adjusted; wherein, for the starting training sample among the multiple training samples corresponding to the ith training task, the initial sample weight corresponding to the starting training sample corresponding to the ith training task is reduced, and for the subsequent training samples among the multiple training samples corresponding to the ith training task, the initial sample weight corresponding to the subsequent training samples corresponding to the ith training task is increased.

9. The method according to claim 1, wherein: The method further comprises: During the outer loop process of training the initial multi-scene model, the outer loop learning rate is annealed; wherein the outer loop learning rate decreases as the outer loop process of training the initial multi-scene model progresses.

10. A model determination device, wherein: include: An acquisition unit, used to acquire a plurality of training samples corresponding to M training tasks, where M is an integer and M≥2; For an i-th training task among the M training tasks, the multiple training samples corresponding to the i-th training task correspond to multiple training data sets, and the multiple training data sets correspond one-to-one to multiple application scenarios, wherein i is an integer, and M≥i≥1; A first determination unit is used to input a plurality of training samples corresponding to the i-th training task into an initial multi-scenario model, and determine data set features corresponding to the plurality of training samples corresponding to the i-th training task respectively through a discriminant sub-model in the initial multi-scenario model; the data set features are used to represent the correlation between the corresponding training samples and the plurality of training data sets; A second determination unit is used to determine the prediction results corresponding to the multiple training samples corresponding to the i-th training task respectively through the prediction sub-model in the initial multi-scenario model according to the multiple training samples corresponding to the i-th training task and the data set features corresponding to the multiple training samples respectively. A generating unit, configured to generate a sub-model loss function corresponding to the i-th training task based on a difference between prediction results and corresponding sample labels respectively corresponding to a plurality of training samples corresponding to the i-th training task; A training unit is used to perform inner and outer loop training on the initial multi-scenario model through the sub-model loss functions and outer loop learning rates corresponding to the M training tasks, so as to obtain a multi-scenario model.

11. A model determination device, wherein: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to execute: the method as described in any one of claims 1-9.

12. A computer-readable storage medium, wherein: The computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor is caused to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Meta-learning method and device, initialization method, computing equipment and storage medium

    CN110852447A

  • MAML-based small sample video anomaly detection method in disaster scene

    CN116597207A

  • Multi-scene model training method and device, computer equipment and storage medium

    CN116628503A

  • Model determination method and device and computer readable storage medium

    CN117313893A

  • Machine Learning Model Training Method And Apparatus

    US20190286986A1

Cited By

  • Self-adaptive PID-attention-based meta-learning fraud detection step length optimization method

    CN120579603A

  • Multi-scene data simulation method and system based on generative adversarial network

    CN120850838A

  • A multi-scene data simulation method and system based on a generative adversarial network

    CN120850838B