A training method and device for image processing model and machine learning model

By using a sample relationship identifier to link training samples across different sets, the method improves the training efficiency and universality of image recognition models, addressing the inefficiencies of manual labeling and ensuring accurate recognition across varied scenes.

CN112257670BActive Publication Date: 2025-01-03BEIJING AIBI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011279492.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-16
Publication Date
2025-01-03
Estimated Expiration
2040-11-16

AI Technical Summary

Technical Problem

Existing image recognition models require manual labeling of training samples across multiple scenes, leading to inefficiencies and insufficient training data for certain categories, resulting in reduced recognition accuracy and universality.

Method used

A method and device for training image processing models that utilize a first and second training sample set, setting a sample relationship identifier based on similarity to identify positive and negative samples across different training sets, thereby increasing the number of training samples and improving model universality.

Benefits of technology

Enhances the training effect of image processing models by increasing the number of positive and negative samples, allowing them to learn features from multiple scenes and achieve higher recognition accuracy across diverse scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112257670B_ABST
    Figure CN112257670B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing model, a training method and a device for a machine learning model. According to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, a corresponding sample relationship identifier can be set for the target training sample, and then the model can be trained using at least the target training sample with the sample relationship identifier. The present invention can increase the number of training samples when the model is trained using the first training sample set, improve the training effect of the model, and enable the model to learn the sample features of the training samples from the second training sample set when learning the sample features of the training samples in the first training sample set, so that the model can have the versatility in the scenes corresponding to the first training sample set and the scenes corresponding to the second training sample set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to an image processing model, a training method and a device for a machine learning model. Background Art

[0002] With the development of artificial intelligence science and technology, the relevant technologies of machine learning are constantly improving. The image recognition model obtained through machine learning can effectively identify the category to which the target image belongs.

[0003] At present, if the image recognition model is to have a high image recognition accuracy in multiple scenes, that is, to have universality, the existing technology needs to collect training samples in multiple scenes and merge the collected training samples into the same training sample set, and then use the merged training sample set to train the image recognition model. For example, the image recognition model used within the enterprise to perform face recognition on employees for signing in and out of get off work needs to have a high image recognition accuracy for employees in different time scenes (such as different dates). For this, the existing technology needs to collect employee face images (i.e., training samples) in multiple time scenes, merge the employee face images collected in multiple time scenes into the same training sample set, and then use the training sample set after merging the employee face images to train the image recognition model. Among them, in the process of merging the training samples collected in multiple scenes into the same training sample set, it is first necessary to manually identify the training samples of the same category, such as marking the face images of Xiao Zhang collected in the above different time scenes as face images of Xiao Zhang, and then placing the identified training samples in the training sample set.

[0004] However, manual labeling has low efficiency and is difficult to complete for a large number of training samples. This may result in an insufficient number of training samples for one or more categories in the merged training data set, making the image recognition model's learning effect on the training samples of the corresponding categories insufficient, resulting in the image recognition model's insufficient ability to recognize images of the corresponding categories in different scenarios and its inability to be universal. Summary of the invention

[0005] In view of the above problems, the present invention provides a method and device for training an image processing model and a machine learning model that overcome the above problems or at least partially solve the above problems. The technical solution is as follows:

[0006] A training method for an image processing model, wherein the training sample set of the image processing model includes a first training sample set and a second training sample set, and the method includes:

[0007] According to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least some of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the target training sample is a sample in the at least some of the training samples, and the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets;

[0008] The image processing model is trained using at least the target training sample with the sample relationship identifier.

[0009] Optionally, the sample relationship identifier includes a first identifier and / or a second identifier, the first identifier is used to indicate that the target training sample is a negative sample of the training samples of the first category, and the second identifier is used to indicate that the target training sample is a positive sample of the training samples of the first category.

[0010] Optionally, when the similarity is less than a first preset threshold, the sample relationship identifier that matches the similarity is the first identifier;

[0011] When the similarity is not less than a second preset threshold, the sample relationship identifier that matches the similarity is the second identifier.

[0012] Optionally, the image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier is: a model that has been trained using the first training sample set;

[0013] Alternatively, the image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier is: a model that has been trained using the first training sample set and the second training sample set.

[0014] Optionally, the first training sample set includes face images collected within a first time range, and the second training sample set includes face images collected within a second time range.

[0015] Optionally, the method further includes:

[0016] The number of target training samples to which the sample relationship identifier is to be added is adjusted according to the number of times the image processing model has been trained.

[0017] Optionally, the method further includes:

[0018] The value of the first preset threshold and / or the value of the second preset threshold are adjusted according to the number of times the image processing model has been trained.

[0019] A training method for a machine learning model, wherein the training sample set of the machine learning model includes a first training sample set and a second training sample set, and the method includes:

[0020] According to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets, and the target training sample is a sample in the at least part of the training samples;

[0021] The machine learning model is trained using at least the target training sample with the sample relationship identifier.

[0022] A training device for an image processing model, wherein the training sample set of the image processing model includes a first training sample set and a second training sample set, and the device includes: an identification setting unit and a model training unit, wherein:

[0023] The identifier setting unit is configured to perform: according to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the target training sample is a sample in the at least part of the training samples, and the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets;

[0024] The model training unit is configured to execute: training the image processing model using at least the target training sample with the sample relationship identifier.

[0025] A training device for a machine learning model, wherein the training sample set of the machine learning model includes a first training sample set and a second training sample set, and the device includes: a second setting unit and a second training unit, wherein:

[0026] The second setting unit is configured to execute: according to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for the target training sample, wherein the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets, and the target training sample is a sample in the at least part of the training samples;

[0027] The second training unit is configured to execute: training the machine learning model using at least the target training sample with the sample relationship identifier.

[0028] The training method and device of the image processing model proposed in this embodiment, the training sample set of the image processing model may include a first training sample set and a second training sample set. The present invention can set a sample relationship identifier matching the above similarity for a target training sample based on the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set. The target training sample is a sample in at least part of the above training samples. The sample relationship identifier can be used to characterize the sample relationship between the training samples in two different training sample sets. After that, the present invention can use at least the target training sample with the sample relationship identifier to train the image processing model.

[0029] In the process of training the image processing model, the present invention can identify training samples with higher similarity to the training samples of the first category from the second training set as positive samples of the training samples of the first category, and / or identify training samples with lower similarity to the training samples of the first category as negative samples of the training samples of the first category based on the similarity calculation with the training samples of the first category. This part of the training samples identified from the second training sample set can participate in the training of the image processing model using the first training sample set, and can increase the number of positive samples and / or negative samples of the training samples of the first category, thereby increasing the number of training samples when the present invention uses the first training sample set to train the image processing model, improving the training effect of the image processing model, and enabling the image processing model to learn the image features of the training samples from the second training sample set when learning the image features of the training samples in the first training sample set, thereby enabling the image processing model to have universality in the scenes corresponding to the first training sample set and the scenes corresponding to the second training sample set.

[0030] The training method and device of the machine learning model proposed in the present invention can set a sample relationship identifier that matches the above similarity for the target training sample based on the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set. The sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets. The target training sample is a sample in at least part of the above training samples. The machine learning model is trained using at least the target training sample with the sample relationship identifier.

[0031] In the process of training the machine learning model, the present invention can identify training samples with higher similarity to the training samples of the first category from the second training set as positive samples of the training samples of the first category, and / or identify training samples with lower similarity to the training samples of the first category as negative samples of the training samples of the first category based on the similarity calculation with the training samples of the first category. This part of the training samples identified from the second training sample set can participate in the training of the machine learning model using the first training sample set, and can increase the number of positive samples and / or negative samples of the training samples of the first category, thereby increasing the number of training samples when the present invention uses the first training sample set to train the machine learning model, improving the training effect of the machine learning model, and enabling the machine learning model to learn the sample features of the training samples from the second training sample set when learning the sample features of the training samples in the first training sample set, thereby enabling the machine learning model to have universality in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0032] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0034] Figure 1 A training method for an image processing model provided by an embodiment of the present invention is shown;

[0035] Figure 2 Another method for training an image processing model provided by an embodiment of the present invention is shown;

[0036] Figure 3 Another method for training an image processing model provided by an embodiment of the present invention is shown;

[0037] Figure 4 A training method for a machine learning model provided by an embodiment of the present invention is shown;

[0038] Figure 5 A training device for an image processing model provided by an embodiment of the present invention is shown;

[0039] Figure 6 A training device for a machine learning model provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0040] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0041] like Figure 1 As shown, this embodiment proposes a training method for an image processing model. In the method, the training sample set of the image processing model includes a first training sample set and a second training sample set. The method may include the following steps:

[0042] S101. According to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set, a sample relationship identifier matching the above similarity is set for a target training sample, the target training sample being a sample in the above at least part of the training samples, and the sample relationship identifier being used to characterize the sample relationship between the training samples in two different training sample sets.

[0043] Among them, the image processing model is a machine learning model that can perform relevant processing on a certain image based on the image features of the image. It should be noted that the present invention does not limit the way in which the image processing model can process the image, such as image detection, image classification and image recognition. Specifically, when the image processing model is applied to image detection, the image processing model can be an image detection model; when the image processing model is applied to image classification, the image processing model can be an image classification model; when the image processing model is applied to image recognition, the image processing model can be an image recognition model.

[0044] Among them, the present invention does not limit the training stage of the image processing model. For example, the image processing model can be a model that has not been trained, a model that is in the process of training, or a model that has completed one or more trainings.

[0045] The first training sample set and the second training sample set are both training sample sets that can be used to train the image processing model. Specifically, the first training sample set and the second training sample set can be different training sample sets, that is, the categories and / or sample quantities of the training samples contained in the first training sample set and the second training sample set can be different.

[0046] It should be noted that when the prior art uses a certain training sample set to train the image processing model, it is limited to using the training samples in the training sample set to train the image processing model. For example, when the prior art uses the first training sample set to train the image processing model, it can only use the training samples in the first training sample set to train the image processing model. Similarly, when the prior art uses the second training sample set to train the image processing model, it can only use the training samples in the second training sample set to train the image processing model.

[0047] The category may be a category used to classify the processing object. For example, when the processing object is a human face image, the category may be set according to the name of the person to whom the human face image belongs, such as Zhang San's face, Li Si's face. Another example is when the processing object is a cat face image, the category may be set according to the type of cat, such as Persian cat, Egyptian cat, Scottish Fold cat, etc. It is understandable that both human face images and cat face images may be a category of images.

[0048] The first training sample set and the second training sample set may be training sample sets collected from different scenes. For example, the first training sample set may be a training sample set collected from a first scene, and the second training sample set may be a training sample set collected from a second scene. The differences between the first scene and the second scene may include: different locations (such as companies, communities, shopping malls, and stations), different times, different cameras, different shooting times (such as shooting angles, lighting, occlusions), and / or different shooting subjects (such as whether or not a mask is worn).

[0049] Specifically, the first training sample set may be a training sample set in which the training samples have been classified. Optionally, the first training sample set may be a training sample set in which the training samples have been classified and the classified training samples of each category are labeled with category identifiers; optionally, the first training sample set may also be a training sample set in which the training samples have been classified but the classified training samples of each category are not labeled with category identifiers.

[0050] Among them, the category identifier can be an identifier used to indicate the category to which a training sample in the training sample set belongs. For example, when the category identifier of a training sample is Persian cat, the category of the training sample is Persian cat; for another example, when the category identifier of a training sample is Zhang San’s face, the category of the training sample is Zhang San’s face.

[0051] The first training sample set may include training samples of one or more categories, and the first category may be a category in the first training sample set.

[0052] The present invention does not limit whether the training samples of the second training sample set have been classified or whether the categories are marked with category identifiers. Specifically, the second training sample set can be a training sample set with classified training samples or a training sample set with unclassified training samples. When the second training sample set is a training sample set with classified training samples, the classified training samples of each category can be marked with category identifiers or not.

[0053] The target training sample may be one of at least some of the training samples mentioned above that has a certain similarity relationship with the training samples of the first category, such as a training sample with a higher similarity or a lower similarity. It should be noted that the determination of the similarity level may be determined by a technician who formulates a relevant threshold value according to actual needs, and the present invention does not limit this.

[0054] It can be understood that, for target training samples with a higher similarity to training samples of the first category, the present invention can determine them as positive samples of training samples of the first category; for target training samples with a lower similarity to training samples of the first category, the present invention can determine them as negative samples of training samples of the first category. When the present invention uses the training samples in the first training sample set to train the image processing model, it can be combined with the target training samples with a higher similarity to the first category, i.e., positive samples of training samples of the first category, and / or the target training samples with a lower similarity to the first category, i.e., negative samples of training samples of the first category, to train it, thereby increasing the number of positive samples and / or the number of negative samples of training samples of the first category, thereby improving the processing effect of the image processing model.

[0055] The present invention does not limit the number of the at least part of the training samples. For example, it may be one third, one half or two thirds of all the training samples in the second training sample set; for example, it may be all the training samples in the second training sample set.

[0056] It is understandable that the present invention can identify a certain number of target training samples from at least part of the above training samples, further increase the number of positive samples and / or negative samples of the first category of training samples, thereby further improving the processing effect of the image processing model. The specific value of the above first number can be determined by technicians according to actual needs, and the present invention does not limit this.

[0057] Among them, when the number of identified target training samples does not reach the required number, the present invention can expand the number of training samples contained in the above-mentioned at least part of the training samples from the second training sample set, and continue to identify the target training samples; when the number of identified target training samples has reached the required number, the present invention can prohibit continuing to identify the target training samples.

[0058] Specifically, the present invention can respectively calculate the similarity between the image features of the training samples of the first category and the image features of each training sample in the above-mentioned at least part of the training samples, and identify a certain number of target training samples according to the similarity calculation results. For example, when the above-mentioned at least part of the training samples include the first training sample and the second training sample, the present invention can calculate the similarity between the image features of the training samples of the first category and the image features of the first training sample, calculate the similarity between the image features of the training samples of the first category and the image features of the second training sample, and calculate the similarity between the image features of the training samples of the first category and the image features of the third training sample. If the similarity between the first training sample and the training samples of the first category is high, the present invention can identify the first training sample as a target training sample with a high similarity to the training samples of the first category. If the similarity between the second training sample and the training samples of the first category is low, the present invention can identify the second training sample as a target training sample with a low similarity to the training samples of the first category.

[0059] Among them, the present invention can use an image processing model to obtain the image features of the training samples of the first category and the image features of each training sample in the above-mentioned at least part of the training samples. Specifically, when determining the image features of the training samples of the first category, the present invention can input part or all of the training samples in the first category of training samples into the image processing model, obtain the average feature vector output by the image processing model, and determine the average feature vector as the image features of the training samples of the first category; specifically, when determining the image features of a certain training sample in the above-mentioned at least part of the training samples, the present invention can input the training sample into the image processing model, obtain the feature vector output by the image processing model, and determine the feature vector as the image features of the training sample. Optionally, if the category to which the training sample belongs in the second training sample set can be determined, the present invention can also directly determine the average feature vector of the training samples of the category as the feature vector of the training sample.

[0060] It should be noted that the present invention can also use other methods to obtain the image features of the training samples of the first category and the image features of each training sample in at least part of the above-mentioned training samples, such as using other image-related machine learning models with reliable performance to extract the image features of the training samples of the first category and the image features of each training sample in at least part of the above-mentioned training samples.

[0061] It is understandable that the present invention can use the image processing model to calculate the similarity between the image features of the training samples of the first category and the image features of each training sample in the at least part of the training samples. Of course, the present invention can also use other methods to calculate the similarity, such as the Euclidean distance calculation method and the cosine similarity calculation method.

[0062] It should be noted that if the present invention uses an image processing model to obtain image features of training samples of the first category and image features of each training sample in at least part of the above-mentioned training samples, and uses the image processing model to calculate the similarity between the image features of the training samples of the first category and the image features of at least part of the above-mentioned training samples, then the present invention may be to use the image processing model to identify target training samples from the second training sample set based on the image features of the training samples of the first category.

[0063] Among them, the present invention can also calculate the similarity between the image features of the training samples of the first category and the image features of each training sample in the at least part of the training samples, and then set a sample relationship identifier for each training sample in the at least part of the training samples according to the similarity calculation result, and then identify a certain number of target training samples from each training sample in the at least part of the training samples for which the sample relationship identifier has been set. However, this method will increase the resource consumption of setting the sample relationship identifier for non-target training samples.

[0064] It should be noted that when the second training sample set is a training sample set in which the training samples have been classified, after identifying a target training sample that has a certain similarity relationship with the first category, the present invention can directly identify all training samples in the category to which the target training sample belongs in the second training sample set as target training samples that have the same similarity relationship with the first category without performing similarity calculation. For example, after identifying a target training sample that has a high similarity with the first category, the present invention can directly identify all training samples in the category to which the target training sample belongs in the second training sample set as target training samples that have a high similarity relationship with the first category. At this time, the present invention can effectively improve the recognition rate of the target training sample while reducing the consumption of computing resources.

[0065] Among them, after identifying a certain number of target training samples, the present invention can set a sample relationship identifier that matches the similarity with the training samples of the first category for each pair of target training samples. For example, for target training samples with low similarity with the training samples of the first category, the present invention can set a sample relationship identifier of a negative sample of the training samples of the first category for the target training samples. For another example, for target training samples with high similarity with the training samples of the first category, the present invention can set a sample relationship identifier of a positive sample of the training samples of the first category for the target training samples, so that when the present invention trains the image processing model, the sample relationship between the target training samples and the training samples of the first category can be identified through the sample relationship identifier, and then the target training samples that can be used as positive samples and / or negative samples of the training samples of the first category are identified, thereby increasing the number of positive samples and / or negative samples of the training samples of the first category.

[0066] Optionally, the sample relationship identifier may include a first identifier and / or a second identifier, the first identifier may be used to indicate that the target training sample is a negative sample of the training samples of the first category, and the second identifier may be used to indicate that the target training sample is a positive sample of the training samples of the first category. It should be noted that the sample relationship identifier may include other identifiers, such as a third identifier used to indicate that a certain training sample in the second training sample set is a non-positive sample and a non-negative sample of the training samples of the first category. In this case, the similarity between the two training samples is a non-higher similarity and a non-lower similarity, and is in the middle range.

[0067] Optionally, when the above-mentioned similarity is less than a first preset threshold, the sample relationship identifier that matches the above-mentioned similarity is a first identifier; when the above-mentioned similarity is not less than a second preset threshold, the sample relationship identifier that matches the above-mentioned similarity is a second identifier. Specifically, the present invention can identify the training sample as a target training sample with a lower similarity to the training sample of the first category when the similarity between the training sample of the first category and a certain training sample in the above-mentioned at least part of the training samples is less than a first preset threshold, and set the sample relationship identifier of the target training sample to the first identifier. Among them, the present invention can identify the training sample as a target training sample with a higher similarity to the training sample of the first category when the similarity between the training sample of the first category and a certain training sample in the above-mentioned at least part of the training samples is not less than a second preset threshold, and set the sample relationship identifier of the target training sample to the second identifier.

[0068] It should be noted that, when the present invention uses an image processing model to identify target training samples from the second training sample set according to the image features of the training samples of the first category, the first preset threshold can be set to a smaller value, and / or the second preset threshold can be set to a larger value when the image processing model is in the initial training stage and the image processing model has a weak recognition ability of the sample similarity between the training samples. For example, the first preset threshold can be set to 5%, and the second preset threshold can be set to 96%, so as to improve the recognition standard of the target training samples that can be used as negative samples and / or positive samples of the training samples of the first category, and avoid the image processing model's weak recognition ability of the sample similarity. The sample recognition error of the target training samples that can be used as negative samples and / or positive samples of the training samples of the first category can be avoided, thereby avoiding the decline or deterioration of the training effect of the image processing model caused by the sample recognition error. Among them, the values ​​of the first preset threshold and the second preset threshold can be formulated by technicians according to actual conditions, and the present invention does not limit this.

[0069] Optionally, in the process of classifying the training samples in the first training sample set and labeling the category identifiers of the classified training samples in each category, a technician may first manually label the category identifier of each training sample in the first training sample set, and then a machine may merge the training samples with the same category identifier, thereby completing the classification of the training samples in the first training sample set and the labeling of the category identifiers of the training samples in each category. This method of classifying the training samples in the first training sample set and labeling the category identifiers of the training samples in each category has a high accuracy rate, but the workload is large.

[0070] Optionally, in the process of classifying the training samples in the first training sample set and setting the category identifiers of the classified training samples of each category, the present invention can also first classify the training samples in the first training sample set (for example, using clustering technology), and then the technical personnel can uniformly mark the category identifiers of the classified training samples of each category. This method of classifying the training samples in the first training sample set and marking the category identifiers of the training samples of each category has a low accuracy rate, but the workload is small. Among them, when the technical personnel mark the category identifiers of the training samples of a category, they only need to set a unified label for the category identifier of the category, and there is no need to mark the category identifiers of each training sample under the category separately.

[0071] Optionally, the classification processing of the above training samples can be performed by an image processing model. It is understandable that when the image processing model is an image detection model, an image classification model or an image recognition model, the image processing model can classify the above training samples. Among them, after the present invention uses the image processing model to classify each training sample in the first training sample set, a machine with image recognition capability can identify each category of training samples and mark their category identification. For example, when the processing object is an image of a cat face, after the present invention uses the image processing model to classify the training samples in the first training sample set, a machine with cat face recognition capability can identify each category of cat faces and mark their categories (such as marking categories such as Persian cats, Egyptian cats and Scottish Fold cats). This method of classifying the training samples in the first training sample set and marking the categories of the training samples in each category has a high accuracy rate and a small workload.

[0072] S102: Train the image processing model using at least target training samples with sample relationship identifiers.

[0073] Among them, after the present invention identifies a certain number of target training samples from at least part of the above-mentioned training samples and sets corresponding sample relationship identifiers for each target training sample, it can at least use the target training samples with sample relationship identifiers to train the image processing model, increase the number of positive samples and / or negative samples of the first category of training samples used to train the image processing model, and improve the training effect on the image processing model.

[0074] It should be noted that the present invention does not limit the training stage of the image processing model. Optionally, if the image processing model is a model that has been trained using training samples of the first category, that is, the image processing model has learned the image features of the training samples of the first category, then the present invention can continue to train the image processing model using only target training samples that have sample relationship identifiers, so that the image processing model can continue to learn more image features related to the images of the first category, thereby improving the training effect of the image processing model.

[0075] Optionally, if the image processing model is a model that has not been trained using training samples of the first category, the present invention can train the image processing model in combination with training samples of the first category and target training samples that have sample relationship identifiers, so that the image processing model can learn image features of images of the first category from the first training sample set while at the same time learning more image features related to images of the first category from target training samples that have sample relationship identifiers, thereby improving the training effect of the image processing model.

[0076] Optionally, if the image processing model is an untrained model, the present invention can start training the image processing model in combination with the first training sample set and the target training samples with sample relationship identifiers. Compared with training the image processing model using the first training sample set alone, the present invention can increase the number of positive samples and / or negative samples of the first category of training samples, thereby effectively improving the training effect of the image processing model.

[0077] Optionally, the image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier may be a model that has been trained using the first training sample set. Figure 1 The training method shown uses the first training sample set in combination with the target training samples with sample relationship identifiers to train the image processing model that has been trained using the first training sample set again, thereby improving the training effect of the image processing model.

[0078] Optionally, the image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier may be a model that has been trained using the first training sample set and the second training sample set. Figure 1 The training method shown combines the first training sample set and the target training samples with sample relationship identifiers to train the image processing model that has been trained using the first training sample set and the second training sample set, thereby improving the training effect of the image processing model.

[0079] It should be noted that Figure 1 The training method shown can be applied to a variety of image processing models that use different image processing methods, such as image detection models, image classification models, and image recognition models.

[0080] Among them, when the image processing model is an image detection model, the image processing model can be used to detect whether there is a specific object in the image, such as a human face. At this time, both the first training sample set and the second training sample set can include training samples of the specific object and other objects. For example, when the specific object is a human face, the other objects can be cat faces, dog faces, flowers or toys. Specifically, the present invention can use the training samples of the specific object in the first training sample set as the training samples of the first category, identify a certain number of target training samples whose similarity with the training samples of the specific object meets the similarity requirements (such as higher similarity and lower similarity) from the second training sample set according to the image features of the training samples of the specific object, set a corresponding sample relationship identifier for characterizing the training samples with the specific object for the target training samples, increase the number of positive samples and / or negative samples of the training samples of the first category, that is, increase the number of positive samples and / or negative samples of the training samples of the specific object, thereby improving the training effect of the image processing model and enhancing the detection ability of the image processing model for the specific object.

[0081] For example, when the specific object is a human face, the present invention can use the training samples of the human face in the first training sample set as the training samples of the first category, identify a certain number of target training samples whose similarity with the training samples of the human face meets the similarity requirements from the second training sample set according to the image features of the training samples of the human face, set sample relationship identifiers of the positive samples and / or negative samples of the training samples of the human face for the target training samples, increase the number of positive samples and / or negative samples of the training samples of the first category, that is, increase the number of positive samples and / or negative samples of the training samples of the human face, and then use at least the target training samples with the sample relationship identifiers to train the image processing model, thereby improving the training effect of the image processing model and enhancing the image processing model's ability to detect faces.

[0082] Among them, when the image processing model is an image classification model, the image processing model can be used to identify the category to which a specific object in an image belongs. For example, when the specific object is a face, the image processing model can be used to identify the name of the person to whom the face in the image belongs. At this time, both the first training sample set and the second training sample set can include training samples of one or more categories to which the specific object belongs. For example, when the image processing model is used to identify the name of the person to whom the face in the image belongs, both the first training sample set and the second training sample set can include multiple face images of multiple people with different names (such as multiple face images of Zhang San, multiple face images of Li Si, and multiple face images of Wang Wu). Specifically, the present invention can determine the training samples of a certain category to which a specific object in the first training sample set belongs as the training samples of the first category, identify a certain number of target training samples whose similarity with the training samples of the first category meets the similarity requirements (such as higher similarity and lower similarity) from the second training sample set based on the training samples of the first category, set corresponding sample relationship identifiers for characterizing the training samples with the specific object for the target training samples, increase the number of positive samples and / or negative samples of the training samples of the first category, that is, increase the number of positive samples and / or negative samples of the training samples of the category to which the specific object belongs, improve the training effect of the image processing model, and enhance the image processing model's ability to recognize the category to which the object belongs.

[0083] For example, when the image processing model is used to identify the name of the person to whom the face in the image belongs, the present invention can determine the face image of Zhang San in the first training sample set as the training sample of the first category, identify a certain number of target training samples whose similarity with Zhang San's face image meets the similarity requirement from the second training sample set based on Zhang San's face image, set a corresponding sample relationship identifier for characterizing the training sample with a specific object for the target training sample, increase the number of positive samples and / or negative samples of the training samples of the first category, that is, increase the number of positive samples and / or negative samples of the training samples of Zhang San's face image, improve the training effect of the image processing model, and enhance the image processing model's recognition ability of Zhang San's face image.

[0084] When the image processing model is an image recognition model, the image processing model can be used to detect a specific object in the image and identify the category to which the specific object belongs. For example, when the specific object is a face, the image processing model can be used to detect the face in the image and identify the name of the person to whom the face belongs. It can be understood that the image recognition model can be composed of an image detection model and an image classification model. Therefore, Figure 1 The method shown can be applied to training image recognition models.

[0085] It should be noted that when the present invention uses the first training sample set to train the image processing model, it can use Figure 1 The method shown identifies training samples that can serve as positive samples of training samples of the first category in the first training sample set from the second training set in a cross-training sample set manner, and / or identifies training samples that can serve as negative samples of training samples of the first category in the first training sample set. This part of the training samples identified from the second training sample set can participate in the training of the image processing model using the first training sample set by the present invention, which can increase the number of positive samples and / or negative samples of training samples of the first category, improve the training effect on the image processing model, and enable the image processing model to learn the image features of the training samples from the second training sample set while learning the image features of the training samples in the first training sample set, so that the image processing model can simultaneously have the versatility in the scenes corresponding to the first training sample set and the scenes corresponding to the second training sample set.

[0086] It should also be noted that the present invention can sequentially use the training samples of each category in the first training sample set as the training samples of the first category, and perform Figure 1 Steps S101 and S102 shown can further increase the number of training samples that can be used when training the image processing model using the first training sample set, improve the training effect on the image processing model, and further enhance the versatility of the image processing model in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0087] Understandably, Figure 1 The method shown can be applied not only to image processing models that perform classification processing on images, but also to image processing models that perform regression analysis on images.

[0088] The training method of the image processing model proposed in this embodiment, the training sample set of the image processing model may include a first training sample set and a second training sample set. The method can set a sample relationship identifier matching the above similarity for a target training sample based on the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set. The target training sample is a sample in at least part of the above training samples. The sample relationship identifier can be used to characterize the sample relationship between the training samples in two different training sample sets. After that, the method can use at least the target training sample with the sample relationship identifier to train the image processing model. The method can calculate the similarity with the training samples of the first category, identify the training samples with higher similarity to the training samples of the first category from the second training set as positive samples of the training samples of the first category, and / or identify the training samples with lower similarity to the training samples of the first category as negative samples of the training samples of the first category. The training samples identified from the second training sample set can participate in the training of the image processing model using the first training sample set, and can increase the number of positive samples and / or negative samples of the training samples of the first category, thereby increasing the number of training samples when the present invention uses the first training sample set to train the image processing model, improving the training effect of the image processing model, and enabling the image processing model to learn the image features of the training samples from the second training sample set when learning the image features of the training samples in the first training sample set, thereby enabling the image processing model to have universality in the scenes corresponding to the first training sample set and the scenes corresponding to the second training sample set.

[0089] based on Figure 1 The present invention also proposes another training method for an image processing model, in which the first training sample set may include face images collected within a first time range, and the second training sample set may include face images collected within a second time range. At this time, the image processing model may be a face image processing model, such as a face detection model, a face classification model, or a face recognition model.

[0090] It should be noted that, since people's clothing, posture and dressing may change over time, the image features of people's facial images at different times may be different. It is understandable that in order to ensure that the image processing model can process facial images with better effects at different times, the image processing model needs to have the versatility to process facial images in scenes at different times. For example, when the image processing model is a face recognition model, in order to ensure that the image processing model can recognize facial images with high accuracy at different times, the image processing model needs to have the versatility to perform face recognition in scenes at different times.

[0091] The time range may include the time between a certain moment and another moment, that is, the time range may be a time period. The time range may be determined by the technician according to the actual working situation. For example, the first time range may be the first day, and the second time range may be the second day; for another example, the first time range may be from 7 am to 12 noon, and the second time range may be from 12 noon to 3 pm. The present invention does not limit this.

[0092] Among them, the collection locations of the training samples of the first training sample set and the second training sample set may be the same or different, and the present invention does not limit this. Specifically, the present invention can use a camera and pedestrian re-identification technology in combination to track the trajectory of the captured facial images at the collection location of the training sample set, and determine the facial images collected within the first time range as the first training sample set, and determine the facial images collected within the second time range as the second training sample set. It should be noted that the pedestrian re-identification technology can merge facial images of the same category collected within the same time range. For example, facial images of the same category collected within the first time range can be merged, and facial images of the same category collected within the second time range can be merged.

[0093] Specifically, after obtaining the first training sample set and the second training sample set belonging to different time ranges, the present invention can use Figure 1 The method shown trains the image processing model, increases the number of positive samples and / or negative samples of the first category of training samples, and thus can increase the number of training samples when using the first training sample set to train the image processing model, thereby improving the training effect of the image processing model, that is, improving the effect of the image processing model on face processing, and can enable the image processing model to learn the image features of the training samples in the second training sample set from the second time range when learning the image features of the training samples in the first training sample set from the first time range, thereby enabling the image processing model to have universality in scenes at different times.

[0094] It should be noted that the present invention does not limit the application scenarios of the image processing model. For example, when the image processing model is a face recognition model, the image processing model can be applied to face recognition of employees within an enterprise, to face recognition of mobile personnel including passengers and staff at airports, or to face recognition of mobile personnel including passengers and staff at shopping malls.

[0095] The location where the training sample set is collected can correspond to the application scenario of the image processing model. For example, when the image processing model is applied to face recognition of employees within an enterprise, the location where the training sample set is collected can be within the enterprise; for example, when the image processing model is applied to face recognition of mobile personnel including passengers and staff at an airport, the location where the training sample set is collected can be the airport; for another example, when the image processing model is applied to face recognition of mobile personnel including passengers and staff at a shopping mall, the location where the training sample set is collected can be a store.

[0096] The training method of the image processing model proposed in this embodiment can enable the image processing model to have the versatility to process facial images in scenes at different times, thereby improving the generalization of the image processing model in scenes at different times.

[0097] based on Figure 1 The steps shown in this embodiment propose another training method for an image processing model, in which the present invention can, when identifying target training samples from the second training sample set, only identify target training samples that can be negative samples of training samples of the first category from the second training sample set, while prohibiting the identification of target training samples that can be positive samples of training samples of the first category from the second training sample set.

[0098] It should be noted that when the image processing performance of the image processing model is relatively weak, the accuracy of identifying whether a certain training sample is a positive sample of a training sample of a category is low, while the accuracy of identifying whether a certain training sample is a negative sample of a training sample of a category is relatively high. Therefore, when identifying the target training sample from the second training sample set, the present invention can only identify the target training sample that can be used as a negative sample of the training sample of the first category from the training samples of the second training sample set, and can prohibit the identification of the target training sample that can be used as a positive sample of the training sample of the first category from the second training sample set, which can effectively avoid the image processing model from misidentifying the target training sample when the image processing performance is relatively weak, thereby avoiding the negative impact of using the target training sample with incorrect sample relationship identification to train the image processing model.

[0099] The training method of the image processing model proposed in the present invention can identify target training samples that can serve as negative samples of training samples of the first category only from the training samples of the second training sample set, while prohibiting the identification of target training samples that can serve as positive samples of training samples of the first category from the second training sample set, thereby effectively avoiding the image processing model from incorrectly identifying the target training samples when the image processing performance is weak, thereby avoiding the negative impact of using target training samples with incorrect sample relationship identification to train the image processing model.

[0100] based on Figure 1 The method shown in the figure, the present invention can propose another training method for the image processing model, such as Figure 2 As shown, the method may also include the following steps:

[0101] S201. Adjust the number of target training samples to which sample relationship identifiers are to be added according to the number of times the image processing model has been trained.

[0102] It should be noted that, in the process of identifying the required number of target training samples based on the similarity between the image features of the training samples of the first category and the image features of each training sample in the above-mentioned at least part of the training samples, the required number of target training samples can be identified by sorting the similarity between each training sample in the above-mentioned at least part of the training samples and the training samples of the first category.

[0103] Specifically, in the process of identifying the required number of target training samples, the present invention can first sort the similarities between each training sample in the above-mentioned at least part of the training samples and the training samples of the first category, and then, based on the required number of target training samples, identify the training samples in the above-mentioned at least part of the training samples corresponding to the similarities in the corresponding serial numbers as target training samples.

[0104] For example, if the required number of target training samples that can be used as positive samples of the first category is ten, the present invention can determine the ten training samples with the greatest similarity to the training samples of the first category among at least part of the above training samples, and identify the ten training samples with the greatest similarity as target training samples that can be used as positive samples of the first category; for another example, if the required number of target training samples that can be used as negative samples of the first category is ten, the present invention can determine the ten training samples with the least similarity to the training samples of the first category among at least part of the above training samples, and identify the ten training samples with the least similarity as target training samples that can be used as negative samples of the first category.

[0105] Specifically, the present invention can determine the image processing model's ability to recognize sample similarities between training samples based on the number of times the image processing model has been trained, and then determine the required number of target training samples based on the image processing model's ability to recognize sample similarities.

[0106] Among them, when the image processing model has been trained a small number of times, the present invention can be considered that the image processing model has a weaker ability to recognize sample similarity; when the image processing model has been trained a large number of times, the present invention can be considered that the image processing model has a stronger ability to recognize sample similarity. It should be noted that whether the number of training times is small or large can be determined by the technicians according to the actual needs to formulate relevant thresholds, and the present invention does not limit this.

[0107] Specifically, when the image processing model has a weak ability to recognize sample similarity, the present invention can set the required number of target training samples to a smaller number. When the number of times the image processing model has been trained increases and the image processing model's ability to recognize sample similarity gradually increases, the present invention can gradually increase the required number of target training samples. For example, when the present invention trains the image processing model at a certain time, the required number of target training samples that can be used as negative samples of the first category is ten. When the present invention trains the image processing model next time, the required number of target training samples that can be used as negative samples of the first category can be increased from ten to twenty.

[0108] It should be noted that, when the image processing model has a weak ability to identify sample similarity, the present invention sets the required number of target training samples to a smaller number. In the process of identifying the target training samples from at least part of the training samples according to the order of similarity with the training samples of the first category, the requirement for the similarity relationship can be effectively improved by limiting the number of target training samples, thereby improving the recognition standard for the target training samples. For example, if the present invention sets the required number of target training samples that can be used as positive samples of the training samples of the first category to ten when the image processing model has a weak ability to identify sample similarity, then when identifying the target training samples, the present invention can rank the top ten in terms of similarity, that is, the ten training samples with the greatest similarity with the training samples of the first category are identified as target training samples that can be used as positive samples of the training samples of the first category, and no matter how great the similarity is, the training samples corresponding to the eleventh and eleventh order will not be identified as target training samples, thereby effectively improving the recognition standard for the target training samples.

[0109] It should also be noted that the present invention is based on Figure 2 The method shown can realize dynamic adjustment of the required number of target training samples during the training process of the image processing model. While effectively improving the recognition standard of the target training samples, it can also reduce the consumption of related resources, such as reducing the resource consumption of setting the sample relationship identifiers of the target training samples.

[0110] The training method of the image processing model proposed in this embodiment can identify the required number of target training samples by sorting the similarities between each training sample in at least part of the above-mentioned training samples and the training samples of the first category during the process of identifying the required number of target training samples. By limiting the number of target training samples, the requirements for the similarity relationship can be effectively improved, thereby improving the recognition standard for the target training samples.

[0111] based on Figure 1The method shown in the embodiment proposes another training method of the image processing model, such as Figure 3 In this method, the present invention may be provided with the above-mentioned first preset threshold and second preset threshold. The method may also include the following steps:

[0112] S301. Adjust the value of the first preset threshold and / or the value of the second preset threshold according to the number of times the image processing model has been trained.

[0113] Specifically, the present invention can adjust the value of the first preset threshold and / or the second preset threshold when the number of times the image processing model has been trained increases, that is, when the image processing model's ability to recognize sample similarity is enhanced, thereby increasing the value of the first preset threshold and / or decreasing the value of the second preset threshold.

[0114] It can be understood that when the image processing model of the present invention enhances the recognition ability of sample similarities between training samples, the value of the first preset threshold and / or the second preset threshold is adjusted to appropriately lower the recognition standard for the target training samples. In the process of identifying the required number of target training samples, while ensuring accurate recognition of the target training samples, a larger number of target training samples can be identified from at least part of the above-mentioned training samples at one time, thereby effectively reducing the resources consumed for identifying the required number of target training samples.

[0115] It should be noted that, in the present invention, when the value of the first preset threshold and / or the second preset threshold needs to be adjusted, the technical personnel may adjust the specific value thereof.

[0116] The training method of the image processing model proposed in this embodiment can adjust the value of the first preset threshold and / or the second preset threshold when the number of times the image processing model has been trained increases and the image processing model's ability to recognize sample similarity is enhanced, and appropriately lower the recognition standard for the target training samples. In the process of identifying the required number of target training samples, while ensuring accurate recognition of the target training samples, a larger number of target training samples can be identified from at least part of the above-mentioned training samples at one time, thereby effectively reducing the resources consumed for identifying the required number of target training samples.

[0117] It should also be noted that Figure 1 The training method shown can also be applied to other machine learning models besides image processing models. The present invention proposes a training method for a machine learning model, such as Figure 4 As shown, in this method, the training sample set of the machine learning model may include a first training sample set and a second training sample set, and the method may include the following steps:

[0118] S401, according to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the above similarity for the target training sample, the sample relationship identifier is used to characterize the sample relationship between the training samples in the two different training sample sets, and the target training sample is a sample in the above at least part of the training samples;

[0119] S402: Train the machine learning model using at least a target training sample with a sample relationship identifier.

[0120] Among them, the machine learning model can be an image processing model or a model in other technical fields other than the image processing field, such as an email classification model, a text classification model, an audio classification model, a video classification model, and a semantic analysis model.

[0121] Among them, when the present invention uses the first training sample set to train the machine learning model, it can use steps S401 and S402 to identify training samples that can be used as positive samples of training samples of the first category in the first training sample set from the second training set in a cross-training sample set manner, and / or identify training samples that can be used as negative samples of training samples of the first category in the first training sample set. This part of the training samples identified from the second training sample set can participate in the training of the machine learning model using the first training sample set by the present invention, which can increase the number of positive samples and / or negative samples of training samples of the first category, improve the training effect of the machine learning model, and enable the machine learning model to learn the sample features of the training samples in the first training sample set while learning the sample features of the training samples from the second training sample set, so that the machine learning model can simultaneously have the versatility in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0122] The training method of the machine learning model proposed in this embodiment can calculate the similarity with the training samples of the first category, identify the training samples with higher similarity to the training samples of the first category from the second training set as positive samples of the training samples of the first category, and / or identify the training samples with lower similarity to the training samples of the first category as negative samples of the training samples of the first category. This part of the training samples identified from the second training sample set can participate in the training of the machine learning model using the first training sample set, and can increase the number of positive samples and / or negative samples of the training samples of the first category, thereby increasing the number of training samples when the present invention uses the first training sample set to train the machine learning model, improving the training effect of the machine learning model, and enabling the machine learning model to learn the sample features of the training samples from the second training sample set when learning the sample features of the training samples in the first training sample set, thereby enabling the machine learning model to have versatility in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0123] and Figure 1 Corresponding to the method shown, the present invention proposes a training device for an image processing model, such as Figure 5 In the device, the training sample set of the image processing model includes a first training sample set and a second training sample set. The device may include: a first setting unit 101 and a first training unit 102, wherein:

[0124] The first setting unit 101 can be configured to perform: according to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set, setting a sample relationship identifier that matches the above similarity for the target training sample, the target training sample is a sample in the above at least part of the training samples, and the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets.

[0125] Among them, the image processing model is a machine learning model that can perform relevant processing on an image based on the image features of the image.

[0126] Among them, the present invention does not limit the training stage of the image processing model. For example, the image processing model can be a model that has not been trained, a model that is in the process of training, or a model that has completed one or more trainings.

[0127] The first training sample set and the second training sample set are both training sample sets that can be used to train the image processing model. Specifically, the first training sample set and the second training sample set can be different training sample sets, that is, the categories and / or sample quantities of the training samples contained in the first training sample set and the second training sample set can be different.

[0128] It should be noted that, when the prior art uses a certain training sample set to train an image processing model, it is limited to using the training samples in the training sample set to train the image processing model.

[0129] The category may be a category used to classify the processing object.

[0130] The first training sample set and the second training sample set may be training sample sets collected from different scenarios.

[0131] Specifically, the first training sample set may be a training sample set in which the training samples have been classified. Optionally, the first training sample set may be a training sample set in which the training samples have been classified and the classified training samples of each category are labeled with category identifiers; optionally, the first training sample set may also be a training sample set in which the training samples have been classified but the classified training samples of each category are not labeled with category identifiers.

[0132] The category identifier may be an identifier used to indicate the category to which a training sample in the training sample set belongs.

[0133] The first training sample set may include training samples of one or more categories, and the first category may be a category in the first training sample set.

[0134] The present invention does not limit whether the training samples of the second training sample set have been classified or whether the categories are marked with category identifiers. Specifically, the second training sample set can be a training sample set with classified training samples or a training sample set with unclassified training samples. When the second training sample set is a training sample set with classified training samples, the classified training samples of each category can be marked with category identifiers or not.

[0135] The target training sample may be one of the at least some of the training samples mentioned above and has a certain similarity relationship with the training samples of the first category.

[0136] It can be understood that, for target training samples with a higher similarity to training samples of the first category, the present invention can determine them as positive samples of training samples of the first category; for target training samples with a lower similarity to training samples of the first category, the present invention can determine them as negative samples of training samples of the first category. When the present invention uses the training samples in the first training sample set to train the image processing model, it can be combined with the target training samples with a higher similarity to the first category, i.e., positive samples of training samples of the first category, and / or the target training samples with a lower similarity to the first category, i.e., negative samples of training samples of the first category, to train it, thereby increasing the number of positive samples and / or the number of negative samples of training samples of the first category, thereby improving the processing effect of the image processing model.

[0137] It is understandable that the present invention can identify a certain number of target training samples from at least part of the above training samples, further increase the number of positive samples and / or negative samples of the first category of training samples, thereby further improving the processing effect of the image processing model. The specific value of the above first number can be determined by technicians according to actual needs, and the present invention does not limit this.

[0138] Specifically, the present invention can respectively calculate the similarity between the image features of the training samples of the first category and the image features of each training sample in at least part of the training samples, and identify a certain number of target training samples according to the similarity calculation results.

[0139] The present invention may use an image processing model to obtain image features of training samples of the first category and image features of each training sample in at least part of the training samples.

[0140] It should be noted that the present invention may also use other methods to obtain the image features of the training samples of the first category and the image features of each training sample in at least part of the training samples.

[0141] It is understandable that the present invention can use the image processing model to calculate the similarity between the image features of the training samples of the first category and the image features of each training sample in the at least part of the training samples. Of course, the present invention can also use other methods to calculate the similarity.

[0142] It should be noted that if the present invention uses an image processing model to obtain image features of training samples of the first category and image features of each training sample in at least part of the above-mentioned training samples, and uses the image processing model to calculate the similarity between the image features of the training samples of the first category and the image features of at least part of the above-mentioned training samples, then the present invention may be to use the image processing model to identify target training samples from the second training sample set based on the image features of the training samples of the first category.

[0143] After identifying a certain number of target training samples, the present invention can set sample relationship identifiers for each pair of target training samples that match their similarity with the training samples of the first category.

[0144] Optionally, the sample relationship identifier may include a first identifier and / or a second identifier, the first identifier may be used to indicate that the target training sample is a negative sample of the training samples of the first category, and the second identifier may be used to indicate that the target training sample is a positive sample of the training samples of the first category.

[0145] Optionally, when the similarity is less than a first preset threshold, the sample relationship identifier that matches the similarity is a first identifier; when the similarity is not less than a second preset threshold, the sample relationship identifier that matches the similarity is a second identifier.

[0146] The values ​​of the first preset threshold and the second preset threshold can be determined by technicians according to actual conditions, and the present invention does not limit this.

[0147] The first training unit 102 may be configured to execute: training the image processing model using at least the target training sample with the sample relationship identifier.

[0148] Among them, after the present invention identifies a certain number of target training samples from at least part of the above-mentioned training samples and sets corresponding sample relationship identifiers for each target training sample, it can at least use the target training samples with sample relationship identifiers to train the image processing model, increase the number of positive samples and / or negative samples of the first category of training samples used to train the image processing model, and improve the training effect on the image processing model.

[0149] It should be noted that the present invention does not limit the training stage of the image processing model.

[0150] in, Figure 5 The training device shown can be applicable to a variety of image processing models that use different image processing methods, such as image detection models, image classification models, and image recognition models.

[0151] Understandably, Figure 5 The device shown can be applied not only to image processing models that perform classification processing on images, but also to image processing models that perform regression analysis on images.

[0152] The training device for the image processing model proposed in this embodiment increases the number of training samples when using the first training sample set to train the image processing model, improves the training effect of the image processing model, and enables the image processing model to learn the image features of the training samples from the second training sample set when learning the image features of the training samples in the first training sample set, thereby enabling the image processing model to have versatility in the scenes corresponding to the first training sample set and the scenes corresponding to the second training sample set.

[0153] and Figure 4 Corresponding to the method shown, the present invention proposes a training device for a machine learning model, such as Figure 6 As shown, in the device, the training sample set of the machine learning model may include a first training sample set and a second training sample set, and the device may include: a second setting unit 201 and a second training unit 202, wherein:

[0154] The second setting unit 201 may be configured to execute: according to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for the target training sample, the sample relationship identifier being used to characterize the sample relationship between the training samples in the two different training sample sets, the target training sample being a sample in at least part of the training samples;

[0155] The second training unit 202 may be configured to execute: training the machine learning model using at least target training samples with sample relationship identifiers.

[0156] Among them, the machine learning model can be an image processing model or a model in other technical fields other than the image processing field, such as an email classification model, a text classification model, an audio classification model, a video classification model, and a semantic analysis model.

[0157] Among them, when the present invention uses the first training sample set to train the machine learning model, it can identify training samples that can serve as positive samples of training samples of the first category in the first training sample set from the second training set in a cross-training sample set manner, and / or identify training samples that can serve as negative samples of training samples of the first category in the first training sample set. This part of the training samples identified from the second training sample set can participate in the training of the machine learning model using the first training sample set by the present invention, which can increase the number of positive samples and / or negative samples of training samples of the first category, improve the training effect of the machine learning model, and enable the machine learning model to learn the sample features of the training samples in the first training sample set while learning the sample features of the training samples from the second training sample set, so that the machine learning model can simultaneously have the versatility in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0158] The training device for the machine learning model proposed in this embodiment can increase the number of training samples when using the first training sample set to train the machine learning model, improve the training effect of the machine learning model, and enable the machine learning model to learn the sample features of the training samples in the first training sample set while learning the sample features of the training samples from the second training sample set, so that the machine learning model can have versatility in the scenarios corresponding to the first training sample set and the scenarios corresponding to the second training sample set.

[0159] 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.

[0160] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A training method for an image processing model, characterized in that: The training sample set of the image processing model includes a first training sample set and a second training sample set, wherein the first training sample set includes face images collected within a first time range, and the second training sample set includes face images collected within a second time range, and the method includes: According to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least some of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the target training sample is a sample in the at least some of the training samples, and the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets; The image processing model is trained using at least the target training sample with the sample relationship identifier, so that the image processing model has the versatility to process facial images in scenes at different times.

2. The method according to claim 1, characterized in that The sample relationship identifier includes a first identifier and / or a second identifier, the first identifier is used to indicate that the target training sample is a negative sample of the training samples of the first category, and the second identifier is used to indicate that the target training sample is a positive sample of the training samples of the first category.

3. The method according to claim 2, characterized in that When the similarity is less than a first preset threshold, the sample relationship identifier that matches the similarity is the first identifier; When the similarity is not less than a second preset threshold, the sample relationship identifier that matches the similarity is the second identifier.

4. The method according to claim 1, characterized in that The image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier is: a model that has been trained using the first training sample set; Alternatively, the image processing model before the image processing model is trained using at least the target training sample with the sample relationship identifier is: a model that has been trained using the first training sample set and the second training sample set.

5. The method according to claim 1, characterized in that The method further comprises: The number of target training samples to which the sample relationship identifier is to be added is adjusted according to the number of times the image processing model has been trained.

6. The method according to claim 3, characterized in that The method further comprises: The value of the first preset threshold and / or the value of the second preset threshold are adjusted according to the number of times the image processing model has been trained.

7. A method for training a machine learning model, characterized in that: The training sample set of the machine learning model includes a first training sample set and a second training sample set, wherein the first training sample set includes face images collected within a first time range, and the second training sample set includes face images collected within a second time range, and the method includes: According to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets, and the target training sample is a sample in the at least part of the training samples; The machine learning model is trained using at least the target training sample with the sample relationship identifier, so that the machine learning model has the versatility to process facial images in scenes at different times.

8. A training device for an image processing model, characterized in that: The training sample set of the image processing model includes a first training sample set and a second training sample set, wherein the first training sample set includes face images collected within a first time range, and the second training sample set includes face images collected within a second time range, and the device includes: an identification setting unit and a model training unit, wherein: The identifier setting unit is configured to perform: according to the similarity between the image features of the training samples of the first category in the first training sample set and the image features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for a target training sample, wherein the target training sample is a sample in the at least part of the training samples, and the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets; The model training unit is configured to execute: at least training the image processing model using the target training sample with the sample relationship identifier, so that the image processing model has the versatility to process facial images in scenes at different times.

9. A training device for a machine learning model, characterized in that: The training sample set of the machine learning model includes a first training sample set and a second training sample set, wherein the first training sample set includes face images collected within a first time range, and the second training sample set includes face images collected within a second time range, and the device includes: a second setting unit and a second training unit, wherein: The second setting unit is configured to execute: according to the similarity between the sample features of the training samples of the first category in the first training sample set and the sample features of at least part of the training samples in the second training sample set, setting a sample relationship identifier matching the similarity for the target training sample, wherein the sample relationship identifier is used to characterize the sample relationship between the training samples in two different training sample sets, and the target training sample is a sample in the at least part of the training samples; The second training unit is configured to execute: at least using the target training sample with the sample relationship identifier to train the machine learning model, so that the machine learning model has the versatility to process facial images in scenes at different times.