Network training methods and devices, recognition methods, electronic devices and storage media
By initializing and adjusting multiple subclass centers for the image recognition network to generate target subclass centers, the problems of low recognition accuracy and efficiency caused by noisy data in the training data are solved, and efficient and robust image recognition network training is achieved.
Patent Information
- Application Number
- CN202210910127.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-07-29
AI Technical Summary
The training efficiency and robustness of existing image recognition networks are low, mainly due to the presence of noisy data with labeling errors in the training data, which leads to low recognition accuracy. Furthermore, existing methods for cleaning up noisy data are computationally and time-consuming, and parameter tuning is complex.
The image recognition network is trained by initializing multiple initial sub-centers for sample feature clusters under the same category label, adjusting the sub-centers according to similarity, generating target sub-centers, and using the target sub-centers and sample features to determine the network loss.
This improves the robustness and recognition accuracy of image recognition networks, reduces computational resources and time overhead, and achieves an efficient network training process.
Smart Images

Figure CN115147699B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a network training method and apparatus, an identification method, an electronic device, and a storage medium. Background Technology
[0002] Currently, the recognition performance of image recognition networks largely depends on large-scale training datasets. However, due to the massive amount of data and its fine-grained nature, it is difficult to obtain clean training datasets directly through data annotation. In other words, there is bound to be noisy data with labeling errors in the training data. This noisy data will reduce the performance and efficiency of network training, and may result in poor robustness and low recognition accuracy of the trained image recognition network.
[0003] Related technologies can clean up noisy data through recursive clustering, but this method usually requires multiple iterations to ensure data availability. As the data scale increases, the computational resource and time overhead of each iteration is very large, and a lot of parameter tuning is required to obtain good training results, resulting in low network training efficiency. Summary of the Invention
[0004] This disclosure proposes a network training technology solution.
[0005] According to one aspect of this disclosure, a network training method is provided, comprising: extracting features from multiple sample images labeled with the same category label in a sample image set using an image recognition network to obtain sample feature clusters under the same category label, wherein the sample image set includes sample images labeled with multiple category labels; initializing multiple initial sub-centers for the sample feature clusters and determining the initial sub-center to which each of the multiple sample features in the sample feature cluster belongs; adjusting the multiple initial sub-centers according to the similarity between the multiple sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label; determining a network loss based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, and training the image recognition network using the network loss.
[0006] In one possible implementation, adjusting the multiple initial sub-centers based on the similarity between the multiple sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label includes: determining whether there are outlier features among the multiple sample features based on the similarity between the multiple sample features and their respective initial sub-centers, wherein the similarity between the outlier feature and its corresponding initial sub-center is less than a first threshold; if there are outlier features among the multiple sample features, adding a new initial sub-center based on the outlier feature, and adjusting the outlier feature to belong to the newly added initial sub-center; wherein the target sub-center includes the newly added initial sub-center and the multiple initialized initial sub-centers.
[0007] In one possible implementation, determining whether there are outlier features among the plurality of sample features based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining a first threshold corresponding to the initial sub-center based on the mean and standard deviation of the similarity between the initial sub-center and the sample features belonging to the initial sub-center; determining whether there are sample features among the sample features belonging to the initial sub-center whose similarity to the initial sub-center is less than the first threshold; and identifying the sample features whose similarity to the initial sub-center is less than the first threshold as outlier features far from the initial sub-center.
[0008] In one possible implementation, adjusting the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label includes: determining whether there are any anomalous sub-centers among the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers, wherein the mean similarity between the sample features belonging to the anomalous sub-center and the anomalous sub-center is less than or equal to a second threshold; if there are anomalous sub-centers among the plurality of initial sub-centers, discarding the anomalous sub-center and the sample features belonging to the anomalous sub-center, obtaining the remaining initial sub-centers and the sample features belonging to the remaining initial sub-centers; wherein the target sub-center includes the remaining initial sub-centers.
[0009] In one possible implementation, determining whether there is an anomalous sub-center among the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining whether the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to a second threshold; if the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to the second threshold, determining that the initial sub-center is an anomalous sub-center.
[0010] In one possible implementation, adjusting the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label includes: determining at least one group of sub-centers to be merged from the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers, each group of sub-centers to be merged including at least two similar initial sub-centers; merging the at least one group of sub-centers to be merged to obtain at least one merged sub-center, and adjusting the sample features belonging to each group of sub-centers to be merged to belong to each merged sub-center; wherein, the target sub-center includes the merged sub-center.
[0011] In one possible implementation, determining at least one group of sub-centers to be merged from the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: determining a third threshold corresponding to each initial sub-center based on the mean and standard deviation of the similarity between each initial sub-center and the sample features belonging to each initial sub-center; for any initial sub-center, determining whether the similarity between the initial sub-center and other initial sub-centers among the plurality of initial sub-centers is greater than or equal to a fourth threshold, wherein the fourth threshold is the maximum value between the third threshold corresponding to the initial sub-center and the third threshold corresponding to the other initial sub-centers; if the similarity between the initial sub-center and the other initial sub-centers is greater than or equal to the maximum value, determining that the other initial sub-centers are similar to the initial sub-center; and determining the initial sub-center and at least one other initial sub-center similar to the initial sub-center as a group of sub-centers to be merged.
[0012] In one possible implementation, determining the network loss based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center includes: for each sample feature belonging to any target sub-center, determining the sub-loss corresponding to the sample feature based on the similarity between the sample feature and its corresponding target sub-center, and the similarity between the sample feature and other target sub-centers, wherein the other target sub-centers include target sub-centers among the multiple target sub-centers under the multiple category labels that are other than the target sub-center to which the sample feature belongs and whose similarity to the sample feature is less than or equal to a fifth threshold; and determining the network loss based on the sub-loss corresponding to each sample feature belonging to each target sub-center.
[0013] In one possible implementation, determining the initial subclass center to which each of the multiple sample features in the sample feature cluster belongs includes: for any sample feature in the sample feature cluster, calculating the similarity between the sample feature and each initial subclass center, and determining the initial subclass center corresponding to the maximum similarity as the initial subclass center to which the sample feature belongs.
[0014] According to one aspect of this disclosure, an image recognition method is provided, comprising: using an image recognition network to recognize an object in an image to be recognized, and obtaining a recognition result of the object, wherein the recognition result characterizes the category of the object, and wherein the image recognition network is trained by the network training method.
[0015] According to one aspect of this disclosure, a network training apparatus is provided, comprising: a feature extraction module, configured to extract features from multiple sample images labeled with the same category label in a sample image set using an image recognition network, to obtain sample feature clusters under the same category label, wherein the sample image set includes sample images labeled with multiple category labels; a determination module, configured to initialize multiple initial sub-centers for the sample feature clusters, and determine the initial sub-center to which each of the multiple sample features in the sample feature cluster belongs; an adjustment module, configured to adjust the multiple initial sub-centers according to the similarity between the multiple sample features and their respective initial sub-centers, to obtain at least one target sub-center under the same category label; and a training module, configured to determine a network loss based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, and to train the image recognition network using the network loss.
[0016] In one possible implementation, the adjustment module includes: a first determining submodule, configured to determine whether there are outlier features among the plurality of sample features based on the similarity between the plurality of sample features and their respective initial subclass centers, wherein the similarity between the outlier features and their respective initial subclass centers is less than a first threshold; and a adding submodule, configured to, if there are outlier features among the plurality of sample features, add new initial subclass centers based on the outlier features, and adjust the outlier features to belong to the newly added initial subclass centers; wherein the target subclass center includes the newly added initial subclass center and the plurality of initialized initial subclass centers.
[0017] In one possible implementation, determining whether there are outlier features among the plurality of sample features based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining a first threshold corresponding to the initial sub-center based on the mean and standard deviation of the similarity between the initial sub-center and the sample features belonging to the initial sub-center; determining whether there are sample features among the sample features belonging to the initial sub-center whose similarity to the initial sub-center is less than the first threshold; and identifying the sample features whose similarity to the initial sub-center is less than the first threshold as outlier features far from the initial sub-center.
[0018] In one possible implementation, the adjustment module includes: a second determining submodule, configured to determine whether there is an anomalous subcenter among the plurality of initial subcenters based on the similarity between the plurality of sample features and their respective initial subcenters, wherein the mean similarity between the sample features belonging to the anomalous subcenter and the anomalous subcenter is less than or equal to a second threshold; and a discarding submodule, configured to discard the anomalous subcenter and the sample features belonging to the anomalous subcenter when there is an anomalous subcenter among the plurality of initial subcenters, thereby obtaining the remaining initial subcenters and the sample features belonging to the remaining initial subcenters; wherein the target subcenter includes the remaining initial subcenters.
[0019] In one possible implementation, determining whether there is an anomalous sub-center among the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining whether the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to a second threshold; if the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to the second threshold, determining that the initial sub-center is an anomalous sub-center.
[0020] In one possible implementation, the adjustment module includes: a third determining submodule, configured to determine at least one group of subcenters to be merged from the plurality of initial subcenters based on the similarity between the plurality of sample features and their respective initial subcenters, each group of subcenters to be merged including at least two similar initial subcenters; and a merging submodule, configured to merge the at least one group of subcenters to be merged to obtain at least one merged subcenter, and adjust the sample features belonging to each group of subcenters to be merged to belong to each merged subcenter; wherein the target subcenter includes the merged subcenter.
[0021] In one possible implementation, determining at least one group of sub-centers to be merged from the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: determining a third threshold corresponding to each initial sub-center based on the mean and standard deviation of the similarity between each initial sub-center and the sample features belonging to each initial sub-center; for any initial sub-center, determining whether the similarity between the initial sub-center and other initial sub-centers among the plurality of initial sub-centers is greater than or equal to a fourth threshold, wherein the fourth threshold is the maximum value between the third threshold corresponding to the initial sub-center and the third threshold corresponding to the other initial sub-centers; if the similarity between the initial sub-center and the other initial sub-centers is greater than or equal to the maximum value, determining that the other initial sub-centers are similar to the initial sub-center; and determining the initial sub-center and at least one other initial sub-center similar to the initial sub-center as a group of sub-centers to be merged.
[0022] In one possible implementation, the training module includes: a loss determination submodule, configured to determine a sub-loss corresponding to each sample feature belonging to any target subclass center, based on the similarity between the sample feature and its corresponding target subclass center, and the similarity between the sample feature and other target subclass centers, wherein the other target subclass centers include target subclass centers among the multiple target subclass centers under the multiple category labels, excluding the target subclass center to which the sample feature belongs, and whose similarity to the sample feature is less than or equal to a fifth threshold; and a training submodule, configured to determine the network loss based on the sub-loss corresponding to each sample feature belonging to each target subclass center.
[0023] In one possible implementation, the determining module includes a subclass center determining submodule, used to calculate the similarity between any sample feature in the sample feature cluster and each initial subclass center, and determine the initial subclass center corresponding to the maximum similarity as the initial subclass center to which the sample feature belongs.
[0024] According to one aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method described above.
[0025] According to one aspect of this disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the above-described method.
[0026] In this embodiment, by initializing multiple initial subclass centers for sample feature clusters under the same category label and determining the initial subclass centers to which each sample feature in the sample feature cluster belongs, it is equivalent to initializing multiple subclasses for multiple sample features under the same category label to accommodate noise features that may exist under the same category label. Then, based on the similarity between multiple sample features and their respective initial subclass centers, the multiple initial subclass centers are adjusted so that at least one target subclass center under the same category label can more flexibly adapt to the actual distribution of sample features under that category label, that is, to ensure that the sample features under the same category label are... It can be assigned to a more accurate target subclass center, thereby alleviating label conflicts caused by various unconstrained noise features that may exist under different category labels; and by using the network loss determined by the target subclass center and the sample features belonging to the target subclass center to train the image recognition network, it is possible to improve the robustness of the trained image recognition network to unconstrained noisy images during the training process using sample image sets that may contain noisy images. Good training results and network performance can be obtained without a lot of parameter tuning, and the computational resource overhead and computation time overhead required for network training can be reduced, thereby improving network training efficiency.
[0027] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0029] Figure 1 A schematic diagram of a noise type according to an embodiment of the present disclosure is shown.
[0030] Figure 2 A flowchart illustrating a network training method according to an embodiment of the present disclosure is shown.
[0031] Figure 3A schematic diagram illustrating the adjustment of an initial subclass center according to an embodiment of the present disclosure is shown.
[0032] Figure 4 A block diagram of a network training apparatus according to an embodiment of the present disclosure is shown.
[0033] Figure 5 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. Detailed Implementation
[0034] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0035] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0036] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0037] It should be understood that the terms "first," "second," "third," and "fourth," etc., in the claims, specification, and drawings of this disclosure are used to distinguish different objects, rather than to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this disclosure indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.
[0038] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0039] In related technologies, the sample image set used to train the image recognition network usually contains sample images of multiple categories (i.e. identities), and each category corresponds to multiple sample images. For example, the sample image set contains face images of multiple people, and the same person has multiple face images taken from different angles (or at different times, etc.). The same person represents a category, or in other words, multiple face images of the same person have the same identity.
[0040] Understandably, multiple sample images of the same category will be labeled with the same category label. The category label represents the labeled category. Multiple sample images of the same category will cluster together in the feature space. The image recognition network can find the class center (or cluster center) for each category and accurately classify the sample images of the same category to the corresponding class center. During the training process, the network loss of the image recognition network can be determined by using the category labels of the sample images and the recognition results output by the image recognition network. The recognition results can be the probability of the sample image belonging to each category. Then, the network parameters of the image recognition network can be adjusted based on the network loss to achieve the training of the image recognition network.
[0041] However, as mentioned above, since the recognition performance of image recognition networks largely depends on the collection of a large number of sample images, the ever-growing sample image set inevitably introduces unconstrained noisy images (i.e., mislabeled sample images). For example, labeling facial images of different people as the same category will reduce the performance and efficiency of network training due to the presence of noisy sample images. Furthermore, the training process of cleaning up noisy data through recursive clustering and other methods in related technologies suffers from high computational complexity, large accumulated errors, and significant computational resource and time overhead. In some implementations, multiple sub-centers can be designed for each category to mitigate the impact of intra-class noise (different identities with the same label) and inter-class noise (identical identities with different labels) on network training. However, this approach is still susceptible to the influence of unconstrained noisy images in real-world scenarios.
[0042] To address the aforementioned issues, this disclosure proposes a network training method in which the types of noise that may exist in real-world scenarios can be expressed in a more granular manner as: N - number of identities |K C- Cluster number, where N represents the number of real identities under each category label, K represents the number of meaningful clusters under each category label, and if there is only one sample image under a category, that sample image under that category can be considered a meaningless anomalous noise image instead of a meaningful cluster. That is, a meaningful cluster includes at least two sample images. C represents the number of sub-centers in other classes that have the same identity as a sub-center in the current class. For example, if multiple face images of the same person are labeled into two different categories (that is, the face images of the same person are divided into two sub-centers), then C is 1. If they are labeled into three different categories, then C is 2, and so on. By adjusting the values of N, K, and C, different noise types of noise images can be generated under the same category label. This shows that the network training process needs to flexibly adapt to different combinations of N, K, and C, that is, adapt to various noise types in real-world scenarios.
[0043] Figure 1 A schematic diagram illustrating a noise type according to an embodiment of the present disclosure is shown, such as Figure 1 As shown, different values of N, K, and C can lead to intra-class conflicts of different noise types; if N = K = 1, this is a clean class without noise, meaning there is a cluster of identities in this class, such as... Figure 1 As shown, the clean class includes multiple face images of the same person; if N = K > 1, this class is a noisy class containing multiple clusters of multiple identities, such as... Figure 1 As shown, this noise class includes multiple face images of two people; if N>K>1, this class is a noise class containing abnormal noise images, that is, a noise class with more identities than the cluster size, such as... Figure 1 As shown, this class contains 8 face images, 4 of which are of the same person, and the remaining 4 belong to 4 different people. These 4 face images belonging to 4 different people are considered anomalous noise images. If C > 0, it means that sample images with the same identity are divided into multiple subclass centers, such as... Figure 1 As shown, the facial images of the same person are divided into multiple subclass centers.
[0044] For example, suppose that M initial sub-centers are introduced for a certain category label. If the number of initial sub-centers M under the category label is less than the number of meaningful clusters K under the category label, that is, the actual number of identities in the sample feature clusters under the category label is greater than the number of initial sub-centers, M = K can be achieved by adding new initial sub-centers. If the actual number of identities N under the category label is greater than the number of meaningful clusters K, that is, there are abnormal noise images under the category label, then the initial sub-center and the abnormal noise images belonging to the initial sub-center can be discarded. If sample images with the same identity are divided into multiple initial sub-centers, that is, C > 0, the initial sub-centers with the same identity will be merged into the same initial sub-center to enhance intra-class compactness and alleviate inter-class conflicts.
[0045] It should be understood that, theoretically, sample images labeled with the same category should have one identity. Multiple sample images with the same identity should be clustered together, and each cluster should have a class center that represents the identity category of the sample images within that cluster. If multiple sample images labeled with the same category actually have multiple identities, but there is no corresponding subclass center to accommodate different identities, such noisy images will cause intra-class conflicts in network training. If multiple initial subclass centers are introduced for each class and the number of subclass centers is greater than the actual number of identities in that class, then the additional subclass centers will also cause inter-class conflicts in network training. Both intra-class and inter-class conflicts will produce incorrect network losses, which will greatly weaken the image recognition network's learning effect on feature representation, resulting in poor robustness and low recognition accuracy of the trained image recognition network.
[0046] This disclosure proposes a network training method, termed the evolutionary subcenter learning method, to address the aforementioned problems caused by unconstrained noise types (N, K, and C) in real-world scenarios. By initializing multiple initial subcenters for each category, sample images labeled as belonging to the same category but actually having multiple identities can be divided into different initial subcenters, thus accommodating multiple identities with multiple initial subcenters. This alleviates intra-class conflicts. Further adjustments, such as subcenter generation, merging, and discarding, flexibly adjust the initial subcenters to obtain the target subcenter for each category. This target subcenter is automatically aligned with the actual number of identities and clusters within that category. Consequently, sample images belonging to the same identity can effectively converge to the same target subcenter, while sample images with different identities are separated, mitigating inter-class conflicts. The network training method proposed in this disclosure can flexibly adapt to different combinations of N, K, and C, thus more robustly adapting to various unconstrained noise types and significantly improving network training performance.
[0047] Figure 2A flowchart illustrating a network training method according to an embodiment of this disclosure is provided. The network training method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. The method can be implemented by a processor calling computer-readable instructions stored in memory, or it can be executed by a server. Figure 2 As shown, the network training method includes:
[0048] In step S11, an image recognition network is used to extract features from multiple sample images labeled with the same category in the sample image set to obtain sample feature clusters under the same category label. The sample image set includes sample images labeled with multiple categories.
[0049] It is known that image recognition networks, in order to identify the category of objects in an image, typically pre-define multiple categories and calculate the predicted probability of the image belonging to each category, and then determine the target category corresponding to the image based on the probability. In one possible implementation, the image recognition network includes at least a feature extraction layer and a softmax layer. The feature extraction layer is used to extract image features of the image to be recognized, and the softmax layer is used to calculate the probability of the image features belonging to each identity category. Specifically, the probability of the image features belonging to each identity category can be calculated based on the similarity (e.g., cosine similarity) between the image features and the class center features corresponding to each identity category. Then, the identity category corresponding to the highest probability can be determined as the identity category of the object in the image to be recognized. It should be understood that the embodiments of this disclosure do not limit the network structure and network type of the image recognition network. For example, fully connected layers, pooling layers, etc., may be included before the softmax layer, and the embodiments of this disclosure do not impose any limitations on this.
[0050] In this context, a sample feature cluster under the same category label can be understood as a set composed of multiple sample features from multiple sample images under the same category label. It should be understood that an image recognition network can extract features from multiple sample images with multiple category labels to obtain sample feature clusters under multiple category labels. This disclosure does not limit the feature extraction process of the image recognition network.
[0051] In step S12, multiple initial subclass centers are initialized for the sample feature cluster, and the initial subclass centers to which each of the multiple sample features in the sample feature cluster belongs are determined.
[0052] As mentioned above, the sample image set includes sample images with multiple category labels. Users can specify the number of initial sub-centers initialized by the image recognition network through hyperparameters. For example, assuming there are 100 categories of sample images and each category generates 3 initial sub-centers, the image recognition network can randomly generate 300 initial sub-centers, that is, each category label will correspond to 3 initial sub-centers initialized.
[0053] The initial subclass centers can be represented as vectors, matrices, or other equivalently transformable forms. It's understood that the initial subclass centers can be randomly generated by the image recognition network, and can be considered as learnable parameters within the network. By initializing multiple initial subclass centers for sample feature clusters, the initial subclass centers belonging to each sample feature within a cluster can be determined, effectively achieving preliminary classification and recognition. Subsequently, the initial subclass centers can be adjusted to flexibly adapt to sample distributions under different noise types, achieving more accurate classification and recognition.
[0054] In one possible implementation, determining the initial subclass center to which each of multiple sample features in a sample feature cluster belongs can include: for any sample feature in the sample feature cluster, calculating the similarity between that sample feature and each initial subclass center, and determining the initial subclass center corresponding to the highest similarity as the initial subclass center to which that sample feature belongs. This method can be understood as finding the initial subclass center with the highest similarity (i.e., the closest distance) to each sample feature by calculating the similarity between each sample feature and each initial subclass center, and determining the initial subclass center with the closest distance to each sample feature as the initial subclass center to which that sample feature belongs. This method can effectively determine the initial subclass center to which each sample feature belongs.
[0055] The similarity calculation methods known in the art, such as cosine similarity and Euclidean distance, can be used to calculate the similarity between sample features and each initial subclass center. This disclosure does not limit the scope of the embodiments. It should be understood that similarity can also be interpreted as distance. A higher similarity between a sample feature and an initial subclass center indicates a closer distance between them, meaning the sample feature is more likely to belong to the category represented by the initial subclass center. Conversely, a lower similarity indicates a greater distance, meaning the sample feature is less likely to belong to the category represented by the initial subclass center.
[0056] In step S13, the multiple initial sub-centers are adjusted based on the similarity between the multiple sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label.
[0057] As mentioned above, since noisy images in the sample image set may have various noise types, the multiple initial sub-centers initialized using step S13 may not be suitable for the noise types of the current sample image set. In order to flexibly adapt to different noise types, the initial sub-centers can be adjusted again. Specifically, the initial sub-centers under each category label can be flexibly adjusted through sub-center generation, sub-center merging, and sub-center discarding operations to obtain the target sub-centers under each category label.
[0058] Figure 3 This diagram illustrates an adjustment of an initial subclass center according to an embodiment of the present disclosure, such as... Figure 3 As shown, assuming the current batch of sample images contains sample images of three categories (i.e., sample images labeled with three categories), three initial sub-centers are first introduced for each category. Figure 3 The solid circle in the middle represents the initial subclass center. Then, the initial subclass centers under the three categories are adjusted by subclass center generation, subclass center merging, and subclass center discarding respectively, to obtain 4 target subclass centers under the first category, 2 target subclass centers under the second category, and 1 target subclass center under the third category. That is, adaptively aligning the actual sample distribution in the latent space (i.e., feature space). Then, the training objective is to push the sample features of the sample image in the latent space toward the target subclass center of its own, ignore other target subclass centers that are close to the sample features (i.e., have high similarity), and stay away from other target subclass centers that are far from the sample features (i.e., have low similarity). The image recognition network is trained so as to effectively handle label conflicts (including intra-class conflicts and inter-class conflicts) caused by fine-grained noisy images.
[0059] In one possible implementation, adjusting multiple initial sub-centers based on the similarity between multiple sample features and their respective initial sub-centers to obtain at least one target sub-center under the same category label may include: determining whether there are sample features far from their respective initial sub-centers in the sub-sample feature clusters corresponding to each initial sub-center, whether there are initial sub-centers among multiple initial sub-centers where all sample features belonging to the same initial sub-center are far from that initial sub-center, and whether there are at least two initial sub-centers that are close to each other;
[0060] If there are sample features that are far from their respective initial subclass centers, that is, if the actual number of identities in the sample feature cluster under the same category label is greater than the number of initial subclass centers, then a new initial subclass center is generated for the sample features that are far from their respective initial subclass centers to accommodate the sample features under the actual number of identities. If there are initial subclass centers whose sample features belonging to the same initial subclass center are all far from that initial subclass center, then that initial subclass center and the sample features belonging to that initial subclass center are discarded. That is, if the distance between the sample features belonging to a certain initial subclass center and that initial subclass center is large, then that initial subclass center is considered a meaningless anomalous subclass center, and that anomalous subclass center and the sample features belonging to that anomalous subclass center are discarded. If there are at least two initial subclass centers that are close in distance, then at least two initial subclass centers that are close in distance can be merged. That is, if at least two initial subclass centers are very close in distance, it means that at least two initial subclass centers are likely to have the same identity, and at least two sample features that are close in distance can be assigned to the same category by merging.
[0061] It should be understood that the adjusted target subclass center may include at least one of the initial subclass centers initialized in step S12, the newly generated initial subclass centers in step S13, and the merged initial subclass centers, such as... Figure 3 As shown, after adjusting multiple initial sub-centers under each category label, at least one target sub-center can be obtained under each category label.
[0062] Considering that the initial subclass centers generated by the image recognition network in the early stages of training may be too random or significantly different from reality, the image recognition network can be pre-trained for several rounds. During these rounds, step S13 is not executed, and the network loss is directly determined using the initial subclass centers obtained in step S12 and the sample features belonging to each initial subclass center. In the field of image recognition networks, epochs are typically used to identify the number of training rounds; therefore, step S13 can be started when the epoch exceeds a specified number of rounds.
[0063] In step S14, the network loss is determined based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, and the network loss is used to train the image recognition network.
[0064] It should be understood that through steps S11 to S13, multiple target sub-centers under various category labels and sample features belonging to each target sub-center can be obtained, which is equivalent to obtaining the predicted classification of each sample image output by the image recognition network. Since the sample images are labeled with category labels, the network loss can be determined by using the similarity between the sample features of the sample image and the target sub-centers under the corresponding category label of the sample image, as well as the similarity between the sample features of the sample image and other target sub-centers under other category labels.
[0065] In one possible implementation, the network loss is determined based on multiple target sub-centers under various category labels and the sample features belonging to each target sub-center. This includes: for any sample feature belonging to any target sub-center, calculating the similarity between the sample feature and its corresponding target sub-center, and the similarity between the sample feature and other target sub-centers; then determining the sub-loss corresponding to the sample feature based on the similarity between the sample feature and its corresponding target sub-center, and the similarity between the sample feature and other target sub-centers; and finally summing the sub-losses corresponding to each sample feature belonging to each target sub-center to obtain the network loss.
[0066] In this process, similarity calculation methods known in the art, such as cosine similarity, can be used to calculate the similarity between sample features and the center of the target subclass to which they belong, as well as the similarity between sample features and the centers of other target subclasses. This disclosure does not limit the scope of the embodiments.
[0067] Those skilled in the art can use loss functions known in the field of image recognition, such as the softmax loss function and the L-softmax loss function, to determine the sub-loss corresponding to a sample feature based on the similarity between the sample feature and the center of the target subclass to which it belongs, as well as the similarity between the sample feature and the centers of other target subclasses. This disclosure does not limit this aspect.
[0068] Considering that in real-world scenarios, there may be noisy images with the same identity labeled with different category tags, there may be other target sub-centers among the aforementioned target sub-centers that have the same identity as the current sample features. If the sample features are made to be far away from all other target sub-centers when determining the network loss, it may cause the sample features to be far away from other target sub-centers with the same identity, which is obviously unreasonable in network training. Therefore, when determining the network loss, other target sub-centers with high similarity to the current sample features can be ignored.
[0069] Based on this, in one possible implementation, the network loss is determined according to the target sub-centers under multiple category labels and the sample features belonging to each target sub-center. This includes: for each sample feature belonging to any target sub-center, determining the sub-loss corresponding to the sample feature based on the similarity between the sample feature and its corresponding target sub-center, and the similarity between the sample feature and other target sub-centers. Other target sub-centers include target sub-centers among multiple target sub-centers under multiple category labels that are other than the target sub-center to which the sample feature belongs and whose similarity to the sample feature is less than or equal to a fifth threshold; and determining the network loss based on the sub-loss corresponding to each sample feature belonging to each target sub-center. In this way, when determining the network loss, sample features are pushed towards their corresponding target sub-centers, ignoring other target sub-centers with high similarity to the current sample feature and moving away from other target sub-centers with low similarity to the current sample feature. This effectively handles label conflicts (including intra-class and inter-class conflicts) caused by fine-grained noisy images, achieving better training results and enabling the network recognition network to better learn effective feature representations.
[0070] Among these, "other target sub-centers" includes target sub-centers from multiple target sub-centers under various category labels that are not included in the target sub-centers of the sample feature and whose similarity to the sample feature is less than or equal to the fifth threshold. This can be understood as follows: when calculating the sub-loss corresponding to a sample feature, target sub-centers with a similarity greater than the fifth threshold are ignored. In other words, "other target sub-centers" includes target sub-centers with a similarity less than or equal to the fifth threshold. It can be understood that if the similarity between a sample feature and another target sub-center is greater than the fifth threshold, it can be considered that the similarity between the sample feature and that other target sub-center is high (i.e., the closer the distance), and that other target sub-center can be ignored. Conversely, if the similarity between a sample feature and another target sub-center is less than or equal to the fifth threshold, it can be considered that the similarity between the sample feature and that other target sub-center is low (i.e., the farther the distance), and that other target sub-center can be retained.
[0071] It should be understood that the other target sub-centers whose similarity to the sample feature is less than or equal to the fifth threshold may actually have the same identity as the sample feature or they may have different identities. For example, two faces that look similar. In order to avoid the sample feature from being far away from other target sub-centers with the same identity, other target sub-centers whose similarity to the sample feature is less than or equal to the fifth threshold can be directly ignored.
[0072] In one possible implementation, the fifth threshold can be determined based on the mean and standard deviation of the similarity between each other target sub-center and the sample features belonging to that other target sub-center; that is, each other target sub-center corresponds to its own fifth threshold. For example, the fifth threshold can be the weighted sum of the mean and standard deviation, and can be expressed as: Where j represents the j-th category, m j Represents the m-th element under the j-th category. j Other target subclass centers Represents the mth j The fifth threshold corresponding to the center of each other target subclass. Represents the mth j Other target subclass centers and those belonging to the m-th subclass j The mean similarity between sample features of other target subclass centers, Represents the mth j Other target subclass centers and those belonging to the m-th subclass j The standard deviation of the similarity between sample features of other target subclass centers, λ1 is a preset weight, and the specific value of λ1 is not limited in the embodiments of this disclosure.
[0073] Based on the aforementioned fifth threshold, in one possible implementation, the loss function shown in formula (1) can be used to determine the sub-loss corresponding to each sample feature:
[0074]
[0075] Where, x i L(x) represents the feature of the i-th sample. i ) represents the sub-loss of the i-th sample feature, y represents the class label corresponding to the i-th sample feature, and m represents the sample feature x. i The target subclass center corresponding to the category label y, where e represents the natural constant. Representative sample feature x i The similarity between the target subclass center m and its corresponding center. Representative sample feature x i With the mth label under the jth category j The similarity between the centers of the other target subclasses, J represents the total number of classes in the sample image set (i.e., the total number of labeled class labels), M j This represents the total number of target subclass centers under the j-th category. Representative sample feature x i With the mth label under the jth category j The angle between the centers of other target subclasses Representative sample feature x iWith the mth label under the jth category j Cosine similarity between the centers of other target subclasses Used to filter out samples with feature x i Other target subclass centers whose similarity to the fifth threshold is greater than the fifth threshold, where, hour, If it returns 1, then The result is 0, meaning that features related to the sample x are ignored during the summation. i The centers of other target subclasses whose similarity to the fifth threshold is greater than the fifth threshold when hour, If it returns 0, then The result is 1, meaning that the summation retains the value associated with the sample feature x. i The centers of other target subclasses whose similarity is less than or equal to the fifth threshold
[0076] The training objective of the above formula (1) is to obtain the desired sample feature x. i The smaller the corresponding sub-loss, the higher the expected value. The larger the value, the greater the expected value of the sample feature x. i The greater the cosine similarity between the sample feature x and the center of its target subclass, the greater the similarity. i Push towards the sample feature x i The target subclass center, and also expect The smaller the value, the better the expected sample feature x. i The smaller the cosine similarity with the centers of other target subclasses, the less effective the sample feature x becomes. i Move away from other target subclass centers and ignore samples with similar features x. i Other target subclass centers with high similarity.
[0077] It should be understood that the above formula (1) is an implementation method provided by this disclosure. As mentioned above, those skilled in the art can use loss functions known in the art to determine the sub-loss corresponding to the sample feature based on the similarity between the sample feature and the target sub-center to which it belongs, and the similarity between the sample feature and other target sub-centers. This disclosure does not limit this aspect.
[0078] The determination of network loss based on the sub-loss corresponding to each sample feature belonging to each target sub-center may include summing (or averaging) the sub-loss corresponding to each sample feature belonging to each target sub-center to obtain the network loss. This disclosure does not limit the scope of the embodiments.
[0079] In one possible implementation, training the image recognition network using network loss may include: adjusting the network parameters of the image recognition network using backpropagation with network loss. It should be understood that the training process of steps S11 to S14 above may iterate for multiple rounds until the network loss meets preset conditions, such as loss convergence, the number of iteration rounds reaching a preset number of rounds, etc., and this disclosure does not limit this.
[0080] In this embodiment, by initializing multiple initial subclass centers for sample feature clusters under the same category label and determining the initial subclass centers to which each sample feature in the sample feature cluster belongs, it is equivalent to initializing multiple subclasses for multiple sample features under the same category label to accommodate noise features that may exist under the same category label. Then, based on the similarity between multiple sample features and their respective initial subclass centers, the multiple initial subclass centers are adjusted so that at least one target subclass center under the same category label can more flexibly adapt to the actual distribution of sample features under that category label, that is, to ensure that the sample features under the same category label are... It can be assigned to a more accurate target subclass center, thereby alleviating label conflicts caused by various unconstrained noise features that may exist under different category labels; and by using the network loss determined by the target subclass center and the sample features belonging to the target subclass center to train the image recognition network, it is possible to improve the robustness of the trained image recognition network to unconstrained noisy images during the training process using sample image sets that may contain noisy images. Good training results and network performance can be obtained without a lot of parameter tuning, and the computational resource overhead and computation time overhead required for network training can be reduced, thereby improving network training efficiency.
[0081] As described above, during the adjustment of multiple initial sub-centers, if the actual number of identities in the sample feature clusters under the same category label is greater than the number of initial sub-centers (e.g., if there are 3 initial sub-centers, but the sample feature clusters under the same category label actually contain sample features representing 4 identities), then new initial sub-centers can be generated to accommodate identities other than those represented by the initialized initial sub-centers. In one possible implementation, in step S13, based on the similarity between multiple sample features and their respective initial sub-centers, the multiple initial sub-centers are adjusted to obtain at least one target sub-center under the same category label, including:
[0082] Step S131: Based on the similarity between multiple sample features and their respective initial subclass centers, determine whether there are outlier features among the multiple sample features, wherein the similarity between the outlier features and their respective initial subclass centers is less than a first threshold.
[0083] Step S132: When outlier features exist among multiple sample features, add new initial sub-centers based on the outlier features, and adjust the outlier features to belong to the newly added initial sub-centers; wherein, the target sub-centers include the newly added initial sub-centers and multiple initialized initial sub-centers.
[0084] In step S131, if the similarity between an outlier feature and its corresponding initial subclass center is less than a first threshold, it indicates that the outlier feature is a sample feature far removed from its initial subclass center, or in other words, the distance between the outlier feature and its initial subclass center is relatively large. In one possible implementation, the first threshold can be determined based on the mean and standard deviation of the similarity between the initial subclass center and the sample features belonging to that initial subclass center; that is, each initial subclass center corresponds to its own first threshold. The first threshold determined in this way facilitates more accurate screening of outlier features later.
[0085] In one possible implementation, in step S131, determining whether outlier features exist among the multiple sample features based on their similarity to their respective initial sub-centers includes: for any initial sub-center, determining a first threshold corresponding to the initial sub-center based on the mean and standard deviation of the similarity between the initial sub-center and the sample features belonging to the initial sub-center; determining whether there are sample features among the sample features belonging to the initial sub-center whose similarity to the initial sub-center is less than the first threshold; and identifying the sample features whose similarity to the initial sub-center is less than the first threshold as outlier features far from the initial sub-center. This method can accurately filter out outlier features in each initial sub-center.
[0086] Specifically, a first threshold corresponding to the initial sub-center is determined based on the mean and standard deviation of the similarity between the initial sub-center and the features of samples belonging to the initial sub-center. For example, this could include determining the first threshold corresponding to any initial sub-center as the weighted difference between the mean and standard deviation of the features corresponding to that initial sub-center. The first threshold can be expressed as: D1 = μ n -λ2σ n , where μ n σ represents the mean similarity between the features of the nth initial subclass center and multiple samples belonging to that nth initial subclass center. n λ2 represents the standard deviation of the similarity between the nth initial subclass center and multiple sample features belonging to the nth initial subclass center, and λ2 is a preset weight. In this embodiment of the disclosure, the specific value of λ2 is not limited.
[0087] Understandably, if the similarity between a sample feature and the initial subclass center is less than the first threshold, it is considered that the sample feature is actually a noise feature with a different identity from its initial subclass center, that is, an outlier feature that is far away from its initial subclass center. Therefore, outliers that are far away from each initial subclass center can be identified as a cluster of sample features, which is equivalent to splitting out the outliers from each initial subclass center and generating new initial subclass centers for the outliers to alleviate intraclass conflicts.
[0088] Understandably, step S131 may identify at least one outlier feature. If an outlier feature is identified in step S131, it can be discarded directly, meaning no new initial sub-center is added; alternatively, in step S132, the outlier feature can be directly identified as a new initial sub-center. If at least two outlier features are identified in step S131, in step S132, the average or weighted average of the at least two outlier features can be identified as a new initial sub-center.
[0089] In one possible implementation, outlier features in each initial subclass center can be selected using formula (2), and new initial subclass centers can be added for the outlier features:
[0090]
[0091] Where, x i Let I represent the i-th sample feature, and let I represent the total number of sample features in the sample feature cluster. Representative sample feature x i With the initial subclass center n i The angle between them Representative sample feature x i With the initial subclass center n i Cosine similarity between them Used to filter out outlier features from each initial sub-center, where, when That is, when the cosine similarity is less than the first threshold, Return 1, x i This is then identified as an outlier characteristic. This represents the sum of all outlier features whose cosine similarity is less than the first threshold. This represents the total number of outlier features whose cosine similarity is less than the first threshold. Formula (2) above can be understood as... The mean of multiple outlier features is used as the initial subclass center for the new addition.
[0092] It is understandable that the multiple initial subclass centers generated during initialization usually each have a unique subclass number, so as to distinguish different initial subclass centers under different category labels. In the initial subclass center to which each sample feature belongs in the sample feature cluster determined in step S12 above, each sample feature can be associated with its respective initial subclass center based on the subclass number. Therefore, after adding a new initial subclass center, a unique subclass code can be set for the new initial subclass center. Among them, adjusting outlier features to belong to the new initial subclass center can be done by adjusting the outlier features to be associated with the subclass number of the new initial subclass center.
[0093] In this embodiment of the disclosure, by filtering out the outlier features that are far from the initial subclass center among the multiple sample features based on the similarity between the multiple sample features and their respective initial subclass centers, and adding a new initial subclass center for the outlier features, it is possible to accommodate other identities besides the identity represented by the initial subclass center generated during initialization, alleviate intraclass conflicts caused by intraclass noise, and thus improve the learning effect of the image recognition network on feature representation.
[0094] As described above, during the adjustment of initial subclass centers, if the distance between the sample features belonging to a certain initial subclass center and that initial subclass center is large, the initial subclass center is considered a meaningless anomalous subclass center, and thus the anomalous subclass center and the sample features belonging to that anomalous subclass center are discarded. In one possible implementation, in step S13, multiple initial subclass centers are adjusted based on the similarity between multiple sample features and their respective initial subclass centers to obtain at least one target subclass center under the same category label, including:
[0095] Step S133: Based on the similarity between multiple sample features and their respective initial sub-centers, determine whether there are abnormal sub-centers among the multiple initial sub-centers, wherein the average similarity between the sample features under the abnormal sub-center and the abnormal sub-center is less than or equal to the second threshold.
[0096] Step S134: If there are abnormal sub-centers among the multiple initial sub-centers, discard the abnormal sub-centers and the sample features belonging to the abnormal sub-centers to obtain the remaining initial sub-centers and the sample features belonging to the remaining initial sub-centers; wherein, the target sub-centers include the remaining initial sub-centers.
[0097] Understandably, if steps S131 to S132 have been executed before step S132, meaning that subclass center generation may have occurred before subclass center discarding, then the multiple initial subclass centers in step S133 may include the initial subclass centers added in steps S131 to S132 and the multiple initial subclass centers initialized in step S12. Since the initial subclass centers added in steps S131 to S132 are determined based on outlier characteristics, abnormal subclass centers are highly likely to originate from the initial subclass centers added in steps S131 to S132. Conversely, if steps S131 to S132 have not been executed before step S133, meaning that subclass center generation has not occurred, then the multiple initial subclass centers in step S133 may include the multiple initial subclass centers initialized in step S12.
[0098] In one possible implementation, in step S133, determining whether there are anomalous sub-centers among the multiple initial sub-centers based on the similarity between multiple sample features and their respective initial sub-centers includes: for any initial sub-center, determining whether the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to a second threshold; if the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to the second threshold, determining the initial sub-center as an anomalous sub-center. This method can effectively identify meaningless anomalous sub-centers.
[0099] The second threshold can be set by customization, and the specific value of the second threshold is not limited in this embodiment. Understandably, the mean similarity between the initial subclass center and the sample features belonging to the initial subclass center can characterize the distribution density of the similarity between the initial subclass center and the sample features belonging to the initial subclass center. Usually, multiple sample features with the same identity will be concentrated in the feature space. If the mean similarity between the sample features under a certain initial subclass center and the initial subclass center is less than or equal to the second threshold, it is considered that the distribution between the initial subclass center and the sample features belonging to the initial subclass center is relatively scattered (i.e., not concentrated enough), or that the sample features under the initial subclass center may be few and scattered, that is, the sample features under the initial subclass center are far away from the initial subclass center. The sample features under such abnormal subclass centers may each have different identities, or the sample images corresponding to the sample features may be blurry, making it impossible for the sample features to be accurately classified to the matching initial subclass center. Therefore, initial subclass centers with a mean similarity between the initial subclass center and the sample features belonging to the initial subclass center that is less than or equal to the second threshold can be identified as meaningless abnormal subclass centers.
[0100] In step S134, abnormal sub-centers and sample features belonging to abnormal sub-centers are discarded; that is, the network loss is calculated without using the sample features belonging to abnormal sub-centers. The remaining initial sub-centers are the initial sub-centers other than the abnormal sub-centers among the multiple initial sub-centers mentioned above.
[0101] In this embodiment of the disclosure, by determining abnormal sub-centers among the multiple initial sub-centers based on the similarity between multiple sample features and their respective initial sub-centers, and discarding abnormal sub-centers and sample features belonging to abnormal sub-centers, meaningless abnormal noise features in the sample features can be ignored, alleviating intra-class conflicts caused by intra-class noise, thereby improving the learning effect of the image recognition network on feature representation.
[0102] As mentioned above, during training, if at least two initial sub-centers are very close, it means that these two initial sub-centers are likely to have the same identity. Therefore, at least two sample features that are close in distance can be assigned to the same category through merging, thus alleviating the inter-class conflicts caused by the additional initial sub-centers introduced into the network training. In one possible implementation, in step S13, based on the similarity between multiple sample features and their respective initial sub-centers, at least one set of sub-centers to be merged from the multiple initial sub-centers is determined, including:
[0103] Step S135: Based on the similarity between multiple sample features and their respective initial sub-centers, determine at least one group of sub-centers to be merged from the multiple initial sub-centers, and each group of sub-centers to be merged includes at least two similar initial sub-centers;
[0104] Step S136: Merge at least one group of sub-centers to be merged to obtain at least one merged sub-center, and adjust the sample features belonging to each group of sub-centers to be merged to belong to each merged sub-center; wherein, the target sub-center includes the merged sub-center.
[0105] It is understandable that before executing step S135, steps S131 to S132, or steps S133 to S134, may have already been executed, or steps S131 to S132 and steps S133 to S134 may have already been executed. That is to say, before executing the subclass center merging, at least one of subclass center generation and subclass center discard may have been executed. Therefore, the multiple initial subclass centers in step S135 may include at least one of the multiple initial subclass centers initialized in step S12, the initial subclass centers added in steps S131 to S132, and the remaining initial subclass centers in steps S133 to S134.
[0106] If at least two initial sub-centers are similar (i.e., close in distance), they can be considered to be highly likely to belong to the same identity, and therefore, at least two similar initial sub-centers can be merged. It should be understood that each category label may actually contain sample images of one or more identities, and sample images of the same identity may be labeled with different category labels. Therefore, multiple initial sub-centers may include at least one set of sub-centers to be merged. Each set of sub-centers to be merged may include initial sub-centers under the current category label, or initial sub-centers under other category labels.
[0107] In one possible implementation, in step S135, the similarity between any two initial sub-centers among a plurality of initial sub-centers can be calculated. Two initial sub-centers with a similarity greater than a fourth threshold are identified as similar initial sub-centers. This allows at least two similar initial sub-centers to be identified as a group of sub-centers to be merged. For example, suppose there are four initial sub-centers "W1, W2, W3, W4", where the similarity between W1 and W2, W2 and W3, and W1 and W3 are all greater than the fourth threshold. Then, W1, W2, and W3 can be identified as a group of sub-centers to be merged. This embodiment of the present disclosure does not limit the specific value of the fourth threshold.
[0108] In one possible implementation, in step S135, determining at least one group of sub-centers to be merged from multiple initial sub-centers based on the similarity between multiple sample features and their respective initial sub-centers includes: determining a third threshold corresponding to each initial sub-center based on the mean and standard deviation of the similarity between each initial sub-center and the sample features belonging to each initial sub-center; for any initial sub-center, determining whether the similarity between the initial sub-center and other initial sub-centers is greater than or equal to a fourth threshold, where the fourth threshold is the maximum value between the third threshold corresponding to the initial sub-center and the third threshold corresponding to other initial sub-centers; if the similarity between the initial sub-center and other initial sub-centers is greater than or equal to the maximum value, determining that other initial sub-centers are similar to the initial sub-center; and determining the initial sub-center and at least one other initial sub-center similar to the initial sub-center as a group of sub-centers to be merged. This method can effectively determine at least one group of sub-centers to be merged.
[0109] Specifically, a third threshold is determined for each initial sub-center based on the mean and standard deviation of the similarity between the features of each initial sub-center and the features of samples belonging to that initial sub-center. For example, this could include using the weighted sum of the mean and standard deviation of each initial sub-center as the third threshold. The third threshold can be expressed as: D3 = μ n +λ3σ n , where μ n σ represents the mean similarity between the features of the nth initial subclass center and multiple samples belonging to that nth initial subclass center. n λ3 represents the standard deviation of the similarity between the nth initial subclass center and multiple sample features belonging to the nth initial subclass center, and λ3 is a preset weight. In this embodiment, the specific value of λ3 is not limited.
[0110] Specifically, for any initial sub-center, it is determined whether the similarity between the initial sub-center and other initial sub-centers is greater than or equal to a fourth threshold. The fourth threshold is the maximum value between the third threshold corresponding to the initial sub-center and the third threshold corresponding to other initial sub-centers. This can be understood as determining whether an initial sub-center is close to other initial sub-centers, or whether an initial sub-center is within the feature distribution range corresponding to other initial sub-centers. If the similarity between the initial sub-center and another initial sub-center is greater than or equal to the fourth threshold, then it is considered that the initial sub-center and the other initial sub-center are close to each other, or that the initial sub-center is within the feature distribution range corresponding to the other initial sub-center. Therefore, it is considered that the initial sub-center and the other initial sub-center are likely to have the same identity.
[0111] Calculating the similarity between the initial sub-center and other initial sub-centers can, for example, include: first standardizing the initial sub-center and other initial sub-centers separately (e.g., L1 standardization or L2 standardization); then calculating the similarity between the standardized initial sub-center and other standardized sub-centers. It should be understood that this disclosure does not limit the method of similarity calculation.
[0112] Among them, other initial subclass centers include the initial subclass centers other than the currently targeted initial subclass center. It should be understood that for any initial subclass center, at least one other initial subclass center similar to that initial subclass center can be determined by the above pairwise comparison method. Based on the above third threshold D3, the determination of at least one initial subclass center that is close to the initial subclass center can be expressed as formula (3):
[0113]
[0114] Among them, W n W represents the center of the nth initial subclass. t Represents the center of the t-th other initial subclass. μ represents the similarity between the nth initial subclass center and the tth other initial subclass center. n +λ3σ n μ represents the third threshold corresponding to the center of the nth initial subclass. t +λ3σ t The third threshold representing the center of the t-th other initial subclass should be understood as μ t +λ3σ t With the above μ n +λ3σ n The calculation process is the same; max(μ) n +λ3σ n ,μ t +λ3σ t ) represents the maximum value among the third threshold corresponding to the initial subclass center and the third threshold corresponding to other initial subclass centers. When, that is, when the similarity between the initial subclass center and other initial subclass centers is greater than or equal to the above maximum value, If 1 is returned, then V(W) n W t ) represents W t Is with W n Similar to other initial subclass centers; then, V(W) can be made n W t All W ) = 1 t With W n These are identified as a group of subclass centers to be merged.
[0115] In one possible implementation, in step S136, at least one group of sub-centers to be merged is merged to obtain at least one merged sub-center. This includes: for any group of sub-centers to be merged, determining the average value of at least two initial sub-centers included in that group as the merged sub-center after merging that group of sub-centers. This method effectively determines the merged sub-center of the group of sub-centers to be merged.
[0116] As described above, the multiple initial sub-centers generated during initialization typically each have a unique sub-center number to facilitate the differentiation of different initial sub-centers under different category labels. Furthermore, in step S12, which determines the initial sub-centers to which each sample feature belongs within a sample feature cluster, each sample feature can be associated with its respective initial sub-center based on its sub-center number. In one possible implementation, the sub-center number of any initial sub-center in each group of sub-centers to be merged can be determined as the sub-center number corresponding to each merged sub-center after merging the groups of sub-centers. For example, the smallest sub-center number in each group of sub-centers to be merged can be determined as the sub-center number of each merged sub-center after merging the groups of sub-centers. This embodiment of the present disclosure does not limit this approach.
[0117] Based on this, the sample features belonging to each group of sub-centers to be merged are adjusted to belong to each merged sub-center after the merger. This can be understood as adjusting the sample features belonging to each group of sub-centers to be merged to associate them with the sub-center numbers of each merged sub-center after the merger of each group of sub-centers to be merged.
[0118] In this embodiment of the disclosure, initial subclass centers belonging to the same identity can be merged to alleviate interclass conflicts caused by interclass noise, improve the compactness of sample features under the same identity, and thus improve the learning effect of the image recognition network on feature representation, which is conducive to improving the robustness and recognition accuracy of the trained image recognition network.
[0119] The network training method according to the embodiments of this disclosure can flexibly adapt to network training under various noise types, for example, based on the above-mentioned N-identity number |K C - The expression of the noise type of the cluster number. If N=K=1 and C=0, this indicates that the sample image set is clean. With such a sample image set, most image recognition network feature learning strategies can show excellent accuracy. However, introducing an initial sub-center for each category will destroy intra-class compactness and reduce performance. Therefore, the initial sub-centers can be gradually merged by sub-center merging, i.e., the above formula (3), to maintain intra-class compactness.
[0120] If N = K > 1 and C = 0, this means that there are multiple identities under a category label. N = K means that the sample images of each category label are sufficient to form an effective sample feature cluster in the latent space and there are no outlier features. In this case, if the number of initial sub-centers under a certain category label is less than the actual number of identities in that category label, new initial sub-centers can be generated by the above formula (2), that is, adaptively added initial sub-centers to adapt to external identities outside the initial sub-centers. If the number of initial sub-centers under a certain category label is greater than the actual number of identities in that category label, initial sub-centers with the same identity can be merged by the above formula (3) to maintain intra-class compactness.
[0121] If N>K>1 and C=0, this means that some sample features cannot converge to effective initial subclass centers in the latent space. This may be caused by a few anomalous sample images in each identity. The sample features of these anomalous sample images can be called anomalous noise features. The initial subclass centers to which these anomalous noise features belong are anomalous subclass centers. These anomalous subclass centers are not actually dominated by any identity. Then, multiple anomalous noise images of anomalous subclass centers will produce poor compactness, affecting the network training performance. In order to reduce the impact of these anomalous noise features on the network training performance, we can discard these anomalous subclass centers with a small number of samples or dispersed intraclass density, as well as the sample features belonging to anomalous subclass centers.
[0122] If N>K=1 and C=0, it means that there is one valid identity and multiple abnormal noise features under the category label. The abnormal noise features in each category label can be deleted and the valid sample features can be retained. If N>K=0 and C=0, it means that each initial sub-center under a certain category label has only a few sample features. All initial sub-centers under this category label can be discarded directly. For the case of C>0, this means that there are multiple initial sub-centers with the same identity but different category labels, which introduces inter-class conflict. For this kind of inter-class conflict, the above formula (3) can be used to dynamically merge initial sub-centers with the same identity to alleviate this inter-class conflict.
[0123] The network training method of this disclosure is less affected by the noise types of unconstrained N, K, and C in various real-world scenarios. Through adjustments such as subclass center generation, subclass center discarding, and subclass center merging, the image recognition network can more flexibly adapt to network training under different noise types and better handle intra-class and inter-class conflicts.
[0124] According to embodiments of this disclosure, it is possible to train on noisy data with limited computing resources and quickly train on noisy data within a limited time, and obtain a high-performance image recognition network without extensive parameter tuning, effectively improving the performance and efficiency of network training in noisy data scenarios.
[0125] This disclosure also provides an image recognition method, comprising: using an image recognition network to recognize objects in an image to be recognized, obtaining a recognition result for the objects, wherein the recognition result represents the category of the objects, and the image recognition network is trained using the aforementioned network training method. In this way, by using the image recognition network trained using the aforementioned network training method, the category of objects in the image to be recognized can be accurately identified.
[0126] The objects in the image to be recognized can be, for example, faces or other objects. As mentioned above, the image recognition network can preset multiple categories (equivalent to the centers of various target subclasses in the image recognition network). The image recognition network can output the probability that the image to be recognized belongs to each category, and then the category corresponding to the highest probability can be determined as the category of the object in the image to be recognized, that is, the object recognition result is obtained.
[0127] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0128] In addition, this disclosure also provides network training devices, electronic devices, computer-readable storage media, and programs, all of which can be used to implement any of the network training methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the method section and will not be repeated here.
[0129] Figure 4 A block diagram of a network training apparatus according to an embodiment of the present disclosure is shown, such as Figure 4 As shown, the device includes:
[0130] The feature extraction module 101 is used to extract features from multiple sample images labeled with the same category label in the sample image set using an image recognition network, so as to obtain sample feature clusters under the same category label. The sample image set includes sample images labeled with multiple category labels.
[0131] The determining module 102 is used to initialize multiple initial subclass centers for the sample feature cluster and determine the initial subclass center to which each of the multiple sample features in the sample feature cluster belongs.
[0132] The adjustment module 103 is used to adjust the multiple initial sub-centers based on the similarity between the multiple sample features and their respective initial sub-centers, so as to obtain at least one target sub-center under the same category label.
[0133] The training module 104 is used to determine the network loss based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, and to train the image recognition network using the network loss.
[0134] In one possible implementation, the adjustment module 103 includes: a first determining submodule, configured to determine whether there are outlier features among the multiple sample features based on the similarity between the multiple sample features and their respective initial subclass centers, wherein the similarity between the outlier features and their respective initial subclass centers is less than a first threshold; and a adding submodule, configured to, if there are outlier features among the multiple sample features, add an initial subclass center based on the outlier features, and adjust the outlier features to belong to the newly added initial subclass center; wherein the target subclass center includes the newly added initial subclass center and the multiple initialized initial subclass centers.
[0135] In one possible implementation, determining whether there are outlier features among the plurality of sample features based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining a first threshold corresponding to the initial sub-center based on the mean and standard deviation of the similarity between the initial sub-center and the sample features belonging to the initial sub-center; determining whether there are sample features among the sample features belonging to the initial sub-center whose similarity to the initial sub-center is less than the first threshold; and identifying the sample features whose similarity to the initial sub-center is less than the first threshold as outlier features far from the initial sub-center.
[0136] In one possible implementation, the adjustment module 103 includes: a second determining submodule, configured to determine whether there is an anomalous subcenter among the plurality of initial subcenters based on the similarity between the plurality of sample features and their respective initial subcenters, wherein the mean similarity between the sample features belonging to the anomalous subcenter and the anomalous subcenter is less than or equal to a second threshold; and a discarding submodule, configured to discard the anomalous subcenter and the sample features belonging to the anomalous subcenter when there is an anomalous subcenter among the plurality of initial subcenters, thereby obtaining the remaining initial subcenters and the sample features belonging to the remaining initial subcenters; wherein the target subcenter includes the remaining initial subcenters.
[0137] In one possible implementation, determining whether there is an anomalous sub-center among the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: for any initial sub-center, determining whether the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to a second threshold; if the mean similarity between the initial sub-center and the sample features belonging to the initial sub-center is less than or equal to the second threshold, determining that the initial sub-center is an anomalous sub-center.
[0138] In one possible implementation, the adjustment module 103 includes: a third determining submodule, configured to determine at least one group of subcenters to be merged from the plurality of initial subcenters based on the similarity between the plurality of sample features and their respective initial subcenters, wherein each group of subcenters to be merged includes at least two similar initial subcenters; and a merging submodule, configured to merge each of the at least one group of subcenters to be merged to obtain at least one merged subcenter, and adjust the sample features belonging to each group of subcenters to be merged to belong to each merged subcenter; wherein the target subcenter includes the merged subcenter.
[0139] In one possible implementation, determining at least one group of sub-centers to be merged from the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: determining a third threshold corresponding to each initial sub-center based on the mean and standard deviation of the similarity between each initial sub-center and the sample features belonging to each initial sub-center; for any initial sub-center, determining whether the similarity between the initial sub-center and other initial sub-centers among the plurality of initial sub-centers is greater than or equal to a fourth threshold, wherein the fourth threshold is the maximum value between the third threshold corresponding to the initial sub-center and the third threshold corresponding to the other initial sub-centers; if the similarity between the initial sub-center and the other initial sub-centers is greater than or equal to the maximum value, determining that the other initial sub-centers are similar to the initial sub-center; and determining the initial sub-center and at least one other initial sub-center similar to the initial sub-center as a group of sub-centers to be merged.
[0140] In one possible implementation, the training module 104 includes: a loss determination submodule, configured to determine the sub-loss corresponding to each sample feature belonging to any target subclass center, based on the similarity between the sample feature and its corresponding target subclass center, and the similarity between the sample feature and other target subclass centers, wherein the other target subclass centers include target subclass centers among the multiple target subclass centers under the multiple category labels, excluding the target subclass center to which the sample feature belongs, and whose similarity to the sample feature is less than or equal to a fifth threshold; and a training submodule, configured to determine the network loss based on the sub-loss corresponding to each sample feature belonging to each target subclass center.
[0141] In one possible implementation, the determining module 102 includes a subclass center determining submodule, which is used to calculate the similarity between any sample feature in the sample feature cluster and each initial subclass center, and determine the initial subclass center corresponding to the maximum similarity as the initial subclass center to which the sample feature belongs.
[0142] In this embodiment, by initializing multiple initial subclass centers for sample feature clusters under the same category label and determining the initial subclass centers to which each sample feature in the sample feature cluster belongs, it is equivalent to initializing multiple subclasses for multiple sample features under the same category label to accommodate noise features that may exist under the same category label. Then, based on the similarity between multiple sample features and their respective initial subclass centers, the multiple initial subclass centers are adjusted so that at least one target subclass center under the same category label can more flexibly adapt to the actual distribution of sample features under that category label, that is, to ensure that the sample features under the same category label are... It can be assigned to a more accurate target subclass center, thereby alleviating label conflicts caused by various unconstrained noise features that may exist under different category labels; and by using the network loss determined by the target subclass center and the sample features belonging to the target subclass center to train the image recognition network, it is possible to improve the robustness of the trained image recognition network to unconstrained noisy images during the training process using sample image sets that may contain noisy images. Good training results and network performance can be obtained without a lot of parameter tuning, and the computational resource overhead and computation time overhead required for network training can be reduced, thereby improving network training efficiency.
[0143] This method is specifically technically related to the internal structure of computer systems and can solve technical problems of how to improve hardware computing efficiency or execution performance (including reducing data storage, reducing data transmission, and increasing hardware processing speed), thereby achieving technical effects that improve the internal performance of computer systems in accordance with natural laws.
[0144] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0145] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium can be volatile or non-volatile.
[0146] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above-described method.
[0147] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.
[0148] Electronic devices can be provided as terminals, servers, or other forms of devices.
[0149] Figure 5 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 may be provided as a server or a terminal device. (Refer to...) Figure 5 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0150] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Microsoft Server operating system (Windows Server). TM Apple's graphical user interface-based operating system (Mac OSX) TM ), a multi-user, multi-process computer operating system (Unix) TMLinux is a free and open-source Unix-like operating system. TM ), the open-source Unix-like operating system (FreeBSD) TM (or similar.)
[0151] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.
[0152] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0153] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, (but not limited to) electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0154] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0155] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0156] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0157] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0158] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0159] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0160] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0161] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0162] 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.
[0163] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0164] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A network training method, characterized in that, include: The image recognition network is used to extract features from multiple sample images labeled with the same category in the sample image set to obtain sample feature clusters under the same category label. The sample image set includes sample images labeled with multiple categories. Multiple initial subclass centers are initialized for the sample feature cluster, and the initial subclass centers to which each of the multiple sample features in the sample feature cluster belongs are determined. The initial subclass center to which any sample feature belongs includes the initial subclass center corresponding to the maximum similarity between the sample feature and the sample feature. Based on the similarity between the multiple sample features and their respective initial sub-centers, the multiple initial sub-centers are adjusted to obtain at least one target sub-center under the same category label; wherein, the adjustment of the multiple initial sub-centers includes: adding new initial sub-centers for outlier features among the multiple sample features, discarding abnormal sub-centers among the multiple initial sub-centers, and merging similar initial sub-centers among the multiple initial sub-centers; Based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, the network loss is determined, and the image recognition network is trained using the network loss.
2. The method according to claim 1, characterized in that, The step of adjusting the multiple initial sub-class centers based on the similarity between the multiple sample features and their respective initial sub-class centers to obtain at least one target sub-class center under the same category label includes: Based on the similarity between the multiple sample features and their respective initial subclass centers, it is determined whether there are outlier features among the multiple sample features, and the similarity between the outlier features and their respective initial subclass centers is less than a first threshold. If outlier features exist among the multiple sample features, new initial sub-centers are added based on the outlier features, and the outlier features are adjusted to belong to the newly added initial sub-centers. The target subclass center includes newly added initial subclass centers and multiple initialized initial subclass centers.
3. The method according to claim 2, characterized in that, The step of determining whether outlier features exist among the multiple sample features based on the similarity between the multiple sample features and their respective initial subclass centers includes: For any initial sub-center, a first threshold corresponding to the initial sub-center is determined based on the mean and standard deviation of the similarity between the initial sub-center and the sample features belonging to the initial sub-center; Determine whether there are any sample features among the sample features belonging to the initial subclass center whose similarity to the initial subclass center is less than the first threshold; Sample features whose similarity to the initial subclass center is less than the first threshold are identified as outlier features that are far from the initial subclass center.
4. The method according to any one of claims 1 to 3, characterized in that, The step of adjusting the multiple initial sub-class centers based on the similarity between the multiple sample features and their respective initial sub-class centers to obtain at least one target sub-class center under the same category label includes: Based on the similarity between the multiple sample features and their respective initial sub-centers, it is determined whether there are abnormal sub-centers among the multiple initial sub-centers. The mean similarity between the sample features under the abnormal sub-center and the abnormal sub-center is less than or equal to a second threshold. If there is an abnormal subclass center among the multiple initial subclass centers, the abnormal subclass center and the sample features belonging to the abnormal subclass center are discarded to obtain the remaining initial subclass centers and the sample features belonging to the remaining initial subclass centers; wherein, the target subclass center includes the remaining initial subclass centers.
5. The method according to claim 4, characterized in that, The step of determining whether there are anomalous sub-centers among the multiple initial sub-centers based on the similarity between the multiple sample features and their respective initial sub-centers includes: For any initial subclass center, determine whether the mean similarity between the initial subclass center and the sample features belonging to the initial subclass center is less than or equal to a second threshold. If the mean similarity between the initial subclass center and the sample features belonging to the initial subclass center is less than or equal to the second threshold, the initial subclass center is determined to be an abnormal subclass center.
6. The method according to any one of claims 1 to 3, characterized in that, The step of adjusting the multiple initial sub-class centers based on the similarity between the multiple sample features and their respective initial sub-class centers to obtain at least one target sub-class center under the same category label includes: Based on the similarity between the multiple sample features and their respective initial sub-centers, at least one group of sub-centers to be merged is determined from the multiple initial sub-centers, and each group of sub-centers to be merged includes at least two similar initial sub-centers; The at least one group of sub-centers to be merged is merged to obtain at least one merged sub-center, and the sample features belonging to each group of sub-centers to be merged are adjusted to belong to each merged sub-center; wherein, the target sub-center includes the merged sub-center.
7. The method according to claim 6, characterized in that, The step of determining at least one set of sub-centers to be merged from the plurality of initial sub-centers based on the similarity between the plurality of sample features and their respective initial sub-centers includes: The third threshold corresponding to each initial sub-center is determined based on the mean and standard deviation of the similarity between each initial sub-center and the sample features belonging to each initial sub-center. For any initial subclass center, determine whether the similarity between the initial subclass center and other initial subclass centers among the plurality of initial subclass centers is greater than or equal to a fourth threshold, wherein the fourth threshold is the maximum value between the third threshold corresponding to the initial subclass center and the third threshold corresponding to the other initial subclass centers; If the similarity between the initial subclass center and the other initial subclass centers is greater than or equal to the maximum value, then the other initial subclass centers are determined to be similar to the initial subclass center. The initial subclass center and at least one other initial subclass center similar to the initial subclass center are identified as a group of subclass centers to be merged.
8. The method according to any one of claims 1 to 3, characterized in that, The process of determining network loss based on target sub-centers under multiple category labels and sample features belonging to each target sub-center includes: For each sample feature belonging to any target subclass center, the sub-loss corresponding to the sample feature is determined based on the similarity between the sample feature and the target subclass center to which it belongs, and the similarity between the sample feature and other target subclass centers. The other target subclass centers include target subclass centers other than the target subclass center to which the sample feature belongs and whose similarity with the sample feature is less than or equal to the fifth threshold among the multiple target subclass centers under the multiple category labels. The network loss is determined based on the sub-loss corresponding to the features of each sample belonging to each target sub-class center.
9. The method according to any one of claims 1 to 3, characterized in that, Determining the initial subclass center to which each of the multiple sample features in the sample feature cluster belongs includes: For any sample feature in the sample feature cluster, calculate the similarity between the sample feature and each initial subclass center, and determine the initial subclass center corresponding to the maximum similarity as the initial subclass center to which the sample feature belongs.
10. An image recognition method, characterized in that, include: An image recognition network is used to identify objects in an image to obtain an identification result of the object, wherein the identification result represents the category of the object, and the image recognition network is trained by the network training method according to any one of claims 1 to 9.
11. A network training device, characterized in that, include: The feature extraction module is used to extract features from multiple sample images labeled with the same category label in the sample image set using an image recognition network, so as to obtain sample feature clusters under the same category label. The sample image set includes sample images labeled with multiple category labels. The determination module is used to initialize multiple initial subclass centers for the sample feature cluster, and determine the initial subclass centers to which each of the multiple sample features in the sample feature cluster belongs. The initial subclass center to which any sample feature belongs includes the initial subclass center corresponding to the maximum similarity between the sample feature and the sample feature. An adjustment module is used to adjust the multiple initial sub-centers based on the similarity between the multiple sample features and their respective initial sub-centers, to obtain at least one target sub-center under the same category label; wherein, the adjustment of the multiple initial sub-centers includes: adding new initial sub-centers for outlier features among the multiple sample features, discarding abnormal sub-centers among the multiple initial sub-centers, and merging similar initial sub-centers among the multiple initial sub-centers; The training module is used to determine the network loss based on the target sub-centers under multiple category labels and the sample features belonging to each target sub-center, and to train the image recognition network using the network loss.
12. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 10.
Citation Information
Patent Citations
Multi-scale anchor initialization method and device for image detection model
CN111986255A