CN116452861A - Target model training method and device and electronic equipment - Google Patents

Target model training method and device and electronic equipment Download PDF

Info

Publication number
CN116452861A
CN116452861A CN202310319875.7A CN202310319875A CN116452861A CN 116452861 A CN116452861 A CN 116452861A CN 202310319875 A CN202310319875 A CN 202310319875A CN 116452861 A CN116452861 A CN 116452861A
Authority
CN
China
Prior art keywords
output information
model
updating
target
iterative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310319875.7A
Other languages
Chinese (zh)
Inventor
刘家伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202310319875.7A priority Critical patent/CN116452861A/en
Publication of CN116452861A publication Critical patent/CN116452861A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/353Clustering; Classification into predefined classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The disclosure provides a target model training method, a target model training device and electronic equipment, relates to the technical field of artificial intelligence, and particularly relates to the technical fields of computer vision, image processing, deep learning and the like. The specific implementation scheme is as follows: inputting a target sample into a first model to perform information prediction to obtain first output information, wherein the target sample comprises an image or a text, the information prediction comprises image classification or text classification, the first model is a model obtained by updating a preset initial model in the ith iteration, and i is a positive integer; adding the first output information to a target storage queue, and updating the first group of output information stored in the target storage queue to obtain a second group of output information stored in the target storage queue; and iteratively updating the first model based on the second group of output information to obtain a second model. The method and the device can effectively enrich the data diversity of iterative updating of the first model.

Description

Target model training method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision, image processing, deep learning and the like, and particularly relates to a target model training method, a target model training device and electronic equipment.
Background
With the development and progress of artificial intelligence technology, various network models based on deep learning are widely applied in various fields. In the training process of the network model, a large number of training samples are usually required to be collected so as to train the network model based on the collected training samples until the network model converges and meets the use requirement of a user.
Disclosure of Invention
The disclosure provides a target model training method and device and electronic equipment.
According to an aspect of the present disclosure, there is provided a target model training method, including:
inputting a target sample into a first model to perform information prediction to obtain first output information, wherein the target sample comprises an image or a text, the information prediction comprises image classification or text classification, the first model is a model obtained by updating a preset initial model in the ith iteration, and i is a positive integer;
adding the first output information to a target storage queue, updating a first group of output information stored in the target storage queue to obtain a second group of output information stored in the target storage queue, wherein the first group of output information comprises N pieces of output information obtained by inputting the target sample into N historical iterative models for information prediction, the second group of output information comprises the first output information and N-1 pieces of output information, the N-1 pieces of output information are output information obtained by deleting one piece of output information from the N pieces of 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 carrying out iterative updating on the preset initial model from the 1 st time to the i-1 th time, and N is an integer which is larger than 1 and smaller than i;
iteratively updating the first model based on the second set of output information to obtain a second model;
the second model is used for carrying out information prediction on model input.
According to another aspect of the present disclosure, there is provided a target model training apparatus including:
the prediction module is used for inputting a target sample into a first model to perform information prediction to obtain first output information, wherein the target sample comprises an image or a text, the information prediction comprises image classification or text classification, the first model is a model obtained by updating a preset initial model in the ith iteration, and i is a positive integer;
the first updating module is used for adding the first output information to a target storage queue, updating a first group of stored output information in the target storage queue to obtain a second group of output information stored in the target storage queue, wherein the first group of output information comprises N output information obtained by inputting the target sample into N historical iterative models for information prediction, the second group of output information comprises 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 in 1 st to i-1 th iterations, and N is an integer greater than 1 and less than i;
the second updating module is used for carrying out iterative updating on the first model based on the second group of output information to obtain a second model;
the second model is used for carrying out information prediction on model input.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the object model training method provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the object model training method provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the object model training method provided by the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a method of training a target model provided by the present disclosure;
FIG. 2 is a schematic diagram of a model training architecture provided by the present disclosure;
3 a-3 b are block diagrams of a target model training apparatus provided by the present disclosure;
fig. 4 is a block diagram of an electronic device used to implement an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a flowchart of a target model training method provided in the present disclosure.
As shown in fig. 1, the method comprises the following steps:
step S101, inputting a target sample into a first model for information prediction to obtain first output information.
The first model may be understood as a model obtained by updating the preset initial model in the ith iteration, where i is a positive integer. For example, when the value of i is 50, the first model may be understood as a model obtained by the preset initial model at the 50 th iteration update, that is, the first model is a model obtained by the preset initial model at the 50 th iteration update.
The preset initial model can be various network models based on deep learning, and information prediction can be performed on model input. For example, the preset initial model may be a model for predicting image classification, or may be a model for predicting text classification, that is, the information prediction may be image classification, or may be text classification.
The above-mentioned target sample may be understood as a sample that iteratively updates the first model, and the type of the target sample may be determined based on the type of the preset initial model. For example, in the case where the preset initial model is a model for performing image classification prediction, the target sample may be an image; in the case where the preset initial model is a model for performing text classification prediction, the target sample may be text.
For example, when the target sample is an image, the output information of the image classification can be obtained when the target sample is input to the first model for information prediction. Correspondingly, when the target sample is text, and the target sample is input into the first model for information prediction, output information of text classification can be obtained.
Step S102, adding the first output information to a target storage queue, and updating the stored first group of output information in the target storage queue to obtain a second group of output information stored in the target storage queue.
The target storage queue may be a storage queue (memory bank) in a memory, that is, a storage queue stored in a memory in a form of a queue.
The first set of output information may be understood as a set of output information stored in the target storage queue prior to the update. The first set of output information may include N output information obtained by inputting a target sample into N historical iterative models for information prediction, where the N historical iterative models may be N models in the i-1 historical iterative models, and the i-1 historical iterative models may be i-1 models obtained by updating the preset initial model in 1 st to i-1 st iterations, where N is an integer greater than 1 and less than i.
The second set of output information may be understood as the set of output information stored in the target storage queue after the update. The second set of output information may include the first output information and N-1 output information, where the N-1 output information is output information obtained by deleting one of the N output information.
It will be appreciated that in the process of adding the first output information to the target storage queue to update the contents of the target storage queue, the contents stored in the target storage queue are updated from the first set of output information to the second set of output information.
Because the parameters of the model change after each iteration update, when the target sample is input into different historical iteration models for information prediction, different output information can be predicted, namely N output information predicted based on N historical iteration models has differences. Therefore, when the first model is iteratively updated by utilizing N-1 output information in the N output information and the first output information, the data diversity of the first model for iterative update can be effectively improved.
The target storage queue may further include a plurality of difficult positive samples and a plurality of difficult negative samples of the target sample, that is, the first set of output information and the second set of output information may each include a plurality of difficult positive samples and a plurality of difficult negative samples of the target sample, so as to reduce the influence of the N output information on iterative update of the model and improve the effect of model training.
And step S103, carrying out iterative updating on the first model based on the second group of output information to obtain a second model.
The second model may be used to predict information from the model inputs.
In the method, the second set of output information comprises N-1 output information obtained by inputting the target sample into the N-1 historical iterative models for information prediction, so that when the first model is subjected to iterative updating based on the second set of output information, the data diversity of the iterative updating of the first model can be effectively enriched compared with the iterative updating of the first model based on the first output information only.
In addition, because the N-1 output information is generated based on the target sample, no additional training sample is needed to be added to generate the corresponding N-1 information, so that additional data diversity is provided for model training, and meanwhile, the acquisition of the training sample is reduced.
It can be appreciated that as one target sample can enrich the data diversity of iterative updating of the first model, the number of training samples required is effectively reduced; therefore, the training process of the model can be completed without large-scale machine equipment with the same height as the video memory, and the cost of model training is effectively reduced.
In addition, the difference between the historical iteration models is utilized to enable the target samples to be input into the historical iteration models so as to predict the obtained differential output information, and additional data diversity is provided for iterative updating of the first model.
In the disclosure, the method may be applied to an electronic device, where all steps included in the method are performed by the electronic device, and the electronic device may be an electronic device such as a server, a computer, a mobile phone, and the like.
In one embodiment, adding the first output information to a target storage queue, and updating the stored first set of output information in the target storage queue to obtain the second set of output information stored in the target storage queue includes:
adding the first output information to a target storage queue, and simultaneously replacing second output information in a first group of output information with the first output information to obtain a second group of output information stored in the target storage queue;
the second output information is output information obtained by information prediction of the target sample input to a target historical iterative model, and the target historical iterative model is an iterative model with earliest iterative update time in the N historical iterative models.
In this embodiment, in the process of updating the target storage queue, when the first output information is added to the target storage queue, the second output information in the first group of output information is replaced by 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 target sample is removed from the iteration model with the earliest iteration update time, so that first-in first-out management of the output information in the target storage queue is realized, and management efficiency of the output information in the target storage queue is improved.
In addition, by removing the second output information from the target storage queue, that is, removing the second output information predicted by the iteration model with the earliest iteration update time for the target sample from the target storage queue, the influence of the differential output information predicted by the early iteration model on the iteration update of the model can be reduced, and the training effect of the model can be improved under the condition of increasing data diversity based on the target sample.
In one embodiment, the N historical iterative models are N models obtained by updating the preset initial model in the ith-N to ith-1 th iterations.
In this embodiment, the influence of the target sample input to the N output information predicted by the N historical iterative models on the model iterative update can be further reduced by defining the N historical iterative models as N models obtained by updating the preset initial model in the i-N to i-1 iterations, that is, defining the N historical iterative models as N continuous historical iterative models of the preset initial model before the i-th iterative update.
In one embodiment, N is in the range of 15 to 25.
In this embodiment, when the value range of N is 15 to 25, not only the data diversity based on the target sample can be effectively increased, but also the influence of the differential output information obtained by early iterative model prediction on the model iterative update can be reduced when the value of N is too large.
When the value of N is 20, the training effect of the N output information on the model is better.
In one embodiment, the N output information included in the target storage queue prior to the updating is arranged based on a first ordering relationship, the first ordering relationship being a chronological order of iterative update times of the N historical iterative models.
In this embodiment, the N output information may be ordered by ordering the N output information included in the target storage queue, and specifically, the N output information may be ordered based on the order of iteration update times of the N historical iteration models, so as to improve update efficiency when the target storage queue is updated.
For example, when the N pieces of output information stored in the target storage queue are P1, P2, … …, and Pn, if the N pieces of output information are not ordered, determining the second output information from the N pieces of output information by means of a query is needed, so that the second output information is deleted from the target storage queue after the query is determined, where the second output information is the output information that needs to be deleted from the target storage queue when the target storage queue is updated; by sequencing the N pieces of output information, the output information to be deleted can be determined directly based on the sequencing relation of the N pieces of output information, so that the updating efficiency of the target storage queue in updating is effectively improved.
In one embodiment, the iteratively updating the first model based on the second set of output information to obtain a second model includes:
calculating a loss function value based on the second set of output information;
and updating parameters of the first model based on the loss function value to obtain an updated second model.
In this embodiment, the parameters of the first model may be updated by calculating the loss function value so as to obtain an updated second model. Moreover, by calculating the loss function value based on the second set of output information, the data diversity of calculating the loss function value can be effectively improved, and the training effect of the model can be further improved, compared with the case of calculating the loss function value based on the first output information only.
In addition, after obtaining the updated second model, the second model may be used as the first model, and the steps from step S101 to step S103 may be repeatedly performed until the model converges, so as to complete the training update of the model.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a model training provided in the present disclosure. As shown in fig. 2, the method comprises the following steps:
firstly, inputting sample data into a model, and extracting features by using a feature extractor to obtain output information obtained by predicting a current model;
secondly, updating output information obtained by predicting the current model to a storage queue in a first-in first-out queue updating mode;
finally, repeating the iterative process, calculating a loss function value by utilizing the output information obtained by the current model prediction and a plurality of output information stored in a storage queue, and finishing model updating;
the storage queue stores a plurality of pieces of output information in advance, wherein the plurality of pieces of output information are output information obtained by predicting sample data input into a plurality of historical models.
In one embodiment, the target model may be a visual recognition model applied to an autonomous vehicle, the target sample may be image data acquired by an image acquisition device of the autonomous vehicle, the image data may be an obstacle image, a traffic light image, or the like. And may define the first model as M i The first model may be a model obtained by updating an initial model of the visual recognition model in the ith iteration; can be used forDefining N historical iteration models as M i-1 、M i-2 、……、M i-N ;M i-1 、M i-2 、……、M i-N There may be N models obtained by iteratively updating the initial model of the visual recognition model before the ith iterative update.
Specifically, in the case where the target sample is an obstacle image, the acquired obstacle image for training the visual recognition model may be input to M i To obtain first image classification information P i The method comprises the steps of carrying out a first treatment on the surface of the The obstacle images can also be respectively input into N historical iterative models for information prediction, N image classification information can be obtained, and the N image classification information can be expressed as P i-1 、P i-2 、……、P i-N I.e. the target storage queue prior to updating stores a data stream comprising P i-1 、P i-2 、……、P i-N And P in the first set of output information i-1 、P i-2 、……、P i-N Can be ordered according to the sequence of the iterative update time of the historical iterative model corresponding to each output information, wherein P i-N For the image classification information predicted by the historical iteration model with earliest iteration update time, and P i-1 Image classification information predicted by the historical iteration model with the latest iteration update time is obtained;
and then P is added i When the P-type buffer is added to the target storage queue, P in the target storage queue is simultaneously added i-N Removing from the target storage queue to obtain an updated target storage queue, thereby realizing the updating of the target storage queue, wherein the updated target storage queue stores the data comprising P i 、P i-1 、……、P i-(N-1) Is a second set of output information;
wherein the second set of output information is used for iteratively updating the first model to obtain a second model, namely a model M i+1 The method comprises the steps of carrying out a first treatment on the surface of the And repeating the process until the model converges, and finishing the training update of the model.
It can be appreciated that, in the case that the target sample is a text sample, the training process of the corresponding text recognition model can also be implemented; moreover, when the text recognition model is trained by adopting the mode, the number of required text training samples can be effectively reduced, and the text recognition model of the text recognition model is enriched.
In the method, the second set of output information comprises N-1 output information obtained by inputting the target sample into the N-1 historical iterative models for information prediction, so that when the first model is subjected to iterative updating based on the second set of output information, the data diversity of the iterative updating of the first model can be effectively enriched compared with the iterative updating of the first model based on the first output information only.
Referring to fig. 3a, fig. 3a is a target model training apparatus provided in the present disclosure, and as shown in fig. 3a, a target model training apparatus 300 includes:
the prediction module 301 is configured to input a target sample to a first model to perform information prediction, so as to obtain first output information, where the target sample includes an image or a text, the information prediction includes image classification or text classification, the first model is a model obtained by updating a preset initial model in an ith iteration, and i is a positive integer;
a first updating module 302, configured to add the first output information to a target storage queue, and update a first set of output information stored in the target storage queue, to obtain a second set of output information stored in the target storage queue, where the first set of output information includes N output information obtained by inputting the target sample to 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 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 in 1 st to i-1 st iterations, and N is an integer greater than 1 and less than i;
a second updating module 303, configured to iteratively update the first model based on the second set of output information, to obtain a second model;
the second model is used for carrying out information prediction on model input.
In one embodiment, the first updating module 302 is specifically configured to add the first output information to a target storage queue, and replace second output information in a first set of output information with the first output information, so as to obtain a second set of output information stored in the target storage queue;
the second output information is output information obtained by information prediction of the target sample input to a target historical iterative model, and the target historical iterative model is an iterative model with earliest iterative update time in the N historical iterative models.
In one embodiment, the N historical iterative models are N models obtained by updating the preset initial model in the ith-N to ith-1 th iterations.
In one embodiment, the N output information included in the target storage queue prior to the updating is arranged based on a first ordering relationship, the first ordering relationship being a chronological order of iterative update times of the N historical iterative models.
In one embodiment, as shown in fig. 3b, the second updating module 303 includes:
a calculation unit 3031 for calculating a loss function value based on the second set of output information;
and an updating unit 3032, configured to update parameters of the first model based on the loss function value, to obtain an updated second model.
The target model training device provided by the disclosure can realize each process realized by the target model training method provided by the disclosure, and achieve the same technical effect, and for avoiding repetition, the description is omitted here.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Wherein, above-mentioned electronic equipment includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the object model training method provided by the present disclosure.
The readable storage medium stores computer instructions for causing the computer to perform the object model training method provided by the present disclosure.
The computer program product described above includes a computer program that, when executed by a processor, implements the object model training method provided by the present disclosure.
Fig. 4 illustrates a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In RAM 403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer grid, such as the internet, and/or various telecommunications grids.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized 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 object model training method. For example, in some embodiments, the object model training method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the object 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).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These 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 the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a grid browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication grid). Examples of communication grids include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communications grid. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (13)

1. A method of training a target model, comprising:
inputting a target sample into a first model to perform information prediction to obtain first output information, wherein the target sample comprises an image or a text, the information prediction comprises image classification or text classification, the first model is a model obtained by updating a preset initial model in the ith iteration, and i is a positive integer;
adding the first output information to a target storage queue, updating a first group of output information stored in the target storage queue to obtain a second group of output information stored in the target storage queue, wherein the first group of output information comprises N pieces of output information obtained by inputting the target sample into N historical iterative models for information prediction, the second group of output information comprises the first output information and N-1 pieces of output information, the N-1 pieces of output information are output information obtained by deleting one piece of output information from the N pieces of 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 carrying out iterative updating on the preset initial model from the 1 st time to the i-1 th time, and N is an integer which is larger than 1 and smaller than i;
iteratively updating the first model based on the second set of output information to obtain a second model;
the second model is used for carrying out information prediction on model input.
2. The method of claim 1, wherein the adding the first output information to a target storage queue and updating the stored first set of output information in the target storage queue to obtain the stored second set of output information of the target storage queue comprises:
adding the first output information to a target storage queue, and simultaneously replacing second output information in a first group of output information with the first output information to obtain a second group of output information stored in the target storage queue;
the second output information is output information obtained by information prediction of the target sample input to a target historical iterative model, and the target historical iterative model is an iterative model with earliest iterative update time in the N historical iterative models.
3. The method of claim 2, wherein the N historical iterative models are the resulting N models updated on the i-N to i-1 th iterations of the preset initial model.
4. A method according to any one of claims 1 to 3, wherein the N output information comprised by the target storage queue prior to the updating is arranged based on a first ordering relation, the first ordering relation being a chronological order of iterative update times of the N historical iterative models.
5. A method according to any one of claims 1 to 3, wherein said iteratively updating said first model based on said second set of output information results in a second model, comprising:
calculating a loss function value based on the second set of output information;
and updating parameters of the first model based on the loss function value to obtain an updated second model.
6. A target model training apparatus comprising:
the prediction module is used for inputting a target sample into a first model to perform information prediction to obtain first output information, wherein the target sample comprises an image or a text, the information prediction comprises image classification or text classification, the first model is a model obtained by updating a preset initial model in the ith iteration, and i is a positive integer;
the first updating module is used for adding the first output information to a target storage queue, updating a first group of stored output information in the target storage queue to obtain a second group of output information stored in the target storage queue, wherein the first group of output information comprises N output information obtained by inputting the target sample into N historical iterative models for information prediction, the second group of output information comprises 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 in 1 st to i-1 th iterations, and N is an integer greater than 1 and less than i;
the second updating module is used for carrying out iterative updating on the first model based on the second group of output information to obtain a second model;
the second model is used for carrying out information prediction on model input.
7. The apparatus of claim 5, wherein the first updating module is specifically configured to add the first output information to a target storage queue, and replace second output information in a first set of output information with the first output information, so as to obtain a second set of output information stored in the target storage queue;
the second output information is output information obtained by information prediction of the target sample input to a target historical iterative model, and the target historical iterative model is an iterative model with earliest iterative update time in the N historical iterative models.
8. The apparatus of claim 7, wherein the N historical iterative models are the resulting N models updated on the preset initial model at the i-N to i-1 th iterations.
9. The apparatus of any of claims 6 to 8, wherein the N output information included in the target storage queue prior to the update is arranged based on a first ordering relationship, the first ordering relationship being a chronological order of iterative update times of the N historical iterative models.
10. The apparatus of any of claims 6 to 8, wherein the second update module comprises:
a calculation unit for calculating a loss function value based on the second set of output information;
and the updating unit is used for updating the parameters of the first model based on the loss function value to obtain an updated second model.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1 to 5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
CN202310319875.7A 2023-03-29 2023-03-29 Target model training method and device and electronic equipment Pending CN116452861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310319875.7A CN116452861A (en) 2023-03-29 2023-03-29 Target model training method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310319875.7A CN116452861A (en) 2023-03-29 2023-03-29 Target model training method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116452861A true CN116452861A (en) 2023-07-18

Family

ID=87129489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310319875.7A Pending CN116452861A (en) 2023-03-29 2023-03-29 Target model training method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116452861A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644781A (en) * 2023-07-27 2023-08-25 美智纵横科技有限责任公司 Model compression method, data processing device, storage medium and chip

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644781A (en) * 2023-07-27 2023-08-25 美智纵横科技有限责任公司 Model compression method, data processing device, storage medium and chip
CN116644781B (en) * 2023-07-27 2023-09-29 美智纵横科技有限责任公司 Model compression method, data processing device, storage medium and chip

Similar Documents

Publication Publication Date Title
CN113538235B (en) Training method and device for image processing model, electronic equipment and storage medium
CN114187459A (en) Training method and device of target detection model, electronic equipment and storage medium
CN114693934B (en) Training method of semantic segmentation model, video semantic segmentation method and device
CN114118287A (en) Sample generation method, sample generation device, electronic device and storage medium
CN115147680B (en) Pre-training method, device and equipment for target detection model
CN114020950A (en) Training method, device and equipment of image retrieval model and storage medium
CN113627536A (en) Model training method, video classification method, device, equipment and storage medium
CN115456167A (en) Lightweight model training method, image processing device and electronic equipment
CN112528995A (en) Method for training target detection model, target detection method and device
CN116452861A (en) Target model training method and device and electronic equipment
CN115631381A (en) Classification model training method, image classification device and electronic equipment
CN113792876B (en) Backbone network generation method, device, equipment and storage medium
CN114239853A (en) Model training method, device, equipment, storage medium and program product
CN113033408B (en) Data queue dynamic updating method and device, electronic equipment and storage medium
CN113657468A (en) Pre-training model generation method and device, electronic equipment and storage medium
CN113344213A (en) Knowledge distillation method, knowledge distillation device, electronic equipment and computer readable storage medium
CN117351299A (en) Image generation and model training method, device, equipment and storage medium
CN117540625A (en) Training method and device for correction model of sea wave numerical forecast data
CN115759209B (en) Quantification method and device of neural network model, electronic equipment and medium
CN115186738B (en) Model training method, device and storage medium
CN114817476A (en) Language model training method and device, electronic equipment and storage medium
CN114330576A (en) Model processing method and device, and image recognition method and device
CN112560987A (en) Image sample processing method, device, equipment, storage medium and program product
CN113361574A (en) Training method and device of data processing model, electronic equipment and storage medium
CN113361575A (en) Model training method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination