A label generation method and device, electronic equipment and storage medium

By generating the first predicted label for unlabeled data using a model trained on labeled data, and combining data features and cluster analysis, multiple prediction methods are integrated to solve the problem of inaccurate label generation for unlabeled data and improve the model's performance on the target domain dataset.

CN117152571BActive Publication Date: 2026-05-01HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
Filing Date
2023-08-14
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies cannot effectively generate labels for unlabeled data, resulting in insufficient model performance on target domain datasets.

Method used

The model, trained on labeled data, generates the first predicted label for the unlabeled data. Then, by combining data features and cluster analysis, the first and second predicted labels are merged to generate the final label for the unlabeled data.

Benefits of technology

It improves the accuracy of label generation for unlabeled data and enhances the model's processing capabilities on target domain datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117152571B_ABST
    Figure CN117152571B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a label generation method and device, electronic equipment and storage medium, relating to the technical field of machine learning, the method comprising: inputting each unlabeled data into a model trained based on labeled data to obtain a first predicted label representing the probability of the unlabeled data belonging to each preset category; clustering the unlabeled data based on the data features of the unlabeled data and the first predicted label to obtain a first clustering cluster, and clustering the labeled data based on the data features of the labeled data and the true value label to obtain a second clustering cluster; for each first clustering cluster, obtaining a second predicted label representing the probability of the first clustering cluster belonging to each preset category based on the feature distance between the first clustering cluster and each clustering cluster set; and fusing the first predicted label and the second predicted label of each unlabeled data to obtain a fused label and a final label. In this way, effective labels of unlabeled data can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a label generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of big data and machine learning technologies, the application of models is becoming increasingly widespread. For example, models can be used for data classification or object detection. Before using a model, it is necessary to train the model using pre-labeled sample data from the source domain dataset (referred to as labeled data) and test the model's performance using unlabeled sample data from the target domain dataset (referred to as unlabeled data) to obtain a model that meets the application requirements. For example, the sample data can be images, speech, or text. Since the source domain dataset and the target domain dataset are collected from different scenarios, the performance of a model trained on the source domain dataset when processing the target domain dataset cannot be guaranteed.

[0003] To improve the generalization performance of a model, it is often trained using both labeled and unlabeled data, i.e., semi-supervised training. During semi-supervised training, labels (pseudo-labels) can be generated for the unlabeled data. By combining these labels with those from the labeled and unlabeled data, the model's performance in processing sample data from the target domain dataset can be improved.

[0004] Therefore, there is an urgent need for a method to generate valid labels for unlabeled data. Summary of the Invention

[0005] The purpose of this application is to provide a tag generation method, apparatus, electronic device, and storage medium to generate tags with valid data even without tags. The specific technical solution is as follows:

[0006] A first aspect of this application provides a label generation method, the method comprising:

[0007] For each unlabeled data point to be labeled, the unlabeled data point is input into the model trained based on each labeled data point to obtain the probability that the unlabeled data point belongs to each preset category, which is used as the first predicted label for the unlabeled data point.

[0008] Based on the data features and first predicted labels of each unlabeled data, multiple clusters are obtained by clustering each unlabeled data, which serve as the first cluster. Based on the data features and ground truth labels of each labeled data, multiple clusters are obtained by clustering each labeled data, which serve as the second cluster. The ground truth label of a labeled data is used to indicate the preset category to which the labeled data belongs.

[0009] For each current first cluster, based on the feature distance between the first cluster and each current cluster set, the probability that the first cluster belongs to each preset category is obtained, which is used as the current second predicted label for the unlabeled data in the first cluster; wherein, a current cluster set contains a second cluster that is consistent with the current ground truth label;

[0010] For each unlabeled data point, the first predicted label of the unlabeled data point and the current second predicted label are fused to obtain the current fused label of the unlabeled data point.

[0011] Based on the current fused labels of each unlabeled data point, the final labels of each unlabeled data point are obtained.

[0012] Optionally, based on the data features and the first predicted label of each unlabeled data point, multiple clusters are obtained by clustering each unlabeled data point, which serve as the first cluster, including:

[0013] Based on the data characteristics of each unlabeled data, multiple clusters are obtained by clustering each unlabeled data, which serve as the first-level unlabeled clusters.

[0014] For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster to obtain the first cluster.

[0015] Optionally, for each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in that first-level unlabeled cluster, clustering is performed on each unlabeled data in that first-level unlabeled cluster to obtain a first cluster, including:

[0016] For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, the unlabeled data in the first-level unlabeled cluster are clustered to obtain multiple clusters, which are used as the second-level unlabeled clusters of the first-level unlabeled cluster.

[0017] For each second-level unlabeled cluster, if the number of unlabeled data in the second-level unlabeled cluster is greater than the first specified number, then based on the data characteristics of each unlabeled data in the second-level unlabeled cluster, the unlabeled data in the second-level unlabeled cluster are clustered to obtain multiple clusters, which are used as the first cluster.

[0018] Optionally, obtaining the final label for each unlabeled data based on its current fused label includes:

[0019] For each current first cluster, if the first cluster meets the preset screening conditions, then based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, the final label of each unlabeled data in the first cluster is determined, and a new second cluster is obtained by taking the final label of each unlabeled data in the first cluster as the truth label. Then, the process of performing the step of obtaining the probability of the first cluster belonging to each preset category based on the feature distance between the first cluster and each current cluster set for each current first cluster, and using it as the second predicted label of the unlabeled data in the first cluster, is repeated until there are no more first clusters that meet the preset screening conditions.

[0020] Among them, the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than the first threshold, and the proportion of dominant unlabeled data in the cluster to which the first cluster belongs is greater than the second threshold; the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

[0021] Optionally, after fusing the first predicted label and the current second predicted label for each current unlabeled data point to obtain the current fused label for that unlabeled data, the method further includes:

[0022] For each current first cluster, if the proportion of dominant unlabeled data in the first cluster is greater than the third threshold, then the current fusion label of the other unlabeled data in the first cluster, excluding the dominant unlabeled data, is updated to the current fusion label of the dominant unlabeled data; wherein, the third threshold is less than the first threshold.

[0023] Optionally, the first threshold is greater than the second threshold.

[0024] Optionally, based on the data features and ground truth labels of the labeled data, the labeled data is clustered to obtain multiple clusters, which serve as a second cluster, including:

[0025] Based on the truth labels of the labeled data, the labeled data are clustered to obtain multiple clusters, which serve as first-level labeled clusters.

[0026] For each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, the labeled data in that first-level labeled cluster are clustered to obtain a second cluster.

[0027] Optionally, for each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, clustering is performed on the labeled data in that first-level labeled cluster to obtain a second cluster, including:

[0028] For each first-level labeled cluster, based on the data characteristics of each labeled data in the first-level labeled cluster, the labeled data in the first-level labeled cluster are clustered to obtain multiple clusters, which serve as the second-level labeled clusters of the first-level labeled cluster;

[0029] For each secondary labeled cluster, if the number of labeled data in the secondary labeled cluster is greater than the second specified number, then based on the data characteristics of each labeled data in the secondary labeled cluster, multiple clusters are obtained by clustering the labeled data in the secondary labeled cluster, which are then used as the second cluster.

[0030] Optionally, before determining the probability that a first cluster belongs to each preset category based on the feature distance between the first cluster and each current set of clusters, and using this probability as the second predicted label for the unlabeled data in the first cluster, the method further includes:

[0031] For each current first cluster, calculate the feature distance between the first cluster and each second cluster in each current cluster set to obtain multiple initial feature distances;

[0032] Select the first preset number of feature distances from the multiple calculated initial feature distances in ascending order;

[0033] Based on the selected preset number of feature distances, the feature distance between the first cluster and the set of clusters is obtained.

[0034] Optionally, after fusing the first predicted label and the current second predicted label for each current unlabeled data point to obtain the current fused label for that unlabeled data, the method further includes:

[0035] For each current first cluster, if the proportion of dominant unlabeled data in the first cluster is greater than the fourth threshold, then the current fusion label of the other unlabeled data in the first cluster, excluding the dominant unlabeled data, is updated to the current fusion label of the dominant unlabeled data. Among these, the dominant unlabeled data in a cluster belongs to the target data group. Among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

[0036] Optionally, the unlabeled data and the labeled data are images, and the data features are the visual features of the images.

[0037] A second aspect of this application also provides a label generation apparatus, the apparatus comprising:

[0038] The first label acquisition module is used to input each unlabeled data to be labeled into a model trained based on each labeled data, and obtain the probability that the unlabeled data belongs to each preset category, which is then used as the first predicted label for the unlabeled data.

[0039] The clustering module is used to cluster the unlabeled data based on the data features and the first predicted label of each unlabeled data to obtain multiple clusters as the first cluster, and to cluster the labeled data based on the data features and the ground truth label of each labeled data to obtain multiple clusters as the second cluster; wherein, the ground truth label of a labeled data is used to indicate the preset category to which the labeled data belongs;

[0040] The second label acquisition module, for each current first cluster, obtains the probability that the first cluster belongs to each preset category based on the feature distance between the first cluster and each current cluster set, and uses it as the current second predicted label for the unlabeled data in the first cluster; wherein, the current cluster set contains the second cluster that is consistent with the current ground truth label;

[0041] The label fusion module is used to fuse the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data.

[0042] The label determination module is used to obtain the final label of each unlabeled data based on the current fused label of each unlabeled data.

[0043] Optionally, the clustering module includes:

[0044] The first clustering submodule is used to cluster the unlabeled data according to the data characteristics of each unlabeled data to obtain multiple clusters, which serve as first-level unlabeled clusters.

[0045] The second clustering submodule is used to cluster the unlabeled data in each first-level unlabeled cluster according to the first predicted label of each unlabeled data in the first-level unlabeled cluster, so as to obtain the first cluster.

[0046] Optionally, the second clustering submodule is specifically used to, for each first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster according to the first predicted label of each unlabeled data in the first-level unlabeled cluster to obtain multiple clusters, which are used as second-level unlabeled clusters of the first-level unlabeled cluster; for each second-level unlabeled cluster, if the number of unlabeled data in the second-level unlabeled cluster is greater than a first specified number, then cluster the unlabeled data in the second-level unlabeled cluster according to the data characteristics of each unlabeled data in the second-level unlabeled cluster to obtain multiple clusters, which are used as first clusters.

[0047] Optionally, the label determination module is specifically used to, for each current first cluster, if the first cluster meets the preset screening conditions, determine the final label of each unlabeled data in the first cluster based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, and use the final label of each unlabeled data in the first cluster as the truth label to obtain a new second cluster, and return to execute the step of, for each current first cluster, obtaining the probability of the first cluster belonging to each preset category based on the feature distance between the first cluster and each current cluster set, as the second predicted label of the unlabeled data in the first cluster, until there are no first clusters that meet the preset screening conditions;

[0048] Among them, the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than the first threshold, and the proportion of dominant unlabeled data in the cluster to which the first cluster belongs is greater than the second threshold; the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

[0049] Optionally, the device further includes:

[0050] The first update module is used to, after fusing the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data, update the current fused label of the other unlabeled data points in the first cluster (excluding the dominant unlabeled data) to the current fused label of the dominant unlabeled data for each first cluster; wherein the third threshold is less than the first threshold.

[0051] Optionally, the first threshold is greater than the second threshold.

[0052] Optionally, the clustering module includes:

[0053] The third clustering submodule is used to cluster the labeled data according to the truth labels of the labeled data to obtain multiple clusters, which serve as first-level labeled clusters.

[0054] The fourth clustering submodule is used to cluster the labeled data in each first-level labeled cluster according to the data characteristics of the labeled data in that first-level labeled cluster, and obtain a second cluster.

[0055] Optionally, the fourth clustering submodule is specifically used to, for each first-level labeled cluster, cluster the labeled data in the first-level labeled cluster according to the data characteristics of the labeled data in the first-level labeled cluster to obtain multiple clusters, which are used as second-level labeled clusters of the first-level labeled cluster; for each second-level labeled cluster, if the number of labeled data in the second-level labeled cluster is greater than a second specified number, then cluster the labeled data in the second-level labeled cluster according to the data characteristics of the labeled data in the second-level labeled cluster to obtain multiple clusters, which are used as second clusters.

[0056] Optionally, the device further includes:

[0057] The feature distance calculation module is used to calculate the feature distance between each first cluster and each second cluster in each current cluster set before, for each current first cluster, obtaining the probability that the first cluster belongs to each preset category based on the feature distance between the first cluster and each current cluster set, and using it as the current second predicted label for the unlabeled data in the first cluster, to obtain multiple initial feature distances;

[0058] The feature distance selection module is used to select the first preset number of feature distances from multiple calculated initial feature distances in ascending order;

[0059] The feature distance determination module is used to obtain the feature distance between the first cluster and the set of clusters based on a preset number of selected feature distances.

[0060] Optionally, the device further includes:

[0061] The second update module is used to, after fusing the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data, for each first cluster, if the proportion of the dominant unlabeled data in the first cluster is greater than a fourth threshold, update the current fused label of the other unlabeled data in the first cluster (excluding the dominant unlabeled data) to the current fused label of the dominant unlabeled data; wherein, the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fused label, the target data group contains the largest number of unlabeled data points.

[0062] Optionally, the unlabeled data and the labeled data are images, and the data features are the visual features of the images.

[0063] A third aspect of this application also provides an electronic device, comprising:

[0064] Memory, used to store computer programs;

[0065] The processor, when executing a program stored in memory, implements any of the label generation methods described above.

[0066] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the label generation methods described above.

[0067] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the label generation methods described above.

[0068] This application provides a label generation method that, for each unlabeled data point to be labeled, inputs the unlabeled data into a model trained on labeled data to obtain the probability that the unlabeled data belongs to each preset category, which serves as the first predicted label for the unlabeled data; based on the data features of each unlabeled data point and the first predicted label, clusters are performed on the unlabeled data points to obtain multiple clusters, which serve as the first cluster; and based on the data features and ground truth labels of each labeled data point, clusters are performed on the labeled data points to obtain multiple clusters, which serve as the second cluster; wherein, the ground truth label of a labeled data point is used to represent the number of labeled data points. According to the preset category to which it belongs; for each current first cluster, based on the feature distance between the first cluster and each current cluster set, the probability that the first cluster belongs to each preset category is obtained, which is used as the current second predicted label for the unlabeled data in the first cluster; wherein, a current cluster set contains a second cluster that is consistent with the current ground truth label; for each current unlabeled data, the first predicted label and the current second predicted label of the unlabeled data are fused to obtain the current fused label of the unlabeled data; based on the current fused labels of each unlabeled data, the final label of each unlabeled data is obtained.

[0069] Based on the above processing, the model trained on labeled data can predict the probability of unlabeled data belonging to each preset category, thus obtaining the label of the unlabeled data (i.e., the first predicted label). However, labeled and unlabeled data may belong to different scenarios; therefore, the accuracy of the model trained on labeled data in predicting unlabeled data cannot be guaranteed, i.e., the accuracy of the first predicted label cannot be guaranteed. Since the feature distance between a first cluster and each set of clusters reflects the similarity between the first cluster and the second cluster in that set, the similarity between the first cluster and the second cluster in that set represents the probability that the first cluster belongs to the preset category to which the labeled data in that set belongs. Furthermore, since the ground truth labels of the second clusters in a set of clusters are consistent, the preset categories to which the labeled data in the second clusters of a set of clusters belong are also consistent. Therefore, the probability that the first cluster belongs to each preset category can be determined by the feature distance between the first cluster and each cluster set (i.e., the current second predicted label of the unlabeled data in the first cluster).

[0070] Based on this, by comparing the data features of unlabeled data with those of labeled data, the probability of unlabeled data belonging to each preset category (i.e., the second predicted label) can be obtained, and the probability of unlabeled data belonging to each preset category can be predicted by the model (i.e., the first predicted label). Then, by fusing the predicted labels obtained by the two methods, the accuracy of the generated labels can be improved by combining the similarity between the data features of unlabeled data and those of labeled data, as well as the predictive ability of the model, so as to generate effective labels for unlabeled data.

[0071] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0072] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0073] Figure 1 This is a schematic diagram of a first flowchart of a label generation method provided in an embodiment of this application;

[0074] Figure 2 A schematic diagram illustrating a clustering result provided in an embodiment of this application;

[0075] Figure 3 This is a second flowchart illustrating the label generation method provided in the embodiments of this application;

[0076] Figure 4a This is a schematic diagram illustrating an embodiment of the present application where the tag is not updated via anchor clusters.

[0077] Figure 4b A schematic diagram illustrating an embodiment of this application for updating tags via anchor clusters;

[0078] Figure 5 A schematic diagram illustrating an anchor cluster filtering method provided in an embodiment of this application;

[0079] Figure 6a A schematic diagram of the first cluster M that does not require label correction, provided in an embodiment of this application;

[0080] Figure 6b A schematic diagram of the first cluster N that requires label correction, provided in an embodiment of this application;

[0081] Figure 6c This is a schematic diagram of the first cluster N1 obtained after label correction of the first cluster N, as provided in an embodiment of this application.

[0082] Figure 7 This is a schematic diagram of a third process for the label generation method provided in an embodiment of this application;

[0083] Figure 8 A flowchart illustrating the application process of the label generation method provided in this application embodiment;

[0084] Figure 9 This is a schematic diagram of the structure of a label generation device provided in an embodiment of this application;

[0085] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0086] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0087] With the development of big data and machine learning technologies, the application of models is becoming increasingly widespread. For example, models can be used for data classification or object detection. Before using a model, it is necessary to train the model using pre-labeled sample data from the source domain dataset (referred to as labeled data) and test the model's performance using unlabeled sample data from the target domain dataset (referred to as unlabeled data) to obtain a model that meets the application requirements. For example, the sample data can be images, speech, or text. Since the source domain dataset and the target domain dataset are collected from different scenarios, the performance of a model trained on the source domain dataset when processing the target domain dataset cannot be guaranteed.

[0088] To improve the generalization performance of a model, it is often trained using both labeled and unlabeled data, i.e., semi-supervised training. During semi-supervised training, labels (pseudo-labels) can be generated for the unlabeled data. By combining these labels with those from the labeled and unlabeled data, the model's performance in processing sample data from the target domain dataset can be improved.

[0089] To generate valid labels for unlabeled data, this application provides a label generation method, see [link to relevant documentation]. Figure 1 , Figure 1 This is a first flowchart illustrating a label generation method provided in an embodiment of this application. The method may include the following steps:

[0090] Step S101: For each unlabeled data point to be labeled, input the unlabeled data point into the model trained based on each labeled data point to obtain the probability that the unlabeled data point belongs to each preset category, which is used as the first predicted label for the unlabeled data point.

[0091] Step S102: Based on the data features and the first predicted label of each unlabeled data, cluster the unlabeled data to obtain multiple clusters, which are the first clusters; and based on the data features and the ground truth label of each labeled data, cluster the labeled data to obtain multiple clusters, which are the second clusters.

[0092] In this context, a truth label for a labeled data item is used to indicate the preset category to which the labeled data item belongs.

[0093] Step S103: For each current first cluster, based on the feature distance between the first cluster and each current cluster set, obtain the probability that the first cluster belongs to each preset category, and use it as the current second predicted label for the unlabeled data in the first cluster.

[0094] Among them, the current set of clusters contains the second cluster that corresponds to the truth label.

[0095] Step S104: For each unlabeled data point, fuse the first predicted label of the unlabeled data point and the current second predicted label to obtain the current fused label of the unlabeled data point.

[0096] Step S105: Based on the current fusion labels of each unlabeled data, obtain the final labels of each unlabeled data.

[0097] Based on the above processing, the model trained on labeled data can predict the probability of unlabeled data belonging to each preset category, thus obtaining the label of the unlabeled data (i.e., the first predicted label). However, labeled and unlabeled data may belong to different scenarios; therefore, the accuracy of the model trained on labeled data in predicting unlabeled data cannot be guaranteed, i.e., the accuracy of the first predicted label cannot be guaranteed. Since the feature distance between a first cluster and each set of clusters reflects the similarity between the first cluster and the second cluster in that set, the similarity between the first cluster and the second cluster in that set represents the probability that the first cluster belongs to the preset category to which the labeled data in that set belongs. Furthermore, since the ground truth labels of the second clusters in a set of clusters are consistent, the preset categories to which the labeled data in the second clusters of a set of clusters belong are also consistent. Therefore, the probability that the first cluster belongs to each preset category can be determined by the feature distance between the first cluster and each cluster set (i.e., the current second predicted label of the unlabeled data in the first cluster).

[0098] Based on this, by comparing the data features of unlabeled data with those of labeled data, the probability of unlabeled data belonging to each preset category (i.e., the second predicted label) can be obtained, and the probability of unlabeled data belonging to each preset category can be predicted by the model (i.e., the first predicted label). Then, by fusing the predicted labels obtained by the two methods, the accuracy of the generated labels can be improved by combining the similarity between the data features of unlabeled data and those of labeled data, as well as the predictive ability of the model, so as to generate effective labels for unlabeled data.

[0099] Regarding step S101, the sample data involved in this application includes labeled data and unlabeled data. For example, the sample data can be speech or images. When the sample data is speech, the preset category can be determined according to the target of the speech. For example, the preset category of speech can include human voice, animal voice, and environmental sound. When the sample data is images, the preset category can be determined according to the category of the objects contained in the image. For example, the preset category of an image containing a dog is "dog," the preset category of an image containing a person is "person," and the preset category of an image containing a vehicle is "vehicle." For any sample data, the sum of the probabilities that the sample data belongs to each preset category is 1.

[0100] The model in this application can be applied to different scenarios, such as surveillance scenarios, like shopping malls or intersections. To improve the model's generalization performance, before deploying the model to the current scenario, models from other scenarios can be obtained. That is, models trained on pre-labeled data from the datasets of those other scenarios can be trained on the dataset of the current scenario. For example, the model can be an object detection model or an object classification model. These other scenarios can be called source domain scenarios, and correspondingly, the datasets from those other scenarios can be called source domain datasets. The models trained on pre-labeled data from those other scenario datasets can be called source domain models.

[0101] The current scenario can be referred to as the target domain scenario. When deploying the source domain model to the target domain scenario, since the source and target domain scenarios differ, it is also necessary to train the source domain model using data from the target domain dataset (which can be called the target domain dataset). However, the data in the target domain dataset consists of unlabeled data; therefore, labels for the unlabeled data need to be generated. This allows for training the source domain model based on the unlabeled data and its labels, resulting in a model suitable for the target domain scenario.

[0102] A source domain model trained on labeled data can predict the probability of unlabeled data belonging to each preset category. However, labeled and unlabeled data may belong to different scenarios. Therefore, the accuracy of the model trained on labeled data in predicting unlabeled data cannot be guaranteed; that is, the accuracy of the first predicted label cannot be guaranteed. Subsequently, it is necessary to compare the data features of unlabeled data with those of labeled data to obtain the probability of unlabeled data belonging to each preset category (i.e., the second predicted label). Then, the two methods are fused to obtain the predicted label, thus generating a valid label for the unlabeled data.

[0103] In step S102, a specified model can be used to extract features from both labeled and unlabeled data to obtain the data features of the labeled and unlabeled data. For example, the specified model can be the source domain model mentioned above, or it can be any other model capable of feature extraction. For instance, the specified model could be BEiT (Bidirectional Encoder representation from Image Transformers), Swin Transformer (Hierarchical Vision Transformer using Shifted Windows), or CLIP (Contrastive Language-Image Pre-Training). The specified model can include fully connected layers. After inputting labeled and unlabeled data into the specified model, the features output by the fully connected layers can serve as the data features of the labeled and unlabeled data. For example, when the labeled and unlabeled data are speech, the data features can be spectral features; when the labeled and unlabeled data are images, the data features can be the semantic features of the image. For example, the semantic features of the image can be visual features, which can include the color and texture features of the image.

[0104] Furthermore, based on the data characteristics of each unlabeled data and the first predicted label, multiple clusters (i.e., the first cluster) can be obtained by clustering each unlabeled data.

[0105] In one implementation, unlabeled data can be clustered based on a first predicted label. This allows unlabeled data with the same preset category represented by the first predicted label to be grouped into the same cluster, resulting in multiple clusters (i.e., first-level unlabeled clusters). For each first-level unlabeled cluster, the unlabeled data within that cluster are further clustered based on data characteristics. This allows unlabeled data with the same data characteristics within that first-level unlabeled cluster to be grouped into the same cluster, resulting in multiple new clusters (i.e., second-level unlabeled clusters of the first-level unlabeled clusters). Furthermore, a first cluster can be obtained based on the second-level unlabeled clusters. The specific process can be described in subsequent embodiments.

[0106] In another implementation, clustering can be performed first based on data features, and then further clustering based on the first predicted label. The process of generating the first cluster includes:

[0107] Step 1: Based on the data characteristics of each unlabeled data, cluster the unlabeled data to obtain multiple clusters, which serve as the first-level unlabeled clusters.

[0108] Step 2: For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster to obtain the first cluster.

[0109] In this embodiment of the application, unlabeled data can be used to cluster the unlabeled data to obtain multiple clusters (i.e., first-level unlabeled clusters).

[0110] Furthermore, for each first-level unlabeled cluster, based on the first predicted label, the unlabeled data in that first-level unlabeled cluster are clustered to obtain multiple clusters corresponding to that first-level unlabeled cluster. Then, based on the multiple clusters corresponding to each first-level unlabeled cluster, a first cluster can be obtained, as described in the subsequent embodiments.

[0111] Based on the above processing, multiple first clusters can be obtained. The data features of the unlabeled data within a first cluster are consistent, and the preset categories represented by the first predicted labels are also consistent. Subsequently, for each first cluster, the probability of that first cluster belonging to each preset category is obtained, serving as the current second predicted label for the unlabeled data within that first cluster. Since the data features of the unlabeled data within a first cluster are similar, and the preset categories represented by the first predicted labels are relatively consistent, the obtained second predicted labels can effectively represent the preset categories to which each unlabeled data in the first cluster belongs, thus improving the accuracy of the obtained second predicted labels. This, in turn, improves the accuracy of the final labels for the unlabeled data, further ensuring the generation of valid labels for the unlabeled data.

[0112] In one implementation, in step 2, for each first-level unlabeled cluster, based on the first predicted label of each unlabeled data point in that first-level unlabeled cluster, clustering is performed on the unlabeled data points in that first-level unlabeled cluster, resulting in multiple clusters, which serve as second-level unlabeled clusters for that first-level unlabeled cluster. Furthermore, each of the resulting second-level unlabeled clusters can be directly used as the first cluster.

[0113] In another implementation, the unlabeled data in the second-level unlabeled clusters can be further clustered. Accordingly, step 2 includes:

[0114] Step 21: For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster to obtain multiple clusters, which serve as the second-level unlabeled clusters of the first-level unlabeled cluster.

[0115] Step 22: For each second-level unlabeled cluster, if the number of unlabeled data in the second-level unlabeled cluster is greater than the first specified number, then according to the data characteristics of each unlabeled data in the second-level unlabeled cluster, cluster the unlabeled data in the second-level unlabeled cluster to obtain multiple clusters, which are used as the first cluster.

[0116] In this embodiment, for each primary unlabeled cluster, based on the first predicted label of each unlabeled data point in the primary unlabeled cluster, clustering is performed on the unlabeled data points in that primary unlabeled cluster to obtain multiple secondary unlabeled clusters for that primary unlabeled cluster. Since the total number of unlabeled data points is often large, the number of unlabeled data points contained in a primary unlabeled cluster is also large; therefore, the number of unlabeled data points contained in a secondary unlabeled cluster may also be large. When the number of unlabeled data points contained in a single unlabeled cluster is large, the consistency of the unlabeled data points contained in that cluster may be low.

[0117] Therefore, for each second-level unlabeled cluster, if the number of unlabeled data points in the cluster exceeds a predetermined number, it indicates a large number of unlabeled data points, suggesting that the consistency of the data characteristics of these unlabeled data points may be low. Therefore, based on the data characteristics of each unlabeled data point in the second-level cluster, further clustering can be performed to obtain multiple new clusters. These new clusters obtained from the second-level unlabeled clusters can then serve as the first cluster, thereby reducing the number of unlabeled data points in the first cluster and improving the consistency of the data characteristics of the unlabeled data points within the first cluster.

[0118] If the number of unlabeled data points in the second-level unlabeled cluster is not greater than a first specified number, it indicates that there are relatively few unlabeled data points in the second-level unlabeled cluster, and correspondingly, the consistency of the data characteristics of the unlabeled data is also relatively high. Therefore, it is not necessary to cluster the unlabeled data points in the second-level unlabeled cluster, and the second-level unlabeled cluster can be directly used as the first cluster. For example, the first specified number can be 30 or 50.

[0119] Based on the above processing, the number of second-level unlabeled clusters that need to be clustered and those that do not can be determined according to the first specified number. This improves the consistency of data features of unlabeled data in the first cluster while reducing the number of clustering operations, thus saving computational resources. Consequently, it improves the accuracy of the obtained second predicted labels and the efficiency of determining the second predicted labels. Furthermore, it improves the accuracy of the final labels for the unlabeled data, further ensuring the generation of valid labels for the unlabeled data and improving the efficiency of label generation.

[0120] Similarly, based on the data characteristics and ground truth labels of each labeled data, multiple clusters (i.e., second clusters) can be obtained by clustering the labeled data. For any labeled data, the ground truth label of the labeled data can represent the preset category to which the labeled data belongs. Correspondingly, the probability that the labeled data belongs to the preset category is 1, and the probability that it belongs to other preset categories is 0.

[0121] In one embodiment, based on the data features and ground truth labels of the labeled data, multiple clusters are obtained by clustering the labeled data to form a second cluster, including:

[0122] Step 3: Cluster the labeled data according to the true labels of each labeled data to obtain multiple clusters, which serve as first-level labeled clusters.

[0123] Step 4: For each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, cluster the labeled data in that first-level labeled cluster to obtain a second cluster.

[0124] In this embodiment, the order of steps 3-4 and steps 1-2 is not limited. The labeled data can be clustered according to the truth labels of each labeled data point. Specifically, labeled data belonging to the same preset category can be grouped into a single cluster based on the preset category represented by the truth label, resulting in multiple clusters (i.e., first-level labeled clusters). Furthermore, for each first-level labeled cluster, labeled data with consistent data characteristics within that cluster are grouped into another cluster, resulting in multiple clusters corresponding to that first-level labeled cluster. Finally, based on the clusters corresponding to each first-level labeled cluster, a second cluster can be obtained, as described in subsequent embodiments.

[0125] Based on the above processing, multiple second clusters can be obtained. The labeled data within a second cluster have consistent data features, and the preset categories represented by the ground truth labels are also consistent. Thus, each second cluster reflects the correspondence between the preset category represented by the ground truth label and the data features of the labeled image. This ensures that for each first cluster, the probability of it belonging to each preset category can be accurately determined based on the feature distance between the first cluster and each current cluster set, serving as the second predicted label for the unlabeled data within that first cluster. This improves the accuracy of the obtained second predicted labels, thereby improving the accuracy of the final labels for the unlabeled data and further ensuring the generation of valid labels for the unlabeled data.

[0126] In one implementation, in step 4, for each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, clustering is performed on the labeled data in that first-level labeled cluster to obtain multiple clusters, which serve as second-level labeled clusters for that first-level labeled cluster. Furthermore, each of the obtained second-level labeled clusters can be directly used as a second cluster.

[0127] In another implementation, the unlabeled data in the secondary labeled clusters can be further clustered. Accordingly, step 4 includes:

[0128] Step 41: For each first-level labeled cluster, based on the data characteristics of each labeled data in the first-level labeled cluster, cluster the labeled data in the first-level labeled cluster to obtain multiple clusters, which serve as the second-level labeled clusters of the first-level labeled cluster.

[0129] Step 42: For each secondary labeled cluster, if the number of labeled data in the secondary labeled cluster is greater than the second specified number, then based on the data characteristics of each labeled data in the secondary labeled cluster, cluster the labeled data in the secondary labeled cluster to obtain multiple clusters, which are used as the second clusters.

[0130] In this embodiment, for each primary labeled cluster, the labeled data in the primary labeled cluster are clustered according to their data characteristics to obtain multiple secondary labeled clusters. For each secondary labeled cluster, if the number of unlabeled data in the secondary labeled cluster is greater than a second specified number, it indicates that there is a large amount of labeled data in the secondary labeled cluster, and correspondingly, the consistency of the data characteristics of the labeled data may not be high. Therefore, the labeled data in the secondary labeled cluster can be further clustered according to their data characteristics to obtain a second cluster, thereby improving the consistency of the data characteristics of the labeled data in the second cluster.

[0131] If the number of labeled data points in the second-level labeled cluster is not greater than the second specified number, it indicates that the number of labeled data points in the second-level labeled cluster is relatively small, and correspondingly, the consistency of the data characteristics of the labeled data is also relatively high. Therefore, it is not necessary to cluster the labeled data points in the second-level labeled cluster; the second-level labeled cluster can be directly used as the second cluster. The second specified number can be the same as the first specified number. For example, the second specified number can be 30 or 50.

[0132] Based on the above processing, the secondary labeled clusters that need to be clustered and those that do not can be determined according to the second specified number. This improves the consistency of data features of the labeled data in the second cluster while reducing the number of clustering operations, thus saving computational resources. Consequently, it improves the accuracy of the obtained second predicted labels and the efficiency of determining the second predicted labels. Furthermore, it improves the accuracy of the final labels of the labeled data, further ensuring the generation of valid labels for the labeled data and improving the efficiency of label generation.

[0133] In the clustering process described above, a data label contains the probability that the data belongs to each preset category; that is, a label contains multiple probabilities, and the number of probabilities is the same as the number of preset categories. When clustering labeled data based on ground truth labels, labeled data with the same ground truth labels can be grouped into the same cluster. Labeled data with the same ground truth labels belong to the same preset category, so labeled data in the same preset category can also be grouped into the same cluster. When clustering unlabeled data based on the first predicted label, unlabeled data in the same preset category represented by the first predicted label can be grouped into the same cluster. Among the first predicted labels of an unlabeled data point, the preset category with the highest probability value is the preset category represented by that first predicted label.

[0134] Clustering algorithms can be used to cluster unlabeled data based on its characteristics, resulting in multiple clusters. This allows unlabeled data with similar characteristics to be grouped into the same cluster. Examples of clustering algorithms include K-Means, mean-shift clustering, and DBSCAN (a density-based clustering method). The process of clustering labeled data based on its characteristics can be referenced in relation to the process of clustering unlabeled data based on its characteristics.

[0135] In one embodiment, see Figure 2 , Figure 2 This is a schematic diagram illustrating a clustering result provided in an embodiment of this application. If Figure 2 The sample data in the table represents unlabeled data. C1, C2, ..., Cn are the first-level clusters obtained by clustering the sample data (i.e., the first-level unlabeled clusters in the above embodiments). C1.1 and C1.2 are the second-level clusters of C1 (i.e., the second-level unlabeled clusters in the above embodiments), C2.1 and C2.2 are the second-level clusters of C2, and Cn.1, Cn.2 and Cn.3 are the second-level clusters of Cn. C1.1.1, C1.1.2 and C1.1.3 are the third-level clusters of C1.1 (i.e., the first clusters in the above embodiments), C1.2.1 is the third-level cluster of C1.2, C2.1.1 is the third-level cluster of C2.1, and C2.2.1 and C2.2.2 are the third-level clusters of C2.2.

[0136] like Figure 2 The sample data in the above example represents labeled data. The first-level cluster is the first-level labeled cluster in the above example, the second-level cluster is the second-level labeled cluster in the above example, and the third-level cluster is the second cluster in the above example.

[0137] In the embodiments of this application, from the first-level cluster to the third-level cluster, the number of sample data in the cluster gradually decreases, and the data characteristics of the sample data in the cluster become more and more similar. That is, it is possible to obtain multi-level clustering results with cluster size from large to small and cluster granularity from coarse to fine, and the data characteristics of the sample data in the third-level cluster have high consistency.

[0138] Regarding step S103, the second clusters with the same truth labels can be defined as a cluster set. Each current cluster set contains at least one second cluster. For each current cluster set, the preset category is the preset category represented by the truth labels of the second clusters contained within that cluster set. For each current first cluster, the feature distance between the unlabeled data features in that first cluster and the labeled data features in the second clusters contained within that current cluster set can be determined.

[0139] The determined feature distance can represent the probability that the first cluster belongs to the preset category corresponding to the cluster set. This also allows us to obtain the probability that the first cluster belongs to the preset category corresponding to each cluster set, i.e., the probability that the first cluster belongs to each preset category. Since the data features of the unlabeled data in the first cluster have high consistency, and the consistency of the first predicted label is also high, the probability that the first cluster belongs to each preset category can be used as the current second predicted label for the unlabeled data in the first cluster.

[0140] For each of the current first clusters, for the current set of clusters, a second cluster can also be selected from the set of clusters. The feature distance between the first cluster and the second cluster is taken as the feature distance between the first cluster and the set of clusters. The selected second cluster can be the one in the set of clusters that has the closest feature distance to the first cluster.

[0141] Alternatively, multiple second clusters can be selected from the set of clusters, and the feature distances between the multiple second clusters and the first cluster can be calculated. Then, by combining the calculated feature distances, the feature distance between the first cluster and the set of clusters can be determined.

[0142] For a first cluster and a second cluster, the feature distance between any unlabeled data point in the first cluster and any labeled data point in the second cluster can be calculated as the feature distance between the first cluster and the second cluster. For example, the feature distance between the cluster centers of the first cluster and the second cluster can be calculated as the feature distance between the first cluster and the second cluster.

[0143] The feature distances involved in the above calculation process can be represented by Euclidean distance, inner product distance, or cosine distance.

[0144] In one implementation, Figure 1 Based on this, see Figure 3 , Figure 3 This is a schematic diagram of a second flowchart of the label generation method provided in an embodiment of this application. Before step S103, the label generation method may further include:

[0145] Step S106: For each current first cluster, calculate the feature distance between the first cluster and each second cluster in each current cluster set to obtain multiple initial feature distances.

[0146] Step S107: Select the first preset number of feature distances from the multiple calculated initial feature distances in ascending order.

[0147] Step S108: Based on the selected preset number of feature distances, obtain the feature distance between the first cluster and the set of clusters.

[0148] In this embodiment, for each first cluster, for a given set of clusters, the feature distance between the first cluster and each second cluster in that set can be calculated to obtain multiple feature distances (i.e., initial feature distances). The data features used to calculate the feature distances are the same data features used during clustering in the above embodiments.

[0149] Then, in ascending order, a preset number of feature distances are selected from multiple initial feature distances. For example, the preset number can be 5 or 10. Based on the selected preset number of feature distances, the feature distance between the first cluster and the set of clusters is obtained.

[0150] Since a larger feature distance between a first cluster and a second cluster corresponds to a lower probability that the first cluster belongs to the preset category of the second cluster, each selected initial feature distance can be preprocessed to make the preprocessed data negatively correlated with the initial feature distance. Consequently, the larger the preprocessed data, the higher the probability that the first cluster belongs to the preset category of the second cluster.

[0151] For example, each selected initial feature distance can be preprocessed using formula (1).

[0152]

[0153] Where Dist_UX represents the preprocessed data obtained by preprocessing an initial feature distance; e represents the base of the natural logarithm; u represents a first cluster, x represents a second cluster in a set of clusters with a preset category, dist(u,x) represents the feature distance between the first cluster and a second cluster in the set of clusters; T represents a constant coefficient, for example, the constant coefficient can be any constant between 1 and 100.

[0154] Furthermore, the sum of the preprocessing results corresponding to each selected initial feature distance can be calculated as the feature distance between the first cluster and the cluster set. Correspondingly, the larger the feature distance between the first cluster and the cluster set, the greater the probability that the first cluster belongs to the preset category of the cluster set. That is, the feature distance between the first cluster and a cluster set is positively correlated with the probability that the first cluster belongs to the preset category of the cluster set.

[0155] Based on the above processing, for each current first cluster, the feature distance between the first cluster and each current set of second clusters can be obtained according to the feature distance between the first cluster and each current set of second clusters. Furthermore, the probability of the first cluster belonging to each preset category can be obtained based on the feature distance between the first cluster and each current set of second clusters, serving as the second predicted label for the unlabeled data in the first cluster. This ensures that a valid second predicted label can be obtained, further guaranteeing the generation of valid labels for labeled data.

[0156] In one embodiment, step S103 includes: for each current first cluster, normalizing the feature distance between the first cluster and the current set of clusters to obtain the probability that the first cluster belongs to each preset category, which is used as the current second predicted label for the unlabeled data in the first cluster.

[0157] In this embodiment, since the feature distance between the first cluster and a set of clusters is positively correlated with the probability that the first cluster belongs to a preset category of the set of clusters, the feature distance between the first cluster and the current sets of clusters can be normalized. The normalized result can be used as the probability that the first cluster belongs to each preset category, and as the second predicted label for the unlabeled data in the first cluster. Thus, the second predicted label for the unlabeled data in the first cluster is obtained, ensuring the validity of the obtained second predicted label, further ensuring the generation of valid labels for labeled data, and improving the efficiency of label generation.

[0158] In one implementation, the feature distance between the first cluster and the current set of clusters can be normalized using formula (2).

[0159] U2 prob =norm[topk(Dist_UX1), topk(Dist_UX2),..., topk(Dist_UX i (2)

[0160] Among them, U2 prob This represents the probability that the first cluster belongs to each preset category, i.e., the second predicted label of the unlabeled data in the first cluster; norm[...] indicates that the values ​​within the parentheses are normalized; for the cluster set of the i-th preset category, calculate the initial feature distances corresponding to the cluster set, and then, in ascending order, select the first k (i.e., the preset number in the above embodiment) initial feature distances from the calculated initial feature distances, and preprocess each selected initial feature distance, and calculate the sum of the preprocessing results to obtain topk(Dist_UX). i ).

[0161] For step S104, for each unlabeled data point, the first predicted label and the current second predicted label of the unlabeled data point can be fused according to a preset weight to obtain the current fused label of the unlabeled data point. For example, the first predicted label and the current second predicted label of the unlabeled data point can be fused according to formula (3).

[0162] U mix = a*U1+b*U2 (3)

[0163] Among them, U mixU1 represents the current fused label of the unlabeled data; U2 represents the current second predicted label of the unlabeled data; a and b represent preset weights, for example, a is 0.5 and b is 0.5; or a is 0.4 and b is 0.6.

[0164] In one implementation of step S105, the current fusion label of each unlabeled data can be used as the final label of each unlabeled data.

[0165] In another implementation, the current fusion labels of each unlabeled data point can be updated to obtain the final labels for each unlabeled data point. The specific update method can be found in the description of subsequent embodiments.

[0166] In one embodiment, step S105 includes:

[0167] Step 1: For each current first cluster, if the first cluster meets the preset filtering conditions, then based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, determine the final label of each unlabeled data in the first cluster, and use the final label of each unlabeled data in the first cluster as the truth label to obtain a new second cluster, and return to execute step S103 until there are no more first clusters that meet the preset filtering conditions.

[0168] Among them, the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than the first threshold, and the proportion of dominant unlabeled data in the cluster to which the first cluster belongs is greater than the second threshold; the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

[0169] In one implementation, the first threshold is greater than the second threshold. Since the first-level and second-level unlabeled clusters contain a large number of unlabeled data points, the consistency of data characteristics among the unlabeled data in the first-level and second-level unlabeled clusters may not be high. If the second threshold is set too high, anchor clusters may not be able to be filtered out.

[0170] Since the first cluster contains a smaller number of unlabeled data points, the data consistency of the unlabeled data in the first cluster is also higher. If the first threshold is set too low, the effectiveness of the selected anchor clusters may not be guaranteed. Accordingly, the first threshold set for the first cluster can be higher than the second threshold set for the first-level and second-level unlabeled clusters. In this way, the effectiveness of the selected anchor clusters is guaranteed while ensuring their selection.

[0171] In the embodiments of this application, if the unlabeled data are clustered to obtain a first-level unlabeled cluster, and then the first-level unlabeled cluster is clustered to obtain a second-level unlabeled cluster, and the obtained second-level unlabeled cluster is directly used as the first cluster, then for a first cluster, the cluster to which the first cluster belongs is a first-level unlabeled cluster.

[0172] If we cluster each unlabeled data to obtain a first-level unlabeled cluster, then we cluster the first-level unlabeled cluster to obtain a second-level unlabeled cluster, and then we cluster the second-level unlabeled cluster to obtain a new cluster as the first cluster, then for a first cluster, the cluster to which the first cluster belongs includes: a second-level unlabeled cluster, and the first-level unlabeled cluster to which the second-level unlabeled cluster belongs.

[0173] If the first cluster belongs to only one first-level unlabeled cluster, then the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than a first threshold, and the proportion of dominant unlabeled data in the first-level unlabeled cluster to which the first cluster belongs is greater than a second threshold. For example, the first threshold can be 0.75, and correspondingly, the second threshold can be 0.6 or 0.75; the first threshold can also be 0.8, and correspondingly, the second threshold can be 0.7 or 0.65.

[0174] If the first cluster belongs to one first-level unlabeled cluster and one second-level unlabeled cluster, then the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than a first threshold, the proportion of dominant unlabeled data in the second-level unlabeled cluster to which the first cluster belongs is greater than a second threshold corresponding to the second-level unlabeled cluster, and the proportion of dominant unlabeled data in the first-level unlabeled cluster to which the second-level unlabeled cluster belongs is greater than the second threshold corresponding to the first-level unlabeled cluster. The second threshold corresponding to the second-level unlabeled cluster is greater than the second threshold corresponding to the first-level unlabeled cluster. For example, the first threshold can be 0.7, and correspondingly, the second threshold corresponding to the second-level unlabeled cluster can be 0.6, and the second threshold corresponding to the first-level unlabeled cluster can be 0.55; the first threshold can also be 0.85, and correspondingly, the second threshold corresponding to the second-level unlabeled cluster can be 0.75, and the second threshold corresponding to the first-level unlabeled cluster can be 0.65.

[0175] For each unlabeled data point, its current fused label represents the probability that the data point belongs to each preset category. The preset category with the highest probability can be determined as the preset category to which the unlabeled data point belongs. Furthermore, for a cluster, the unlabeled data points can be divided into multiple data groups according to the preset categories to which each unlabeled data point in the cluster belongs, with each data group corresponding to a preset category. The data group containing the most unlabeled data points is then determined as the target data group, and the preset category corresponding to the target data group can be called the dominant category of the cluster. The first cluster that meets the preset filtering conditions can be called the anchor cluster. The process of determining the anchor cluster in step one can be called anchor cluster filtering.

[0176] If the first cluster meets the preset screening criteria—that is, the proportion of dominant unlabeled data in the first cluster and its constituent clusters is relatively large—it indicates that the accuracy of the current fused labels of the unlabeled data in the first cluster is high. Therefore, based on the preset category represented by the current fused labels of the dominant unlabeled data in the first cluster, the final label of each unlabeled data in the first cluster can be determined, and a new second cluster can be obtained using the final label of each unlabeled data in the first cluster as the truth label. For example, the preset category represented by the current fused labels of the dominant unlabeled data in the first cluster can be called the target preset category. Correspondingly, the probability corresponding to the target preset category in the current fused label of each unlabeled data in the first cluster can be updated to 1, and the probabilities corresponding to other preset categories besides the target preset category can be updated to 0, to obtain the final label of each unlabeled data in the first cluster.

[0177] At this point, since both the first and second clusters have been updated, we can return to step S103 to recalculate the second predicted label for each first cluster. This allows us to obtain the latest second predicted label based on the updated first and second clusters, avoiding situations where the second predicted label is inaccurate due to the large distance between the first cluster and the cluster sets corresponding to each preset category. The latest second predicted label is then fused with the first predicted label to obtain the latest fused label for the unlabeled data. This process continues until no first cluster meets the preset screening conditions. At this point, the final label for each unlabeled data in the first cluster is determined based on the preset category represented by the latest fused label of the dominant unlabeled data in that first cluster. This iterative adjustment of the fused labels for unlabeled data continuously improves the accuracy of the fused labels, thereby improving the accuracy of the final labels for the unlabeled data and ensuring the generation of valid labels for the unlabeled data.

[0178] Figure 4aThis is a schematic diagram illustrating an embodiment of the present application where the tag is not updated via anchor cluster. Figure 4b This is a schematic diagram illustrating an embodiment of updating tags using anchor clusters. Figure 4a and Figure 4b In the diagram, the dashed lines represent the first cluster, and the solid lines represent the second cluster.

[0179] like Figure 4a As shown, for the first cluster A, since the distance between the first cluster A and each of the second clusters is relatively large, only the closer second cluster C can be selected. Based on the preset category to which the second cluster C belongs, the probability (i.e., the second predicted label) of the unlabeled data in the first cluster A belonging to each preset category is determined, leading to inaccurate second predicted labels. For example... Figure 4b As shown, if the first cluster B meets the preset screening conditions, then based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster B, the final label of each unlabeled data in the first cluster B is determined, and a new second cluster B1 is obtained by using the final label of each unlabeled data in the first cluster B as the truth label. At this time, the distance between the first cluster and the second cluster B1 is relatively small. Therefore, the second predicted label of the unlabeled data in the first cluster A can be re-determined based on the second cluster B1, and the new second predicted label is fused with the first predicted label to obtain the latest fusion label of the unlabeled data. In this way, the label of the first cluster can be updated through the anchor cluster.

[0180] See Figure 5 , Figure 5 This is a schematic diagram of anchor cluster filtering provided in an embodiment of this application. C1 is a primary cluster, C1.1 and C1.2 are secondary clusters of C1, and C1.1.1, C1.1.2, and C1.1.3 are tertiary clusters of C1.1. If the proportion of dominant unlabeled data in C1.1.3 is greater than a first threshold, the proportion of dominant unlabeled data in C1.1 is greater than a second threshold corresponding to a secondary unlabeled cluster, and the proportion of dominant unlabeled data in C1 is greater than a second threshold corresponding to a primary unlabeled cluster, then C1.1.3 can be determined as an anchor cluster.

[0181] In one embodiment, after step S104, the method further includes:

[0182] Step 2: For each current first cluster, if the proportion of dominant unlabeled data in the first cluster is greater than the third threshold, then update the current fusion label of the other unlabeled data in the first cluster (excluding the dominant unlabeled data) to the current fusion label of the dominant unlabeled data.

[0183] In this embodiment, step two can be referred to as label correction. After obtaining the current fused labels of each unlabeled data point, the first cluster is first corrected. Then, based on the corrected first cluster, it is determined whether the first cluster meets the preset filtering conditions. If a first cluster meets the preset filtering conditions, the fused label of each unlabeled data point in the first cluster is determined as the final label, and the final label of each unlabeled data point in the first cluster is used as the truth label to obtain a new second cluster. This updates the first and second clusters, and the process returns to step S103 until no first cluster meets the preset filtering conditions.

[0184] For each current first cluster, if the proportion of dominant unlabeled data in that first cluster is greater than the third threshold, it indicates that there are a large number of unlabeled data belonging to the dominant category in that first cluster. Since the data characteristics of the unlabeled data in the first cluster are highly consistent, if the number of unlabeled data belonging to the dominant category in a first cluster exceeds the third threshold, it can be considered that all the unlabeled data in that first cluster belongs to the dominant category. The fusion labels of the unlabeled data that do not belong to the dominant category in that first cluster are not accurate enough and need to be corrected. Therefore, the fusion labels of the other unlabeled data in that first cluster, excluding the dominant unlabeled data, can be updated to the fusion labels of the dominant unlabeled data. Furthermore, to avoid label correction affecting anchor cluster selection, the third threshold can be set to be greater than the first threshold. For example, the third threshold can be 0.85 or 0.9.

[0185] Based on the above processing, the inaccurate fusion labels of the unlabeled data in the first cluster can be corrected, thereby improving the accuracy of the final labels of the unlabeled data and further ensuring that valid labels can be generated for the unlabeled data.

[0186] In one embodiment, Figure 6a This is a schematic diagram of the first cluster M that does not require label correction, as provided in the embodiments of this application. Figure 6b This is a schematic diagram of the first cluster N that requires label correction, provided in an embodiment of this application. Figure 6cThis is a schematic diagram of the first cluster N1 obtained after label correction of the first cluster N according to an embodiment of this application. An ellipse represents a first cluster, and circles, triangles, and squares represent unlabeled data with different fusion labels within a first cluster. For the first cluster M, the dominant unlabeled data is represented by circles, and its proportion is no greater than the third threshold; therefore, no label correction is performed on the first cluster M. For the first cluster N, the dominant unlabeled data is represented by circles, and its proportion is greater than the third threshold. Therefore, the fusion labels of the other unlabeled data in the first cluster N besides the dominant unlabeled data can be updated to the current fusion label of the dominant unlabeled data, resulting in the first cluster N1.

[0187] It is understood that, based on the solution provided in the embodiments of this application, after determining the current fusion label of each unlabeled data, the label of the first cluster can be corrected firstly. Then, based on the corrected first cluster, it can be determined whether the first cluster meets the preset screening conditions. If a first cluster meets the preset screening conditions, the fusion label of each unlabeled data in the first cluster is determined as the final label, and the final label of each unlabeled data in the first cluster is used as the truth label to obtain a new second cluster, thereby updating the first cluster and the second cluster, and returning to step S103 until there is no first cluster that meets the preset screening conditions.

[0188] Alternatively, after determining the current fusion label of each unlabeled data, first determine whether the first cluster meets the preset filtering conditions. If a first cluster meets the preset filtering conditions, then the first cluster is determined as the anchor cluster. Then, the labels of the first cluster and the determined anchor cluster are corrected, and the fusion label of each unlabeled data in the corrected anchor cluster is taken as the final label. The final label of each unlabeled data in the first cluster is taken as the truth label to obtain a new second cluster. The first cluster and the second cluster are updated, and the process returns to step S103 until there is no first cluster that meets the preset filtering conditions.

[0189] Alternatively, after determining the current fusion label of each unlabeled data, it is possible to determine only whether the first cluster meets the preset filtering conditions. If a first cluster meets the preset filtering conditions, the final label of each unlabeled data in the first cluster is determined based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster. The final label of each unlabeled data in the first cluster is used as the truth label to obtain a new second cluster, thereby updating the first cluster and the second cluster, and returning to step S103 until there are no first clusters that meet the preset filtering conditions.

[0190] Alternatively, after determining the current fusion label of each unlabeled data, the label can be corrected only for the first cluster, and the fusion label of the unlabeled data in the first cluster after label correction can be used as the final label of the unlabeled data.

[0191] In one embodiment, see Figure 7 , Figure 7 This is a schematic diagram of a third process for the label generation method provided in an embodiment of this application. The method includes:

[0192] Step S701: Obtain the target domain dataset U. The data contained in the target domain dataset U is the unlabeled data in the above embodiment.

[0193] Step S702: Input each unlabeled data point in the target domain dataset U into the source domain model to generate a pseudo-label U1. That is, step S101 in the above embodiment. The pseudo-label data U1 is the first predicted label for each unlabeled data point. The source domain model is trained based on the labeled data in the source domain dataset X.

[0194] Step S703: Obtain the source domain dataset X.

[0195] Step S704: Extract features of U and X and cluster them separately. That is, extract the data features of labeled data in the source domain dataset X and the data features of unlabeled data in the target domain dataset U, and perform step S102 in the above embodiment.

[0196] Step S705: Generate a pseudo-label U2 based on the UX distance, that is, execute step S103 in the above embodiment. The pseudo-label U2 is the second predicted label for each unlabeled data.

[0197] Step S706: Tag fusion, that is, performing step S104 in the above embodiment.

[0198] Step S707: Anchor cluster generation. The anchor cluster is then added to the X cluster, and the process returns to step S705. That is, step one of the above embodiments is executed. The anchor cluster is the first cluster that meets the preset screening conditions in the above embodiments, and the X cluster is the second cluster.

[0199] Step S708: Determine the pseudo-label U3 for the target domain dataset. That is, if no first cluster meets the preset screening criteria, based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, determine the final label of each unlabeled data in the first cluster as the pseudo-label U3 for the target domain dataset. The pseudo-label U3 for the target domain dataset is the final label of the unlabeled data.

[0200] In this embodiment, anchor clusters can be used to achieve self-iterative updating of labels for unlabeled data, eliminating the need for manual intervention in the label generation process and reducing labor costs. Furthermore, by determining anchor clusters through a selection process and using iterative updates of these clusters to merge labels, the merged labels of the unlabeled data can be progressively propagated and corrected, improving the quality of the generated labels. Additionally, the label generation method provided in this embodiment does not require dividing the unlabeled data into multiple groups and generating labels for each group, nor does it require training the source domain model for each iteration to generate new merged labels. Training the source domain model only requires using the final labels of the unlabeled data, reducing model training time and making it more compatible with models deployed on devices.

[0201] In one embodiment, see Figure 8 , Figure 8 A flowchart illustrating the application process of the label generation method provided in this application embodiment. It includes:

[0202] Step S801: Obtain the unlabeled target domain dataset. That is, obtain the unlabeled data in the target domain dataset for which labels are to be generated.

[0203] Step S802: Pseudo-tag generation. That is, using the tag generation method provided in the embodiments of this application, tags without tag data are generated.

[0204] Step S803: Train the source domain model. That is, after generating labels for the unlabeled data, the source domain model is further trained using the unlabeled data and the labels for the unlabeled data.

[0205] Step S804: Test the unlabeled target domain dataset. That is, test the ability of the trained source domain model to process data in the unlabeled target region dataset.

[0206] In this embodiment of the application, the model can be trained by combining labels that can generate unlabeled data, that is, by generating pseudo-labels for unlabeled data, and combining the labels of labeled data and unlabeled data, thereby improving the performance of the model in processing sample data in the target domain dataset.

[0207] Based on the same inventive concept, this application also provides a label generation device, see [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram of a label generation device provided in an embodiment of this application. The device includes:

[0208] The first label acquisition module 901 is used to input the unlabeled data into the model trained based on each labeled data for each unlabeled data to be labeled, and obtain the probability that the unlabeled data belongs to each preset category, which is used as the first predicted label of the unlabeled data.

[0209] Clustering module 902 is used to cluster each unlabeled data based on the data features and the first predicted label to obtain multiple clusters as the first cluster, and to cluster each labeled data based on the data features and the ground truth label to obtain multiple clusters as the second cluster; wherein, the ground truth label of a labeled data is used to indicate the preset category to which the labeled data belongs;

[0210] The second label acquisition module 903, for each current first cluster, obtains the probability that the first cluster belongs to each preset category based on the feature distance between the first cluster and each current cluster set, and uses it as the current second predicted label for the unlabeled data in the first cluster; wherein, the current cluster set contains the second cluster that is consistent with the current ground truth label;

[0211] The label fusion module 904 is used to fuse the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data point.

[0212] The label determination module 905 is used to obtain the final label of each unlabeled data based on the current fused label of each unlabeled data.

[0213] In one embodiment, the clustering module 902 includes:

[0214] The first clustering submodule is used to cluster the unlabeled data according to the data characteristics of each unlabeled data to obtain multiple clusters, which serve as first-level unlabeled clusters.

[0215] The second clustering submodule is used to cluster the unlabeled data in each first-level unlabeled cluster according to the first predicted label of each unlabeled data in the first-level unlabeled cluster, so as to obtain the first cluster.

[0216] In one embodiment, the second clustering submodule is specifically used to, for each first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster according to the first predicted label of each unlabeled data in the first-level unlabeled cluster to obtain multiple clusters, which serve as second-level unlabeled clusters of the first-level unlabeled cluster; for each second-level unlabeled cluster, if the number of unlabeled data in the second-level unlabeled cluster is greater than a first specified number, then cluster the unlabeled data in the second-level unlabeled cluster according to the data characteristics of each unlabeled data in the second-level unlabeled cluster to obtain multiple clusters, which serve as first clusters.

[0217] In one embodiment, the label determination module 905 is specifically used to, for each current first cluster, if the first cluster meets the preset screening conditions, determine the final label of each unlabeled data in the first cluster based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, and use the final label of each unlabeled data in the first cluster as the truth label to obtain a new second cluster, and return to execute the step of, for each current first cluster, obtaining the probability of the first cluster belonging to each preset category based on the feature distance between the first cluster and each current cluster set, as the second predicted label of the unlabeled data in the first cluster, until there are no first clusters that meet the preset screening conditions;

[0218] Among them, the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than the first threshold, and the proportion of dominant unlabeled data in the cluster to which the first cluster belongs is greater than the second threshold; the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

[0219] In one embodiment, the apparatus further includes:

[0220] The first update module is used to, after fusing the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data, update the current fused label of the other unlabeled data points in the first cluster (excluding the dominant unlabeled data) to the current fused label of the dominant unlabeled data for each first cluster; wherein the third threshold is less than the first threshold.

[0221] In one embodiment, the first threshold is greater than the second threshold.

[0222] In one embodiment, the clustering module 902 includes:

[0223] The third clustering submodule is used to cluster the labeled data according to the truth labels of the labeled data to obtain multiple clusters, which serve as first-level labeled clusters.

[0224] The fourth clustering submodule is used to cluster the labeled data in each first-level labeled cluster according to the data characteristics of the labeled data in that first-level labeled cluster, and obtain a second cluster.

[0225] In one embodiment, the fourth clustering submodule is specifically used to, for each first-level labeled cluster, cluster the labeled data in the first-level labeled cluster according to the data characteristics of the labeled data in the first-level labeled cluster to obtain multiple clusters, which serve as second-level labeled clusters of the first-level labeled cluster; for each second-level labeled cluster, if the number of labeled data in the second-level labeled cluster is greater than a second specified number, then, based on the data characteristics of the labeled data in the second-level labeled cluster, cluster the labeled data in the second-level labeled cluster to obtain multiple clusters, which serve as second clusters.

[0226] In one embodiment, the apparatus further includes:

[0227] The feature distance calculation module is used to calculate the feature distance between each first cluster and each second cluster in each current cluster set before, for each current first cluster, obtaining the probability that the first cluster belongs to each preset category based on the feature distance between the first cluster and each current cluster set, and using it as the current second predicted label for the unlabeled data in the first cluster, to obtain multiple initial feature distances;

[0228] The feature distance selection module is used to select the first preset number of feature distances from multiple calculated initial feature distances in ascending order;

[0229] The feature distance determination module is used to obtain the feature distance between the first cluster and the set of clusters based on a preset number of selected feature distances.

[0230] In one embodiment, the apparatus further includes:

[0231] The second update module is used to, after fusing the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data, for each first cluster, if the proportion of the dominant unlabeled data in the first cluster is greater than a fourth threshold, update the current fused label of the other unlabeled data in the first cluster (excluding the dominant unlabeled data) to the current fused label of the dominant unlabeled data; wherein, the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fused label, the target data group contains the largest number of unlabeled data points.

[0232] In one embodiment, the unlabeled data and the labeled data are images, and the data features are the visual features of the images.

[0233] This application also provides an electronic device, such as... Figure 10 As shown, it includes:

[0234] Memory 1001 is used to store computer programs;

[0235] When processor 1002 executes a program stored in memory 1001, it performs the following steps:

[0236] For each unlabeled data point to be labeled, the unlabeled data point is input into the model trained based on each labeled data point to obtain the probability that the unlabeled data point belongs to each preset category, which is used as the first predicted label for the unlabeled data point.

[0237] Based on the data features and first predicted labels of each unlabeled data, multiple clusters are obtained by clustering each unlabeled data, which serve as the first cluster. Based on the data features and ground truth labels of each labeled data, multiple clusters are obtained by clustering each labeled data, which serve as the second cluster. The ground truth label of a labeled data is used to indicate the preset category to which the labeled data belongs.

[0238] For each current first cluster, based on the feature distance between the first cluster and each current cluster set, the probability that the first cluster belongs to each preset category is obtained, which is used as the current second predicted label for the unlabeled data in the first cluster; wherein, a current cluster set contains a second cluster that is consistent with the current ground truth label;

[0239] For each unlabeled data point, the first predicted label of the unlabeled data point and the current second predicted label are fused to obtain the current fused label of the unlabeled data point.

[0240] Based on the current fused labels of each unlabeled data point, the final labels of each unlabeled data point are obtained.

[0241] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1002, the communication interface, and the memory 1001 communicating with each other via the communication bus.

[0242] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0243] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0244] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0245] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0246] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described tag generation methods.

[0247] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the label generation methods described above.

[0248] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.

[0249] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0250] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0251] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A label generation method, characterized in that, The method includes: For each unlabeled data point to be labeled, the unlabeled data point is input into a model trained based on each labeled data point to obtain the probability that the unlabeled data point belongs to each preset category, which is used as the first predicted label for the unlabeled data point; wherein, the labeled data and unlabeled data are speech or images; the model is an object detection model or an object classification model; Based on the data features and first predicted labels of each unlabeled data point, multiple clusters are obtained by clustering the unlabeled data points, which serve as the first cluster. Similarly, based on the data features and ground truth labels of each labeled data point, multiple clusters are obtained by clustering the labeled data points, which serve as the second cluster. The ground truth label of a labeled data point represents the preset category to which the labeled data point belongs. When both labeled and unlabeled data are speech, the data features are spectral features; when both labeled and unlabeled data are images, the data features are the semantic features of the image. For each current first cluster, based on the feature distance between the first cluster and each current cluster set, the probability that the first cluster belongs to each preset category is obtained, which is used as the current second predicted label for the unlabeled data in the first cluster; wherein, a current cluster set contains a second cluster that is consistent with the current ground truth label; For each unlabeled data point, the first predicted label and the current second predicted label of the unlabeled data point are fused according to preset weights to obtain the current fused label of the unlabeled data point. For each current first cluster, if the proportion of dominant unlabeled data in the first cluster is greater than the fourth threshold, then the current fusion label of the other unlabeled data in the first cluster (excluding the dominant unlabeled data) is updated to the current fusion label of the dominant unlabeled data. Among these, the dominant unlabeled data in a cluster belongs to the target data group. Among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data. Based on the current fused labels of each unlabeled data point, the final labels of each unlabeled data point are obtained; wherein, the final labels of each unlabeled data point and each unlabeled data point are used to train the model.

2. The method according to claim 1, characterized in that, Based on the data features and the first predicted label of each unlabeled data point, multiple clusters are obtained by clustering the unlabeled data points, with the first cluster being: Based on the data characteristics of each unlabeled data, multiple clusters are obtained by clustering each unlabeled data, which serve as the first-level unlabeled clusters. For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, cluster the unlabeled data in the first-level unlabeled cluster to obtain the first cluster.

3. The method according to claim 2, characterized in that, For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in that first-level unlabeled cluster, clustering is performed on each unlabeled data in that first-level unlabeled cluster to obtain a first cluster, including: For each first-level unlabeled cluster, based on the first predicted label of each unlabeled data in the first-level unlabeled cluster, the unlabeled data in the first-level unlabeled cluster are clustered to obtain multiple clusters, which are used as the second-level unlabeled clusters of the first-level unlabeled cluster. For each second-level unlabeled cluster, if the number of unlabeled data in the second-level unlabeled cluster is greater than the first specified number, then based on the data characteristics of each unlabeled data in the second-level unlabeled cluster, the unlabeled data in the second-level unlabeled cluster are clustered to obtain multiple clusters, which are used as the first cluster.

4. The method according to claim 2, characterized in that, The process of obtaining the final label for each unlabeled data point based on its current fused label includes: For each current first cluster, if the first cluster meets the preset screening conditions, then based on the preset category represented by the current fusion label of the dominant unlabeled data in the first cluster, the final label of each unlabeled data in the first cluster is determined, and a new second cluster is obtained by taking the final label of each unlabeled data in the first cluster as the truth label. Then, the process of performing the step of obtaining the probability of the first cluster belonging to each preset category based on the feature distance between the first cluster and each current cluster set for each current first cluster, and using it as the second predicted label of the unlabeled data in the first cluster, is repeated until there are no more first clusters that meet the preset screening conditions. Among them, the proportion of dominant unlabeled data in the first cluster that meets the preset screening conditions is greater than the first threshold, and the proportion of dominant unlabeled data in the cluster to which the first cluster belongs is greater than the second threshold; the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fusion label, the target data group contains the largest number of unlabeled data.

5. The method according to claim 4, characterized in that, After fusing the first predicted label and the current second predicted label for each current unlabeled data point to obtain the current fused label for that unlabeled data, the method further includes: For each current first cluster, if the proportion of dominant unlabeled data in the first cluster is greater than the third threshold, then the current fusion label of the other unlabeled data in the first cluster, excluding the dominant unlabeled data, is updated to the current fusion label of the dominant unlabeled data; wherein, the third threshold is less than the first threshold.

6. The method according to claim 4, characterized in that, The first threshold is greater than the second threshold.

7. The method according to claim 1, characterized in that, Based on the data features and ground truth labels of the labeled data, the labeled data is clustered to obtain multiple clusters, which serve as the second cluster, including: Based on the truth labels of the labeled data, the labeled data are clustered to obtain multiple clusters, which serve as first-level labeled clusters. For each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, the labeled data in that first-level labeled cluster are clustered to obtain a second cluster.

8. The method according to claim 7, characterized in that, For each first-level labeled cluster, based on the data characteristics of the labeled data in that first-level labeled cluster, the labeled data in that first-level labeled cluster are clustered to obtain a second cluster, including: For each first-level labeled cluster, based on the data characteristics of each labeled data in the first-level labeled cluster, the labeled data in the first-level labeled cluster are clustered to obtain multiple clusters, which serve as the second-level labeled clusters of the first-level labeled cluster; For each secondary labeled cluster, if the number of labeled data in the secondary labeled cluster is greater than the second specified number, then based on the data characteristics of each labeled data in the secondary labeled cluster, multiple clusters are obtained by clustering the labeled data in the secondary labeled cluster, which are then used as the second cluster.

9. The method according to claim 1, characterized in that, Before determining the probability that a first cluster belongs to each preset category based on the feature distance between the first cluster and each current set of clusters, and using this probability as the second predicted label for the unlabeled data in the first cluster, the method further includes: For each current first cluster, calculate the feature distance between the first cluster and each second cluster in each current cluster set to obtain multiple initial feature distances; Select the first preset number of feature distances from the multiple calculated initial feature distances in ascending order; Based on the selected preset number of feature distances, the feature distance between the first cluster and the set of clusters is obtained.

10. A label generating apparatus, characterized in that, The device includes: The first label acquisition module is used to input each unlabeled data point to be labeled into a model trained based on each labeled data point, and obtain the probability that the unlabeled data point belongs to each preset category, which is then used as the first predicted label for the unlabeled data point; wherein, the labeled data and the unlabeled data point are speech or images; and the model is an object detection model or an object classification model. The clustering module is used to cluster the unlabeled data into multiple clusters based on the data features and first predicted labels of each unlabeled data, serving as the first cluster cluster; and to cluster the labeled data into multiple clusters based on the data features and ground truth labels of each labeled data, serving as the second cluster cluster; wherein, the ground truth label of a labeled data is used to represent the preset category to which the labeled data belongs; when the labeled and unlabeled data are speech, the data features are spectral features; when the labeled and unlabeled data are images, the data features are semantic features of the image; The second label acquisition module, for each current first cluster, obtains the probability that the first cluster belongs to each preset category based on the feature distance between the first cluster and each current cluster set, and uses it as the current second predicted label for the unlabeled data in the first cluster; wherein, the current cluster set contains the second cluster that is consistent with the current ground truth label; The label fusion module is used to fuse the first predicted label and the current second predicted label of each unlabeled data point according to a preset weight, so as to obtain the current fused label of the unlabeled data. The second update module is used to, after fusing the first predicted label and the current second predicted label of each unlabeled data point to obtain the current fused label of the unlabeled data, for each first cluster, if the proportion of the dominant unlabeled data in the first cluster is greater than a fourth threshold, then update the current fused label of the other unlabeled data in the first cluster (excluding the dominant unlabeled data) to the current fused label of the dominant unlabeled data; wherein, the dominant unlabeled data in a cluster belongs to the target data group; among the data groups obtained by grouping the unlabeled data in the cluster according to the current fused label, the target data group contains the largest number of unlabeled data points; The label determination module is used to obtain the final label of each unlabeled data based on the current fused label of each unlabeled data; wherein the final label of each unlabeled data and each unlabeled data are used to train the model.

11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-9.

Citation Information

Patent Citations

  • Data processing method, device and equipment

    CN113705648A

  • Self-adaptive semi-supervised deep clustering method

    CN115937560A