Training method and device of recognition model, computer device and storage medium

By combining sampling and training, the problem of poor accuracy of the recognition model in practical application scenarios was solved. The recognition accuracy on incremental data was improved and the application scenarios were expanded, thereby improving the iterative training effect and performance of the recognition model.

CN114154575BActive Publication Date: 2025-10-24JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111466387.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-10-24
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

In existing technologies, recognition models lack real data in practical application scenarios, resulting in poor recognition accuracy and difficulty in expanding application scenarios.

Method used

By acquiring initial teacher identification models and initial student identification models, positive and negative sample pairs are sampled from incremental and existing data to train the target teacher identification model and assist in training the target student identification model. Iterative optimization is performed using stochastic gradient descent algorithm and semi-twin network architecture, and lightweight processing is performed in conjunction with local feature library.

Benefits of technology

It effectively maintains the recognition accuracy of the recognition model in existing scenarios, while improving the recognition accuracy on incremental data, expanding the application scenarios of the recognition model, and improving the iterative training effect and recognition performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114154575B_ABST
    Figure CN114154575B_ABST
Patent Text Reader

Abstract

The present disclosure provides a training method and device of a recognition model, a computer device and a storage medium. The method comprises: obtaining an initial teacher recognition model and an initial student recognition model; sampling positive sample pairs and negative sample pairs from incremental data and stock data; training the initial teacher recognition model according to the positive sample pairs and the negative sample pairs to obtain a target teacher recognition model; and training the initial student recognition model according to the positive sample pairs, the negative sample pairs and the target teacher recognition model to obtain a target recognition model. The target recognition model can effectively maintain the recognition accuracy for the stock data in the existing scene, effectively improve the recognition accuracy of the target recognition model on the incremental data, effectively improve the iterative training effect of the target recognition model, improve the recognition performance of the target recognition model, and effectively expand the recognition application scene of the target recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, and in particular, to a training method and device of a recognition model, a computer device, and a storage medium. BACKGROUND

[0002] With the development of artificial intelligence, various recognition technologies (e.g., feature recognition, portrait recognition, etc.) have been derived and widely used in various recognition scenarios. Generally, some to-be-recognized data in a scene is given, and then a recognition technology is used to process the to-be-recognized data to obtain a corresponding recognition result. The to-be-recognized data may be, for example, face image data. With the diversification of application scenarios, the diversity of to-be-recognized data also generally increases.

[0003] In related technologies, different recognition models are generally trained for different application scenarios, and sample data in the scene is collected to train the recognition model.

[0004] In this way, due to the lack of real data in actual application scenarios, the recognition accuracy of the trained recognition model is poor when the trained recognition model is used to perform a recognition task in an actual application scenario, and the trained recognition model is not convenient for application in an actual application scenario. SUMMARY

[0005] The present disclosure aims to at least partially solve one of the technical problems in the related art.

[0006] To this end, the present disclosure aims to provide a training method and device of a recognition model, a computer device, and a storage medium, which can effectively maintain the recognition accuracy of a target recognition model for existing data in a scene while effectively improving the recognition accuracy of the target recognition model on incremental data, thereby effectively improving the iterative training effect of the target recognition model, improving the recognition performance of the target recognition model, and effectively expanding the recognition application scenarios of the target recognition model.

[0007] The training method of a recognition model provided by the first aspect of the present disclosure includes: obtaining an initial teacher recognition model and an initial student recognition model; sampling a positive sample pair and a negative sample pair from incremental data and existing data; training the initial teacher recognition model according to the positive sample pair and the negative sample pair to obtain a target teacher recognition model; and training the initial student recognition model according to the positive sample pair, the negative sample pair, and the target teacher recognition model to obtain a target recognition model.

[0008] The training method of the recognition model provided in the first aspect of the present disclosure can effectively maintain the recognition accuracy of the target recognition model for the stock data in the existing scene, effectively improve the recognition accuracy of the target recognition model on the incremental data, thereby effectively improving the iterative training effect of the target recognition model, improving the recognition performance of the target recognition model, and effectively expanding the recognition application scene of the target recognition model.

[0009] The training device of the recognition model provided in the second aspect of the present disclosure comprises: a first obtaining module configured to obtain an initial teacher recognition model and an initial student recognition model; a second obtaining module configured to sample positive sample pairs and negative sample pairs from incremental data and stock data; a first training module configured to train the initial teacher recognition model according to the positive sample pairs and the negative sample pairs to obtain a target teacher recognition model; and a second training module configured to train the initial student recognition model according to the positive sample pairs, the negative sample pairs, and the target teacher recognition model to obtain a target recognition model.

[0010] The training device of the recognition model provided in the second aspect of the present disclosure can effectively maintain the recognition accuracy of the target recognition model for the stock data in the existing scene, effectively improve the recognition accuracy of the target recognition model on the incremental data, thereby effectively improve the iterative training effect of the target recognition model, improve the recognition performance of the target recognition model, and effectively expand the recognition application scene of the target recognition model.

[0011] The third aspect of the present disclosure provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the training method of the recognition model provided in the first aspect of the present disclosure is implemented.

[0012] The fourth aspect of the present disclosure provides a non-transitory computer readable storage medium, which stores a computer program executable by a processor to implement the training method of the recognition model provided in the first aspect of the present disclosure.

[0013] A fifth aspect of the present disclosure provides a computer program product, when an instruction processor in the computer program product executes, performs the training method of the identification model as the first aspect of the present disclosure.

[0014] Additional aspects and advantages of the present disclosure will be made apparent from the following description of the embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0015] The above and / or additional aspects and advantages of the present disclosure will become apparent and be readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings.

[0016] Figure 1 is a flowchart of a training method of an identification model according to an embodiment of the present disclosure;

[0017] Figure 2 is a flowchart of a training method of an identification model according to another embodiment of the present disclosure;

[0018] Figure 3 is a flowchart of a model iteration process according to an embodiment of the present disclosure;

[0019] Figure 4 is a structural diagram of a training device of an identification model according to an embodiment of the present disclosure;

[0020] Figure 5 is a structural diagram of a training device of an identification model according to another embodiment of the present disclosure;

[0021] Figure 6 shows a block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure are described in detail below with reference to the attached drawings, wherein the same or like reference numerals in different drawings represent the same or like elements or components having the same or similar function. The embodiments described below are examples of the present disclosure, and are only used to explain the present disclosure, and cannot be understood as limiting the present disclosure. On the contrary, embodiments of the present disclosure include all changes, modifications and equivalents falling within the spirit and scope of the appended claims.

[0023] Figure 1 is a flowchart of a training method of an identification model according to an embodiment of the present disclosure.

[0024] It should be noted that the execution subject of the training method of the identification model in this embodiment is a training device of the identification model, which can be implemented in software and / or hardware, and the device can be configured in a computer device, which can include but is not limited to a terminal, a server end, etc.

[0025] As shown in Figure 1 the training method of the identification model includes:

[0026] S101: Obtain an initial teacher identification model and an initial student identification model.

[0027] The model can be a model in artificial intelligence, such as a neural network model, a machine learning model, etc., which is not limited.

[0028] The identification model can be an artificial intelligence model capable of performing an identification task, such as feature recognition, portrait recognition, etc., which is not limited. Among them, the identification model with a deeper and more complex network structure and relatively high identification accuracy can be referred to as a teacher identification model, and the teacher identification model obtained in the initial training stage can be referred to as an initial teacher identification model. Correspondingly, the network structure of the initial teacher identification model can be processed to obtain a lightweight identification model, which can be referred to as a student identification model, and the student identification model obtained in the initial training stage can be referred to as an initial student identification model.

[0029] After obtaining the initial teacher identification model and the initial student identification model, the disclosure embodiment can collect incremental data and stock data in the actual application scenario, and train the initial teacher identification model and the initial student identification model respectively to obtain a target identification model conforming to the real data distribution of the actual application scenario. For details, see the subsequent embodiments.

[0030] S102: Sample a positive sample pair and a negative sample pair from the incremental data and the stock data.

[0031] The above step of sampling sample data in combination with stock data and incremental data can be performed after obtaining the initial teacher identification model and the initial student identification model.

[0032] The stock data can be existing data, for example, data whose data distribution characteristics have been learned by the identification model, and the incremental data can be newly obtained data in a new scene, for example, data whose data distribution characteristics have not been learned by the identification model.

[0033] For example, the stock data can be data already existing in the local data warehouse, and the incremental data can be new data to be entered into the data warehouse.

[0034] The positive sample pair refers to sample data belonging to a same category, and the negative sample pair can be sample data composed of data of the category and data of other categories, which can be different categories.

[0035] For example, the positive sample pair can be a sample pair composed of two face images of the same person in the local data warehouse, and the negative sample pair can be a sample pair composed of two face images of different persons or a face image and background image data in the to-be-identified image.

[0036] In the embodiments of the present disclosure, after obtaining the initial teacher recognition model and the initial student recognition model, the incremental data and the stock data can also be obtained, and then the positive sample pair and the negative sample pair can be determined according to the incremental data and the stock data.

[0037] For example, when the positive sample pair and the negative sample pair are determined according to the incremental data and the stock data, the positive sample pair and the negative sample pair can be sampled from the plurality of incremental data and stock data.

[0038] In some other embodiments, the positive sample pair and the negative sample pair can also be determined according to the incremental data and the stock data in any other possible manner, for example, the incremental data and the stock data can be input into a data processing model to obtain the positive sample pair and the negative sample pair output by the data processing model, or the positive sample pair and the negative sample pair can also be determined in an engineering manner, which is not limited.

[0039] In the embodiments of the present disclosure, by determining the positive sample pair and the negative sample pair according to the incremental data and the stock data, that is, dividing the dimension of the training sample data, the data distribution characteristics of the incremental data and the stock data can be represented, so that when the recognition model is trained according to the positive sample pair and the negative sample pair determined according to the incremental data and the stock data, the balance of the recognition effect of the target recognition model on the incremental data and the stock data can be effectively guaranteed, and the recognition effect can be comprehensively guaranteed.

[0040] S103: training the initial teacher recognition model according to the positive sample pair and the negative sample pair to obtain a target teacher recognition model.

[0041] The model obtained by training the initial teacher recognition model can be referred to as a target teacher recognition model, which can be used to train the initial student recognition model, which will be described in detail in the following embodiments.

[0042] After the positive sample pairs and the negative sample pairs are determined according to the incremental data and the inventory data, the initial teacher recognition model can be trained in combination with the positive sample pairs and the negative sample pairs to obtain a target teacher recognition model, and then the student recognition model is trained based on the target teacher recognition model to obtain a target recognition model, so as to realize the recognition accuracy of the target recognition model guaranteed by the target teacher recognition model, and the target recognition model is trained from the initial student recognition model, so that the target recognition model has relatively light model parameters, facilitating deployment and implementation, and facilitating the expansion of the scene.

[0043] In the embodiments of the present disclosure, when the initial teacher recognition model is trained according to the positive sample pairs and the negative sample pairs, the initial teacher recognition model can be fine-tuned by using a stochastic gradient descent (SGD) algorithm, or iteratively optimized by using other arbitrary deep learning algorithm in artificial intelligence, and no limitation is made to this.

[0044] The stochastic gradient descent algorithm can set a small learning rate to slowly improve the recognition accuracy of the initial teacher recognition model on the incremental data, wherein the mathematical expectation of the incremental data can be used as the gradient information of the model iteration, and the expectation can be approximated by using the mathematical expectation of the small-scale sample data obtained by sampling the incremental data.

[0045] S104: Training the initial student recognition model according to the positive sample pairs, the negative sample pairs, and the target teacher recognition model to obtain a target recognition model.

[0046] The initial teacher recognition model can be trained in combination with the positive sample pairs and the negative sample pairs to obtain a target teacher recognition model, and then the initial student recognition model can be trained based on the target teacher recognition model in combination with the positive sample pairs and the negative sample pairs to obtain a trained student recognition model, which can be referred to as a target recognition model.

[0047] In the embodiments of the present disclosure, when the initial student recognition model is trained according to the positive sample pairs, the negative sample pairs, and the target teacher recognition model, the network structure of the initial student model can be lightened by using the target teacher model, the number of parameters of the initial student recognition model can be reduced, and some model parameters, intermediate results of model recognition, and features of the model of the target teacher recognition model can be used to assist in training the initial student recognition model, so that the target recognition model after training has the same recognition performance as the target teacher recognition model.

[0048] In this embodiment, the initial teacher recognition model and the initial student recognition model are obtained, positive sample pairs and negative sample pairs are sampled from the incremental data and the stock data, the initial teacher recognition model is trained according to the positive sample pairs and the negative sample pairs to obtain a target teacher recognition model, and the initial student recognition model is trained according to the positive sample pairs, the negative sample pairs, and the target teacher recognition model to obtain a target recognition model. The recognition accuracy of the target recognition model on the stock data in the existing scene can be effectively maintained, and the recognition accuracy of the target recognition model on the incremental data can be effectively improved, so that the iterative training effect of the target recognition model can be effectively improved, the recognition performance of the target recognition model can be improved, and the recognition application scene of the target recognition model can be effectively expanded.

[0049] Figure 2 FIG. 1 is a flowchart of a method for training a recognition model according to another embodiment of the present disclosure.

[0050] As shown in FIG. 1, the method for training the recognition model includes the following steps. Figure 2

[0051] S201: Obtain an initial teacher recognition model and an initial student recognition model.

[0052] Optionally, in some embodiments, the initial teacher recognition model includes a first teacher recognition sub-model and a second teacher recognition sub-model, and the first teacher recognition sub-model and the second teacher recognition sub-model form a semi-twin network architecture, so that the student recognition model can be trained using multiple teacher recognition models, and the student recognition model can obtain higher gain in training.

[0053] The semi-twin network architecture refers to dividing one neural network into left and right neural networks, and the left and right neural networks can be neural networks of the same type or neural networks of different types. The architectures of the left and right neural networks are the same, and the weights are different. The semi-twin network architecture processes data using two inputs.

[0054] In the embodiments of the present disclosure, the first teacher recognition sub-model and the second teacher recognition sub-model form a semi-twin network architecture, the reference group samples and the detection group samples are input into the first teacher recognition sub-model and the second teacher recognition sub-model respectively to obtain reference teacher features and detection teacher features, so that the data features of the reference group samples and the data features corresponding to the detection group samples can be accurately identified, the recognition model can be trained based on the respective data features, and the recognition results of the two sub-models on the sample data features can be fused, so that the iterative training effect of the teacher recognition model can be effectively guaranteed, and the subsequent step of training the initial teacher recognition model to obtain the target teacher recognition model using the reference teacher features and the detection teacher features can be supported. For details, refer to subsequent embodiments.

[0055] ​S202: Sample positive sample pairs and negative sample pairs from the incremental data and the inventory data.

[0056] The positive sample pair includes a current detection sample and a current reference sample, and the current detection sample and the current reference sample have the same category. The negative sample pair includes the current detection sample and a historical reference sample, and the current detection sample and the historical reference sample have different categories.

[0057] The reference sample is used as input to the first teacher recognition sub-model to obtain a reference teacher feature, and the detection sample is used as input to the second teacher recognition sub-model to obtain a detection teacher feature. The current detection sample and the current reference sample refer to data samples at a time of non-iterative training of the model. The current detection sample and the current reference sample have the same category and can form a positive sample pair. The historical reference sample refers to a reference sample used at a time of iterative training of the model in recent times. The current detection sample and the historical reference sample have different categories and can form a negative sample pair.

[0058] In the embodiments of the present disclosure, when the plurality of incremental data and inventory data are sampled to obtain the positive sample pair and the negative sample pair, the inventory data and the incremental data can be mixed and sampled according to a set proportion.

[0059] For example, when a batch of training data data_2 is added in the scene, the data_2 can be regarded as a plurality of incremental data. Assuming that the total number of identity (ID) of the face image data in the incremental data data_2 is Y, and any id contains y images, the number of positive sample pairs that can be formed is The total number of positive sample pairs is

[0060] After the positive sample pair is sampled from the incremental data, assuming that the inventory data is defined as data_1, the total number of ids of the face image data in the inventory data data_1 is Count_1, and each id may contain multiple face images. Two face images are randomly selected and combined to obtain a pair of positive sample pairs. The number of positive sample pairs that can be obtained in the inventory data is Count_1.

[0061] After the above-mentioned sampling of the Count_1 pairs of positive sample pairs from the inventory data, alpha*mini_batch positive sample pairs are randomly sampled from the Count_1 pairs of positive sample pairs, and (1-alpha)*mini_batch positive sample pairs are randomly sampled from Count_2, where mini_batch is the number of positive sample pairs required in the model iteration process, and alpha can be 0.5 in actual application scenarios, so as to ensure balanced sampling in inventory data and incremental data.

[0062] In some other embodiments, any other possible way can also be used to determine the positive sample pairs from the incremental data and the inventory data, for example, the data processing algorithm can be used to sample and process the incremental data and the inventory data, and no limitation is made in this regard. Optionally, in some embodiments, the positive sample pairs and the negative sample pairs can be amplified.

[0063] After the above-mentioned sampling of the positive sample pairs and the negative sample pairs from the incremental data and the inventory data, the positive sample pairs and the negative sample pairs can be amplified, for example, two face images in a positive sample pair can be randomly selected for a small amount of offset or mirror flipping or small amount of rotation, etc., to obtain a new positive sample pair, or the blurring of one image in the sample pair can be artificially increased, the brightness of the image in the sample can be adjusted, etc., to process the image, and then the processed image is added to the incremental data set, and the new incremental data set is sampled to amplify the positive sample pairs and the negative sample pairs.

[0064] In some other embodiments, any other possible way can also be used to supplement the incremental data, for example, glasses, masks, etc. can be added to the face images in the incremental data set, and then the face image data with the added occlusion is added to the incremental data set, and the new incremental data set is sampled to obtain the amplified positive sample pairs and the negative sample pairs, or any other possible way can be used to process the image to amplify the sample pairs, and no limitation is made in this regard.

[0065] In the embodiments of the present disclosure, by amplifying the positive sample pairs and the negative sample pairs and supplementing the positive sample pairs and the negative sample pairs obtained by amplification, the unbalanced data sampling event when the sample data of the new scene is less than the inventory data sample can be effectively avoided, so as to effectively train the initial student recognition model.

[0066] S203: Form a reference group sample according to the multiple times of sampling of the reference sample, which is sampled from the current reference sample and the historical reference sample.

[0067] The reference sample is used for input into the first teacher identification sub-model to obtain a reference teacher feature. In the model training process, multiple iterations are performed. Data sampling is required for each iteration to obtain the reference sample. The data sampling can be performed on the current reference sample and the historical reference sample to obtain the multiple sampled reference samples to form a reference group sample. The reference teacher feature can be used together with the probe teacher feature to determine the loss value of the model.

[0068] S204: A probe group sample is formed according to the multiple sampled probe samples, which are sampled from the multiple current probe samples.

[0069] The probe sample is used for input into the second teacher identification sub-model to obtain a probe teacher feature. In the model training process, multiple iterations are performed. Data sampling is required for each iteration to obtain the probe sample. The data sampling can be performed on the multiple current probe samples. The probe teacher feature can be used together with the reference teacher feature to determine the loss value of the model.

[0070] S205: The reference group sample is input into the first teacher identification sub-model to obtain the reference teacher feature output by the first teacher identification sub-model.

[0071] The reference teacher feature can be a data distribution feature of the reference group sample obtained after the reference group sample is processed by the first teacher identification sub-model.

[0072] In the disclosure embodiment, when the reference group sample pair is input into the first teacher identification sub-model to obtain the reference teacher feature output by the first teacher identification sub-model, the current data set for training the model can be preset as data_1. The initial teacher identification model model_t1 is trained on this data set. The initial teacher identification model includes the first teacher identification sub-model and the second teacher identification sub-model. The first teacher identification sub-model and the second teacher identification sub-model form a semi-twin network architecture. That is, in the training process, the weight information of the two sets of model_t1 is stored, which are the weight information of the first teacher identification sub-model model_t1_0 and the weight information of the second teacher identification sub-model model_t1_1. Similarly, when the initial teacher identification model is trained, the data in the sample pair is divided into two groups, one group is called Probe, and the other group is called Gallery. The Probe group sample data is input into the first teacher identification sub-model. The reference teacher feature output by the first teacher identification sub-model is extracted according to the weight information of model_t1_0. Thus, the data distribution feature of the reference group sample can be obtained.

[0073] In some other embodiments, any possible combination of sample data can be used to input the reference group samples into the first teacher recognition sub-model to obtain the reference teacher features output by the first teacher recognition sub-model, for example, the reference group samples can be processed by principal component analysis to obtain the reference teacher features, or the reference group samples can be processed by non-negative matrix factorization to output the reference teacher features of the first teacher recognition sub-model, and the present disclosure is not limited in this regard.

[0074] S206: input the probe group samples into the second teacher recognition sub-model to obtain the probe teacher features output by the second teacher recognition sub-model.

[0075] The probe teacher features can be data distribution features of the probe group samples processed by the second teacher recognition sub-model.

[0076] In the embodiments of the present disclosure, the sample data of the probe group samples Gallery can be input into the second teacher recognition sub-model to extract the probe teacher features output by the second teacher recognition sub-model according to the weight information of the second teacher recognition sub-model model_t1_1.

[0077] In some other embodiments, any possible combination of sample data can be used to input the probe group samples into the second teacher recognition sub-model to obtain the probe teacher features output by the second teacher recognition sub-model, for example, the probe group samples can be processed by principal component analysis to obtain the probe teacher features, or the probe group samples can be processed by linear discriminant analysis to output the probe teacher features of the second teacher recognition sub-model, and the present disclosure is not limited in this regard.

[0078] S207: determine the loss value according to the reference teacher features and the probe teacher features.

[0079] The loss value can be used to represent the difference between the predicted data result and the actual data result of the model training, and can be used to measure whether the model is trained, which can be seen in subsequent embodiments.

[0080] In the embodiments, when the loss value is determined according to the reference teacher features and the probe teacher features, the loss function such as the maximum probability distribution function Softmax and the wide boundary maximum probability distribution function Arc-Softmax can be used to calculate the loss value corresponding to the current feature value, so that the loss value can be used to represent the recognition difference between the initial teacher recognition model and the target teacher recognition model, and the convergence degree of the model can be measured, so that the recognition effect of the teacher recognition model is improved.

[0081] Optionally, in some embodiments, the sample pair corresponding to the incremental data can be input into the target teacher recognition model to obtain a target teacher feature output by the target teacher recognition model, the target teacher feature being a teacher feature related to the sample pair corresponding to the incremental data extracted by the target teacher recognition model.

[0082] The target teacher feature is a teacher feature corresponding to the positive sample pair extracted by the target teacher recognition model.

[0083] Optionally, in some embodiments, the target teacher feature can be stored in a feature library, the feature library being a local feature library that stores the target teacher feature of the newly added training data extracted after the iterative training of the teacher recognition model is completed when the incremental data arrives. Using the local feature library can accelerate the training speed of the student recognition model, and only the corresponding features trained by the incremental data are extracted, and the features of the previous training data are not updated, so that the feature extraction time is less, and multiple historical versions of the teacher recognition model can be used to train the student recognition model, so that the student recognition model can obtain higher gain in training.

[0084] For example, the incremental data set data_1 can be stored in the local feature library, and the set of reference teacher features and probe teacher features extracted in the model iteration process are stored in the local disk in the form of a dictionary. The target teacher recognition model obtained after the iteration is completed can be used to extract the data feature value in the incremental data, and the feature value is also supplemented to the feature library.

[0085] S208: If the loss value meets the set condition, the initial teacher recognition model is used as the target teacher recognition model.

[0086] The set condition can be artificially set before model training, and can be set according to the expected recognition accuracy of the target teacher recognition model to obtain a recognition model that meets a specific recognition accuracy.

[0087] S209: If the loss value does not meet the set condition, the first model parameter and the second model parameter are updated respectively using the target method until the target loss value meets the set condition, and the teacher recognition model obtained by training is used as the target teacher recognition model.

[0088] In the embodiments of the present disclosure, the training of the teacher recognition model is a process of continuous updating and iteration. If the loss value does not meet the set condition, the iterative training can be triggered again, and a new loss value is calculated again. The new loss value obtained by iteration is continuously compared with the set condition until the set condition is met. The teacher recognition model obtained by multiple training can be used as the target teacher recognition model.

[0089] Before the loss value is recalculated, the positive sample pair used after one iteration of training of the teacher identification model needs to be sampled and updated, and then the reference group sample is input into the first teacher identification sub-model to output the reference teacher feature, the probe group sample pair is input into the second teacher identification sub-model to output the probe teacher feature, and then the loss value is calculated using the loss function according to the updated reference teacher feature and the probe teacher feature. The weight information of the first teacher identification sub-model model_t1_0 can be updated using the stochastic gradient descent algorithm, the weight information of the second teacher identification sub-model model_t1_1 is slowly updated using the moving average method (MA), and the new reference teacher feature value and the probe teacher feature value are extracted according to the new weight information to calculate the loss value. Then, the iteration process is repeated, the learning rate is slowly reduced during the training process, until the new loss value determined satisfies the set condition, so that the accuracy of model_t1_0 on the incremental data set is improved to satisfaction, and the iterative teacher identification model model_t2 can be obtained as the target teacher identification model.

[0090] Optionally, in some embodiments, when the target method is used to update the first model parameter and the second model parameter respectively, the stochastic gradient descent method can be used to update the first model parameter, and the moving average method can be used to update the second model parameter. In this way, the parameters of the high-precision target teacher identification model can be processed to reduce the parameter amount, so as to ensure the training and inference speed of the model when new incremental data arrives, and the accuracy of the identification model training is improved at a faster speed.

[0091] The first model parameter is the parameter of the first teacher identification sub-model, for example, it can be the weight information of the first teacher identification sub-model model_t1_0, the second model parameter is the parameter of the second teacher identification sub-model, for example, it can be the weight information of the second teacher identification sub-model model_t1_1, the target loss value is the loss value determined based on the teacher features output by the first teacher identification sub-model and the second teacher identification sub-model after parameter update, and the first model parameter of the first teacher identification sub-model and the second model parameter of the second teacher identification sub-model will also be updated during the iteration process of the model. The reference teacher feature value and the probe teacher feature value are extracted according to the first model parameter and the second model parameter, and then the loss value is calculated according to the feature values. The loss value obtained after iteration is the target loss value.

[0092] In some other embodiments, the update of the first model parameter and the second model parameter can also be implemented in other arbitrary possible ways, for example, the model parameters can be updated using the forward algorithm, or some other machine learning algorithm can be used to update the model parameters, which is not limited.

[0093] S210: training an initial student recognition model according to the positive sample pair, the negative sample pair, and the target teacher recognition model to obtain a target recognition model.

[0094] Optionally, in some embodiments, the initial student recognition model includes a first student recognition sub-model and a second student recognition sub-model, the first student recognition sub-model and the second student recognition sub-model form a semi-twin network architecture, the reference group sample is input into the first student recognition sub-model to obtain reference student features output by the first student recognition sub-model, the probe group sample pair is input into the second student recognition sub-model to obtain probe student features output by the first student recognition sub-model, and the initial student recognition model is trained according to the reference student features, the probe student features, and the target teacher features to obtain a target student recognition model, so that the initial student recognition model can be continuously iterated with some model parameters of the target teacher recognition model and data features respectively recognized by the target teacher recognition model for the positive sample pair and the negative sample pair, so that the initial student recognition model is effectively trained.

[0095] In the training process, the semi-twin network architecture stores the weight information of two sets of initial student recognition models, and iteratively updates the weight information of the model.

[0096] For example, assuming that the current data set for training the model is data_1, two different recognition models are obtained by training on this data set, one is an initial teacher recognition model model_t1 with high precision, and the other is a lightweight initial student recognition sub-model model_s1. When training the initial student recognition model, the random gradient descent algorithm can be used to fine-tune the initial student recognition model. Based on the semi-twin network architecture, the model stores two sets of weight information of the student recognition model_s1 in the training, which are the weight information of the first student recognition sub-model model_s1_0 and the weight information of the second student recognition sub-model model_s1_1.

[0097] For example, in the iterative training process of the model weight information, the sample pair data is divided into two groups, one group is called Probe, and the other group is called Gallery. The reference group Gallery extracts reference student features through the weight information of the first student recognition sub-model model_s1_0, and the probe group Probe extracts probe student features through the weight information of the second student recognition sub-model model_s1_1. The weight information updating method of the student recognition model can refer to the weight information updating method of the teacher recognition model, which will not be described here.

[0098] Wherein, when training the initial student recognition model, the target teacher features of the high-precision target teacher model in the local feature library can be introduced to guide the student model, and when calculating the target loss value of the student recognition model, the classification loss Loss class, the predicted features of the initial teacher recognition model and the difference measurement loss Loss similarity of the target teacher features need to be combined for calculation. The two feature values can be converted into probability distribution, and the relative entropy (Kullback Leibler, KL) divergence of the probability distribution is calculated to quantize a numerical value for calculation. The calculation of the target loss value Loss total can be linear weighting between the classification loss and the distribution similarity loss by using a hyperparameter, for example,

[0099] Loss_total = belta * Loss_class + (1-belta) * Loss_similarity;

[0100] Wherein, belta is a weighting hyperparameter, which will be fine-tuned in the training iteration process. In the initial training, the calculation of the target loss value can be more biased towards the distribution similarity loss, and the proportion of the classification loss can be gradually increased later, so that the knowledge in the target teacher recognition model in the local feature library can be transferred to the target recognition model more quickly.

[0101] In the embodiment, the initial student recognition model is trained using multiple historical versions of the teacher recognition model, which can make the initial student recognition model obtain higher gain in training. The parameters of the high-precision target teacher recognition model are processed to reduce the parameter amount, thereby effectively improving the training and inference speed of the initial student recognition model for incremental data, and making the training accuracy of the student recognition model be improved faster.

[0102] In the embodiment, after obtaining the above amplified positive sample pairs and negative sample pairs, the initial student model can be trained using the amplified positive sample pairs, negative sample pairs and target teacher recognition model, as shown in Figure 3 Figure 3 ​is a model iteration process schematic diagram in the embodiment, a batch of sample data is obtained from the original data (stock data) and the new data (incremental data) in sampling, the sample data is subjected to data augmentation operation, the positive sample pair and the negative sample pair obtained after the augmentation are used to train the initial teacher recognition model, the sampling and training process is repeated until the initial teacher recognition model converges, the teacher recognition model obtained by training is taken as a target teacher recognition model, and then the local feature library is updated. The feature value of the target teacher recognition model in the feature library and the sample data are used to train an initial student recognition model, and the sampling and training process is repeated until the student recognition model converges, and the student recognition model obtained by training is taken as a target recognition model.

[0103] In the embodiment, the initial teacher recognition model and the initial student recognition model are obtained, the positive sample pair and the negative sample pair are obtained from the incremental data and the stock data, the initial teacher recognition model is trained according to the positive sample pair and the negative sample pair to obtain a target teacher recognition model, and the initial student recognition model is trained according to the positive sample pair, the negative sample pair and the target teacher recognition model to obtain a target recognition model. While effectively maintaining the recognition accuracy of the target recognition model for the stock data in the existing scene, the recognition accuracy of the target recognition model on the incremental data can be effectively improved, so that the iterative training effect of the target recognition model can be effectively improved, the recognition performance of the target recognition model can be improved, and the recognition application scene of the target recognition model can be effectively expanded. Since the sample data is subjected to augmentation processing, the data augmentation mode can be flexibly adjusted according to the common situation of the business scene, the data sampling imbalance event can be effectively avoided when the sample data of the new scene is less than the stock data sample, so that the initial student recognition model can be effectively trained, the technical problem of overfitting in the related art under a small amount of new sample is solved, an incremental data of a small amount of new application scene is realized, and a lightweight student model is trained in combination with the stock data. The training efficiency and the training effect of the recognition model are greatly improved.

[0104] Figure 4 is a structural schematic diagram of a training device of a recognition model according to an embodiment of the present disclosure.

[0105] As Figure 4 shown, the training device 40 of the recognition model comprises:

[0106] A first obtaining module 401 is configured to obtain an initial teacher recognition model and an initial student recognition model.

[0107] A second obtaining module 402 is configured to obtain a positive sample pair and a negative sample pair from incremental data and stock data.

[0108] The first training module 403 is configured to train the initial teacher recognition model according to the positive sample pair and the negative sample pair, to obtain the target teacher recognition model.

[0109] The second training module 404 is configured to train the initial student recognition model according to the positive sample pair, the negative sample pair, and the target teacher recognition model, to obtain the target recognition model. In some embodiments of the present disclosure, as shown in the figure, the positive sample pair includes a current detection sample and a current reference sample, the current detection sample and the current reference sample have the same category, the negative sample pair includes the current detection sample and a historical reference sample, the current detection sample and the historical reference sample have different categories, and after the positive sample pair and the negative sample pair are obtained, the following steps are further included. Figure 5

[0110] The first forming module 405 is configured to form reference group samples according to the multiple times of sampling of the reference samples, the multiple times of sampling of the reference samples being obtained by sampling from the current reference sample and the historical reference sample.

[0111] The second forming module 406 is configured to form detection group samples according to the multiple times of sampling of the detection samples, the multiple times of sampling of the detection samples being obtained by sampling from the multiple current detection samples.

[0112] The first training module 403 is further configured to:

[0113] train the initial teacher recognition model according to the reference group samples and the detection group samples, to obtain the target teacher recognition model.

[0114] In some embodiments of the present disclosure, the initial teacher recognition model includes a first teacher recognition sub-model and a second teacher recognition sub-model, the first teacher recognition sub-model and the second teacher recognition sub-model form a semi-twin network architecture,

[0115] The first training module includes:

[0116] The first input sub-module 4031 is configured to input the reference group samples into the first teacher recognition sub-model, to obtain reference teacher features output by the first teacher recognition sub-model.

[0117] The second input sub-module 4032 is configured to input the detection group samples into the second teacher recognition sub-model, to obtain detection teacher features output by the first teacher recognition sub-model.

[0118] The training sub-module 4033 is configured to train the initial teacher recognition model according to the reference teacher features and the detection teacher features, to obtain the target teacher recognition model.

[0119] In some embodiments of the present disclosure, the training sub-module 4033 is further configured to:

[0120] ​determine a loss value according to the reference teacher feature and the detected teacher feature;

[0121] if the loss value meets a set condition, the initial teacher recognition model is taken as a target teacher recognition model;

[0122] if the loss value does not meet the set condition, the first model parameter and the second model parameter are respectively updated by using a target method until a target loss value meets the set condition, and a teacher recognition model obtained by training is taken as the target teacher recognition model;

[0123] wherein the first model parameter is a parameter of the first teacher recognition sub-model, the second model parameter is a parameter of the second teacher recognition sub-model, and the target loss value is a loss value determined based on teacher features respectively output by the first teacher recognition sub-model and the second teacher recognition sub-model after the parameters are updated.

[0124] In some embodiments of the present disclosure, the training sub-module 4033 is further configured to:

[0125] update the first model parameter by using a stochastic gradient descent method;

[0126] update the second model parameter by using a moving average method.

[0127] In some embodiments of the present disclosure, the training sub-module 4033 is further configured to:

[0128] input a sample pair corresponding to the incremental data into the target teacher recognition model to obtain a target teacher feature output by the target teacher recognition model, the target teacher feature being a teacher feature related to the sample pair corresponding to the incremental data and extracted by the target teacher recognition model.

[0129] In some embodiments of the present disclosure, the training sub-module 4033 is further configured to:

[0130] store the target teacher feature into a feature library.

[0131] In some embodiments of the present disclosure, the initial student recognition model comprises a first student recognition sub-model and a second student recognition sub-model, and the first student recognition sub-model and the second student recognition sub-model form a semi-twin network architecture,

[0132] wherein the second determining module 404 is further configured to:

[0133] input the reference group sample into the first student recognition sub-model to obtain a reference student feature output by the first student recognition sub-model;

[0134] input the detection group sample into the second student recognition sub-model to obtain a detection student feature output by the first student recognition sub-model;

[0135] The initial student recognition model is trained according to the reference student features, the detected student features, the target teacher features, and the teacher training features related to the sample pairs corresponding to the inventory data, to obtain a target student recognition model.

[0136] In some embodiments of the present disclosure, the method further comprises:

[0137] The processing module 407 is configured to perform amplification processing on the positive sample pairs and the negative sample pairs respectively.

[0138] The training method of the recognition model provided in the above Figures 1 to 3 The training method of the recognition model provided in the above Figures 1 to 3 The training method of the recognition model provided in the above

[0139] In the present embodiment, the initial teacher recognition model and the initial student recognition model are obtained, the positive sample pairs and the negative sample pairs are obtained, the positive sample pairs are determined according to the incremental data, the negative sample pairs are determined according to the inventory data, the initial teacher recognition model is trained according to the positive sample pairs and the negative sample pairs, to obtain a target teacher recognition model, the initial student recognition model is trained according to the positive sample pairs, the negative sample pairs, and the target teacher recognition model, to obtain a target recognition model, which can effectively maintain the recognition accuracy of the target recognition model for the inventory data in the existing scene, effectively improve the recognition accuracy of the target recognition model on the incremental data, thereby effectively improving the iterative training effect of the target recognition model, improving the recognition performance of the target recognition model, and effectively expanding the recognition application scene of the target recognition model.

[0140] To implement the above-mentioned embodiments, the present disclosure further provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the training method of the recognition model provided in the above-mentioned embodiments of the present disclosure.

[0141] To implement the above-mentioned embodiments, the present disclosure further provides a non-transitory computer readable storage medium having a computer program stored thereon, and the program is executable on a processor to implement the training method of the recognition model provided in the above-mentioned embodiments of the present disclosure.

[0142] To implement the above-mentioned embodiments, the present disclosure further provides a computer program product, and when the instructions in the computer program product are executed by a processor, the training method of the recognition model provided in the above-mentioned embodiments of the present disclosure is executed.

[0143] Figure 6A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Figure 6 The computer device 12 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.

[0144] like Figure 6 As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0145] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of such architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnection (PCI) bus.

[0146] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0147] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive").

[0148] although Figure 6A disk drive, a floppy disk drive, a CD-ROM drive, a DVD-ROM drive, or other removable media drive, can be provided for reading from and writing to a removable n onvolatile magnetic disk (e.g., a "floppy disk"), and to a removable nonvolatile optical disk (e.g., a CD ROM, a DVD ROM, or another optical medium). In these instances, each drive can be connected to the bus 18 by one or more data media interfaces. The memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.

[0149] Program / utility 40, having a set (at least one) of program modules 42, can be stored in memory 28 by way of example, and not limitation, as well as an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, can include implementation of a networking environment. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the disclosure as described herein.

[0150] Computer device 12 can also communicate with one or more external devices 14 such as a keyboard or a pointing device, a display 24, etc. and also with one or more devices that enable a user to interact with computer device 12 and / or any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication can occur via input / output (I / O) interface(s) 22. Still yet, computer device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or the Internet) through network adapter 20. As an example, network adapter 20 can include a modem, a network card (wireless or wired), or other well-known interface devices. As depicted, network adapter 20 communicates with the other

[0151] Processing unit(s) 16 can execute instructions from programs stored in system memory 28 to perform various functions applications and data processing, such as implementing the training methods of the recognition models mentioned in the foregoing embodiments.

[0152] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the concepts disclosed herein. It is intended that the disclosure be construed as including any paterns of this disclosure which are within the scope of the disclosure and including equivalents thereof. The specification and examples given herein are only intended to be exemplary and are not intended to limit the true scope and spirit of the disclosure.

[0153] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated in the drawings and that various modifications and changes can be made therein without departing from the scope thereof. The scope of the present disclosure is limited only by the claims appended hereto.

[0154] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are used only for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, the meaning of "a plurality of" is two or more, unless otherwise specified.

[0155] Any process or method descriptions or any other descriptions herein can be understood as representing embodiments of implementations encompassing one or more steps, operations or functions, and the scope of the preferred embodiments of the present disclosure includes additional implementations that can not be precisely shown or described herein, but which are encompassed by the claims. The claims are intended to cover all steps, operations, methods, and / or processes substantially similar to those described herein, whether or not such steps, operations, methods, and / or processes are expressly described herein.

[0156] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: discrete logic circuit with logic gate circuit for implementing logic functions on data signals, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA), etc.

[0157] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment method can be completed by a program instructing the relevant hardware, and the program can be stored in a computer readable storage medium, which includes one or a combination of the steps of the method embodiment when executed.

[0158] In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0159] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0160] In the description of the present specification, the description referring to the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0161] Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present disclosure, and those of ordinary skill in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A method for training a recognition model, characterized by, The method comprises: obtaining an initial teacher identification model and an initial student identification model, wherein the initial teacher identification model comprises a first teacher identification sub-model and a second teacher identification sub-model, and the first teacher identification sub-model and the second teacher identification sub-model form a semi-twin network architecture; sampling positive sample pairs and negative sample pairs from incremental data and inventory data, wherein the positive sample pairs comprise a current detection sample and a current reference sample, the current detection sample and the current reference sample have the same category, and the negative sample pairs comprise the current detection sample and a historical reference sample, the current detection sample and the historical reference sample have different categories; the current detection sample and the current reference sample refer to data samples at a time of non-iterative training of the model, and the historical reference sample refers to a reference sample that has been used in iterative training of the model; forming reference group samples according to multiple sampled reference samples, wherein the multiple sampled reference samples are sampled from the current reference sample and the historical reference sample; forming detection group samples according to multiple sampled detection samples, wherein the multiple sampled detection samples are sampled from multiple current detection samples; inputting the reference group samples into the first teacher identification sub-model to obtain reference teacher features output by the first teacher identification sub-model; inputting the detection group samples into the second teacher identification sub-model to obtain detection teacher features output by the second teacher identification sub-model; training the initial teacher identification model according to the reference teacher features and the detection teacher features to obtain a target teacher identification model; training the initial student identification model according to the positive sample pairs, the negative sample pairs, and the target teacher identification model to obtain a target identification model.

2. The method of claim 1, wherein, The training of the initial teacher identification model according to the reference teacher features and the detection teacher features to obtain a target teacher identification model comprises: determining a loss value according to the reference teacher features and the detection teacher features; if the loss value meets a set condition, regarding the initial teacher identification model as the target teacher identification model; if the loss value does not meet the set condition, updating first model parameters and second model parameters respectively by using a target method until a target loss value meets the set condition, and regarding a trained teacher identification model as the target teacher identification model; wherein the first model parameters are parameters of the first teacher identification sub-model, the second model parameters are parameters of the second teacher identification sub-model, and the target loss value is a loss value determined based on teacher features respectively output by the first teacher identification sub-model and the second teacher identification sub-model after parameter updating.

3. The method of claim 2, wherein, The updating of the first model parameters and the second model parameters respectively by using the target method comprises: updating the first model parameters by using a stochastic gradient descent method; updating the second model parameters by using a moving average method.

4. The method of claim 2, wherein, The method further comprises: Inputting the sample pair corresponding to the incremental data into the target teacher identification model to obtain a target teacher feature output by the target teacher identification model, the target teacher feature being a teacher feature related to the sample pair corresponding to the incremental data extracted by the target teacher identification model.

5. The method of claim 4, wherein, The method further comprises: Storing the target teacher feature into a feature library.

6. The method of claim 4, wherein, The initial student identification model comprises a first student identification sub-model and a second student identification sub-model, and the first student identification sub-model and the second student identification sub-model form a semi-twin network architecture, The method further comprises: Inputting the reference group sample into the first student identification sub-model to obtain a reference student feature output by the first student identification sub-model; Inputting the detection group sample into the second student identification sub-model to obtain a detection student feature output by the first student identification sub-model; Training the initial student identification model according to the reference student feature, the detection student feature, the target teacher feature, and a teacher feature related to the sample pair corresponding to the stock data to obtain the target student identification model.

7. The method according to any one of claims 1 to 6, wherein The method further comprises: Respectively amplifying the positive sample pair and the negative sample pair.

8. A training apparatus of a recognition model characterized by comprising: The device comprises: A first obtaining module configured to obtain an initial teacher identification model and an initial student identification model, wherein the initial teacher identification model comprises a first teacher identification sub-model and a second teacher identification sub-model, and the first teacher identification sub-model and the second teacher identification sub-model form a semi-twin network architecture; A second obtaining module configured to sample a positive sample pair and a negative sample pair from incremental data and stock data, wherein the positive sample pair comprises a current detection sample and a current reference sample, the current detection sample and the current reference sample have the same category, the negative sample pair comprises the current detection sample and a historical reference sample, the current detection sample and the historical reference sample have different categories, the current detection sample and the current reference sample refer to data samples at a time of non-iterative training of a model, and the historical reference sample refers to a reference sample used in iterative training of the model; The first training module is configured to form reference group samples according to multiple sampled reference samples, the multiple sampled reference samples being sampled from the current reference samples and the historical reference samples; form detection group samples according to multiple sampled detection samples, the multiple sampled detection samples being sampled from multiple current detection samples; input the reference group samples into the first teacher identification sub-model to obtain reference teacher features output by the first teacher identification sub-model; input the detection group samples into the second teacher identification sub-model to obtain detection teacher features output by the second teacher identification sub-model; and train the initial teacher identification model according to the reference teacher features and the detection teacher features to obtain a target teacher identification model. The second training module is configured to train the initial student identification model according to the positive sample pair, the negative sample pair, and the target teacher identification model to obtain a target identification model.

9. The apparatus of claim 8, wherein, The first training module is further configured to: determine a loss value according to the reference teacher features and the detection teacher features; if the loss value meets a set condition, use the initial teacher identification model as the target teacher identification model; if the loss value does not meet the set condition, update first model parameters and second model parameters respectively by using a target method until a target loss value meets the set condition, and use the trained teacher identification model as the target teacher identification model; wherein the first model parameters are parameters of the first teacher identification sub-model, the second model parameters are parameters of the second teacher identification sub-model, and the target loss value is a loss value determined based on teacher features output by the first teacher identification sub-model and the second teacher identification sub-model after parameter updating.

10. The apparatus of claim 9, wherein, The first training module is further configured to: update the first model parameters by using a stochastic gradient descent method; update the second model parameters by using a moving average method.

11. The apparatus of claim 9, wherein, The first training module is further configured to: input a sample pair corresponding to the incremental data into the target teacher identification model to obtain target teacher features output by the target teacher identification model, the target teacher features being teacher features related to the sample pair corresponding to the incremental data and extracted by the target teacher identification model.

12. The apparatus of claim 11, wherein, The first training module is further configured to: store the target teacher features into a feature library.

13. The apparatus of claim 11, wherein, The initial student identification model includes a first student identification sub-model and a second student identification sub-model, and the first student identification sub-model and the second student identification sub-model form a semi-twin network architecture. The second training module is further configured to: input the reference group samples into the first student identification sub-model to obtain reference student features output by the first student identification sub-model; input the detection group samples into the second student identification sub-model to obtain detection student features output by the first student identification sub-model; and The initial student recognition model is trained according to the reference student feature, the detection student feature, the target teacher feature, and a teacher feature related to a sample pair corresponding to the inventory data, to obtain the target student recognition model.

14. The apparatus of any one of claims 8-13, wherein Further comprising: a processing module, configured to perform amplification processing on the positive sample pair and the negative sample pair respectively.

15. A computer device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

16. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-7. The computer instructions are used to enable the computer to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Image detection model training method and device, electronic equipment and storage medium

    CN113705362A