Model training method, object retrieval method and related equipment

By inputting existing objects and new objects into existing models and new models for feature extraction and adjusting new model parameters, the algorithm lacks learning and adaptability to new objects in the database, improving the accuracy and efficiency of object retrieval, and avoiding "catastrophic forgetting".

CN119692429APending Publication Date: 2025-03-25MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411823185.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve the algorithm's ability to learn and adapt to new objects in the database, thereby affecting the accuracy and efficiency of object retrieval.

Method used

A model training method is adopted to extract features by inputting existing objects and new objects into existing models and new models, adjusting the parameters of the new model to enhance their learning and adaptability to the new objects, and avoiding "catastrophic forgetting".

Benefits of technology

It improves the model's continuous learning and adaptability to new objects, enhances the accuracy and efficiency of object retrieval, and effectively conveys the knowledge of existing models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692429A_ABST
    Figure CN119692429A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, an object retrieval method and related equipment, which are used for improving the learning and adaptive capacity of a model to a newly added object so as to improve the retrieval accuracy and efficiency. The model training method comprises the following steps: inputting a first object and a newly added second object into a trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object; the first object and the second object are input into a second model for feature extraction, a third feature vector of the first object and a fourth feature vector of the second object are obtained, and the parameters of the second model are the same as those of the first model; and adjusting parameters of the second model based on a first distance between the first feature vector and the third feature vector, a second distance between the second feature vector and the fourth feature vector, and a third distance between the third feature vector and the fourth feature vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a model training method, an object retrieval method and related equipment. Background Art

[0002] Retrieving similar objects from a database through artificial intelligence (AI) algorithms has been widely used in risk assessment, fraud detection, information recommendation and other fields. In order to cope with the complex and changing data environment and retrieval requirements in various fields, it is usually necessary to update the objects in the database.

[0003] How to ensure the algorithm's ability to learn and adapt to new objects in the database, thereby improving the accuracy and efficiency of object retrieval, has become a hot research topic. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a model training method, an object retrieval method and related equipment for continuous learning of new objects in a database, thereby improving the model's learning and adaptability to new objects, thereby improving retrieval accuracy and efficiency.

[0005] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a model training method, comprising:

[0007] Inputting the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object;

[0008] Inputting the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model;

[0009] Parameters of the second model are adjusted based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

[0010] In a second aspect, an embodiment of the present application provides an object retrieval method, including:

[0011] In response to receiving a retrieval request for a sixth object, extracting features of the objects in the database and the sixth object by using a second model to obtain a fifth feature vector of the objects in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model provided by the first aspect;

[0012] Based on the fifth feature vector and the sixth feature vector, a seventh object similar to the sixth object is retrieved from the database.

[0013] In a third aspect, an embodiment of the present application provides a model training device, comprising:

[0014] A first extraction module, used for inputting the first object and the newly added second object into the trained first model for feature extraction, to obtain a first feature vector of the first object and a second feature vector of the second object;

[0015] a second extraction module, configured to input the first object and the second object into a second model for feature extraction, to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model;

[0016] An adjustment module is used to adjust the parameters of the second model based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

[0017] In a fourth aspect, an embodiment of the present application provides an object retrieval device, including:

[0018] a response module, configured to, in response to receiving a retrieval request for a sixth object, extract features of the objects in the database and the sixth object by using a second model to obtain a fifth feature vector of the objects in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model provided in the first aspect;

[0019] A retrieval module is used to retrieve a seventh object similar to the sixth object from the database based on the fifth feature vector and the sixth feature vector.

[0020] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0021] processor;

[0022] a memory for storing instructions executable by the processor;

[0023] The processor is configured to execute the instructions to implement the model training method provided in the first aspect; or, the processor is configured to execute the instructions to implement the object retrieval method provided in the second aspect.

[0024] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a model training method as provided in the first aspect; or, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute an object retrieval method as provided in the second aspect.

[0025] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps in the model training method provided in the first aspect; or, the computer program is operable to cause a computer to execute part or all of the steps in the object retrieval method provided in the second aspect.

[0026] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0027] Adopting the technical concept of sustainable learning, a new model with the same parameters as the existing model is adopted, so that the existing model and the new model form a twin network structure. On this basis, the existing objects and the new objects are input into the existing model for feature extraction to obtain the first feature vector of the existing objects and the second feature vector of the new objects. The existing objects and the new objects are also input into the new model for feature extraction to obtain the third feature vector of the existing objects and the fourth feature vector of the new objects. The first distance between the first eigenvector and the third eigenvector of the existing object can reflect the output consistency of the existing model and the new model for the existing object, and the second distance between the second eigenvector and the fourth eigenvector of the newly added object can reflect the output consistency of the existing model and the new model for the newly added object. These two output consistencies help to use the existing model to guide the new model to learn the existing objects and the newly added objects, which not only constrains the new model to be consistent with the existing model in output, but also ensures that the new model retains the knowledge in the existing model; and the third distance between the third eigenvector of the existing object and the fourth eigenvector of the newly added object can reflect the learning effect of the new model on the similarity between the existing object and the newly added object; based on this, training the new model based on the above-mentioned first distance, second distance and third distance can not only enhance the new model's continuous learning and adaptability to the newly added objects and improve the training efficiency, but also effectively transfer the knowledge mastered by the existing model to the new model, avoiding the new model's "catastrophic forgetting" of the existing objects. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0029] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present application;

[0030] Figure 2 A schematic diagram of a training process of a model provided for one embodiment of the present application;

[0031] Figure 3 A flowchart of a model training method provided for one embodiment of the present application;

[0032] Figure 4 A schematic diagram of a training process of a second model provided for one embodiment of the present application;

[0033] Figure 5 A flowchart of an object retrieval method provided for one embodiment of the present application;

[0034] Figure 6 A schematic diagram of the structure of a model training device provided in one embodiment of the present application;

[0035] Figure 7 A schematic diagram of the structure of an object retrieval device provided for one embodiment of the present application;

[0036] Figure 8 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0038] The terms "first", "second", etc. in this specification and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in this specification and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.

[0039] As mentioned above, how to ensure the algorithm's ability to learn and adapt to newly added objects in the database, thereby improving the accuracy and efficiency of object retrieval, has become a hot research topic. In related technologies, in order to address this technical problem, the newly added objects in the database are usually mixed with the existing objects and then the model is retrained, or the newly added objects are directly used for training based on the model trained with the existing objects.

[0040] After extensive research, the applicant found that the categories of the newly added objects in the database may be new categories or existing categories in the database. If the new objects in the database are mixed with the existing objects and the model is re-trained, it will lead to inefficiency and hinder the model's ability to learn the new objects in real time. If training is performed on a model trained based on existing objects and new objects are used directly for training, the model will easily be affected by the new objects and its processing ability for existing objects will be greatly reduced, causing "catastrophic forgetting."

[0041] To this end, an embodiment of the present application proposes a model training method, adopts the technical concept of sustainable learning, and adopts a new model with the same parameters as the existing model, so that the existing model and the new model form a twin network structure. On this basis, the existing objects and the new objects are input into the existing model for feature extraction to obtain the first feature vector of the existing objects and the second feature vector of the new objects. The existing objects and the new objects are also input into the new model for feature extraction to obtain the third feature vector of the existing objects and the fourth feature vector of the new objects. The first distance between the first eigenvector and the third eigenvector of the existing object can reflect the output consistency of the existing model and the new model for the existing object, and the second distance between the second eigenvector and the fourth eigenvector of the newly added object can reflect the output consistency of the existing model and the new model for the newly added object. These two output consistencies help to use the existing model to guide the new model to learn the existing objects and the newly added objects, which not only constrains the new model to be consistent with the existing model in output, but also ensures that the new model retains the knowledge in the existing model; and the third distance between the third eigenvector of the existing object and the fourth eigenvector of the newly added object can reflect the learning effect of the new model on the similarity between the existing object and the newly added object; based on this, training the new model based on the above-mentioned first distance, second distance and third distance can not only enhance the new model's continuous learning and adaptability to the newly added objects and improve the training efficiency, but also effectively transfer the knowledge mastered by the existing model to the new model, avoiding the new model's "catastrophic forgetting" of the existing objects.

[0042] The embodiment of the present application also proposes an object retrieval method. Since the new model after the above training has both the ability to process existing objects and the ability to adapt to newly added objects, the new model trained by the above training method is used to extract features of the objects requested to be retrieved and the objects in the database respectively. Based on the feature vectors of the two, similar objects of the objects requested to be retrieved are retrieved from the database, which can improve the retrieval accuracy.

[0043] It should be understood that the model training method and object retrieval method provided in the embodiments of the present application can be performed by an electronic device. The electronic devices referred to here may include terminal devices, such as smart phones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances, smart watches, vehicle terminals, aircraft, etc.; or, the electronic device may also include a server, such as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0044] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0045] Before introducing the technical solution provided by the embodiment of the present application in detail, a brief introduction to the system architecture involved in the embodiment of the present application is first given. Figure 1 , is a schematic diagram of a system architecture provided for an embodiment of the present application, wherein the system mainly includes: an information collection module, a retrieval module, a training module, a continuous learning module and a database.

[0046] The training module obtains multiple objects from the database, uses the object information of these objects to train the model, and deploys the trained model to the retrieval module. As an example, Figure 2 As shown, the objects in the database are combined to obtain sample pairs and mark the labels of the sample pairs. The sample pairs include two objects (i.e., object 1 and object 2), and the labels of the sample pairs indicate whether the two objects are similar. Then, two models with the same parameters are used to form a twin network structure, and the object information of object 1 in the sample pair is input into one model for feature extraction to obtain a feature vector of object 1, and the object 2 in the sample pair is input into another model for feature extraction to obtain a feature vector of object 2. Further, based on the distance between the feature vectors of the two objects and the labels of the sample pair, the loss is calculated. Then, the parameters of the two models are adjusted based on the loss. The above steps are repeated multiple times until the training stop condition is met, and then any trained model is deployed as the first model in the retrieval module.

[0047] More specifically, as an example, the model includes TextCNN, VGGNet, a first decoder of a multi-layer transformer structure, a second decoder of a multi-layer transformer structure, and a multilayer perceptron (MLP). Among them, TextCNN is a convolutional neural network (CNN) for text classification, which is used to extract text features from the text contained in the object information of the object and encode them (such as one-hot, multihot, word2vec, bert, etc. encoding) to obtain the text feature vector of the object. VGGNet is a deep convolutional neural network, which is used to extract video features from the adaptation contained in the object information and encode them to obtain the video feature vector of the object. The first decoder decodes the text feature vector, and the second decoder decodes the video feature vector. The two decoding results are processed by MLP to obtain the feature vector of the object.

[0048] The information collection module can receive a search request, which is used to request to search for similar objects of a certain object. The information collection module sends the object as a newly added object to the database for storage, and also sends the object to the search module.

[0049] The retrieval module obtains the object information of the existing objects from the database, and inputs the object information of the existing objects into the trained model for feature extraction, obtains the feature vector of the existing objects and stores it. After receiving the object information of the newly added object, the retrieval module inputs the object information into the trained model for feature extraction, obtains the feature vector of the newly added object, calculates the distance between the feature vector and the feature vector of the existing object, selects the first n existing objects closest to the newly added object, and outputs them as the retrieval result.

[0050] The continuous learning module periodically obtains new objects in the database. If the new objects meet the update conditions for the existing model, the existing model is updated based on the new objects and the existing objects, and the updated model is deployed to the retrieval module.

[0051] Based on the system architecture introduced above, the training method and retrieval method of the model provided in the embodiment of the present application are introduced in detail with reference to the accompanying drawings.

[0052] Please refer to Figure 3 , is a flow chart of a model training method provided by an embodiment of the present application, the method comprising the following steps:

[0053] S302: Input the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object.

[0054] In order to cope with the complex and ever-changing data environment and retrieval requirements in various fields, the database will be updated in real time. As an example, the object that already exists in the database before the update is the first object, and the newly acquired object after the update is the second object.

[0055] Each object has corresponding object information, and the object information may include, for example, but is not limited to, at least one of the following information: text and video corresponding to the object. For example, in the resource application scenario, each object is an applicant, and the text corresponding to the applicant is used to describe at least one of the following information: the applicant's name, age, application amount, occupation and income, education, graduation school, education manager, children's age, academic status, debt status, credit status (such as whether there is a record of overdue resource return), parents' age, parents' physical condition, etc. The video corresponding to the applicant may include a personal video recorded by the applicant when applying for resources.

[0056] The first model has the function of feature extraction. Figure 4 As shown, the object information of the first object is input into the first model for feature extraction, and the first feature vector of the first object can be obtained. The object information of the second object is input into the first model for feature extraction, and the second feature vector of the second object can be obtained.

[0057] S304: Input the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object.

[0058] The parameters of the second model are the same as those of the first model. As an example, the second model can be initialized using the parameters of the first model. In this way, the second model has the knowledge already acquired by the first model and can be used to process existing objects. Training based on the second model can improve training efficiency compared to training a model from scratch.

[0059] like Figure 4 As shown, similar to the above S302, the object information of the first object is input into the second model for feature extraction to obtain the third feature vector of the first object, and the object information of the second object is input into the second model for feature extraction to obtain the fourth feature vector of the second object.

[0060] S306 , adjusting parameters of the second model based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

[0061] In the embodiment of the present application, the distance between any two feature vectors can be obtained by using various distance calculation methods in the art, such as Euclidean distance, cosine distance, etc., which is not limited in the embodiment of the present application.

[0062] The first distance can reflect the output consistency of the existing model and the new model for the existing objects, and the second distance can reflect the output consistency of the existing model and the new model for the newly added objects. These two output consistencies help to use the existing model to guide the new model to learn the existing objects and the newly added objects, which not only constrains the new model to be consistent with the existing model in output, but also ensures that the new model retains the knowledge in the existing model; and the third distance can reflect the learning effect of the new model on the similarity between the existing objects and the newly added objects; based on this, training the new model based on the above-mentioned first distance, second distance and third distance can not only enhance the new model's continuous learning and adaptability to the newly added objects and improve the training efficiency, but also effectively transfer the knowledge mastered by the existing model to the new model, avoiding the new model's "catastrophic forgetting" of the existing objects.

[0063] In the embodiment of the present application, the above S306 can be implemented in various appropriate ways, which is not limited in the embodiment of the present application.

[0064] In one embodiment, the above S306 includes the following steps:

[0065] S361: Obtain a first label of a first sample pair consisting of a first object and a second object.

[0066] The first label is used to indicate whether the first object and the second object are similar.

[0067] S362, determine a first loss based on the first distance and the second distance.

[0068] The first loss is also called distillation loss, which is used to measure the difference between the output of the first model and the output of the second model. By minimizing the first loss, the second model can learn the knowledge in the first model, thereby reducing the complexity of the model and computing resource requirements while ensuring high performance.

[0069] As an example, the average value between the first distance and the second distance is determined as the first loss.

[0070] As another example, the sum of the first distance and the second distance is determined as the first loss. Specifically, the first loss can be obtained by the following formula (1):

[0071] L kd =(MA(XB)-MB(XB)) 2 +(MA(XA)-MB(XA)) 2 (1)

[0072] Among them, L kd represents the first loss, MA represents the first model, MB represents the second model, XA represents the first object, XB represents the second object, MA(XA) represents the first eigenvector of the first object, MB(XA) represents the third eigenvector of the first object, (MA(XA)-MB(XA)) 2 represents the first distance, MA(XB) represents the second eigenvector of the second object, MB(XB) represents the fourth eigenvector of the second object, (MA(XB)-MB(XB)) 2 Indicates the second distance.

[0073] S363: Determine a second loss based on the first label and the third distance.

[0074] The third distance may reflect the similarity evaluated by the second model for the first object and the second object. The first label is used to represent the actual similarity between the first object and the second object. For example, if the first object and the second object are similar, the first label yc_i=1; if the first object and the second object are not similar, the first label yc_i=0. Therefore, the second loss is also called the metric loss, which is used to evaluate the difference between the similarity evaluated by the second model for the first object and the second object and the actual similarity between the two.

[0075] As an example, the third distance is converted into a corresponding score to indicate whether the first object and the second object are similar; then, the second loss is determined based on the difference between the first label and the score.

[0076] As another example, the above S363 includes: determining the difference between the third distance and the first distance threshold and the maximum value between the preset differences; based on the first label, determining the first weight of the third distance and the second weight of the maximum value; based on the first weight and the second weight, performing weighted summation on the third distance and the maximum value to obtain a second loss.

[0077] Specifically, the second loss can be determined by the following formula (2):

[0078]

[0079] Among them, L c represents the second loss, N is the number of first sample pairs consisting of the first object and the second object, yc i represents the first label of the first sample pair i, dc i represents the third distance between the third eigenvector of the first object and the fourth eigenvector of the second object in the first sample pair, △ represents the first distance threshold, and 0 is the preset difference value. The first threshold distance can be a minimum distance set according to actual needs, such as 0.1, 0.5, etc., which is not limited in the embodiment of the present application.

[0080] S364: Adjust parameters of the second model based on the first loss and the second loss.

[0081] As an example, a weighted sum of the first loss and the second loss is determined, and the parameters of the second model are adjusted based on the weighted sum, such as by a gradient descent algorithm, a back propagation algorithm, etc.

[0082] As another example, before the above S364, it also includes: obtaining a second label of the second sample pair composed of the first object, the second label indicating whether the first object in the second sample pair is similar; determining a fourth distance between the first feature vectors of the first object in the second sample pair; and determining a third loss based on the second label and the fourth distance. Further, the above S364 includes: adjusting the parameters of the second model based on the weighted sum of the first loss, the second loss, and the third loss.

[0083] The fourth distance can reflect the similarity evaluated by the first model for the two first objects. The second label is used to represent the actual similarity between the two first objects. For example, if the two first objects are similar, the second label yc_i=1; if the two first objects are not similar, the second label yc_i=0. Therefore, the third loss can be used to evaluate the difference between the similarity evaluated by the first model for the two first objects and the actual similarity between the two, and thus can reflect the processing ability of the first model for existing objects.

[0084] More specifically, the third loss can be determined by the following formula (3):

[0085]

[0086] Among them, L ori represents the third loss, N is the number of second sample pairs consisting of two first objects, y i represents the second label of the second sample pair i, d i represents the fourth distance between the first feature vectors of the first object in the second sample pair, △ represents the first distance threshold, and 0 is the preset difference value.

[0087] The weighted sum of the first loss, the second loss and the third loss can be obtained by the following formula (4):

[0088] L=L ori +L c +L kd (4)

[0089] Among them, L represents the weighted sum of the first loss, the second loss and the third loss.

[0090] In the second method mentioned above, the third loss is also considered when adjusting the parameters of the second model, which can not only retain the knowledge in the trained first model, but also perform further training on newly added second objects, especially training on second objects of new categories, thereby enhancing the retrieval capability of the second model.

[0091] The above shows some implementation methods of the above S306. Of course, it should be understood that the above S306 can also be implemented in other ways, and the embodiments of the present application are not limited to this. For example, in other implementations, the first label of the first sample pair consisting of the first object and the second object is obtained, and the difference between the first label and the third distance is determined; then, the difference, the first distance and the second distance are weighted and summed, and the weighted summation result is used to adjust the parameters of the second model.

[0092] It is worth noting that the above S302 to S306 is only a training process for the second model. In practical applications, the second model can be trained multiple times, that is, the above S302 to S306 are repeated multiple times until the training stop condition is met. Among them, the training stop condition can be set according to actual needs, such as the number of training times reaches a threshold or the loss of the second model converges, etc., and the embodiments of the present application do not limit this.

[0093] In the embodiment of the present application, as an example, all objects in the database can be used as the first object to perform the above S302 to S306. Since all the existing objects are used to train the second model, the training effect of the second model can be ensured.

[0094] As another example, the first object is obtained in the following manner:

[0095] Repeating the first operation, and stopping the first operation when the number of objects in the database is less than a first preset number; the first operation includes:

[0096] Repeat the second operation, and if there is no fourth object similar to the starting point in the database, stop the second operation; wherein the second operation includes: randomly selecting a third object from the database as the starting point, selecting a fourth object similar to the starting point from the database, and using the fourth object as a new starting point;

[0097] Extracting a first preset number of objects from the third object and the fourth object as the first object;

[0098] The third object and the fourth object are deleted from the database.

[0099] For example, the objects in the database include objects 1 to n, and the first preset number is m (m is less than n). Assume that object 2 is randomly extracted from the database, object 2 is similar to object 3, object 3 is similar to object 5, object 5 is similar to object 7, and so on. According to the principle of similarity transfer, object 5 and object 7 are also similar to object 2, that is, object 3 has a direct similarity relationship with object 2, and object 5 and object 7 have an indirect similarity relationship with object 2; further, objects that have a direct or indirect similarity relationship with object 2 are extracted from the database, m objects are extracted from object 2 and these objects as the first object, and object 2 extracted from the database and objects that are directly or indirectly similar to object 2 are deleted from the database; if the number of objects remaining in the database is less than m, the next round of extraction (i.e., the first operation of the next round) is stopped, otherwise, the next round of extraction is performed, and the above process is repeated until the number of objects remaining is less than m.

[0100] In this way, using these first objects to train the second model can not only avoid the huge computing and storage overhead brought by using all existing objects, but also help to quickly mark which first objects are similar and which are dissimilar based on the similarity transfer relationship, thereby improving the training efficiency of the second model.

[0101] In the embodiment of the present application, the training of the second model may be triggered at any appropriate time. As an example, once there is a newly added second object, the training of the second model is triggered, that is, the above S302 to S306 are executed.

[0102] As another example, once the number of newly added second objects is greater than the number threshold, the training of the second model is triggered, that is, the above S302 to S306 are executed.

[0103] As another example, before the above S304, it is determined whether the training condition of the second model is triggered. If the training condition is triggered, S304 to S306 are executed. Specifically, whether the training condition is triggered can be determined in the following manner:

[0104] Step A1: determining a fifth distance between the first object and the second object based on a first feature vector of the first object and a second feature vector of the second object.

[0105] Step A2: selecting a plurality of first objects whose fifth distance to the second object is greater than a second distance threshold.

[0106] Step A3: determining a first deviation degree of the second object based on the fifth distances between the selected plurality of first objects and the second object.

[0107] The first deviation degree of the second object is used to represent the difference in data distribution between the second object and the first object which is closer.

[0108] Specifically, for each second object, the n first objects closest to the second object are selected from the database; the maximum fifth distance and the minimum fifth distance are selected from the fifth distances between the second object and the n first objects, and then the first deviation degree of the second object is determined by the following formula (5).

[0109]

[0110] Among them, γ i represents the first deviation degree of the second object i, represents the maximum fifth distance, Indicates the smallest fifth distance.

[0111] It can be seen that the larger the difference between the maximum distance and the minimum distance between the second object and the selected first object, the more the second object deviates from the data distribution of the first object, and thus the greater the first deviation degree of the second object.

[0112] Step A4: determining whether a training condition of the second model is triggered based on the first deviation degree of the second object.

[0113] If the number of the second object is one, then when the first deviation degree of the second object is greater than the deviation degree threshold, it is determined that the training condition of the second model is triggered.

[0114] If there are multiple second objects, the second degree of deviation is determined based on the first degree of deviation of the multiple second objects; if the second degree of deviation is greater than or equal to the deviation degree threshold, and the number of second objects is greater than a second preset number, it is determined that the training condition of the second model is triggered.

[0115] The second deviation degree represents the overall deviation degree of all second objects from the first object in data distribution, which can be determined by the following formula (6):

[0116] γ=∑ p γ i (6)

[0117] Among them, γ represents the second deviation degree, γ i represents the first deviation degree of the second object i, and p represents the number of the second objects.

[0118] It is understandable that, when the second degree of deviation is large, it can be determined that the category of the newly added second object is not a category already in the database. If the number of second objects is too large at this time, the first model is still used to search for similar objects, which will lead to inaccurate search results. For this reason, when the second degree of deviation is large and the number of second objects is large, it is determined that the training condition of the second model is triggered, and the second model is trained using the first object and the second object, which can enhance the adaptability of the trained second model to objects of the newly added category, thereby improving the accuracy of object retrieval.

[0119] The model training method provided by one or more embodiments of the present application adopts the technical concept of sustainable learning and adopts a new model with the same parameters as the existing model, so that the existing model and the new model form a twin network structure. On this basis, the existing objects and the new objects are input into the existing model for feature extraction to obtain the first feature vector of the existing objects and the second feature vector of the new objects. The existing objects and the new objects are also input into the new model for feature extraction to obtain the third feature vector of the existing objects and the fourth feature vector of the new objects. The first distance between the first eigenvector and the third eigenvector of the existing object can reflect the output consistency of the existing model and the new model for the existing object, and the second distance between the second eigenvector and the fourth eigenvector of the newly added object can reflect the output consistency of the existing model and the new model for the newly added object. These two output consistencies help to use the existing model to guide the new model to learn the existing objects and the newly added objects, which not only constrains the new model to be consistent with the existing model in output, but also ensures that the new model retains the knowledge in the existing model; and the third distance between the third eigenvector of the existing object and the fourth eigenvector of the newly added object can reflect the learning effect of the new model on the similarity between the existing object and the newly added object; based on this, training the new model based on the above-mentioned first distance, second distance and third distance can not only enhance the new model's continuous learning and adaptability to the newly added objects and improve the training efficiency, but also effectively transfer the knowledge mastered by the existing model to the new model, avoiding the new model's "catastrophic forgetting" of the existing objects.

[0120] Please refer to Figure 5 , is a flow chart of an object retrieval method provided by an embodiment of the present application, the method comprising the following steps:

[0121] S502, in response to receiving a search request for a sixth object, extracting features of the object in the database and the sixth object using a second model to obtain a fifth feature vector of the object in the database and a sixth feature vector of the sixth object.

[0122] The second model is obtained by training based on the model training method provided in one or more embodiments of the present application.

[0123] A specific implementation method of extracting features from each object using the second model, and Figure 3 The specific implementation of S304 in the illustrated embodiment is similar and will not be described in detail.

[0124] S504: Retrieve a seventh object similar to the sixth object from a database based on the fifth feature vector and the sixth feature vector.

[0125] Specifically, the distance between each object in the database and the sixth object is determined according to the fifth eigenvector and the sixth eigenvector; then, n objects with the closest distance to the sixth object are selected from the database as seventh objects similar to the sixth object.

[0126] One or more embodiments of the present application provide an object retrieval method. Since the new model after the training mentioned above has both the ability to process existing objects and the ability to adapt to newly added objects, the new model trained by the above training method is used to extract features of the objects requested to be retrieved and the objects in the database respectively, and based on the feature vectors of the two, similar objects to the objects requested to be retrieved are retrieved from the database, which can improve the retrieval accuracy.

[0127] The model training method and object retrieval method provided in the above embodiment can be applied to various scenarios with similar object retrieval requirements, and the present application embodiment does not limit this. For ease of understanding, the model training method and object retrieval method provided in the present application embodiment are described below using the resource application scenario as an example.

[0128] When an applicant applies for resources, in order to ensure that the resources can be returned in a timely manner, the resource distribution platform usually needs to conduct a risk assessment on the applicant by searching historical applicants similar to the applicant; if the applicant passes the risk assessment, the applied resources will be issued to the applicant; otherwise, the applicant's application will be rejected.

[0129] Specifically, the resource distribution platform combines the historical applicants stored in the database in pairs to obtain historical applicant pairs, and marks the labels of the historical applicant pairs to indicate whether the historical applicants in the historical applicant pairs are similar. Then, the resource distribution platform also inputs the resource application information of the historical applicants in the historical applicant pairs into the model to be trained for feature extraction, obtains the feature vectors of the historical applicants in the historical applicant pairs, and predicts whether the two are similar based on the distance between the feature vectors of the historical applicants in the historical applicant pairs; further, based on the prediction results and labels, the loss of the model is determined, and the parameters of the model are adjusted based on the loss, thereby completing the training of the model.

[0130] After the resource issuance platform receives a resource application request from a new applicant, on the one hand, the resource application information of the new applicant is input into the model for feature extraction to obtain the feature vector of the new applicant, and based on the distance between the feature vector and the feature vector of the historical applicant, n historical applicants similar to the new applicant are selected from the database, and the risk assessment of the new applicant is performed based on the risk assessment results of these n historical applicants; on the other hand, the resource application information of the new applicant is also added to the database for sustainable training of the model.

[0131] The resource application platform determines whether to trigger sustainable training of the model based on the number of new applicants and the distance between the feature vectors of the new applicants and the feature vectors of historical applicants; if so, a new model with the same parameters as the existing model is used to extract some historical applicants from the database, and the resource application information of the extracted historical applicants is input into the existing model and the new model respectively for feature extraction to obtain the first feature vector and the third feature vector of the historical applicant; the resource application information of the new applicant is input into the existing model and the new model respectively for feature extraction to obtain the second feature vector and the fourth feature vector of the new applicant; further, based on the first distance between the first feature vector and the third feature vector, the second distance between the second feature vector and the fourth feature vector, and the third distance between the third feature vector and the fourth feature vector, the parameters of the new model are adjusted; the above process is repeated multiple times until the training stop condition is met, thereby completing this round of sustainable training of the new model, and using the trained new model to retrieve similar historical applicants for new applicants who subsequently send resource application requests.

[0132] If a new round of sustainable training is triggered subsequently, the new model after the above training will be used as the existing model, and the above process will be repeated on this basis to complete a new round of sustainable training.

[0133] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0134] Based on the same inventive concept, the present application embodiment also provides a model training device. Figure 6 , is a structural diagram of a model training device 600 provided in an embodiment of the present application, wherein the device 600 includes: a first extraction module 610, a second extraction module 620 and an adjustment module 630.

[0135] The first extraction module 610 is used to input the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object.

[0136] The second extraction module 620 is used to input the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object, and the parameters of the second model are the same as those of the first model.

[0137] The adjustment module 630 is used to adjust the parameters of the second model based on the first distance between the first eigenvector and the third eigenvector, the second distance between the second eigenvector and the fourth eigenvector, and the third distance between the third eigenvector and the fourth eigenvector.

[0138] In another embodiment, the adjustment module is used to:

[0139] Obtaining a first label of a first sample pair consisting of the first object and the second object, the first label indicating whether the first object and the second object are similar;

[0140] determining a first loss based on the first distance and the second distance;

[0141] determining a second loss based on the first tag and the third distance;

[0142] Based on the first loss and the second loss, parameters of the second model are adjusted.

[0143] In another embodiment, the adjustment module performs the following steps when determining the second loss based on the first tag and the third distance:

[0144] Determine a maximum value between a difference between the third distance and the first distance threshold and a preset difference value;

[0145] Based on the first label, determining a first weight of the third distance and a second weight of the maximum value;

[0146] Based on the first weight and the second weight, a weighted sum is performed on the third distance and the maximum value to obtain a second loss.

[0147] In another embodiment, the adjustment module is used to:

[0148] Obtaining a second label of a second sample pair consisting of the first objects, wherein the second label indicates whether the first objects in the second sample pair are similar;

[0149] determining a fourth distance between first feature vectors of first objects in said second sample pair;

[0150] determining a third loss based on the second tag and the fourth distance;

[0151] Adjusting parameters of the second model based on a weighted sum of the first loss, the second loss, and the third loss.

[0152] In another embodiment, the first object is obtained by:

[0153] Repeating the first operation, and stopping the first operation when the number of objects in the database is less than a first preset number;

[0154] The first operation includes:

[0155] Repeating the second operation, and stopping the second operation when there is no fourth object similar to the starting point in the database; the second operation includes: randomly selecting a third object from the database as the starting point, selecting a fourth object similar to the starting point from the database, and using the fourth object as a new starting point;

[0156] Extracting the first preset number of objects from the third object and the fourth object as the first object;

[0157] The third object and the fourth object are deleted from the database.

[0158] In another embodiment, the second extraction module inputs the first object and the second object into the second model for feature extraction when determining that the training condition of the second model is triggered;

[0159] The device 600 further includes:

[0160] A first determining module, configured to determine a fifth distance between the first object and the second object based on a first feature vector of the first object and a second feature vector of the second object;

[0161] A selection module, configured to select a plurality of first objects whose fifth distance from the second object is greater than a second distance threshold;

[0162] A second determining module, configured to determine a first deviation degree of the second object based on a fifth distance between the selected plurality of first objects and the second object;

[0163] The third determination module is used to determine whether the training condition of the second model is triggered based on the first deviation degree of the second object.

[0164] In another embodiment, the third determination module is used to:

[0165] If there are multiple second objects, determining the second deviation degree based on the average of the first deviation degrees of the multiple second objects;

[0166] If the second deviation degree is greater than or equal to a deviation degree threshold, and the number of the second objects is greater than a second preset number, it is determined that the training condition of the second model is triggered.

[0167] Obviously, the model training device 600 provided in the embodiment of the present application can be used as the above Figure 3 The execution subject of the training method of the model shown in FIG. Figure 3 Since the principle is the same, the functions realized are not described again here.

[0168] Based on the same inventive concept, the present application also provides an object retrieval device. Figure 7 , is a structural diagram of an object retrieval device 700 provided in an embodiment of the present application, and the device 700 includes: a response module 710 and a retrieval module 720.

[0169] The response module 710 is used to extract features of the objects in the database and the sixth object by using the second model in response to receiving a search request for the sixth object, so as to obtain a fifth feature vector of the objects in the database and a sixth feature vector of the sixth object.

[0170] The retrieval module 720 is configured to retrieve a seventh object similar to the sixth object from the database based on the fifth feature vector and the sixth feature vector.

[0171] Obviously, the object retrieval device 700 provided in the embodiment of the present application can be used as the above Figure 5 The object retrieval method shown in FIG. Figure 5 Since the principle is the same, the functions realized are not described again here.

[0172] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 8 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0173] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0174] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0175] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a training device for the model at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0176] Inputting the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object;

[0177] Inputting the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model;

[0178] Parameters of the second model are adjusted based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

[0179] Alternatively, the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming an object retrieval device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0180] In response to receiving a retrieval request for a sixth object, extracting features of the object in the database and the sixth object by using a second model to obtain a fifth feature vector of the object in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model provided in an embodiment of the present application;

[0181] Based on the fifth feature vector and the sixth feature vector, a seventh object similar to the sixth object is retrieved from the database.

[0182] The above application Figure 3 The method performed by the training device of the model disclosed in the embodiment shown, or the above-mentioned method of the present application Figure 5 The method performed by the object retrieval device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0183] The electronic device may also perform Figure 3 The method and the training device of the model are implemented in Figure 3 , Figure 4 Alternatively, the electronic device may also perform the functions of the embodiments shown. Figure 5 method, and implement the object retrieval device in Figure 5The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0184] Of course, in addition to software implementation, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0185] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 3 The method of the embodiment shown is specifically used to perform the following operations:

[0186] Inputting the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object;

[0187] Inputting the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model;

[0188] Parameters of the second model are adjusted based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

[0189] Alternatively, the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 5 The method of the embodiment shown is specifically used to perform the following operations:

[0190] In response to receiving a retrieval request for a sixth object, extracting features of the object in the database and the sixth object by using a second model to obtain a fifth feature vector of the object in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model provided in an embodiment of the present application;

[0191] Based on the fifth feature vector and the sixth feature vector, a seventh object similar to the sixth object is retrieved from the database.

[0192] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps in the model training method provided in the embodiment of the present application; or, the computer program is operable to cause a computer to execute part or all of the steps in the object retrieval method provided in the embodiment of the present application.

[0193] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0194] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0195] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0196] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0197] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A model training method, characterized in that: include: Inputting the first object and the newly added second object into the trained first model for feature extraction to obtain a first feature vector of the first object and a second feature vector of the second object; Inputting the first object and the second object into a second model for feature extraction to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model; Parameters of the second model are adjusted based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

2. The method according to claim 1, characterized in that The adjusting the parameters of the second model based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector comprises: Obtaining a first label of a first sample pair consisting of the first object and the second object, the first label indicating whether the first object and the second object are similar; determining a first loss based on the first distance and the second distance; determining a second loss based on the first tag and the third distance; Based on the first loss and the second loss, parameters of the second model are adjusted.

3. The method according to claim 2, characterized in that The determining of the second loss based on the first tag and the third distance comprises: Determine a maximum value between a difference between the third distance and the first distance threshold and a preset difference value; Based on the first label, determining a first weight of the third distance and a second weight of the maximum value; Based on the first weight and the second weight, a weighted sum is performed on the third distance and the maximum value to obtain a second loss.

4. The method according to claim 2, characterized in that: Before adjusting the parameters of the second model based on the first loss and the second loss, the method further includes: Obtaining a second label of a second sample pair consisting of the first objects, wherein the second label indicates whether the first objects in the second sample pair are similar; determining a fourth distance between first feature vectors of first objects in said second sample pair; determining a third loss based on the second tag and the fourth distance; The adjusting the parameters of the second model based on the first loss and the second loss includes: Adjusting parameters of the second model based on a weighted sum of the first loss, the second loss, and the third loss.

5. The method according to claim 1, characterized in that The first object is obtained by: Repeating the first operation until the number of objects in the database is less than a first preset number, and then stopping the first operation; The first operation includes: Repeat the second operation until there is no fourth object similar to the starting point in the database, and then stop the second operation; the second operation includes: randomly selecting a third object from the database as the starting point, selecting a fourth object similar to the starting point from the database, and using the fourth object as a new starting point; extracting the first preset number of objects from the third object and the fourth object as the first object; The third object and the fourth object are deleted from the database.

6. The method according to claim 1, characterized in that The step of inputting the first object and the second object into a second model for feature extraction is performed when it is determined that a training condition of the second model is triggered; Before inputting the first object and the second object into a second model for feature extraction, the method further includes: determining a fifth distance between the first object and the second object based on a first feature vector of the first object and a second feature vector of the second object; Selecting a plurality of first objects whose fifth distance from the second object is greater than a second distance threshold; determining a first deviation degree of the second object based on fifth distances between the selected plurality of first objects and the second object; Based on the first deviation degree of the second object, it is determined whether a training condition of the second model is triggered.

7. The method according to claim 6, characterized in that The determining whether the training condition of the second model is triggered based on the first deviation degree of the second object includes: If there are multiple second objects, determining the second deviation degree based on the average of the first deviation degrees of the multiple second objects; If the second deviation degree is greater than or equal to a deviation degree threshold, and the number of the second objects is greater than a second preset number, it is determined that the training condition of the second model is triggered.

8. An object retrieval method, characterized in that: include: In response to receiving a retrieval request for a sixth object, extracting features of the objects in a database and the sixth object through a second model to obtain a fifth feature vector of the objects in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model according to any one of claims 1 to 7; Based on the fifth feature vector and the sixth feature vector, a seventh object similar to the sixth object is retrieved from the database.

9. A model training device, characterized in that: include: A first extraction module, used for inputting the first object and the newly added second object into the trained first model for feature extraction, to obtain a first feature vector of the first object and a second feature vector of the second object; a second extraction module, configured to input the first object and the second object into a second model for feature extraction, to obtain a third feature vector of the first object and a fourth feature vector of the second object, wherein the parameters of the second model are the same as those of the first model; An adjustment module is used to adjust the parameters of the second model based on a first distance between the first eigenvector and the third eigenvector, a second distance between the second eigenvector and the fourth eigenvector, and a third distance between the third eigenvector and the fourth eigenvector.

10. An object retrieval device, characterized in that: include: a response module, configured to, in response to receiving a retrieval request for a sixth object, extract features of the objects in a database and the sixth object by using a second model to obtain a fifth feature vector of the objects in the database and a sixth feature vector of the sixth object, wherein the second model is trained based on the training method of the model according to any one of claims 1 to 7; A retrieval module is used to retrieve a seventh object similar to the sixth object from the database based on the fifth feature vector and the sixth feature vector.

11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the model training method as described in any one of claims 1 to 7; or, the processor is configured to execute the instructions to implement the object retrieval method as described in claim 8.

12. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the training method of the model as described in any one of claims 1 to 7; or, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the object retrieval method as described in claim 8.

13. A computer program product, characterized in that The computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps in the model training method as described in any one of claims 1 to 7; or, the computer program is operable to cause a computer to execute part or all of the steps in the object retrieval method as described in claim 8.