Model training method and device, model, storage medium and electronic equipment

By generating sample training data and instance update data, updating the initial instance query in the model, and using the training instance query for model training, the problem of slow convergence speed of the Hungarian matching Transformer algorithm model training is solved, thereby improving model training efficiency and saving resources.

CN122347786APending Publication Date: 2026-07-07BEIJING CO WHEELS TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING CO WHEELS TECH CO LTD
Filing Date
2025-01-06
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

The existing technology uses the Transformer algorithm based on Hungarian matching, which suffers from slow training convergence speed.

Method used

By generating sample training data and instance update data based on the original sample data and expansion factor, the initial instance query in the model is updated, and the model is trained using the training instance query, including feature reconstruction, Hungarian matching, and backpropagation to adjust the model parameters.

Benefits of technology

It accelerated the model training process, improved training efficiency, balanced the number of positive and negative samples, and saved training resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347786A_ABST
    Figure CN122347786A_ABST
Patent Text Reader

Abstract

The application discloses a model training method and device, a model, a storage medium and an electronic device, relates to the technical field of model training, and comprises the following steps: obtaining sample training data and instance update data based on sample original data and an expansion multiple; updating an initial instance query in a model based on the instance update data to obtain a training instance query, wherein the training instance query comprises a plurality of vectors, and each vector is used for representing a feature; and training the model based on the sample training data and the training instance query to obtain a final model. The model overall training convergence is accelerated, the model training efficiency is improved, and the training resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving technology, specifically to a model training method, a model training device, a model, a machine-readable storage medium, a computer program product, and an electronic device. Background Technology

[0002] Models built based on learning algorithms are used in many fields. For example, lane line recognition is an important component of the perception module in autonomous driving. A lane line recognition model can be built based on the Transformer algorithm using Hungarian matching, and then used to identify lane lines. Specifically, a matching algorithm is used as the model training strategy, and a Transformer-based attention mechanism is used for feature reconstruction.

[0003] In the training process of the Transformer algorithm based on Hungarian matching, the training method adopted is to train occlusion-aware computing (OCC) and the joint dynamic and static model in a unified manner. This unified training method can integrate information from different models or features, enabling the model to learn a more comprehensive and integrated feature representation.

[0004] However, when dealing with static features, this approach relies on architecture design or parameter configuration to adapt to the extraction and analysis of static features, which leads to slow training convergence speed. Summary of the Invention

[0005] The purpose of this application is to provide a model training method, a model training device, a model, a machine-readable storage medium, a computer program product, and an electronic device to solve the problem of slow training convergence speed in the prior art.

[0006] To achieve the above objectives, the first aspect of this application provides a model training method, comprising:

[0007] Based on the original sample data and the expansion factor, we obtain sample training data and instance update data;

[0008] Based on the instance update data, the initial instance query in the model is updated to obtain the training instance query, which includes multiple vectors, each vector representing a feature;

[0009] The model is trained based on the sample training data and the training instance query to obtain the final model.

[0010] In this embodiment of the application, instance update data is obtained based on the original sample data and the expansion factor, including:

[0011] Based on the original sample data and the expansion factor, the auxiliary quantity is determined, and a corresponding number of instance query data are randomly generated;

[0012] Initialize the instance query data to obtain the instance update data.

[0013] In this embodiment of the application, the initial instance query in the model is a multi-dimensional instance query, and the multiple dimensions include at least the quantity dimension;

[0014] The step of updating the initial instance query in the model based on the instance update data to obtain the training instance query includes:

[0015] The instance update data is superimposed on the initial instance query in the model in terms of quantity to obtain the training instance query.

[0016] In this embodiment of the application, training the model based on the sample training data and the training instance query to obtain the final model includes:

[0017] A1: Perform feature reconstruction on the training instance query to obtain the reconstructed instance query;

[0018] A2: Input the reconstructed instance query into the current model to obtain the recognition result, and perform Hungarian matching between the recognition result and the sample training data to obtain the matching result;

[0019] A3: Based on the matching results, determine whether the current model training is complete;

[0020] A4: If it is determined that the current model training is complete, then the current model shall be used as the final model;

[0021] A5: If it is determined that the current model training is not complete, adjust the current model based on the matching results and jump to execute A2-A3.

[0022] In this embodiment of the application, determining whether the current model training is complete based on the matching result includes:

[0023] A first matching result is determined from the matching results, and the first matching result is the matching result corresponding to the initial instance query in the model;

[0024] Based on the first matching result, the loss value is calculated according to the preset rules to obtain the first loss value;

[0025] Based on the first loss value, determine whether the current model training is complete.

[0026] In this embodiment of the application, adjusting the current model based on the matching result includes:

[0027] A second matching result is determined from the matching results, and the second matching result is the matching result corresponding to the instance update data;

[0028] Based on the second matching result, the loss value is calculated according to the preset rules to obtain the second loss value;

[0029] Based on the second loss value, the current model is adjusted using backpropagation to update the current model.

[0030] A second aspect of this application provides a model training apparatus, comprising:

[0031] The expansion module is used to obtain sample training data and instance update data based on the original sample data and the expansion factor;

[0032] The update module is used to update the data based on the instance, update the initial instance query in the model, and obtain the training instance query. The training instance query includes multiple vectors, each vector representing a feature.

[0033] The training module is used to train the model based on the sample training data and the training instance query to obtain the final model.

[0034] A third aspect of this application provides a model, which is trained using the model training method described above.

[0035] A fourth aspect of this application provides an electronic device, comprising:

[0036] The memory is configured to store instructions; and

[0037] The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the model training method described above.

[0038] A fifth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the model training method described above.

[0039] The sixth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the model training method described above.

[0040] The above technical solution obtains sample training data and instance update data based on the original sample data and the expansion factor. Based on the instance update data, the initial instance query in the model is updated to obtain the training instance query, which includes multiple vectors, each representing a feature. The model is then trained based on the sample training data and the training instance query to obtain the final model. By using the original sample data and the expansion factor, the feature vectors in the instance query can be increased, balancing the number of positive and negative samples in the instance query. This allows a single true value to match multiple predicted values ​​output by the model, accelerating the model's matching phase and thus speeding up overall model training convergence, improving training efficiency, and saving training resources.

[0041] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description

[0042] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:

[0043] Figure 1 The illustration shows a flowchart of a model training method according to an embodiment of this application;

[0044] Figure 2 The flowchart illustrating the initialization of lane lines and instance query according to an embodiment of this application is shown in the schematic diagram.

[0045] Figure 3 The schematic diagram illustrates a structural schematic of a model training apparatus according to an embodiment of this application;

[0046] Figure 4 The diagram illustrates the internal structure of a computer device according to an embodiment of this application.

[0047] Explanation of reference numerals in the attached figures

[0048] 410 - Expansion Module; 420 - Update Module; 430 - Training Module; A01 - Processor; A02 - Network Interface; A03 - Internal Memory; A04 - Display Screen; A05 - Input Device; A06 - Non-Volatile Storage Medium; B01 - Operating System; B02 - Computer Program. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0050] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0051] It should be noted that the model mentioned in this embodiment refers to the model constructed based on the Hungarian matching Transformer algorithm. For the sake of explaining the scheme, this embodiment mainly uses the lane line recognition model constructed based on the Hungarian matching Transformer algorithm for explanation.

[0052] Figure 1 The illustration shows a schematic flowchart of a model training method according to an embodiment of this application. Figure 1 As shown in the figure, this application provides a model training method, which may include the following steps.

[0053] Step 210: Based on the original sample data and the expansion factor, obtain the sample training data and instance update data;

[0054] In this embodiment, the aforementioned original sample data can refer to the sample data of the training model. For example, taking a lane line recognition model as an example, the original sample data consists of multiple lane line information of the training model. This information can be represented in matrix form, obtained by inputting real lane line information collected by the user, or obtained through simulation. The aforementioned expansion factor can be a specific value, which can be determined based on the actual situation. The aforementioned sample training data can be obtained by copying the original sample data according to the expansion factor. For example, denoted by K, after determining the expansion factor, the original sample data is copied K times to obtain the sample training data. The aforementioned instance update data refers to the auxiliary instance query generated based on the original sample data and the expansion factor.

[0055] In some embodiments, instance update data is obtained based on the original sample data and the expansion factor, including the following steps:

[0056] First, based on the original sample data and the expansion factor, the auxiliary number is determined, and a corresponding number of instance query data are randomly generated;

[0057] In this embodiment, the number of replicated data can be determined based on the original sample data and the expansion factor. Taking a lane line recognition model as an example, the number of replicated lane lines can be determined based on the original sample data and the expansion factor. This number serves as an auxiliary number, and then a corresponding number of instance query data are randomly generated. For example, if the auxiliary number is 6, then 6 instance query data are randomly generated.

[0058] Then, initialize the instance query data to obtain the instance update data.

[0059] In this embodiment, the instance query data is discrete data, which can be initialized using the `nn.embedding` function. `nn.embedding` is a layer in deep learning, typically used to map discrete numerical values ​​(such as word indices) into continuous vector representations. Using `nn.embedding`, the instance query data can be mapped to continuous vectors, resulting in auxiliary instance queries. Taking a lane line recognition model as an example, the instance query data can be initialized using `nn.embedding` in the lane line head of the lane line recognition model to obtain auxiliary instance queries, i.e., instance update data. The lane line head is used to iterate lane line information. The lane line head receives features extracted from the main body of the lane line recognition model and further processes and transforms these features, converting general features into specific lane line predictions. By using the `nn.embedding` function, auxiliary instance queries can be quickly generated to facilitate subsequent model training.

[0060] Step 220: Update the initial instance query in the model based on the instance update data to obtain the training instance query. The training instance query includes multiple vectors, each vector representing a feature.

[0061] In this embodiment, an instance query typically refers to a query targeting a specific instance or sample. Taking a lane line recognition model as an example, an instance query is a query targeting lane lines. An instance query can be viewed as a set of vectors, each designed to capture lane line features. Through the attention mechanism in the Transformer architecture, these instance queries interact with the input feature map, enabling the location and identification of different lane lines. Auxiliary instance queries can be further added to the original instance queries to expand the number of lane line features in the instance queries. Lane line features in the instance queries are considered positive samples, and null values ​​in the instance queries are considered negative samples. By adding instance update data to the initial instance queries in the model, training instance queries are obtained, resulting in a more balanced number of positive and negative samples in the training instance queries.

[0062] In some embodiments, the initial instance query in the model is a multi-dimensional instance query, and the multiple dimensions include at least the quantity dimension;

[0063] The step of updating the initial instance query in the model based on the instance update data to obtain the training instance query includes: superimposing the instance update data and the initial instance query in the model in terms of quantity dimension to obtain the training instance query.

[0064] In this embodiment, the quantity dimension can be found through an index. For example, if dim is used as the index, the initial instance query has four dimensions, and the dimension where dim is 1 is the quantity dimension. The instance update data can be added to the initial instance query in the dimension where dim equals 1. For example, if the initial instance query is 4*128*84*1.2, and 84 is the dimension corresponding to the quantity dimension, then the instance update data will be added to the initial instance query in the dimension where 84 is, and the rest will remain unchanged.

[0065] Step 230: Based on the sample training data and the training instance query, train the model to obtain the final model.

[0066] In this embodiment, the above-mentioned training can be performed by inputting training instance queries into the model, obtaining recognition results through model prediction, matching the predicted recognition results with sample training data, adjusting the model parameters based on the matching results, and then using the model to predict again, adjusting the model parameters based on the matching results, and repeating this process until the matching results meet the requirements, training is completed, and the final model is obtained.

[0067] In some embodiments, training the model based on the sample training data and the training instance query to obtain the final model includes the following steps:

[0068] Step A1: Perform feature reconstruction on the training instance query to obtain the reconstructed instance query;

[0069] In this embodiment, taking the lane line recognition model as an example, the Transformer-based attention mechanism and region proposal network can be used to construct the correlation between features in the feature vectors of the training instance query. The encoder updates the feature vectors, and finally the decoder reconstructs the features.

[0070] Step A2: Input the reconstructed instance query into the current model to obtain the recognition result, and perform Hungarian matching between the recognition result and the sample training data to obtain the matching result;

[0071] In this embodiment, the features in the reconstructed instance query are predicted values, and the sample training data are real values. Hungarian matching can be used to find the optimal matching relationship between the features in the reconstructed instance query and the features in the sample training data. Taking a lane recognition model as an example, one predicted value corresponds to one real lane line, resulting in a matching result. Since the original sample data is copied from the sample training data, after Hungarian matching, the same lane line will correspond to multiple predicted values ​​in the reconstructed instance query.

[0072] Step A3: Based on the matching results, determine whether the current model training is complete;

[0073] In this embodiment, determining whether the current model training is complete means determining whether the current model meets the requirements. The determination process can be to calculate the loss value between the predicted value and the true value in the matching result, and determine whether the loss value meets the requirements. If the requirements are met, it means that the model training is complete; otherwise, it means that the model training is not complete.

[0074] In some embodiments, determining whether the current model training is complete based on the matching result includes the following steps:

[0075] First, a first matching result is determined from the matching results. The first matching result is the matching result corresponding to the initial instance query in the model.

[0076] In this embodiment, the matching results include the matching results corresponding to the instance update data and the matching results corresponding to the initial instance query. The matching results can be divided into original matching results and auxiliary matching results based on the instance update data and the initial instance query. The original matching results are the matching results corresponding to the initial instance query, i.e., the first matching results. The auxiliary matching results are the matching results corresponding to the instance update data, i.e., the second matching results.

[0077] Then, based on the first matching result, the loss value is calculated according to the preset rules to obtain the first loss value;

[0078] In this embodiment, the preset rules can be determined according to actual needs, and the preset rules can be preset loss functions. For example, taking a lane line recognition model as an example, lane lines are composed of points, so when calculating the loss value, the error between the points of the real lane line and the points of the predicted value can be calculated based on the first matching result to obtain the first loss value.

[0079] Finally, based on the first loss value, it is determined whether the current model training is complete.

[0080] In this embodiment, it can be determined whether the first loss value reaches a threshold. If it does, the model training is complete; otherwise, the model training is incomplete. By calculating the loss value corresponding to the first matching result, it is possible to quickly determine whether the model training is complete. For example, in the above example, the smaller the first loss value, the better. A threshold can be set. If the first loss value reaches this threshold, it indicates that the lane line recognition model training is complete.

[0081] Step A4: If it is determined that the current model training is complete, use the current model as the final model;

[0082] In this embodiment, if it is determined that the current model training is complete, it means that the current model has met the requirements and can be used as the final model output.

[0083] Step A5: If it is determined that the current model training is not complete, adjust the current model based on the matching results, and then proceed to steps A2-A3.

[0084] In this embodiment, if it is determined that the current model training is not complete, it indicates that further training is needed. Specifically, this can be done by adjusting the model parameters and then executing steps A2-A3 until the model training is complete. Taking a lane recognition model as an example, the parameters of the lane recognition model include backbone, neck, and head parameters. The backbone refers to the main structure in the deep neural network, used to extract features from the input image and provide a basic feature representation for subsequent tasks. The neck is located between the backbone and heads, acting as a connector and transformer of features. It can further process and fuse the features extracted by the backbone to adapt to different head requirements. The heads are the output part, used to predict lane lines. By adjusting the parameters of the lane recognition model, the lane recognition model is updated, and then steps A2-A3 are executed until it is determined that the lane recognition model training is complete.

[0085] In some embodiments, in order to train the model quickly, the model parameters can be adjusted according to the loss value corresponding to the second matching result. Specifically, adjusting the current model based on the matching result includes the following steps:

[0086] First, a second matching result is determined from the matching results, and the second matching result is the matching result corresponding to the instance update data;

[0087] In this embodiment, the matching results include the matching results corresponding to the instance update data and the matching results corresponding to the initial instance query. The matching results can be divided into original matching results and auxiliary matching results based on the instance update data and the initial instance query. The original matching results are the matching results corresponding to the initial instance query, i.e., the first matching results. The auxiliary matching results are the matching results corresponding to the instance update data, i.e., the second matching results.

[0088] Then, based on the second matching result, the loss value is calculated according to the preset rules to obtain the second loss value;

[0089] In this embodiment, the process of calculating the second loss value is the same as the process of calculating the first loss value, and will not be described again here. The preset rule can be a preset loss function.

[0090] Then, based on the second loss value, the current model is adjusted using backpropagation to update the current model.

[0091] In this embodiment, the main function of backpropagation is to calculate the gradient layer by layer from the output layer to the input layer based on the second loss value, and to use these gradients to update the model parameters (such as weights and biases) to reduce the value of the loss function, thereby making the model's prediction results closer to the true value.

[0092] By calculating the loss value corresponding to the second matching result and updating the model using backpropagation, the prediction results of the adjusted model can be made closer to the true value, thus helping to quickly obtain a well-trained model.

[0093] In the above implementation process, sample training data and instance update data are obtained based on the original sample data and the expansion factor. Based on the instance update data, the initial instance query in the model is updated to obtain the training instance query, which includes multiple vectors, each representing a feature. Based on the sample training data and the training instance query, the model is trained to obtain the final model. By using the original sample data and the expansion factor, the feature vectors in the instance query can be increased, balancing the number of positive and negative samples in the instance query. This allows a single true value to match multiple predicted values ​​output by the model, accelerating the model's matching phase and thus speeding up overall model training convergence, improving training efficiency, and saving training resources.

[0094] The following examples illustrate the solution; please refer to them. Figure 2 , Figure 2 The flowchart illustrating the initialization of lane lines and instance query according to an embodiment of this application is shown schematically. Figure 2 In the original context, the actual lane data is represented as Y, containing N lane lines. After being copied K times, it becomes Y', containing K lane lines. The original instance query {qi} contains feature vectors of N lane lines. By initializing the auxiliary instance query and adding it to the instance query, the new instance query becomes {q}. ∧ Let i} contain the feature vectors of T lane lines. The new instance query is input into the Transformer header, and the Transformer decoder outputs the updated instance query Y. ∧ ', then Y' and Y ∧ 'Hungarian matching is performed, where one true value corresponds to multiple predicted values. The original instance query is input into the Transformer header, and the Transformer decoder outputs the updated instance query Y.' ∧ Y ∧ Perform a Hungarian matching with Y, and the matching result is one true value corresponding to one predicted value.

[0095] When validating this approach, for example, you can calculate the original loss value and the existing loss value separately. Based on the loss value, there will be a loss curve. Then, plot the original loss curve and the loss curve for the newly added instance query separately, and compare the two loss curves. You can find that the loss curve of the newly added instance decreases faster than the original one. To achieve the same value, this approach requires less model training time.

[0096] Figure 1 This is a flowchart illustrating a model training method in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0097] This embodiment provides a model, which is trained using the model training method described above.

[0098] In this embodiment, the model described above can be constructed based on the Transformer algorithm using Hungarian matching, such as a lane line recognition model, which can be used to identify lane lines. By training the model using the above-described model training method, the feature vectors in the instance query can be increased, balancing the number of positive and negative samples in the instance query. This allows a single true value to match multiple predicted values ​​output by the model, accelerating the model during the matching phase, improving model training efficiency, and saving training resources.

[0099] Please refer to Figure 3 , Figure 3 A schematic diagram illustrating the structure of a model training apparatus according to an embodiment of this application is provided. This embodiment provides a model training apparatus, including an expansion module 410, an update module 420, and a training module 430, wherein:

[0100] The expansion module 410 is used to obtain sample training data and instance update data based on the original sample data and the expansion factor;

[0101] Update module 420 is used to update the initial instance query in the model based on the instance update data to obtain the training instance query, wherein the training instance query includes multiple vectors, each vector representing a feature;

[0102] The training module 430 is used to train the model based on the sample training data and the training instance query to obtain the final model.

[0103] The expansion module 410 includes:

[0104] The generation unit is used to determine the auxiliary quantity based on the original sample data and the expansion factor, and randomly generate a corresponding number of instance query data.

[0105] An initialization unit is used to initialize the instance query data and obtain instance update data.

[0106] The initial instance query in the model is a multi-dimensional instance query, and the multiple dimensions include at least the quantity dimension;

[0107] The update module 420 includes:

[0108] The overlay unit is used to overlay the instance update data with the initial instance query in the model in terms of quantity dimension to obtain the training instance query.

[0109] The training module 430 includes:

[0110] The feature reconstruction unit is used to reconstruct the features of the training instance query to obtain the reconstructed instance query.

[0111] The matching unit is used to input the reconstructed instance query into the current model to obtain the recognition result, and to match the recognition result with the sample training data to obtain the matching result;

[0112] The judgment unit is used to determine whether the current model training is complete based on the matching result;

[0113] The output unit is used to use the current model as the final model when it is determined that the current model training is complete.

[0114] The adjustment unit is used to adjust the current model based on the matching result and call the matching unit when it is determined that the current model training is not yet complete.

[0115] The determination unit includes:

[0116] The first determining subunit is used to determine a first matching result from the matching results, wherein the first matching result is the matching result corresponding to the initial instance query in the model;

[0117] The first calculation subunit is used to calculate the loss value based on the first matching result according to a preset rule to obtain the first loss value;

[0118] The judgment sub-unit is used to determine whether the current model training is complete based on the first loss value.

[0119] The adjustment unit includes:

[0120] The second determining subunit is used to determine a second matching result from the matching results, wherein the second matching result is the matching result corresponding to the instance update data;

[0121] The second calculation subunit is used to calculate the loss value based on the second matching result according to a preset rule, and obtain the second loss value;

[0122] The adjustment subunit is used to adjust the current model based on the second loss value using backpropagation, so as to update the current model.

[0123] In the above implementation process, the expansion module 410 obtains sample training data and instance update data based on the original sample data and the expansion factor; the update module 420 updates the initial instance query in the model based on the instance update data to obtain the training instance query, which includes multiple vectors, each vector representing a feature; the training module 430 trains the model based on the sample training data and the training instance query to obtain the final model. By using the original sample data and the expansion factor, the feature vectors in the instance query can be increased, balancing the number of positive and negative samples in the instance query, so that a true value can match multiple predicted values ​​output by the model, thereby accelerating the model in the matching stage, improving model training efficiency, and saving training resources.

[0124] The model training device includes a processor and a memory. The expansion module 410, update module 420 and training module 430 are all stored in the memory as program units. The processor executes the program modules stored in the memory to implement the corresponding functions.

[0125] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and the model training method can be implemented by adjusting the kernel parameters.

[0126] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0127] This application provides a machine-readable storage medium storing a program that, when executed by a processor, implements the above-described model training method.

[0128] This application provides an electronic device, including:

[0129] The memory is configured to store instructions; and

[0130] The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the model training method described above.

[0131] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown in the figure, the computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A06. The network interface A02 is used for communication with external terminals via a network connection. When the computer program is executed by the processor A01, it implements a model training method. The display screen A04 can be a liquid crystal display (LCD) or an e-ink display. The input device A05 can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0132] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0133] In one embodiment, the model training apparatus provided in this application can be implemented as a computer program, which can be implemented in, for example... Figure 4 It runs on the computer device shown. The computer device's memory can store the various program modules that make up the model training device, for example, Figure 3The expansion module 410, update module 420, and training module 430 are shown. The computer program comprised of these modules causes the processor to execute the steps in the model training methods of the various embodiments of this application described in this specification.

[0134] Figure 4 The computer device shown can be used as follows Figure 3 The expansion module 410 in the model training device shown executes step 210. The computer device can execute step 220 via update module 420 and step 230 via training module 430.

[0135] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps:

[0136] Based on the original sample data and the expansion factor, we obtain sample training data and instance update data;

[0137] Based on the instance update data, the initial instance query in the model is updated to obtain the training instance query, which includes multiple vectors, each vector representing a feature;

[0138] The model is trained based on the sample training data and the training instance query to obtain the final model.

[0139] In one embodiment, instance update data is obtained based on the original sample data and the expansion factor, including:

[0140] Based on the original sample data and the expansion factor, the auxiliary quantity is determined, and a corresponding number of instance query data are randomly generated;

[0141] Initialize the instance query data to obtain the instance update data.

[0142] In one embodiment, the initial instance query in the model is a multi-dimensional instance query, and the multiple dimensions include at least the quantity dimension;

[0143] The step of updating the initial instance query in the model based on the instance update data to obtain the training instance query includes:

[0144] The instance update data is superimposed on the initial instance query in the model in terms of quantity to obtain the training instance query.

[0145] In one embodiment, training the model based on the sample training data and the training instance query to obtain the final model includes:

[0146] A1: Perform feature reconstruction on the training instance query to obtain the reconstructed instance query;

[0147] A2: Input the reconstructed instance query into the current model to obtain the recognition result, and perform Hungarian matching between the recognition result and the sample training data to obtain the matching result;

[0148] A3: Based on the matching results, determine whether the current model training is complete;

[0149] A4: If it is determined that the current model training is complete, then the current model shall be used as the final model;

[0150] A5: If it is determined that the current model training is not complete, adjust the current model based on the matching results and jump to execute A2-A3.

[0151] In one embodiment, determining whether the current model training is complete based on the matching result includes:

[0152] A first matching result is determined from the matching results, and the first matching result is the matching result corresponding to the initial instance query in the model;

[0153] Based on the first matching result, the loss value is calculated according to the preset rules to obtain the first loss value;

[0154] Based on the first loss value, determine whether the current model training is complete.

[0155] In one embodiment, adjusting the current model based on the matching result includes:

[0156] A second matching result is determined from the matching results, and the second matching result is the matching result corresponding to the instance update data;

[0157] Based on the second matching result, the loss value is calculated according to the preset rules to obtain the second loss value;

[0158] Based on the second loss value, the current model is adjusted using backpropagation to update the current model.

[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

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

[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0163] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0164] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0165] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer 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 (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0166] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0167] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A model training method, characterized in that, include: Based on the original sample data and the expansion factor, we obtain sample training data and instance update data; Based on the instance update data, the initial instance query in the model is updated to obtain the training instance query, which includes multiple vectors, each vector representing a feature; The model is trained based on the sample training data and the training instance query to obtain the final model.

2. The model training method according to claim 1, characterized in that, Based on the original sample data and the expansion factor, the instance update data is obtained, including: Based on the original sample data and the expansion factor, the auxiliary quantity is determined, and a corresponding number of instance query data are randomly generated; Initialize the instance query data to obtain the instance update data.

3. The model training method according to claim 1, characterized in that, The initial instance query in the model is a multi-dimensional instance query, and the multiple dimensions include at least the quantity dimension; The step of updating the initial instance query in the model based on the instance update data to obtain the training instance query includes: The instance update data is superimposed on the initial instance query in the model in terms of quantity to obtain the training instance query.

4. The model training method according to claim 1, characterized in that, The step of training the model based on the sample training data and the training instance query to obtain the final model includes: A1: Perform feature reconstruction on the training instance query to obtain the reconstructed instance query; A2: Input the reconstructed instance query into the current model to obtain the recognition result, and perform Hungarian matching between the recognition result and the sample training data to obtain the matching result; A3: Based on the matching results, determine whether the current model training is complete; A4: If it is determined that the current model training is complete, then the current model shall be used as the final model; A5: If it is determined that the current model training is not complete, adjust the current model based on the matching results and jump to execute A2-A3.

5. The model training method according to claim 4, characterized in that, The step of determining whether the current model training is complete based on the matching result includes: A first matching result is determined from the matching results, and the first matching result is the matching result corresponding to the initial instance query in the model; Based on the first matching result, the loss value is calculated according to the preset rules to obtain the first loss value; Based on the first loss value, determine whether the current model training is complete.

6. The model training method according to claim 5, characterized in that, The adjustment of the current model based on the matching results includes: A second matching result is determined from the matching results, and the second matching result is the matching result corresponding to the instance update data; Based on the second matching result, the loss value is calculated according to the preset rules to obtain the second loss value; Based on the second loss value, the current model is adjusted using backpropagation to update the current model.

7. A model training device, characterized in that, include: The expansion module is used to obtain sample training data and instance update data based on the original sample data and the expansion factor; The update module is used to update the data based on the instance, update the initial instance query in the model, and obtain the training instance query. The training instance query includes multiple vectors, each vector representing a feature. The training module is used to train the model based on the sample training data and the training instance query to obtain the final model.

8. A model, characterized in that, The model is trained using the model training method described in any one of claims 1 to 6.

9. An electronic device, characterized in that, include: The memory is configured to store instructions; as well as The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the model training method according to any one of claims 1 to 6.

10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to perform the model training method according to any one of claims 1 to 6.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the model training method according to any one of claims 1 to 6.