A training method and device, computer device and storage medium

By selecting the branch with the minimum loss from the prediction branches with different initial network parameters in the face recognition model for training, and removing noisy sample images, the problem of model performance degradation caused by training with noisy labeled data is solved, and the recognition accuracy is improved.

CN113887458BActive Publication Date: 2026-04-28BEIJING SENSETIME TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SENSETIME TECH DEV CO LTD
Filing Date
2021-10-11
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The performance of face recognition models is limited by the amount of labeled data used during training, and training with noisy labeled data makes later optimization difficult, resulting in lower model recognition accuracy.

Method used

By acquiring multiple sample images, processing the sample images using prediction branches with different initial network parameters, selecting the prediction branch with the smallest loss for training, and removing noisy sample images during the training process, merging object categories of the same type, and retraining the neural network.

Benefits of technology

It improves the training accuracy and recognition accuracy of the face recognition model, overcomes the influence of noisy samples, and optimizes model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113887458B_ABST
    Figure CN113887458B_ABST
Patent Text Reader

Abstract

The present disclosure provides a training method and device, computer equipment and a storage medium, wherein the method comprises: obtaining a plurality of sample images; the sample images comprise a target object; for each sample image, processing the sample image by using a target neural network to be trained to obtain a plurality of category prediction information corresponding to the target object; wherein different category prediction information is respectively output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and based on the plurality of category prediction information, determining the target prediction branch corresponding to each sample image from the plurality of prediction branches; based on the plurality of sample images and the target prediction branch corresponding to each sample image in the plurality of sample images, training the target neural network until a preset training stop condition is met, and obtaining the trained target neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer vision technology, and more specifically, to a training method, apparatus, computer device, and storage medium. Background Technology

[0002] Facial recognition plays a crucial role in many fields, such as access control systems and attendance tracking. However, the performance of facial recognition models is limited by the amount of labeled data used during training; more training data (such as sample images) generally leads to better performance. On one hand, obtaining training data with accurate labels is difficult, and the amount of such data available is limited. On the other hand, training facial recognition models on noisy labeled data makes later model optimization challenging, resulting in decreased model performance and lower facial recognition accuracy. Summary of the Invention

[0003] This disclosure provides at least one training method, apparatus, computer device, and storage medium.

[0004] In a first aspect, embodiments of this disclosure provide a training method, including:

[0005] Acquire multiple sample images; the sample images include the target object;

[0006] For each sample image, the target neural network to be trained is used to process the sample image to obtain multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, the target prediction branch corresponding to each sample image is determined from the multiple prediction branches.

[0007] Based on the multiple sample images and the target prediction branch corresponding to each sample image, the target neural network is trained until a preset training cutoff condition is met, thus obtaining the trained target neural network.

[0008] This embodiment does not limit the presence or absence of noise in the sample image. It utilizes different preset branches corresponding to different initial network parameters to process the sample image, thereby obtaining different category prediction information. Based on multiple category prediction information, the prediction branch with the highest processing accuracy, i.e., the target prediction branch, can be selected from the different preset branches. Subsequently, the target neural network is trained using this target prediction branch and sample images that may contain noise, which overcomes the influence of noisy samples and improves the training accuracy of the target neural network.

[0009] In one optional implementation, determining the target prediction branch corresponding to each sample image from the plurality of prediction branches based on the plurality of category prediction information includes:

[0010] For any sample image, based on the category prediction information output by each prediction branch, the first loss information corresponding to each prediction branch for that sample image is determined;

[0011] Based on the first loss information corresponding to each prediction branch for any sample image, the prediction branch corresponding to the minimum loss is taken as the target prediction branch corresponding to any sample image.

[0012] In this implementation, since the first loss information can characterize the fitting effect of the target neural network on the sample image (i.e., the smaller the loss, the better the fitting effect, and the higher the accuracy of the target neural network's prediction result on the sample image), processing the corresponding sample image using the prediction branch corresponding to the first loss information with the smallest loss (i.e., the target prediction branch) can provide conditions for subsequently obtaining accurate target loss information, such as the loss function of the target neural network to be trained.

[0013] In one optional implementation, training the target neural network based on multiple sample images and the target prediction branch corresponding to each sample image includes:

[0014] For each of the plurality of target prediction branches, the portion of the target neural network other than the plurality of prediction branches and the target prediction branch are trained using at least one sample image corresponding to the target prediction branch.

[0015] In this implementation, since each target prediction branch is a relatively accurate prediction branch of its corresponding sample image prediction result, a relatively accurate prediction result can be obtained during the training process of the target prediction branch corresponding to the sample image and the part of the target neural network to be trained other than multiple prediction branches. Then, using the accurate prediction result, a relatively accurate loss function corresponding to the target neural network to be trained can be obtained. Using the loss function, the parameters of the target neural network to be trained can be updated, thereby improving the performance of the target neural network trained on noisy sample images.

[0016] In one optional implementation, training the target neural network (excluding the plurality of prediction branches) and the target prediction branch using at least one sample image corresponding to the target prediction branch includes:

[0017] Using the target prediction branch, determine the second loss information corresponding to each of the sample images in at least one of the sample images corresponding to the target prediction branch;

[0018] Based on multiple pieces of the second loss information, the target loss information of the target neural network to be trained is determined;

[0019] The target loss information is used to train the portion of the target neural network other than the multiple prediction branches, as well as the target prediction branch.

[0020] In this implementation, since the target prediction branch has the least loss when predicting sample images, processing the corresponding sample images using the target prediction branch can yield a more accurate prediction result, namely the second loss information. The second loss information can be used to obtain a more accurate loss function for determining the target neural network to be trained. Using this loss function, the parameters of the target neural network to be trained can be updated, thereby improving the performance of the target neural network trained on noisy sample images.

[0021] In one optional implementation, after obtaining the trained target neural network, the method further includes:

[0022] For each of the multiple sample images, based on the object category of the target object in the sample image, a first class center corresponding to each prediction branch is determined, and from the multiple first class centers, class centers whose matching degree with the object category of the target object meets a preset condition are selected; wherein, the first class center in the prediction branch is used to characterize the preset object category;

[0023] For each preset object category, based on each of the sample images in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset condition, the number of times each first class center corresponding to the preset object category is selected is determined, and the first class center with the most selections is taken as the second class center corresponding to the preset object category.

[0024] Based on the second class center corresponding to each of the multiple preset object categories, noisy sample images are removed from the multiple sample images.

[0025] In this implementation, firstly, a class center is selected from multiple prediction branches that best matches the object category of the target object in the sample image. This class center represents the similarity between the preset object category and the object category of the target object. Then, if a particular class center is selected most frequently from multiple prediction branches for multiple sample images corresponding to the same object category, this class center can be used as a second class center. This second class center more accurately represents the object category of the target object than other class centers selected from the prediction branches. Therefore, this second class center can be used to filter out noisy sample images from multiple sample images, improving the accuracy of the filtered noisy sample images.

[0026] In one optional implementation, the step of filtering class centers from a plurality of first class centers that meet preset conditions regarding the degree of matching with the object category of the target object includes:

[0027] Extract the image feature information of the sample image;

[0028] Based on the image feature information, a first similarity is determined between the sample image and each of the first class centers;

[0029] The first class center corresponding to the highest first similarity is taken as the class center whose matching degree with the object category of the target object meets the preset condition.

[0030] In this implementation, the image feature information can accurately represent the features of the sample image. Using this image feature information, the first similarity between the sample image and each first class center can be calculated. It can be considered that the preset object category corresponding to the first class center with the maximum first similarity is most matched with the object category of the target object in the sample image. Therefore, by taking the first class center as the class center whose matching degree with the object category of the target object meets the preset condition, a more accurate class center representing the object category of the target object in the sample image can be obtained.

[0031] In one optional implementation, for each of the plurality of second-type centers, noisy sample images are removed from the plurality of sample images corresponding to the preset object category, including:

[0032] For each of the multiple second-class centers, determine the second similarity between each of the sample images in the multiple sample images corresponding to the preset object category of the second-class center and the second-class center;

[0033] From the multiple sample images corresponding to the preset object category, filter out the sample images whose second similarity to the second category center is less than the first preset similarity, and discard them.

[0034] In this implementation, since the second class center more accurately represents the object category of the target object than other class centers selected from the prediction branch, it is possible to use this second class center to filter out sample images from multiple sample images whose second similarity to the second class center is less than the first preset similarity. These sample images can be considered to contain noise. Because the second class center has high accuracy in representing the object category of the target object, the accuracy of the filtered sample images being found to contain noise can be improved.

[0035] In one optional implementation, after determining the second type of center, the method further includes:

[0036] Based on the second center corresponding to each of the multiple preset object categories, a third similarity is determined between any two second centers.

[0037] The two preset object categories whose third similarity is less than the second preset similarity are merged into one target object category.

[0038] In this implementation, since the preset object category corresponding to the second center is subject to noise interference, in order to eliminate the interference, two preset object categories with a third pixel point less than the second preset similarity can be merged into one target object category.

[0039] In one optional implementation, after obtaining the trained target neural network, the method further includes:

[0040] Based on multiple sample images after removing noise, the merged target object category, and the preset object category without merging, the trained target neural network is retrained to obtain the final target neural network; wherein, the trained target neural network includes another prediction branch whose initial network parameters are different from the initial network parameters corresponding to the prediction branch.

[0041] This implementation method utilizes multiple sample images that have already had noise removed, target object categories that have had interference eliminated, and preset object categories that do not have noise interference to retrain the already trained target neural network, which can further improve the performance of the trained target neural network.

[0042] Secondly, embodiments of this disclosure also provide a training device, comprising:

[0043] The image acquisition module is used to acquire multiple sample images; the sample images include the target object;

[0044] An information determination module is used to process each sample image using a target neural network to be trained, thereby obtaining multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, to determine the target prediction branch corresponding to each sample image from the multiple prediction branches.

[0045] The network training module is used to train the target neural network based on the multiple sample images and the target prediction branch corresponding to each sample image in the multiple sample images until a preset training cutoff condition is met, thereby obtaining the trained target neural network.

[0046] In one optional implementation, the information determination module is used to determine, for any sample image, the first loss information corresponding to each prediction branch based on the category prediction information output by each prediction branch;

[0047] Based on the first loss information corresponding to each prediction branch for any sample image, the prediction branch corresponding to the minimum loss is taken as the target prediction branch corresponding to any sample image.

[0048] In one optional implementation, the network training module is used to train the portion of the target neural network other than the multiple prediction branches and the target prediction branch using at least one sample image corresponding to the target prediction branch for each of the multiple target prediction branches.

[0049] In one optional implementation, the network training module is used to determine second loss information corresponding to each of the sample images in at least one of the sample images corresponding to the target prediction branch using the target prediction branch;

[0050] Based on multiple pieces of the second loss information, the target loss information of the target neural network to be trained is determined;

[0051] The target loss information is used to train the portion of the target neural network other than the multiple prediction branches, as well as the target prediction branch.

[0052] In an optional embodiment, the apparatus further includes a data cleaning module, configured to, after obtaining the trained target neural network, determine, for each of the plurality of sample images, a first class center corresponding to each of the prediction branches based on the object category of the target object in the sample image, and filter class centers from the plurality of first class centers whose matching degree with the object category of the target object meets a preset condition; wherein, the first class center in the prediction branch is used to characterize the preset object category;

[0053] For each preset object category, based on each of the sample images in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset condition, the number of times each first class center corresponding to the preset object category is selected is determined, and the first class center with the most selections is taken as the second class center corresponding to the preset object category.

[0054] Based on the second class center corresponding to each of the multiple preset object categories, noisy sample images are removed from the multiple sample images.

[0055] In one optional implementation, the data cleaning module is used to extract image feature information from the sample image;

[0056] Based on the image feature information, a first similarity is determined between the sample image and each of the first class centers;

[0057] The first class center corresponding to the highest first similarity is taken as the class center whose matching degree with the object category of the target object meets the preset condition.

[0058] In one optional implementation, the data cleaning module is used to determine, for each of the multiple second-type centers, a second similarity between each of the sample images in the multiple sample images corresponding to the preset object category of the second-type center and the second-type center.

[0059] From the multiple sample images corresponding to the preset object category, filter out the sample images whose second similarity to the second category center is less than the first preset similarity, and discard them.

[0060] In an optional implementation, the data cleaning module is further configured to, after determining the second type center, determine a third similarity between any two second type centers based on the second type center corresponding to each of the multiple preset object categories;

[0061] The two preset object categories whose third similarity is less than the second preset similarity are merged into one target object category.

[0062] In an optional implementation, the network training module is further configured to, after obtaining the trained target neural network, retrain the trained target neural network based on multiple sample images after removing noise, the merged target object category, and the preset object category that has not been merged, to obtain the final target neural network; wherein the trained target neural network includes another prediction branch whose initial network parameters are different from the initial network parameters corresponding to the prediction branch.

[0063] Thirdly, embodiments of this disclosure also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible training method in the first aspect, are performed.

[0064] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect or any possible training method described in the first aspect.

[0065] For a description of the effects of the aforementioned training device, computer equipment, and storage medium, please refer to the description of the training method above; it will not be repeated here.

[0066] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0067] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0068] Figure 1 A flowchart of a training method provided by an embodiment of this disclosure is shown;

[0069] Figure 2This illustration shows a flowchart of the process by which the target neural network to be trained processes sample images, as provided in an embodiment of this disclosure.

[0070] Figure 3 A detailed flowchart of the process for removing noisy sample images provided in this embodiment of the disclosure is shown.

[0071] Figure 4 A schematic diagram of a training apparatus provided in an embodiment of this disclosure is shown;

[0072] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0074] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0075] In this article, "multiple or several" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0076] Research has shown that facial recognition plays a crucial role in many fields, such as access control systems and attendance tracking. However, the performance of facial recognition models is limited by the amount of labeled data used during training; more training data (such as sample images) generally leads to better performance. On one hand, obtaining training data with accurate labels is difficult, and the amount of such data available is limited. On the other hand, training facial recognition models on noisy labeled data makes later model optimization challenging, leading to decreased model performance and lower facial recognition accuracy.

[0077] Based on the above research, this disclosure provides a training method. When the sample image is a sample face image (which may contain noise) and the target neural network is a face recognition neural network, different preset branches corresponding to different initial network parameters are used to process the sample face image. This yields different category prediction information. Based on multiple category prediction information, the prediction branch with the highest processing accuracy, i.e., the target prediction branch, can be selected from the different preset branches. Subsequently, the face recognition neural network is trained using this target prediction branch and the sample face image, which overcomes the influence of noisy samples and improves the training accuracy of the face recognition neural network.

[0078] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.

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

[0080] To facilitate understanding of this embodiment, a training method disclosed in this disclosure will first be described in detail. The execution subject of the training method provided in this disclosure is generally a computer device with a certain computing power. In some possible implementations, this training method can be implemented by the processor calling computer-readable instructions stored in memory.

[0081] The training method provided in this embodiment will be described below using a computer device as the execution subject as an example.

[0082] See Figure 1 The diagram shows a flowchart of a training method provided in an embodiment of this disclosure. The method includes steps S101 to S103, wherein:

[0083] S101: Acquire multiple sample images; the sample images include the target object.

[0084] In this step, the sample images may include images used to train the target neural network; multiple sample images may be multiple images to be obtained for one iteration of training of the target neural network.

[0085] The target objects in the selected sample images differ depending on the training task. For example, if the training task is face recognition, the target neural network to be trained is a face recognition neural network, and the target objects in the selected sample images are faces. If the training task is preset object recognition, the target neural network to be trained is a preset object recognition neural network, and the target objects in the selected sample images are preset objects. Other training tasks will not be listed here.

[0086] In this embodiment of the face recognition neural network, the presence or absence of noise in the selected sample images is not limited. Here, a noisy sample image may include an image whose preset label is incorrect (e.g., the preset label does not match the actual object category of the target object), or an image containing abnormal elements. For example, if the actual object category of the face in the sample image is small A, but the preset label indicates that the face is small B, then the preset label of the sample image is determined to be incorrect, and thus the sample image is determined to be a noisy image.

[0087] Alternatively, a sample face image may be an image without a face or with a blurred face, which is considered a noisy sample image. A noisy sample image includes images with preset labels that correspond to the actual labels of the faces; or, an image with a clear face may exist.

[0088] For example, face recognition neural networks may include ResNet, DenseNet, MobileNet, etc.

[0089] S102: For each sample image, the target neural network to be trained is used to process the sample image to obtain multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, the target prediction branch corresponding to each sample image is determined from the multiple prediction branches.

[0090] This step involves analyzing each of the multiple sample images. The following section uses the determination of the target prediction branch corresponding to one of the sample images as an example to explain this step in detail:

[0091] First, the target neural network to be trained can be used to process the sample images. This processing can be divided into two parts (a first processing part and a second processing part). Specifically, the target neural network to be trained can also be divided into two neural networks. The first neural network can include parts other than multiple prediction branches, while the second neural network can include multiple prediction branches. See also... Figure 2 The diagram illustrates the process of a target neural network to be trained processing a sample image. It includes a target neural network 20 to be trained, comprising a first neural network 21 and a second neural network 22. The second neural network 22 includes multiple prediction branches 221, each of which may include a classifier. For example, multiple prediction branches 221 may include classifier A, classifier B, classifier C, etc., where each prediction branch has different initial network parameters. Multiple classifiers are deployed in the target neural network; the specific number can be determined based on the actual application process and empirical values, and this embodiment does not impose a specific limitation.

[0092] Specifically, for the first processing part, the sample image can be processed using the first part of the neural network 21. For example, the network layers in the first part of the neural network 21 to be trained can be used to capture the abstract features of the sample image and process them to obtain the initial processing result of the sample image.

[0093] Specifically, for the second processing part, the initial processing results can be input into each prediction branch 221 of the second neural network 22 to obtain the category prediction information corresponding to the target object output by each prediction branch 221. Here, the prediction branch may include a classifier, which is used to determine the preset object category to which the target object in a new sample image belongs, based on the labeled preset object category. Here, the preset object category may include pre-set object names, such as A, B, C, ...

[0094] Each prediction branch includes classifiers that contain the same information representing the preset object category (i.e., the first class center), but different initial network parameters. That is, the initialization parameters of the target neural network to be trained are different. Therefore, each classifier may produce different target processing results based on the initial processing results, meaning that the prediction information for multiple categories may differ. The initial network parameters can be set randomly based on empirical values; this disclosure does not impose specific limitations. Random initialization of neural network parameters is a mature existing technology and will not be described in detail here.

[0095] Here, the category prediction information includes predictions of the object category of the target object in the sample image. Specifically, it can include the probability that the predicted object category belongs to each preset object category. For example, in face recognition, the object category of the target object can be a preset label, which can include a preset identity identifier, such as the target object's name, i.e., "Little C". The classifier includes multiple class centers representing preset object categories, such as the first class center representing Little A, the first class center representing Little B, the first class center representing Little C, ..., the first class center representing Little N. In this case, the category prediction information can include the probability that the target object is Little A, Little B, Little C, ..., Little N.

[0096] A single category of predefined information includes a set of predicted probabilities; multiple categories of prediction information include multiple sets of predicted probabilities. The target prediction branch corresponding to a sample image is determined. In some embodiments, for any given sample image, based on the category prediction information output by each prediction branch, first loss information corresponding to each prediction branch for that given sample image is determined; based on the first loss information corresponding to each prediction branch for that given sample image, the prediction branch corresponding to the minimum loss is taken as the target prediction branch corresponding to that given sample image.

[0097] Here, the first loss information for any sample image corresponding to a certain prediction branch can include the loss of that prediction branch plus the loss of the first part of the neural network processing that sample image. The first loss information for any sample image corresponding to each prediction branch includes the loss of each prediction branch plus the loss of the first part of the neural network processing that sample image, thus obtaining multiple first loss information for any sample image.

[0098] Specifically, based on a set of prediction probabilities included in the category prediction information, a prediction branch that outputs the category prediction information plus the loss of the first part of the neural network for processing the sample image, such as the loss for face recognition, can be calculated; for multiple category prediction information, multiple losses can be calculated (one loss corresponds to one prediction branch), and the prediction branch corresponding to the minimum loss can be used as the target prediction branch for any sample image.

[0099] For example, see Figure 2 As shown, classifier A outputs category prediction information A, and based on category prediction information A, the loss A of the first part of the neural network + classifier A is calculated; classifier B outputs category prediction information B, and based on category prediction information B, the loss B of the first part of the neural network + classifier B is calculated; classifier C outputs category prediction information C, and based on category prediction information C, the loss C of the first part of the neural network + classifier C is calculated; then, the minimum value among loss A, loss B, and loss C is determined, and the classifier A corresponding to the minimum loss A is taken as the target classifier corresponding to the sample image, i.e., the target prediction branch.

[0100] Here, the first loss information characterizes the fitting effect of the target neural network on the sample image; the smaller the loss, the better the fitting effect, and the higher the accuracy of the target neural network's prediction result for the sample image. Therefore, using the prediction branch corresponding to the first loss information with the smallest loss, i.e., the target prediction branch, to process its corresponding sample image can provide conditions for obtaining accurate target loss information, such as the loss function of the target neural network to be trained.

[0101] S103: Based on multiple sample images and the target prediction branch corresponding to each sample image, train the target neural network until the preset training cutoff condition is met, and obtain the trained target neural network.

[0102] In practice, given multiple sample images and the target prediction branch corresponding to each sample image, traditional model training methods can be used to perform forward and backward propagation, and calculate the gradients of the backpropagation network layers to update the parameters of the target neural network to be trained. Forward propagation: Multiple sample images are input into the target neural network to be trained. The loss is calculated using the category prediction information output by the target prediction branch corresponding to each sample image. The choice of loss function is unrestricted; any form of loss function can be used, such as ArcFace or AMSoftmax. Backpropagation and calculation of gradients of the backpropagation network layers: The gradients of the network layers in the neural network are calculated using the loss function, thereby updating the parameters of the target neural network to be trained.

[0103] The following analysis focuses on multiple sample images included in a single iteration. Specifically, based on the target prediction branch corresponding to each sample image determined in S102, in some embodiments, without considering the memory usage of the loss calculated in S102, the calculated loss corresponding to the target prediction branch, i.e., the loss corresponding to the sample image, can be directly called. Based on the losses corresponding to multiple sample images, the loss function of the target neural network to be trained is determined, and the parameters of the target neural network to be trained are updated using the loss function to complete one iteration of training of the target neural network.

[0104] In other embodiments, considering the memory usage of the losses of multiple other prediction branches (excluding the target prediction branch) calculated in S102, after determining the target prediction branch, its corresponding loss is deleted. In this case, training the target neural network requires recalculating the loss corresponding to each target prediction branch, i.e., the loss corresponding to the sample image. The determination process in S102 can be referenced, and repeated parts will not be described here. Then, based on the losses of multiple sample images, the loss function of the target neural network to be trained is determined. The parameters of the target neural network to be trained are updated using the loss function, completing one iterative training of the target neural network.

[0105] Then, the above iterative process is repeated multiple times until the target neural network to be trained meets the preset training cutoff condition, and the trained target neural network is obtained.

[0106] This embodiment does not limit whether the sample image is noisy. The above steps S101-S102 process the sample image using different preset branches corresponding to different initial network parameters, obtaining different category prediction information. Based on multiple category prediction information, the prediction branch with the highest processing accuracy, i.e., the target prediction branch, can be selected from the different preset branches. Then, the target neural network is trained using this target prediction branch and sample images that may contain noise, overcoming the influence of noisy samples and improving the training accuracy of the target neural network.

[0107] In some embodiments, for each of the multiple target prediction branches, at least one sample image corresponding to the target prediction branch can be used to train the part of the target neural network other than the multiple prediction branches and the target prediction branch.

[0108] Here, the part of the target neural network other than the multiple prediction branches is the first part of the neural network 21.

[0109] In practice, the second loss information corresponding to each sample image in at least one sample image corresponding to the target prediction branch is determined using the target prediction branch; the target loss information of the target neural network to be trained is determined based on the multiple second loss information; and the target loss information is used to train the part of the target neural network other than the multiple prediction branches and the target prediction branch.

[0110] For example, the target prediction branch corresponds to multiple sample images, such as three sample images. The loss corresponding to each sample image is calculated, and the loss function is directly calculated using these three losses. For example, the loss function is the sum of the three losses or the average loss of the three losses. Then, the calculated loss function can be directly used to backpropagate and calculate the gradient of the backpropagation network layer, thereby updating the parameters of the target neural network to be trained (including the first part of the neural network 21 and the target prediction branch).

[0111] Alternatively, multiple target prediction branches can be used to determine multiple sets of sample images corresponding to the multiple target prediction branches. For each sample image in the multiple sets of sample images, the third loss information corresponding to each sample image can be determined. Based on the multiple third loss information, the target loss information of the target neural network to be trained can be determined. The target neural network can then be trained using the target loss information.

[0112] For example, in the previous example, multiple losses corresponding to a target prediction branch were determined, i.e., multiple second loss information. Based on this, multiple sets of losses corresponding to multiple target prediction branches can be determined, i.e., multiple sets of third loss information. The target loss information of the target neural network to be trained is determined using multiple sets of third loss information. Specifically, multiple target prediction branches correspond to multiple sets of sample images. The loss corresponding to each sample image in the multiple sets of sample images is calculated, and a loss function is calculated using multiple losses. The loss function can be the sum of multiple losses or the average loss corresponding to multiple losses. Then, using the calculated loss function, backpropagation is performed and the gradient of the backpropagation network layer is calculated, thereby updating the parameters of the target neural network to be trained (including the first part of the neural network 21 and the second part of the neural network 22).

[0113] Here, since the target prediction branch has the least loss when predicting the sample image, each target prediction branch is a prediction branch with a relatively accurate prediction result for its corresponding sample image. The target prediction branch processes its corresponding sample image to obtain a relatively accurate prediction result, i.e., the second loss information. Then, using this accurate prediction result, a relatively accurate loss function corresponding to the target neural network to be trained can be obtained. Using this loss function, the parameters of the target neural network to be trained can be updated, which can improve the performance of the target neural network trained on noisy sample images.

[0114] After obtaining the trained target neural network, the sample images can be further cleaned. Cleaning methods may include removing noisy sample images and / or merging preset object categories that belong to the same category.

[0115] In some embodiments, see Figure 3The diagram shows the specific flowchart for removing noisy sample images; it includes steps S301 to S303, where:

[0116] S301: For each of the multiple sample images, based on the object category of the target object in the sample image, determine the first class center corresponding to each prediction branch of the sample image, and select class centers from the multiple first class centers that meet the preset conditions for matching the object category of the target object; wherein, the first class center in the prediction branch is used to represent the preset object category.

[0117] In this step, the classifier includes multiple first-class centers, and different first-class centers represent different preset object categories.

[0118] For example, such as Figure 2 As shown, the sample image is determined to correspond to the first class center A of classifier A, the first class center B of classifier B, the first class center C of classifier C, and so on. Specifically, based on the sample image, the object category of the target object in the sample image is determined. Based on the object category of the target object, the first class center corresponding to the preset object category that is the same as the object category of the target object is selected in each classifier, namely, the first class center A, the first class center B, the first class center C, and so on.

[0119] The method for determining whether the matching degree meets the preset conditions may include: calculating the first similarity between the sample image and each first class center; for multiple first similarities, the preset conditions include the maximum similarity. Here, the first similarity can represent the similarity between the object category of the target object in the sample image and the preset object category corresponding to the first class center. The higher the similarity, the more closely the object category of the target object in the sample image matches the preset object category corresponding to the first class center, that is, the higher the matching degree.

[0120] Specifically, the first similarity can be determined by using a trained target neural network to extract image feature information from the sample image. Here, image feature information can include the feature vector of the sample image. For each first-class center, determine the vector of the first-class center. Calculate the eigenvector with vector The cosine distance between them is used to determine the first similarity. For example, the reciprocal of the cosine distance can be used as the first similarity.

[0121] Next, the first similarity between the sample image and each first class center is determined; the first class center corresponding to the maximum first similarity can be used as the class center whose matching degree with the object category of the target object meets the preset conditions.

[0122] Here, image feature information can accurately represent the features of the sample image. Using this image feature information, the first similarity between the sample image and each first class center can be calculated. It can be considered that the preset object category corresponding to the first class center with the maximum first similarity is most matched with the object category of the target object in the sample image. Therefore, by taking the first class center as the class center whose matching degree with the object category of the target object meets the preset condition, a more accurate class center representing the object category of the target object in the sample image can be obtained.

[0123] S302: For each preset object category, based on each sample image in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset conditions, determine the number of times each first class center corresponding to the preset object category is selected, and take the first class center with the most selections as the second class center corresponding to the preset object category.

[0124] For each preset object category, the following is a detailed explanation using one preset object category as an example.

[0125] For example, given a preset object category of "small A" and three classifiers, there are three first class centers representing the preset object category of "small A", denoted as the first class centers. Category I Center and the first type of center There are ten sample images corresponding to image A, of which six sample images are centered in the first class. Three sample images were selected, with the first type of center chosen. A sample image selects the first type center The first type of center selected here is the class center in S301 that is selected from multiple first type centers and whose matching degree with the object category of the target object meets the preset conditions.

[0126] Determine the number of times each first-category center corresponding to the preset object category is selected. Continuing with the previous example, determine the first-category center corresponding to the preset object category A. Selected 3 times, first category center Selected 6 times, first-class center It was selected once. At this point, the first-class center with the most selections will be selected. As the second category center corresponding to the preset object category.

[0127] Then, following the method described above for determining the second type of center, the second type of center corresponding to each preset object category is determined.

[0128] S303: Based on the second class center corresponding to each preset object category in multiple preset object categories, remove noisy sample images from multiple sample images.

[0129] Here, multiple second-type centers are identified. Taking one second-type center as an example, we determine how to remove noisy sample images from the multiple sample images corresponding to that second-type center. These multiple sample images, for example, include the first-type center. The corresponding six sample images.

[0130] In specific implementation, for each of the multiple second-type centers, determine the second similarity between each sample image in the multiple sample images corresponding to the preset object category of the second-type center and the second-type center; filter out sample images from the multiple sample images corresponding to the preset object category whose second similarity with the second-type center is less than the first preset similarity and remove them.

[0131] For each sample image in the multiple sample images corresponding to the preset object category corresponding to the second type center, continuing the previous example, the preset object category corresponding to the second type center is the first type center. The corresponding preset object category (small A), and the multiple sample images corresponding to this preset object category (small A), constitute the first category center. The six corresponding sample images. For one of the sample images, determine its second similarity with the second class center. Here, the second similarity represents the similarity between the object category of the target object in the sample image and the preset object category corresponding to the second class center.

[0132] The specific process for determining the second similarity is as follows: First, obtain the image feature information of the sample image and determine the feature vector of the sample image. Next, the feature vector of the sample image is calculated. Vectors of the second type center The cosine distance between the two samples is used to determine a second similarity. If the second similarity is less than the first preset similarity, the sample image is determined to contain noise and is removed. Here, the first preset similarity can be determined based on empirical values ​​and is the preset similarity between the maximum similarity between a noisy sample image and its corresponding second-class center, and the minimum similarity between a noise-free sample image and its corresponding second-class center, where the maximum similarity is less than or equal to the minimum similarity. This first preset similarity can be used to determine whether the preset label of the sample image is incorrect. If the second similarity is less than the first preset similarity, the preset label of the sample image is incorrect, and the sample image contains noise; if the second similarity is greater than or equal to the first preset similarity, the preset label of the sample image is correct, and the sample image does not contain noise.

[0133] Then, repeat the above method for each sample image to clean the sample images used to train the target neural network. At this point, only the sample images without noise need to be retained.

[0134] Here, because the second class center more accurately represents the object category of the target object than other class centers selected from the prediction branch, it can be used to filter out sample images from multiple sample images whose second similarity to the second class center is less than the first preset similarity. These sample images can be considered to contain noise. Since the second class center accurately represents the object category of the target object, it can improve the accuracy of the filtered sample images being indeed noisy.

[0135] In one embodiment, after determining the second type center, if there is noise interference in the preset object category corresponding to the second type center, such as the preset object category representing the same category, then the preset object categories belonging to the same category can be merged in order to eliminate the interference.

[0136] Specifically, a third similarity can be determined between any two second-class centers based on the second-class centers corresponding to each of the multiple preset object categories; then, two preset object categories with a third similarity less than the second preset similarity are merged into a single target object category.

[0137] Here, the third similarity can represent the similarity between any two predefined object categories corresponding to the second class centers. Specifically, the determination process involves determining a vector of a second class center. Another vector of the second type center Calculate vector sum vector The cosine distance between the two objects is used to determine the third similarity. If the third similarity is less than the second preset similarity, then the two preset object categories corresponding to them are determined to represent the same category, and they can be merged into a single target object category. This target object category can be one of the two preset object categories mentioned above, or a newly labeled preset tag. Here, the second preset similarity can be used to determine whether any two preset object categories represent the same category. The second preset similarity can be a preset similarity determined based on empirical values, between the minimum similarity between two second-category centers representing the same preset object category and the maximum similarity between two second-category centers that do not belong to the same preset object category. Here, the maximum similarity is less than or equal to the minimum similarity.

[0138] In some embodiments, after cleaning the sample images, the remaining cleaned sample images can be used to retrain the target neural network trained in S103 to obtain the final target neural network. This allows for further improvement of the target neural network's performance based on the performance of the target neural network trained in S103.

[0139] In practice, the target neural network can be retrained based on multiple sample images after removing noise, the merged target object category, and the preset object category that has not been merged, to obtain the final target neural network.

[0140] The trained target neural network may include other prediction branches whose initial network parameters differ from those of the prediction branch. Here, the initial network parameters of these other prediction branches can be the network parameters of the classifier obtained by randomly initializing the trained target neural network before retraining it.

[0141] Here, based on multiple sample images after removing noise, the merged target object categories, and the preset object categories that have not undergone merging, a relatively clean dataset can be obtained, i.e., free from noise interference. This dataset is then input into the target neural network that has already been trained in S103, and trained using traditional training methods or the training methods provided in this embodiment. This yields a final target neural network with higher performance than the previously trained target neural network. Of course, these multiple sample images after removing noise, the merged target object categories, and the preset object categories that have not undergone merging can also be used to train other neural networks, thereby improving the training effect.

[0142] By using the network training method and the data cleaning and retraining method provided in the embodiments of this disclosure, a face recognition neural network can be trained to obtain a high-performance face recognition neural network and a high-precision face recognition result.

[0143] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0144] Based on the same inventive concept, this disclosure also provides a training device corresponding to the training method. Since the principle of the device in this disclosure for solving the problem is similar to the training method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0145] Reference Figure 4 The diagram shown is a schematic representation of a training device provided in an embodiment of this disclosure. The device includes: an image acquisition module 401, an information determination module 402, and a network training module 403; wherein,

[0146] Image acquisition module 401 is used to acquire multiple sample images; the sample images include a target object;

[0147] The information determination module 402 is used to process each sample image using a target neural network to be trained, thereby obtaining multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, to determine the target prediction branch corresponding to each sample image from the multiple prediction branches.

[0148] The network training module 403 is used to train the target neural network based on the multiple sample images and the target prediction branch corresponding to each sample image in the multiple sample images until a preset training cutoff condition is met, thereby obtaining the trained target neural network.

[0149] In one optional implementation, the information determination module 402 is used to determine, for any sample image, the first loss information corresponding to each prediction branch based on the category prediction information output by each prediction branch;

[0150] Based on the first loss information corresponding to each prediction branch for any sample image, the prediction branch corresponding to the minimum loss is taken as the target prediction branch corresponding to any sample image.

[0151] In one optional implementation, the network training module 403 is used to train the part of the target neural network other than the multiple prediction branches and the target prediction branch for each of the multiple target prediction branches using at least one sample image corresponding to the target prediction branch.

[0152] In one optional implementation, the network training module 403 is used to determine, using the target prediction branch, second loss information corresponding to each of the sample images in at least one of the sample images corresponding to the target prediction branch;

[0153] Based on multiple pieces of the second loss information, the target loss information of the target neural network to be trained is determined;

[0154] The target loss information is used to train the portion of the target neural network other than the multiple prediction branches, as well as the target prediction branch.

[0155] In an optional embodiment, the apparatus further includes a data cleaning module 404, configured to, after obtaining the trained target neural network, determine, for each of the plurality of sample images, a first class center corresponding to each of the prediction branches based on the object category of the target object in the sample image, and filter class centers from the plurality of first class centers whose matching degree with the object category of the target object meets a preset condition; wherein, the first class center in the prediction branch is used to characterize the preset object category;

[0156] For each preset object category, based on each of the sample images in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset condition, the number of times each first class center corresponding to the preset object category is selected is determined, and the first class center with the most selections is taken as the second class center corresponding to the preset object category.

[0157] Based on the second class center corresponding to each of the multiple preset object categories, noisy sample images are removed from the multiple sample images.

[0158] In one optional implementation, the data cleaning module 404 is used to extract image feature information from the sample image;

[0159] Based on the image feature information, a first similarity is determined between the sample image and each of the first class centers;

[0160] The first class center corresponding to the highest first similarity is taken as the class center whose matching degree with the object category of the target object meets the preset condition.

[0161] In one optional implementation, the data cleaning module 404 is used to determine, for each of the multiple second-type centers, a second similarity between each of the sample images in the multiple sample images corresponding to the preset object category of the second-type center and the second-type center.

[0162] From the multiple sample images corresponding to the preset object category, filter out the sample images whose second similarity to the second category center is less than the first preset similarity, and discard them.

[0163] In an optional implementation, the data cleaning module 404 is further configured to, after determining the second type center, determine a third similarity between any two second type centers based on the second type center corresponding to each of the multiple preset object categories;

[0164] The two preset object categories whose third similarity is less than the second preset similarity are merged into one target object category.

[0165] In an optional implementation, the network training module 403 is further configured to, after obtaining the trained target neural network, retrain the trained target neural network based on multiple sample images after removing noise, the merged target object category, and the preset object category without merging, to obtain the final target neural network; wherein the trained target neural network includes another prediction branch whose initial network parameters are different from the initial network parameters corresponding to the prediction branch.

[0166] The processing flow of each module in the training device and the interaction flow between each module can be referred to the relevant descriptions in the above training method embodiments, and will not be detailed here.

[0167] Based on the same technical concept, embodiments of this application also provide a computer device. (Refer to...) Figure 5 The diagram shown is a structural schematic of a computer device provided in an embodiment of this application, including:

[0168] The system comprises a processor 51, a memory 52, and a bus 53. The memory 52 stores machine-readable instructions executable by the processor 51. The processor 51 executes these machine-readable instructions, and when executed, performs the following steps: S101: Acquire multiple sample images; each sample image includes a target object; S102: For each sample image, process it using a target neural network to be trained to obtain multiple category prediction information corresponding to the target object; wherein different category prediction information is output by different prediction branches in the target neural network; different prediction branches correspond to different initial network parameters; and, based on the multiple category prediction information, determine the target prediction branch corresponding to each sample image from the multiple prediction branches; S103: Based on the multiple sample images and the target prediction branch corresponding to each sample image, train the target neural network until a preset training cutoff condition is met, thus obtaining a trained target neural network.

[0169] The aforementioned memory 52 includes a main memory 521 and an external memory 522. The main memory 521, also known as internal memory, is used to temporarily store the computational data in the processor 51, as well as the data exchanged with external memory such as a hard disk. The processor 51 exchanges data with the external memory 522 through the main memory 521. When the computer device is running, the processor 51 and the memory 52 communicate through the bus 53, so that the processor 51 executes the execution instructions mentioned in the above method embodiments.

[0170] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the training method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0171] This disclosure also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the training method described above. The computer program product can be any product capable of implementing the training method described above. Part or all of the solutions in the computer program product that contribute to the prior art can be embodied in the form of a software product (e.g., a software development kit, SDK). This software product can be stored in a storage medium, and the included computer instructions cause relevant devices or processors to execute part or all of the steps of the training method described above.

[0172] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0173] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0174] In addition, the functional modules in the various embodiments of this disclosure can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0175] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0176] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A training method, characterized in that, include: Acquire multiple sample images; the sample images include the target object; For each sample image, the target neural network to be trained is used to process the sample image to obtain multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, the target prediction branch corresponding to each sample image is determined from the multiple prediction branches. Based on the multiple sample images and the target prediction branch corresponding to each sample image, the target neural network is trained until a preset training cutoff condition is met, and the trained target neural network is obtained. After obtaining the trained target neural network, the following steps are also included: For each of the multiple sample images, based on the object category of the target object in the sample image, a first class center corresponding to each prediction branch is determined, and from the multiple first class centers, class centers whose matching degree with the object category of the target object meets a preset condition are selected; wherein, the first class center in the prediction branch is used to characterize the preset object category; For each preset object category, based on each of the sample images in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset condition, the number of times each first class center corresponding to the preset object category is selected is determined, and the first class center with the most selections is taken as the second class center corresponding to the preset object category. Based on the second class center corresponding to each of the multiple preset object categories, noisy sample images are removed from the multiple sample images; The trained target neural network is retrained using sample images that have been removed to remove noisy images.

2. The method according to claim 1, characterized in that, The step of determining the target prediction branch corresponding to each sample image from the multiple prediction branches based on the multiple category prediction information includes: For any sample image, based on the category prediction information output by each prediction branch, the first loss information corresponding to each prediction branch for that sample image is determined; Based on the first loss information corresponding to each prediction branch for any sample image, the prediction branch corresponding to the minimum loss is taken as the target prediction branch corresponding to any sample image.

3. The method according to claim 1 or 2, characterized in that, The step of training the target neural network based on the multiple sample images and the target prediction branch corresponding to each sample image includes: For each of the plurality of target prediction branches, the portion of the target neural network other than the plurality of prediction branches and the target prediction branch are trained using at least one sample image corresponding to the target prediction branch.

4. The method according to claim 3, characterized in that, The step of training the target neural network, excluding the multiple prediction branches, and the target prediction branch using at least one sample image corresponding to the target prediction branch includes: Using the target prediction branch, determine the second loss information corresponding to each of the sample images in at least one of the sample images corresponding to the target prediction branch; Based on multiple pieces of the second loss information, the target loss information of the target neural network to be trained is determined; The target loss information is used to train the portion of the target neural network other than the multiple prediction branches, as well as the target prediction branch.

5. The method according to claim 1, characterized in that, The step of filtering class centers from a plurality of first class centers that meet preset conditions regarding the degree of matching with the object category of the target object includes: Extract the image feature information of the sample image; Based on the image feature information, a first similarity is determined between the sample image and each of the first class centers; The first class center corresponding to the highest first similarity is taken as the class center whose matching degree with the object category of the target object meets the preset condition.

6. The method according to claim 1, characterized in that, For each of the multiple second-type centers, noisy sample images are removed from the multiple sample images corresponding to the preset object category, including: For each of the multiple second-class centers, determine the second similarity between each of the sample images in the multiple sample images corresponding to the preset object category of the second-class center and the second-class center; From the multiple sample images corresponding to the preset object category, filter out the sample images whose second similarity to the second category center is less than the first preset similarity, and discard them.

7. The method according to any one of claims 1, 5-6, characterized in that, After determining the second type of center, the following is also included: Based on the second center corresponding to each of the multiple preset object categories, a third similarity is determined between any two second centers. The two preset object categories whose third similarity is less than the second preset similarity are merged into one target object category.

8. The method according to claim 7, characterized in that, The step of retraining the trained target neural network using sample images that have been removed to remove noise includes: Based on multiple sample images after removing noise, the merged target object category, and the preset object category without merging, the trained target neural network is retrained to obtain the final target neural network; wherein, the trained target neural network includes another prediction branch whose initial network parameters are different from the initial network parameters corresponding to the prediction branch.

9. A training device, characterized in that, include: The image acquisition module is used to acquire multiple sample images; the sample images include the target object; An information determination module is used to process each sample image using a target neural network to be trained, thereby obtaining multiple category prediction information corresponding to the target object; wherein, different category prediction information is output by different prediction branches in the target neural network; the initial network parameters corresponding to different prediction branches are different; and, based on the multiple category prediction information, to determine the target prediction branch corresponding to each sample image from the multiple prediction branches. The network training module is used to train the target neural network based on the multiple sample images and the target prediction branch corresponding to each sample image in the multiple sample images until a preset training cutoff condition is met, so as to obtain the trained target neural network. The device further includes a data cleaning module, which, after obtaining the trained target neural network, determines, for each of the plurality of sample images, a first class center corresponding to each of the prediction branches based on the object category of the target object in the sample image, and filters class centers from the plurality of first class centers that meet the preset conditions for matching the object category of the target object; wherein, the first class center in the prediction branch is used to characterize the preset object category; For each preset object category, based on each of the sample images in the multiple sample images corresponding to the preset object category, and the class center whose matching degree with the object category of the target object in the sample image meets the preset condition, the number of times each first class center corresponding to the preset object category is selected is determined, and the first class center with the most selections is taken as the second class center corresponding to the preset object category. Based on the second class center corresponding to each of the multiple preset object categories, noisy sample images are removed from the multiple sample images; The trained target neural network is retrained using sample images that have been removed to remove noisy images.

10. A computer device, characterized in that, include: The computer device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and the processor communicates with the memory via the bus when the computer device is running, and the machine-readable instructions, when executed by the processor, perform the steps of the training method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the training method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method, image processing apparatus, computer readable storage medium

    CN109241880A

  • Image classification method and apparatus, storage medium, and electronic device

    WO2021138911A1