Methods, media, and electronic devices for model training

CN120976664BActive Publication Date: 2026-05-26FUSHAN INTELLIGENT INFORMATION TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUSHAN INTELLIGENT INFORMATION TECHNOLOGY (BEIJING) CO LTD
Filing Date
2025-05-28
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing model training methods result in wasted computational resources on low-value samples, slow model convergence, low training efficiency, and difficulty in effectively identifying and utilizing high-value samples, thus limiting the improvement of model performance.

Method used

By analyzing the impact of candidate samples on the current dynamic parameters of the model to be trained, samples with high training value are dynamically selected and scheduled, while low-value samples are eliminated. Gradient flow dynamics features are used to guide sample selection, thereby achieving dynamic scheduling.

Benefits of technology

It improves model training efficiency, enhances the model's ability to identify and generalize on sparse samples, avoids wasting computing resources, and promotes rapid model convergence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976664B_ABST
    Figure CN120976664B_ABST
Patent Text Reader

Abstract

A method, medium, and electronic device for model training are disclosed. The method includes: acquiring multiple samples and using these samples as candidate samples to obtain multiple candidate samples; determining the current training value of each candidate sample based on its influence on the current dynamic parameters of the model to be trained; selecting a portion of the samples from the multiple candidate samples as current training samples based on their current training values; providing the current training samples as input to the model to be trained; calculating loss based on the output of the model to be trained; and updating the model parameters of the model to be trained based on the result of the loss calculation. The technical solution provided by this disclosure helps to concentrate computational resources during the training process on candidate samples with higher current training value, thereby improving the training efficiency of the model and enhancing its performance in terms of sparse sample recognition and generalization capabilities.
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, and in particular to a method for implementing model training, a computer-readable storage medium, and an electronic device. Background Technology

[0002] The samples used for model training (especially model pre-training) typically include high-value samples and low-value samples. High-value samples are key samples that have high informational value for model training and can significantly improve model training efficiency and performance (such as model recognition ability and model generalization ability). Low-value samples can be considered as regular samples, normal samples, or background samples. For example, for medical image analysis models, high-value samples include rare lesion image samples, while low-value samples include common lesion image samples. Similarly, for autonomous driving models, high-value samples include irregular obstacle samples and rare traffic sign samples, while low-value samples include common traffic sign samples and common traffic facility samples. The number of low-value samples in the sample set used for model training is usually far greater than the number of high-value samples, causing the high-value samples to be overwhelmed by the low-value samples. For example, from the perspective of sample distribution, high-value samples in the sample set are usually located in the long-tail region or sparse region of the sample distribution.

[0003] Current model training typically selects samples from the sample set in the following three ways:

[0004] 1. The RS (Random Sampling) method is to select samples from the sample set by means of random selection.

[0005] Second, the OHEM (Hard Example Mining) approach focuses on samples that the model predicts incorrectly or have high loss values.

[0006] Third, the FCL (Fixed Curriculum Learning) method identifies the learning difficulty of samples and distinguishes the learning difficulty of samples based on the identification results. Then, samples can be provided to the model in a preset order from easy to difficult.

[0007] The above method often results in most of the computing resources (such as GPU (Graphics Processing Unit) computation time and memory) being wasted on a large number of repetitive, low-value samples that contribute little to improving model performance, leading to slow model convergence and poor training efficiency.

[0008] In the second approach described above, where high-value samples are extremely sparse, the hard samples mined often include a large number of non-high-value samples, such as noise samples, mislabeled samples, and trivial hard samples, without truly focusing on high-value samples. Furthermore, frequently calculating the loss of each sample for sample selection incurs significant computational overhead.

[0009] The above method three does not distinguish between low-value samples that are difficult to learn and high-value samples that are difficult to learn. Furthermore, based on a fixed curriculum that provides samples from easy to difficult, it may not be able to adapt to the dynamic changes in the learning state and ability of the model during the training process.

[0010] As described above, the existing method of selecting samples from a sample set to train the model (especially pre-training) is not conducive to efficient and high-quality model training. How to dynamically and efficiently identify more valuable samples for the current model's learning from a massive amount of samples during the model training process, so as to improve model training efficiency and model performance, is a technical problem worthy of attention. Summary of the Invention

[0011] To address the aforementioned technical problems, this disclosure is proposed. Embodiments of this disclosure provide a method, storage medium, and electronic device for implementing model training.

[0012] According to a first aspect of the present disclosure, a method for implementing model training is provided, the method comprising: acquiring a plurality of samples and using the plurality of samples as candidate samples to obtain a plurality of candidate samples; determining the current training value of each candidate sample based on the influence of each candidate sample on the current dynamic parameters of the model to be trained; selecting a portion of the samples from the plurality of candidate samples as current training samples based on the current training value of each candidate sample; providing the current training samples as input to the model to be trained; performing loss calculation based on the output of the model to be trained, and updating the model parameters of the model to be trained based on the result of the loss calculation.

[0013] According to a second aspect of the present disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program for implementing the above-described method.

[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described above.

[0015] Based on the above embodiments of this disclosure, a method, storage medium, and electronic device for implementing model training are provided. Since the gradient flow during model training has dynamic characteristics, and these dynamic characteristics are closely related to the learning state within the model, this disclosure can obtain the current training value of different candidate samples in the current iteration stage by analyzing the influence of candidate samples on the current dynamic parameters of the model to be trained. Because candidate samples with lower current training value contribute less to the current iteration stage of model training, while candidate samples with higher current training value contribute more, this disclosure can eliminate candidate samples with lower current training value by screening all candidate samples using their current training value. The method of selecting candidate samples with lower training value and retaining those with higher training value not only effectively distinguishes candidate samples but also dynamically schedules training samples. Since this dynamic scheduling is related to the model's current dynamic parameters, it can be considered to be related to the dynamic changes in the model's learning state during training. Therefore, this dynamic scheduling method can be considered as intelligent dynamic scheduling guided by the dynamic changes in the model's internal state. By using candidate samples with higher training value for model training (e.g., pre-training), it is beneficial to avoid the consumption of training resources by candidate samples with lower training value, thus promoting faster model convergence. Therefore, the technical solution provided in this disclosure helps to concentrate computational resources during training on candidate samples with higher training value, thereby improving model training efficiency and enhancing the model's performance in terms of sparse sample recognition and generalization capabilities.

[0016] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0017] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0018] Figure 1 This is a schematic diagram illustrating an application scenario of the method for implementing model training disclosed herein.

[0019] Figure 2 This is a schematic diagram of an embodiment of the method for implementing model training disclosed herein;

[0020] Figure 3 This is a schematic diagram of another embodiment of the method for implementing model training disclosed herein;

[0021] Figure 4 This is a schematic diagram of yet another embodiment of the method for implementing model training disclosed herein;

[0022] Figure 5 This is a schematic diagram of an embodiment of the apparatus for implementing model training disclosed herein;

[0023] Figure 6 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation

[0024] Example embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. It is obvious that the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure, and it should be understood that this disclosure is not limited to the example embodiments described herein.

[0025] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0026] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.

[0027] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.

[0028] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.

[0029] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.

[0030] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0031] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0032] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.

[0033] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0034] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0035] The embodiments of this disclosure can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate with a wide range of other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems, etc.

[0036] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can reside on local or remote computing system storage media, including storage devices.

[0037] This disclosure outlines

[0038] In realizing this disclosure, the inventors discovered that currently, the methods of providing samples to the model during model training are all static sampling methods, meaning that the strategy for providing samples to the model does not change during model training. However, the model's state changes dynamically during training. If we can accurately measure the true contribution of samples to the improvement of the current model state (such as representation ability), and determine the samples currently provided to the model based on the contribution obtained from the current measurement, it will be beneficial to provide more suitable samples to the model in the current iteration. This will help avoid problems such as limited model performance (e.g., poor recognition ability of the pre-trained representation model for sparse categories (e.g., recall or F1-score) and insufficient generalization ability) and low training efficiency.

[0039] Exemplary Overview

[0040] The method for model training disclosed herein can be applied to applications such as pre-training models for processing visual information and models for processing natural language. For example, it can be applied to applications for pre-training student and teacher networks using a self-distillation and SSL (Self-Supervised Learning) framework. A specific example of the application scenario where the method for model training disclosed herein is applicable to the pre-training of student and teacher networks using a self-distillation and SSL framework is as follows: Figure 1 As shown.

[0041] Figure 1 The "student model" in this context refers to the student network. Figure 1 The "teacher model" in this context refers to the teacher network. Both the student and teacher networks can use BYOL (Bootstrap Your Own Latent) or SimSiam (Simple Siamese) as the underlying SSL (Self-Supervised Learning) framework to achieve self-distillation learning. This means that the student and teacher networks employ self-distillation learning during pre-training, which can also be called self-distillation representation learning. Pre-training the student and teacher networks typically requires a large number of training samples. Figure 1 The “large-scale training data” shown on the left refers to the large-scale training samples.

[0042] Figure 1The student and teacher networks involved involve model learning dynamics, particularly representation learning dynamics. Specifically, this disclosure utilizes the model's dynamic equations to guide the selection of training samples, thereby facilitating the selection of samples more suitable for the current training of the student network.

[0043] Figure 1 "Data-representation dynamic equations" "That is, the dynamic equation based on representation obtained by performing dynamic modeling for the self-distillation representation learning method in this disclosure, and the data in "data-representation" can be regarded as sample data. Figure 1 The data-characterized dynamic equations in the model are based on the gradient flow dynamic equations (i.e., Figure 1 gradient flow equations and The process of deriving and obtaining the data-representation dynamic equations using the gradient flow dynamics equations is explained below:

[0044] Let the network parameters of the student network f be denoted as θ. f The network parameters of the teacher network g are represented as θ. g For a sample x in a large-scale training dataset, two different data augmentation methods, t1 and t2, can be used to augment the data, resulting in two distinct images, x1 and x2, where x1 = t1(x) and x2 = t2(x). One image is provided to the student network, and the other to the teacher network. For example, x1 is provided as input to the student network, while x2 is provided as input to the teacher network. The learning objective of the student network is to predict the output of the teacher network for image x2; that is, the output of the student network for image x1 should match the output of the teacher network for image x2 as closely as possible.

[0045] Network parameters θ of the student network f The loss function can be used to update the network parameters θ of the student network. f The loss function L(θ) of the student network is updated via gradient descent. f ) can be in the form of the following formula (1):

[0046]

[0047] In the above formula (1), L(θ) f ) represents the loss function value of the student network, which is obtained by optimizing the network parameters θ. f It can make L(θ) fThe smaller the value, the better; E[.] represents the expected value, and ||.|| 2 The vector's L2 norm squared; q(.) represents the function corresponding to the prediction head in the student network, and in some applications, q(.) can be optional; f(x1; θ) f ) represents the student network based on network parameter θ f The feature vector obtained by feature extraction processing of image x1; sg(.) indicates the stop-gradient operation, and sg(z2) indicates that the influence of the network structure after z2 on the gradient is not considered, and z2 = g(x2; θ g g(x2; θ) g ) represents the teacher network based on network parameters θ g The feature vector obtained by performing feature extraction on image x2.

[0048] The purpose of using the above formula (1) to update the network parameters of the student network includes: prompting the student network to make q(f(x1; θ) as close as possible to the network parameters of the student network. f )) is close to sg(z2).

[0049] The network parameters of the teacher network can be updated using the EMA (Exponential Moving Average) of the network parameters of the student network. Specifically, the method for updating the network parameters of the teacher network can be expressed in the form of the following formula (2):

[0050] θ g =m*θ g +(1-m)*θ f Formula (2)

[0051] In the above formula (2), θ g The network parameters of the teacher network are represented by m; the momentum coefficient is represented by θ. f This represents the network parameters of the student network.

[0052] From the above formulas (1) and (2), it can be seen that the network parameters of the teacher network can be updated by exponential moving average after minimizing the above formula (1). Furthermore, the gradient flow dynamics equation of the SSL architecture for self-distillation representation learning can be obtained from the above formulas (1) and (2). Figure 1 The gradient flow equation in the equation is shown in the following formula (3):

[0053]

[0054] In the above formula (3), The network parameter θ represents the student network. fThe derivative with respect to time, i.e., the network parameters θ of the student network. f Rate of change over time; The network parameter θ represents the student network. f The gradient operator; L(θ) f ) represents the loss function value of the student network; η represents a coefficient; The network parameters θ of the teacher network g The derivative with respect to time, i.e., the network parameters θ of the teacher network. g The rate of change over time; β represents another coefficient.

[0055] Let the correlation matrix F represent the second-order statistics of the student network output features, and assume that the student network output features have been centered. Then F can be expressed in the form of the following formula (4):

[0056]

[0057] In the above formula (4), F represents the representation correlation matrix, which represents the correlation structure between feature dimensions in the representation space formed by the student network for the input sample x; f(x) represents the mathematical expectation of the input sample x; f(x) represents the feature vector in the representation space obtained by the student network through feature extraction of the input sample x; f T (x) represents the transpose of f(x). By using formula (4) to solve for the mathematical expectation of all input samples x, we can obtain the correlation matrix F that reflects the feature dimensions in the representation space.

[0058] The dynamic evolution of F can reflect the learning process of the student network. The update of the network parameters of the student network can be regarded as a continuous time process (i.e., it can be regarded as a gradient flow), which is beneficial to the analysis of the dynamic evolution of F. The gradient flow equation can be expressed in the form of the following formula (5):

[0059]

[0060] In the above formula (5), The network parameter θ represents the student network. f The derivative with respect to time t, i.e., the network parameter θ f Rate of change over time t; Represents network parameter θ f The gradient operator; L(θ) f ) represents the loss function value of the student network.

[0061] Derive the change of F with time t (i.e., d) F / d t The process can be:

[0062] Based on the chain rule and the assumption of local linearization of the student network f (such as a deep neural network), the dynamic equation of F can be established. Specifically, an approximate form of the dynamic equation can be formed based on the Taylor expansion of the student network f, as shown in the following formula (6):

[0063] F(t+1)≈F(t)+η*ΔF(t) Formula (6)

[0064] In the above formula (6), F(t+1) represents the representation correlation matrix of the student network for the input sample at time t+1; F(t) represents the representation correlation matrix of the student network for the input sample at time t; η represents a coefficient, which can be a parameter that controls the step size when the student network updates the network parameters; ΔF(t) represents the increment of the representation correlation matrix at time t, and ΔF(t) usually depends on the network parameter θ of the student network at time t. s (t), the network parameters θ of the teacher network at time t g (t)(Network parameter θ) g (t) will indirectly affect the loss function value of the student network, as well as the input sample x that the student network is currently processing (at time t).

[0065] In the above formula (6), ΔF(t) is related to the gradient, that is, ΔF(t) is related to the following formula (7):

[0066]

[0067] In the above formula (7), The derivative of the correlation matrix F with respect to time is represented by the derivative of F, which can characterize the rate of change of F with time and reflect the dynamic characteristics of F. This represents the mathematical expectation of the input sample x; Represents network parameter θ f The gradient operator; f(x) represents the feature vector in the representation space obtained by the student network for feature extraction of input sample x; f T (x) denotes the transpose of f(x); The network parameter θ represents the student network. f The derivative with respect to time, i.e., the network parameters θ of the student network. f Rate of change over time; express The transpose of the matrix; R(x) is the higher-order term, that is, the part above the first order in the Taylor expansion.

[0068] From the above formula (7), it can be seen that ΔF(t) is related to the gradient of the loss function of the student network and the current input sample x.

[0069] Furthermore, drawing on the ideas of control theory or system dynamics, F can be transformed into the form of the following formula (8):

[0070]

[0071] In the above formula (8), Let F(t) be the time derivative of the commutator [F,G], where F,G = FG - GF. The commutator [F,G] describes the relationship between the representation correlation matrices F and G obtained by the student network and the teacher network for the input samples, respectively. K(t) represents the convergence matrix of the student network at time t, also known as the damping matrix, which determines the speed at which the network parameters of the student network converge to the steady state. S(t) represents the steady-state matrix of the representation obtained by the student network at time t, which determines the final steady-state position reached by the student network.

[0072] The above formula (8) is the final characterization-based dynamic equation, i.e. Figure 1 The data-representational dynamic equations in the model, where the convergence matrix K(t) and steady-state matrix S(t) in the model-representational dynamic equations can be considered as dynamic parameters, i.e., the dynamic parameters of the dynamic equations.

[0073] Steady-state matrix S(t) and steady-state F * Or [F,G] * The steady-state matrix S(t) is related to the quality of the final learned representation structure. An ideal representation should possess good properties, such as decoupling between feature dimensions (low correlation between feature dimensions), feature diversity, and the ability to distinguish different instances. The steady-state matrix S(t) is influenced by the input training samples. If a training sample x can push the model's steady-state matrix S(t) to a "better" position (e.g., improve the steady-state representation matrix F...), then the steady-state matrix S(t) will be affected. * To be closer to the identity matrix, or, for example, to make the representations obtained by the student network and the teacher network better aligned in steady state (e.g., making [F,G]...). * A matrix closer to zero or making F * If the sample deviates further from "ordinary", then it can be considered that the sample is more helpful in improving the performance of the model.

[0074] The convergence matrix K(t) determines the speed at which the model converges to a steady state. The convergence matrix K(t) is also affected by the input training samples. For example, if a training sample can make the eigenvalues ​​of the convergence matrix K(t) larger (i.e., the real part more negative), then the sample can be considered to help the model converge faster.

[0075] Figure 1Each sample in the training data affects the dynamic parameters (i.e., the convergence matrix K(t) and the steady-state matrix S(t)). This influence reflects the training value of the sample. In the sample selection process of iterative training, this disclosure uses the influence of the sample on the dynamic parameters of the current student network to measure the training value of the sample in this iteration, and performs sample selection based on the training value of each sample, forming a unique sample scheduling mechanism. This sample scheduling mechanism can be called dynamics-driven sample scheduling. Considering the influence of the sample on the convergence matrix K(t) and the steady-state matrix S(t) in the dynamic parameters, this sample scheduling mechanism can be called steady-state and convergence-driven sample scheduling. The sample scheduling mechanism of this disclosure is beneficial for selecting samples that are more conducive to model training, that is, for selecting samples with high training value (i.e.,... Figure 1 High-value data in the middle). Due to low-value training samples (i.e. Figure 1 Low-value data in training models are lacking in terms of steady-state gain and convergence performance, while high-value training samples perform better in terms of steady-state gain and convergence performance. Therefore, this disclosure selects samples based on the influence of training samples on the current dynamic parameters of the model during an iterative training process, which helps student and teacher networks achieve self-distillation learning more efficiently and with higher quality.

[0076] Exemplary methods

[0077] The method disclosed herein for implementing model training is typically applied in application scenarios that require training a model using a large number of samples, such as applications that pre-train a model. Using the method disclosed herein, samples can be dynamically scheduled based on the current state of the model to be trained, so as to provide more appropriate samples for training the model in some or all iterations.

[0078] Figure 2 This is a flowchart illustrating one embodiment of the method for implementing model training according to this disclosure. Figure 2 The method shown mainly includes the following steps: S200, S201, S202, S203, and S204. The following section details... Figure 2 Each step in the process will be explained separately.

[0079] S200. Obtain multiple samples and use them as candidate samples to obtain multiple candidate samples.

[0080] This disclosure allows for the selection of multiple samples from a pre-defined sample set. For example, multiple samples can be selected randomly or sequentially. The number of samples selected at once can be set according to actual needs. This disclosure can also obtain multiple samples by receiving externally input samples. Each obtained sample is used as a candidate sample, thus obtaining multiple candidate samples. These samples can be image-based samples, text-based samples, etc., specifically determined based on the sample requirements of the model to be trained.

[0081] S201. Determine the current training value of each candidate sample based on its impact on the current dynamic parameters of the model to be trained.

[0082] The training model in this disclosure can be a model that is trained using model learning dynamics during the training process; that is, the training model in this disclosure can be a model capable of dynamically modeling the learning process. In one example, the training model can be a student network and a teacher network employing a self-distillation and self-supervised learning framework. Alternatively, the training model can also be a model employing learning paradigms such as contrastive learning and masked image modeling. Furthermore, from the perspective of sample content type, the training model can be a model for image processing (such as recognition or generation) or a model for natural language processing (such as semantic analysis or data mining).

[0083] In this disclosure, dynamic parameters refer to parameters related to the model's learning dynamics, such as parameters in the dynamic equations obtained from representation learning dynamics modeling. In one example, dynamic parameters may include a steady-state matrix. In another example, dynamic parameters may include a steady-state matrix and a convergence matrix.

[0084] When the dynamic parameters include the steady-state matrix, the influence of the candidate samples on the current dynamic parameters of the model to be trained in this disclosure can be regarded as the contribution of the candidate samples to the model reaching the steady state, and the contribution of the candidate samples to the model reaching the steady state is usually positively correlated with the current training value of the candidate samples.

[0085] In one example, for any candidate sample among multiple candidate samples, this disclosure can calculate the degree of influence of the candidate sample on the current steady-state matrix of the model to be trained, thereby obtaining the first degree of influence corresponding to the candidate sample. This disclosure can use the first degree of influence corresponding to the candidate sample as the current training value of the candidate sample. The degree of influence of the candidate sample on the current steady-state matrix of the model to be trained can refer to the role played by the candidate sample in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration. The better position here has different meanings for different types of models to be trained. For example, for a representation learning model, a better position can be considered as a position that is more conducive to representation learning, that is, a position that is more conducive to maintaining feature diversity and avoiding collapse. In one example, a better position can represent making the steady-state representation correlation matrix of the model closer to the identity matrix. In one example, a better position can represent making the representations obtained by the student network and the teacher network in the model better aligned in steady state. In one example, a better position can represent making the steady-state representation correlation matrix of the model deviate further from trivial features. Since the influence of candidate samples on the current steady-state matrix of the model to be trained can reflect the role played by candidate samples in pushing the current steady-state matrix of the model to be trained to a better position, taking the first degree of influence of candidate samples as the current training value of candidate samples is beneficial to accurately distinguish between truly high-value samples, difficult-to-learn low-value samples, and normal low-value samples located in sparse and long-tail regions. This not only helps to avoid the problems of overfitting, slow convergence speed, and insufficient generalization ability of the model caused by difficult-to-learn low-value samples, but also helps to avoid the problem of truly high-value samples being overwhelmed by a large number of normal low-value samples.

[0086] This disclosure determines the first degree of influence of a candidate sample by measuring the difference between the current steady-state matrix formed by all candidate samples and the current steady-state matrix formed by a subset of candidate samples.

[0087] In one example, assuming S200 obtains m (m is an integer greater than 1) candidate samples, for any candidate sample (such as the i-th candidate sample, and 1≤i≤m), the process of determining the first degree of influence corresponding to the candidate sample in this disclosure can be as follows:

[0088] First, use m candidate samples as the training sample set. The current steady-state matrix of the model to be trained is obtained by using the following formula (9), which is denoted as the first current steady-state matrix.

[0089]

[0090] In the above formula (9) This indicates that for the sample set Find, among all possible values ​​of the orthogonal matrix U, the function value (i.e.) is found. The minimum value is needed because when characterizing transformations such as spatial rotation, the transformation may cause distortion of the distance metric. To avoid this distortion, a suitable orthogonal transformation needs to be found. This represents the steady-state matrix corresponding to the training sample set D. The training sample set D can be any set of training samples. For example, the training sample set D can be... Figure 1 The large-scale training data on the left, and It can be calculated using the above formula (8), or it can be obtained in other ways, such as using a preset value; Represents the training sample set The corresponding steady-state matrix, and the training sample set Belongs to the training sample set D, Similarly, it can be calculated using the above formula (8); This indicates the use of the orthogonal matrix U to represent the steady-state matrix. The result after orthogonal transformation; This represents measuring the distance between two matrices, i.e., calculating... and The distance between them.

[0091] Secondly, the i-th candidate sample among the m candidate samples is deleted, and the remaining m-1 candidate samples are used as the training sample set. The above formula (9) is used to calculate again to obtain the current steady-state matrix of the model to be trained, which is denoted as the second current steady-state matrix.

[0092] In this calculation, the training sample set does not include the i-th candidate sample. The corresponding steady-state matrix Similarly, it can be calculated using the above formula (8). The first and second current steady-state matrices obtained in this disclosure are distance-based matrices.

[0093] Finally, the difference between the first current steady-state matrix and the second current steady-state matrix is ​​calculated, and this difference is used as the first degree of influence corresponding to the i-th candidate sample.

[0094] Specifically, the difference between the first current steady-state matrix and the second current steady-state matrix can be represented by the distance between them. That is, the distance difference between the first current steady-state matrix and the second current steady-state matrix is ​​the first influence degree corresponding to the i-th candidate sample.

[0095] Since the first current steady-state matrix represents the role of all candidate samples in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration, and the second current steady-state matrix represents the role of other candidate samples (excluding the i-th candidate sample) in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration, the difference between the two roles can be considered as the role of the i-th candidate sample in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration. Therefore, this disclosure can quickly and accurately determine the degree of influence corresponding to each candidate sample.

[0096] When the dynamic parameters include the steady-state matrix and the convergence matrix, the influence of the candidate samples on the current dynamic parameters of the model to be trained in this disclosure can be regarded as the contribution of the candidate samples to the model reaching steady state and model convergence, and the contribution of the candidate samples to the model reaching steady state and model convergence is usually positively correlated with the current training value of the candidate samples.

[0097] In one example, for any candidate sample among multiple candidate samples, this disclosure can calculate the degree of influence of the candidate sample on the current steady-state matrix and current convergence matrix of the model to be trained, thereby obtaining the second degree of influence corresponding to the candidate sample. This disclosure can use the second degree of influence corresponding to the candidate sample as the current training value of the candidate sample. The degree of influence of the candidate sample on the current steady-state matrix and current convergence matrix of the model to be trained can refer to the role played by the candidate sample in pushing the current steady-state matrix and current convergence matrix of the model to be trained to a better position during the current iteration. The better position here has different meanings for different types of models to be trained. For example, for a representation learning model, a better position can be considered as a position that is more conducive to representation learning and model convergence, that is, a position that is more conducive to maintaining feature diversity and avoiding collapse (the model's convergence speed also affects model collapse). In one example, a better position is used to make the steady-state representation correlation matrix of the model closer to the identity matrix, and the convergence speed is neither too fast nor too slow. In one example, a better position is used to ensure that the representations obtained by the student and teacher networks in the model are better aligned in steady state, with a convergence rate that is neither too fast nor too slow. In another example, a better position is used to ensure that the steady-state representation correlation matrix of the model deviates further from trivial features, with a convergence rate that is neither too fast nor too slow.

[0098] Since the influence of candidate samples on the current steady-state matrix and current convergence matrix of the model to be trained can reflect the role played by candidate samples in pushing the current steady-state matrix of the model to be trained to a better position, taking the second degree of influence of candidate samples as the current training value of candidate samples is beneficial to accurately distinguish between truly high-value samples, difficult-to-learn low-value samples, and normal low-value samples located in sparse regions and long-tail regions. It also helps to avoid the problem of the convergence matrix K being ill-conditioned due to the addition of overly difficult samples in the early training stage, which would cause the model to converge too slowly. Therefore, this disclosure not only helps to avoid the problems of overfitting risk, slow convergence speed, and insufficient generalization ability of the model caused by difficult-to-learn low-value samples, but also helps to avoid the problem of truly high-value samples being overwhelmed by a large number of normal low-value samples. In addition, it also helps to keep the convergence matrix in a healthy state throughout the training process.

[0099] This disclosure can determine the second influence degree of a candidate sample by measuring the difference between the current steady-state matrix formed by all candidate samples and the current steady-state matrix formed by a subset of candidate samples, and the minimum eigenvalue of the current convergence matrix.

[0100] In one example, assuming S200 obtains m (m is an integer greater than 1) candidate samples, for any candidate sample (such as the i-th candidate sample, and 1≤i≤m), the process of determining the second degree of influence corresponding to the i-th candidate sample in this disclosure can be as follows:

[0101] First, use m candidate samples as the training sample set. The current steady-state matrix of the model to be trained is obtained by using the above formula (9), and is denoted as the first current steady-state matrix.

[0102] Secondly, based on the current training sample set Calculate the current convergence matrix of the model to be trained, obtain the first current convergence matrix, and obtain the minimum eigenvalue of the first current convergence matrix.

[0103] Next, delete the i-th candidate sample from the m candidate samples, and use the remaining m-1 candidate samples as the current training sample set. The above formula (9) is used to calculate again to obtain the current steady-state matrix of the model to be trained, which is denoted as the second current steady-state matrix.

[0104] Secondly, based on the current training sample set Calculate the current convergence matrix of the model to be trained, obtain the second current convergence matrix, and obtain the minimum eigenvalue of the second current convergence matrix.

[0105] Finally, the difference between the first current steady-state matrix and the first minimum eigenvalue and the second current steady-state matrix and the second minimum eigenvalue is calculated, and this difference is used as the second influence degree corresponding to the i-th candidate sample.

[0106] The first current steady-state matrix and the first minimum eigenvalue can be expressed in the form of the following formula (10), and the second current steady-state matrix and the second minimum eigenvalue can also be expressed in the form of the following formula (10):

[0107]

[0108] In the above formula (10) This indicates that for the sample set Find, among all possible values ​​of the orthogonal matrix U, the function value (i.e.) is found. The minimum value is needed because when characterizing transformations such as spatial rotation, the transformation may cause distortion of the distance metric. To avoid this distortion, a suitable orthogonal transformation needs to be found. This represents the steady-state matrix corresponding to the training sample set D. The training sample set D can be any set of training samples. For example, the training sample set D can be... Figure 1 The large-scale training data on the left, and It can be calculated using the above formula (8). Of course, it can also be obtained in other ways, such as using preset values. Represents the training sample set The corresponding steady-state matrix, and the training sample set Belongs to the training sample set D, Similarly, it can be calculated using the above formula (8); This indicates the use of the orthogonal matrix U to represent the steady-state matrix. The result after orthogonal transformation; This represents measuring the distance between two matrices, i.e., calculating... and The distance between them; Represents the sample set The smallest eigenvalue of the corresponding convergent matrix, and the sample set The corresponding convergence matrix can also be calculated using the above formula (8).

[0109] Specifically, the difference between the first current steady-state matrix and the first minimum eigenvalue and the second current steady-state matrix and the second minimum eigenvalue can be represented by the distance between the first current steady-state matrix and the first minimum eigenvalue and the second current steady-state matrix and the second minimum eigenvalue. That is, the distance difference between the first current steady-state matrix and the first minimum eigenvalue and the second current steady-state matrix and the second minimum eigenvalue is the second influence degree corresponding to the i-th candidate sample.

[0110] Since the combination of the first current steady-state matrix and the first minimum eigenvalue can more comprehensively represent the role of all candidate samples in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration, and the combination of the second current steady-state matrix and the second minimum eigenvalue can more comprehensively represent the role of other candidate samples (excluding the i-th candidate sample) in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration, the difference between the two roles can be considered as the role of the i-th candidate sample in pushing the current steady-state matrix of the model to be trained to a better position during the current iteration. Therefore, this disclosure can quickly, comprehensively, and accurately determine the degree of second influence corresponding to each candidate sample.

[0111] S202. Based on the current training value of each candidate sample, select a portion of the above candidate samples as the current training samples.

[0112] Specifically, this disclosure can sort the current training values ​​of each candidate sample, and select the corresponding number of candidate samples with the highest current training value (e.g., N candidate samples or less than N candidate samples) from multiple candidate samples as the current training samples according to a preset number of training samples (e.g., N candidate samples). Of course, other methods can also be used to select candidate samples. For example, candidate samples can be selected using the two conditions of the sum of current training values ​​reaching a predetermined value and the N candidate samples with the highest current training value. As long as one of the conditions is met, it is sufficient. The current training sample is the sample used in the current iteration.

[0113] When the dynamic parameters include the steady-state matrix, S202 can be expressed in the form of the following formula (11):

[0114]

[0115] In the above formula (11), Represents the set formed by candidate samples; This indicates the number of current training samples contained in the set, i.e. This indicates that the maximum number of samples used as current training samples is N.

[0116] When the dynamic parameters include the steady-state matrix and the convergence matrix, S202 can be expressed in the form of the following formula (12):

[0117]

[0118] In the above formula (12), Represents the set formed by candidate samples; This indicates the number of current training samples contained in the set, i.e. This indicates that the maximum number of samples used as current training samples is N.

[0119] By selecting no more than N candidate samples with the highest current training value from all candidate samples as the current training samples, we can control the number of current training samples to be as small as possible, and at the same time, we can ensure the learning quality of the model in this learning process as much as possible. Thus, while minimizing the amount of computation in the training process, we can ensure the performance and convergence speed of the model as much as possible.

[0120] S203. Use the current training samples obtained above as input to provide to the model to be trained.

[0121] Specifically, the current training samples can be sequentially provided as input to the model to be trained according to their current training value, or a random input method can be used. The model to be trained then performs feature extraction and other processing on the input training samples and outputs the processing results for each input.

[0122] In one example, when a training sample is used as input, two different data augmentation methods can be applied to that training sample to obtain two different augmented training samples. One augmented training sample is provided to the student network, and the other augmented training sample is provided to the teacher network.

[0123] S204. Calculate the loss based on the output of the model to be trained, and update the model parameters of the model to be trained based on the result of the loss calculation.

[0124] Specifically, loss can be calculated using a loss function based on the processing results of the model to be trained for all inputs and outputs. For example, when the model to be trained consists of a student network and a teacher network using a self-distillation and self-supervised learning framework, the loss can be calculated using the above formula (1), and the network parameters of the student network can be updated using the loss calculation results. Using the updated network parameters of the student network, the network parameters of the teacher network can be updated using the EMA method, for example, using the above formula (2). By updating the network parameters of the teacher network using the EMA method, the network parameters of the teacher network can be constructed using the smoother network parameters of the student network, which is beneficial for the teacher network to provide more stable and robust training guidance for the student network.

[0125] It should be noted that this disclosure may also include an initial training process before S200, that is, using multiple initial training samples to initially train the model to be trained (such as a student network and a teacher network using a self-distillation and self-supervised learning framework), so that the model to be trained is in an initial state, for example, both the student network and the teacher network are in an initial state. The number of initial training samples can be controlled within a small range. By initially training the model to be trained, it is beneficial to allow the model to enter a more optimal initialization space, thereby helping to reduce the number of iterations in the pre-training stage.

[0126] Beyond the initial training, this disclosure can employ the above-described approach in each iteration of training. Figure 2 The methods shown in S200-S204 update the model parameters of the model to be trained until the model training process is complete. A specific model training process is as follows: Figure 3 As shown.

[0127] Figure 3 In the middle, S300, the training process for the model to be trained begins.

[0128] S301. Randomly select a certain number of initial samples from the sample set, and use the initial samples to initialize the training of the model to be trained, so as to initialize the model parameters of the model to be trained.

[0129] This disclosure addresses processing the initial samples in the sample set, for example, marking the initial samples in the sample set as used samples, or deleting the initial samples in the sample set.

[0130] S302. Determine whether the current iteration meets the conditions for stopping iterative training. For example, determine whether the convergence of the model to be trained meets the predetermined convergence conditions. If the predetermined convergence conditions are met, proceed to S308. If the predetermined convergence conditions are not met, continue to determine whether the current iteration count exceeds the maximum iteration count. If the maximum iteration count has been exceeded, proceed to S308. If the maximum iteration count has not been exceeded, proceed to S303.

[0131] S303. Select multiple samples from the sample set to obtain multiple candidate samples.

[0132] Specifically, multiple samples should be selected from the unused samples in the sample set. For example, multiple samples can be selected as candidate samples using random or sequential selection methods. The number of samples selected at one time can be set according to actual needs; for example, dozens of samples can be selected as candidate samples at one time.

[0133] S304. Calculate the impact of each candidate sample on the current dynamic parameters of the model to be trained, thereby obtaining the current training value of each candidate sample.

[0134] Specifically, the formulas described in the above embodiments can be used to calculate the impact of each candidate sample on the current dynamic parameters of the model to be trained, which will not be explained in detail here.

[0135] S305. Based on the current training value of each candidate sample, select N candidate samples from multiple candidate samples to obtain the training samples for this iteration.

[0136] Specifically, the N candidate samples with the highest current training value can be selected, and N is usually less than the number of candidate samples selected from the sample set in this instance. Alternatively, this disclosure can use the conditions that the sum of current training values ​​reaches a predetermined value and that the N candidate samples with the highest current training value are selected to choose candidate samples; either condition is sufficient.

[0137] S306. Provide N training samples as inputs to the model to be trained, and update the model parameters according to the output of the model to be trained.

[0138] Specifically, after providing N training samples as inputs to the model to be trained, the model will output a corresponding processing result for each input. This disclosure can use the model's loss function to calculate all processing results, obtain the corresponding loss value, and use this loss value to update the current model parameters of the model to be trained. The specific loss function and the method of updating model parameters using the loss value can vary depending on the model to be trained.

[0139] S307. Perform used processing on N training samples in the sample set.

[0140] Specifically, these N training samples can be deleted from the sample set, or they can be marked in the sample set to indicate that they have been used, thus preventing them from being reused in subsequent training iterations. Return to step S302.

[0141] S308. End the training process for the model to be trained.

[0142] Beyond the initial training, this disclosure can employ the above-described methods during partial iterative training. Figure 2 The methods shown in S200-S204 update the model parameters of the model to be trained until the model training process is complete. A specific model training process is as follows: Figure 4 As shown.

[0143] Figure 4In the middle, S400 begins the training process for the model to be trained.

[0144] S401. Randomly select a certain number of initial samples from the sample set, and use the initial samples to initialize the training of the model to be trained, so as to initialize the model parameters of the model to be trained.

[0145] This disclosure addresses processing the initial samples in the sample set, for example, marking the initial samples in the sample set as used samples, or deleting the initial samples in the sample set.

[0146] S402. Determine whether the current iteration meets the conditions for stopping iterative training. For example, determine whether the convergence of the model to be trained meets the predetermined convergence conditions. If the predetermined convergence conditions are met, proceed to S410. If the predetermined convergence conditions are not met, continue to determine whether the current iteration count exceeds the maximum iteration count. If the maximum iteration count has been exceeded, proceed to S410. If the maximum iteration count has not been exceeded, proceed to S403.

[0147] S403. Determine the sample selection method used in this iteration. If it is method 1, proceed to S404; if it is method 2, proceed to S409.

[0148] Specifically, Method 1 selects samples based on their current training value, while Method 2 selects samples using existing methods such as random or sequential selection. In one example, it can be determined whether the number of iterations in this iteration is odd or even. If it is odd, proceed to S404; if it is even, proceed to S409.

[0149] S404. Select multiple samples from the sample set to obtain multiple candidate samples.

[0150] Specifically, multiple samples should be selected from the unused samples in the sample set. For example, multiple samples can be selected as candidate samples using random or sequential selection methods. The number of samples selected at one time can be set according to actual needs; for example, dozens of samples can be selected as candidate samples at one time.

[0151] S405. Calculate the impact of each candidate sample on the current dynamic parameters of the model to be trained, thereby obtaining the current training value of each candidate sample.

[0152] Specifically, the formulas described in the above embodiments can be used to calculate the impact of each candidate sample on the current dynamic parameters of the model to be trained, which will not be explained in detail here.

[0153] S406. Based on the current training value of each candidate sample, select N candidate samples from multiple candidate samples to obtain the training samples for this iteration.

[0154] Specifically, the N candidate samples with the highest current training value can be selected, and N is usually less than the number of candidate samples selected from the sample set in this instance. Alternatively, this disclosure can use the conditions that the sum of current training values ​​reaches a predetermined value and that the N candidate samples with the highest current training value are selected to choose candidate samples; either condition is sufficient.

[0155] S407. Provide N training samples as inputs to the model to be trained, and update the model parameters according to the output of the model to be trained.

[0156] Specifically, after providing N training samples as inputs to the model to be trained, the model will output a corresponding processing result for each input. This disclosure can use the model's loss function to calculate all processing results, obtain the corresponding loss value, and use this loss value to update the current model parameters of the model to be trained. The specific loss function and the method of updating model parameters using the loss value can vary depending on the model to be trained.

[0157] S408. Perform the used processing on N training samples in the sample set.

[0158] Specifically, these N training samples can be deleted from the sample set, or they can be marked in the sample set to indicate that they have been used, thus preventing them from being reused in subsequent training iterations. Return to step S402.

[0159] S409. Select N samples from the sample set and use these N samples as training samples for this iteration, proceeding to S407. For example, select N samples from the unused samples in the sample set using a random selection method or a sequential selection method to obtain N training samples.

[0160] S410. End the training process for the model to be trained.

[0161] By employing at least two methods to select samples, different training methods can be combined during the model training process. This facilitates a more flexible model training process and makes it possible to combine the advantages of the two training methods, thereby improving model performance.

[0162] Exemplary device

[0163] Figure 5 This is a schematic diagram of a specific embodiment of the apparatus for implementing model training according to the present disclosure. The apparatus of this embodiment can be used to implement the present disclosure. Figures 2-4 The method embodiment shown. For example... Figure 5The apparatus shown mainly includes: a candidate sample acquisition module 500, a training value determination module 501, a training sample screening module 502, an input module 503, and a parameter update module 504. Optionally, the apparatus may also include an initial training module 500-1. The following describes each module of the apparatus.

[0164] The initial training module 500-1 is mainly used to perform initial training on the model to be trained using multiple initial training samples, so that the model to be trained is in its initial state.

[0165] The candidate sample acquisition module 500 is mainly used to acquire multiple samples and use these multiple samples as candidate samples, thereby obtaining multiple candidate samples.

[0166] The training value determination module 501 is mainly used to determine the impact of each candidate sample obtained by the candidate sample acquisition module 500 on the current dynamic parameters of the model to be trained, and to determine the current training value of each candidate sample based on the impact of each candidate sample on the current dynamic parameters of the model to be trained.

[0167] In one example, the training value determination module 501 can calculate the influence of each candidate sample on the current steady-state matrix of the model to be trained, thereby obtaining the first influence degree corresponding to each candidate sample. The training value determination module 501 can then use the first influence degree corresponding to each candidate sample as the current training value of each candidate sample. More specifically, firstly, the training value determination module 501 can calculate the current steady-state matrix of the model to be trained based on multiple candidate samples, thereby obtaining a first current steady-state matrix; secondly, for any candidate sample among the multiple candidate samples, the training value determination module 501 can calculate the current steady-state matrix of the model to be trained based on other candidate samples besides the aforementioned candidate sample, thereby obtaining a second current steady-state matrix; finally, the training value determination module 501 can obtain the first influence degree corresponding to any of the aforementioned candidate samples based on the difference between the first current steady-state matrix and the second current steady-state matrix. The training value determination module 501 can use this method to obtain the first influence degree corresponding to each candidate sample and use the first influence degree corresponding to each candidate sample as the current training value of each candidate sample.

[0168] In another example, the training value determination module 501 can calculate the degree of influence of each candidate sample on the current steady-state matrix and the current convergence matrix of the model to be trained, thereby obtaining the second degree of influence corresponding to each candidate sample. The training value determination module 501 can use the second degree of influence corresponding to each candidate sample as the current training value of each candidate sample. More specifically, firstly, the training value determination module 501 calculates the current steady-state matrix of the model to be trained based on multiple candidate samples, thereby obtaining a first current steady-state matrix; secondly, the training value determination module 501 calculates the current convergence matrix of the model to be trained based on multiple candidate samples, thereby obtaining a first current convergence matrix, and obtains the minimum eigenvalue of the first current convergence matrix, thereby obtaining a first minimum eigenvalue; thirdly, for any candidate sample among the multiple candidate samples, the training value determination module 501 calculates the current steady-state matrix of the model to be trained based on other candidate samples besides that candidate sample, thereby obtaining a second current steady-state matrix, and calculates the current convergence matrix of the model to be trained based on other candidate samples besides that candidate sample, thereby obtaining a second current convergence matrix, and obtains the minimum eigenvalue of the second current convergence matrix, thereby obtaining a second minimum eigenvalue; finally, the training value determination module 501 obtains the second degree of influence corresponding to any candidate sample based on the difference between the first steady-state matrix and the first minimum eigenvalue and the second steady-state matrix and the second minimum eigenvalue. The module 501 for determining training value can use this method to obtain the second degree of influence corresponding to each candidate sample, and use the second degree of influence corresponding to each candidate sample as the current training value of each candidate sample.

[0169] The training sample selection module 502 is mainly used to select a portion of the samples as the current training samples from multiple candidate samples based on the current training value of each candidate sample determined by the training value determination module 501. Specifically, the training sample selection module 502 can select the corresponding number of candidate samples with the highest current training value from multiple candidate samples as the current training samples based on the ranking of the current training values ​​of each candidate sample and according to a preset number of training samples (e.g., N).

[0170] The input module 503 is mainly used to provide the current training samples selected by the training sample selection module 502 as input to the model to be trained.

[0171] The parameter update module 504 is mainly used to calculate the loss based on the output of the model to be trained for each current training sample, and update the model parameters of the model to be trained based on the result of the loss calculation. When the model to be trained is a student network and a teacher network using a self-distillation and self-supervised learning framework, the parameter update module 504 can update the network parameters of the student network based on the result of the loss calculation, and then update the network parameters of the teacher network using an exponential moving average method based on the updated network parameters of the student network.

[0172] In one embodiment, the apparatus for implementing model training disclosed herein may use the above-described training process to update the model parameters of the model to be trained in each training session other than the initial training; or it may use the above-described training process to update the model parameters of the model to be trained in some training sessions other than the initial training.

[0173] Exemplary electronic devices

[0174] The following is for reference. Figure 6 To describe an electronic device according to embodiments of the present disclosure. Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (As follows) Figure 6 As shown, the electronic device 61 includes one or more processors 611 and memory 612.

[0175] The processor 611 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 61 to perform desired functions.

[0176] The memory 612 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, and flash memory. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 611 may execute the program instructions to implement the methods for implementing model training and / or other desired functions described in the various embodiments of this disclosure above.

[0177] In one example, electronic device 61 may further include input device 413 and output device 414, etc., these components being interconnected via a bus system and / or other forms of connection mechanism (not shown). Furthermore, the input device 613 may include, for example, a keyboard, mouse, etc. The output device 614 can output various information to the outside. The output device 614 may include, for example, a display, speaker, printer, and communication networks and their connected remote output devices, etc.

[0178] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device 61 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 61 may include any other suitable components depending on the specific application.

[0179] Exemplary computer program products and computer-readable storage media

[0180] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods for implementing model training according to various embodiments of this disclosure as described in the "Exemplary Methods" section of this specification.

[0181] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program source code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0182] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods for implementing model training according to various embodiments of this disclosure described in the "Exemplary Methods" section above.

[0183] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not an exhaustive list) of a readable storage medium may include: an electrical connection having one or more wires, a portable disk, a hard disk, 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 thereof.

[0184] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0185] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0186] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.

[0187] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A method for implementing model training, characterized in that, The method is performed by an electronic device, and the method includes: Multiple samples are obtained, and these multiple samples are used as candidate samples to obtain multiple candidate samples; The current training value of each candidate sample is determined based on its impact on the current dynamic parameters of the model to be trained. Based on the current training value of each candidate sample, a subset of samples are selected from the plurality of candidate samples as the current training samples; The current training sample is provided as input to the model to be trained. Loss is calculated based on the output of the model to be trained, and the model parameters of the model to be trained are updated based on the result of the loss calculation. The multiple samples are image-based or text-based samples, and the model to be trained is a recognition model used to process visual or natural language information.

2. The method according to claim 1, characterized in that, The step of determining the current training value of each candidate sample based on its impact on the current dynamic parameters of the model to be trained includes: The influence of each candidate sample on the current steady-state matrix of the model to be trained is calculated, and the first influence degree corresponding to each candidate sample is obtained. The first influence degree corresponding to each candidate sample is used as the current training value of each candidate sample.

3. The method according to claim 2, characterized in that, The step of calculating the influence of each candidate sample on the current steady-state matrix of the model to be trained, and obtaining the first influence degree corresponding to each candidate sample, includes: Based on the multiple candidate samples, the current steady-state matrix of the model to be trained is calculated to obtain the first current steady-state matrix; For any one of the plurality of candidate samples, the current steady-state matrix of the model to be trained is calculated based on the other candidate samples besides the aforementioned candidate sample, and a second current steady-state matrix is ​​obtained. Based on the difference between the first current steady-state matrix and the second current steady-state matrix, the first degree of influence corresponding to any candidate sample is obtained.

4. The method according to claim 1, characterized in that, The step of determining the current training value of each candidate sample based on its impact on the current dynamic parameters of the model to be trained includes: The influence of each candidate sample on the current steady-state matrix and the current convergence matrix of the model to be trained is calculated respectively, and the second influence degree corresponding to each candidate sample is obtained. The second influence degree corresponding to each candidate sample is used as the current training value of each candidate sample.

5. The method according to claim 4, characterized in that, The step of calculating the influence of each candidate sample on the current steady-state matrix and the current convergence matrix of the model to be trained, and obtaining the second influence degree corresponding to each candidate sample, includes: Based on the multiple candidate samples, the current steady-state matrix of the model to be trained is calculated to obtain the first current steady-state matrix; Based on the multiple candidate samples, calculate the current convergence matrix of the model to be trained, obtain the first current convergence matrix, and obtain the minimum eigenvalue of the first current convergence matrix. For any one of the plurality of candidate samples, the current steady-state matrix of the model to be trained is calculated based on the other candidate samples besides the aforementioned candidate sample, and a second current steady-state matrix is ​​obtained. For any candidate sample among the plurality of candidate samples, the current convergence matrix of the model to be trained is calculated based on the other candidate samples besides the candidate sample, to obtain the second current convergence matrix, and the minimum eigenvalue of the second current convergence matrix is ​​obtained to obtain the second minimum eigenvalue. The second degree of influence corresponding to any candidate sample is obtained based on the difference between the first current steady-state matrix and the first minimum eigenvalue and the second current steady-state matrix and the second minimum eigenvalue.

6. The method according to any one of claims 1 to 5, characterized in that, The step of selecting a subset of samples as current training samples from the plurality of candidate samples based on the current training value of each candidate sample includes: Based on the ranking of the current training values ​​of each candidate sample, and according to the preset number of training samples, the corresponding number of candidate samples with the highest current training value are selected from the multiple candidate samples as the current training samples.

7. The method according to any one of claims 1 to 5, characterized in that, The model to be trained includes: a student network and a teacher network employing a self-distillation and self-supervised learning framework; Updating the model parameters of the model to be trained based on the result of the loss calculation includes: Update the network parameters of the student network based on the results of the loss calculation; Based on the updated network parameters of the student network, the network parameters of the teacher network are updated using an exponential moving average method.

8. The method according to any one of claims 1 to 5, characterized in that, The method further includes, before acquiring multiple samples and using the multiple samples as candidate samples: The model to be trained is initially trained using multiple initial training samples, so that the model to be trained is in an initial state. In all training sessions other than the initial training, the model parameters of the model to be trained are updated using the method described above; or, in some training sessions other than the initial training, the model parameters of the model to be trained are updated using the method described above.

9. A computer-readable storage medium storing a computer program for performing the method according to any one of claims 1-8.

10. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any one of claims 1-8.