Target model training method and device, and electronic device

By utilizing the differential output information of historical iterative models during network model training for iterative updates, the problems of training sample quantity and device dependence are solved, achieving efficient and low-cost model training.

CN116452861BActive Publication Date: 2026-07-21BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2023-03-29
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In the process of training network models, existing technologies require a large number of training samples, which leads to high costs and dependence on high-specification equipment, and the collection of training samples is complicated.

Method used

By inputting the target sample into the first model for information prediction, generating output information, and adding it to the storage queue, the model is iteratively updated using the differential output information of the historical iterative models, thereby enriching data diversity and reducing the number of training samples.

Benefits of technology

It effectively improves the data diversity for model training, reduces training costs, decreases reliance on high-specification equipment, and improves model training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452861B_ABST
    Figure CN116452861B_ABST
Patent Text Reader

Abstract

The present disclosure provides a target model training method and device and electronic equipment, relating to the technical field of artificial intelligence, specifically the technical field of computer vision, image processing, deep learning and the like. The specific implementation scheme is: inputting a target sample into a first model to perform information prediction, obtaining first output information, the target sample including an image or text, the information prediction including image classification or text classification, the first model being a model obtained by updating a preset initial model for the i-th time, i being a positive integer; adding the first output information to a target storage queue, updating a first group of stored output information in the target storage queue, and obtaining a second group of output information stored in the target storage queue; and updating the first model based on the second group of output information to obtain a second model. The present disclosure can effectively enrich the data diversity of the iterative update of the first model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, specifically to the fields of computer vision, image processing, deep learning, etc., and particularly to a target model training method, apparatus, and electronic device. Background Technology

[0002] With the advancement of artificial intelligence technology, various deep learning-based network models are widely used in various fields. During the training process of these network models, it is typically necessary to collect a large number of training samples to train the model until it converges and meets the user's needs. Summary of the Invention

[0003] This disclosure provides a method, apparatus, and electronic device for training a target model.

[0004] According to one aspect of this disclosure, a method for training a target model is provided, comprising:

[0005] The target sample is input into the first model for information prediction to obtain the first output information. The target sample includes images or text. The information prediction includes image classification or text classification. The first model is a model obtained by updating a preset initial model in the i-th iteration, where i is a positive integer.

[0006] The first output information is added to the target storage queue, and the first set of output information stored in the target storage queue is updated to obtain the second set of output information stored in the target storage queue. The first set of output information includes N output information obtained by inputting the target sample into N historical iterative models for information prediction. The second set of output information includes the first output information and N-1 output information. The N-1 output information is the output information obtained by deleting one of the N output information. The N historical iterative models are N models in i-1 historical iterative models. The i-1 historical iterative models are i-1 models obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i.

[0007] The first model is iteratively updated based on the second set of output information to obtain the second model;

[0008] The second model is used to predict information from the model input.

[0009] According to another aspect of this disclosure, a target model training apparatus is provided, comprising:

[0010] The prediction module is used to input the target sample into the first model for information prediction and obtain the first output information. The target sample includes an image or text, and the information prediction includes image classification or text classification. The first model is a model obtained by updating a preset initial model in the i-th iteration, where i is a positive integer.

[0011] The first update module is used to add the first output information to the target storage queue and update the first set of output information stored in the target storage queue to obtain the second set of output information stored in the target storage queue. The first set of output information includes N output information obtained by inputting the target sample into N historical iterative models for information prediction. The second set of output information includes the first output information and N-1 output information. The N-1 output information is the output information obtained by deleting one of the N output information. The N historical iterative models are N models in i-1 historical iterative models. The i-1 historical iterative models are the i-1 models obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i.

[0012] The second update module is used to iteratively update the first model based on the second set of output information to obtain the second model.

[0013] The second model is used to predict information from the model input.

[0014] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the target model training method provided in this disclosure.

[0018] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to execute the target model training method provided in this disclosure.

[0019] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the target model training method provided in this disclosure.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0021] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0022] Figure 1 This is a flowchart of a target model training method provided in this disclosure;

[0023] Figure 2 This is a schematic diagram of a model training structure provided in this publication;

[0024] Figures 3a to 3b This is a structural diagram of the target model training device provided in this disclosure;

[0025] Figure 4 This is a block diagram of an electronic device used to implement embodiments of the present disclosure. Detailed Implementation

[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0027] Please see Figure 1 , Figure 1 This is a flowchart of a target model training method provided in this publication.

[0028] like Figure 1 As shown, it includes the following steps:

[0029] Step S101: Input the target sample into the first model for information prediction and obtain the first output information.

[0030] The first model mentioned above can be understood as the model obtained by updating the preset initial model in the i-th iteration, where i is a positive integer. For example, when the value of i is 50, the first model can be understood as the model obtained by updating the preset initial model in the 50th iteration, that is, the first model is the model obtained by updating the preset initial model 50 times.

[0031] The preset initial model can be any deep learning-based network model, and it can predict information from the model input. For example, the preset initial model can be a model for image classification or a model for text classification; that is, the information prediction can be either image classification or text classification.

[0032] The target samples mentioned above can be understood as samples used to iteratively update the first model, and the type of the target samples can be determined based on the type of the preset initial model. For example, when the preset initial model is a model for image classification prediction, the target sample can be an image; when the preset initial model is a model for text classification prediction, the target sample can be text.

[0033] For example, when the target sample is an image, inputting the target sample into the first model for information prediction yields image classification output information. Similarly, when the target sample is text, inputting the target sample into the first model for information prediction yields text classification output information.

[0034] Step S102: Add the first output information to the target storage queue, and update the first set of output information stored in the target storage queue to obtain the second set of output information stored in the target storage queue.

[0035] The target storage queue mentioned above can be a memory bank, that is, a storage queue stored in memory in the form of a queue.

[0036] The first set of output information mentioned above can be understood as the set of output information stored in the target storage queue before the above update. This first set of output information may include N output information obtained by inputting the target sample into N historical iterative models for information prediction. The N historical iterative models can be N models from i-1 historical iterative models, where i-1 historical iterative models are obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i.

[0037] The second set of output information mentioned above can be understood as the set of output information stored in the target storage queue after the above update. This second set of output information may include the first output information and N-1 other output information, where the N-1 output information is obtained by deleting one of the N output information.

[0038] It is understandable that during the process of adding the first output information to the target storage queue to update the content in the target storage queue, the content stored in the target storage queue is updated from the first set of output information to the second set of output information.

[0039] Since the parameters of the model change with each iteration, inputting the target sample into different historical iterative models for information prediction can yield different output information. That is, the N output information predicted based on N historical iterative models are different from each other. Therefore, when using N-1 of the N output information and the first output information to iteratively update the first model, the data diversity for iterative updates of the first model can be effectively improved.

[0040] The target storage queue can also include multiple difficult positive samples and multiple difficult negative samples of the target sample. That is, both the first set of output information and the second set of output information can include multiple difficult positive samples and multiple difficult negative samples of the target sample, so as to reduce the impact of N output information on model iteration and update and improve the model training effect.

[0041] Step S103: Iteratively update the first model based on the second set of output information to obtain the second model.

[0042] The second model described above can predict information from the model input.

[0043] In this disclosure, since the second set of output information includes N-1 output information obtained by inputting the target sample into N-1 historical iterative models for information prediction, when iterating and updating the first model based on the second set of output information, compared with iterating and updating the first model based only on the first output information, it can effectively enrich the data diversity for iteratively updating the first model.

[0044] Moreover, since all N-1 output information are generated based on the target samples, there is no need to add additional training samples to generate the corresponding N-1 information, which provides additional data diversity for model training and also reduces the collection of training samples.

[0045] Understandably, since a single target sample can enrich the data diversity for iterative updates of the first model, the number of training samples required is effectively reduced; therefore, the training process of the model can be completed without high-specification machines such as large video memory, thereby effectively reducing the cost of model training.

[0046] In addition, by utilizing the differences between historical iterative models, the target sample is input into the historical iterative model to predict the output information of the differences, so as to predict the output information of the differences and provide additional data diversity for the iterative update of the first model.

[0047] In this disclosure, the above method can be applied to an electronic device, and all steps included in the above method are performed by the electronic device, which may be a server, computer, mobile phone or other electronic device.

[0048] In one embodiment, the first output information is added to a target storage queue, and the first set of output information stored in the target storage queue is updated to obtain a second set of output information stored in the target storage queue, including:

[0049] The first output information is added to the target storage queue, and the second output information in the first set of output information is replaced with the first output information to obtain the second set of output information stored in the target storage queue.

[0050] Wherein, the second output information is the output information obtained by inputting the target sample into the target historical iterative model for information prediction, and the target historical iterative model is the iterative model with the earliest iteration update time among the N historical iterative models.

[0051] In this embodiment, during the process of updating the target storage queue, by adding the first output information to the target storage queue, the second output information in the first set of output information is replaced with the first output information at the same time. That is, the second output information is removed from the target storage queue, that is, the second output information predicted by the iterative model with the earliest iteration update time for the target sample is removed. This realizes the first-in-first-out management of the output information in the target storage queue and improves the management efficiency of the output information in the target storage queue.

[0052] Furthermore, by removing the second output information from the target storage queue, that is, removing the second output information predicted by the earliest iterative model for the target sample from the target storage queue, the impact of the differential output information predicted by the early iterative model on the model iteration update can be reduced, and the model training effect can be improved when the data diversity based on the target sample is increased.

[0053] In one embodiment, the N historical iteration models are the N models obtained by updating the preset initial model in the iNth to i-1th iterations.

[0054] In this embodiment, by defining N historical iteration models as the N models obtained from updating the preset initial model in the iNth to i-1th iterations, that is, defining N historical iteration models as the N consecutive historical iteration models before the preset initial model in the ith iteration, the impact of the target sample input to the N historical iteration models predicted by the N output information on the model iteration update can be further reduced.

[0055] In one embodiment, the value of N ranges from 15 to 25.

[0056] In this embodiment, when the value of N is in the range of 15 to 25, it can not only effectively increase the data diversity based on the target sample, but also reduce the impact of the differential output information predicted by the early iterative model on the model iteration update when the value of N is too large.

[0057] When N is 20, the above N output information results in a better training effect on the model.

[0058] In one embodiment, the N output information items included in the target storage queue before the update are arranged based on a first sorting relationship, which is the chronological order of the iteration update times of the N historical iteration models.

[0059] In this embodiment, the N output information items included in the target storage queue can be sorted. Specifically, the N output information items can be sorted according to the order of the iteration update times of the N historical iteration models, so as to improve the update efficiency when updating the target storage queue.

[0060] For example, if the target storage queue contains N output information items P1, P2, ..., Pn, and these N output information items are not sorted, then determining the second output information from these N output information items requires a query method. After the query determines the second output information, it needs to be deleted from the target storage queue. This second output information is the output information that needs to be deleted from the target storage queue when updating it. However, by sorting the N output information items, the output information to be deleted can be determined directly based on the sorting relationship of the N output information items, effectively improving the update efficiency when updating the target storage queue.

[0061] In one embodiment, the step of iteratively updating the first model based on the second set of output information to obtain the second model includes:

[0062] Calculate the loss function value based on the second set of output information;

[0063] The parameters of the first model are updated based on the loss function value to obtain the updated second model.

[0064] In this embodiment, the parameters of the first model can be updated by calculating the loss function value to obtain the updated second model. Moreover, by calculating the loss function value based on the second set of output information, compared to calculating the loss function value based solely on the first output information, the data diversity for calculating the loss function value can be effectively improved, thereby enhancing the training effect of the model.

[0065] In addition, after obtaining the updated second model, the second model can be used as the first model, and steps S101 to S103 can be repeated until the model converges, thus completing the training and update of the model.

[0066] Please see Figure 2 , Figure 2 This is a schematic diagram of a model training structure provided in this disclosure. For example... Figure 2 As shown, it includes the following steps:

[0067] First, the sample data is input into the model, and the feature extractor is used to extract features to obtain the output information predicted by the current model.

[0068] Secondly, the output information predicted by the current model is updated to the storage queue using a first-in-first-out queue update method;

[0069] Finally, repeat the above iterative process, and use the output information predicted by the current model and the multiple output information stored in the storage queue to calculate the loss function value and complete the model update.

[0070] The storage queue pre-stores multiple output information, which are the output information obtained by inputting sample data into multiple historical models.

[0071] In one embodiment, the target model can be a visual recognition model applied to autonomous vehicles, and the target samples can be image data collected by the image acquisition device of the autonomous vehicle. The image data can be obstacle images, traffic light images, etc. The first model can be defined as M. i The first model can be the initial model of the visual recognition model, updated in the i-th iteration; and N historical iteration models can be defined as M. i-1 M i-2 ... M i-N M i-1 M i-2 ... M i-N It can be N models obtained by iteratively updating the initial model of the visual recognition model before the i-th iteration update.

[0072] Specifically, when the target sample is an obstacle image, the acquired obstacle image used to train the visual recognition model can be input into M. i Image classification prediction is performed to obtain the first image classification information P. i The obstacle images can also be input into N historical iterative models for information prediction, resulting in N image classification information, which can be represented as P. i-1 Pi-2 ... P i-N That is, the target storage queue before the update contains P. i-1 P i-2 ... P i-N The first set of output information, and P in the first set of output information i-1 P i-2 ... P i-N The output information can be sorted according to the chronological order of the iteration update time of the historical iterative model corresponding to each output information, where P i-N The image classification information predicted by the earliest iterative model is updated, while P... i-1 The image classification information predicted by the historical iteration model with the latest iteration update time;

[0073] Then P i When adding to the target storage queue, P in the target storage queue will also be removed. i-N Remove from the target storage queue to obtain the updated target storage queue, thereby updating the target storage queue. The updated target storage queue stores items including P. i P i-1 ... P i-(N-1) The second set of output information;

[0074] The second set of output information is used to iteratively update the first model to obtain the second model, i.e., model M. i+1 Then repeat the above process until the model converges, completing the model training and update.

[0075] It is understandable that when the target sample is a text sample, the corresponding text recognition model can also be trained. Moreover, when training the text recognition model in the above way, the number of text training samples required can be effectively reduced, and the text recognition model can be enriched.

[0076] In this disclosure, since the second set of output information includes N-1 output information obtained by inputting the target sample into N-1 historical iterative models for information prediction, when iterating and updating the first model based on the second set of output information, compared with iterating and updating the first model based only on the first output information, it can effectively enrich the data diversity for iteratively updating the first model.

[0077] Please see Figure 3a , Figure 3a This disclosure provides a target model training device, such as... Figure 3a As shown, the target model training device 300 includes:

[0078] Prediction module 301 is used to input target samples into a first model for information prediction and obtain first output information. The target samples include images or text, and the information prediction includes image classification or text classification. The first model is a model obtained by updating a preset initial model in the i-th iteration, where i is a positive integer.

[0079] The first update module 302 is used to add the first output information to the target storage queue and update the first set of output information stored in the target storage queue to obtain the second set of output information stored in the target storage queue. The first set of output information includes N output information obtained by inputting the target sample into N historical iterative models for information prediction. The second set of output information includes the first output information and N-1 output information. The N-1 output information is the output information obtained by deleting one of the N output information. The N historical iterative models are N models in i-1 historical iterative models. The i-1 historical iterative models are i-1 models obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i.

[0080] The second update module 303 is used to iteratively update the first model based on the second set of output information to obtain the second model;

[0081] The second model is used to predict information from the model input.

[0082] In one embodiment, the first update module 302 is specifically used to add the first output information to the target storage queue, and at the same time replace the second output information in the first group of output information with the first output information to obtain the second group of output information stored in the target storage queue.

[0083] Wherein, the second output information is the output information obtained by inputting the target sample into the target historical iterative model for information prediction, and the target historical iterative model is the iterative model with the earliest iteration update time among the N historical iterative models.

[0084] In one embodiment, the N historical iteration models are the N models obtained by updating the preset initial model in the iNth to i-1th iterations.

[0085] In one embodiment, the N output information items included in the target storage queue before the update are arranged based on a first sorting relationship, which is the chronological order of the iteration update times of the N historical iteration models.

[0086] In one embodiment, such as Figure 3bAs shown, the second update module 303 includes:

[0087] Calculation unit 3031 is used to calculate the loss function value based on the second set of output information;

[0088] The update unit 3032 is used to update the parameters of the first model based on the loss function value to obtain the updated second model.

[0089] The target model training device provided in this disclosure can realize all the processes of the target model training method provided in this disclosure and achieve the same technical effect. To avoid repetition, it will not be described in detail here.

[0090] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0091] The aforementioned electronic device includes: 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, the instructions being executed by the at least one processor to enable the at least one processor to execute the target model training method provided in this disclosure.

[0092] The aforementioned readable storage medium stores computer instructions, wherein the computer instructions are used to cause the computer to execute the target model training method provided in this disclosure.

[0093] The aforementioned computer program product includes a computer program that, when executed by a processor, implements the target model training method provided in this disclosure.

[0094] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0095] like Figure 4As shown, device 400 includes a computing unit 401, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 402 or a computer program loaded from storage unit 408 into random access memory (RAM) 403. RAM 403 may also store various programs and data required for the operation of device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0096] Multiple components in device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of monitors, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices through computer grids such as the Internet and / or various telecommunications grids.

[0097] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as the target model training method. For example, in some embodiments, the target model training method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the target model training method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the target model training method by any other suitable means (e.g., by means of firmware).

[0098] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0099] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0100] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or grid browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication mesh). Examples of communication meshes include local area networks (LANs), wide area networks (WANs), and the Internet.

[0103] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact through a communication mesh. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0104] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0105] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for training a target model, comprising: The target sample is input into the first model for information prediction to obtain the first output information. The target sample includes images or text. The information prediction includes image classification or text classification. The first model is a model obtained by updating a preset initial model in the i-th iteration, where i is a positive integer. The first output information is added to the target storage queue, and the first set of output information stored in the target storage queue is updated to obtain the second set of output information stored in the target storage queue. The first set of output information includes N output information obtained by inputting the target sample into N historical iterative models for information prediction. The second set of output information includes the first output information and N-1 output information. The N-1 output information is obtained by deleting one of the N output information. The N historical iterative models are N models in i-1 historical iterative models. The i-1 historical iterative models are i-1 models obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i. The value range of N is 15 to 25. The first model is iteratively updated based on the second set of output information to obtain the second model; The second model is used to predict information from the model input; The target storage queue also includes multiple difficult positive samples and multiple difficult negative samples of the target sample, and both the first set of output information and the second set of output information include multiple difficult positive samples and multiple difficult negative samples of the target sample. The step of iteratively updating the first model based on the second set of output information to obtain the second model includes: Calculate the loss function value based on the second set of output information; The parameters of the first model are updated based on the loss function value to obtain the updated second model.

2. The method according to claim 1, wherein, The step of adding the first output information to the target storage queue and updating the first set of output information stored in the target storage queue to obtain the second set of output information stored in the target storage queue includes: The first output information is added to the target storage queue, and the second output information in the first set of output information is replaced with the first output information to obtain the second set of output information stored in the target storage queue. Wherein, the second output information is the output information obtained by inputting the target sample into the target historical iterative model for information prediction, and the target historical iterative model is the iterative model with the earliest iteration update time among the N historical iterative models.

3. The method according to claim 2, wherein, The N historical iteration models are the N models obtained by updating the preset initial model from the iNth to the i-1th iteration.

4. The method according to any one of claims 1 to 3, wherein, Prior to the update, the N output information items included in the target storage queue are arranged based on a first sorting relationship, which is the chronological order of the iteration update times of the N historical iteration models.

5. A target model training device, comprising: The prediction module is used to input the target sample into the first model for information prediction and obtain the first output information. The target sample includes an image or text, and the information prediction includes image classification or text classification. The first model is a model obtained by updating a preset initial model in the i-th iteration, where i is a positive integer. The first update module is used to add the first output information to the target storage queue and update the first set of output information stored in the target storage queue to obtain the second set of output information stored in the target storage queue. The first set of output information includes N output information obtained by inputting the target sample into N historical iterative models for information prediction. The second set of output information includes the first output information and N-1 output information. The N-1 output information is obtained by deleting one of the N output information. The N historical iterative models are N models in i-1 historical iterative models. The i-1 historical iterative models are i-1 models obtained by updating the preset initial model from the 1st to the i-1th iteration. N is an integer greater than 1 and less than i. The value range of N is 15 to 25. The second update module is used to iteratively update the first model based on the second set of output information to obtain the second model. The second model is used to predict information from the model input; The target storage queue also includes multiple difficult positive samples and multiple difficult negative samples of the target sample, and both the first set of output information and the second set of output information include multiple difficult positive samples and multiple difficult negative samples of the target sample. The second update module includes: The calculation unit is used to calculate the loss function value based on the second set of output information; The update unit is used to update the parameters of the first model based on the loss function value to obtain the updated second model.

6. The apparatus according to claim 5, wherein, The first update module is specifically used to add the first output information to the target storage queue, and at the same time replace the second output information in the first set of output information with the first output information to obtain the second set of output information stored in the target storage queue; Wherein, the second output information is the output information obtained by inputting the target sample into the target historical iterative model for information prediction, and the target historical iterative model is the iterative model with the earliest iteration update time among the N historical iterative models.

7. The apparatus according to claim 6, wherein, The N historical iteration models are the N models obtained by updating the preset initial model from the iNth to the i-1th iteration.

8. The apparatus according to any one of claims 5 to 7, wherein, Prior to the update, the N output information items included in the target storage queue are arranged based on a first sorting relationship, which is the chronological order of the iteration update times of the N historical iteration models.

9. An electronic device, comprising: At least one processor; as well as 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 to enable the at least one processor to perform the method of any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 4.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 4.